Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/build-react-production-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"playground-cli": patch
---

Build the compiled CLI binary with `process.env.NODE_ENV=production` so React ships in production mode. This removes the spurious React development warnings (e.g. "Cannot update a component while rendering a different component") that surfaced during `playground deploy`, and makes React faster and smaller in the shipped binary.
8 changes: 4 additions & 4 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

- name: Compile CLI binaries
run: |
bun build --compile --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64

- name: Ensure gh CLI
run: type gh >/dev/null 2>&1 || (sudo apt-get update -qq && sudo apt-get install -y gh)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-contract-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ jobs:
- name: Compile CLI binaries
if: steps.manifest.outputs.changed == 'true' || steps.current_release.outputs.missing == 'true'
run: |
bun build --compile --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64

- name: Commit release changes
if: steps.manifest.outputs.changed == 'true'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ jobs:
- name: Compile CLI binaries
if: steps.changesets.outputs.found == 'true'
run: |
bun build --compile --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-x64 src/index.ts --outfile dot-linux-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-linux-arm64 src/index.ts --outfile dot-linux-arm64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-x64 src/index.ts --outfile dot-darwin-x64
bun build --compile --define process.env.NODE_ENV='"production"' --target=bun-darwin-arm64 src/index.ts --outfile dot-darwin-arm64

- name: Generate release tag
if: steps.changesets.outputs.found == 'true'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"format:check": "biome format .",
"lint:license": "./scripts/check-license-headers.sh",
"typecheck": "tsc --noEmit",
"build": "bun build --compile src/index.ts --outfile ./dist/playground",
"cli:install": "bun build --compile src/index.ts --outfile ~/.polkadot/bin/playground && ln -sf ~/.polkadot/bin/playground ~/.polkadot/bin/pg",
"build": "bun build --compile --define process.env.NODE_ENV='\"production\"' src/index.ts --outfile ./dist/playground",
"cli:install": "bun build --compile --define process.env.NODE_ENV='\"production\"' src/index.ts --outfile ~/.polkadot/bin/playground && ln -sf ~/.polkadot/bin/playground ~/.polkadot/bin/pg",
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "vitest run --config e2e/vitest.config.ts",
Expand Down
Loading