Skip to content

Commit a97b7c7

Browse files
authored
Replace npm with pnpm
Replaces the use of NPM with PNPM. This should make it quick and easy to update any of the dependencies as dependabot will now see everything in one go.
1 parent 9f9306a commit a97b7c7

24 files changed

+4373
-1362
lines changed

.github/actions/install-nodejs/action.yaml

-40
This file was deleted.

.github/actions/test-online-editor/action.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ runs:
5454
shell: bash
5555

5656
- name: Install NPM dependencies
57-
run: npm install
57+
uses: pnpm/[email protected]
58+
with:
59+
version: 9.11.0
60+
run: pnpm install --frozen-lockfile --ignore-scripts
5861
shell: bash
5962
working-directory: tools/slintpad
6063

@@ -63,7 +66,7 @@ runs:
6366
with:
6467
browser: ${{ inputs.browser }}
6568
working-directory: tools/slintpad
66-
start: npm run start:vite_cypress-preview
69+
start: pnpm start:vite_cypress-preview
6770
wait-on: "http://localhost:3001"
6871
wait-on-timeout: 20
6972
config-file: cypress.config.ts

.github/dependabot.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ updates:
1515
github-actions:
1616
patterns:
1717
- "*" # Group all Actions updates into a single larger pull request
18+
ignore:
19+
- dependency-name: "lukka/run-cmake"
1820

1921

2022
- package-ecosystem: "npm" # See documentation for possible values
21-
directory: "/editors/vscode" # Location of package manifests
23+
directory: "/" # Location of package manifests
2224
schedule:
2325
interval: "weekly"
2426
time: "04:00"

.github/workflows/build_docs.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ jobs:
2929
RELEASE_INPUT: ${{ inputs.release }}
3030
steps:
3131
- uses: actions/checkout@v4
32+
- uses: pnpm/[email protected]
33+
with:
34+
version: 9.11.0
3235
- name: Set up rgb crate rustdoc link
3336
run: |
3437
rgb_version=`grep 'rgb = ' internal/core/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'`
3538
echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ --extern-html-root-url android_activity=https://docs.rs/android-activity/0.5/ --extern-html-root-url raw_window_handle=https://docs.rs/raw_window_handle/0.6 -Z unstable-options" >> $GITHUB_ENV
36-
- uses: ./.github/actions/install-nodejs
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
3742
- name: Cache mdbook and mdbook-linkcheck
3843
uses: actions/cache@v4
3944
with:
@@ -114,9 +119,10 @@ jobs:
114119
sed -i "s/\$TYPESENSE_SERVER_URL/typesense.slint.dev/g" "$searchbox_html"
115120
cargo xtask slintdocs --show-warnings
116121
- name: "Node docs"
122+
117123
run: |
118-
npm install --ignore-scripts
119-
npm run docs
124+
pnpm install --frozen-lockfile --ignore-scripts
125+
pnpm run docs
120126
working-directory: api/node
121127

122128
- name: Generate a token

.github/workflows/ci.yaml

+35-27
Original file line numberDiff line numberDiff line change
@@ -130,27 +130,32 @@ jobs:
130130
run: choco upgrade llvm
131131
- name: Setup headless display
132132
uses: pyvista/setup-headless-display-action@v1
133-
- uses: ./.github/actions/install-nodejs
133+
- uses: actions/setup-node@v4
134+
with:
135+
node-version: 20
134136
id: node-install
137+
- uses: pnpm/[email protected]
138+
with:
139+
version: 9.11.0
135140
- uses: ./.github/actions/setup-rust
136141
with:
137142
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.
138-
- name: Run npm install
139-
working-directory: ./api/node
140-
run: npm install --ignore-scripts
143+
- name: Run pnpm install
144+
working-directory: api/node
145+
run: pnpm install --frozen-lockfile --ignore-scripts
141146
- name: Build node plugin in debug
142-
run: npm run build:testing
143-
working-directory: ./api/node
147+
run: pnpm build:testing
148+
working-directory: api/node
144149
- name: Lint node api
145-
working-directory: ./api/node
146-
run: npm run lint
150+
working-directory: api/node
151+
run: pnpm lint
147152
- name: Check code formatting
148153
if: ${{ runner.os != 'Windows' }}
149-
working-directory: ./api/node
150-
run: npm run format
154+
working-directory: api/node
155+
run: pnpm format
151156
- name: Run node tests
152-
working-directory: ./api/node
153-
run: npm test
157+
working-directory: api/node
158+
run: pnpm test
154159
- name: Run test-driver-nodejs
155160
# Release is only applied to the harness that drives the node.js invocations, but needed
156161
# to avoid crashing on Windows with what looks like an out of stack exception.
@@ -190,7 +195,7 @@ jobs:
190195
python-version: "3.10"
191196
- uses: fjwillemsen/[email protected]
192197
- name: Run python tests
193-
working-directory: ./api/python
198+
working-directory: api/python
194199
run: nox
195200

