@santi020k/lumen 3.0.1 → 4.1.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 (125) hide show
  1. package/README.md +211 -3
  2. package/dist/cli.js +49 -5
  3. package/dist/consumer-upgrade-audit.d.ts +10 -0
  4. package/dist/consumer-upgrade-audit.d.ts.map +1 -0
  5. package/dist/consumer-upgrade-audit.js +52 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -0
  9. package/dist/installer.d.ts.map +1 -1
  10. package/dist/installer.js +16 -0
  11. package/dist/integration-diagnostics.d.ts.map +1 -1
  12. package/dist/integration-diagnostics.js +199 -3
  13. package/dist/registry-component-name.d.ts +2 -0
  14. package/dist/registry-component-name.d.ts.map +1 -0
  15. package/dist/registry-component-name.js +53 -0
  16. package/dist/registry-data.d.ts +339 -18
  17. package/dist/registry-data.d.ts.map +1 -1
  18. package/dist/registry-data.js +789 -3
  19. package/dist/registry.d.ts.map +1 -1
  20. package/dist/registry.js +11 -9
  21. package/dist/source-script-ranges.d.ts +3 -0
  22. package/dist/source-script-ranges.d.ts.map +1 -0
  23. package/dist/source-script-ranges.js +41 -0
  24. package/dist/v2-migration.d.ts +38 -0
  25. package/dist/v2-migration.d.ts.map +1 -1
  26. package/dist/v2-migration.js +26 -14
  27. package/dist/v4-migration.d.ts +26 -0
  28. package/dist/v4-migration.d.ts.map +1 -0
  29. package/dist/v4-migration.js +272 -0
  30. package/dist/version-migration-dependencies.d.ts +8 -0
  31. package/dist/version-migration-dependencies.d.ts.map +1 -0
  32. package/dist/version-migration-dependencies.js +10 -0
  33. package/dist/version-migration-source.d.ts +4 -0
  34. package/dist/version-migration-source.d.ts.map +1 -0
  35. package/dist/version-migration-source.js +281 -0
  36. package/dist/version-migration.d.ts +34 -0
  37. package/dist/version-migration.d.ts.map +1 -0
  38. package/dist/version-migration.js +158 -0
  39. package/native-components.json +564 -17
  40. package/package.json +26 -11
  41. package/release-manifest.json +22 -17
  42. package/styles/critical.css +696 -66
  43. package/styles/motion.css +61 -0
  44. package/styles/world-map.css +30 -0
  45. package/styles.css +1756 -409
  46. package/templates/astro/advanced-fields/src/lumen/advanced-fields.astro +35 -0
  47. package/templates/astro/ai-docs/llms.txt +3 -0
  48. package/templates/astro/analytics-dashboard/src/lumen/analytics-dashboard.astro +110 -0
  49. package/templates/astro/auth-onboarding/src/lumen/auth-onboarding.astro +107 -0
  50. package/templates/astro/command-center/src/lumen/command-center.astro +34 -0
  51. package/templates/astro/commerce-dashboard/src/lumen/commerce-dashboard.astro +108 -0
  52. package/templates/astro/content-flow-actions/src/lumen/content-flow-actions.astro +10 -0
  53. package/templates/astro/content-flow-header/src/lumen/content-flow-header.astro +14 -0
  54. package/templates/astro/content-flow-list/src/lumen/content-flow-list.astro +13 -0
  55. package/templates/astro/content-flow-settings/src/lumen/content-flow-settings.astro +17 -0
  56. package/templates/astro/data-collections/src/lumen/data-collections.astro +52 -0
  57. package/templates/astro/feature-preview/src/lumen/feature-preview.astro +32 -0
  58. package/templates/astro/guided-onboarding/src/lumen/guided-onboarding.astro +35 -0
  59. package/templates/astro/interactive-pricing/src/lumen/interactive-pricing.astro +32 -0
  60. package/templates/astro/media-workspace/src/lumen/adjustment-controls.astro +89 -0
  61. package/templates/astro/media-workspace/src/lumen/media-processing.astro +47 -0
  62. package/templates/astro/media-workspace/src/lumen/media-workspace.astro +77 -0
  63. package/templates/astro/page-header/src/lumen/page-header.astro +41 -0
  64. package/templates/astro/project-workspace/src/lumen/project-workspace.astro +103 -0
  65. package/templates/astro/rich-text-editor/src/lumen/rich-text-editor.astro +21 -0
  66. package/templates/astro/saas-admin/src/lumen/saas-admin.astro +110 -0
  67. package/templates/astro/scheduler/src/lumen/scheduler.astro +36 -0
  68. package/templates/astro/section-header/src/lumen/section-header.astro +35 -0
  69. package/templates/astro/theme-builder/src/lumen/theme-builder.astro +28 -0
  70. package/templates/elements/advanced-fields/src/lumen/advanced-fields.html +25 -0
  71. package/templates/elements/analytics-dashboard/src/lumen/analytics-dashboard.html +28 -0
  72. package/templates/elements/auth-onboarding/src/lumen/auth-onboarding.html +79 -0
  73. package/templates/elements/command-center/src/lumen/command-center.html +15 -0
  74. package/templates/elements/commerce-dashboard/src/lumen/commerce-dashboard.html +24 -0
  75. package/templates/elements/content-flow-actions/src/lumen/content-flow-actions.html +11 -0
  76. package/templates/elements/content-flow-header/src/lumen/content-flow-header.html +15 -0
  77. package/templates/elements/content-flow-list/src/lumen/content-flow-list.html +14 -0
  78. package/templates/elements/content-flow-settings/src/lumen/content-flow-settings.html +18 -0
  79. package/templates/elements/data-collections/src/lumen/data-collections.html +31 -0
  80. package/templates/elements/feature-preview/src/lumen/feature-preview.html +13 -0
  81. package/templates/elements/guided-onboarding/src/lumen/guided-onboarding.html +16 -0
  82. package/templates/elements/interactive-pricing/src/lumen/interactive-pricing.html +13 -0
  83. package/templates/elements/media-workspace/src/lumen/media-workspace.html +57 -0
  84. package/templates/elements/media-workspace/src/lumen/media-workspace.ts +163 -0
  85. package/templates/elements/page-header/src/lumen/page-header.html +20 -0
  86. package/templates/elements/project-workspace/src/lumen/project-workspace.html +17 -0
  87. package/templates/elements/rich-text-editor/src/lumen/rich-text-editor.html +17 -0
  88. package/templates/elements/saas-admin/src/lumen/saas-admin.html +18 -0
  89. package/templates/elements/scheduler/src/lumen/scheduler.html +27 -0
  90. package/templates/elements/section-header/src/lumen/section-header.html +21 -0
  91. package/templates/elements/theme-builder/src/lumen/theme-builder.html +59 -0
  92. package/templates/react/advanced-fields/src/lumen/advanced-fields.tsx +37 -0
  93. package/templates/react/analytics-dashboard/src/lumen/analytics-dashboard.tsx +143 -0
  94. package/templates/react/auth-onboarding/src/lumen/auth-onboarding.tsx +129 -0
  95. package/templates/react/command-center/src/lumen/command-center.tsx +85 -0
  96. package/templates/react/commerce-dashboard/src/lumen/commerce-dashboard.tsx +148 -0
  97. package/templates/react/content-flow-actions/src/lumen/content-flow-actions.tsx +11 -0
  98. package/templates/react/content-flow-header/src/lumen/content-flow-header.tsx +14 -0
  99. package/templates/react/content-flow-list/src/lumen/content-flow-list.tsx +19 -0
  100. package/templates/react/content-flow-settings/src/lumen/content-flow-settings.tsx +26 -0
  101. package/templates/react/data-collections/src/lumen/data-collections.tsx +60 -0
  102. package/templates/react/feature-preview/src/lumen/feature-preview.tsx +42 -0
  103. package/templates/react/guided-onboarding/src/lumen/guided-onboarding.tsx +100 -0
  104. package/templates/react/import-review/src/lumen/import-review.tsx +150 -0
  105. package/templates/react/interactive-pricing/src/lumen/interactive-pricing.tsx +60 -0
  106. package/templates/react/media-workspace/src/lumen/adjustment-controls.tsx +61 -0
  107. package/templates/react/media-workspace/src/lumen/media-processing.tsx +43 -0
  108. package/templates/react/media-workspace/src/lumen/media-workspace.tsx +100 -0
  109. package/templates/react/operational-records/src/lumen/operational-records.tsx +92 -0
  110. package/templates/react/page-header/src/lumen/page-header.tsx +41 -0
  111. package/templates/react/project-workspace/src/lumen/project-workspace.tsx +112 -0
  112. package/templates/react/record-workspace/src/lumen/record-workspace.tsx +67 -0
  113. package/templates/react/review-workflow/src/lumen/review-workflow.tsx +202 -0
  114. package/templates/react/rich-text-editor/src/lumen/rich-text-editor.tsx +33 -0
  115. package/templates/react/saas-admin/src/lumen/saas-admin.tsx +119 -0
  116. package/templates/react/scheduler/src/lumen/scheduler.tsx +45 -0
  117. package/templates/react/section-header/src/lumen/section-header.tsx +33 -0
  118. package/templates/react/styles.d.ts +1 -0
  119. package/templates/react/theme-builder/src/lumen/theme-builder.tsx +57 -0
  120. package/templates/react/tsconfig.json +14 -0
  121. package/templates/react/validated-form/src/lumen/validated-form.tsx +166 -0
  122. package/templates/shared/common/src/lumen/lumen-template.css +247 -0
  123. package/templates/shared/media-workspace/src/lumen/media-workspace.css +14 -0
  124. package/templates/shared/visual-blocks/src/lumen/product-blocks.ts +224 -0
  125. package/v4-migration.json +448 -0
