werewolf-ui 0.1.0-beta.0 → 0.1.0-beta.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 (44) hide show
  1. package/README.md +42 -12
  2. package/data/manifest.json +1974 -365
  3. package/data/native/android/WerewolfAlert.kt +210 -0
  4. package/data/native/android/WerewolfBadge.kt +307 -0
  5. package/data/native/android/WerewolfButton.kt +692 -0
  6. package/data/native/android/WerewolfCard.kt +134 -0
  7. package/data/native/android/WerewolfEmptyState.kt +94 -0
  8. package/data/native/android/WerewolfFonts.kt +69 -0
  9. package/data/native/android/WerewolfIcons.kt +94 -0
  10. package/data/native/android/WerewolfInput.kt +558 -0
  11. package/data/native/android/WerewolfKbd.kt +103 -0
  12. package/data/native/android/WerewolfLabel.kt +236 -0
  13. package/data/native/android/WerewolfModifiers.kt +137 -0
  14. package/data/native/android/WerewolfSeparator.kt +90 -0
  15. package/data/native/android/WerewolfSkeleton.kt +170 -0
  16. package/data/native/android/WerewolfSpinner.kt +79 -0
  17. package/data/native/android/WerewolfSpinnerArc.kt +53 -0
  18. package/data/native/android/WerewolfSwitch.kt +485 -0
  19. package/data/native/android/WerewolfTheme.kt +36 -0
  20. package/data/native/android/WerewolfToken.kt +240 -0
  21. package/data/native/ios/WerewolfAlert.swift +284 -0
  22. package/data/native/ios/WerewolfBadge.swift +439 -0
  23. package/data/native/ios/WerewolfButton.swift +721 -0
  24. package/data/native/ios/WerewolfCard.swift +189 -0
  25. package/data/native/ios/WerewolfEmptyState.swift +122 -0
  26. package/data/native/ios/WerewolfFonts.swift +140 -0
  27. package/data/native/ios/WerewolfIcons.swift +35 -0
  28. package/data/native/ios/WerewolfInput.swift +670 -0
  29. package/data/native/ios/WerewolfKbd.swift +136 -0
  30. package/data/native/ios/WerewolfLabel.swift +270 -0
  31. package/data/native/ios/WerewolfModifiers.swift +108 -0
  32. package/data/native/ios/WerewolfSeparator.swift +120 -0
  33. package/data/native/ios/WerewolfSkeleton.swift +238 -0
  34. package/data/native/ios/WerewolfSpinner.swift +108 -0
  35. package/data/native/ios/WerewolfSpinnerArc.swift +24 -0
  36. package/data/native/ios/WerewolfSwitch.swift +737 -0
  37. package/data/native/ios/WerewolfTheme.swift +62 -0
  38. package/data/native/ios/WerewolfToken.swift +320 -0
  39. package/dist/cli.mjs +11634 -7280
  40. package/dist/core.mjs +7426 -4371
  41. package/dist/lint.mjs +61 -11
  42. package/dist/package-manager.mjs +55 -10
  43. package/dist/project.mjs +228 -16
  44. package/package.json +3 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Werewolf CLI (alpha)
1
+ # Werewolf CLI (beta)
2
2
 
3
- Published on npm as `werewolf-ui` (dist tags `latest` and `alpha`; run `npx werewolf-ui --version` to see which version you have). Run it with `npx werewolf-ui` from a supported app. Component APIs remain draft.
3
+ Published on npm as `werewolf-ui` (dist tags `latest` and `beta`; run `npx werewolf-ui --version` to see which version you have). Run it with `npx werewolf-ui` from a supported app. Component APIs remain draft.
4
4
 
5
5
  ## Platform token export (E1, shipped in PR #134)
6
6
 
@@ -23,16 +23,18 @@ The export uses the initialized app's configured DTCG seed, preserving its
23
23
  bytes, metadata and file mode. Config, app stylesheet, components and agent rules
24
24
  stay unchanged. Each selection writes both json/dark.json and json/light.json
25
25
  plus only the selected platform's artifacts. Web adds dark.css, light.css,
