@zenithbuild/language 0.6.1 → 0.6.17

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/package.json CHANGED
@@ -1,54 +1,68 @@
1
1
  {
2
2
  "name": "@zenithbuild/language",
3
3
  "displayName": "Zenith Language Support",
4
- "description": "Syntax highlighting, IntelliSense, and editor support for Zenith Framework (.zen files)",
5
- "version": "0.6.1",
4
+ "description": "Canonical Zenith syntax highlighting, snippets, and VS Code integration",
5
+ "version": "0.6.17",
6
6
  "publisher": "ZenithBuild",
7
+ "license": "MIT",
8
+ "private": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/zenithbuild/framework",
12
+ "directory": "packages/language"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/zenithbuild/framework/issues"
16
+ },
17
+ "homepage": "https://github.com/zenithbuild/framework#readme",
7
18
  "engines": {
8
- "vscode": "^1.80.0"
19
+ "vscode": "^1.90.0"
9
20
  },
10
- "main": "./out/extension.js",
21
+ "main": "./out/extension.cjs",
11
22
  "activationEvents": [
12
23
  "onLanguage:zenith",
13
- "onCommand:zenith.runContractPack",
14
- "onCommand:zenith.runLegacyTests",
15
- "onCommand:zenith.build",
16
24
  "onCommand:zenith.restartServer"
17
25
  ],
18
- "scripts": {
19
- "test": "node --test test/grammar-snippets.spec.js",
20
- "build:server": "cd ../zenith-language-server && bun run build",
21
- "compile": "bun x esbuild src/extension.ts --bundle --outfile=out/extension.js --external:vscode --external:vscode-languageclient/node --format=cjs --platform=node && cp ../zenith-language-server/dist/server.js out/server.js",
22
- "watch": "bun run compile -- --watch",
23
- "build:markplace": "bun run build:marketplace",
24
- "build:marketplace": "bun run build:server && bun run compile && node scripts/build.js marketplace",
25
- "build:openvsx": "bun run build:server && bun run compile && node scripts/build.js openvsx",
26
- "build:all": "bun run build:server && bun run compile && node scripts/build.js all",
27
- "release": "bun run scripts/release.ts",
28
- "release:dry": "bun run scripts/release.ts --dry-run",
29
- "release:patch": "bun run scripts/release.ts --bump=patch",
30
- "release:minor": "bun run scripts/release.ts --bump=minor",
31
- "release:major": "bun run scripts/release.ts --bump=major",
32
- "build": "tsc"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^20.0.0",
36
- "@types/vscode": "^1.80.0",
37
- "esbuild": "^0.19.0",
38
- "typescript": "^5.0.0"
39
- },
40
26
  "categories": [
41
27
  "Programming Languages"
42
28
  ],
43
- "icon": "assets/logo.png",
44
29
  "keywords": [
45
30
  "zenith",
46
- "zen",
31
+ "language",
32
+ "lsp",
47
33
  "syntax",
48
- "highlighting",
49
- "intellisense",
50
- "framework"
34
+ "tooling"
51
35
  ],
