@zenithbuild/language 0.6.1 → 0.7.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/README.md +15 -49
- package/language-configuration.json +52 -120
- package/out/extension.cjs +115 -0
- package/out/server.mjs +931 -0
- package/package.json +72 -95
- package/snippets/zenith.code-snippets +83 -47
- package/syntaxes/zenith.tmLanguage.json +220 -714
- package/.github/workflows/release.yml +0 -261
- package/.releaserc.json +0 -73
- package/.vscodeignore +0 -9
- package/CHANGELOG.md +0 -90
- package/RELEASE_NOTES.md +0 -30
- package/RELEASE_NOTES_v0.6.0.md +0 -26
- package/assets/logo.png +0 -0
- package/bun.lock +0 -91
- package/icons/zen.icns +0 -0
- package/icons/zenith-icon-theme.json +0 -14
- package/scripts/build.js +0 -141
- package/scripts/release.ts +0 -571
- package/src/extension.ts +0 -147
- package/test/fixtures/grammar-test.zen +0 -36
- package/test/grammar-snippets.spec.js +0 -73
- package/tsconfig.json +0 -26
package/package.json
CHANGED
|
@@ -1,54 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenithbuild/language",
|
|
3
3
|
"displayName": "Zenith Language Support",
|
|
4
|
-
"description": "
|
|
5
|
-
"version": "0.
|
|
4
|
+
"description": "Canonical Zenith syntax highlighting, snippets, and VS Code integration",
|
|
5
|
+
"version": "0.7.0",
|
|
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.
|
|
19
|
+
"vscode": "^1.90.0"
|
|
9
20
|
},
|
|
10
|
-
"main": "./out/extension.
|
|
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
|
-
"
|
|
31
|
+
"language",
|
|
32
|
+
"lsp",
|
|
47
33
|
"syntax",
|
|
48
|
-
"
|
|
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
|
+
"package:vsix": "bun run build && node scripts/package-vsix.mjs",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test": "node --test test/*.spec.mjs",
|
|
54
|
+
"prepublishOnly": "bun run build"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@zenithbuild/compiler": "0.7.0",
|
|
58
|
+
"vscode-languageserver": "^9.0.1",
|
|
59
|
+
"vscode-languageserver-textdocument": "^1.0.11",
|
|
60
|
+
"vscode-languageclient": "^9.0.1"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "latest",
|
|
64
|
+
"@types/vscode": "^1.90.0",
|
|
65
|
+
"esbuild": "^0.25.11",
|
|
66
|
+
"typescript": "^5.7.3",
|
|
67
|
+
"vscode-oniguruma": "^2.0.1",
|
|
68
|
+
"vscode-textmate": "^9.2.0"
|
|
69
|
+
},
|
|
52
70
|
"contributes": {
|
|
53
71
|
"languages": [
|
|
54
72
|
{
|
|
@@ -65,32 +83,32 @@
|
|
|
65
83
|
"configuration": "./language-configuration.json"
|
|
66
84
|
}
|
|
67
85
|
],
|
|
68
|
-
"snippets": [
|
|
69
|
-
{
|
|
70
|
-
"language": "zenith",
|
|
71
|
-
"path": "./snippets/zenith.code-snippets"
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
86
|
"grammars": [
|
|
75
87
|
{
|
|
76
88
|
"language": "zenith",
|
|
77
89
|
"scopeName": "text.html.zenith",
|
|
78
90
|
"path": "./syntaxes/zenith.tmLanguage.json",
|
|
79
91
|
"embeddedLanguages": {
|
|
80
|
-
"source.js": "javascript",
|
|
81
92
|
"source.ts": "typescript",
|
|
82
|
-
"source.
|
|
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"
|
|
93
|
+
"source.css": "css"
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
],
|
|
97
|
+
"snippets": [
|
|
98
|
+
{
|
|
99
|
+
"language": "zenith",
|
|
100
|
+
"path": "./snippets/zenith.code-snippets"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"commands": [
|
|
104
|
+
{
|
|
105
|
+
"command": "zenith.restartServer",
|
|
106
|
+
"title": "Zenith: Restart Server",
|
|
107
|
+
"category": "Zenith"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
91
110
|
"configurationDefaults": {
|
|
92
111
|
"[zenith]": {
|
|
93
|
-
"editor.formatOnSave": true,
|
|
94
112
|
"editor.wordBasedSuggestions": "off",
|
|
95
113
|
"editor.suggest.insertMode": "replace",
|
|
96
114
|
"editor.semanticHighlighting.enabled": true,
|
|
@@ -108,45 +126,19 @@
|
|
|
108
126
|
"zenith": "html"
|
|
109
127
|
}
|
|
110
128
|
},
|
|
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
129
|
"configuration": {
|
|
134
130
|
"type": "object",
|
|
135
131
|
"title": "Zenith",
|
|
136
132
|
"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
133
|
"zenith.strictDomLints": {
|
|
147
134
|
"type": "boolean",
|
|
148
135
|
"default": false,
|
|
149
|
-
"description": "
|
|
136
|
+
"description": "Report ZEN-DOM-* warnings as errors when true."
|
|
137
|
+
},
|
|
138
|
+
"zenith.enableFrameworkSnippets": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"default": false,
|
|
141
|
+
"description": "Reserved compatibility flag. Zenith ships only canonical Zenith snippets."
|
|
150
142
|
},
|
|
151
143
|
"zenith.languageServer.path": {
|
|
152
144
|
"type": "string",
|
|
@@ -155,20 +147,5 @@
|
|
|
155
147
|
}
|
|
156
148
|
}
|
|
157
149
|
}
|
|
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
150
|
}
|
|
174
151
|
}
|
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"prefix": "
|
|
2
|
+
"zen-component": {
|
|
3
|
+
"prefix": "zen-component",
|
|
4
|
+
"body": [
|
|
5
|
+
"<script lang=\"ts\">",
|
|
6
|
+
"\t$0",
|
|
7
|
+
"</script>",
|
|
8
|
+
"",
|
|
9
|
+
"<${1:main} class=\"${2:root}\">",
|
|
10
|
+
"\t",
|
|
11
|
+
"</${1:main}>"
|
|
12
|
+
],
|
|
13
|
+
"description": "Zenith component skeleton with script and markup"
|
|
14
|
+
},
|
|
15
|
+
"zen-server-script": {
|
|
16
|
+
"prefix": "zen-server-script",
|
|
17
|
+
"body": [
|
|
18
|
+
"<script server lang=\"ts\">",
|
|
19
|
+
"\t$0",
|
|
20
|
+
"</script>"
|
|
21
|
+
],
|
|
22
|
+
"description": "Server-side script block"
|
|
23
|
+
},
|
|
24
|
+
"zen-setup-script": {
|
|
25
|
+
"prefix": "zen-setup-script",
|
|
26
|
+
"body": [
|
|
27
|
+
"<script setup=\"ts\">",
|
|
28
|
+
"import ${1:Component} from \"${2:@/components/${1:Component}.zen}\"",
|
|
29
|
+
"",
|
|
30
|
+
"$0",
|
|
31
|
+
"</script>"
|
|
32
|
+
],
|
|
33
|
+
"description": "Setup script block with component import"
|
|
34
|
+
},
|
|
35
|
+
"zen-guard-load": {
|
|
36
|
+
"prefix": "zen-guard-load",
|
|
37
|
+
"body": [
|
|
38
|
+
"<script server lang=\"ts\">",
|
|
39
|
+
"import { allow, redirect, deny, data } from '@zenithbuild/core/server'",
|
|
40
|
+
"",
|
|
41
|
+
"export const guard = async (ctx) => {",
|
|
42
|
+
"\t${1:// return allow(), redirect(url), or deny()}",
|
|
43
|
+
"\treturn allow()",
|
|
44
|
+
"}",
|
|
45
|
+
"",
|
|
46
|
+
"export const load = async (ctx) => {",
|
|
47
|
+
"\t$0",
|
|
48
|
+
"\treturn data({})",
|
|
49
|
+
"}",
|
|
50
|
+
"</script>"
|
|
51
|
+
],
|
|
52
|
+
"description": "Route guard and load pattern for protected routes"
|
|
53
|
+
},
|
|
54
|
+
"state-toggle": {
|
|
55
|
+
"prefix": "state-toggle",
|
|
4
56
|
"body": [
|
|
5
57
|
"state ${1:open} = false",
|
|
6
58
|
"function toggle${1/(.*)/${1:/capitalize}/}() { ${1:open} = !${1:open} }",
|
|
@@ -8,87 +60,71 @@
|
|
|
8
60
|
],
|
|
9
61
|
"description": "State variable with toggle function"
|
|
10
62
|
},
|
|
11
|
-
"
|
|
12
|
-
"prefix": "signal
|
|
63
|
+
"signal-counter": {
|
|
64
|
+
"prefix": "signal-counter",
|
|
13
65
|
"body": [
|
|
14
66
|
"const ${1:count} = signal(${2:0})",
|
|
67
|
+
"${1:count}.set(${1:count}.get() + 1)",
|
|
15
68
|
"$0"
|
|
16
69
|
],
|
|
17
|
-
"description": "Signal with get/set"
|
|
70
|
+
"description": "Signal with explicit get/set"
|
|
18
71
|
},
|
|
19
|
-
"
|
|
20
|
-
"prefix": "ref
|
|
72
|
+
"ref-dom": {
|
|
73
|
+
"prefix": "ref-dom",
|
|
21
74
|
"body": [
|
|
22
|
-
"const ${1:
|
|
75
|
+
"const ${1:node} = ref<${2:HTMLElement}>()",
|
|
23
76
|
"$0"
|
|
24
77
|
],
|
|
25
|
-
"description": "Ref for DOM node"
|
|
78
|
+
"description": "Ref for a DOM node"
|
|
26
79
|
},
|
|
27
|
-
"
|
|
28
|
-
"prefix": "
|
|
80
|
+
"zenmount-cleanup": {
|
|
81
|
+
"prefix": "zenmount-cleanup",
|
|
29
82
|
"body": [
|
|
30
83
|
"zenMount((ctx) => {",
|
|
31
84
|
"\t$0",
|
|
32
|
-
"\tctx.cleanup(${1:
|
|
85
|
+
"\tctx.cleanup(${1:dispose})",
|
|
33
86
|
"})"
|
|
34
87
|
],
|
|
35
|
-
"description": "zenMount with
|
|
88
|
+
"description": "zenMount with registered cleanup"
|
|
36
89
|
},
|
|
37
|
-
"
|
|
38
|
-
"prefix": "
|
|
90
|
+
"zeneffect-basic": {
|
|
91
|
+
"prefix": "zeneffect-basic",
|
|
39
92
|
"body": [
|
|
40
93
|
"zenEffect(() => {",
|
|
41
94
|
"\t$0",
|
|
42
95
|
"})"
|
|
43
96
|
],
|
|
44
|
-
"description": "
|
|
97
|
+
"description": "Basic zenEffect pattern"
|
|
45
98
|
},
|
|
46
|
-
"
|
|
47
|
-
"prefix": "
|
|
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",
|
|
99
|
+
"zenon-keydown-escape": {
|
|
100
|
+
"prefix": "zenon-keydown-escape",
|
|
57
101
|
"body": [
|
|
58
102
|
"const doc = zenDocument()",
|
|
59
103
|
"if (!doc) return",
|
|
60
|
-
"const offKey = zenOn(doc, 'keydown', (
|
|
61
|
-
"\tif (
|
|
104
|
+
"const offKey = zenOn(doc, 'keydown', (event) => {",
|
|
105
|
+
"\tif (event.key === 'Escape') ${1:closeMenu}()",
|
|
62
106
|
"})",
|
|
63
107
|
"ctx.cleanup(offKey)",
|
|
64
108
|
"$0"
|
|
65
109
|
],
|
|
66
|
-
"description": "
|
|
110
|
+
"description": "Escape key listener via zenOn"
|
|
67
111
|
},
|
|
68
|
-
"
|
|
69
|
-
"prefix": "
|
|
112
|
+
"zenresize-viewport": {
|
|
113
|
+
"prefix": "zenresize-viewport",
|
|
70
114
|
"body": [
|
|
71
|
-
"const
|
|
115
|
+
"const offResize = zenResize(({ w, h }) => {",
|
|
72
116
|
"\t$0",
|
|
73
117
|
"})",
|
|
74
|
-
"ctx.cleanup(
|
|
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"
|
|
118
|
+
"ctx.cleanup(offResize)"
|
|
83
119
|
],
|
|
84
|
-
"description": "
|
|
120
|
+
"description": "Viewport resize handling via zenResize"
|
|
85
121
|
},
|
|
86
|
-
"
|
|
87
|
-
"prefix": "
|
|
122
|
+
"collectrefs": {
|
|
123
|
+
"prefix": "collectrefs",
|
|
88
124
|
"body": [
|
|
89
|
-
"
|
|
125
|
+
"const nodes = collectRefs(${1:firstRef}, ${2:secondRef}, ${3:thirdRef})",
|
|
90
126
|
"$0"
|
|
91
127
|
],
|
|
92
|
-
"description": "
|
|
128
|
+
"description": "Collect multiple refs deterministically"
|
|
93
129
|
}
|
|
94
130
|
}
|