196201
cpp_test_driver:
@@ -329,37 +334,40 @@ jobs:
329334

330335
steps:
331336
- uses: actions/checkout@v4
337+
- uses: pnpm/[email protected]
338+
with:
339+
version: 9.11.0
332340
- uses: Swatinem/rust-cache@v2
333341
with:
334342
key: "vsce_1" # increment this to bust the cache if needed
335343
- uses: ./.github/actions/install-linux-dependencies
336344
- uses: actions/setup-node@v4
337345
with:
338-
node-version: 18
346+
node-version: 20
339347
- name: Install wasm-pack
340348
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
341349
- name: Fake slint-lsp build
342350
run: |
343351
mkdir -p target/debug
344352
echo 1 > target/debug/slint-lsp
345-
- name: Run npm install
346-
working-directory: ./editors/vscode
347-
run: npm clean-install
353+
- name: Run pnpm install
354+
working-directory: editors/vscode
355+
run: pnpm install --frozen-lockfile --ignore-scripts
348356
- name: Lint vscode project
349-
working-directory: ./editors/vscode
350-
run: npm run lint
357+
working-directory: editors/vscode
358+
run: pnpm lint
351359
- name: Check code formatting
352-
working-directory: ./editors/vscode
353-
run: npm run format
360+
working-directory: editors/vscode
361+
run: pnpm format
354362
- name: vscode prebuild
355-
working-directory: ./editors/vscode
356-
run: npm run vscode:prepublish
363+
working-directory: editors/vscode
364+
run: pnpm vscode:prepublish
357365
- name: Build VS Code extension
358-
working-directory: ./editors/vscode
359-
run: npm run local-package
366+
working-directory: editors/vscode
367+
run: pnpm local-package
360368
- name: Typescript syntax check # has to run after the build as it depends on the wasm
361-
working-directory: ./editors/vscode
362-
run: npm run syntax_check
369+
working-directory: editors/vscode
370+
run: pnpm type-check
363371

364372
# test to compile the mcu backend for the arm target (no_std)
365373
mcu:

.github/workflows/nightly_snapshot.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,14 @@ jobs:
236236
if: ${{ needs.check-for-secrets.outputs.has-openvsx-pat == 'yes' && needs.check-for-secrets.outputs.has-vscode-marketplace-pat == 'yes' }}
237237
steps:
238238
- uses: actions/checkout@v4
239+
- uses: pnpm/[email protected]
240+
with:
241+
version: 9.11.0
239242
- name: Install GNU Sed
240243
run: brew install gnu-sed
241244
- uses: actions/setup-node@v4
242245
with:
243-
node-version: 18
246+
node-version: 20
244247
- uses: actions/download-artifact@v4
245248
with:
246249
name: vscode-lsp-binary-x86_64-unknown-linux-gnu
@@ -278,9 +281,9 @@ jobs:
278281
../../scripts/prepare_vscode_nightly.sh
279282
fi
280283
shell: bash
281-
- name: "npm install"
284+
- name: "pnpm install"
282285
working-directory: editors/vscode
283-
run: npm clean-install
286+
run: pnpm install --frozen-lockfile --ignore-scripts
284287
- name: Install wasm-pack
285288
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
286289
- name: Build package and optionally publish to Visual Studio Marketplace
@@ -291,6 +294,7 @@ jobs:
291294
registryUrl: https://marketplace.visualstudio.com
292295
dryRun: ${{ github.event.inputs.private == 'true' || (github.ref != 'refs/heads/master' && github.event.inputs.release != 'true') }}
293296
packagePath: editors/vscode
297+
dependencies: false
294298
- name: Publish to Open VSX Registry
295299
continue-on-error: true
296300
if: ${{ github.event.inputs.private != 'true' && (github.ref == 'refs/heads/master' || github.event.inputs.release == 'true') }}

.github/workflows/wasm_editor_and_interpreter.yaml

