mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 12:26:19 +00:00
Add script to set package versions in codegen (#270)
This commit is contained in:
parent
c5908c4c0e
commit
d0ac2aa895
@ -23,6 +23,7 @@
|
|||||||
"build:watch": "lerna run build --stream --parallel -- -w",
|
"build:watch": "lerna run build --stream --parallel -- -w",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"publish:workspace": "yarn build && lerna publish",
|
"publish:workspace": "yarn build && lerna publish",
|
||||||
"version:set": "lerna version --no-git-tag-version"
|
"version:set": "lerna version --no-git-tag-version",
|
||||||
|
"version:set-codegen": "yarn workspace @cerc-io/codegen version:set"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,36 @@ Steps:
|
|||||||
|
|
||||||
This will create a folder containing the generated code at the path provided in config. Follow the steps in [Run Generated Watcher](#run-generated-watcher) to setup and run the generated watcher.
|
This will create a folder containing the generated code at the path provided in config. Follow the steps in [Run Generated Watcher](#run-generated-watcher) to setup and run the generated watcher.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
* `lint`
|
||||||
|
|
||||||
|
Command to check lint issues in files
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn lint
|
||||||
|
```
|
||||||
|
|
||||||
|
To fix lint issue
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn lint --fix
|
||||||
|
```
|
||||||
|
|
||||||
|
* `version:set`
|
||||||
|
|
||||||
|
Command to set cerc-io package versions in package.json template
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn version:set <VERSION>
|
||||||
|
```
|
||||||
|
|
||||||
|
Example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn version:set 0.2.17
|
||||||
|
```
|
||||||
|
|
||||||
## Run Generated Watcher
|
## Run Generated Watcher
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"codegen": "ts-node src/generate-code.ts"
|
"codegen": "ts-node src/generate-code.ts",
|
||||||
|
"version:set": "./scripts/set-version.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
17
packages/codegen/scripts/set-version.sh
Executable file
17
packages/codegen/scripts/set-version.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check the command line argument value exists or not
|
||||||
|
if [ $1 != "" ]; then
|
||||||
|
|
||||||
|
# Change to script file directory
|
||||||
|
scriptDir=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||||
|
cd "$scriptDir"
|
||||||
|
|
||||||
|
# Set package versions
|
||||||
|
sed -i "s/\"@cerc-io\/cli.*/\"@cerc-io\/cli\": \"^${1}\",/" ../src/templates/package-template.handlebars
|
||||||
|
sed -i "s/\"@cerc-io\/ipld-eth-client.*/\"@cerc-io\/ipld-eth-client\": \"^${1}\",/" ../src/templates/package-template.handlebars
|
||||||
|
sed -i "s/\"@cerc-io\/solidity-mapper.*/\"@cerc-io\/solidity-mapper\": \"^${1}\",/" ../src/templates/package-template.handlebars
|
||||||
|
sed -i "s/\"@cerc-io\/util.*/\"@cerc-io\/util\": \"^${1}\",/" ../src/templates/package-template.handlebars
|
||||||
|
sed -i "s/\"@cerc-io\/graph-node.*/\"@cerc-io\/graph-node\": \"^${1}\",/" ../src/templates/package-template.handlebars
|
||||||
|
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user