chore: only build what is necessary to test

Script to build enough to run tests locally and in CI (skip bundling).
This commit is contained in:
fryorcraken.eth 2023-01-30 20:30:31 +11:00
parent afa7262604
commit 3aed340cb2
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 7 additions and 5 deletions

View File

@ -52,7 +52,7 @@ jobs:
with: with:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
- run: npm run build - run: npm run build:esm
- run: npm run test:browser - run: npm run test:browser
node: node:
@ -76,7 +76,7 @@ jobs:
with: with:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
- run: npm run build - run: npm run build:esm
- run: npm run test:node - run: npm run test:node
env: env:
DEBUG: "" DEBUG: ""
@ -130,7 +130,7 @@ jobs:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
- run: npm run build - run: npm run build:esm
- run: npm run test:node - run: npm run test:node
env: env:
DEBUG: "waku:nwaku*,waku:test*" DEBUG: "waku:nwaku*,waku:test*"
@ -184,7 +184,7 @@ jobs:
cd nwaku cd nwaku
./build/wakunode2 --help ./build/wakunode2 --help
- run: npm run build - run: npm run build:esm
- run: npm run test:node - run: npm run test:node
env: env:
DEBUG: "waku:nwaku*,waku:test*" DEBUG: "waku:nwaku*,waku:test*"

View File

@ -18,6 +18,7 @@
"scripts": { "scripts": {
"prepare": "husky install", "prepare": "husky install",
"build": "npm run build --workspaces --if-present", "build": "npm run build --workspaces --if-present",
"build:esm": "npm run build:esm --workspaces --if-present",
"size": "npm run build && size-limit", "size": "npm run build && size-limit",
"fix": "npm run fix --workspaces --if-present", "fix": "npm run fix --workspaces --if-present",
"check": "npm run check --workspaces --if-present", "check": "npm run check --workspaces --if-present",

View File

@ -32,7 +32,8 @@
"privacy" "privacy"
], ],
"scripts": { "scripts": {
"build": "tsc", "build": "run-s build:**",
"build:esm": "tsc",
"fix": "run-s fix:*", "fix": "run-s fix:*",
"fix:prettier": "prettier . --write", "fix:prettier": "prettier . --write",
"fix:lint": "eslint src --ext .ts --ext .cjs --fix", "fix:lint": "eslint src --ext .ts --ext .cjs --fix",