@hydranium/langium 1.0.0-next.31 → 1.0.0-next.315

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/README.md CHANGED
@@ -1,48 +1,20 @@
1
1
  # `@hydranium/langium`
2
2
 
3
- The pinned [Langium](https://langium.org/) re-export for the
4
- [Hydranium](https://github.com/eclipse-emfcloud/hydranium) framework — the single chokepoint every
5
- `@hydranium/*` package, and every adopter of them, imports Langium through.
6
-
7
- You do not install this for its own API: it is almost entirely passthrough. You install it because a
8
- framework package will resolve it anyway, and because importing Langium through it is how your
9
- project stays in lockstep with the version the framework was built against.
10
-
11
- ## Why this package exists
12
-
13
- Langium is pinned to **one exact version** here, to guarantee a **single physical copy** across the
14
- workspace. Re-export is transparent — given one physical install, importing `AstNode` or `URI` from
15
- `@hydranium/langium` and from `langium` yields the same class object and the same declaration. That
16
- transparency is exactly what a split install destroys: two copies of Langium mean two `AstNode`
17
- declarations and two `URI` classes, so `instanceof` and every nominal identity check across them
18
- silently start returning `false`. Without the pin, single-copy is only a semver-dedup coincidence,
19
- one minor bump away from breaking.
20
-
21
- For an **adopter**, the reason to route imports here is not runtime identity (that already holds) —
22
- it is **version coupling**. Langium sits in an atomic chain with `vscode-languageserver`,
23
- `vscode-languageserver-protocol` and `vscode-jsonrpc`, with no independently movable link. An
24
- adopter importing `langium` directly owns that pin itself and can drift out of lockstep with the
25
- framework it composes; importing it from here means the framework owns it.
26
-
27
- The chokepoint is **lint-enforced**, not merely conventional: an ESLint
28
- `no-restricted-imports` rule over `packages/**` and `examples/**` rejects direct imports of
29
- `langium`, `langium/lsp`, `langium/node`, `langium/test` and `vscode-uri` (whose `URI` Langium
30
- re-exports and owns the version of). This package itself is exempt, as is any `generated` directory —
31
- `langium-cli` emits direct imports there and rewrites them on every build, which is also why
32
- `langium` stays a declared dependency of an adopter's own package.
3
+ [Langium](https://langium.org/), re-exported for the
4
+ [Hydranium](https://github.com/eclipse-emfcloud/hydranium) framework. Import
5
+ Langium through this package so your install has one copy of it and the
6
+ framework owns the Langium version chain. `@hydranium/core` takes it as a peer,
7
+ so you install it alongside.
33
8
 
34
9
  ## What it gives you
35
10
 
36
- - Langium's full API surface, re-exported: `AstNode`, `AstUtils`, `URI`, `UriUtils`, the service
37
- types, the DI helpers — everything, unfiltered.
38
- - A subpath per upstream subpath, so `langium/lsp`, `langium/node` and `langium/test` each have a
39
- chokepoint mirror.
40
- - One ambient type augmentation: `AstNode.$synthetic`, a marker for a node that was programmatically
41
- constructed rather than parsed. Type-level only — the behaviour that reads it lives in
42
- `@hydranium/core`.
43
- - Two additions to the `UriUtils` namespace, so framework URI helpers sit beside Langium's own:
44
- `UriUtils.toUri` (normalise a `URI | string`) and `UriUtils.isAncestorOrEqual` (a scheme- and
45
- authority-aware containment check, unlike `UriUtils.contains`).
11
+ - Langium's full API, unfiltered. Replace `langium` with `@hydranium/langium` in
12
+ your imports; nothing else changes, because the symbols are the same objects.
13
+ - A mirror of each Langium subpath, so `langium/lsp`, `langium/node` and
14
+ `langium/test` go through the same pin.
15
+ - Langium and its `vscode-languageserver`, `vscode-languageserver-protocol` and
16
+ `vscode-jsonrpc` chain move together, at the versions the framework was built
17
+ against, instead of a pin you maintain yourself.
46
18
 
47
19
  ## Install
48
20
 
@@ -52,36 +24,31 @@ npm install @hydranium/langium
52
24
 
53
25
  No peer dependencies: `langium` is a direct, exact dependency of this package.
54
26
 
55
- ## Subpaths
56
-
57
- | Subpath | Re-exports | Contents |
58
- | -------- | -------------- | ----------------------------------------- |
59
- | `.` | `langium` | Core API + the framework's augmentations. |
60
- | `./lsp` | `langium/lsp` | LSP service defaults. |
61
- | `./node` | `langium/node` | `NodeFileSystem`. |
62
- | `./test` | `langium/test` | Parsing / validation test helpers. |
63
-
64
- Each named subpath also resolves as `@hydranium/langium/lib/<name>`, so a consumer on classic
65
- `moduleResolution: "Node"` can reach it.
27
+ Still declare `langium` in your own package, at the version this package pins:
28
+ the code `langium-cli` generates imports `langium` directly. If your install
29
+ resolves a second copy, the framework refuses to start your language server.
66
30
 
67
- ## Usage
31
+ ## Entry points
68
32
 
69
- Replace `langium` with `@hydranium/langium` in your import specifiers; nothing else changes, because
70
- the symbols are the same objects.
33
+ | Subpath | Use it for | Runs in |
34
+ | -------- | ----------------------------- | --------------- |
35
+ | `.` | instead of `langium` | browser-neutral |
36
+ | `./lsp` | instead of `langium/lsp` | browser-neutral |
37
+ | `./node` | instead of `langium/node` | Node-only |
38
+ | `./test` | instead of `langium/test` | Node-only |
71
39
 
72
- The one thing to know is that the root entry is **side-effecting**: importing anything from
73
- `@hydranium/langium` loads the `UriUtils` augmentation, which mutates the runtime `UriUtils` object.
74
- That is why the added helpers are visible process-wide once any framework package has loaded — and
75
- why code that imports `UriUtils` from `langium` without ever loading the framework correctly sees
76
- only the stock surface.
40
+ The subpaths need a TypeScript `moduleResolution` that reads `exports`
41
+ (`NodeNext` or `Bundler`); see *Requirements* in
42
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
77
43
 
78
44
  ## Status
79
45
 
80
- Alpha — pre-v0, not yet published. The API is Langium's and is stable to the extent Langium's is;
81
- what is not yet settled is the augmentation set and the pinned version. See the
82
- [repository README](../../README.md) for the current status and known limitations.
46
+ Alpha: every release is a prerelease that may break the API, so pin an exact
47
+ version. Guides and known limitations:
48
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
83
49
 
84
50
  ## License
85
51
 
86
52
  `MIT` — see this package's [`LICENSE`](./LICENSE), and the repository
87
- [`NOTICE.md`](../../NOTICE.md) for third-party notices.
53
+ [`NOTICE.md`](https://github.com/eclipse-emfcloud/hydranium/blob/main/NOTICE.md)
54
+ for third-party notices.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,8BAA8B,CAAC;AAEtC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,8BAA8B,CAAC;AAGtC,cAAc,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -36,5 +36,6 @@
36
36
  import './augmentations/synthetic.js';
37
37
  // Side-effecting runtime augmentation of the `UriUtils` namespace.
38
38
  import './augmentations/uri-utils.js';
39
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
39
40
  export * from 'langium';
40
41
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,oEAAoE;AACpE,OAAO,8BAA8B,CAAC;AACtC,mEAAmE;AACnE,OAAO,8BAA8B,CAAC;AAEtC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,oEAAoE;AACpE,OAAO,8BAA8B,CAAC;AACtC,mEAAmE;AACnE,OAAO,8BAA8B,CAAC;AAEtC,iIAAiI;AACjI,cAAc,SAAS,CAAC"}
package/lib/lsp.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lsp.d.ts","sourceRoot":"","sources":["../src/lsp.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"lsp.d.ts","sourceRoot":"","sources":["../src/lsp.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AAEH,cAAc,aAAa,CAAC"}
package/lib/lsp.js CHANGED
@@ -12,5 +12,6 @@
12
12
  * so framework packages and adopters reach every Langium subpath through
13
13
  * this package and inherit its version pin instead of owning one themselves.
14
14
  */
15
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
15
16
  export * from 'langium/lsp';
16
17
  //# sourceMappingURL=lsp.js.map
package/lib/lsp.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lsp.js","sourceRoot":"","sources":["../src/lsp.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"lsp.js","sourceRoot":"","sources":["../src/lsp.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,iIAAiI;AACjI,cAAc,aAAa,CAAC"}
package/lib/node.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AAEH,cAAc,cAAc,CAAC"}
package/lib/node.js CHANGED
@@ -12,5 +12,6 @@
12
12
  * framework packages and adopters reach every Langium subpath through this
13
13
  * package and inherit its version pin instead of owning one themselves.
14
14
  */
15
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
15
16
  export * from 'langium/node';
16
17
  //# sourceMappingURL=node.js.map
package/lib/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,iIAAiI;AACjI,cAAc,cAAc,CAAC"}
package/lib/test.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AAEH,cAAc,cAAc,CAAC"}
package/lib/test.js CHANGED
@@ -12,5 +12,6 @@
12
12
  * and adopters reach every Langium subpath through this package and inherit
13
13
  * its version pin instead of owning one themselves.
14
14
  */
15
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
15
16
  export * from 'langium/test';
16
17
  //# sourceMappingURL=test.js.map
package/lib/test.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;GAKG;AACH,iIAAiI;AACjI,cAAc,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/langium",
3
- "version": "1.0.0-next.31",
3
+ "version": "1.0.0-next.315",
4
4
  "description": "Augmented re-export of the Langium API for the hydranium framework: the single chokepoint where hydranium pins the Langium version and layers its type/namespace augmentations. ~99% passthrough today.",
5
5
  "keywords": [
6
6
  "hydranium",
@@ -12,20 +12,27 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/eclipse-emfcloud/hydranium/issues"
14
14
  },
15
+ "license": "MIT",
16
+ "author": {
17
+ "name": "Hydranium Team"
18
+ },
15
19
  "repository": {
16
20
  "type": "git",
17
21
  "url": "https://github.com/eclipse-emfcloud/hydranium.git",
18
22
  "directory": "packages/langium"
19
23
  },
20
- "license": "MIT",
21
- "author": {
22
- "name": "Hydranium Team"
23
- },
24
+ "files": [
25
+ "lib",
26
+ "src",
27
+ "!lib/**/*.tsbuildinfo"
28
+ ],
29
+ "type": "module",
24
30
  "sideEffects": [
25
31
  "./lib/index.js",
26
32
  "./lib/augmentations/*.js"
27
33
  ],
28
- "type": "module",
34
+ "main": "lib/index.js",
35
+ "types": "lib/index.d.ts",
29
36
  "exports": {
30
37
  ".": {
31
38
  "types": "./lib/index.d.ts",
@@ -35,38 +42,22 @@
35
42
  "types": "./lib/lsp.d.ts",
36
43
  "default": "./lib/lsp.js"
37
44
  },
38
- "./lib/lsp": {
39
- "types": "./lib/lsp.d.ts",
40
- "default": "./lib/lsp.js"
41
- },
42
45
  "./node": {
43
46
  "types": "./lib/node.d.ts",
44
47
  "default": "./lib/node.js"
45
48
  },
46
- "./lib/node": {
47
- "types": "./lib/node.d.ts",
48
- "default": "./lib/node.js"
49
- },
50
49
  "./test": {
51
50
  "types": "./lib/test.d.ts",
52
51
  "default": "./lib/test.js"
53
- },
54
- "./lib/test": {
55
- "types": "./lib/test.d.ts",
56
- "default": "./lib/test.js"
57
52
  }
58
53
  },
59
- "main": "lib/index.js",
60
- "types": "lib/index.d.ts",
61
- "files": [
62
- "lib",
63
- "src",
64
- "!lib/**/*.tsbuildinfo"
65
- ],
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
66
57
  "scripts": {
67
58
  "build": "tsc -b",
68
59
  "clean": "rimraf lib tsconfig.tsbuildinfo",
69
- "lint": "eslint src --max-warnings 0",
60
+ "lint": "oxlint --format stylish --config ../../oxlint.config.cjs src --max-warnings 0",
70
61
  "prepack": "node -e \"const m=require('./package.json'),fs=require('node:fs');const missing=[m.main,...Object.values(m.bin||{})].filter(entry=>entry&&!fs.existsSync(entry));if(missing.length){console.error('prepack '+m.name+': not built ('+missing.join(', ')+' missing). Run the build before packing: a files entry that matches nothing is skipped silently, so the tarball would ship src only.');process.exit(1);}\"",
71
62
  "test": "npm run typecheck:test && vitest run",
72
63
  "typecheck:test": "tsc --noEmit -p tsconfig.test.json",
@@ -77,14 +68,11 @@
77
68
  },
78
69
  "devDependencies": {
79
70
  "rimraf": "^5.0.0",
80
- "typescript": "^5.8.0"
71
+ "typescript": "^7.0.2"
81
72
  },
82
73
  "engines": {
83
74
  "node": ">=22.13"
84
75
  },
85
- "publishConfig": {
86
- "access": "public"
87
- },
88
- "//prepack": "The publish guard, and it deliberately is NOT a `prepare`: npm runs a workspace `prepare` BEFORE the root `postinstall` that applies patches/vscode-jsonrpc+9.0.1.patch, so building there fails on a cold clone and npm rolls the entire install back. `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. It FAILS rather than rebuilds, because the rebuild is exactly the part that ordering defeats. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error.",
76
+ "//prepack": "The publish guard, a `prepack` rather than a `prepare`: `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error.",
89
77
  "//sideEffects": "NOT `false`, and the two entries are load-bearing. `augmentations/uri-utils.js` mutates the runtime `UriUtils` object it imports from `langium`, and `index.js` is the only module that loads it — everything else there is `export * from 'langium'`. Declared side-effect-free, a bundler rewrites an import of any symbol from this package straight through to `langium` and skips `index.js` entirely, so `UriUtils.toUri` / `.isAncestorOrEqual` are simply absent at runtime. Nothing fails at build time: the augmentation is a type-level `declare module` merge, so the call still typechecks. `./lsp` and `./node` are pure passthroughs of the upstream subpaths and deliberately not listed."
90
78
  }
package/src/index.ts CHANGED
@@ -39,4 +39,5 @@ import './augmentations/synthetic.js';
39
39
  // Side-effecting runtime augmentation of the `UriUtils` namespace.
40
40
  import './augmentations/uri-utils.js';
41
41
 
42
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
42
43
  export * from 'langium';
package/src/lsp.ts CHANGED
@@ -13,4 +13,5 @@
13
13
  * so framework packages and adopters reach every Langium subpath through
14
14
  * this package and inherit its version pin instead of owning one themselves.
15
15
  */
16
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
16
17
  export * from 'langium/lsp';
package/src/node.ts CHANGED
@@ -13,4 +13,5 @@
13
13
  * framework packages and adopters reach every Langium subpath through this
14
14
  * package and inherit its version pin instead of owning one themselves.
15
15
  */
16
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
16
17
  export * from 'langium/node';
package/src/test.ts CHANGED
@@ -13,4 +13,5 @@
13
13
  * and adopters reach every Langium subpath through this package and inherit
14
14
  * its version pin instead of owning one themselves.
15
15
  */
16
+ // oxlint-disable-next-line import/export -- misreads export * from an npm package: https://github.com/oxc-project/oxc/pull/26872
16
17
  export * from 'langium/test';