@velarscript/cli 0.24.0 → 0.25.0

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.
Files changed (36) hide show
  1. package/dist/cli.js +20 -3
  2. package/dist/cli.js.map +1 -1
  3. package/dist/config.d.ts +1 -1
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +71 -1
  6. package/dist/config.js.map +1 -1
  7. package/dist/extension-metadata.d.ts +12 -0
  8. package/dist/extension-metadata.d.ts.map +1 -1
  9. package/dist/extension-metadata.js +38 -2
  10. package/dist/extension-metadata.js.map +1 -1
  11. package/dist/host-error.d.ts +7 -0
  12. package/dist/host-error.d.ts.map +1 -1
  13. package/dist/host-error.js +9 -0
  14. package/dist/host-error.js.map +1 -1
  15. package/dist/language-server-bundle-entry.js +1 -1
  16. package/dist/language-server-bundle-entry.js.map +1 -1
  17. package/dist/language-server-tool.d.ts.map +1 -1
  18. package/dist/language-server-tool.js +34 -0
  19. package/dist/language-server-tool.js.map +1 -1
  20. package/dist/official-language-server-extensions.d.ts +12 -1
  21. package/dist/official-language-server-extensions.d.ts.map +1 -1
  22. package/dist/official-language-server-extensions.js +78 -46
  23. package/dist/official-language-server-extensions.js.map +1 -1
  24. package/dist/project-format.d.ts +1 -1
  25. package/dist/project-format.d.ts.map +1 -1
  26. package/dist/project-format.js +6 -0
  27. package/dist/project-format.js.map +1 -1
  28. package/dist/surface-versions.d.ts +42 -0
  29. package/dist/surface-versions.d.ts.map +1 -0
  30. package/dist/surface-versions.js +72 -0
  31. package/dist/surface-versions.js.map +1 -0
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/package.json +25 -9
  35. package/skill/ai-skill-server.md +1 -1
  36. package/skill/ai-skill.md +10 -0
@@ -0,0 +1,72 @@
1
+ import { VELAR_CORE_API_VERSION } from "@velarscript/compiler";
2
+ /**
3
+ * D110 — one installation number, five surface versions.
4
+ *
5
+ * `VELAR_VERSION` is the number you install. It steps for every package at
6
+ * once, so it cannot say which of the five observable surfaces actually moved:
7
+ * Desktop's surface sat still for several releases while its package climbed
8
+ * with everybody else's. The surface versions answer the question an upgrade
9
+ * really raises — *which code do I have to re-read?*
10
+ *
11
+ * Every number here is read from the package that owns the surface. None of
12
+ * them is written down twice: D110's background is a website that accumulated
13
+ * two dozen hand-typed release numbers and had every one of them go stale in a
14
+ * single release, and a hand-typed number is the failure this whole mechanism
15
+ * exists to remove. `scripts/check-surface-versions.mjs` hashes each surface
16
+ * and refuses a change that leaves its number behind.
17
+ *
18
+ * `0.N`'s `N` counts how many times that surface has changed since counting
19
+ * began, and it is not a maturity grade: a low number beside a high one means
20
+ * that surface started counting later, and nothing else.
21
+ *
22
+ * The four target constants are imported *lazily*, and that is not an
23
+ * optimization detail — it is the difference between this file costing one
24
+ * command and costing all of them. Reading Web's, Server's and Desktop's
25
+ * numbers means loading three compiler extensions the CLI otherwise touches
26
+ * only when a project activates them, and a static import here would put that
27
+ * on the start of `velar check` and every other command for the sake of a
28
+ * banner almost none of them print. Core's constant is already loaded, because
29
+ * the compiler always is.
30
+ *
31
+ * Three of those four are also optional now (D111): a project installs the
32
+ * targets it declares, so a Core project has no Web, Server or Desktop package
33
+ * to read a number out of. The banner answers for the installation it is in —
34
+ * the same reading `velar.json`'s `surfaces` check already takes, where the
35
+ * installed packages, not the CLI's own pins, decide what a project activates.
36
+ * A surface with nothing installed to speak for it is left out rather than
37
+ * printed from a number written down here, which is exactly the second copy
38
+ * this file exists to avoid.
39
+ */
40
+ export async function readSurfaceVersions() {
41
+ const [web, node, server, desktop] = await Promise.all([
42
+ installedSurface(() => import("@velarscript/web/compiler")),
43
+ import("@velarscript/node/compiler"),
44
+ installedSurface(() => import("@velarscript/server/compiler")),
45
+ installedSurface(() => import("@velarscript/desktop")),
46
+ ]);
47
+ // Declaration order is the order the surface table is printed in (D110 rule 6).
48
+ const versions = { core: VELAR_CORE_API_VERSION };
49
+ if (web)
50
+ versions.web = web.VELAR_WEB_API_VERSION;
51
+ versions.node = node.VELAR_NODE_API_VERSION;
52
+ if (server)
53
+ versions.server = server.VELAR_SERVER_API_VERSION;
54
+ if (desktop)
55
+ versions.desktop = desktop.VELAR_DESKTOP_API_VERSION;
56
+ return Object.freeze(versions);
57
+ }
58
+ /** One optional target's module, or null when this project did not install it. */
59
+ async function installedSurface(load) {
60
+ try {
61
+ return await load();
62
+ }
63
+ catch {
64
+ return null;
65
+ }
66
+ }
67
+ /** One line, three spaces between entries: `core@<n> web@<n> …`. */
68
+ export async function formatSurfaceVersions() {
69
+ const versions = await readSurfaceVersions();
70
+ return Object.entries(versions).map(([surface, version]) => `${surface}@${version}`).join(" ");
71
+ }
72
+ //# sourceMappingURL=surface-versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-versions.js","sourceRoot":"","sources":["../src/surface-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACrD,gBAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC;QAC3D,MAAM,CAAC,4BAA4B,CAAC;QACpC,gBAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;QAC9D,gBAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;KACvD,CAAC,CAAC;IACH,gFAAgF;IAChF,MAAM,QAAQ,GAA2B,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;IAC1E,IAAI,GAAG;QAAE,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,qBAAqB,CAAC;IAClD,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAC5C,IAAI,MAAM;QAAE,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC;IAC9D,IAAI,OAAO;QAAE,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAClE,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,kFAAkF;AAClF,KAAK,UAAU,gBAAgB,CAAI,IAAsB;IACvD,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnG,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const VELAR_VERSION = "0.24.0";
1
+ export declare const VELAR_VERSION = "0.25.0";
2
2
  export { VELAR_STANDARD_API_VERSION } from "@velarscript/core";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const VELAR_VERSION = "0.24.0";
