@canonical/terrazzo-lsp-extension 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/install.mjs ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Install the Terrazzo LSP VS Code extension from the bundled VSIX.
5
+ *
6
+ * Resolves the VSIX path relative to this script via `import.meta.url`,
7
+ * which always points to the real file — not the symlink in `.bin/`.
8
+ *
9
+ * @note Impure — spawns a child process and writes to stdout.
10
+ */
11
+
12
+ import { execFileSync } from "node:child_process";
13
+ import { existsSync } from "node:fs";
14
+ import { dirname, join } from "node:path";
15
+ import { fileURLToPath } from "node:url";
16
+
17
+ const packageDir = dirname(fileURLToPath(import.meta.url));
18
+ const vsixPath = join(packageDir, "terrazzo-lsp.vsix");
19
+
20
+ if (!existsSync(vsixPath)) {
21
+ console.error(
22
+ `VSIX not found at ${vsixPath}.\nRebuild with: bun run package`,
23
+ );
24
+ process.exit(1);
25
+ }
26
+
27
+ try {
28
+ execFileSync("code", ["--install-extension", vsixPath], {
29
+ stdio: "inherit",
30
+ });
31
+ } catch {
32
+ console.error(
33
+ `Auto-install failed. Install manually:\n code --install-extension ${vsixPath}`,
34
+ );
35
+ process.exit(1);
36
+ }
37
+
38
+ console.log(`
39
+ Terrazzo LSP extension installed.
40
+
41
+ To get started:
42
+
43
+ npm i @canonical/design-tokens --save-dev
44
+
45
+ Then copy this minimal config to terrazzo-lsp.config.json at the root of your project:
46
+
47
+ {
48
+ "artifacts": ["@canonical/design-tokens/dist/tokens.json"]
49
+ }
50
+ `);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@canonical/terrazzo-lsp-extension",
3
3
  "displayName": "Terrazzo LSP",
4
4
  "description": "CSS custom property intelligence for design token workflows",
5
- "version": "0.4.0",
5
+ "version": "0.4.2",
6
6
  "publisher": "canonical",
7
7
  "license": "LGPL-3.0-only",
8
8
  "galleryBanner": {
@@ -39,18 +39,18 @@
39
39
  ],
40
40
  "main": "./dist/extension.js",
41
41
  "bin": {
42
- "terrazzo-lsp-install-vscode": "./install.sh"
42
+ "terrazzo-lsp-install-vscode": "./install.mjs"
43
43
  },
44
44
  "files": [
45
45
  "dist",
46
46
  "terrazzo-lsp.vsix",
47
- "install.sh"
47
+ "install.mjs"
48
48
  ],
49
49
  "scripts": {
50
50
  "build:client": "bun build extension.ts --outdir dist --format=cjs --target=node --external vscode",
51
51
  "build:server": "rm -rf dist/esm && cp -r node_modules/@canonical/terrazzo-lsp/dist/esm dist/esm",
52
52
  "build": "bun run build:client && bun run build:server",
53
- "package": "bun install && bun run build && vsce package --no-dependencies -o terrazzo-lsp.vsix"
53
+ "package": "bun install && bun run build && node vsce-pack.mjs"
54
54
  },
55
55
  "contributes": {
56
56
  "configuration": {
@@ -85,7 +85,7 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
- "@canonical/terrazzo-lsp": "^0.4.0",
88
+ "@canonical/terrazzo-lsp": "^0.4.2",
89
89
  "vscode-languageclient": "^9.0.1"
90
90
  },
91
91
  "devDependencies": {
Binary file
package/install.sh DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env sh
2
- # Install the Terrazzo LSP VS Code extension from the bundled VSIX.
3
- set -e
4
-
5
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
- VSIX_PATH="$SCRIPT_DIR/terrazzo-lsp.vsix"
7
-
8
- if [ ! -f "$VSIX_PATH" ]; then
9
- echo "VSIX not found at $VSIX_PATH" >&2
10
- echo "Rebuild with: bun run package" >&2
11
- exit 1
12
- fi
13
-
14
- code --install-extension "$VSIX_PATH"
15
-
16
- cat <<'EOF'
17
-
18
- Terrazzo LSP extension installed.
19
-
20
- To get started:
21
-
22
- npm i @canonical/design-tokens --save-dev
23
-
24
- Then copy this minimal config to terrazzo-lsp.config.json at the root of your project:
25
-
26
- {
27
- "artifacts": ["@canonical/design-tokens/dist/tokens.json"]
28
- }
29
- EOF