@valbuild/language-server 0.132.0 → 0.133.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @valbuild/language-server
|
|
2
2
|
|
|
3
|
+
## 0.133.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`802412b`](https://github.com/valbuild/val/commit/802412b92c06bc1abbca78c86885e39c8710dd83)]:
|
|
8
|
+
- @valbuild/server@0.133.0
|
|
9
|
+
- @valbuild/shared@0.133.0
|
|
10
|
+
|
|
11
|
+
## 0.132.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#685](https://github.com/valbuild/val/pull/685) [`f2ac188`](https://github.com/valbuild/val/commit/f2ac1887c11397b597081eef7206063b52b21c5b) Thanks [@freekh](https://github.com/freekh)! - Editor clients: resolve the language server through `@valbuild/tanstack` too
|
|
16
|
+
|
|
17
|
+
`@valbuild/language-server` ships inside Val's framework bindings and its CLI —
|
|
18
|
+
`@valbuild/next`, `@valbuild/tanstack` and `@valbuild/cli` — but the resolution
|
|
19
|
+
recipes in this package's README, which exist to be copied into an editor
|
|
20
|
+
client, only ever anchored on `next` and `cli`.
|
|
21
|
+
|
|
22
|
+
Under pnpm's isolated `node_modules` a transitive dependency is reachable _only_
|
|
23
|
+
through a package the project declares, so a client built from those snippets
|
|
24
|
+
finds nothing at all in a TanStack Start project. The Neovim configuration in
|
|
25
|
+
here then tells the user to upgrade `@valbuild/next` — a package they do not
|
|
26
|
+
have and should not add.
|
|
27
|
+
|
|
28
|
+
The snippets now anchor on `@valbuild/tanstack` as well, and point at the better
|
|
29
|
+
version of the rule: read the project's own `@valbuild/*` dependencies out of its
|
|
30
|
+
`package.json` and try those first, so the framework binding after this one works
|
|
31
|
+
with no client release. Docs only — the server itself is unchanged, and the VS
|
|
32
|
+
Code extension already resolved this way.
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [[`c07b1ab`](https://github.com/valbuild/val/commit/c07b1abe30e226c80ef7ec4b4f0f5ccdae061c11), [`cbfa2b8`](https://github.com/valbuild/val/commit/cbfa2b884898f1603bde8e5aa5cd9da78778101f)]:
|
|
35
|
+
- @valbuild/server@0.132.1
|
|
36
|
+
|
|
3
37
|
## 0.132.0
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
The Val language server: validation, quick fixes and completions for `*.val.ts`
|
|
4
4
|
files, over the Language Server Protocol.
|
|
5
5
|
|
|
6
|
-
It ships **inside Val**, as a dependency of
|
|
7
|
-
`@valbuild/
|
|
8
|
-
|
|
6
|
+
It ships **inside Val**, as a dependency of the framework bindings and the CLI —
|
|
7
|
+
`@valbuild/next`, `@valbuild/tanstack` and `@valbuild/cli`. Not of every
|
|
8
|
+
`@valbuild/*` a project depends on: `@valbuild/core` and `@valbuild/server`
|
|
9
|
+
could not carry it without a cycle, since the server depends on them. You do not
|
|
10
|
+
install it — a project on a recent enough Val already has it. That is the point: an editor client resolves the server out of
|
|
9
11
|
the user's own `node_modules`, so one published client works against every
|
|
10
12
|
version of Val, and a feature Val gains works without an editor release.
|
|
11
13
|
|
|
@@ -45,18 +47,34 @@ import { createRequire } from "node:module";
|
|
|
45
47
|
|
|
46
48
|
const rootPkg = path.join(projectRoot, "package.json");
|
|
47
49
|
// A direct dependency wins; otherwise go through whichever package carries it.
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
// One anchor per framework binding, plus the CLI. @valbuild/core and
|
|
51
|
+
// @valbuild/server are NOT valid anchors -- they do not depend on the language
|
|
52
|
+
// server, and could not without a cycle. Better still: read the project's own
|
|
53
|
+
// @valbuild/* dependencies out of its package.json and try those first, so a
|
|
54
|
+
// framework package added after your client shipped resolves anyway.
|
|
55
|
+
for (const anchor of [
|
|
56
|
+
null,
|
|
57
|
+
"@valbuild/next",
|
|
58
|
+
"@valbuild/tanstack",
|
|
59
|
+
"@valbuild/cli",
|
|
60
|
+
]) {
|
|
61
|
+
// The try/catch is load-bearing, not defensive: `resolve` THROWS when it
|
|
62
|
+
// finds nothing. Under pnpm the first (`null`) attempt is exactly that case,
|
|
63
|
+
// so without it the anchors below are never reached and the recipe fails on
|
|
64
|
+
// the one layout it exists for.
|
|
65
|
+
try {
|
|
66
|
+
const from =
|
|
67
|
+
anchor === null
|
|
68
|
+
? rootPkg
|
|
69
|
+
: createRequire(rootPkg).resolve(`${anchor}/package.json`);
|
|
70
|
+
const pkgPath = createRequire(from).resolve(
|
|
71
|
+
"@valbuild/language-server/package.json",
|
|
72
|
+
);
|
|
73
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
74
|
+
return path.resolve(path.dirname(pkgPath), pkg.bin["val-language-server"]);
|
|
75
|
+
} catch {
|
|
76
|
+
// Not reachable through this anchor. Try the next.
|
|
77
|
+
}
|
|
60
78
|
}
|
|
61
79
|
```
|
|
62
80
|
|
|
@@ -238,7 +256,7 @@ local RESOLVE = [[
|
|
|
238
256
|
const { createRequire } = require("node:module");
|
|
239
257
|
const fs = require("fs"), path = require("path");
|
|
240
258
|
const rootPkg = path.join(process.argv[2], "package.json");
|
|
241
|
-
for (const anchor of [null, "@valbuild/next", "@valbuild/cli"]) {
|
|
259
|
+
for (const anchor of [null, "@valbuild/next", "@valbuild/tanstack", "@valbuild/cli"]) {
|
|
242
260
|
try {
|
|
243
261
|
const from = anchor === null
|
|
244
262
|
? rootPkg
|
|
@@ -269,7 +287,7 @@ local function val_server_cmd(root)
|
|
|
269
287
|
-- its dependencies are not installed. Say so rather than starting nothing.
|
|
270
288
|
vim.notify(
|
|
271
289
|
"Val: no @valbuild/language-server in " .. root ..
|
|
272
|
-
" -- upgrade @valbuild/next or @valbuild/cli.",
|
|
290
|
+
" -- upgrade @valbuild/next, @valbuild/tanstack or @valbuild/cli.",
|
|
273
291
|
vim.log.levels.WARN
|
|
274
292
|
)
|
|
275
293
|
return nil
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lsp",
|
|
12
12
|
"language-server"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.133.0",
|
|
15
15
|
"bin": {
|
|
16
16
|
"val-language-server": "./bin.js"
|
|
17
17
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
30
|
"vscode-languageserver": "^10.1.0",
|
|
31
31
|
"vscode-languageserver-textdocument": "^1.0.14",
|
|
32
|
-
"@valbuild/
|
|
33
|
-
"@valbuild/
|
|
34
|
-
"@valbuild/
|
|
32
|
+
"@valbuild/core": "0.130.0",
|
|
33
|
+
"@valbuild/server": "0.133.0",
|
|
34
|
+
"@valbuild/shared": "0.133.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/jest": "^30.0.0",
|