Skip to content

Commit 5f1f58c

Browse files
authored
Merge pull request #23 from Yuripetusko/master
Switch to npmjs registry instead of github registry, as github packages are more suited towards private repos
2 parents 18fc651 + dc49e37 commit 5f1f58c

File tree

4 files changed

+40
-18
lines changed

4 files changed

+40
-18
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ jobs:
2323
with:
2424
node-version: 14
2525
# Specifies the registry, this field is required!
26-
registry-url: https://npm.pkg.github.com/
27-
scope: "@Swader"
26+
registry-url: 'https://registry.npmjs.org'
2827
# clean install of your projects' deps. We use "npm ci" to avoid package lock changes
2928
- run: yarn install
3029
# set up git since we will later push to the repo
@@ -34,9 +33,9 @@ jobs:
3433
# run tests just in case
3534
- run: yarn test
3635
# publish to NPM -> there is one caveat, continue reading for the fix
37-
- run: yarn publish
36+
- run: npm publish
3837
env:
39-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
38+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4039
# push the version changes to GitHub
4140
- run: git push
4241
env:

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Typescript implementation of the [RMRK spec](https://github.com/Swader/rmrk-spec
88

99
> Note: NodeJS 14+ is required. Please install with [NVM](https://nvm.sh).
1010
11-
`yarn install @Swader/rmrk-tools`
11+
`yarn install rmrk-tools`
1212

1313
## Usage
1414

@@ -50,7 +50,33 @@ const fetchAndConsolidate = async () => {
5050
</script>
5151
```
5252

53-
TBD
53+
### CLI
54+
55+
You can use this package as a CLI tool
56+
`npm install --save-dev rmrk-tools@latest`
57+
58+
Now you can use rmrk-tools coomands in your bash or npm scripts:
59+
You can use any of the available [Helper Tools](#helper-tools) by prepending `rmrk-tools-`
60+
61+
```
62+
"scripts": {
63+
"fetch": "rmrk-tools-fetch",
64+
"consolidate": "rmrk-tools-consolidate",
65+
"seed": "rmrk-tools-seed",
66+
"getevents": "rmrk-tools-getevents",
67+
"validate": "rmrk-tools-validate",
68+
"run-listener": "rmrk-tools-run-listener"
69+
},
70+
```
71+
72+
Or in bash scripts
73+
74+
```
75+
#! /usr/bin/env node
76+
var shell = require("shelljs");
77+
78+
shell.exec("rmrk-tools-fetch");
79+
```
5480

5581
## API
5682

package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
{
2-
"name": "@Swader/rmrk-tools",
3-
"version": "0.0.1",
2+
"name": "rmrk-tools",
3+
"version": "0.0.6",
44
"description": "Suite of libraries implementing RMRK.app specs",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/Swader/rmrk-tools"
88
},
9-
"publishConfig": {
10-
"registry": "https://npm.pkg.github.com/"
11-
},
129
"main": "dist/index.cjs",
1310
"module": "./dist/index.es.js",
1411
"types": "./dist/index.d.ts",
@@ -45,12 +42,12 @@
4542
"prepublishOnly": "yarn build"
4643
},
4744
"bin": {
48-
"rmrk-tools:fetch": "dist-cli/cli/fetch.js",
49-
"rmrk-tools:consolidate": "dist-cli/cli/consolidate.js",
50-
"rmrk-tools:seed": "dist-cli/cli/seed.js",
51-
"rmrk-tools:getevents": "dist-cli/cli/getevents.js",
52-
"rmrk-tools:validate": "dist-cli/cli/validate.js",
53-
"rmrk-tools:run-listener": "dist-cli/cli/run-listener.js"
45+
"rmrk-tools-fetch": "dist-cli/cli/fetch.js",
46+
"rmrk-tools-consolidate": "dist-cli/cli/consolidate.js",
47+
"rmrk-tools-seed": "dist-cli/cli/seed.js",
48+
"rmrk-tools-getevents": "dist-cli/cli/getevents.js",
49+
"rmrk-tools-validate": "dist-cli/cli/validate.js",
50+
"rmrk-tools-run-listener": "dist-cli/cli/run-listener.js"
5451
},
5552
"author": "Bruno Skvorc <[email protected]>",
5653
"license": "GPL-3.0",

tsconfig.cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"compilerOptions": {
44
"module":"commonjs",
55
},
6-
"include": ["cli/*.ts"],
6+
"include": ["cli/*.ts", "src/*.ts", "src/**/*.ts"],
77
"files": ["cli/index.ts"]
88
}

0 commit comments

Comments
 (0)