@vsceasy/cli 0.1.9 → 0.1.10
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 +32 -0
- package/dist/bin/cli.js +652 -17
- package/dist/index.js +608 -6
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/contributesMerge.d.ts +18 -0
- package/dist/lib/helper/add.d.ts +1 -1
- package/dist/lib/scaffold.d.ts +4 -0
- package/dist/lib/templatesData.d.ts +1 -1
- package/package.json +1 -1
- package/templates/_assets/language/README.language.md +39 -0
- package/templates/_assets/language/contributes.extra.json +40 -0
- package/templates/_assets/language/fileicons/{{langId}}-icon-theme.json +13 -0
- package/templates/_assets/language/icons/{{langId}}.svg +5 -0
- package/templates/_assets/language/language-configuration.json +30 -0
- package/templates/_assets/language/snippets/{{langId}}.json +12 -0
- package/templates/_assets/language/src/colorize.ts +31 -0
- package/templates/_assets/language/src/commands/applyColors.ts +11 -0
- package/templates/_assets/language/src/commands/removeColors.ts +11 -0
- package/templates/_assets/language/src/extension/extension.ts +25 -0
- package/templates/_assets/language/src/helpers/colorize.ts +70 -0
- package/templates/_assets/language/syntaxes/{{langId}}.tmLanguage.json +45 -0
- package/templates/_generators/helper/colorize.ts.tpl +85 -0
- package/templates/react/scripts/gen.ts +55 -0
package/README.md
CHANGED
|
@@ -48,11 +48,36 @@ bunx @vsceasy/cli create \
|
|
|
48
48
|
--displayName "My Extension" \
|
|
49
49
|
--description "Does cool things" \
|
|
50
50
|
--publisher my-publisher \
|
|
51
|
+
--type ui \
|
|
51
52
|
--ui react \
|
|
52
53
|
--git \
|
|
53
54
|
--install
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
### Extension types
|
|
58
|
+
|
|
59
|
+
`create` asks what kind of extension you're building (`--type`):
|
|
60
|
+
|
|
61
|
+
| Type | What you get |
|
|
62
|
+
|------|--------------|
|
|
63
|
+
| `ui` *(default)* | React webview + typed RPC bridge. `--preset full` adds a sample panel; `--preset minimal` is empty. |
|
|
64
|
+
| `language` | Language support — TextMate grammar, `language-configuration.json`, snippets, and an opt-in file-icon theme. No React. |
|
|
65
|
+
| `empty` | Bare extension (`activate`/`deactivate` only). No UI, no language. |
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bunx @vsceasy/cli create --name toml --type language --extensions .toml
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Non-generated contributions: `contributes.extra.json`
|
|
72
|
+
|
|
73
|
+
`scripts/gen.ts` regenerates the parts of `package.json#contributes` it owns
|
|
74
|
+
(commands, keybindings, views) on every build. Anything it doesn't generate —
|
|
75
|
+
`languages`, `grammars`, `snippets`, `themes`, `iconThemes`, `walkthroughs` —
|
|
76
|
+
goes in a `contributes.extra.json` file at the project root and is deep-merged
|
|
77
|
+
into `package.json` on `bun run gen`. The keys gen owns always win; everything
|
|
78
|
+
else from `contributes.extra.json` is preserved. The `language` scaffold ships a
|
|
79
|
+
populated `contributes.extra.json` wiring up its grammar, snippets and icons.
|
|
80
|
+
|
|
56
81
|
## What you get
|
|
57
82
|
|
|
58
83
|
```
|
|
@@ -343,8 +368,15 @@ vsceasy helper add --kind config # workspace.getConfiguration — typed
|
|
|
343
368
|
vsceasy helper add --kind state # workspace + global mementos
|
|
344
369
|
vsceasy helper add --kind notifications # toast + confirm + withProgress
|
|
345
370
|
vsceasy helper add --kind cache # in-memory TTL + LRU + wrap()
|
|
371
|
+
vsceasy helper add --kind colorize # scoped editor.tokenColorCustomizations
|
|
346
372
|
# For ORM use the dedicated commands: `vsceasy db init` + `vsceasy model add`
|
|
347
373
|
```
|
|
374
|
+
|
|
375
|
+
The `colorize` helper writes theme-independent token colors scoped to a single
|
|
376
|
+
TextMate scope (e.g. a language's `source.x`), so only that language is
|
|
377
|
+
recolored — other languages keep the user's theme. `create --type language`
|
|
378
|
+
wires it automatically (auto-apply on activate behind a `<prefix>.colorize`
|
|
379
|
+
opt-out setting + `Apply/Remove Colors` commands).
|
|
348
380
|
For `secrets` and `state`, wire on activate:
|
|
349
381
|
```ts
|
|
350
382
|
import { initSecrets } from './helpers/secrets';
|