Skip to content

Commit

Permalink
Avoid building Rust on pnpm install
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored and tronical committed Nov 14, 2024
1 parent 9cfe886 commit 0461abf
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/actions/test-online-editor/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ runs:
uses: pnpm/action-setup@v4.0.0
with:
version: 9.11.0
run: pnpm install --frozen-lockfile --ignore-scripts
run: pnpm install --frozen-lockfile
shell: bash
working-directory: tools/slintpad

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: "Node docs"

run: |
pnpm install --frozen-lockfile --ignore-scripts
pnpm install --frozen-lockfile
pnpm run docs
working-directory: api/node

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
key: x-napi-v2-${{ steps.node-install.outputs.node-version }} # the cache key consists of a manually bumpable version and the node version, as the cached rustc artifacts contain linking information where to find node.lib, which is in a versioned directory.
- name: Run pnpm install
working-directory: api/node
run: pnpm install --frozen-lockfile --ignore-scripts
run: pnpm install --frozen-lockfile
- name: Build node plugin in debug
run: pnpm build:testing
working-directory: api/node
Expand Down Expand Up @@ -345,7 +345,7 @@ jobs:
echo 1 > target/debug/slint-lsp
- name: Run pnpm install
working-directory: editors/vscode
run: pnpm install --frozen-lockfile --ignore-scripts
run: pnpm install --frozen-lockfile
- name: vscode prebuild
working-directory: editors/vscode
run: pnpm vscode:prepublish
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fmt_lint_typecheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: biome format biome.json
- name: Format, Lint on npm projects
run: |
pnpm install --frozen-lockfile --ignore-scripts
pnpm install --frozen-lockfile
pnpm format
pnpm lint
- name: Suggest format changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ jobs:
shell: bash
- name: "pnpm install"
working-directory: editors/vscode
run: pnpm install --frozen-lockfile --ignore-scripts
run: pnpm install --frozen-lockfile
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build package and optionally publish to Visual Studio Marketplace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm_editor_and_interpreter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
name: wasm
- name: Install NPM dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
run: pnpm install --frozen-lockfile
working-directory: tools/slintpad

- name: Compile slintpad
Expand Down
3 changes: 1 addition & 2 deletions api/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
},
"scripts": {
"artifacts": "napi artifacts",
"compile": "tsc",
"compile": "tsc --build",
"build": "napi build --platform --release --js rust-module.cjs --dts rust-module.d.ts -c binaries.json",
"build:debug": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json && pnpm compile",
"build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json --features testing && pnpm compile",
"install": "node build-on-demand.mjs",
"docs": "pnpm build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md typescript/index.ts",
"check": "biome check",
"format": "biome format",
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"opengl",
"opengles",
"pixmap",
"prestart",
"printerdemo",
"riscv",
"rowspan",
Expand Down
3 changes: 2 additions & 1 deletion demos/home-automation/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"type": "module",
"dependencies": {
"@biomejs/biome": "1.9.3",
"slint-ui": "../../../api/node"
"slint-ui": "workspace:*"
},
"scripts": {
"start": "node .",
"prestart": "cd ../../../api/node/ && node build-on-demand.mjs && pnpm compile",
"check": "biome check",
"format": "biome format",
"format:fix": "biome format --write",
Expand Down
4 changes: 0 additions & 4 deletions demos/printerdemo/node/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
Run with

# pushd ../../../api/node
# pnpm install
# pnpm compile
# popd
# pnpm install --ignore-scripts
# pnpm start
5 changes: 3 additions & 2 deletions demos/printerdemo/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"main": "main.js",
"type": "module",
"dependencies": {
"slint-ui": "../../../api/node"
"slint-ui": "workspace:*"
},
"scripts": {
"start": "node ."
"start": "node .",
"prestart": "cd ../../../api/node/ && node build-on-demand.mjs && pnpm compile"
}
}
2 changes: 1 addition & 1 deletion editors/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following step will build a local version of the vscode extension and the LS
cargo install wasm-pack
cargo build -p slint-lsp
cd editors/vscode
pnpm install --frozen-lockfile --ignore-scripts
pnpm install --frozen-lockfile
pnpm build:wasm_lsp
pnpm compile
```
Expand Down
8 changes: 2 additions & 6 deletions examples/carousel/node/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Run with
# pushd ../../../api/node
# npm install
# npm run compile
# popd
# npm install
# npm start
# pnpm install
# pnpm start
5 changes: 3 additions & 2 deletions examples/carousel/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"main": "main.js",
"type": "module",
"dependencies": {
"slint-ui": "../../../api/node"
"slint-ui": "workspace:*"
},
"scripts": {
"start": "node ."
"start": "node .",
"prestart": "cd ../../../api/node/ && node build-on-demand.mjs && pnpm compile"
}
}
5 changes: 0 additions & 5 deletions examples/imagefilter/node/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
Run with

# pushd ../../../api/node
# pnpm install
# pnpm run compile
# popd
# pnpm install --ignore-scripts
# pnpm start
4 changes: 2 additions & 2 deletions examples/imagefilter/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "main.js",
"type": "module",
"dependencies": {
"slint-ui": "../../../api/node",
"slint-ui": "workspace:*",
"jimp": "1.6.0"
},
"devDependencies": {
Expand All @@ -13,7 +13,7 @@
},
"scripts": {
"start": "tsc --build && node ./main.js",
"prestart": "cd ../../../api/node/ && node build-on-demand.mjs && pnpm compile",
"type-check": "tsc --noEmit"

}
}
5 changes: 3 additions & 2 deletions examples/memory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"main": "main.js",
"type": "module",
"dependencies": {
"slint-ui": "../../api/node"
"slint-ui": "workspace:*"
},
"scripts": {
"start": "node ."
"start": "node .",
"prestart": "cd ../../api/node/ && node build-on-demand.mjs && pnpm compile"
}
}
8 changes: 2 additions & 6 deletions examples/todo/node/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Run with
# pushd ../../../api/node
# npm install
# npm run compile
# popd
# npm install
# npm start
# pnpm install
# pnpm start
5 changes: 3 additions & 2 deletions examples/todo/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"main": "main.js",
"type": "module",
"dependencies": {
"slint-ui": "../../../api/node"
"slint-ui": "workspace:*"
},
"scripts": {
"start": "node ."
"start": "node .",
"prestart": "cd ../../../api/node/ && node build-on-demand.mjs && pnpm compile"
}
}
24 changes: 21 additions & 3 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ packages:
- "demos/printerdemo/node"
- "demos/home-automation/node"
- "examples/imagefilter/node"
- "examples/carousel/node"
- "examples/todo/node"
- "examples/memory"
- "docs/editor"

0 comments on commit 0461abf

Please sign in to comment.