kopular 0.11.0 → 0.11.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/LLM.md +34 -2
  3. package/package.json +9 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joe Koppin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LLM.md CHANGED
@@ -425,6 +425,34 @@ class CounterService {
425
425
  }
426
426
  ```
427
427
 
428
+ ## Common mistakes (seeded from real generation failures)
429
+
430
+ - **`Router.Param` is a plain `string`, not `state<T>` — don't `Subscribe()` to it.** A
431
+ `state<T>`-based design for it was tried and genuinely crashes: `Navigate()` sets `Param`
432
+ *before* the newly-matched page finishes mounting, so a page `Subscribe`-ing to it fires
433
+ while its own `Update()` still has no `ParentElement` to `replaceChild` into. `Render()`
434
+ already re-reads the fresh `Param` on every navigation with no extra step — just read
435
+ `this.Nav.Param` directly inside `Render()`.
436
+ - **Deploying a `Router`-based app needs SPA/history-fallback configured on the actual host**
437
+ — this bit the real `KopularDemo` production site (worked when navigated to via a link,
438
+ 404'd on a direct refresh) before its Cloudflare Workers config had
439
+ `not_found_handling: "single-page-application"` set. Don't assume `ks build`/`npm run
440
+ build` alone is enough for a routed app to work on refresh at a non-root path — see
441
+ "Router" above for the exact config.
442
+ - **Cross-package consumption always goes through `extern`, never `using`.** `using
443
+ "kopular/component"` doesn't compile — `using` only resolves relative same-project paths.
444
+ Redeclare the members you need as `extern ... from "kopular/component"` instead (see
445
+ "Consuming Kopular from your own KopScript project" above) even though it looks like it
446
+ should "just work" the way an npm `import` would.
447
+ - **A template's `*if`/`*for` and the hand-written `If()`/`.ForEach()` helpers are two
448
+ independent mechanisms, not the same thing wired two ways** — a template never needs
449
+ `directives.ks`'s `If()` imported or called; `*if`/`*for` compile to real `if`/`for`
450
+ directly. Don't mix a template with a hand-written-`Render()` helper call.
451
+ - **No two-way binding, anywhere.** Wiring a template's `[value]` or a hand-written
452
+ `.Value` to a real `<input>` back and forth always needs an explicit
453
+ `addEventListener("input", ...)` — there's no `[(ngModel)]`-equivalent to reach for in
454
+ either authoring style.
455
+
428
456
  ## Does not exist
429
457
 
430
458
  DI container/injector · decorators (`@Injectable`, `@Component`, ...) · a runtime
@@ -432,5 +460,9 @@ template engine or interpreted expression language — templates compile to the
432
460
  imperative `Render()` code as the hand-written form, checked at compile time, not
433
461
  interpreted at runtime (see "Templates" above) · two-way binding (`[(ngModel)]`) ·
434
462
  vdom diffing / reconciliation beyond a single component's own re-render · pipes ·
435
- animations · forms/validation module · typed/generic HTTP responses (`Http` returns raw
436
- text — see above) · a CLI/scaffolding tool (`ng generate`-equivalent) · SSR.
463
+ animations · typed/generic HTTP responses (`Http` returns raw text — see above) · SSR.
464
+
465
+ (`FormField<T>`/`Validators` and `kp new` — see "FormField<T> / Validators" and "Starting
466
+ a new project" above — are real, shipped features; they used to be listed here as gaps
467
+ before those landed and this list wasn't updated at the time. Leaving this parenthetical
468
+ rather than quietly deleting it, as a reminder to keep this list in sync going forward.)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kopular",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Kopular: a small component framework for KopScript — components, reactive state, constructor-injected services, routing, real compiled templates, and HTTP, with no DI container",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,11 +9,16 @@
9
9
  "type": "git",
10
10
  "url": "https://dev.azure.com/koppinator/Koppindependence/_git/Kopular"
11
11
  },
12
+ "homepage": "https://kopular.dev",
12
13
  "keywords": [
13
14
  "kopscript",
14
15
  "framework",
15
16
  "components",
16
- "ui"
17
+ "ui",
18
+ "ai",
19
+ "llm",
20
+ "codegen",
21
+ "agent"
17
22
  ],
18
23
  "main": "./src/component.js",
19
24
  "bin": {
@@ -51,12 +56,12 @@
51
56
  }
52
57
  },
53
58
  "devDependencies": {
54
- "kopscript": "^0.7.0",
55
59
  "@types/jsdom": "^30.0.0",
56
60
  "@types/node": "^20.14.0",
57
61
  "jsdom": "^25.0.1",
62
+ "kopscript": "^0.7.0",
58
63
  "typescript": "^5.5.0",
59
- "vitest": "^2.0.0"
64
+ "vitest": "^4.1.11"
60
65
  },
61
66
  "engines": {
62
67
  "node": ">=18"