@zenithbuild/language 1.3.3
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/.github/workflows/release.yml +261 -0
- package/.releaserc.json +73 -0
- package/.vscodeignore +9 -0
- package/CHANGELOG.md +50 -0
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/RELEASE_NOTES.md +24 -0
- package/assets/logo.png +0 -0
- package/bun.lock +91 -0
- package/icons/zen.icns +0 -0
- package/icons/zenith-icon-theme.json +14 -0
- package/language-configuration.json +121 -0
- package/package.json +110 -0
- package/scripts/build.js +120 -0
- package/scripts/release.ts +571 -0
- package/src/extension.ts +51 -0
- package/syntaxes/zenith.tmLanguage.json +672 -0
- package/test/fixtures/grammar-test.zen +36 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": "//",
|
|
4
|
+
"blockComment": [
|
|
5
|
+
"/*",
|
|
6
|
+
"*/"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"brackets": [
|
|
10
|
+
[
|
|
11
|
+
"{",
|
|
12
|
+
"}"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"[",
|
|
16
|
+
"]"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"(",
|
|
20
|
+
")"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"<",
|
|
24
|
+
">"
|
|
25
|
+
]
|
|
26
|
+
],
|
|
27
|
+
"autoClosingPairs": [
|
|
28
|
+
{
|
|
29
|
+
"open": "{",
|
|
30
|
+
"close": "}"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"open": "[",
|
|
34
|
+
"close": "]"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"open": "(",
|
|
38
|
+
"close": ")"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"open": "<",
|
|
42
|
+
"close": ">",
|
|
43
|
+
"notIn": [
|
|
44
|
+
"string",
|
|
45
|
+
"comment"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"open": "\"",
|
|
50
|
+
"close": "\"",
|
|
51
|
+
"notIn": [
|
|
52
|
+
"string"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"open": "'",
|
|
57
|
+
"close": "'",
|
|
58
|
+
"notIn": [
|
|
59
|
+
"string",
|
|
60
|
+
"comment"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"open": "`",
|
|
65
|
+
"close": "`",
|
|
66
|
+
"notIn": [
|
|
67
|
+
"string",
|
|
68
|
+
"comment"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"open": "<!--",
|
|
73
|
+
"close": "-->",
|
|
74
|
+
"notIn": [
|
|
75
|
+
"comment",
|
|
76
|
+
"string"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"surroundingPairs": [
|
|
81
|
+
{
|
|
82
|
+
"open": "{",
|
|
83
|
+
"close": "}"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"open": "[",
|
|
87
|
+
"close": "]"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"open": "(",
|
|
91
|
+
"close": ")"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"open": "<",
|
|
95
|
+
"close": ">"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"open": "\"",
|
|
99
|
+
"close": "\""
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"open": "'",
|
|
103
|
+
"close": "'"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"open": "`",
|
|
107
|
+
"close": "`"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"folding": {
|
|
111
|
+
"markers": {
|
|
112
|
+
"start": "^\\s*<!--\\s*#region\\b.*-->",
|
|
113
|
+
"end": "^\\s*<!--\\s*#endregion\\b.*-->"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"indentationRules": {
|
|
117
|
+
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style)\\b|[^>]*/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*</\\1>)|<!--(?!.*-->)|\\{[^}\"']*$",
|
|
118
|
+
"decreaseIndentPattern": "^\\s*(</[-_\\.A-Za-z0-9]+\\b[^>]*>|-?-->|\\})"
|
|
119
|
+
},
|
|
120
|
+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"
|
|
121
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zenithbuild/language",
|
|
3
|
+
"displayName": "Zenith Language Support",
|
|
4
|
+
"description": "Syntax highlighting, IntelliSense, and editor support for Zenith Framework (.zen files)",
|
|
5
|
+
"version": "1.3.3",
|
|
6
|
+
"publisher": "ZenithBuild",
|
|
7
|
+
"engines": {
|
|
8
|
+
"vscode": "^1.80.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./out/extension.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build:server": "cd ../zenith-language-server && bun run build",
|
|
13
|
+
"compile": "bun x esbuild src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node && cp ../zenith-language-server/dist/server.js out/server.js",
|
|
14
|
+
"watch": "bun run compile -- --watch",
|
|
15
|
+
"build:marketplace": "bun run build:server && bun run compile && node scripts/build.js marketplace",
|
|
16
|
+
"build:openvsx": "bun run build:server && bun run compile && node scripts/build.js openvsx",
|
|
17
|
+
"build:all": "bun run build:server && bun run compile && node scripts/build.js all",
|
|
18
|
+
"release": "bun run scripts/release.ts",
|
|
19
|
+
"release:dry": "bun run scripts/release.ts --dry-run",
|
|
20
|
+
"release:patch": "bun run scripts/release.ts --bump=patch",
|
|
21
|
+
"release:minor": "bun run scripts/release.ts --bump=minor",
|
|
22
|
+
"release:major": "bun run scripts/release.ts --bump=major"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"@types/vscode": "^1.80.0",
|
|
27
|
+
"esbuild": "^0.19.0",
|
|
28
|
+
"typescript": "^5.0.0"
|
|
29
|
+
},
|
|
30
|
+
"categories": [
|
|
31
|
+
"Programming Languages"
|
|
32
|
+
],
|
|
33
|
+
"icon": "assets/logo.png",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"zenith",
|
|
36
|
+
"zen",
|
|
37
|
+
"syntax",
|
|
38
|
+
"highlighting",
|
|
39
|
+
"intellisense",
|
|
40
|
+
"framework"
|
|
41
|
+
],
|
|
42
|
+
"contributes": {
|
|
43
|
+
"languages": [
|
|
44
|
+
{
|
|
45
|
+
"id": "zenith",
|
|
46
|
+
"aliases": [
|
|
47
|
+
"Zenith",
|
|
48
|
+
"zenith"
|
|
49
|
+
],
|
|
50
|
+
"extensions": [
|
|
51
|
+
".zen",
|
|
52
|
+
".zen.html",
|
|
53
|
+
".zenx"
|
|
54
|
+
],
|
|
55
|
+
"configuration": "./language-configuration.json"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"grammars": [
|
|
59
|
+
{
|
|
60
|
+
"language": "zenith",
|
|
61
|
+
"scopeName": "text.html.zenith",
|
|
62
|
+
"path": "./syntaxes/zenith.tmLanguage.json",
|
|
63
|
+
"embeddedLanguages": {
|
|
64
|
+
"source.js": "javascript",
|
|
65
|
+
"source.ts": "typescript",
|
|
66
|
+
"source.css": "css",
|
|
67
|
+
"text.html.basic": "html",
|
|
68
|
+
"meta.embedded.block.javascript": "javascript",
|
|
69
|
+
"meta.embedded.block.typescript": "typescript",
|
|
70
|
+
"meta.embedded.block.css": "css"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"configurationDefaults": {
|
|
75
|
+
"[zenith]": {
|
|
76
|
+
"editor.formatOnSave": true,
|
|
77
|
+
"editor.wordBasedSuggestions": "off",
|
|
78
|
+
"editor.suggest.insertMode": "replace",
|
|
79
|
+
"editor.semanticHighlighting.enabled": true,
|
|
80
|
+
"editor.quickSuggestions": {
|
|
81
|
+
"other": true,
|
|
82
|
+
"comments": false,
|
|
83
|
+
"strings": true
|
|
84
|
+
},
|
|
85
|
+
"editor.autoClosingBrackets": "always"
|
|
86
|
+
},
|
|
87
|
+
"emmet.includeLanguages": {
|
|
88
|
+
"zenith": "html"
|
|
89
|
+
},
|
|
90
|
+
"emmet.syntaxProfiles": {
|
|
91
|
+
"zenith": "html"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"repository": {
|
|
96
|
+
"type": "git",
|
|
97
|
+
"url": "https://github.com/zenithbuild/zenith"
|
|
98
|
+
},
|
|
99
|
+
"homepage": "https://github.com/zenithbuild/zenith#readme",
|
|
100
|
+
"bugs": {
|
|
101
|
+
"url": "https://github.com/zenithbuild/zenith/issues"
|
|
102
|
+
},
|
|
103
|
+
"publishConfig": {
|
|
104
|
+
"access": "public"
|
|
105
|
+
},
|
|
106
|
+
"license": "MIT",
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"vscode-languageclient": "^9.0.1"
|
|
109
|
+
}
|
|
110
|
+
}
|
package/scripts/build.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build script for Zenith VSCode Extension
|
|
5
|
+
* Supports dual publishing to VSCode Marketplace and Open VSX
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node scripts/build.js marketplace - Build for VSCode Marketplace (ZenithBuild)
|
|
9
|
+
* node scripts/build.js openvsx - Build for Open VSX (zenithbuild)
|
|
10
|
+
* node scripts/build.js all - Build both
|
|
11
|
+
* node scripts/build.js - Defaults to marketplace
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const { execSync } = require('child_process');
|
|
17
|
+
|
|
18
|
+
const TARGETS = {
|
|
19
|
+
marketplace: {
|
|
20
|
+
publisher: 'ZenithBuild',
|
|
21
|
+
outputSuffix: 'vscode-marketplace'
|
|
22
|
+
},
|
|
23
|
+
openvsx: {
|
|
24
|
+
publisher: 'zenithbuild',
|
|
25
|
+
outputSuffix: 'openvsx'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
30
|
+
const rootDir = path.join(__dirname, '..');
|
|
31
|
+
|
|
32
|
+
function build(target) {
|
|
33
|
+
const config = TARGETS[target];
|
|
34
|
+
if (!config) {
|
|
35
|
+
console.error(`Unknown target: ${target}`);
|
|
36
|
+
console.error('Valid targets: marketplace, openvsx, all');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log(`\nš§ Building for ${target}`);
|
|
41
|
+
console.log(` Publisher: ${config.publisher}\n`);
|
|
42
|
+
|
|
43
|
+
// Read package.json
|
|
44
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
45
|
+
const originalPublisher = packageJson.publisher;
|
|
46
|
+
const version = packageJson.version;
|
|
47
|
+
const name = packageJson.name;
|
|
48
|
+
|
|
49
|
+
// Output filename
|
|
50
|
+
const outputName = `${name}-${config.outputSuffix}.vsix`;
|
|
51
|
+
const defaultOutput = `${name}-${version}.vsix`;
|
|
52
|
+
|
|
53
|
+
// Update publisher
|
|
54
|
+
packageJson.publisher = config.publisher;
|
|
55
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4) + '\n');
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
// Run vsce package
|
|
59
|
+
console.log('š¦ Packaging extension...\n');
|
|
60
|
+
execSync('vsce package', {
|
|
61
|
+
cwd: rootDir,
|
|
62
|
+
stdio: 'inherit'
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Rename to target-specific name
|
|
66
|
+
const defaultPath = path.join(rootDir, defaultOutput);
|
|
67
|
+
const outputPath = path.join(rootDir, outputName);
|
|
68
|
+
|
|
69
|
+
if (fs.existsSync(defaultPath)) {
|
|
70
|
+
// Remove existing output if present
|
|
71
|
+
if (fs.existsSync(outputPath)) {
|
|
72
|
+
fs.unlinkSync(outputPath);
|
|
73
|
+
}
|
|
74
|
+
fs.renameSync(defaultPath, outputPath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log(`\nā
Built: ${outputName}`);
|
|
78
|
+
console.log(` Publisher: ${config.publisher}`);
|
|
79
|
+
console.log(` Version: ${version}`);
|
|
80
|
+
|
|
81
|
+
if (target === 'marketplace') {
|
|
82
|
+
console.log('\nš¤ To publish to VSCode Marketplace:');
|
|
83
|
+
console.log(' vsce publish');
|
|
84
|
+
} else {
|
|
85
|
+
console.log('\nš¤ To publish to Open VSX:');
|
|
86
|
+
console.log(` npx ovsx publish ${outputName} -p <TOKEN>`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return outputName;
|
|
90
|
+
|
|
91
|
+
} finally {
|
|
92
|
+
// Restore original publisher
|
|
93
|
+
packageJson.publisher = originalPublisher;
|
|
94
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4) + '\n');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function buildAll() {
|
|
99
|
+
console.log('š Building for all targets...\n');
|
|
100
|
+
const outputs = [];
|
|
101
|
+
|
|
102
|
+
for (const target of Object.keys(TARGETS)) {
|
|
103
|
+
outputs.push(build(target));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log('\n' + '='.repeat(50));
|
|
107
|
+
console.log('š¦ All builds complete!\n');
|
|
108
|
+
console.log('Generated files:');
|
|
109
|
+
outputs.forEach(output => console.log(` ⢠${output}`));
|
|
110
|
+
console.log('');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Get target from command line
|
|
114
|
+
const target = process.argv[2] || 'marketplace';
|
|
115
|
+
|
|
116
|
+
if (target === 'all') {
|
|
117
|
+
buildAll();
|
|
118
|
+
} else {
|
|
119
|
+
build(target);
|
|
120
|
+
}
|