feat: prepare VS Code extension for marketplace
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
.vscode/**
|
||||
test/**
|
||||
PUBLISHING.md
|
||||
icons/*.svg
|
||||
*.vsix
|
||||
**/*.ts
|
||||
**/*.map
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 0.2.1
|
||||
|
||||
- Prepared the extension manifest, branding, documentation, and PNG icon for the
|
||||
Visual Studio Marketplace.
|
||||
- Added repeatable build, validation, packaging, and publishing instructions.
|
||||
- Documented formatter setup and the extension's no-telemetry policy.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
- Added native Format Document and format-on-save support for `.wrn` files.
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Publishing the WRNexus VS Code extension
|
||||
|
||||
The Marketplace extension identifier is `wrnexus.wrnexus`. The `wrnexus`
|
||||
publisher must exist in the Visual Studio Marketplace and the publishing
|
||||
identity must have permission to manage it.
|
||||
|
||||
## Build and inspect the VSIX
|
||||
|
||||
From `editors/vscode`:
|
||||
|
||||
```powershell
|
||||
bun install
|
||||
bun run check
|
||||
bun run package
|
||||
```
|
||||
|
||||
Install the resulting `wrnexus-<version>.vsix` in a clean VS Code profile and
|
||||
verify highlighting, Format Document, completion, snippets, and diagnostics on
|
||||
a `.wrn` file.
|
||||
|
||||
## Publish
|
||||
|
||||
Choose one of these supported routes:
|
||||
|
||||
1. Upload the verified VSIX through the Visual Studio Marketplace publisher
|
||||
management page.
|
||||
2. Authenticate `vsce` for the `wrnexus` publisher and run:
|
||||
|
||||
```powershell
|
||||
bun run publish
|
||||
```
|
||||
|
||||
Never commit an Azure token or place it in a command-line argument. For local
|
||||
token-based publishing, provide it through the `VSCE_PAT` environment variable.
|
||||
For automated publishing, prefer a protected CI secret or Microsoft Entra ID.
|
||||
|
||||
Before each release, increment `version` in `package.json`, update
|
||||
`CHANGELOG.md`, run the checks, and inspect the VSIX contents printed by `vsce`.
|
||||
+41
-10
@@ -1,8 +1,20 @@
|
||||
# WrNexus for VS Code
|
||||
# WRNexus Language Support
|
||||
|
||||
Language support for [WrNexus](https://github.com/) `.wrn` files — the SSR-first,
|
||||
Language support for [WRNexus](https://wrnexusjs.dev) `.wrn` files — the SSR-first,
|
||||
Bun-powered full-stack framework.
|
||||
|
||||
## Installation
|
||||
|
||||
After the first Marketplace release, search for **WRNexus Language Support** in
|
||||
VS Code or run:
|
||||
|
||||
```text
|
||||
ext install wrnexus.wrnexus
|
||||
```
|
||||
|
||||
For a local package, open the Command Palette, choose **Extensions: Install from
|
||||
VSIX**, and select the generated `wrnexus-<version>.vsix` file.
|
||||
|
||||
## Features
|
||||
|
||||
- **Syntax highlighting** ("color-full code"). Keywords (`page`, `component`,
|
||||
@@ -36,19 +48,38 @@ Bun-powered full-stack framework.
|
||||
| `wrnexus.diagnostics.enable` | `true` | Show parse errors for `.wrn` files. |
|
||||
| `wrnexus.format.enable` | `true` | Enable the built-in formatter for `.wrn`. |
|
||||
|
||||
## Building the diagnostics engine
|
||||
To format automatically when saving, add this to VS Code settings:
|
||||
|
||||
Diagnostics use a bundled copy of the compiler. Regenerate it after changing
|
||||
`@wrnexus/compiler`:
|
||||
|
||||
```bash
|
||||
bun run build:compiler # writes src/compiler.cjs
|
||||
```json
|
||||
"[wrn]": {
|
||||
"editor.defaultFormatter": "wrnexus.wrnexus",
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
```
|
||||
|
||||
The extension still highlights, snippets and completes without the bundle; only
|
||||
inline error reporting requires it.
|
||||
## Privacy
|
||||
|
||||
The extension does not collect telemetry and does not send source code or usage
|
||||
data over the network. Formatting, completion, and diagnostics run locally.
|
||||
|
||||
## Development
|
||||
|
||||
Diagnostics use a bundled copy of the compiler. Build and validate everything
|
||||
after changing the extension or `@wrnexus/compiler`:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
bun run check
|
||||
bun run package
|
||||
```
|
||||
|
||||
`bun run package` creates `wrnexus-<version>.vsix`. The extension still
|
||||
highlights, provides snippets, and completes without the compiler bundle; only
|
||||
inline error reporting requires it.
|
||||
|
||||
Open this folder in VS Code and press <kbd>F5</kbd> to launch an Extension
|
||||
Development Host, then open any `.wrn` file.
|
||||
|
||||
See the
|
||||
[Marketplace publishing guide](https://git.workroot.in/WorkRoot/WRNexusJS/src/branch/main/editors/vscode/PUBLISHING.md)
|
||||
for the release procedure.
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
For bugs, feature requests, and publishing issues, open an issue in the WrNexus repository:
|
||||
|
||||
https://github.com/wrnexus/wrnexus/issues
|
||||
https://git.workroot.in/WorkRoot/WRNexusJS/issues
|
||||
|
||||
Please include your VS Code version, extension version, operating system, and a small `.wrn` sample when reporting language support problems.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Generated
+3
-3
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "wrnexus",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wrnexus",
|
||||
"version": "0.2.0",
|
||||
"license": "MIT",
|
||||
"version": "0.2.1",
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"devDependencies": {
|
||||
"@vscode/vsce": "^3.9.2"
|
||||
},
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
{
|
||||
"name": "wrnexus",
|
||||
"displayName": "WrNexus (.wrn)",
|
||||
"displayName": "WRNexus Language Support",
|
||||
"description": "Syntax highlighting, formatting, diagnostics, snippets and completions for WrNexus .wrn files.",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"publisher": "wrnexus",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"icon": "icons/wrn.png",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wrnexus/wrnexus.git",
|
||||
"url": "https://git.workroot.in/WorkRoot/WRNexusJS.git",
|
||||
"directory": "editors/vscode"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/wrnexus/wrnexus/issues"
|
||||
"url": "https://git.workroot.in/WorkRoot/WRNexusJS/issues"
|
||||
},
|
||||
"homepage": "https://github.com/wrnexus/wrnexus#readme",
|
||||
"homepage": "https://wrnexusjs.dev",
|
||||
"qna": "https://git.workroot.in/WorkRoot/WRNexusJS/issues",
|
||||
"galleryBanner": {
|
||||
"color": "#0b1021",
|
||||
"theme": "dark"
|
||||
@@ -32,6 +35,10 @@
|
||||
"wire",
|
||||
"wrnexus",
|
||||
"wrn",
|
||||
"wirejs",
|
||||
"language support",
|
||||
"formatter",
|
||||
"syntax highlighting",
|
||||
"full-stack",
|
||||
"ssr",
|
||||
"bun"
|
||||
@@ -53,8 +60,8 @@
|
||||
],
|
||||
"configuration": "./language-configuration.json",
|
||||
"icon": {
|
||||
"light": "./icons/wrn.svg",
|
||||
"dark": "./icons/wrn.svg"
|
||||
"light": "./icons/wrn.png",
|
||||
"dark": "./icons/wrn.png"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -148,8 +155,10 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build:compiler": "bun build ../../packages/compiler/src/index.ts --target=node --format=cjs --outfile=src/compiler.cjs",
|
||||
"build": "bun run build:compiler",
|
||||
"validate": "node test/validate.mjs",
|
||||
"vscode:prepublish": "bun run build:compiler",
|
||||
"check": "bun run build && bun run validate",
|
||||
"vscode:prepublish": "bun run check",
|
||||
"package": "vsce package --no-dependencies",
|
||||
"publish": "vsce publish --no-dependencies",
|
||||
"publish:azure": "vsce publish --no-dependencies --azure-credential"
|
||||
|
||||
@@ -22,6 +22,7 @@ for (const rel of [
|
||||
"package.json",
|
||||
"language-configuration.json",
|
||||
"syntaxes/wrn.tmLanguage.json",
|
||||
"syntaxes/wrn.injection.tmLanguage.json",
|
||||
"snippets/wrn.json",
|
||||
]) {
|
||||
try {
|
||||
@@ -36,7 +37,27 @@ for (const rel of [
|
||||
const grammar = JSON.parse(readFileSync(join(root, "syntaxes/wrn.tmLanguage.json"), "utf8"));
|
||||
grammar.scopeName === "source.wrn" ? ok("grammar scopeName") : bad("grammar scopeName");
|
||||
|
||||
// 3. Bundled compiler: valid source compiles, invalid source throws with an offset.
|
||||
// 3. Marketplace metadata and the gallery icon meet vsce requirements.
|
||||
try {
|
||||
const manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
||||
manifest.publisher === "wrnexus" ? ok("publisher id") : bad("publisher id");
|
||||
manifest.icon?.endsWith(".png") ? ok("Marketplace icon is PNG") : bad("Marketplace icon is PNG");
|
||||
const icon = readFileSync(join(root, manifest.icon));
|
||||
const isPng = icon.subarray(1, 4).toString("ascii") === "PNG";
|
||||
const width = isPng ? icon.readUInt32BE(16) : 0;
|
||||
const height = isPng ? icon.readUInt32BE(20) : 0;
|
||||
isPng && width >= 128 && height >= 128
|
||||
? ok(`Marketplace icon dimensions (${width}x${height})`)
|
||||
: bad("Marketplace icon is at least 128x128 PNG");
|
||||
for (const rel of ["README.md", "CHANGELOG.md", "SUPPORT.md", "LICENSE"]) {
|
||||
readFileSync(join(root, rel), "utf8");
|
||||
ok(`Marketplace document exists: ${rel}`);
|
||||
}
|
||||
} catch (e) {
|
||||
bad("Marketplace metadata", e.message);
|
||||
}
|
||||
|
||||
// 4. Bundled compiler: valid source compiles, invalid source throws with an offset.
|
||||
try {
|
||||
const compiler = require(join(root, "src/compiler.cjs"));
|
||||
const good = `page Home {\n view { <h1>Hi</h1> }\n}`;
|
||||
@@ -58,7 +79,7 @@ try {
|
||||
bad("compiler bundle loads", e.message);
|
||||
}
|
||||
|
||||
// 4. Formatter normalizes nested WRN blocks and is idempotent.
|
||||
// 5. Formatter normalizes nested WRN blocks and is idempotent.
|
||||
try {
|
||||
const { formatWrn } = require(join(root, "src/formatter.js"));
|
||||
const source = `page Home {\nview {\n<main>\n<h1>Hello</h1>\n</main>\n}\n}\n`;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user