@skillstech/thunderlang 1.3.0 → 1.4.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/CHANGELOG.md +87 -0
- package/dist/core.cjs +4868 -1068
- package/dist/index.cjs +3676 -189
- package/dist/learn.cjs +6444 -1275
- package/package.json +18 -1
- package/src/cli-home.mjs +1 -1
- package/src/cli.mjs +23 -0
- package/src/core.d.ts +45 -0
- package/src/core.mjs +15 -0
- package/src/emit.mjs +1 -1
- package/src/faithful.mjs +4 -1
- package/src/flow/access.mjs +1451 -0
- package/src/flow/ts-parse.mjs +772 -0
- package/src/index.d.ts +3 -0
- package/src/index.mjs +3 -0
- package/src/learn-lessons.mjs +145 -0
- package/src/learn.mjs +17 -0
- package/src/libraries.mjs +22 -1
- package/src/model.mjs +22 -1
- package/src/passport-cli.mjs +101 -0
- package/src/passport-fs.d.mts +9 -0
- package/src/passport-fs.mjs +180 -0
- package/src/passport.d.mts +46 -0
- package/src/passport.mjs +255 -0
- package/src/program.d.mts +31 -0
- package/src/program.mjs +14 -0
- package/src/react/reading.css +119 -0
- package/src/react/reading.d.mts +15 -0
- package/src/react/reading.mjs +87 -0
- package/src/read.mjs +37 -1
- package/src/reading-layout.d.mts +40 -0
- package/src/reading-layout.mjs +112 -0
- package/src/review.mjs +31 -3
- package/src/say-less.mjs +16 -2
- package/src/steps.mjs +13 -1
- package/src/things-langs.mjs +20 -3
- package/src/write-across-cli.mjs +143 -0
- package/src/write-across.mjs +178 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
+
# 1.4.1
|
|
2
|
+
|
|
3
|
+
**Upgrade note.** No command, flag, exit code, or JSON shape changed. New: the drawing kit entry
|
|
4
|
+
`@skillstech/thunderlang/react` (with `react/reading.css`; React >=18 is an optional peer dependency) and
|
|
5
|
+
`readingLayout()` in `./core` (schema `thunder-reading-layout-v1`). One behavior fix: `thunder write <folder…>` now
|
|
6
|
+
lists, instead of changing, a rule with the same condition in a decision whose name shares no word with the chosen one.
|
|
7
|
+
|
|
8
|
+
- **The Thunder drawing kit, `@skillstech/thunderlang/react` (first part).** One set of components so OpenThunder,
|
|
9
|
+
thunderlang.dev, and the Skills Tech Talk course draw a reading the same way: `ThingCard` ("A Thing", "It knows",
|
|
10
|
+
the "It can" buttons, "How a new … starts"), `DataCard` (a record or choices), `BigPicture`, and `ThunderSymbol`.
|
|
11
|
+
Every word and its order come from `readingLayout(model, { focus })` in `./core` (`thunder-reading-layout-v1`),
|
|
12
|
+
which zooms with focus: the whole app or a file (Things, then records, then choices), a Thing (its card and its
|
|
13
|
+
file's Data), or an action or rule (`ioBoxes`: "You give it", "You get back", "It can stop with", "Part of …").
|
|
14
|
+
Styling is one stylesheet, `@skillstech/thunderlang/react/reading.css`: plain `tl-` classes, every color a CSS
|
|
15
|
+
variable (a dark and a light set; `--language-accent` is honored), one column under 560px, 44px touch targets.
|
|
16
|
+
React is an optional peer dependency; no Tailwind, no build step. thunderlang.dev now draws its Thing and Data
|
|
17
|
+
cards with it. The Flow and Details views and the drawn IO boxes join next.
|
|
18
|
+
- **Three lessons on changing real code, in `@skillstech/thunderlang/learn`.** "Does every route keep each
|
|
19
|
+
customer's records to them?" (`thunder read --access`), "Change one rule in every service at once"
|
|
20
|
+
(`thunder write <folder…>`), and "Keep the evidence for a change" (`thunder passport`, `passport check`). They are
|
|
21
|
+
write lessons (now 10, 22 lessons in all), and like every lesson, each quiz answer is worked out by the tool itself
|
|
22
|
+
on the lesson's files, so the build fails if a tool ever disagrees with what a lesson teaches.
|
|
23
|
+
- **Fix: `thunder write <folder…>` no longer changes a different rule that happens to share a condition.** A
|
|
24
|
+
decision with the same condition but a name that shares no word with the chosen one (`coupon_allowed` next to
|
|
25
|
+
`shippingFee`, both `subtotal >= 50`) is now listed as "check by hand" instead of being changed. Names are compared
|
|
26
|
+
as words, leaving out words like get, is, and calculate, so `shippingNote`, `ShippingFee`, and `get_shipping_fee`
|
|
27
|
+
still match.
|
|
28
|
+
|
|
29
|
+
# 1.4.0
|
|
30
|
+
|
|
31
|
+
**Upgrade note.** Every existing command, flag, exit code, and JSON output is unchanged. New: the Software Passport
|
|
32
|
+
(`thunder passport`, `thunder passport check`; schema `thunder-passport-v1`), ownership checks on TypeScript web routes
|
|
33
|
+
(`thunder read <dir> --access`, `accessFlow()`; schema `thunder-access-v1`), and a public, browser-safe library entry,
|
|
34
|
+
`@skillstech/thunderlang/program` (compile, run, screens, and all seven targets). `./core` now also exports what apps
|
|
35
|
+
used to reach through paths into `src/`; switch to the public entries, since `src/` paths are not part of the API. The
|
|
36
|
+
repository gains a three-language checkout demo (`demo/checkout/`) with its walkthrough.
|
|
37
|
+
|
|
38
|
+
- **One rule change, every service, any language (`thunder write <folder…>`).** When the same rule is written in
|
|
39
|
+
several services (free shipping from $50 in the cart page in TypeScript, the orders service in C#, and billing's
|
|
40
|
+
receipt in Python), `thunder write web orders billing --decision shippingNote --rule 1 --when "subtotal >= 40"`
|
|
41
|
+
finds every copy (same condition, names compared as words), shows the plan, and with `--write` changes all of them
|
|
42
|
+
or none: only the rule's characters, each file read again. Lookalikes (same names with another limit, or the same
|
|
43
|
+
limit with other names) are listed as "check by hand", never changed; tests are never edited, and those that call
|
|
44
|
+
the rule and mention the old value are listed. `--run "part: cmd"` runs the tests on the change and reports every
|
|
45
|
+
failure; `--passport` records it as a Software Passport. API: `writeRuleAcross`, `findSameRule`,
|
|
46
|
+
`writeAcrossEvidence` in `./core` (`thunder-write-across-v1`). The checkout demo gains the shipping rule in all
|
|
47
|
+
three services and `run-demo.sh --change`.
|
|
48
|
+
- **The Thunder Software Passport (`thunder passport`).** An evidence record for a feature or a change
|
|
49
|
+
(`thunder-passport-v1`): purpose (only what you state, else "not stated"), behavior as Thunder Text with lines,
|
|
50
|
+
dependencies (every file by content hash, Trace links, packages, services), effects detected in code, evidence, unknowns,
|
|
51
|
+
and history. Each claim has a basis (a command with its exit code and output digest, or source lines), what it does not
|
|
52
|
+
cover, and the files it depended on. A failed `--run` is recorded as failed (exit 1), never as passed, and "not verified"
|
|
53
|
+
always lists deployment, real external services, more than one process, and load. `thunder passport check` marks each
|
|
54
|
+
claim current or stale when a file it depended on changed, without re-running anything. Ownership-check verdicts join
|
|
55
|
+
as evidence when that check is present. Pure half in `@skillstech/thunderlang/core` (`assemblePassport`,
|
|
56
|
+
`checkPassport`); `buildPassport` in the root entry. The checkout demo has its passport (`run-demo.sh --passport`).
|
|
57
|
+
- **Access flow: does every path limit the record to the caller?** For TypeScript and JavaScript web routes (Express,
|
|
58
|
+
Fastify, Hono, Next.js), Thunder follows the request's values through the handler, the project's helpers,
|
|
59
|
+
repositories, classes, and middleware, and into the database (Prisma, Drizzle, Knex, raw SQL, postgres.js, Mongoose).
|
|
60
|
+
Each path that hands back or changes a record chosen by the request gets one verdict: guarded (a where clause on
|
|
61
|
+
the caller's tenant or owner, a comparison that stops first, or the caller's own record), unguarded (every step was
|
|
62
|
+
followed and none limits it), or cannot tell (exactly what stopped it, with its line). "Unguarded" is never said
|
|
63
|
+
when anything on the path was left unresolved. `thunder read <dir> --access` (`--json`: thunder-access-v1),
|
|
64
|
+
`accessFlow()` in `@skillstech/thunderlang/core`, and one line on each route in readings. A dependency-free
|
|
65
|
+
TypeScript parser comes with it (`src/flow/ts-parse.mjs`). Measured on a 55-route labeled benchmark (every label
|
|
66
|
+
met; no false "unguarded") and on about 14,500 real files (0 called unguarded). See docs/access-flow.md.
|
|
67
|
+
- **Services that talk across languages are read and linked.** Thunder Trace now links:
|
|
68
|
+
- ASP.NET minimal-API routes (`app.MapPost("/orders", …)`);
|
|
69
|
+
- Python standard-library handlers (`do_POST` and the one path it checks);
|
|
70
|
+
- an `HttpClient` under any client-like name (`http.PostAsync("/charges", …)`);
|
|
71
|
+
- a `fetch` whose options object spans lines.
|
|
72
|
+
|
|
73
|
+
A TypeScript → C# → Python app is linked end to end, each end cited.
|
|
74
|
+
- **More of a change is said in words:**
|
|
75
|
+
- C#'s `String.IsNullOrEmpty(x)` ("x is empty or missing"), `Task.FromResult(x)`, and `GetOrAdd` ("made … if it is missing");
|
|
76
|
+
- a JSON body by its fields ("Turns items (cart), coupon and key into JSON text");
|
|
77
|
+
- a new random ID (`crypto.randomUUID()`, `uuid.uuid4()`, `Guid.NewGuid()`).
|
|
78
|
+
|
|
79
|
+
`thunder review` says when a function's steps moved into a new function it now runs, instead of listing each one as "no longer".
|
|
80
|
+
- **Truer C# values:** a filled-in initializer (`= new() { ["a"] = 1 }`) is no longer "empty at first"; `0.08m` reads 0.08; `new()` of an object is not "empty"; a field and the property that shows it are listed once. Words inside text (`$"… bug (…) {x}"`) and a lambda passed as an argument are no longer read as methods. A folder's big picture no longer takes one file's description as the whole app's.
|
|
81
|
+
- **Demo: `demo/checkout/`.** A three-language shop (TypeScript, C#, Python) where a retried checkout charged twice, the fix (one idempotency key end to end), and `run-demo.sh` to reproduce both and what Thunder reads.
|
|
82
|
+
- **`@skillstech/thunderlang/program`: Thunder Core as a library, browser-safe.** One public entry for apps (OpenThunder,
|
|
83
|
+
the site, your own tools) to compile a program (`compileCore`), run it on the Thunder engine (`runInProcess`,
|
|
84
|
+
`recordedRun`, `testInProcess`), show and drive its screens (`screenApp`, `screenOutline`), and write it as Python,
|
|
85
|
+
TypeScript, C#, Java, Go, Rust, or React (`toPython` … `toReact`), plus `pythonToCore`, with types. A test checks
|
|
86
|
+
that nothing it imports needs Node, so it runs in a browser; until now this needed paths into the package's files.
|
|
87
|
+
|
|
1
88
|
# 1.3.0
|
|
2
89
|
|
|
3
90
|
**Upgrade note.** Every existing command, flag, exit code, and JSON output is unchanged. New: Thunder Core compiles to
|