@canonical/terrazzo-lsp 0.3.1 → 0.3.3

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.
@@ -1,6 +1,21 @@
1
- import { createRequire } from "node:module";
2
- const require = createRequire(import.meta.url);
3
- const pkg = require("../package.json");
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { dirname, join, parse } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ /** Walk up from the current file until we find the lsp package.json. */
5
+ function findPackageJson() {
6
+ let dir = dirname(fileURLToPath(import.meta.url));
7
+ while (dir !== parse(dir).root) {
8
+ const candidate = join(dir, "package.json");
9
+ if (existsSync(candidate)) {
10
+ const pkg = JSON.parse(readFileSync(candidate, "utf-8"));
11
+ if (pkg.name === "@canonical/terrazzo-lsp")
12
+ return candidate;
13
+ }
14
+ dir = dirname(dir);
15
+ }
16
+ return join(dir, "package.json");
17
+ }
18
+ const pkg = JSON.parse(readFileSync(findPackageJson(), "utf-8"));
4
19
  /** The version string from the package's own package.json. */
5
20
  export const VERSION = pkg.version;
6
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAE9D,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,wEAAwE;AACxE,SAAS,eAAe;IACtB,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,OAAO,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAC5C,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAEtD,CAAC;YACF,IAAI,GAAG,CAAC,IAAI,KAAK,yBAAyB;gBAAE,OAAO,SAAS,CAAC;QAC/D,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,OAAO,CAAC,CAE9D,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAKA,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAwBA,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/terrazzo-lsp",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Language server providing CSS custom property intelligence for design token workflows. Includes completions, hover, diagnostics, go-to-definition, rename, document colours, and workspace symbols.",
5
5
  "type": "module",
6
6
  "license": "LGPL-3.0",
@@ -54,7 +54,7 @@
54
54
  "test:coverage": "vitest run --coverage"
55
55
  },
56
56
  "dependencies": {
57
- "@canonical/token-types": "^0.3.1",
57
+ "@canonical/token-types": "^0.3.3",
58
58
  "@lezer/common": "^1.3.0",
59
59
  "@lezer/css": "^1.3.0",
60
60
  "colorjs.io": "^0.6.1"