+24-23
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
runs-on: ubuntu-22.04
2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: ./.github/actions/install-nodejs
24+
- uses: pnpm/[email protected]
25+
with:
26+
version: 9.11.0
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
2530
- uses: ./.github/actions/setup-rust
2631
with:
2732
target: wasm32-unknown-unknown
@@ -35,7 +40,7 @@ jobs:
3540
- name: Build slint-wasm-lsp
3641
env:
3742
SLINT_STYLE: fluent-light
38-
run: npm run build:wasm_lsp-release
43+
run: pnpm build:wasm_lsp-release
3944
working-directory: tools/slintpad
4045

4146
- name: "Upload wasm Artifacts"
@@ -51,24 +56,22 @@ jobs:
5156
runs-on: ubuntu-22.04
5257
steps:
5358
- uses: actions/checkout@v4
54-
- uses: ./.github/actions/install-nodejs
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: 20
62+
- uses: pnpm/[email protected]
63+
with:
64+
version: 9.11.0
5565
- name: Download wasm_lsp Artifacts
5666
uses: actions/download-artifact@v4
5767
with:
5868
name: wasm
59-
- uses: actions/cache@v4
60-
with:
61-
path: ~/.npm
62-
key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('tools/lsp/pkg/package.json', 'tools/slintpad/package.json') }}
63-
restore-keys: |
64-
${{ runner.os }}-${{ github.job }}-node-
65-
6669
- name: Install NPM dependencies
67-
run: npm install
70+
run: pnpm install --frozen-lockfile --ignore-scripts
6871
working-directory: tools/slintpad
6972

7073
- name: Compile slintpad
71-
run: npm run build
74+
run: pnpm build
7275
working-directory: tools/slintpad
7376

7477
- name: "Upload slintpad Artifacts"
@@ -82,26 +85,24 @@ jobs:
8285
runs-on: ubuntu-22.04
8386
steps:
8487
- uses: actions/checkout@v4
85-
- uses: ./.github/actions/install-nodejs
88+
- uses: pnpm/[email protected]
89+
with:
90+
version: 9.11.0
91+
- uses: actions/setup-node@v4
92+
with:
93+
node-version: 20
8694
- name: Download wasm_lsp Artifacts
8795
uses: actions/download-artifact@v4
8896
with:
8997
name: wasm
90-
- uses: actions/cache@v4
91-
with:
92-
path: ~/.npm
93-
key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('tools/lsp/pkg/package.json', 'tools/slintpad/package.json') }}
94-
restore-keys: |
95-
${{ runner.os }}-${{ github.job }}-node-
96-
9798
- name: Install NPM dependencies
98-
run: npm install
99+
run: pnpm install --frozen-lockfile --ignore-scripts
99100
working-directory: tools/slintpad
100101

101102
- name: Lint slintpad # This needs the WASM!
102103
run: |
103-
npm run syntax_check
104-
npm run lint
104+
pnpm type-check
105+
pnpm lint
105106
working-directory: tools/slintpad
106107

107108
# test-slintpad-ff:

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright © SixtyFPS GmbH <[email protected]>
2+
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3+
save-prefix=""
4+
node-linker=hoisted

.reuse/dep5

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Files: */slint-icon-*.svg */slint-icon-*.png */slint-icon-*.pdf */slint-logo-*.s
77
Copyright: Copyright © SixtyFPS GmbH <[email protected]>
88
License: CC-BY-ND-4.0
99

10-
Files: .gitattributes .gitignore */.gitignore .dockerignore .vscode/* cspell.json rustfmt.toml .mailmap */.eslintrc.yml Cargo.lock */.npmignore biome.json package-lock.json docs/search/scraper-config.json
10+
Files: .gitattributes .gitignore */.gitignore .dockerignore .vscode/* cspell.json rustfmt.toml .mailmap */.eslintrc.yml Cargo.lock */.npmignore biome.json package-lock.json docs/search/scraper-config.json pnpm-lock.yaml package.json
1111
Copyright: Copyright © SixtyFPS GmbH <[email protected]>
1212
License: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
1313

api/node/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ npm install slint-ui
3232
You need to install the following components:
3333

3434
* **[Node.js](https://nodejs.org/download/release/)** (v16. or newer)
35-
* **[npm](https://www.npmjs.com/)**
35+
* **[pnpm](https://www.pnpm.io/)**
3636
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer)
3737

3838
You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>

api/node/biome.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
32
"extends": ["../../biome.json"],
43
"formatter": {
5-
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/"]
4+
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"]
65
},
76
"linter": {
8-
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/"],
7+
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"],
98
"rules": {
109
"complexity": {
1110
"useArrowFunction": "off",

0 commit comments

Comments
 (0)