Frontend rules for the bundle's TypeScript search box (Vite library build to an IIFE, pnpm, Vitest)
php artisan boost:add-skill nowo-tech/search-kit-bundle
Save this content to: .cursor/rules/30-frontend-ts-vite-pentatrion.mdc
Work only on the requested entrypoint, module, component, or stylesheet.
Prefer:
- strict TypeScript typing
- small modules and focused edits
- preserving the current Vite entrypoint strategy: one library build, entry `src/Resources/assets/src/iife.ts`
(`index.ts` exports `mount` / `unmount` / `mountAll`, `stimulus.ts` the Stimulus wrapper, for hosts that bundle the sources themselves)
- editing existing initialization code instead of creating parallel bootstraps
- TypeScript sources live in `src/Resources/assets/src/`, Vitest specs in `src/Resources/assets/tests/`
- the build output is the single IIFE `src/Resources/public/js/nowo-search.js` (`vite.config.ts` `outDir`
`src/Resources/public/js`), produced by `make assets` (`pnpm run build` = `vite build` in the container); the
stylesheets `src/Resources/public/css/nowo-search.css` and `nowo-search-popover.css` are hand-written source, not build output
- the markup comes from `src/Resources/views/search.html.twig`; keep its `data-part` hooks and
`template[data-nowo-search-icon]` in sync with `global-search.ts`
- running `make test-ts` (Vitest with coverage) after a change
- preserving integration points used by Twig or Symfony rendering
- JSDoc in English for exported APIs, non-obvious functions, and complex behavior
Do not inspect the minified `src/Resources/public/js/nowo-search.js` or other generated assets.
The bundle does not use Pentatrion Vite Bundle (only the demo app does, for its own `assets/app.ts`); do not add `vite_entry_*` tags to bundle templates.
Do not add JSDoc in Spanish.
Do not edit generated build output.
Do not rewrite the whole frontend architecture unless explicitly requested.
Work only on the requested entrypoint, module, component, or stylesheet.
Prefer:
src/Resources/assets/src/iife.ts
(index.ts exports mount / unmount / mountAll, stimulus.ts the Stimulus wrapper, for hosts that bundle the sources themselves)src/Resources/assets/src/, Vitest specs in src/Resources/assets/tests/src/Resources/public/js/nowo-search.js (vite.config.ts outDir
src/Resources/public/js), produced by make assets (pnpm run build = vite build in the container); the
stylesheets src/Resources/public/css/nowo-search.css and nowo-search-popover.css are hand-written source, not build outputsrc/Resources/views/search.html.twig; keep its data-part hooks and
template[data-nowo-search-icon] in sync with global-search.tsmake test-ts (Vitest with coverage) after a changeDo not inspect the minified src/Resources/public/js/nowo-search.js or other generated assets.
The bundle does not use Pentatrion Vite Bundle (only the demo app does, for its own assets/app.ts); do not add vite_entry_* tags to bundle templates.
Do not add JSDoc in Spanish.
Do not edit generated build output.
Do not rewrite the whole frontend architecture unless explicitly requested.
How can I help you explore Laravel packages today?