package/README.md CHANGED
@@ -1,7 +1,59 @@
1
- # @santi020k/lumen
1
+ <p align="center">
2
+ <a href="https://lumen.santi020k.com">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/santi020k/lumen/main/docs/assets/readme/package-dark.svg">
5
+ <img src="https://raw.githubusercontent.com/santi020k/lumen/main/docs/assets/readme/package-light.svg" alt="Lumen UI — Web. Native. Thoughtfully connected." width="1200" height="184">
6
+ </picture>
7
+ </a>
8
+ </p>
9
+
10
+ <h1 align="center">Lumen UI · CLI &amp; Registry</h1>
11
+
12
+ <p align="center">Component discovery · Recipes · Integration diagnostics</p>
13
+
14
+ <p align="center">
15
+ <a href="https://www.npmjs.com/package/@santi020k/lumen"><img src="https://img.shields.io/npm/v/@santi020k/lumen?style=flat-square&color=0369a0" alt="npm version"></a>
16
+ <a href="https://github.com/santi020k/lumen/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-13967e?style=flat-square" alt="MIT license"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="https://lumen.santi020k.com/docs">Documentation</a>
21
+ ·
22
+ <a href="https://www.npmjs.com/package/@santi020k/lumen">npm</a>
23
+ ·
24
+ <a href="https://github.com/santi020k/lumen/tree/main/packages/lumen">Source</a>
25
+ ·
26
+ <a href="https://github.com/santi020k/lumen/issues">Issues</a>
27
+ </p>
28
+
29
+ **Package:** `@santi020k/lumen`
30
+
31
+ **On this page:** [Install](#install) · [Commands](#commands) · [Appearance presets](#appearance-presets) · [Resources](#resources)
32
+
33
+ <details>
34
+ <summary>Browse all sections</summary>
35
+
36
+ - [Install](#install)
37
+ - [Typography](#typography)
38
+ - [Commands](#commands)
39
+ - [Version migration previews](#version-migration-previews)
40
+ - [Coordinated consumer rollout](#coordinated-consumer-rollout)
41
+ - [Consumer upgrade and theme audits](#consumer-upgrade-and-theme-audits)
42
+ - [Content flow](#content-flow)
43
+ - [Appearance presets](#appearance-presets)
44
+ - [Preview a v4 migration](#preview-a-v4-migration)
45
+ - [Dashboard header recipes](#dashboard-header-recipes)
46
+ - [Visual interactions and product blocks](#visual-interactions-and-product-blocks)
47
+ - [Presence motion](#presence-motion)
48
+ - [Studio media workspace](#studio-media-workspace)
49
+ - [Resources](#resources)
50
+
51
+ </details>
2
52
 
3
53
  Shared foundation and umbrella package for Lumen UI.
4
54
 
55
+ ## Install
56
+
5
57
  Install the framework package directly:
6
58
 
7
59
  - `@santi020k/lumen-astro`
@@ -16,6 +68,10 @@ also want to import its framework-neutral registry or diagnostics APIs:
16
68
  pnpm add @santi020k/lumen
17
69
  ```
18
70
 
71
+ Set direction with the `dir` attribute on `html` or a containing element. Select and NativeSelect
72
+ place their chevron from the nearest `dir="rtl"` or `dir="ltr"` ancestor, so nested LTR regions
73
+ inside RTL work even when a consumer CSS pipeline compiles `:dir()` into language selectors.
74
+
19
75
  ## Typography
20
76
 
21
77
  Lumen defaults `--ui-font` to the canonical Santi020k Montserrat family stack:
@@ -28,6 +84,8 @@ The package declares the family but does not bundle or load font files. Applicat
28
84
  Montserrat once through their preferred delivery path, or override `--ui-font` when using another
29
85
  typeface.
30
86
 
87
+ ## Commands
88
+
31
89
  The umbrella package also exposes typed registry metadata and the `lumen` CLI:
32
90
 
33
91
  ```bash
@@ -47,11 +105,14 @@ lumen doctor --json
47
105
  lumen doctor-native --json
48
106
  lumen init --framework astro --tailwind
49
107
  lumen migrate v2 --dry-run
108
+ lumen migrate v3 --dry-run
109
+ lumen migrate v4 --dry-run
50
110
  ```
51
111
 
52
112
  Use `lumen add <component>` for a local Astro wrapper, `--target react` for a React wrapper, or
53
113
  `--target elements` for a custom-elements starter. Bundled recipes support the same Astro, React,
54
- and Elements targets.
114
+ and Elements targets. With `--conflict error`, existing target files are checked before any recipe
115
+ files are written; runtime write failures can still require cleanup.
55
116
 
56
117
  Complete product recipes are also bundled for `analytics-dashboard`, `saas-admin`,
57
118
  `commerce-dashboard`, `project-workspace`, `auth-onboarding`, `docs-shell`, `marketing-shell`,
@@ -61,6 +122,9 @@ External registry manifests are treated as untrusted input. Inline recipe files
61
122
  relative forward-slash paths and cannot traverse outside the selected `--cwd` or write through a
62
123
  symbolic-link path segment. `loadLumenRegistry` bounds local and remote manifests to 5 MiB by
63
124
  default; programmatic consumers can set `maxBytes` and `timeoutMs` for tighter deployment limits.
125
+ Component wrapper names must be ASCII identifiers containing letters, digits, or underscores,
126
+ starting with a letter or underscore, and cannot be reserved module keywords. Invalid names are
127
+ rejected before generating or writing any wrapper; recipe names retain their existing format.
64
128
 
65
129
  Run `lumen doctor` to check adapter/style agreement, duplicate stylesheet entrypoints, Tailwind
66
130
  layer order, Astro runtime mounts, and fragile internal selector dependencies. In a workspace,
@@ -68,6 +132,8 @@ diagnostics are scoped to the nearest package boundary, generated build trees ar
68
132
  application-controlled Astro `Toggle` instances do not require the shared runtime. It also suggests
69
133
  matching Lumen primitives for likely hand-built dropdown, theme, dialog-focus, and keyboard-menu
70
134
  behavior. These suggestions stay advisory because product-specific composition can be intentional.
135
+ Astro runtime mount detection follows default-import aliases, including `default as` imports.
136
+ Type-only imports, front matter example strings, and HTML comments do not establish a runtime mount.
71
137
  Publishable shared UI libraries are not required to load global styles. Private wrapper packages
72
138
  can declare `"lumen": { "styleOwnership": "consumer" }` when their applications own adapter CSS,
73
139
  or `"application"` when the package itself owns setup.
@@ -93,7 +159,32 @@ Run `lumen audit-tokens [path]` before incremental adoption when an existing sty
93
159
  declare names such as `--surface`, `--ink`, or `--line`. The audit reports complete CSS colors that
94
160
  are incompatible with Lumen's HSL-channel token format and exits non-zero when it finds conflicts.
95
161
 
96
- ## Lumen v2 migration preview
162
+ ## Version migration previews
163
+
164
+ Run `lumen migrate v3` for the v2-to-v3 review: no web source rewrites are needed. It reports
165
+ native rebuild and exhaustive Swift icon-switch boundaries. Run `lumen migrate v4` for the
166
+ v3-to-v4 source preview. Literal Stack/Grid gaps preserve v3 spacing (`md` → `group`, `lg` → `xl`,
167
+ `xl` → `2xl`); dynamic values, spreads, product CSS, charts, dialogs and native contracts need review.
168
+ Aliases are resolved from actual Lumen imports; unrelated components and source examples stay intact.
169
+
170
+ Both commands preview by default and accept `--cwd`, `--json`, and `--apply`. Add `--dependencies`
171
+ to include the existing coordinated pnpm rollout: v3 targets `3.0.1`, v4 targets `4.0.0`. Dependency
172
+ apply retains rollout's exact package-manager and dirty-worktree guards; `--allow-dirty` is explicit.
173
+ Installs run before source rewrites; a failed dependency command stops source apply. Run the
174
+ consumer's completion gate after both phases. Source-only migration works without a package manifest
175
+ or package-manager requirement. Native Swift/Maven pins remain application-owned.
176
+
177
+ V4 apply records output fingerprints in `.lumen/migrations-v4.json`. Commit that ledger with the
178
+ source changes: repeated applies skip migrated files, and later edits to them require manual review.
179
+ The pure `migrateLumenVersionSource` API assumes v3 input and does not maintain that filesystem ledger.
180
+ Markup migrations preserve literal slash-star text; script comments and regex literals remain
181
+ excluded from rewrites. The umbrella package includes TypeScript as a runtime dependency so
182
+ the migration scanner can distinguish regex literals from division using compiler grammar.
183
+ Files that exceed the parser nesting limit remain unchanged and receive a manual-review finding.
184
+ Dependency inventory recognizes root and nested manifests using platform-native paths.
185
+ Review the actual application at mobile and desktop widths after applying a migration.
186
+
187
+ ### Lumen v2 migration
97
188
 
98
189
  Run `lumen migrate v2 [--cwd <path>]` to preview the candidate v2 source migrations. Previewing is
99
190
  the safe default; `--dry-run` makes that intent explicit, and `--json` emits a machine-readable
@@ -144,3 +235,120 @@ new release through `minimumReleaseAgeExclude`, runs installs through Corepack f
144
235
  root, removes obsolete Lumen release-age exceptions, verifies the unified resolved version, and
145
236
  runs available framework checks, builds, and browser scripts. It refuses dirty repositories,
146
237
  missing exact pnpm declarations, and unsupported Node runtimes unless `--allow-dirty` is explicit.
238
+
239
+ ## Consumer upgrade and theme audits
240
+
241
+ ```bash
242
+ lumen audit-consumer ../my-app --json
243
+ lumen audit-theme ./semantic-theme-scopes.json --json
244
+ lumen add validated-form --target react
245
+ lumen add operational-records --target react
246
+ ```
247
+
248
+ The consumer audit reports declared and resolved versions, patch configuration and `ui-*` CSS
249
+ review signals without rewriting files. Selectors are advisory customization review signals.
250
+ Version migration previews include the same audit when the consumer has a manifest.
251
+
252
+ The theme file maps scope names to complete semantic-token objects, such as
253
+ `{ "light": { "canvas": "0 0% 100%", "ink": "0 0% 0%", ... } }`. Supply every semantic color
254
+ mapping with resolved opaque HSL channels. Missing or unresolved values and failing normal-text
255
+ contrast produce findings and a failing theme-audit exit status. Inspect computed mappings with
256
+ `inspectLumenTheme` from core for CSS variable resolution in actual light, dark and nested scopes.
257
+
258
+ See [consumer workflows](https://github.com/santi020k/lumen/blob/main/docs/consumer-ui-recipes.md#executable-consumer-workflows) for
259
+ the installable React form and operational-record recipes.
260
+
261
+ ## Content flow
262
+
263
+ Stack and Grid own sibling spacing. Their gap accepts `related`, `group` (default) and `section`,
264
+ or canonical `none`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl` sizes. Card owns the inset and gap
265
+ between its visible parts; use `density="compact"`, `"comfortable"` (default) or `"spacious"`.
266
+ Elements uses the same names as attributes. Use a nested Stack for CardContent groups and Field
267
+ for label/control/feedback. See [content flow](https://github.com/santi020k/lumen/blob/main/docs/content-flow.md) and the
268
+ [v4 migration guide](https://github.com/santi020k/lumen/blob/main/docs/migrating-to-lumen.md) for ownership and changed explicit gaps.
269
+
270
+ ### Reading and complete compositions
271
+
272
+ Prose and Typography trim outer child margins and separate headings from preceding text.
273
+ Container gutters grow from 16px to 32px with viewport width; override `--ui-container-gutter`
274
+ when a product needs fixed gutters. Card allows interactive overflow; use AspectRatio to clip media.
275
+ Install `content-flow-header`, `content-flow-settings`, `content-flow-list` or `content-flow-actions`
276
+ with `lumen add <recipe> --target astro|react|elements`. MCP returns the same complete examples.
277
+ Connect application actions and replace sample IDs before reuse. See
278
+ [content flow](https://github.com/santi020k/lumen/blob/main/docs/content-flow.md) for composition and migration guidance.
279
+
280
+ React is an optional peer for the published React starter templates. Astro and Elements consumers
281
+ do not need it; React consumers should follow the React adapter's existing installation contract.
282
+
283
+ ## Appearance presets
284
+
285
+ Choose Default, Studio or Glass with `data-lumen-preset` on a scoped web container.
286
+ Use the [appearance guide](https://github.com/santi020k/lumen/blob/main/docs/appearance-presets.md) for semantic overrides,
287
+ ThemeBuilder controls and native fallbacks. The Studio preset uses PostLens as its visual reference.
288
+
289
+ ## Preview a v4 migration
290
+
291
+ ```bash
292
+ pnpm exec lumen migrate v4 --dry-run --json
293
+ pnpm exec lumen migrate v4 --apply
294
+ ```
295
+
296
+ The default is a preview. Deterministic edits cover four known static MCP SDK v1 import paths in
297
+ `.ts`, `.js`, and `.mjs` files. The report inventories resolved installed versions and lists v4
298
+ UI/native review triggers. SDK dependency manifests, comments, examples, dynamic imports, JSX, Astro,
299
+ and native SDK imports remain review tasks. Review triggers are not proof of a defect. The v2 migration
300
+ command remains available separately for older consumers.
301
+
302
+ The integrated `lumen migrate v4` command also retains the release's web spacing migrations and
303
+ optional coordinated dependency workflow. SDK edits compose into that command's source transform,
304
+ so its apply ledger fingerprints the final source and repeat runs do not rewrite spacing twice.
305
+ SDK import edits remain limited to `.ts`, `.js`, and `.mjs`; this restriction does not disable the
306
+ separate documented JSX/Astro spacing migration. The JSON report includes installed package
307
+ versions and explicit SDK dependency-review findings.
308
+
309
+ ## Dashboard header recipes
310
+
311
+ Install `page-header` and `section-header` with `lumen add <recipe> --target astro|react|elements`.
312
+ These compositions provide page identity, optional breadcrumbs and metadata, translated action-group
313
+ labels, and responsive action wrapping using the existing primitives. The application owns its
314
+ routes and action handlers. See the [header recipe guide](https://github.com/santi020k/lumen/blob/main/docs/consumer-ui-recipes.md#page-and-section-headers).
315
+
316
+ The `auth-onboarding` recipe includes visual email-code sign-in, code verification, and passkey
317
+ recovery examples for Astro, React, and Elements. Controls stay disabled until the consumer connects
318
+ its authentication service. See the [login and Auth integration reference](https://lumen.santi020k.com/templates/auth-onboarding#login-examples-title).
319
+
320
+ ## Visual interactions and product blocks
321
+
322
+ See [visual interactions](https://github.com/santi020k/lumen/blob/main/docs/visual-interactions.md) for keyed motion, semantic effects,
323
+ chart continuity, AI surfaces, optional SDK integrations, and the four installable product recipes.
324
+ ## Presence motion
325
+
326
+ `animateLumenPresence` is available from the umbrella package or `@santi020k/lumen-core` for
327
+ optional browser-based enter/exit effects. See the [core motion contract](https://github.com/santi020k/lumen/blob/main/packages/core/README.md#presence-motion)
328
+ for presets, semantic timing, cancellation, reduced motion, and consumer-owned DOM/focus behavior.
329
+ The optional motion stylesheet progressively enhances native disclosures with natural-height transitions;
330
+ unsupported browsers keep native immediate toggles.
331
+
332
+ Import `@santi020k/lumen/styles/motion.css` alongside the base stylesheet to opt into native
333
+ disclosure height transitions and the CSS reduction scope. This small optional stylesheet works
334
+ with Astro, React, and Elements and keeps those effects out of the default stylesheet. The presence
335
+ helper's system and local reduced-motion checks work without this CSS import.
336
+
337
+ ## Studio media workspace
338
+
339
+ Compose MediaViewport, MediaThumbnail, MediaFilmstrip and ImageComparison modes with the
340
+ [Studio media workspace recipes](https://github.com/santi020k/lumen/blob/main/docs/studio-media-workspaces.md). Applications retain
341
+ media loading, selection, adjustment algorithms, processing, export and persistence.
342
+
343
+ ## Resources
344
+
345
+ | Guide | What you will find |
346
+ | --- | --- |
347
+ | [AI usage examples](https://github.com/santi020k/lumen/blob/main/docs/ai-usage.md) | Setup and composition contracts for coding agents. |
348
+ | [Consumer adoption](https://github.com/santi020k/lumen/blob/main/docs/project-adoption.md) | Adoption boundaries and staged migration guidance. |
349
+ | [MCP server](https://github.com/santi020k/lumen/blob/main/packages/mcp/README.md) | Catalog discovery, transport setup, and agent workflows. |
350
+ | [Contributing](https://github.com/santi020k/lumen/blob/main/CONTRIBUTING.md) | Setup, checks, and contribution workflow. |
351
+ | [Release history](https://github.com/santi020k/lumen/releases) | Published releases and version notes. |
352
+
353
+ Part of [Lumen UI](https://lumen.santi020k.com), created by [Santiago Molina](https://santi020k.com).
354
+ Licensed under [MIT](https://github.com/santi020k/lumen/blob/main/LICENSE); third-party artwork retains its own notices.
package/dist/cli.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import { readdir, readFile, stat } from 'node:fs/promises';
2
2
  import { resolve } from 'node:path';
3
+ import { auditLumenTheme } from '@santi020k/lumen-core';
3
4
  import { consumerRolloutSucceeded, formatConsumerRollout, resolveConsumerRolloutTargets, runConsumerRollout } from './consumer-rollout.js';
5
+ import { formatLumenConsumerUpgradeAudit, inspectLumenConsumerUpgrade } from './consumer-upgrade-audit.js';
4
6
  import { createLumenSetup, formatLumenDiagnostics, inspectLumenIntegration } from './integration-diagnostics.js';
5
7
  import { formatNativeAdoptionAudit, inspectNativeAdoption } from './native-audit.js';
6
8
  import { addLumenRegistryItem, getLumenRegistryEntries, getLumenRegistryItem, loadLumenRegistry, lumenRegistry } from './registry.js';
7
9
  import { auditLumenTokenCss } from './token-audit.js';
8
10
  import { formatLumenV2Migration, migrateLumenV2 } from './v2-migration.js';
11
+ import { formatLumenVersionMigration, migrateLumenVersion } from './version-migration.js';
9
12
  const args = process.argv.slice(2);
10
13
  const [command = 'help', name] = args;
11
14
  const dryRun = args.includes('--dry-run');
@@ -187,11 +190,14 @@ const help = [
187
190
  ' lumen add <name> Install a recipe or component into the current project',
188
191
  ' lumen install Print install commands',
189
192
  ' lumen audit-tokens Report incompatible semantic color custom properties',
193
+ ' lumen audit-theme <json> Check named semantic palettes and text contrast',
194
+ ' lumen audit-consumer Review versions, local patches and Lumen CSS overrides',
190
195
  ' lumen doctor Inspect styles, adapters, runtime mounts, and selector usage',
191
196
  ' lumen doctor-native Inspect native versions, package pins, and theme placement',
192
197
  ' lumen init Print canonical framework setup without changing files',
193
198
  ' lumen rollout [version] [repositories...] Inventory or upgrade pnpm consumers',
194
- ' lumen migrate v2 Preview or apply the candidate Lumen v2 source migrations',
199
+ ' lumen migrate v2|v3|v4 Preview source migrations and manual review findings',
200
+ ' --dependencies Include coordinated pnpm upgrades for v3/v4 migrations',
195
201
  '',
196
202
  'Options:',
197
203
  ' --cwd <path> Target directory for lumen add',
@@ -206,7 +212,7 @@ const help = [
206
212
  ' --tailwind Include the verified Tailwind cascade setup in lumen init',
207
213
  ' --json Print lumen doctor output as JSON',
208
214
  ' --manifest <path> Use a specific cross-platform release manifest',
209
- ' --apply Apply a rollout or v2 migration (migrations default to dry-run)',
215
+ ' --apply Apply a rollout or supported migration (migrations default to dry-run)',
210
216
  ' --allow-dirty Allow rollout after recording an uncommitted baseline',
211
217
  ' --exclude <path> Exclude a repository (repeatable)',
212
218
  ' --no-verify Skip downstream check, typecheck, build, and browser scripts',
@@ -220,6 +226,33 @@ const run = async () => {
220
226
  await loadLumenRegistry(registrySource, registryToken ? { token: registryToken } : {}) :
221
227
  lumenRegistry;
222
228
  switch (command) {
229
+ case 'audit-consumer': {
230
+ const report = await inspectLumenConsumerUpgrade(cwd ?? name ?? process.cwd());
231
+ output = json ? JSON.stringify(report, undefined, 2) : formatLumenConsumerUpgradeAudit(report);
232
+ break;
233
+ }
234
+ case 'audit-theme': {
235
+ if (!name)
236
+ throw new Error('Provide a JSON file mapping scope names to resolved semantic palettes.');
237
+ const value = JSON.parse(await readFile(resolve(cwd ?? process.cwd(), name), 'utf8'));
238
+ if (!value || typeof value !== 'object' || Array.isArray(value) || Object.keys(value).length === 0)
239
+ throw new Error('Theme audit requires a nonempty scope-to-palette object.');
240
+ const palettes = Object.entries(value);
241
+ const scopes = palettes.map(([scope, palette]) => {
242
+ if (!palette || typeof palette !== 'object' || Array.isArray(palette))
243
+ throw new Error(`Invalid palette for ${scope}.`);
244
+ const entries = Object.entries(palette);
245
+ if (entries.some(([, channel]) => typeof channel !== 'string')) {
246
+ throw new Error(`Palette ${scope} must contain string HSL channels.`);
247
+ }
248
+ const tokens = Object.fromEntries(entries.map(([token, channel]) => [token, String(channel)]));
249
+ return { scope, ...auditLumenTheme(tokens) };
250
+ });
251
+ output = json ? JSON.stringify(scopes, undefined, 2) : scopes.map(scope => `${scope.scope}: ${scope.healthy ? 'passed' : 'needs review'}\n${scope.findings.map(item => ` [${item.rule}] ${item.message}`).join('\n')}`).join('\n');
252
+ if (scopes.some(scope => !scope.healthy))
253
+ process.exitCode = 1;
254
+ break;
255
+ }
223
256
  case 'audit-tokens': {
224
257
  output = await formatTokenAudit(name ?? cwd ?? process.cwd());
225
258
  break;
@@ -256,10 +289,21 @@ const run = async () => {
256
289
  break;
257
290
  }
258
291
  case 'migrate': {
259
- if (name !== 'v2')
260
- throw new Error('Missing or invalid migration. Use lumen migrate v2.');
292
+ if (name !== 'v2' && name !== 'v3' && name !== 'v4')
293
+ throw new Error('Missing or invalid migration. Use lumen migrate v2, v3 or v4.');
261
294
  if (applyRollout && dryRun)
262
- throw new Error('Choose either --dry-run or --apply for lumen migrate v2.');
295
+ throw new Error('Choose either --dry-run or --apply for lumen migrate.');
296
+ if (name !== 'v2') {
297
+ const report = await migrateLumenVersion({
298
+ allowDirty, apply: applyRollout, ...(cwd ? { cwd } : {}), dependencies: args.includes('--dependencies'), version: name
299
+ });
300
+ output = json ? JSON.stringify(report, undefined, 2) : formatLumenVersionMigration(report);
301
+ if (report.dependencies && !consumerRolloutSucceeded(report.dependencies))
302
+ process.exitCode = 1;
303
+ break;
304
+ }
305
+ if (args.includes('--dependencies'))
306
+ throw new Error('For v2 dependencies, use lumen rollout separately.');
263
307
  const report = await migrateLumenV2({
264
308
  apply: applyRollout,
265
309
  cwd: cwd ?? process.cwd()
@@ -0,0 +1,10 @@
1
+ import type { LumenDiagnosticFinding } from './integration-diagnostics.js';
2
+ export interface LumenConsumerUpgradeAudit {
3
+ findings: LumenDiagnosticFinding[];
4
+ repository: string;
5
+ targetVersion: string;
6
+ }
7
+ /** Advisory inventory only: patches and product CSS are never deleted or rewritten. */
8
+ export declare const inspectLumenConsumerUpgrade: (repository: string, targetVersion?: string) => Promise<LumenConsumerUpgradeAudit>;
9
+ export declare const formatLumenConsumerUpgradeAudit: (report: LumenConsumerUpgradeAudit) => string;
10
+ //# sourceMappingURL=consumer-upgrade-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer-upgrade-audit.d.ts","sourceRoot":"","sources":["../src/consumer-upgrade-audit.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAG1E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,sBAAsB,EAAE,CAAA;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AA0CD,uFAAuF;AACvF,eAAO,MAAM,2BAA2B,GACtC,YAAY,MAAM,EAAE,sBAAuB,KAC1C,OAAO,CAAC,yBAAyB,CAWnC,CAAA;AAED,eAAO,MAAM,+BAA+B,GAAI,QAAQ,yBAAyB,KAAG,MAIxE,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { relative, resolve } from 'node:path';
3
+ import { satisfies, valid } from 'semver';
4
+ import { inspectLumenConsumer } from './consumer-rollout.js';
5
+ import { discoverSourceFiles } from './v2-migration.js';
6
+ const review = (file, rule, message, remediation) => ({ file, rule, message, remediation, severity: 'advisory' });
7
+ const versionFindings = (inventory, targetVersion) => {
8
+ const findings = [];
9
+ for (const reference of inventory.references) {
10
+ if (reference.version.startsWith('workspace:') || reference.version.startsWith('catalog:'))
11
+ continue;
12
+ if (!satisfies(targetVersion, reference.version)) {
13
+ findings.push(review(reference.file, 'consumer-package-version', `${reference.packageName} ${reference.version} does not include target ${targetVersion}.`, 'Preview lumen migrate v4 --dependencies, align the adapter and companion packages, then validate the consumer.'));
14
+ }
15
+ }
16
+ for (const [name, versions] of Object.entries(inventory.resolvedVersions)) {
17
+ if (versions.some(version => version !== targetVersion)) {
18
+ findings.push(review('pnpm-lock.yaml', 'consumer-resolved-version', `${name} resolves ${versions.join(', ')}; target is ${targetVersion}.`, 'Update through the repository package manager and inspect the resulting lockfile; a compatible manifest range does not prove installation.'));
19
+ }
20
+ }
21
+ return findings;
22
+ };
23
+ const sourceFindings = (file, source) => {
24
+ const findings = [];
25
+ if (file.endsWith('.patch') && (file.includes('lumen') || source.includes('@santi020k/lumen'))) {
26
+ findings.push(review(file, 'consumer-package-patch', 'A local Lumen package patch needs migration review.', 'Compare each patch with the target implementation. Chart padding/axis fixes may already be upstream; remove only after equivalent behavior and mobile/desktop visuals pass.'));
27
+ }
28
+ if ((file.endsWith('.yaml') || file.endsWith('.json')) && source.includes('patchedDependencies') && source.includes('@santi020k/lumen')) {
29
+ findings.push(review(file, 'consumer-patch-configuration', 'Lumen dependencies and package patch configuration coexist in this file.', 'Inspect the exact patched dependency keys and patch paths before upgrading; this signal alone does not establish that every Lumen dependency is patched.'));
30
+ }
31
+ if (file.endsWith('.css') && source.includes('.ui-')) {
32
+ findings.push(review(file, 'consumer-css-review', 'CSS references Lumen component classes.', 'Check selectors against the public styling contract. Keep supported customization; review chart axes, hidden states, button children, record layouts and overlay offsets against target behavior.'));
33
+ }
34
+ return findings;
35
+ };
36
+ /** Advisory inventory only: patches and product CSS are never deleted or rewritten. */
37
+ export const inspectLumenConsumerUpgrade = async (repository, targetVersion = '4.0.0') => {
38
+ if (!valid(targetVersion))
39
+ throw new Error('Consumer audit requires an exact semantic target version.');
40
+ const root = resolve(repository);
41
+ const inventory = await inspectLumenConsumer(root);
42
+ const findings = versionFindings(inventory, targetVersion);
43
+ const files = await discoverSourceFiles(root, new Set(['.css', '.patch', '.yaml', '.json']));
44
+ for (const path of files)
45
+ findings.push(...sourceFindings(relative(root, path), await readFile(path, 'utf8')));
46
+ return { findings, repository: root, targetVersion };
47
+ };
48
+ export const formatLumenConsumerUpgradeAudit = (report) => [
49
+ `Consumer upgrade review for ${report.targetVersion}: ${report.repository}`,
50
+ ...report.findings.map(item => `${item.file} [${item.rule}] ${item.message}\n ${item.remediation}`),
51
+ report.findings.length ? 'These are review signals, not permission to remove consumer code.' : 'No package-version, patch or CSS review signals found.'
52
+ ].join('\n');
package/dist/index.d.ts CHANGED
@@ -7,7 +7,10 @@ export declare const lumen: {
7
7
  readonly packageName: "@santi020k/lumen";
8
8
  readonly scope: "@santi020k";
9
9
  };
10
+ export { formatLumenConsumerUpgradeAudit, inspectLumenConsumerUpgrade, type LumenConsumerUpgradeAudit } from './consumer-upgrade-audit.js';
10
11
  export { createLumenSetup, formatLumenDiagnostics, inspectLumenIntegration, type LumenDiagnosticFinding, type LumenDiagnosticReport, type LumenDiagnosticSeverity } from './integration-diagnostics.js';
11
12
  export { auditLumenTokenCss, type LumenTokenAuditFinding } from './token-audit.js';
12
13
  export { formatLumenV2Migration, type LumenV2MigrationFinding, type LumenV2MigrationKind, type LumenV2MigrationOptions, type LumenV2MigrationReport, type LumenV2SourceMigration, migrateLumenV2, migrateLumenV2Source } from './v2-migration.js';
14
+ export { formatLumenVersionMigration, type LumenMigrationVersion, type LumenVersionMigrationFinding, type LumenVersionMigrationOptions, type LumenVersionMigrationReport, type LumenVersionSourceMigration, migrateLumenVersion, migrateLumenVersionSource } from './version-migration.js';
15
+ export { animateLumenPresence, type LumenMotionDuration, type LumenMotionPreset, type LumenMotionResult, type LumenPresenceOptions } from '@santi020k/lumen-core';
13
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,cAAc,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACj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B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAE9B,eAAO,MAAM,KAAK;;;;CAIR,CAAA;AAEV,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,kBAAkB,EAClB,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,cAAc,EACd,oBAAoB,EACrB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,cAAc,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EA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E,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAA"}
package/dist/index.js CHANGED
@@ -7,6 +7,9 @@ export const lumen = {
7
7
  packageName: '@santi020k/lumen',
8
8
  scope: '@santi020k'
9
9
  };
10
+ export { formatLumenConsumerUpgradeAudit, inspectLumenConsumerUpgrade } from './consumer-upgrade-audit.js';
10
11
  export { createLumenSetup, formatLumenDiagnostics, inspectLumenIntegration } from './integration-diagnostics.js';
11
12
  export { auditLumenTokenCss } from './token-audit.js';
12
13
  export { formatLumenV2Migration, migrateLumenV2, migrateLumenV2Source } from './v2-migration.js';
14
+ export { formatLumenVersionMigration, migrateLumenVersion, migrateLumenVersionSource } from './version-migration.js';
15
+ export { animateLumenPresence } from '@santi020k/lumen-core';
@@ -1 +1 @@
1
- {"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAA;AAQtB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAA;IACnD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,MAAM,CAAA;IAChD,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,cAAc;IA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B;AAkRD,eAAO,MAAM,oBAAoB,GAAU,MAAM,MAAM,EAAE,UAAS,eAAoB,KAAG,OAAO,CAAC,cAAc,CAgD9G,CAAA"}
package/dist/installer.js CHANGED
@@ -2,8 +2,10 @@ import { access, lstat, mkdir, readdir, readFile, writeFile } from 'node:fs/prom
2
2
  import { dirname, join, relative, resolve, sep } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { getLumenRegistryItem } from './registry.js';
5
+ import { isSafeRegistryComponentName } from './registry-component-name.js';
5
6
  import { assertSafeRegistryFilePath } from './registry-path.js';
6
7
  const templatesRoot = fileURLToPath(new URL('../templates/', import.meta.url));
8
+ const visualProductBlocks = new Set(['interactive-pricing', 'feature-preview', 'guided-onboarding', 'command-center']);
7
9
  const productTemplateRecipes = new Set([
8
10
  'analytics-dashboard',
9
11
  'auth-onboarding',
@@ -32,6 +34,7 @@ const loadTemplateDirectory = async (templateDir) => {
32
34
  const loadRecipeTemplateFiles = async (itemName, target) => {
33
35
  const templateDirectories = [
34
36
  ...(productTemplateRecipes.has(itemName) ? [join(templatesRoot, 'shared', 'common')] : []),
37
+ ...(target !== 'react' && visualProductBlocks.has(itemName) ? [join(templatesRoot, 'shared', 'visual-blocks')] : []),
35
38
  join(templatesRoot, 'shared', itemName),
36
39
  join(templatesRoot, target, itemName)
37
40
  ];
@@ -94,6 +97,9 @@ declare global {
94
97
  };
95
98
  };
96
99
  const createComponentFile = (name, target) => {
100
+ if (!isSafeRegistryComponentName(name)) {
101
+ throw new Error('Registry component names must be safe identifiers without reserved keywords.');
102
+ }
97
103
  if (target === 'react')
98
104
  return createReactComponentFile(name);
99
105
  if (target === 'elements')
@@ -178,6 +184,15 @@ const validateInstallFiles = async (files, cwd) => {
178
184
  await assertNoSymlinkSegments(cwd, file.path);
179
185
  }
180
186
  };
187
+ const validateInstallConflicts = async (files, cwd, conflict) => {
188
+ if (conflict !== 'error')
189
+ return;
190
+ for (const file of files) {
191
+ if (await fileExists(join(cwd, file.path))) {
192
+ throw new Error(`Refusing to overwrite existing file: ${file.path}`);
193
+ }
194
+ }
195
+ };
181
196
  const installRegistryFile = async (file, cwd, options, conflict) => {
182
197
  const target = join(cwd, file.path);
183
198
  const exists = await fileExists(target);
@@ -203,6 +218,7 @@ export const addLumenRegistryItem = async (name, options = {}) => {
203
218
  await validateInstallFiles(files, cwd);
204
219
  const added = [];
205
220
  const conflict = getConflictMode(options);
221
+ await validateInstallConflicts(files, cwd, conflict);
206
222
  const merged = [];
207
223
  const skipped = [];
208
224
  for (const file of files) {
@@ -1 +1 @@
1
- {"version":3,"file":"integration-diagnostics.d.ts","sourceRoot":"","sources":["../src/integration-diagnostics.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,OAAO,CAAA;AAE1D,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,uBAAuB,CAAA;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,sBAAsB,EAAE,CAAA;IAClC,UAAU,EAAE,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC,EAAE,CAAA;IAC9C,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B;AAowBD,eAAO,MAAM,uBAAuB,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,qBAAqB,CA4D/F,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,QAAQ,qBAAqB,KAAG,MAWtE,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,WAAW,OAAO,GAAG,UAAU,GAAG,OAAO,EAAE,kBAAgB,KAAG,MAsC9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