36
+ "files": [
37
+ "out",
38
+ "snippets",
39
+ "syntaxes",
40
+ "language-configuration.json",
41
+ "README.md",
42
+ "LICENSE",
43
+ "package.json"
44
+ ],
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "scripts": {
49
+ "build": "bun run build:server && rm -rf out && mkdir -p out && bun x esbuild src/extension.ts --bundle --outfile=out/extension.cjs --external:vscode --external:vscode-languageclient/node --format=cjs --platform=node && cp ../language-server/dist/server.mjs out/server.mjs",
50
+ "build:server": "bun run --cwd ../language-server build",
51
+ "typecheck": "tsc -p tsconfig.json --noEmit",
52
+ "test": "node --test test/*.spec.mjs",
53
+ "prepublishOnly": "bun run build"
54
+ },
55
+ "dependencies": {
56
+ "vscode-languageclient": "^9.0.1"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "latest",
60
+ "@types/vscode": "^1.90.0",
61
+ "esbuild": "^0.25.11",
62
+ "typescript": "^5.7.3",
63
+ "vscode-oniguruma": "^2.0.1",
64
+ "vscode-textmate": "^9.2.0"
65
+ },
52
66
  "contributes": {
53
67
  "languages": [
54
68
  {
@@ -65,32 +79,32 @@
65
79
  "configuration": "./language-configuration.json"
66
80
  }
67
81
  ],
68
- "snippets": [
69
- {
70
- "language": "zenith",
71
- "path": "./snippets/zenith.code-snippets"
72
- }
73
- ],
74
82
  "grammars": [
75
83
  {
76
84
  "language": "zenith",
77
85
  "scopeName": "text.html.zenith",
78
86
  "path": "./syntaxes/zenith.tmLanguage.json",
79
87
  "embeddedLanguages": {
80
- "source.js": "javascript",
81
88
  "source.ts": "typescript",
82
- "source.ts.embedded.zenith": "typescript",
83
- "source.css": "css",
84
- "text.html.basic": "html",
85
- "meta.embedded.block.javascript": "javascript",
86
- "meta.embedded.block.typescript": "typescript",
87
- "meta.embedded.block.css": "css"
89
+ "source.css": "css"
88
90
  }
89
91
  }
90
92
  ],
93
+ "snippets": [
94
+ {
95
+ "language": "zenith",
96
+ "path": "./snippets/zenith.code-snippets"
97
+ }
98
+ ],
99
+ "commands": [
100
+ {
101
+ "command": "zenith.restartServer",
102
+ "title": "Zenith: Restart Server",
103
+ "category": "Zenith"
104
+ }
105
+ ],
91
106
  "configurationDefaults": {
92
107
  "[zenith]": {
93
- "editor.formatOnSave": true,
94
108
  "editor.wordBasedSuggestions": "off",
95
109
  "editor.suggest.insertMode": "replace",
96
110
  "editor.semanticHighlighting.enabled": true,
@@ -108,45 +122,19 @@
108
122
  "zenith": "html"
109
123
  }
110
124
  },
111
- "commands": [
112
- {
113
- "command": "zenith.runContractPack",
114
- "title": "Zenith: Run Contract Pack",
115
- "category": "Zenith"
116
- },
117
- {
118
- "command": "zenith.runLegacyTests",
119
- "title": "Zenith: Run Legacy Tests",
120
- "category": "Zenith"
121
- },
122
- {
123
- "command": "zenith.build",
124
- "title": "Zenith: Build",
125
- "category": "Zenith"
126
- },
127
- {
128
- "command": "zenith.restartServer",
129
- "title": "Zenith: Restart Server",
130
- "category": "Zenith"
131
- }
132
- ],
133
125
  "configuration": {
134
126
  "type": "object",
135
127
  "title": "Zenith",
136
128
  "properties": {
137
- "zenith.componentScripts": {
138
- "type": "string",
139
- "enum": [
140
- "forbid",
141
- "allow"
142
- ],
143
- "default": "forbid",
144
- "description": "Component script contract mode. 'forbid' enforces structural-only components; 'allow' disables this diagnostic."
145
- },
146
129
  "zenith.strictDomLints": {
147
130
  "type": "boolean",
148
131
  "default": false,
149
- "description": "When true, ZEN-DOM-* lints (querySelector, addEventListener, etc.) are reported as errors instead of warnings."
132
+ "description": "Report ZEN-DOM-* warnings as errors when true."
133
+ },
134
+ "zenith.enableFrameworkSnippets": {
135
+ "type": "boolean",
136
+ "default": false,
137
+ "description": "Reserved compatibility flag. Zenith ships only canonical Zenith snippets."
150
138
  },
151
139
  "zenith.languageServer.path": {
152
140
  "type": "string",
@@ -155,20 +143,5 @@
155
143
  }
156
144
  }
157
145
  }
158
- },
159
- "repository": {
160
- "type": "git",
161
- "url": "https://github.com/zenithbuild/zenith"
162
- },
163
- "homepage": "https://github.com/zenithbuild/zenith#readme",
164
- "bugs": {
165
- "url": "https://github.com/zenithbuild/zenith/issues"
166
- },
167
- "publishConfig": {
168
- "access": "public"
169
- },
170
- "license": "MIT",
171
- "dependencies": {
172
- "vscode-languageclient": "^9.0.1"
173
146
  }