26
- werewolf.css and tailwind.css in web/; ios adds WerewolfDark.swift and
27
- WerewolfLight.swift in ios/; android adds WerewolfDark.kt and WerewolfLight.kt
28
- in android/. Existing unselected outputs remain untouched. Rebuild each
26
+ werewolf.css and tailwind.css in web/; ios adds WerewolfDark.swift,
27
+ WerewolfLight.swift and WerewolfTokens.swift (both modes, shadows and easing) in
28
+ ios/; android adds WerewolfDark.kt, WerewolfLight.kt and WerewolfTokens.kt in
29
+ android/. Existing unselected outputs remain untouched. Rebuild each
29
30
  platform after changing the seed.
30
31
 
31
32
  Swift and Compose use Joey's decided touch values: sm 28, md 36, lg 44, xl 48,
32
33
  size-target-min 44 and font-size-input 16. Swift dimensions are points; Compose
33
34
  control sizes/targets use dp and input text uses sp. Mode JSON retains the mouse
34
35
  base maps (md 32, lg 36, xl 44, target 24, input 14). Web CSS keeps those base
35
- values and the existing coarse-pointer overrides. Native components remain v2.
36
+ values and the existing coarse-pointer overrides. Native components install
37
+ with init and add --platform; see Native components below.
36
38
 
37
39
  All modes format and pass engine checks before consumer writes. Artifacts and
38
40
  their hashes in .werewolf/managed.json commit through the existing staged
@@ -55,6 +57,26 @@ unchanged read guards; files lists only exported artifacts. Exit 0 succeeds,
55
57
  1 reports operational failure/conflict and 2 reports invalid arguments/config.
56
58
  Cancellation returns 130. No package-manager process runs during export.
57
59
 
60
+ ## Native components
61
+
62
+ Set up a SwiftPM, Xcode or Gradle app, then add generated SwiftUI or Jetpack
63
+ Compose components to it:
64
+
65
+ ```bash
66
+ npx werewolf-ui init --platform ios
67
+ npx werewolf-ui add button --platform ios
68
+ npx werewolf-ui init --platform android --module app
69
+ npx werewolf-ui add button --platform android
70
+ ```
71
+
72
+ init --platform writes werewolf.json, the seed, the native token files and the
73
+ runtime. add --platform writes the generated component into the configured
74
+ folder and runs no package manager. Generated today: Alert, Badge, Button,
75
+ Card, EmptyState, Input, Kbd, Label, Separator, Skeleton, Spinner, Switch and
76
+ Token. A component without native status for that platform returns
77
+ WW_NATIVE_UNSUPPORTED with its status and deferred props. --platform does not install a remote registry item.
78
+ iOS 16 (Xcode 15) and Android minSdk 24 are the baseline.
79
+
58
80
  ## Consumer lint (C3, shipped in PR #129)
59
81
 
60
82
  Select the supported app with `--cwd`:
@@ -159,9 +181,17 @@ runs the same write plan, import mapping and rollback as any other add. `login`
159
181
  signs in with the OAuth device flow, saves the key in the user config folder
160
182
  (never in the app) and adds the registry to `werewolf.json`, with the key read
161
183
  from an environment variable for CI. Only names with a namespace other than
