tutuca 0.10.0 → 0.11.0

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 (48) hide show
  1. package/README.md +14 -14
  2. package/dist/immer.js +1261 -0
  3. package/dist/tutuca-cli.js +1603 -4573
  4. package/dist/tutuca-components.js +194 -424
  5. package/dist/tutuca-dev.ext.js +483 -757
  6. package/dist/tutuca-dev.js +1172 -4999
  7. package/dist/tutuca-dev.min.js +3 -3
  8. package/dist/tutuca-extra.ext.js +460 -547
  9. package/dist/tutuca-extra.js +1136 -4790
  10. package/dist/tutuca-extra.min.js +2 -2
  11. package/dist/tutuca-storybook.js +152 -143
  12. package/dist/tutuca.ext.js +460 -547
  13. package/dist/tutuca.js +1136 -4790
  14. package/dist/tutuca.min.js +2 -2
  15. package/package.json +7 -11
  16. package/skill/tutuca/SKILL.md +0 -4
  17. package/skill/tutuca/advanced.md +12 -4
  18. package/skill/tutuca/cli.md +8 -9
  19. package/skill/tutuca/component-design.md +18 -19
  20. package/skill/tutuca/core.md +83 -81
  21. package/skill/tutuca/iteration.md +2 -2
  22. package/skill/tutuca/macros.md +1 -1
  23. package/skill/tutuca/messages-and-intents.md +24 -23
  24. package/skill/tutuca/patterns/bind-text-and-attributes.md +1 -1
  25. package/skill/tutuca/patterns/conditional-attribute-value.md +1 -1
  26. package/skill/tutuca/patterns/coordinate-components.md +10 -8
  27. package/skill/tutuca/patterns/file-input.md +6 -6
  28. package/skill/tutuca/patterns/filter-and-paginate.md +1 -1
  29. package/skill/tutuca/patterns/handle-events.md +10 -8
  30. package/skill/tutuca/patterns/switch-between-views.md +1 -1
  31. package/skill/tutuca/patterns/tabbed-interface.md +10 -5
  32. package/skill/tutuca/testing.md +37 -28
  33. package/skill/tutuca-source/tutuca.ext.js +460 -547
  34. package/dist/immutable.js +0 -4331
  35. package/skill/immutable-js/SKILL.md +0 -78
  36. package/skill/immutable-js/references/collection.md +0 -346
  37. package/skill/immutable-js/references/conversions.md +0 -99
  38. package/skill/immutable-js/references/deep-updates.md +0 -172
  39. package/skill/immutable-js/references/equality.md +0 -95
  40. package/skill/immutable-js/references/list.md +0 -266
  41. package/skill/immutable-js/references/map.md +0 -300
  42. package/skill/immutable-js/references/predicates.md +0 -93
  43. package/skill/immutable-js/references/range-repeat.md +0 -55
  44. package/skill/immutable-js/references/record.md +0 -196
  45. package/skill/immutable-js/references/seq.md +0 -248
  46. package/skill/immutable-js/references/set.md +0 -270
  47. package/skill/immutable-js/references/shallow-functional.md +0 -99
  48. package/skill/immutable-js/references/stack.md +0 -210
package/README.md CHANGED
@@ -7,12 +7,14 @@ Batteries included SPA framework with a dependency-free browser bundle.
7
7
  - **Fits in your head** (and the context window)
8
8
  - **View source friendly** — step through the whole stack
9
9
  - **As much HTML as possible, as little JS as needed**
10
- - ~182KB minified, ~41KB brotli compressed (the core browser bundle; the dev build adds linting and test helpers)
10
+ - ~110KB minified, ~29KB brotli compressed (the core browser bundle; the dev build adds linting and test helpers)
11
11
 
12
12
  ## Quick Start
13
13
 
14
14
  For an interactive walk-through with editable examples, see the
15
15
  [tutorial](https://marianoguerra.github.io/tutuca/tutorial.html).
16
+ Upgrading an Immutable.js-based app? See the
17
+ [Immer migration guide](./docs/immer-migration.md).
16
18
 
17
19
  ### CDN (no install)
18
20
 
@@ -34,18 +36,18 @@ For an interactive walk-through with editable examples, see the
34
36
  fields: {
35
37
  count: 0,
36
38
  },
37
- methods: {
38
- inc() {
39
- return this.setCount(this.count + 1);
39
+ receive: {
40
+ inc(draft) {
41
+ draft.count++;
40
42
  },
41
- dec() {
42
- return this.setCount(this.count - 1);
43
+ dec(draft) {
44
+ draft.count--;
43
45
  },
44
46
  },
45
47
  view: html`<div>
46
- <button @on.click="$dec">-</button>
48
+ <button @on.click="dec">-</button>
47
49
  <div @text=".count"></div>
48
- <button @on.click="$inc">+</button>
50
+ <button @on.click="inc">+</button>
49
51
  </div>`,
50
52
  });
51
53
 
@@ -67,8 +69,8 @@ For an interactive walk-through with editable examples, see the
67
69
  Each concept has a tutorial section with editable live examples:
68
70
 
69
71
  - **[Components & state](https://marianoguerra.github.io/tutuca/tutorial.html#basics)** —
70
- typed `fields` with auto-generated mutators (`setCount`, `toggleOpen`, …),
71
- views as pure functions of a single immutable state tree
72
+ typed `fields`, Immer draft-first handlers, and views as pure functions of a
73
+ single immutable state tree
72
74
  ([state & updates](https://marianoguerra.github.io/tutuca/tutorial.html#state-and-updates))
73
75
  - **[Collections](https://marianoguerra.github.io/tutuca/tutorial.html#collections)** —
74
76
  iterate with `@each`, filter with `@when`, paginate with `@loop-with`
@@ -121,7 +123,7 @@ tutuca help [command]
121
123
  | `test <module> [name] [--grep p] [--bail]` | Run `getTests()` (exit `4` on failures) |
122
124
  | `storybook [dir]` | Serve a live storybook, auto-discovering co-located `*.dev.js` modules (`--port`, `--out`, `--dry-run`, `--no-margaui`, `--no-check`, `--no-tests`; no module path needed) |
123
125
  | `feedback [message]` | Append a feedback note (positional or stdin) to `~/.tutuca/feedback.jsonl` (no module path needed) |
124
- | `install-skill [--user\|--project] [--margaui-skill\|--immutable-skill\|--all] [--dot-agents] [--dry-run] [--force]` | Install bundled Claude Code skills (no module path needed) |
126
+ | `install-skill [--user\|--project] [--margaui-skill\|--all] [--dot-agents] [--dry-run] [--force]` | Install bundled Claude Code skills (no module path needed) |
125
127
  | `agent-context` | Print a versioned JSON schema of the entire CLI surface (no module path needed) |
126
128
 
127
129
  Global flags: `--json`, `-f, --format <cli\|md\|json\|html>`, `-o, --output <file>`, `--pretty`, `--module <path>`, `-h, --help`.
@@ -165,10 +167,8 @@ npx tutuca install-skill
165
167
  # or user-scoped: writes ~/.claude/skills/tutuca/
166
168
  npx tutuca install-skill --user
167
169
 
168
- # companion skills: MargaUI class lists, or Immutable.js (the values
169
- # tutuca state is made of) — or install all three
170
+ # companion MargaUI skill, or install both bundled skills
170
171
  npx tutuca install-skill --margaui-skill
171
- npx tutuca install-skill --immutable-skill
172
172
  npx tutuca install-skill --all
173
173
 
174
174
  # install into ./.agents/skills/ instead of ./.claude/skills/