Skip to content

Commit

Permalink
feat(internal): Improve script running
Browse files Browse the repository at this point in the history
Add `npm-run-all` package to run scripts in a more ergonomic way
Use `run-s` to run all test scripts in the main repo
Use `run-s` to run all build scripts in the tests and examples
directories
  • Loading branch information
petarvujovic98 committed Oct 12, 2022
1 parent 8f676ae commit bf0c358
Show file tree
Hide file tree
Showing 5 changed files with 569 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"postinstall": "cd .. && yarn link && cd examples && yarn link near-sdk-js",
"build": "yarn build:clean-state && yarn build:counter && yarn build:counter-lowlevel && yarn build:counter-ts && yarn build:cross-contract-call && yarn build:fungible-token-lockable && yarn build:fungible-token && yarn build:non-fungible-token && yarn build:status-message-collections && yarn build:status-message && yarn build:parking-lot && yarn build:nested-collections",
"build": "run-s build:*",
"build:status-message": "near-sdk-js build src/status-message.js build/status-message.wasm",
"build:clean-state": "near-sdk-js build src/clean-state.js build/clean-state.wasm",
"build:counter": "near-sdk-js build src/counter.js build/counter.wasm",
Expand Down
122 changes: 118 additions & 4 deletions examples/yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"build": "tsc -p ./tsconfig.json && chmod u+x lib/cli/cli.js",
"pretest": "yarn build",
"test": "yarn test:unit && yarn test:examples",
"test": "run-s test:*",
"lint": "eslint --fix .",
"format": "prettier --write .",
"test:unit": "yarn && cd tests && yarn && yarn build && yarn test && cd ..",
Expand Down Expand Up @@ -66,6 +66,7 @@
"@typescript-eslint/parser": "^5.37.0",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"typescript": "^4.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"postinstall": "cd .. && yarn link && cd tests && yarn link near-sdk-js",
"build": "yarn build:context-api && yarn build:math-api && yarn build:storage-api && yarn build:log-panic-api && yarn build:promise-api && yarn build:promise-batch-api && yarn build:function-params && yarn build:lookup-map && yarn build:lookup-set && yarn build:unordered-map && yarn build:unordered-set && yarn build:vector && yarn build:bytes && yarn build:typescript && yarn build:public-key && yarn build:near-bindgen && yarn build:payable && yarn build:private && yarn build:highlevel-promise && yarn build:bigint-serialization && yarn build:date-serialization",
"build": "run-s build:*",
"build:context-api": "near-sdk-js build src/context_api.js build/context_api.wasm",
"build:math-api": "near-sdk-js build src/math_api.js build/math_api.wasm",
"build:storage-api": "near-sdk-js build src/storage_api.js build/storage_api.wasm",
Expand Down
Loading

0 comments on commit bf0c358

Please sign in to comment.