@archduck/gst-core 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +7 -7
  2. package/package.json +11 -1
package/README.md CHANGED
@@ -85,14 +85,14 @@ mount(document.getElementById('root'), form)
85
85
  ```js
86
86
  import { loadJsonConfig } from '@archduck/gst-core'
87
87
 
88
- const form = await loadJsonConfig('./UserView', ['uchealth'], { schema })
88
+ const form = await loadJsonConfig('./UserView', { patches: ['uchealth'], schema })
89
89
  mount(document.getElementById('root'), form)
90
90
  ```
91
91
 
92
92
  **Mix both** -- load structure from JSON, define functions in JS:
93
93
 
94
94
  ```js
95
- const form = await loadJsonConfig('./UserView', [], { schema })
95
+ const form = await loadJsonConfig('./UserView', { schema })
96
96
  form.registries.functions = {
97
97
  ...form.registries.functions,
98
98
  customValidation(context) { /* ... */ }
@@ -180,10 +180,10 @@ registries: {
180
180
  Load config from a directory of JSON/JS files. Files are discovered by naming convention and merged using `gst-compose`:
181
181
 
182
182
  ```js
183
- const form = await loadJsonConfig('./UserView', [], { schema })
183
+ const form = await loadJsonConfig('./UserView', { schema })
184
184
 
185
185
  // With variant overlays (each variant stacks on top)
186
- const form = await loadJsonConfig('./UserView', ['uchealth', 'admin'], { schema })
186
+ const form = await loadJsonConfig('./UserView', { patches: ['uchealth', 'admin'], schema })
187
187
  ```
188
188
 
189
189
  File naming: `property[-variant].{json|js}`. A form directory might contain:
@@ -311,16 +311,16 @@ Render config into a DOM container. Returns a controller:
311
311
 
312
312
  Build a schema from top-level property declarations. Returns an object with `resolutionOrder`, `dependencies`, `registryMapping`, `validRegistries`, and `getDefault(property)`.
313
313
 
314
- ### `loadJsonConfig(path, variants?, options?) -> Promise<config>`
314
+ ### `loadJsonConfig(path, options?) -> Promise<config>`
315
315
 
316
- Load and merge config files from a namespace directory. Options include `schema` (required), `scope`, `registries`, `functions`.
316
+ Load and merge config files from a namespace directory. Options include `schema` (required), `patches` (variant array), `scope`, `registries`, `functions`.
317
317
 
318
318
  ### `LiveConfig`
319
319
 
320
320
  Stateful config manager with runtime patching.
321
321
 
322
322
  - `new LiveConfig({ schema })`
323
- - `liveConfig.load(path, variants?, options?)` -- load from files
323
+ - `liveConfig.load(path, options?)` -- load from files
324
324
  - `liveConfig.from(config, options?)` -- initialize from existing config
325
325
  - `liveConfig.get()` -- get resolved config (cached)
326
326
  - `liveConfig.patch(property, patch)` -- merge patch, re-resolve dependents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archduck/gst-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Compositional config-driven rendering engine",
6
6
  "keywords": [
@@ -41,7 +41,17 @@
41
41
  "README.md",
42
42
  "LICENSE"
43
43
  ],
44
+ "scripts": {
45
+ "build": "vite build",
46
+ "dev": "vite build --watch",
47
+ "test": "vitest",
48
+ "test:run": "vitest run",
49
+ "test:coverage": "vitest run --coverage"
50
+ },
44
51
  "dependencies": {
45
52
  "@vue/reactivity": "^3.5.32"
53
+ },
54
+ "devDependencies": {
55
+ "vite": "^6.0.0"
46
56
  }
47
57
  }