162
- `@werewolf` touch the network. Full protocol and limits:
184
+ `@werewolf`, and item URLs, touch the network. Full protocol and limits:
163
185
  [docs/cli.md](../../docs/cli.md#remote-registries).
164
186
 
187
+ `add <url>` installs one registry item JSON by its full URL, for example
188
+ `npx werewolf-ui add https://www.werewolf-ui.dev/r/button.json`. The URL must
189
+ use https (http only on localhost). It is sent no headers and no saved key, and
190
+ a redirect is refused. Its dependencies may be names or URLs; a URL on the
191
+ Werewolf site of an item this CLI bundles installs the bundled item, so the
192
+ theme init wrote stays. Files keep to the same allowed directories as any
193
+ remote item, and dependencies install without package scripts.
194
+
165
195
  From any directory:
166
196
 
167
197
  ```bash
@@ -352,7 +382,7 @@ B3 add requires an initialized app. Missing config, seed or ownership record ret
352
382
  WW_NOT_INITIALIZED with the npx werewolf-ui init action. It resolves one or more
353
383
  component names and their registry dependencies in topological order, once per
354
384
  item. Utility and token registry items are local files, never external packages.
355
- Component APIs remain draft. C3 lint and D2 MCP launch ship on main and in the published alpha.
385
+ Component APIs remain draft. C3 lint and D2 MCP launch ship on main and in the published beta.
356
386
 
357
387
  Add maps UI, lib and hooks source into the configured compiler aliases and
358
388
  directories. It parses source and edits only module specifiers under the known
@@ -434,10 +464,10 @@ npm ci
434
464
  npm run build:cli
435
465
  npm pack --workspace werewolf-ui --pack-destination /absolute/path/to/output
436
466
  cd /absolute/path/to/consumer
437
- npm install /absolute/path/to/output/werewolf-ui-0.1.0-beta.0.tgz --engine-strict
467
+ npm install /absolute/path/to/output/werewolf-ui-0.1.0-beta.2.tgz --engine-strict
438
468
  ```
439
469
 
440
- The supported alpha layouts are Next.js app-router (app or src/app), Vite React
470
+ The supported layouts are Next.js app-router (app or src/app), Vite React
441
471
  TypeScript and any other React TypeScript project, with Node 20+, React 19,
442
472
  Tailwind CSS v4 and existing compiler aliases. Framework `react` is covered by
443
473
  project detection tests only. The E3 consumer gate builds and packs locally,
@@ -475,6 +505,6 @@ To launch the published package without installing it in the app, use the versio
475
505
 
476
506
  The client must have Node 20+ and npx on its PATH. If it cannot set cwd, launch node with the absolute installed node_modules/werewolf-ui/dist/cli.mjs path, mcp, --cwd and the app path as separate arguments. Wrappers vary by client. Init never changes client settings. This local config does not fetch a public release; publication remains planned.
477
507
 
478
- The six names are list_components, search, get_component, generate_theme, lint and check_page (check_page is new on main for the next release). Successful tools return matching JSON text and structuredContent with schemaVersion, dataVersion, ok, data and diagnostics. Lint findings live in data.diagnostics; ok means the tool ran, rather than that the source is clean. Check coverage for dynamic or unread source. Theme returns artifacts without writing them.
508
+ The six names are list_components, search, get_component, generate_theme, lint and check_page. Successful tools return matching JSON text and structuredContent with schemaVersion, dataVersion, ok, data and diagnostics. Lint findings live in data.diagnostics; ok means the tool ran, rather than that the source is clean. Check coverage for dynamic or unread source. Theme returns artifacts without writing them.
479
509
 
480
- The server exposes six read-only tools. check_page opens only pages on this computer and writes screenshots to a temporary folder, never to the project; it needs playwright-core and Chromium, or CHROME_PATH (see `check` in [docs/cli.md](../../docs/cli.md)). Lint accepts submitted content or explicit source files under the canonical root, with the same file, byte and diagnostic limits as core lint. Directory/glob inputs and symlinks are rejected. No installation, fixes or consumer config execution occurs. EOF drains responses; signals and broken input close with bounded cleanup. See [local MCP connection and tool documentation](../../docs/mcp.md) for the local tarball process config, illustrative future published config, tool examples, result envelopes and troubleshooting. D2 ships in PR #132. D3 packed comparisons and configured CLI-client evidence shipped in PR #133; desktop application registration remains untested. MCP lint uses the packaged default seed, while CLI lint reads the consumer seed for color suggestions.
510
+ The server exposes seven read-only tools. check_page opens only pages on this computer and writes screenshots to a temporary folder, never to the project; it needs playwright-core and Chromium, or CHROME_PATH (see `check` in [docs/cli.md](../../docs/cli.md)). Lint accepts submitted content or explicit source files under the canonical root, with the same file, byte and diagnostic limits as core lint. Directory/glob inputs and symlinks are rejected. No installation, fixes or consumer config execution occurs. EOF drains responses; signals and broken input close with bounded cleanup. See [local MCP connection and tool documentation](../../docs/mcp.md) for the local tarball process config, illustrative future published config, tool examples, result envelopes and troubleshooting. D2 ships in PR #132. D3 packed comparisons and configured CLI-client evidence shipped in PR #133; desktop application registration remains untested. MCP lint uses the packaged default seed, while CLI lint reads the consumer seed for color suggestions.