1
+ export const VELAR_VERSION = "0.25.0";
2
2
  export { VELAR_STANDARD_API_VERSION } from "@velarscript/core";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velarscript/cli",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "The VelarScript command-line compiler, dev server, test runner, and language server.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -30,14 +30,30 @@
30
30
  "velar": "./dist/cli.js"
31
31
  },
32
32
  "dependencies": {
33
- "@velarscript/compiler": "0.24.0",
34
- "@velarscript/core": "0.24.0",
35
- "@velarscript/desktop": "0.24.0",
36
- "@velarscript/node": "0.24.0",
37
- "@velarscript/server": "0.24.0",
38
- "@velarscript/web": "0.24.0",
39
- "create-velar": "0.24.0",
40
- "esbuild": "^0.28.1",
33
+ "@velarscript/compiler": "0.25.0",
34
+ "@velarscript/core": "0.25.0",
35
+ "@velarscript/node": "0.25.0",
36
+ "create-velar": "0.25.0",
37
+ "esbuild": "^0.28.1"
38
+ },
39
+ "peerDependencies": {
40
+ "@velarscript/desktop": "0.25.0",
41
+ "@velarscript/server": "0.25.0",
42
+ "@velarscript/web": "0.25.0",
41
43
  "playwright": "^1.58.2"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "@velarscript/desktop": {
47
+ "optional": true
48
+ },
49
+ "@velarscript/server": {
50
+ "optional": true
51
+ },
52
+ "@velarscript/web": {
53
+ "optional": true
54
+ },
55
+ "playwright": {
56
+ "optional": true
57
+ }
42
58
  }
43
59
  }
@@ -13,7 +13,7 @@ browser application activates `@velarscript/web`:
13
13
  ```json
14
14
  {
15
15
  "dependencies": {
16
- "@velarscript/server": "0.24.0"
16
+ "@velarscript/server": "0.25.0"
17
17
  }
18
18
  }
19
19
  ```
package/skill/ai-skill.md CHANGED
@@ -88,6 +88,16 @@ Writing the manifest yourself: `formatVersion` is required, `kind` may be
88
88
  omitted by a project that loads none, `entry` defaults to `src/main.vel`,
89
89
  `outDir` to `dist`, and `publicDir` to `public`.
90
90
 
91
+ `surfaces` is optional and records the **surface version** the project was
92
+ written against — `core`, plus one entry per activated extension. `velar create`
93
+ writes it. **Never invent the values**: read them from `velar --version`, which
94
+ prints the five the installed toolchain ships, or leave the key out. A
95
+ declaration that is present must be complete — every activated surface and no
96
+ others — and one that no longer matches what is installed is refused, naming the
97
+ surface, both numbers, and the changelog sections between them. That refusal
98
+ means the surface moved under the project: read those sections, fix the code,
99
+ then write the new number. It is not a range to widen.
100
+
91
101
  A Core project (CLI or library) loads no extensions:
92
102
 
93
103
  ```json