Commit Graph

163 Commits

Author SHA1 Message Date
Ashley Hunter 00ecbca7d2 build(repo): fix update-ui-docs-snapshot script for vitest
Replace the jest-era invocation (npm test ... --updateSnapshot --skip-cache) with the vitest/nx
equivalent so the snapshot can actually be regenerated.
2026-06-15 00:05:00 +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
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 334dd18ebe test(cli): add the cli-smoke setup-matrix harness
Scaffolds real nx (monorepo + standalone) and angular-cli workspaces from the
locally published CLI, runs the generators, runs healthcheck, consumes a
generated component, and builds - covering library/entrypoint x
buildable/non-buildable plus an all-components cell. Runs each cell on its own
runner via a dedicated workflow with a required result check, and stays cheap on
unrelated PRs via a git-diff gate and an in-runner affected check. Adds a
`pnpm smoke` convenience script.
2026-06-10 22:55:47 +01:00
Ashley Hunter 21a173f121 build(repo): add embla-carousel and verdaccio dev dependencies
embla-carousel is needed so the carousel component can import its option/event/plugin types from the
base package; verdaccio backs the cli-smoke local registry.
2026-06-10 22:51:43 +01:00
Robin Goetz fc8c037add feat(mcp): release and version mcp server alongside cli and brain (#1448)
* feat(mcp): release and version mcp server alongside cli and brain

Wire the MCP server package into the release pipeline so it is published
and version-synced with the cli and brain packages. Add a
replace-mcp-version generator (invoked by auto-increment-version for
nightly and prepare-manual-release for manual), a release-mcp script,
and sync the package to the current alpha version.

Also drop the orphan scope:core tag from release-ui and list mcp in the
PR template's affected-packages section.

* refactor: document release schemas and harden version error handling

Fill in the empty titles and descriptions on the release generator and
executor schemas, and declare the newVersion option so the version
generators are self-documenting and CLI-invocable.

Make the version generators throw with actionable messages instead of
silently logging and returning, validate the brain version format in
auto-increment-version, and fix the misleading source-of-truth message
in replace-ui-version.

* fix: prevent shell injection in npm publish and correct version flag hints

Validate the TAG dist-tag and publish via execFileSync with an argument
array instead of interpolating it into a shell string, removing a
shell-injection vector in the npm-publish executor.

Correct the version generators' error messages to reference the actual
--newVersion / --new-version flag rather than the reserved --version.
2026-06-10 09:58:55 +02:00
Ashley Hunter d4da582d40 feat(repo)!: upgrade nx to 22 and angular to 21 (#1430)
* feat(repo)!: upgrade nx to 22 and angular to 21

Upgrade the workspace to Nx 22.7.5 and Angular 21.2.16, and widen the
published peer dependency ranges to support Angular 21 and 22 while
dropping Angular 20.

- nx and @nx/* to 22.7.5; @angular/* to 21.2.16 (framework) and 21.2.14
  (cli, build, devkit, cdk, ssr)
- brain, helm and trpc @angular/* peers to ">=21.0.0 <23.0.0"; the helm
  embla-carousel-angular peer uses the same range
- @spartan-ng/cli minimums raised to >=21 and @schematics/angular to
  21.2.14; the private tools lib aligned to nx 22 / angular 21
- analog 2.6.0, ng-packagr 21, angular-eslint 21, storybook 10, jest 30,
  @testing-library/angular 19 and related tooling
- replace the calendar select host-listener $event with a typed output
  subscription; constrain the ai-chat-link directive to anchors
- drive the menubar e2e arrow keys via native keydown and disable
  Chromium throttling; hold cypress at 14 (15 breaks realPress specs)

BREAKING CHANGE: Angular 20 is no longer supported. spartan/ui now
supports Angular 21 and 22.

* ci: lower unit test parallelism to fit the runner memory

The docs app's vitest + Analog suite peaks at a few GB; running it
alongside two other test projects under --parallel=3 exhausted the
GitHub runner memory and the worker was OOM-killed with no output.
Run at most two test projects concurrently.

* fix(trpc): drop invalid environment providers from the test env module

The Nx 22 migration wrapped provideZoneChangeDetection() in an @NgModule,
but EnvironmentProviders are not valid in @NgModule providers and Angular
21 throws NG0207 at runtime. Restore the plain initTestEnvironment setup
(matching the docs app); the explicit zone provider is unnecessary.

* ci: run the docs app test suite in isolation

Bundling the docs app's vitest + Analog suite into the parallel test run
made it fail in CI while it passes on its own, and the interleaved output
hid the cause. Run the other projects in parallel, then the docs app as a
separate step.

* fix(nx): point test cache inputs at the real jest preset file

The test targets' cache inputs referenced jest.preset.js, but the
workspace preset is jest.preset.cjs, so the input never matched and a
preset change would not invalidate the cache. Fix both the
@nx/vitest:test target (added by the Nx 22 migration) and the existing
@nx/jest:jest target.

* ci: log exit code and retry the docs app test suite once

The docs app's vitest + Analog suite intermittently crashes in CI right
after loading Angular's testing modules, with no error output. Log the
exit code to classify the crash (128+signal indicates a native crash)
and retry once so a flaky crash does not fail the run while the root
cause is investigated.

* ci: clarify docs app test retry after pinpointing the flaky crash

The crash is in app.spec.ts: booting the full app shell (Header/Footer
and their deep import graph) intermittently crashes the vitest worker
during the Analog transform in CI (exit 1, no output, not reproducible
locally). It happens before any test runs, so a vitest per-test retry
cannot help; re-running the suite once does.

* chore(repo): hold analog at 2.1.3 and drop unit-test ci workarounds

Analog 2.6.0 intermittently crashed the docs app's vitest worker in CI
(a flaky transform of the app shell), so keep analog at the nx-migration's
tested 2.1.3, revert the marked bumps that 2.6.0 required, and restore the
ai-chat-link directive selector. Also restore the original unit test ci
step, dropping the parallel, isolation and retry workarounds added while
chasing that crash.
2026-06-08 22:23:45 +02:00
Ashley Hunter f2978e148d Merge pull request #1362 from SOG-web/mcp
feat(ui-mcp): migrate external ui-mcp project as a monorepo library
2026-06-04 09:20:05 +01:00
Ashley Hunter c8d97abb42 fix(mcp): make the library publishable and harden the server
Make @spartan-ng/mcp publishable and runnable as an MCP server:
- align package metadata, bin, and publishConfig, and add a release target
- bump zod to ^3.25 so it satisfies the MCP SDK peer range, without which
  the server fails to start
- route cache and warmup logging to stderr so it never corrupts the stdio
  JSON-RPC channel
- validate cache keys to prevent path traversal and default the cache to a
  writable user directory
- fix component example rendering, meta tool ids, language detection, and
  peer-dependency analysis
- add unit tests and a documentation page for the MCP server
2026-06-03 21:02:33 +01:00
Ashley Hunter ef2342aae2 feat: add "Open in StackBlitz" to component examples (#1381)
Adds a button on each runnable docs example that boots a real, runnable
Angular CLI project on StackBlitz, with helm source vendored from the existing
generated pipeline so it stays in sync.

- generate-hlm-component-preview captures the exact CLI output (libs/ui, deps,
  tsconfig paths) and version/preset metadata; all @angular packages pinned to a
  single consistent major; example-only deps (tanstack, luxon, ngx-scrollbar,
  embla autoplay, extra ng-icon sets) added explicitly
- generate-primitive-snippets bundles sibling files of multi-file examples
  (e.g. data-table) and rewrites back-references to the entry
- client-side builder assembles the project, drops mismatched Angular ranges,
  rewrites /assets URLs to the live docs origin, and bundles siblings
- docs-internal examples (RTL) are excluded as not self-contained
- fix data-table flexRenderComponent calls that only failed under strict AOT
2026-06-03 12:03:09 +02:00
SOG-web 55c3eb3125 feat(mcp): migrate external ui-mcp project as a monorepo library 2026-05-20 09:10:52 +01:00
goetzrobin f996ed7468 fix: revert nitropack and useStorage and use $fetch instead
useStorage was the wrong tool.
they are available in our public assets.
they are not bundled in our js files.
we load our json files during ssr with a fetch call.
this avoids bundler running out of ram.
this still lets us use their data during pre-rendering / ssr
2026-04-04 23:56:35 +02:00
dependabot[bot] 758c003e96 chore(deps): bump @angular/core from 20.3.17 to 20.3.18 (#1270)
Bumps [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) from 20.3.17 to 20.3.18.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/v20.3.18/packages/core)

---
updated-dependencies:
- dependency-name: "@angular/core"
  dependency-version: 20.3.18
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-04 13:57:28 +02:00
goetzrobin 0584cdb717 fix: make nitropack explicit dependency for ci types 2026-04-04 13:27:11 +02:00
goetzrobin d9c9ba8f4a fix: removes lucide import and bundling of json files, fixes critical vuls 2026-04-04 13:03:58 +02:00
Robin Goetz 5358482ea2 chore: improve head size (#1305) 2026-04-04 09:36:06 +02:00
Merlin 2dd0f88b00 fix: build 2026-03-17 16:03:12 +01:00
Merlin Moos d09a0682b3 feat: add hlm to manual install tool 2026-03-16 23:02:14 +01:00
Merlin 719201154c Merge remote-tracking branch 'origin/main' into polish-button
# Conflicts:
#	apps/app/src/app/pages/(components)/components/(button)/button--icon.example.ts
#	apps/app/src/app/pages/(components)/components/(button)/button--rounded.example.ts
#	apps/app/src/app/pages/(components)/components/(button)/button--size.example.ts
#	apps/app/src/app/pages/(components)/components/(button)/button--spinner.example.ts
#	apps/app/src/app/pages/(components)/components/(button)/button--with-icon.example.ts
#	apps/app/src/app/pages/(components)/components/(button)/button.page.ts
#	apps/app/src/app/pages/(components)/components/(button)/button.preview.ts
#	libs/cli/src/generators/ui/supported-ui-libraries.json
#	package.json
#	pnpm-lock.yaml
2026-03-12 17:50:57 +01:00
Marc Stammerjohann 20caa638ee feat: integrate sonner as brain entry (#1252)
* feat(sonner): add brain sonner entry

* feat(sonner): remove ngx-sonner and use @spartan-ng/brain/sonner

* docs(sonner): add brain api section

* fix(sonner): vanishing of custom icons

* feat(sonner): add toaster spec and update snapshot

* fix(sonner): filter toasts/heights by position in toast to expand toasts grouped by position

* feat(sonner): add sonner toaster config

* feat(sonner): use Directionality for dir, use afterNextRender and DOCUMENT for window access

* remove dir prop

* feat(sonner): update modifiers and type imports

* feat(sonner): update snapshot

* feat(sonner): add sonner healthcheck and migration to migrate ngx-sonner

* fix(sonner): update healthcheck guard

* feat(sonner): copy to helm

* fix(sonner): update comment

* fix(sonner): replace comment

* fix(sonner): update migration test message

* feat(sonner): replace all in migration

* feat(sonner): use injected document, update comments

* feat(sonner): use clsx

* feat(sonner): use computed for classes

* docs(sonner): update about
2026-03-12 11:02:37 +01:00
Marc Stammerjohann 2715096e16 chore: bump pnpm (#1245)
* chore: bump pnpm

* chore: update ci action versions, setup pnpm w/ pnpm/action-setup and cache pnpm

* chore: remove pnpm setup for commitlint, install deps for e2e job

* chore: update checkout version for check_date job
2026-03-04 12:55:36 +01:00
Marc Stammerjohann dc9c2d77eb chore: update nx and angular 20.3 (#1232)
* chore: update nx and angular 20.3

# Conflicts:
#	pnpm-lock.yaml

* chore: fix lint issues

* chore: update tailwind and prettier
2026-03-04 10:03:14 +01:00
Marc Stammerjohann bb56e6a062 docs: update sonner examples (#1241)
* docs(sonner): add types example

* docs(sonner): add position and description example

* chore: update ngx-sonner

* docs(sonner): add note to add to root component

* feat(sonner): update signal boolean and number inputs

* docs(sonner): fix review suggestions
2026-03-04 09:33:49 +01:00
Marc Stammerjohann 4d6d4a150b docs: add reactive forms guide (#1223)
* docs: remove form soon component

* docs: rename components page selector and page

* chore: remove unused ng-signal-forms

* docs: add reactive forms page and demo

* docs: add exact to link, mark forms as new

* docs: use signal input and resource for code block

* docs: add form and reset section

* docs: add validation and displaying error section

* feat(select): add select separator

* docs: add different input field types demos

* docs: revert code block signals

* docs: center form text

* docs: replace wip badge w/ text, as the badge is not aligned correctly to the text
2026-02-25 16:50:52 +01:00
Merlin Moos dfc9dd45ea feat: add registry 2026-02-22 19:32:08 +01:00
Merlin Moos 3d153f6f56 feat: add rtl support 2026-02-19 22:23:25 +01:00
Ashley Hunter fca8a37a29 feat: update contributors generator 2026-01-03 21:41:47 +00:00
Marc Stammerjohann 598e6352ff feat(carousel): update embla-carousel-angular (#1075) 2025-12-11 10:37:31 +01:00
moosme 51a579aa36 feat(repo): nx upgrade (#1002)
* feat(repo): nx upgrade

* fix: sidebar

* fix: node version

* fix: relax dependency versions

* fix: remove naming conventions

* fix: format

* fix: remove chromatic

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-11-20 10:14:26 +01:00
moosme 10f0c46596 fix: dark mode for sidebar (#1016)
Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-11-12 21:37:00 +01:00
Brandon Roberts 1427c24fe9 build: update to Analog 2.0.x (#996) 2025-11-09 14:54:01 +01:00
robingotz 222b9bd81d fix: downgrade ng-icon & resolve version conflicts 2025-11-05 22:33:58 +01:00
moosme 7cb83e6590 fix(cli): angular cli fix #921 (#983)
* fix(cli): angular cli fix #921

* fix(cli): code recommendations

* fix(cli): code recommendations

* fix(cli): broken lockfile

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-11-03 17:36:22 +01:00
Merlin 3e2f258286 feat(item): add --all for format 2025-10-23 08:41:10 +02:00
moosme 0404376bbe feat: tailwind update and renew website style (#939)
* feat: polish the website and tailwind 4

* feat: fix context menu

* feat: add components page

* feat: add components page

* feat: add new label #924 and restyle

* feat: polish website and remove docsearch

* feat: add custom docsearch

* feat: storybook setup tailwind 4 (wip)

* feat: change css layer order

* feat: change title restructure code

* feat: finalize docs

* feat: storybook fix

* feat: fix missing links

* feat: fix tests

* feat: fix styling and wip links

* feat: fix spacing

* feat: add github stars

* feat: fix tests

* feat: align style

* fix: resolve comments

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-10-22 08:40:51 +02:00
Merlin ca4081d166 feat(input-group): finalize docs 2025-10-16 14:26:00 +02:00
Marc Stammerjohann 68f657d495 chore: disable cache for docs snapshot (#932) 2025-10-14 11:16:29 +02:00
Robin Goetz a1e30438f9 fix(accordion): correct trigger semantics and guard keyboard events i… (#838) 2025-09-18 23:23:31 +02:00
Marc Stammerjohann 97f96c31e7 docs: add docsearch to header (#794)
* docs: add docsearch to header

# Conflicts:
#	pnpm-lock.yaml

* docs: update hit active color in dark theme

* docs(command): trigger command dialog on ⌘ + Shift + P to avoid conflict with docsearch
2025-08-19 18:23:20 +02:00
Sammy Mohamed 5cb3c1943a chore: bump analogjs + peer deps (#799)
* chore: bump analogjs + peer deps

* fix: adding requestContextInterceptor

* feat: adds staticdata prerender option to component pages

- adds prerender function to dynamically include all component pages in spartan app
- adds tinyglobby dep
2025-08-12 13:38:50 +02:00
Sammy Mohamed 970a0da8d9 docs: autodocs improvements (#716)
- future proof glob pattern for style guide changes
- identify required inputs
- moved models to input/output
- simplified ui docs test with snapshot
- ensure snapshot test considers only critical properties of api metadata
2025-08-12 13:37:43 +02:00
Ashley Hunter e66a64d76b feat: new york theme (#711)
* feat: new york theme

* refactor: toggle group

* fix: colors

* fix: tests

* docs: updating previews

* fix: updating previews

* build: resolve build failure

* fix: review fixes

* fix: build

* build: adding generated files
2025-07-09 18:40:19 +02:00
Benjamin Heiss cde65b91f9 Feat/add extract primitive generator (#736)
* docs: autogenerate defaultcode

* docs: generate snippets

* docs: improve generator and fix accordion

* docs: improve generator and fix alert

* docs: improve generator and fix alert dialog

* docs: improve generator and fix aspect ratio

* docs: fix avatar and badge

* docs: fix breadcrumb and button

* docs: fix calendar card and carousel

* docs: fix checkbox, collapsible, command, combobox, dropdown menu

* docs: fix data-table, date-picker, dialog

* docs: fix command and formfield

* docs: fix hovercard, icon, input

* docs: fix inputotp, label, menubar and pagination

* docs: fix popover, progress, radio-group, scroll-area, select

* docs: fix separator, sheet, skeleton, sonner, spinner, switch, table, tabs

* docs: fix tabs,textarea,toggle,tooltip

* docs: run generator on serve

* docs: remove options from generator

* docs: fix tests for generators

* docs: run formatter

* docs: refactor generator and add tests
2025-06-30 22:36:38 +02:00
Benjamin Heiss 96564ebf00 Feat: Table Directives replacing hlmTable to be used with Tanstack Table (#712)
* feat(table): replace brain table with tanstack table

* docs(table): improve tasks example

* docs(table): rename selectors of tasks example components

* docs(table): improve data-table after review

* docs(table): defer loading of tanstack table

* docs(table): fix typo and add tanstack installation information
2025-06-20 19:37:47 +02:00
Ashley Hunter 0eeeb17b1a refactor: helm secondary entrypoints 2025-05-29 20:59:16 +01:00
Marc Stammerjohann b90984b2f6 refactor: enforce eslint prefer onpush change detection (#688) 2025-05-14 02:41:54 +02:00
Ashley Hunter d28ae9230e build: improve e2e logs (#690) 2025-05-14 02:41:33 +02:00
Sammy Mohamed d826874baa feat: ui primitive api autodocs (#464)
* feat: ui api autodocs executor

- adds api page sections
- page navigation links
2025-05-12 21:34:15 -04:00
Ashley Hunter 9b654631cc build: nx version updates (#672) 2025-04-27 12:54:23 +02:00
Tobias Landenberger 7022bdab9f docs: extend carousel documentation (#627)
* feat(carousel): add carousel component stories

* docs: add carousel component examples to documentation

* chore: add carousel option to pull request template

* chore: fix broken lockfile
2025-03-20 13:52:42 +01:00