@vsceasy/cli 0.1.8 → 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.
Files changed (30) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +40 -0
  3. package/dist/bin/cli.js +858 -76
  4. package/dist/index.js +717 -19
  5. package/dist/lib/config.d.ts +2 -0
  6. package/dist/lib/contributesMerge.d.ts +18 -0
  7. package/dist/lib/crud/parseModel.d.ts +12 -0
  8. package/dist/lib/helper/add.d.ts +1 -1
  9. package/dist/lib/model/add.d.ts +18 -0
  10. package/dist/lib/model/parseFields.d.ts +9 -3
  11. package/dist/lib/scaffold.d.ts +4 -0
  12. package/dist/lib/templatesData.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/templates/_assets/language/README.language.md +39 -0
  15. package/templates/_assets/language/contributes.extra.json +40 -0
  16. package/templates/_assets/language/fileicons/{{langId}}-icon-theme.json +13 -0
  17. package/templates/_assets/language/icons/{{langId}}.svg +5 -0
  18. package/templates/_assets/language/language-configuration.json +30 -0
  19. package/templates/_assets/language/snippets/{{langId}}.json +12 -0
  20. package/templates/_assets/language/src/colorize.ts +31 -0
  21. package/templates/_assets/language/src/commands/applyColors.ts +11 -0
  22. package/templates/_assets/language/src/commands/removeColors.ts +11 -0
  23. package/templates/_assets/language/src/extension/extension.ts +25 -0
  24. package/templates/_assets/language/src/helpers/colorize.ts +70 -0
  25. package/templates/_assets/language/syntaxes/{{langId}}.tmLanguage.json +45 -0
  26. package/templates/_generators/crud/formApp.tsx.tpl +2 -0
  27. package/templates/_generators/crud/formPanel.ts.tpl +2 -2
  28. package/templates/_generators/helper/colorize.ts.tpl +85 -0
  29. package/templates/_generators/model/model.ts.tpl +1 -1
  30. package/templates/react/scripts/gen.ts +55 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.
5
5
  ## [Unreleased]
6
6
 
7
7
  ### Added
8
+ - **Model relations — `ref(Model)` fields with populated CRUD dropdowns.** Symfony-`make:entity`-style relations.
9
+ - `vsceasy model add --fields "…,category:ref(Category)"` emits a `categoryId` foreign key plus a `<Name>Relations` metadata block. `ref(Category, label=name)` picks the dropdown label field. The referenced model must exist (errors otherwise, naming what to create); the interactive loop lists relatable models.
10
+ - `crud add` reads the relation metadata and generates a populated `<select>`: an `options()` RPC handler on the form panel loads the related rows, and the form webview renders a dropdown of them and stores the chosen id. Non-relational CRUD output is unchanged.
11
+ - ManyToOne only (FK on this model) — no join table or cascade. See the [Relations guide](https://vsceasy.dev/guides/relations/).
8
12
  - **Reactivity — keep a webview in sync with data.** A visual element can now track a source and update the instant it changes, no manual refresh.
9
13
  - ORM entities fire change events on every mutation; subscribe with `watchEntity(Todos, () => emit('todos:changed'))` from your generated `db.ts`.
10
14
  - `defineStore(initial)` — a framework-agnostic observable value (`get`/`set`/`update`/`subscribe`) for non-ORM state. Scaffold one with **`vsceasy store add --name X --type number|string|boolean|json`**.
package/README.md CHANGED
@@ -8,6 +8,14 @@
8
8
 
9
9
  <p align="center"><em>Pronounced <strong>"vee-see-easy"</strong> in English (<code>VSC</code> + <code>easy</code>) — or <strong>"visici"</strong> for Spanish speakers.</em></p>
10
10
 
11
+ <p align="center">
12
+ <video src="https://github.com/jairoFernandez/vsceasy/releases/download/promo-assets/vsceasy-promo.mp4" width="720" controls></video>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://github.com/jairoFernandez/vsceasy/releases/download/promo-assets/vsceasy-promo.mp4">▶ Watch the 30-second promo</a>
17
+ </p>
18
+
11
19
  > Status: v0.1 — React UI. Typed RPC bridge + file-based registry + scaffolding for panels, commands, menus, tree views, subpanels, status bars.
12
20
 
13
21
  ## Install
@@ -40,11 +48,36 @@ bunx @vsceasy/cli create \
40
48
  --displayName "My Extension" \
41
49
  --description "Does cool things" \
42
50
  --publisher my-publisher \
51
+ --type ui \
43
52
  --ui react \
44
53
  --git \
45
54
  --install
46
55
  ```
47
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
+
48
81
  ## What you get
49
82
 
50
83
  ```
@@ -335,8 +368,15 @@ vsceasy helper add --kind config # workspace.getConfiguration — typed
335
368
  vsceasy helper add --kind state # workspace + global mementos
336
369
  vsceasy helper add --kind notifications # toast + confirm + withProgress
337
370
  vsceasy helper add --kind cache # in-memory TTL + LRU + wrap()
371
+ vsceasy helper add --kind colorize # scoped editor.tokenColorCustomizations
338
372
  # For ORM use the dedicated commands: `vsceasy db init` + `vsceasy model add`
339
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).
340
380
  For `secrets` and `state`, wire on activate:
341
381
  ```ts
342
382
  import { initSecrets } from './helpers/secrets';