kopular 1.3.0 → 1.3.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.
- package/GUIDE.md +6 -0
- package/bin/kp.mjs +2 -9
- package/package.json +1 -1
package/GUIDE.md
CHANGED
|
@@ -25,6 +25,12 @@ hint — so running a separate build before it only adds a round-trip (the build
|
|
|
25
25
|
well under a second). `ks check src/app.ks` type-checks without building, for when you only
|
|
26
26
|
want the errors.
|
|
27
27
|
|
|
28
|
+
**A fresh `kp new` project's `src/` is exactly three files, all shown in this guide:**
|
|
29
|
+
`app.ks` (the block above), `counter.ks` (the `Counter` class under Components, plus
|
|
30
|
+
`using "kopular";`), and `counter.html` (its template, right below it). `index.html` already
|
|
31
|
+
maps every Kopular module and never needs editing. There's nothing else to discover — read
|
|
32
|
+
the task, then write your files.
|
|
33
|
+
|
|
28
34
|
## The language you need
|
|
29
35
|
|
|
30
36
|
- `Type name = value;` for every local — no `let`/`var`, no inference on declarations.
|
package/bin/kp.mjs
CHANGED
|
@@ -180,15 +180,8 @@ const COUNTER_KS_TEMPLATE = `using "kopular";
|
|
|
180
180
|
|
|
181
181
|
class Counter : Component {
|
|
182
182
|
public state<number> Count;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this.Count = state(0);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public void Increment() {
|
|
189
|
-
this.Count.Value = this.Count.Value + 1;
|
|
190
|
-
}
|
|
191
|
-
|
|
183
|
+
constructor() : base() { this.Count = state(0); }
|
|
184
|
+
public void Increment() { this.Count.Value = this.Count.Value + 1; }
|
|
192
185
|
template from "./counter.html";
|
|
193
186
|
}
|
|
194
187
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kopular",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
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",
|