690 Commits

Author SHA1 Message Date
moosme 61a546f24a Merge pull request #1476 from spartan-ng/pre-1.0-audit
chore(repo): pre-1.0 audit - overlay leak fixes, data-slot, CLI drawer, naming
2026-06-16 11:43:11 +02:00
Leonidas bd321c9ab0 chore: nightly release 2026-06-16 ⚡ 2026-06-16 04:12:33 +00:00
Robin Goetz 70fb0e929f fix(cli): handle interrupts in healthcheck prompt and harden generators (#1479)
* fix(cli): handle interrupts in healthcheck prompt and harden generators

Replace the raw-stdin prompt in the healthcheck generator with the standard
enquirer confirm prompt so Ctrl+C correctly aborts the run instead of leaving
the generator running. Isolate each healthcheck so one throwing does not abort
the rest, and report registry fetch failures instead of throwing.

Make getImportAlias throw on a present-but-invalid config rather than silently
falling back to the default alias, guard against the coerce() NPE in
version-utils, and switch migrate-hlm to readJson. Add unit tests across these
paths and stub network access so the suite runs offline.

Closes #906

* fix(cli): guard version healthcheck fix against missing dependencies section

The fix writeback read packageJson.dependencies[dep] directly, which threw when
a package.json had no dependencies section and the dependency lived only in
devDependencies. Guard both sections with optional chaining so the writeback is
symmetrical and never touches an undefined section.
2026-06-15 15:16:42 +02:00
copilot-swe-agent[bot] aaf29b4e05 chore(repo): merge main into pre-1.0-audit (resolve drawer brain version conflict) 2026-06-15 11:47:09 +00:00
Marc Stammerjohann 9e825894d1 feat(native-select): generate to cli 2026-06-15 11:24:11 +02:00
Leonidas 7da9d3e4c3 chore: nightly release 2026-06-15 ⚡ 2026-06-15 04:22:11 +00:00
Ashley Hunter e1b26056ec refactor(breadcrumb): drop deprecated HlmBreadCrumbImports alias
Remove the mis-cased `HlmBreadCrumbImports` alias in favour of the canonical
`HlmBreadcrumbImports`, dropping it before 1.0 rather than carrying it on the stable line. The
NgModule migration map is repointed to the canonical name so `nx g @spartan-ng/cli:migrate-module-
imports` still rewrites `HlmBreadCrumbModule` to an export that exists.
2026-06-14 23:40:36 +01:00
Ashley Hunter 935e4c2404 fix(avatar): give image/fallback distinct prefixed exportAs names
BrnAvatarImage/BrnAvatarFallback and their helm wrappers all used the same
unprefixed exportAs ('avatarImage'/'avatarFallback'). Since the helm directive
host-applies the brain one on the same <img>, a template ref was ambiguous, and
the names broke the brn*/hlm* convention every other exportAs follows. Rename to
brnAvatarImage/brnAvatarFallback and hlmAvatarImage/hlmAvatarFallback before the
exportAs surface is locked at 1.0. Regenerated the CLI avatar templates to match.
2026-06-14 22:26:34 +01:00
Ashley Hunter bf758cfac0 feat(cli): add drawer to the ui generator
Drawer shipped as a helm lib with docs but was missing from the CLI, so
`nx g @spartan-ng/cli:ui drawer` failed. Register it in the Primitive union and
dependency map, generate its templates + supported-ui-libraries entry, and add a
drift-guard spec asserting the CLI primitive set equals the installable helm
components (with a generator template each) so this cannot recur.
2026-06-14 22:24:06 +01:00
Leonidas f377723a53 chore: nightly release 2026-06-14 ⚡ 2026-06-14 04:09:37 +00:00
Ashley Hunter b296a3613b test: silence nx-generator console noise in cli and tools specs
The cli generator specs drive real nx generators, which log copiously
("Couldn't find .gitignore", "NX workspace root does not exist", etc.) - ~3k
lines across 142 specs, enough to truncate the CI log and bury the run summary,
making a passing suite look like it failed. tools has the same class of chatter.

Add `onConsoleLog: () => false` to both configs so that intercepted console
output is dropped (the specs assert on the generated tree and on console spies,
not on this logging; test failures are still reported by the reporter). cli's
output drops from ~3160 to ~530 lines and the summary is visible again.
2026-06-13 19:15:39 +01:00
Ashley Hunter 16ecd13eab test: surface vitest test counts in CI logs for the node projects
Add reporters: ['default'] to the mcp, cli, tools, registry and cli-smoke vite
configs (brain and helm already had it). Without a default reporter the @nx/vitest
NxReporter is the only one attached, so these projects printed no summary in CI -
which is how mcp's silently-undiscovered specs stayed invisible. The counts are
now shown so test execution is verifiable at a glance.
2026-06-13 17:35:00 +01:00
Ashley Hunter e0f236ba47 fix: run mcp tests and stop passWithNoTests masking missing test discovery
The mcp vite config lacked `root: __dirname`, so the @nx/vitest executor (which
runs from the workspace root) resolved `src/**/*.spec.ts` against the workspace
root, found nothing, and `passWithNoTests` passed it silently - mcp's 19 tests
never ran.

Pin mcp's root, and drop `passWithNoTests` from every project that has specs
(mcp, cli, tools, brain, helm) so a future test-discovery break fails loudly
instead of going green. registry keeps the flag - it genuinely has no specs.
2026-06-13 17:16:45 +01:00
Ashley Hunter 656225e78b test: address review feedback in cli generator specs
- base spec: replace hoisted vi.unmock + require with test-scoped vi.importActual
  to load the real @nx/angular/generators for that one test without leaking mock
  state across the file
- migrate-brain-accordion-trigger spec: remove a stray debug console.log
- refresh a stale jest-era comment on the @angular/core stub
2026-06-13 15:46:30 +01:00
Ashley Hunter 1b743f8019 test: migrate from jest to vitest with browser testing for brain/helm
Replace Jest with Vitest across the workspace. The brain and helm Angular suites
now run in a real browser (Playwright/Chromium via Vitest browser mode) so they
exercise real layout, focus, pointer events and computed styles that jsdom could
not. The cli, tools, mcp, registry and cli-smoke suites run on Vitest's node
environment.

- Add per-project vite configs and switch test targets to @nx/vitest:test
- Convert jest APIs to vi.* and jest module mocks to vi.mock with importOriginal
- Replace jest-axe with a browser-native axe-core helper and toHaveNoViolations
- Regenerate snapshots in vitest format (content unchanged, format-only)
- Remove all jest packages, configs, the preset and the @nx/jest target default
- Install Playwright Chromium in the CI unit job for the browser suites

Also fixes a brain avatar test that asserted inside a fire-and-forget setTimeout,
which passed vacuously under jsdom and only surfaced once a real browser loaded
the image.
2026-06-13 15:16:45 +01:00
Leonidas f29b10bb68 chore: nightly release 2026-06-13 ⚡ 2026-06-13 03:47:26 +00:00
Ashley Hunter f870b0b8e7 fix(cli): avoid @nx/workspace barrel import in migrate-helm-libraries (#1464)
* fix(cli): avoid @nx/workspace barrel import in migrate-helm-libraries

Import removeGenerator from its module directly instead of the @nx/workspace
barrel. The barrel eagerly evaluates convert-to-nx-project, whose output.js
crashes on nx 22 ("Cannot read properties of undefined (reading 'inverse')"),
so the generator threw before doing any work.

Add a regression test that runs the generator and asserts it does not throw.

* test(cli): tidy migrate-helm-libraries regression test

Assert the generator resolves to undefined instead of using the
resolves.not.toThrow matcher, which does not fit a Promise<void>, and
restore mocks after each test to keep the suite hermetic.

* test(sidebar): update generate-ui-docs snapshot for HlmSidebarTrigger

The HlmSidebarTrigger gained an `srOnlyText` input, but the generate-ui-docs
stable-output snapshot was never regenerated, so `tools:test` failed whenever
it ran uncached. Regenerate the snapshot to match the current component API.
2026-06-12 19:35:54 +02:00
Marc Stammerjohann 90773f3b3c fix(tooltip): spartan-tooltip-content to be replaced for styles 2026-06-12 09:56:08 +02:00
Leonidas 1d4b389e6e chore: nightly release 2026-06-12 ⚡ 2026-06-12 04:02:56 +00:00
Ashley Hunter 859676a41a feat!: drop Tailwind CSS v3 support (#1460)
spartan/ui is now Tailwind CSS v4 only. The v3 compatibility layer added
complexity across the brain preset, the CLI generators and the docs, all of
which is removed here.

Brain:
- Delete the v3 JavaScript preset (hlm-tailwind-preset.js) and its package
  export; the v4 CSS preset (hlm-tailwind-preset.css) is now the only preset.
- Bump the tailwindcss peer dependency to >=4.0.0 and declare tw-animate-css
  as a peer, since it is imported by the CSS preset.

CLI:
- Remove Tailwind version detection and the v3 confirmation prompt; the theme
  generator always emits the v4 stylesheet (preset import plus OKLCH theme).
- Drop the legacy HSL theme table, the v3-only CDK overlay import branch, the
  vestigial addCdkStyles option and the unused registryItemTailwindSchema.

Docs and tooling:
- Remove the Tailwind v3 installation and theming sections and snippets.
- Drop autoprefixer; Tailwind v4 handles vendor prefixing via @tailwindcss/postcss.

BREAKING CHANGE: Tailwind CSS v3 is no longer supported. The
@spartan-ng/brain/hlm-tailwind-preset (JS) package export has been removed; use
the @spartan-ng/brain/hlm-tailwind-preset.css preset with Tailwind CSS v4. The
tailwindcss peer dependency now requires >=4.0.0.
2026-06-12 00:39:14 +02:00
Ashley Hunter f52f1ea6c6 chore(cli): apply review feedback on the smoke harness
- Remove the acceptTailwindV3 flag from the theme and init generators. It was a leftover from
  when the matrix covered Tailwind v3; the suite is v4-only and v3 support is being dropped.
- Publish packages via execFileSync with an argument array so the registry and npmrc values
  are never interpreted by a shell.
- Drop the explanatory embla-carousel import comments from the carousel template and helm source.
2026-06-11 18:07:11 +01:00
Ashley Hunter 7cbb144cdf Merge remote-tracking branch 'origin/main' into feat/cli-smoke-harness
# Conflicts:
#	libs/cli/src/generators/ui/supported-ui-libraries.json
2026-06-11 18:06:49 +01:00
Leonidas a3607e71d7 chore: nightly release 2026-06-11 ⚡ 2026-06-11 04:03:48 +00:00
Ashley Hunter 9769b58fd5 chore(cli): address review feedback on the cli-smoke harness
- await the local-registry stop in global-teardown and the global-setup error
  path, so verdaccio is fully stopped before the process exits
- restore the dist package.json byte-for-byte after publishing, so a local
  `pnpm smoke` leaves the build artifacts untouched
- pass the nx affected args via execFileSync (no shell) so NX_BASE/NX_HEAD are
  never shell-interpreted
- note that setupTailwindCss is an internal-only theme option
2026-06-10 23:35:27 +01:00
Ashley Hunter a60bbfbd5a fix(scroll-area): declare ngx-scrollbar as a generator peer dependency
The generated scroll-area directive imports provideScrollbarOptions from
ngx-scrollbar, but the ui generator did not install it, so a fresh scroll-area
failed to compile (TS2307). Add it to the scroll-area peer dependencies.
2026-06-10 22:55:49 +01:00
Ashley Hunter 2b2e3b21a9 fix(carousel): import embla types from the base embla-carousel package
embla-carousel-angular v22 no longer re-exports EmblaOptionsType,
EmblaEventType and EmblaPluginType, so a fresh carousel failed to compile
(TS2459). Import them from the base embla-carousel package, which exports them
in both v21 and v22, and add it as a peer dependency.
2026-06-10 22:51:43 +01:00
Ashley Hunter a60be560a7 fix(cli): resolve the workspace root tsconfig in the nx generators
The generators assumed a tsconfig.base.json, so they failed on a standalone nx
workspace (single app, no base tsconfig) with "File not found:
tsconfig.base.json". Resolve the root tsconfig with getRootTsConfigPathInTree
instead, and stop tying the eslint-editing ts-morph Project to an on-disk
tsconfig that may not exist yet during generation.
2026-06-10 22:51:43 +01:00
Ashley Hunter 390c38dcb7 feat(cli): support non-interactive init and ui-theme generators
Passing --theme opts the init and ui-theme generators into non-interactive
mode: the project is auto-selected when there is a single app, the styles
entry point is auto-detected, and the Tailwind v3 warning is skipped. This
lets the CLI be scripted in CI. Prompts are unchanged when no theme is passed.
Adds unit tests for the non-interactive paths.
2026-06-10 22:51:43 +01:00
moosme e8fb6b0cfb Merge pull request #1441 from spartan-ng/wt/resizable-1412 2026-06-10 22:44:24 +02:00
Ashley Hunter 99b05147d1 fix(scroll-area): implement per-style support and match shadcn
Address review feedback on the PR. Wire the directive to ngx-scrollbar's
real CSS variables at shadcn's values (transparent 10px track, 7px
bg-border thumb) and default visibility to hover so the thumb only shows
on hover, scroll or focus like shadcn.

Move the container radius into the registry per style now that the demo
no longer hardcodes it: rounded-md for vega/nova/mira, square for lyra
via --radius 0, and rounded-2xl for maia/luma. Replace the dead
radix-era marker rules with a single spartan-scroll-area rule.

Declare ngx-scrollbar as a helm peer dependency since the directive now
imports from it, and mirror the changes in the CLI template.
2026-06-10 18:24:28 +01:00
Ashley Hunter 2abb581585 fix(resizable): align handle and focus styles with shadcn
Address review feedback on the style support. Set Lyra's --radius to 0
so the bordered container and handle render sharp like shadcn's Lyra
preset, and round the Lyra handle grip with the shared rounded-lg token
so the squaring comes from --radius rather than a special case.

Match shadcn's splitter focus ring by using ring-offset-background in
place of the fixed ring-offset-1 offset, in both the helm component and
the CLI template.
2026-06-10 18:09:51 +01:00
Ashley Hunter 66f4d9f454 feat(resizable): add style support and rtl example
Closes #1412
2026-06-10 18:09:51 +01:00
Ashley Hunter 63bf4fe4f1 fix(cli): emit CommonJS so generators load in compat mode
The nx 22 / angular 21 upgrade (#1430) switched the cli tsconfig to
`module: preserve` with `moduleResolution: bundler`. With `preserve`,
TypeScript keeps the ESM import/export syntax in the emitted .js files,
but the published package declares `"type": "commonjs"`. Node then loads
the generator files (e.g. compat.js) as CommonJS and throws
"Cannot use import statement outside a module", breaking every
`ng g @spartan-ng/cli:*` command from alpha.708 onwards.

Restore `module: commonjs` (with `moduleResolution: node`) so the build
output matches the package type again. The same harmless mismatch is
corrected in libs/tools for consistency; tools runs from source and is
never published, so it was not affected at runtime.

Closes #1451
2026-06-10 12:59:38 +01:00
moosme 69595c394e Merge pull request #1440 from spartan-ng/wt/radio-group-1411
feat(radio-group): add style support and rtl example
2026-06-10 09:16:35 +02:00
moosme 3dd146e20f Merge pull request #1443 from spartan-ng/wt/popover-1409
feat(popover): add style support and rtl example
2026-06-10 08:57:08 +02:00
moosme d5095a281d Merge pull request #1442 from spartan-ng/wt/carousel-1396
feat(carousel): add style support and rtl example
2026-06-10 08:56:31 +02:00
moosme 32d0ca6b65 Merge pull request #1439 from spartan-ng/wt/progress-1410
feat(progress): add style support and rtl example
2026-06-10 08:55:49 +02:00
moosme 088e9ce64a Merge pull request #1438 from spartan-ng/wt/checkbox-1397
feat(checkbox): add style support and rtl example
2026-06-10 08:51:10 +02:00
moosme 164ca5d620 Merge pull request #1444 from spartan-ng/wt/hover-card-1405
feat(hover-card): add style support and rtl example
2026-06-10 08:41:49 +02:00
moosme f449d7c3b4 Merge pull request #1445 from spartan-ng/wt/tooltip-1419
feat(tooltip): add style support and rtl example
2026-06-10 08:38:01 +02:00
Leonidas f25559dfca chore: nightly release 2026-06-10 ⚡ 2026-06-10 03:47:12 +00:00
Ashley Hunter 583c07c945 feat(tooltip): add style support and rtl example
Closes #1419
2026-06-09 21:39:43 +01:00
Ashley Hunter 6e63ba9d74 feat(hover-card): add style support and rtl example
Make the hover card overlay inherit the ambient direction so it renders RTL.

Closes #1405
2026-06-09 20:16:36 +01:00
Ashley Hunter bbf5dfadc7 feat(popover): add style support and rtl example
Make BrnDialog overlays inherit the trigger's ambient direction so popover renders RTL.

Closes #1409
2026-06-09 20:13:40 +01:00
Ashley Hunter 8f51fdc646 feat(radio-group): add style support and rtl example
Closes #1411
2026-06-09 20:13:07 +01:00
Ashley Hunter 944746433b feat(progress): add style support and rtl example
Closes #1410
2026-06-09 20:12:44 +01:00
Ashley Hunter 4a511734bd feat(carousel): add style support and rtl example
Closes #1396
2026-06-09 19:57:08 +01:00
Ashley Hunter c4ef0120fd feat(checkbox): add style support and rtl example
Closes #1397
2026-06-09 19:55:52 +01:00
Ashley Hunter 653e887581 Merge pull request #1433 from spartan-ng/feat/switch-style-rtl-1417
feat(switch): add style support and rtl example
2026-06-09 09:34:13 +01:00
Ashley Hunter 558c45505f Merge pull request #1434 from spartan-ng/feat/slider-style-rtl-1416 2026-06-09 09:24:14 +01:00