174
147
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "State Toggle": {
3
- "prefix": "state toggle",
2
+ "state-toggle": {
3
+ "prefix": "state-toggle",
4
4
  "body": [
5
5
  "state ${1:open} = false",
6
6
  "function toggle${1/(.*)/${1:/capitalize}/}() { ${1:open} = !${1:open} }",
@@ -8,87 +8,71 @@
8
8
  ],
9
9
  "description": "State variable with toggle function"
10
10
  },
11
- "Signal Counter": {
12
- "prefix": "signal counter",
11
+ "signal-counter": {
12
+ "prefix": "signal-counter",
13
13
  "body": [
14
14
  "const ${1:count} = signal(${2:0})",
15
+ "${1:count}.set(${1:count}.get() + 1)",
15
16
  "$0"
16
17
  ],
17
- "description": "Signal with get/set"
18
+ "description": "Signal with explicit get/set"
18
19
  },
19
- "Ref DOM": {
20
- "prefix": "ref dom",
20
+ "ref-dom": {
21
+ "prefix": "ref-dom",
21
22
  "body": [
22
- "const ${1:el} = ref<${2:HTMLElement}>()",
23
+ "const ${1:node} = ref<${2:HTMLElement}>()",
23
24
  "$0"
24
25
  ],
25
- "description": "Ref for DOM node"
26
+ "description": "Ref for a DOM node"
26
27
  },
27
- "zenMount Cleanup": {
28
- "prefix": "zenMount cleanup",
28
+ "zenmount-cleanup": {
29
+ "prefix": "zenmount-cleanup",
29
30
  "body": [
30
31
  "zenMount((ctx) => {",
31
32
  "\t$0",
32
- "\tctx.cleanup(${1:disposer})",
33
+ "\tctx.cleanup(${1:dispose})",
33
34
  "})"
34
35
  ],
35
- "description": "zenMount with ctx.cleanup for disposers"
36
+ "description": "zenMount with registered cleanup"
36
37
  },
37
- "zenEffect Pattern": {
38
- "prefix": "zenEffect pattern",
38
+ "zeneffect-basic": {
39
+ "prefix": "zeneffect-basic",
39
40
  "body": [
40
41
  "zenEffect(() => {",
41
42
  "\t$0",
42
43
  "})"
43
44
  ],
44
- "description": "Reactive effect"
45
+ "description": "Basic zenEffect pattern"
45
46
  },
46
- "zenWindow": {
47
- "prefix": "zenWindow",
48
- "body": [
49
- "const win = zenWindow()",
50
- "if (!win) return",
51
- "$0"
52
- ],
53
- "description": "SSR-safe window access"
54
- },
55
- "zenOn Keydown Escape": {
56
- "prefix": "zenOn keydown escape",
47
+ "zenon-keydown-escape": {
48
+ "prefix": "zenon-keydown-escape",
57
49
  "body": [
58
50
  "const doc = zenDocument()",
59
51
  "if (!doc) return",
60
- "const offKey = zenOn(doc, 'keydown', (e) => {",
61
- "\tif (e.key === 'Escape') ${1:closeMenu}()",
52
+ "const offKey = zenOn(doc, 'keydown', (event) => {",
53
+ "\tif (event.key === 'Escape') ${1:closeMenu}()",
62
54
  "})",
63
55
  "ctx.cleanup(offKey)",
64
56
  "$0"
65
57
  ],
66
- "description": "zenOn keydown with Escape handler (use inside zenMount)"
58
+ "description": "Escape key listener via zenOn"
67
59
  },
68
- "zenResize Viewport": {
69
- "prefix": "zenResize viewport",
60
+ "zenresize-viewport": {
61
+ "prefix": "zenresize-viewport",
70
62
  "body": [
71
- "const off = zenResize(({ w, h }) => {",
63
+ "const offResize = zenResize(({ w, h }) => {",
72
64
  "\t$0",
73
65
  "})",
74
- "ctx.cleanup(off)"
75
- ],
76
- "description": "zenResize with ctx.cleanup (use inside zenMount)"
77
- },
78
- "collectRefs Links": {
79
- "prefix": "collectRefs links",
80
- "body": [
81
- "const nodes = collectRefs(${1:refA}, ${2:refB}, ${3:refC})",
82
- "$0"
66
+ "ctx.cleanup(offResize)"
83
67
  ],
84
- "description": "Collect multiple refs into node list"
68
+ "description": "Viewport resize handling via zenResize"
85
69
  },
86
- "on:click Handler": {
87
- "prefix": "on:click",
70
+ "collectrefs": {
71
+ "prefix": "collectrefs",
88
72
  "body": [
89
- "on:click={${1:handler}}",
73
+ "const nodes = collectRefs(${1:firstRef}, ${2:secondRef}, ${3:thirdRef})",
90
74
  "$0"
91
75
  ],
92
- "description": "Canonical event binding"
76
+ "description": "Collect multiple refs deterministically"
93
77
  }
94
78
  }