Skip to content

Commit

Permalink
organize package scripts (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocrime authored Apr 24, 2024
1 parent 110c29d commit 932f7e8
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compile-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
wasm:
runs-on: buildjet-16vcpu-ubuntu-2204 # buildjet for rust, github standard for everything else
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- id: compiled
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packages-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
publish: pnpm changeset:publish
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 7 additions & 6 deletions .github/workflows/turbo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

turbo-lint:
name: Lint
runs-on: buildjet-4vcpu-ubuntu-2204
runs-on: buildjet-8vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
Expand All @@ -47,12 +47,11 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm format-check
- run: pnpm turbo lint --cache-dir=.turbo

turbo-build:
name: Build
runs-on: buildjet-2vcpu-ubuntu-2204
runs-on: buildjet-4vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
Expand All @@ -73,7 +72,7 @@ jobs:

turbo-test:
name: test
runs-on: buildjet-2vcpu-ubuntu-2204
runs-on: buildjet-4vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
Expand All @@ -90,11 +89,12 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm playwright install --with-deps chromium
- run: pnpm turbo test --cache-dir=.turbo

turbo-lint-rust:
name: lint:rust
runs-on: buildjet-16vcpu-ubuntu-2204
runs-on: buildjet-4vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
Expand All @@ -113,7 +113,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- run: pnpm turbo format-check:rust --cache-dir=.turbo
- run: pnpm turbo telemetry disable
- run: pnpm turbo lint:rust --cache-dir=.turbo

turbo-test-rust:
Expand Down Expand Up @@ -141,4 +141,5 @@ jobs:
with:
version: 'latest'
- uses: browser-actions/setup-firefox@v1
- run: pnpm turbo telemetry disable
- run: pnpm turbo test:rust --cache-dir=.turbo
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@
"repository": "penumbra-zone/web.git",
"packageManager": "[email protected]",
"scripts": {
"all-check": "pnpm clean && pnpm install && pnpm compile && pnpm format-check && pnpm lint && pnpm test && pnpm build && pnpm format-check:rust && pnpm lint:rust && pnpm test:rust",
"build": "turbo run build",
"changeset": "changeset",
"changeset:publish": "changeset publish",
"all-check": "pnpm clean && pnpm install && pnpm compile && pnpm lint && pnpm lint:rust && pnpm build && pnpm test && pnpm test:rust",
"build": "turbo build",
"clean": "turbo clean",
"clean:vitest-mjs": "find . -type f -name 'vite.config.ts.timestamp-*-*.mjs' -ls -delete",
"compile": "turbo run compile",
"dev": "turbo run dev --concurrency 20",
"format": "syncpack format && prettier --write .",
"format-check": "syncpack lint && prettier --check .",
"format-check:rust": "turbo run format-check:rust",
"lint": "turbo run lint -- --max-warnings=0",
"lint:fix": "turbo run lint -- --fix",
"lint:rust": "turbo run lint:rust",
"compile": "turbo compile",
"dev": "turbo dev",
"format": "turbo format",
"format:prettier": "prettier --write .",
"format:syncpack": "syncpack format",
"lint": "turbo lint",
"lint:fix": "turbo lint -- --fix",
"lint:prettier": "prettier --check .",
"lint:rust": "turbo lint:rust",
"lint:syncpack": "syncpack lint",
"playwright-install": "playwright install",
"postinstall": "syncpack list-mismatches",
"test": "turbo run test",
"test:rust": "turbo run test:rust"
"pretest": "playwright install",
"test": "turbo test",
"test:rust": "turbo test:rust"
},
"dependencies": {
"@buf/cosmos_ibc.bufbuild_es": "1.8.0-20240327103030-e2006674271c.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"scripts": {
"clean": "rm -v wasm/index*",
"clean:rust": "cargo clean --manifest-path ./crate/Cargo.toml",
"compile": "cd crate ; wasm-pack build --no-pack --target bundler --out-name index --out-dir ../wasm",
"compile": "cd crate && wasm-pack build --no-pack --target bundler --out-name index --out-dir ../wasm",
"dev": "cargo watch -C ./crate --postpone -- pnpm turbo run compile",
"format": "cd crate && cargo fmt --all",
"lint": "eslint \"src/*.ts*\"",
"lint:rust": "cd crate && cargo clippy -- -D warnings && cargo clippy --tests -- -D warnings",
"predev": "cargo install cargo-watch",
"lint:rust": "cd crate && cargo fmt --all -- --check && cargo clippy -- -D warnings && cargo clippy --tests -- -D warnings",
"test": "vitest run",
"test:rust": "cd crate ; wasm-pack test --headless --firefox -- --test build --target wasm32-unknown-unknown --release --features 'mock-database'"
"test:rust": "cd crate && wasm-pack test --headless --firefox -- --test build --target wasm32-unknown-unknown --release --features 'mock-database'"
},
"exports": {
"./*": "./src/*.ts"
Expand Down
71 changes: 40 additions & 31 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,68 @@
"globalDependencies": ["**/.env.*local"],
"globalEnv": ["NODE_ENV", "MODE"],
"pipeline": {
"//#clean:vitest-mjs": {
"cache": false
},
"//#format:prettier": {
"cache": false
},
"//#format:syncpack": {
"cache": false
},
"//#lint:prettier": {
"cache": false
},
"//#lint:syncpack": {
"cache": false
},
"build": {
"dependsOn": ["compile", "^build"],
"dotEnv": [".env"],
"env": ["PRAX", "IDB_VERSION", "CHAIN_ID", "MINIFRONT_URL"],
"dependsOn": ["compile", "^build"],
"outputs": ["dist/**"]
},
"clean": {
"cache": false,
"dependsOn": ["//#clean:vitest-mjs"]
},
"compile": {
"inputs": ["crate/src/**", "crate/Cargo.toml", "crate/Cargo.lock"],
"outputs": ["wasm/**"]
},
"host": {
"dependsOn": ["^build"],
"dev": {
"cache": false,
"dependsOn": ["build"],
"persistent": true
},
"lint": {
"dependsOn": ["compile", "//#lint:syncpack"]
},
"dev": {
"dotEnv": [".env"],
"env": ["PRAX", "IDB_VERSION", "CHAIN_ID", "MINIFRONT_URL"],
"dependsOn": ["^build"],
"outputs": ["dist/**"],
"persistent": true,
"cache": false
},
"test": {
"dependsOn": ["compile", "//#playwright-install"],
"cache": false
"format": {
"cache": false,
"dependsOn": ["//#format:syncpack", "//#format:prettier", "format:rust"]
},
"test:rust": {
"format:rust": {
"dependsOn": ["compile"],
"inputs": ["crate/src/**", "crate/Cargo.toml", "crate/Cargo.lock", "crate/tests/**"]
},
"host": {
"cache": false,
"dependsOn": ["build"],
"persistent": true
},
"lint": {
"dependsOn": ["//#lint:syncpack", "//#lint:prettier", "compile"],
"inputs": ["**/*.ts", "**/*.tsx", "wasm/index*.ts", "package.json"]
},
"lint:rust": {
"dependsOn": ["compile"],
"inputs": ["crate/src/**", "crate/Cargo.toml", "crate/Cargo.lock", "crate/tests/**"]
},
"format-check:rust": {
"test": {
"cache": false,
"dependsOn": ["compile"]
},
"//#clean:vitest-mjs": {
"cache": false
},
"//#lint:syncpack": {
"cache": false
},
"//#playwright-install": {
"cache": false
},
"clean": {
"dependsOn": ["//#clean:vitest-mjs"],
"cache": false
"test:rust": {
"dependsOn": ["compile"],
"inputs": ["crate/src/**", "crate/Cargo.toml", "crate/Cargo.lock", "crate/tests/**"]
}
}
}

0 comments on commit 932f7e8

Please sign in to comment.