mirror of
https://github.com/slint-ui/slint.git
synced 2025-07-07 13:15:23 +00:00
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.
This commit is contained in:
parent
9f9306ac95
commit
a97b7c7d92
24 changed files with 4373 additions and 1362 deletions
40
.github/actions/install-nodejs/action.yaml
vendored
40
.github/actions/install-nodejs/action.yaml
vendored
|
@ -1,40 +0,0 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
---
|
||||
name: Install NodeJS
|
||||
description: Set up NodeJS
|
||||
|
||||
outputs:
|
||||
node-version:
|
||||
description: "The node JS version that was installed"
|
||||
value: ${{ steps.node-query.outputs.node-version }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "16"
|
||||
- id: node-version
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
echo "node-version=$(node --version)" >> $GITHUB_OUTPUT
|
||||
shell: powershell
|
||||
- id: node-query
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
echo "node-version=$(node --version)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Cache native node libraries
|
||||
uses: actions/cache@v4
|
||||
if: runner.os == 'Windows'
|
||||
with:
|
||||
path: ~/node-gyp/cache
|
||||
key: ${{ runner.os }}-${{ github.job }}-${{ steps.node-version.outputs.node-version }}
|
||||
- name: Ensure node-gyp cache is populated
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
npm install -g node-gyp
|
||||
shell: powershell
|
|
@ -54,7 +54,10 @@ runs:
|
|||
shell: bash
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: npm install
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
shell: bash
|
||||
working-directory: tools/slintpad
|
||||
|
||||
|
@ -63,7 +66,7 @@ runs:
|
|||
with:
|
||||
browser: ${{ inputs.browser }}
|
||||
working-directory: tools/slintpad
|
||||
start: npm run start:vite_cypress-preview
|
||||
start: pnpm start:vite_cypress-preview
|
||||
wait-on: "http://localhost:3001"
|
||||
wait-on-timeout: 20
|
||||
config-file: cypress.config.ts
|
||||
|
|
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
|
@ -15,10 +15,12 @@ updates:
|
|||
github-actions:
|
||||
patterns:
|
||||
- "*" # Group all Actions updates into a single larger pull request
|
||||
ignore:
|
||||
- dependency-name: "lukka/run-cmake"
|
||||
|
||||
|
||||
- package-ecosystem: "npm" # See documentation for possible values
|
||||
directory: "/editors/vscode" # Location of package manifests
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
time: "04:00"
|
||||
|
|
12
.github/workflows/build_docs.yaml
vendored
12
.github/workflows/build_docs.yaml
vendored
|
@ -29,11 +29,16 @@ jobs:
|
|||
RELEASE_INPUT: ${{ inputs.release }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- name: Set up rgb crate rustdoc link
|
||||
run: |
|
||||
rgb_version=`grep 'rgb = ' internal/core/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'`
|
||||
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
|
||||
- uses: ./.github/actions/install-nodejs
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Cache mdbook and mdbook-linkcheck
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
@ -114,9 +119,10 @@ jobs:
|
|||
sed -i "s/\$TYPESENSE_SERVER_URL/typesense.slint.dev/g" "$searchbox_html"
|
||||
cargo xtask slintdocs --show-warnings
|
||||
- name: "Node docs"
|
||||
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
npm run docs
|
||||
pnpm install --frozen-lockfile --ignore-scripts
|
||||
pnpm run docs
|
||||
working-directory: api/node
|
||||
|
||||
- name: Generate a token
|
||||
|
|
62
.github/workflows/ci.yaml
vendored
62
.github/workflows/ci.yaml
vendored
|
@ -130,27 +130,32 @@ jobs:
|
|||
run: choco upgrade llvm
|
||||
- name: Setup headless display
|
||||
uses: pyvista/setup-headless-display-action@v1
|
||||
- uses: ./.github/actions/install-nodejs
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
id: node-install
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- uses: ./.github/actions/setup-rust
|
||||
with:
|
||||
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 npm install
|
||||
working-directory: ./api/node
|
||||
run: npm install --ignore-scripts
|
||||
- name: Run pnpm install
|
||||
working-directory: api/node
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
- name: Build node plugin in debug
|
||||
run: npm run build:testing
|
||||
working-directory: ./api/node
|
||||
run: pnpm build:testing
|
||||
working-directory: api/node
|
||||
- name: Lint node api
|
||||
working-directory: ./api/node
|
||||
run: npm run lint
|
||||
working-directory: api/node
|
||||
run: pnpm lint
|
||||
- name: Check code formatting
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
working-directory: ./api/node
|
||||
run: npm run format
|
||||
working-directory: api/node
|
||||
run: pnpm format
|
||||
- name: Run node tests
|
||||
working-directory: ./api/node
|
||||
run: npm test
|
||||
working-directory: api/node
|
||||
run: pnpm test
|
||||
- name: Run test-driver-nodejs
|
||||
# Release is only applied to the harness that drives the node.js invocations, but needed
|
||||
# to avoid crashing on Windows with what looks like an out of stack exception.
|
||||
|
@ -190,7 +195,7 @@ jobs:
|
|||
python-version: "3.10"
|
||||
- uses: fjwillemsen/setup-nox2@v3.0.0
|
||||
- name: Run python tests
|
||||
working-directory: ./api/python
|
||||
working-directory: api/python
|
||||
run: nox
|
||||
|
||||
cpp_test_driver:
|
||||
|
@ -329,37 +334,40 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: "vsce_1" # increment this to bust the cache if needed
|
||||
- uses: ./.github/actions/install-linux-dependencies
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
- name: Fake slint-lsp build
|
||||
run: |
|
||||
mkdir -p target/debug
|
||||
echo 1 > target/debug/slint-lsp
|
||||
- name: Run npm install
|
||||
working-directory: ./editors/vscode
|
||||
run: npm clean-install
|
||||
- name: Run pnpm install
|
||||
working-directory: editors/vscode
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint vscode project
|
||||
working-directory: ./editors/vscode
|
||||
run: npm run lint
|
||||
working-directory: editors/vscode
|
||||
run: pnpm lint
|
||||
- name: Check code formatting
|
||||
working-directory: ./editors/vscode
|
||||
run: npm run format
|
||||
working-directory: editors/vscode
|
||||
run: pnpm format
|
||||
- name: vscode prebuild
|
||||
working-directory: ./editors/vscode
|
||||
run: npm run vscode:prepublish
|
||||
working-directory: editors/vscode
|
||||
run: pnpm vscode:prepublish
|
||||
- name: Build VS Code extension
|
||||
working-directory: ./editors/vscode
|
||||
run: npm run local-package
|
||||
working-directory: editors/vscode
|
||||
run: pnpm local-package
|
||||
- name: Typescript syntax check # has to run after the build as it depends on the wasm
|
||||
working-directory: ./editors/vscode
|
||||
run: npm run syntax_check
|
||||
working-directory: editors/vscode
|
||||
run: pnpm type-check
|
||||
|
||||
# test to compile the mcu backend for the arm target (no_std)
|
||||
mcu:
|
||||
|
|
10
.github/workflows/nightly_snapshot.yaml
vendored
10
.github/workflows/nightly_snapshot.yaml
vendored
|
@ -236,11 +236,14 @@ jobs:
|
|||
if: ${{ needs.check-for-secrets.outputs.has-openvsx-pat == 'yes' && needs.check-for-secrets.outputs.has-vscode-marketplace-pat == 'yes' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- name: Install GNU Sed
|
||||
run: brew install gnu-sed
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode-lsp-binary-x86_64-unknown-linux-gnu
|
||||
|
@ -278,9 +281,9 @@ jobs:
|
|||
../../scripts/prepare_vscode_nightly.sh
|
||||
fi
|
||||
shell: bash
|
||||
- name: "npm install"
|
||||
- name: "pnpm install"
|
||||
working-directory: editors/vscode
|
||||
run: npm clean-install
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
- 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
|
||||
|
@ -291,6 +294,7 @@ jobs:
|
|||
registryUrl: https://marketplace.visualstudio.com
|
||||
dryRun: ${{ github.event.inputs.private == 'true' || (github.ref != 'refs/heads/master' && github.event.inputs.release != 'true') }}
|
||||
packagePath: editors/vscode
|
||||
dependencies: false
|
||||
- name: Publish to Open VSX Registry
|
||||
continue-on-error: true
|
||||
if: ${{ github.event.inputs.private != 'true' && (github.ref == 'refs/heads/master' || github.event.inputs.release == 'true') }}
|
||||
|
|
|
@ -21,7 +21,12 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-nodejs
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- uses: ./.github/actions/setup-rust
|
||||
with:
|
||||
target: wasm32-unknown-unknown
|
||||
|
@ -35,7 +40,7 @@ jobs:
|
|||
- name: Build slint-wasm-lsp
|
||||
env:
|
||||
SLINT_STYLE: fluent-light
|
||||
run: npm run build:wasm_lsp-release
|
||||
run: pnpm build:wasm_lsp-release
|
||||
working-directory: tools/slintpad
|
||||
|
||||
- name: "Upload wasm Artifacts"
|
||||
|
@ -51,24 +56,22 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-nodejs
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- name: Download wasm_lsp Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wasm
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('tools/lsp/pkg/package.json', 'tools/slintpad/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-node-
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: npm install
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
working-directory: tools/slintpad
|
||||
|
||||
- name: Compile slintpad
|
||||
run: npm run build
|
||||
run: pnpm build
|
||||
working-directory: tools/slintpad
|
||||
|
||||
- name: "Upload slintpad Artifacts"
|
||||
|
@ -82,26 +85,24 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-nodejs
|
||||
- uses: pnpm/action-setup@v4.0.0
|
||||
with:
|
||||
version: 9.11.0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Download wasm_lsp Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: wasm
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('tools/lsp/pkg/package.json', 'tools/slintpad/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ github.job }}-node-
|
||||
|
||||
- name: Install NPM dependencies
|
||||
run: npm install
|
||||
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||
working-directory: tools/slintpad
|
||||
|
||||
- name: Lint slintpad # This needs the WASM!
|
||||
run: |
|
||||
npm run syntax_check
|
||||
npm run lint
|
||||
pnpm type-check
|
||||
pnpm lint
|
||||
working-directory: tools/slintpad
|
||||
|
||||
# test-slintpad-ff:
|
||||
|
|
4
.npmrc
Normal file
4
.npmrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
save-prefix=""
|
||||
node-linker=hoisted
|
|
@ -7,7 +7,7 @@ Files: */slint-icon-*.svg */slint-icon-*.png */slint-icon-*.pdf */slint-logo-*.s
|
|||
Copyright: Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
License: CC-BY-ND-4.0
|
||||
|
||||
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
|
||||
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
|
||||
Copyright: Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
License: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ npm install slint-ui
|
|||
You need to install the following components:
|
||||
|
||||
* **[Node.js](https://nodejs.org/download/release/)** (v16. or newer)
|
||||
* **[npm](https://www.npmjs.com/)**
|
||||
* **[pnpm](https://www.pnpm.io/)**
|
||||
* **[Rust compiler](https://www.rust-lang.org/tools/install)** (1.77 or newer)
|
||||
|
||||
You will also need a few more dependencies, see <https://github.com/slint-ui/slint/blob/master/docs/building.md#prerequisites>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||
"extends": ["../../biome.json"],
|
||||
"formatter": {
|
||||
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/"]
|
||||
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"]
|
||||
},
|
||||
"linter": {
|
||||
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/"],
|
||||
"ignore": ["rust-module.d.ts", "rust-module.cjs", "dist/", "docs/"],
|
||||
"rules": {
|
||||
"complexity": {
|
||||
"useArrowFunction": "off",
|
||||
|
|
|
@ -20,17 +20,17 @@
|
|||
],
|
||||
"description": "Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications.",
|
||||
"devDependencies": {
|
||||
"@ava/typescript": "^4.1.0",
|
||||
"@ava/typescript": "4.1.0",
|
||||
"@biomejs/biome": "1.8.3",
|
||||
"@types/capture-console": "^1.0.5",
|
||||
"@types/node": "^20.8.6",
|
||||
"@types/node-fetch": "^2.6.7",
|
||||
"ava": "^5.3.0",
|
||||
"capture-console": "^1.0.2",
|
||||
"jimp": "^0.22.8",
|
||||
"ts-node": "^10.9.1",
|
||||
"typedoc": "^0.25.2",
|
||||
"typescript": "^5.2.2"
|
||||
"@types/capture-console": "1.0.5",
|
||||
"@types/node": "20.8.6",
|
||||
"@types/node-fetch": "2.6.7",
|
||||
"ava": "5.3.0",
|
||||
"capture-console": "1.0.2",
|
||||
"jimp": "0.22.8",
|
||||
"ts-node": "10.9.1",
|
||||
"typedoc": "0.25.2",
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
|
@ -39,16 +39,17 @@
|
|||
"artifacts": "napi artifacts",
|
||||
"compile": "tsc",
|
||||
"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 && npm run compile",
|
||||
"build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json --features testing && npm run compile",
|
||||
"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": "npm run build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md typescript/index.ts",
|
||||
"docs": "pnpm build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md typescript/index.ts",
|
||||
"check": "biome check",
|
||||
"format": "biome format",
|
||||
"format:fix": "biome format --write",
|
||||
"lint": "biome lint",
|
||||
"lint:fix": "biome lint --fix",
|
||||
"test": "ava"
|
||||
"test": "ava",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"ava": {
|
||||
"extensions": {
|
||||
|
@ -64,6 +65,6 @@
|
|||
"workerThreads": false
|
||||
},
|
||||
"dependencies": {
|
||||
"@napi-rs/cli": "^2.16.5"
|
||||
"@napi-rs/cli": "2.16.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,12 +11,16 @@
|
|||
"./node_modules",
|
||||
"**/.vscode/**",
|
||||
"*.json",
|
||||
"!biome.json"
|
||||
"!biome.json",
|
||||
"editors/vscode/out/**"
|
||||
]
|
||||
},
|
||||
"organizeImports": { "enabled": false },
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"ignore": [
|
||||
"api/node/docs/assets/**"
|
||||
],
|
||||
"rules": {
|
||||
"recommended": false,
|
||||
"complexity": {
|
||||
|
|
25
cspell.json
25
cspell.json
|
@ -47,12 +47,22 @@
|
|||
},
|
||||
{
|
||||
"languageId": "restructuredtext",
|
||||
"words": ["genindex", "modindex", "toctree"],
|
||||
"ignoreRegExpList": ["/:.+:/"]
|
||||
"words": [
|
||||
"genindex",
|
||||
"modindex",
|
||||
"toctree"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"/:.+:/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"languageId": "markdown",
|
||||
"words": ["rustup", "SUBDIR", "Yocto"],
|
||||
"words": [
|
||||
"rustup",
|
||||
"SUBDIR",
|
||||
"Yocto"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
// Ignore simple code blocks
|
||||
"`[^`]+`"
|
||||
|
@ -72,7 +82,7 @@
|
|||
"datastructures",
|
||||
"dealloc",
|
||||
"flickable",
|
||||
"focusable", // common term in UI (css, dom, toolkits)
|
||||
"focusable",
|
||||
"fullscreen",
|
||||
"gles",
|
||||
"Goffart",
|
||||
|
@ -82,7 +92,7 @@
|
|||
"Hausmann",
|
||||
"Helvetica",
|
||||
"inout",
|
||||
"layouting", // This would be worth renaming in the ItemVTable to layout_info
|
||||
"layouting",
|
||||
"linebreak",
|
||||
"lineedit",
|
||||
"listview",
|
||||
|
@ -95,6 +105,7 @@
|
|||
"opengl",
|
||||
"opengles",
|
||||
"pixmap",
|
||||
"printerdemo",
|
||||
"riscv",
|
||||
"rowspan",
|
||||
"rustc",
|
||||
|
@ -123,14 +134,14 @@
|
|||
"uefi",
|
||||
"uncompiled",
|
||||
"unerase",
|
||||
"unmapping", // present participle of unmap
|
||||
"unmapping",
|
||||
"untracked",
|
||||
"viewbox",
|
||||
"vtable",
|
||||
"vulkan",
|
||||
"wasm",
|
||||
"webassembly",
|
||||
"windowrc", // use in slint_windowrc_foo FFI functions
|
||||
"windowrc",
|
||||
"winit",
|
||||
"xtask",
|
||||
"xtensa"
|
||||
|
|
|
@ -35,19 +35,23 @@ Issues should be reported in the [Slint issue tracker](https://github.com/slint-
|
|||
|
||||
## Building from Source and Debugging
|
||||
|
||||
You need to install the following components:
|
||||
* **[Node.js](https://nodejs.org/download/release/)** (v20. or newer)
|
||||
* **[pnpm](https://www.pnpm.io/)**
|
||||
|
||||
The following step will build a local version of the vscode extension and the LSP
|
||||
|
||||
```sh
|
||||
cargo install wasm-pack
|
||||
cargo build -p slint-lsp
|
||||
cd editors/vscode
|
||||
npm clean-install
|
||||
npm run build:wasm_lsp
|
||||
npm run compile
|
||||
pnpm clean-install
|
||||
pnpm build:wasm_lsp
|
||||
pnpm compile
|
||||
```
|
||||
|
||||
Later, you only need to do the steps for the part you change like `cargo build -p slint-lsp` to rebuild the lsp binary
|
||||
or `npm run compile` to rebuild the typescript.
|
||||
or `pnpm compile` to rebuild the typescript.
|
||||
|
||||
You can run vscode with that extension by running, in the `editors/vscode` directory:
|
||||
|
||||
|
@ -66,7 +70,7 @@ To create a `.vsix` package for local installation:
|
|||
2. Create a `.vsix` package (needs `vsce` installed)
|
||||
|
||||
```sh
|
||||
npm run local-package
|
||||
pnpm local-package
|
||||
```
|
||||
|
||||
3. Install the `.vsix` file with
|
||||
|
@ -82,8 +86,8 @@ Note that the resulting `.vsix` package contains your locally built debug LSP se
|
|||
## Rules for PRs
|
||||
The code is typechecked with `tsc` and linted/formatted with Biome.
|
||||
If using VS Code then install the [biome extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome).
|
||||
To ensure your PR does not fail check everything with `npm run syntax_check && npm run format && npm run lint`.
|
||||
`npm run lint:fix` and `npm run format:fix` can be used to auto fix lint and code formatting issues.
|
||||
To ensure your PR does not fail check everything with `pnpm type-check && pnpm format && pnpm lint`.
|
||||
`pnpm lint:fix` and `pnpm format:fix` can be used to auto fix lint and code formatting issues.
|
||||
|
||||
## Preview the Library, Preview, and Property Editor
|
||||
|
||||
|
@ -101,6 +105,6 @@ The built-in live-preview can be used to preview itself. For this to work, VS Co
|
|||
|
||||
This extensions comes with some tools to help with QA:
|
||||
|
||||
* `npm run lint` and `npm run lint:fix` run the biome linter on the source code
|
||||
* `npm run syntax_check` run the typescript compiler
|
||||
* `npm run test_grammar` run the tests on the TextMate grammar build into the extension
|
||||
* `pnpm lint` and `pnpm lint:fix` run the biome linter on the source code
|
||||
* `pnpm type-check` run the typescript compiler
|
||||
* `pnpm test_grammar` run the tests on the TextMate grammar build into the extension
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||
"extends": ["../../biome.json"],
|
||||
"formatter": {
|
||||
"ignore": ["**/.vscode/**"]
|
||||
|
|
1199
editors/vscode/package-lock.json
generated
1199
editors/vscode/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -197,23 +197,23 @@
|
|||
"bin/slint-lsp-*"
|
||||
],
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run build:wasm_lsp-release && npm run compile-production && shx echo \"GPL-3.0-only OR LicenseRef-Slint-Software-3.0\" > LICENSE.txt",
|
||||
"vscode:prepublish": "pnpm build:wasm_lsp-release && pnpm compile-production && shx echo \"GPL-3.0-only OR LicenseRef-Slint-Software-3.0\" > LICENSE.txt",
|
||||
"build:lsp": "cargo build -p slint-lsp",
|
||||
"build:lsp-release": "cargo build --release -p slint-lsp",
|
||||
"build:wasm_lsp": "env-var wasm-pack build --dev --target web --no-pack ../../tools/lsp --out-dir {{npm_config_local_prefix}}/out -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
"build:wasm_lsp-release": "env-var wasm-pack build --release --target web --no-pack ../../tools/lsp --out-dir {{npm_config_local_prefix}}/out -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
"build:wasm_lsp": "shx pwd | xargs -I {} wasm-pack build --dev --target web --no-pack ../../tools/lsp --out-dir {}/out -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
"build:wasm_lsp-release": "shx pwd | xargs -I {} wasm-pack build --release --target web --no-pack ../../tools/lsp --out-dir {}/out -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
"compile": "node ./esbuild.js",
|
||||
"compile-production": "node ./esbuild.js --production",
|
||||
"local-package": "shx mkdir -p bin && shx cp ../../target/debug/slint-lsp* bin/ && npx vsce package",
|
||||
"local-package": "shx mkdir -p bin && shx cp ../../target/debug/slint-lsp* bin/ && pnpm dlx vsce package --no-dependencies",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run check",
|
||||
"pretest": "pnpm compile && pnpm check",
|
||||
"check": "biome check",
|
||||
"format": "biome format",
|
||||
"format:fix": "biome format --write",
|
||||
"lint": "biome lint",
|
||||
"lint:fix": "biome lint --fix",
|
||||
"test_grammar": "vscode-tmgrammar-test \"tests/grammar/*.slint\"",
|
||||
"syntax_check": "tsc --build --force",
|
||||
"type-check": "tsc --noEmit",
|
||||
"test": "node ./out/test/runTest.js",
|
||||
"clean": "shx rm -rf out bin LICENSE.txt slint-*.vsix"
|
||||
},
|
||||
|
|
14
package.json
Normal file
14
package.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "slint_repository",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"format": "pnpm --stream -r format",
|
||||
"format:write": "pnpm -r format:write",
|
||||
"lint": "pnpm --stream -r lint",
|
||||
"lint:fix": "pnpm -r lint:fix",
|
||||
"type-check": "pnpm --stream -r type-check"
|
||||
},
|
||||
"packageManager": "pnpm@9.11.0"
|
||||
}
|
4180
pnpm-lock.yaml
generated
Normal file
4180
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
7
pnpm-workspace.yaml
Normal file
7
pnpm-workspace.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
packages:
|
||||
- "api/node"
|
||||
- "editors/vscode"
|
||||
- "tools/slintpad"
|
||||
- "examples/printerdemo/node"
|
|
@ -6,20 +6,24 @@ This directory contains the frontend code for SlintPad, the online code editor
|
|||
which is hosted on https://slint.dev/editor (last stable) and
|
||||
https://slint.dev/snapshots/master/editor (nightly).
|
||||
|
||||
You need to install the following components:
|
||||
* **[Node.js](https://nodejs.org/download/release/)** (v20. or newer)
|
||||
* **[pnpm](https://www.pnpm.io/)**
|
||||
|
||||
To try it out locally type this in this directory:
|
||||
|
||||
```sh
|
||||
## only need to run this once
|
||||
npm install
|
||||
npm run build:wasm_interpreter # Build the wasm interpreter used in `preview.html`
|
||||
npm run build:wasm_lsp # Build the wasm LSP used by the text editor
|
||||
pnpm install
|
||||
pnpm build:wasm_interpreter # Build the wasm interpreter used in `preview.html`
|
||||
pnpm build:wasm_lsp # Build the wasm LSP used by the text editor
|
||||
|
||||
## Run this to refresh slintpad (dev mode!)
|
||||
npm run start # Run in development mode
|
||||
pnpm start # Run in development mode
|
||||
|
||||
## Run this to refresh slintpad (build mode!)
|
||||
npm run build # Build the web UI code
|
||||
npx vite preview # Start a server serving the slintpad UI
|
||||
pnpm build # Build the web UI code
|
||||
pnpm start:vite # Start a server serving the slintpad UI
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
||||
"extends": ["../../biome.json"],
|
||||
"formatter": {
|
||||
"ignore": ["dist/**"]
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "npm run clean && npx vite build",
|
||||
"build": "pnpm clean && vite build",
|
||||
"build:wasm_experimental_lsp": "wasm-pack build --dev --target web ../lsp -- --no-default-features --features backend-winit,renderer-femtovg,preview,experimental",
|
||||
"build:wasm_lsp": "wasm-pack build --dev --target web ../lsp -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
"build:wasm_lsp-release": "wasm-pack build --release --target web ../lsp -- --no-default-features --features backend-winit,renderer-femtovg,preview",
|
||||
|
@ -17,16 +17,16 @@
|
|||
"lint": "biome lint",
|
||||
"lint:fix": "biome lint --fix",
|
||||
"clean": "rimraf dist dev-dist pkg",
|
||||
"start": "npm run clean && npm run build:wasm_lsp && npm run start:vite",
|
||||
"start:vite": "vite --open",
|
||||
"start": "pnpm clean && pnpm build:wasm_lsp && pnpm start:vite",
|
||||
"start:vite": "vite preview --open",
|
||||
"start:vite_cypress": "vite --port=3001",
|
||||
"start:vite_cypress-preview": "vite preview --port=3001",
|
||||
"syntax_check": "tsc --build --force",
|
||||
"type-check": "tsc --noEmit",
|
||||
"test:cypress_run-chromium": "cypress run --browser=chromium --e2e",
|
||||
"test:cypress_open-chromium": "cypress open --browser=chromium --e2e",
|
||||
"test:cypress_run-ff": "cypress run --browser=firefox --e2e",
|
||||
"test:cypress_open-ff": "cypress open --browser=firefox --e2e",
|
||||
"slintpad:prepublish": "npm run clean && npm run build:wasm_lsp-release && npm run build:wasm_interpreter-release"
|
||||
"slintpad:prepublish": "pnpm clean && pnpm build:wasm_lsp-release && pnpm build:wasm_interpreter-release"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
@ -44,13 +44,13 @@
|
|||
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~8.0.4",
|
||||
"monaco-editor-wrapper": "~5.5.3",
|
||||
"monaco-languageclient": "~8.8.3",
|
||||
"path-browserify": "^1.0.1",
|
||||
"rimraf": "^5.0.0",
|
||||
"typescript": "~5.3.3",
|
||||
"vite": "^5.1.5",
|
||||
"path-browserify": "1.0.1",
|
||||
"rimraf": "6.0.1",
|
||||
"typescript": "5.3.3",
|
||||
"vite": "5.1.5",
|
||||
"vscode": "npm:@codingame/monaco-vscode-api@~8.0.4",
|
||||
"vscode-languageclient": "~9.0.1",
|
||||
"vscode-languageserver": "~9.0.1",
|
||||
"vscode-uri": "~3.0.8"
|
||||
"vscode-languageclient": "9.0.1",
|
||||
"vscode-languageserver": "9.0.1",
|
||||
"vscode-uri": "3.0.8"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue