@forinda/kickjs-cli 8.14.8 → 8.16.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.
- package/dist/agent-docs-DhiaLsBj.mjs +591 -0
- package/dist/agent-docs-DhiaLsBj.mjs.map +1 -0
- package/dist/agent-docs-lNvu1K1x.mjs +590 -0
- package/dist/{build-cXg5ZlrG.mjs → build-BNHMWtNY.mjs} +2 -2
- package/dist/{build-Ch7Mu-zN.mjs → build-vY0bmwuH.mjs} +3 -3
- package/dist/{build-Ch7Mu-zN.mjs.map → build-vY0bmwuH.mjs.map} +1 -1
- package/dist/{builtins-Cj-H0MpD.mjs → builtins-CRRb7Lq1.mjs} +2 -2
- package/dist/{builtins-1iFKUPC8.mjs → builtins-tE4nrAZ_.mjs} +59 -59
- package/dist/cli.mjs +2 -2
- package/dist/{config-DJ3Yuos3.mjs → config-mXO3F69m.mjs} +2 -2
- package/dist/{config-LzGMuzP3.mjs → config-zWl1-NCq.mjs} +3 -3
- package/dist/{config-LzGMuzP3.mjs.map → config-zWl1-NCq.mjs.map} +1 -1
- package/dist/{doctor-hrYL914U.mjs → doctor-z92r35fo.mjs} +9 -9
- package/dist/{doctor-hrYL914U.mjs.map → doctor-z92r35fo.mjs.map} +1 -1
- package/dist/{fullstack-BDk2Min0.mjs → fullstack-BqevN8LJ.mjs} +13 -13
- package/dist/{fullstack-BDk2Min0.mjs.map → fullstack-BqevN8LJ.mjs.map} +1 -1
- package/dist/{fullstack-DOx3kvFi.mjs → fullstack-eMi-9BtZ.mjs} +9 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{plugin-h1RvCxk1.mjs → plugin-BbbHEAzr.mjs} +2 -2
- package/dist/{plugin-DmerIwIH.mjs → plugin-CH4X4T0O.mjs} +2 -2
- package/dist/project-Bp6SIRyt.mjs +132 -0
- package/dist/project-D96UoR0P.mjs +133 -0
- package/dist/project-D96UoR0P.mjs.map +1 -0
- package/dist/{project-root-DBTLa3ee.mjs → project-root-Bw3CEPC7.mjs} +3 -3
- package/dist/{project-root-DBTLa3ee.mjs.map → project-root-Bw3CEPC7.mjs.map} +1 -1
- package/dist/{project-root-DQwgpeEX.mjs → project-root-DN0YbQE5.mjs} +2 -2
- package/dist/{rolldown-runtime-UeWuLvbj.mjs → rolldown-runtime-CYy3EyO3.mjs} +1 -1
- package/dist/{run-plugins-CajtgfCU.mjs → run-plugins-f7i7TlPV.mjs} +67 -67
- package/dist/run-plugins-f7i7TlPV.mjs.map +1 -0
- package/dist/{typegen-BsYWuduu.mjs → typegen-Bq4Fis9G.mjs} +5 -5
- package/dist/{typegen-BsYWuduu.mjs.map → typegen-Bq4Fis9G.mjs.map} +1 -1
- package/dist/{typegen-DmSQleE5.mjs → typegen-_x_Q5O0b.mjs} +4 -4
- package/dist/{types-CX1RqHCf.mjs → types-BLZecxnS.mjs} +1 -1
- package/package.json +3 -3
- package/templates/base/files/_dot_vscode/extensions.json +3 -0
- package/templates/base/files/kick.config.ts +4 -0
- package/templates/base/skills/add-adapter.txt +56 -0
- package/templates/base/skills/add-module.txt +53 -0
- package/templates/base/skills/add-plugin.txt +69 -0
- package/templates/base/skills/bootstrap-export.txt +21 -0
- package/templates/base/skills/cli-commands-cheatsheet.txt +46 -0
- package/templates/base/skills/cli-plugin.txt +61 -0
- package/templates/base/skills/context-contributor.txt +73 -0
- package/templates/base/skills/deny-list.txt +44 -0
- package/templates/base/skills/deploy.txt +99 -0
- package/templates/base/skills/docs-lookup.txt +40 -0
- package/templates/base/skills/env-wiring-check.txt +44 -0
- package/templates/base/skills/guard-vs-middleware-vs-contributor.txt +95 -0
- package/templates/base/skills/query-parsing-list-endpoint.txt +48 -0
- package/templates/base/skills/refresh-agent-docs.txt +27 -0
- package/templates/base/skills/route-flags.txt +73 -0
- package/templates/base/skills/thin-entry-file.txt +49 -0
- package/templates/base/skills/use-asset-manager.txt +61 -0
- package/templates/base/skills/write-controller-test.txt +63 -0
- package/templates/feature-views/feature.json +21 -0
- package/templates/feature-views/files/src/adapters/views.ts +5 -0
- package/templates/feature-views/files/src/views/home.kick +3 -0
- package/templates/feature-views/files/src/views/layouts/main.kick +13 -0
- package/templates/feature-views/files/src/views.ts +9 -0
- package/templates/feature-views/skills/views-forms.txt +68 -0
- package/templates/feature-views/skills/views.txt +49 -0
- package/templates/fullstack-root/files/_dot_vscode/extensions.json +3 -0
- package/dist/agent-docs-BLpdFCWy.mjs +0 -932
- package/dist/agent-docs-c9x_je96.mjs +0 -933
- package/dist/agent-docs-c9x_je96.mjs.map +0 -1
- package/dist/package-manager-DMNCUv5Z.mjs +0 -12
- package/dist/package-manager-DMNCUv5Z.mjs.map +0 -1
- package/dist/package-manager-W-gJGan_.mjs +0 -11
- package/dist/project-BhLkKHOD.mjs +0 -135
- package/dist/project-CXcAR-tR.mjs +0 -136
- package/dist/project-CXcAR-tR.mjs.map +0 -1
- package/dist/run-plugins-CajtgfCU.mjs.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kickjs-use-asset-manager
|
|
3
|
+
description: Use when code reads template files / JSON fixtures via fs.readFile + path arithmetic — switch to assets.<ns>.<key>() and the kick.config.ts assetMap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Configure** `kick.config.ts`:
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
assetMap: {
|
|
11
|
+
mails: { src: 'src/templates/mails' },
|
|
12
|
+
reports: { src: 'src/templates/reports', glob: '**/*.{ejs,html}' },
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Consume** via the typed Proxy — no `__dirname` arithmetic, dev/prod paths handled:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { assets } from '@forinda/kickjs'
|
|
21
|
+
|
|
22
|
+
const html = await assets.mails.welcome() // typed: tsc errors on bad key
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Class-field decorator** (lazy getter, swappable in tests):
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
class WelcomeMailService {
|
|
29
|
+
@Asset('mails/welcome') private welcomeTemplate!: () => Promise<string>
|
|
30
|
+
|
|
31
|
+
async send(to: string) {
|
|
32
|
+
const body = await this.welcomeTemplate()
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Dynamic dispatch** (CMS templates, codegen) — `resolveAsset(ns, key)` throws `UnknownAssetError` with `{ namespace, key }` fields when the key is missing.
|
|
38
|
+
|
|
39
|
+
**Test fixtures** — swap via env override + cache clear:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
beforeEach(() => {
|
|
43
|
+
process.env.KICK_ASSETS_ROOT = path.resolve('__fixtures__/assets')
|
|
44
|
+
clearAssetCache()
|
|
45
|
+
})
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
delete process.env.KICK_ASSETS_ROOT
|
|
48
|
+
clearAssetCache()
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Red flags**:
|
|
53
|
+
- Hand-rolled `process.env.NODE_ENV === 'production' ? join(__dirname, '../templates') : join(__dirname, 'templates')` — exactly what the asset manager replaces.
|
|
54
|
+
- `keys: 'strip'` setting in `assetMap.<ns>` when basenames may collide — silent last-walk-wins data loss. Default `'auto'` keeps extensions only for colliding groups.
|
|
55
|
+
- Non-default Vite `outDir` without mirroring in `kick.config.ts` — manifest writes at `dist/.kickjs-assets.json` but the resolver can't find it. Mirror via `build.outDir`.
|
|
56
|
+
- Forgetting to re-run `kick typegen` after adding files — `assets.mails.newTemplate` is a tsc error even though the file ships. `kick dev` does this on-change; one-shot CI builds need `kick build` (or `kick build:assets` for manifest-only).
|
|
57
|
+
- Same-name `welcome.ejs` + `welcome/login.ejs` — directory wins in the typed surface; the `.ejs` file still copies but isn't addressable.
|
|
58
|
+
|
|
59
|
+
**Nuances**:
|
|
60
|
+
- Resolution pipeline (cached): `KICK_ASSETS_ROOT` env override > built manifest at `build.outDir` / `dist` / `build` / `out` > dev-fallback in-memory walk. Manifest presence = "running from built dist."
|
|
61
|
+
- Dev-mode glob matcher is a lite implementation — `**/*`, `**/*.ext`, `**/*.{a,b}` are guaranteed; exotic globs warn-once and accept everything. Run `kick build:assets` to exercise the real glob engine.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kickjs-write-controller-test
|
|
3
|
+
description: Use when adding a Vitest test that exercises an HTTP route or DI graph.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Template** (copy/paste, adjust):
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { describe, it, expect, beforeEach } from 'vitest'
|
|
10
|
+
import request from 'supertest'
|
|
11
|
+
import { Container } from '@forinda/kickjs'
|
|
12
|
+
import { createTestApp } from '@forinda/kickjs-testing'
|
|
13
|
+
// Side-effect import — registers the env schema, exactly as src/index.ts does.
|
|
14
|
+
// `createTestApp` never loads the entry file, so without this
|
|
15
|
+
// `ConfigService.get('YOUR_KEY')` is undefined under test while `@Value()`
|
|
16
|
+
// still appears to work via its process.env fallback — the two disagree only
|
|
17
|
+
// in tests.
|
|
18
|
+
import '@/config'
|
|
19
|
+
|
|
20
|
+
describe('UserController', () => {
|
|
21
|
+
beforeEach(() => Container.reset()) // isolate DI between tests
|
|
22
|
+
|
|
23
|
+
it('returns users', async () => {
|
|
24
|
+
// `createTestApp` takes an OPTIONS OBJECT and returns
|
|
25
|
+
// `{ app, container }`. Passing a bare array throws
|
|
26
|
+
// "this.options.modules is not iterable"; the result has no `.get()`.
|
|
27
|
+
//
|
|
28
|
+
// Drive `app.handle` rather than `expressApp`: it is the Application's
|
|
29
|
+
// own Node listener, so the test runs on whichever runtime the app is
|
|
30
|
+
// configured with. Pass `runtime` to `createTestApp` to match production.
|
|
31
|
+
const { app } = await createTestApp({
|
|
32
|
+
// Matches this project's `modules.style`.
|
|
33
|
+
modules: [{{moduleEntry}}],
|
|
34
|
+
})
|
|
35
|
+
const res = await request(app.handle.bind(app)).get('/api/v1/users')
|
|
36
|
+
expect(res.status).toBe(200)
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Typed handler signature** — pair with `kick typegen` so `ctx.body` / `params` / `query` are typed by the route's Zod schema:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
@Post('/', { body: createTodoSchema })
|
|
45
|
+
async create(ctx: Ctx<KickRoutes.TodoController['create']>) {
|
|
46
|
+
// ctx.body is typed from createTodoSchema; ctx.params from the route.
|
|
47
|
+
// Returning (vs ctx.created) lets typegen infer the response type.
|
|
48
|
+
return reply(201, await this.service.create(ctx.body))
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Red flags**:
|
|
53
|
+
- `new Container()` — wrong; use `Container.reset()` in `beforeEach` or `Container.create()` for fully isolated graphs.
|
|
54
|
+
- `Container.getInstance().reset()` — wrong; same fix.
|
|
55
|
+
- Sharing a container instance across `it()` blocks — leaks registrations between tests.
|
|
56
|
+
- Injecting a `Scope.REQUEST` service into a `SINGLETON` — container throws at resolve. Singletons must resolve request-scoped services explicitly per call.
|
|
57
|
+
- Calling `getRequestValue<string>('traceId')` — the generic slot is the **key** type, not the value type; widens key and bypasses typed lookup.
|
|
58
|
+
- Asserting on `res.body.requestId` when `requestId()` middleware isn't mounted in the test app — value will be `undefined`.
|
|
59
|
+
- Using `Scope.REQUEST` services in a test without mounting `requestScopeMiddleware()` — `getRequestValue` silently returns `undefined`; `getRequestStore` throws.
|
|
60
|
+
|
|
61
|
+
**Nuances**:
|
|
62
|
+
- `@Inject` and `@Autowired` are interchangeable — same runtime, same types; pick by readability.
|
|
63
|
+
- `@Value('MISSING_KEY')` with no default **throws on property access**, not at construction — tests that exercise the getter will surface the missing-env issue.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": ["@forinda/kickjs-view"],
|
|
3
|
+
"integrations": [
|
|
4
|
+
{
|
|
5
|
+
"import": {
|
|
6
|
+
"from": "./adapters/views",
|
|
7
|
+
"names": ["viewsAdapter"]
|
|
8
|
+
},
|
|
9
|
+
"slot": "adapter",
|
|
10
|
+
"code": "// .kick templates in src/views: ctx.render('home').\nviewsAdapter()"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"import": {
|
|
14
|
+
"from": "@forinda/kickjs-view/cli",
|
|
15
|
+
"names": ["viewCliPlugin"]
|
|
16
|
+
},
|
|
17
|
+
"slot": "config-plugin",
|
|
18
|
+
"code": "// kick check:views and kick fmt:views\nviewCliPlugin"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="@forinda/kickjs-view/virtual" />
|
|
2
|
+
import kickViews from 'virtual:kick-views'
|
|
3
|
+
import { createViews } from '@forinda/kickjs-view'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The app's `.kick` templates (src/views). `kick build` checks them and ships
|
|
7
|
+
* them in the build; `kick dev` reads them on each request.
|
|
8
|
+
*/
|
|
9
|
+
export const views = createViews({ ...kickViews, layout: 'layouts/main' })
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kickjs-views-forms
|
|
3
|
+
description: Use when building an HTML form with .kick views — validation errors back on the form, refilled values, flash messages, browser-side checks (validate="…"), CSRF for form posts — or when a form post arrives with an empty body.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Wiring** (once):
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import express from 'express'
|
|
10
|
+
import { bootstrap, csrf, formErrorHandler, getEnv, session } from '@forinda/kickjs'
|
|
11
|
+
import { KickView } from '@forinda/kickjs-view'
|
|
12
|
+
import { views } from './views'
|
|
13
|
+
|
|
14
|
+
export const app = await bootstrap({
|
|
15
|
+
modules,
|
|
16
|
+
middlewares: [
|
|
17
|
+
// Express only: listing middlewares replaces the default body parsers —
|
|
18
|
+
// forms post urlencoded, and keep JSON for any JSON routes.
|
|
19
|
+
express.urlencoded({ extended: false }),
|
|
20
|
+
express.json(),
|
|
21
|
+
session({ secret: getEnv('SESSION_SECRET'), store: 'cookie' }),
|
|
22
|
+
csrf(),
|
|
23
|
+
],
|
|
24
|
+
adapters: [KickView({ views })],
|
|
25
|
+
onError: formErrorHandler(),
|
|
26
|
+
})
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Without `express.urlencoded` on Express, `ctx.body` is empty for form posts; without `express.json()`, for JSON. When the app already lists `middlewares`, add these to its list rather than replacing it. Fastify and h3 parse bodies themselves.
|
|
30
|
+
|
|
31
|
+
**The round trip**
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
@Post('/tasks', { body: taskSchema })
|
|
35
|
+
async create(ctx: RequestContext) {
|
|
36
|
+
await this.tasks.create(ctx.body)
|
|
37
|
+
flash(ctx, { success: 'Task added' })
|
|
38
|
+
ctx.redirect('/tasks', 303)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
A failed `body` schema on a browser form post: `formErrorHandler()` stores the errors and the submitted values in the session and redirects (303) back to the page the form was on. API and `fetch()` calls get the usual 422.
|
|
43
|
+
|
|
44
|
+
```kick
|
|
45
|
+
<form method="post" action="/tasks">
|
|
46
|
+
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
|
47
|
+
<input name="title" validate="required | maxLength:200">
|
|
48
|
+
@error('title') {
|
|
49
|
+
{{ $message }}
|
|
50
|
+
}
|
|
51
|
+
<button>Add</button>
|
|
52
|
+
</form>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- Every template has `$errors` (field → first message, `form` for the whole body), `$old` and `$flash` — for the next page only.
|
|
56
|
+
- Named inputs refill from `$old` by themselves; passwords, hidden fields and secret-looking names never do.
|
|
57
|
+
- A check the schema can't do (email already taken): re-render with `ctx.render('tasks/new', { $errors: { email: '…' }, $old: ctx.body })`.
|
|
58
|
+
- Flash messages: `@for ([kind, message] of $flash | entries; track kind) { … }` in the layout.
|
|
59
|
+
|
|
60
|
+
**CSRF.** `csrf()` takes the token from the `_csrf` form field when there's no `x-csrf-token` header. Give pages the token with `createViews({ share: (ctx) => ({ csrfToken: csrfToken(ctx) }) })` (`csrfToken` from `@forinda/kickjs`).
|
|
61
|
+
|
|
62
|
+
**Checking in the browser**
|
|
63
|
+
|
|
64
|
+
- `validate="required | email | minLength:3"` on a named field: built-ins `required`, `email`, `url`, `minLength:n`, `maxLength:n`, `min:n`, `max:n`, `pattern:'re'`, `in:'a, b'`. Messages land in the field's `@error` spot. Only pages with such a field get the small validator script.
|
|
65
|
+
- Rich rules: a component with a `<script client>` can import the route's own schema (`import { taskSchema } from '@/modules/tasks/tasks.schemas'`) and run `safeParse` on blur and submit — one set of rules for server and browser. Keep the schema file free of server imports.
|
|
66
|
+
- The browser checks are for quick feedback. The route's schema still decides.
|
|
67
|
+
|
|
68
|
+
Full guide: https://kickjs.app/guide/views#forms.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kickjs-views
|
|
3
|
+
description: Use when rendering server-side HTML with .kick templates — setting up views, adding a page, layout, component or pipe, a component with a <script client>, or when a template fails kick build / kick check:views.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
**Setup** (once): `{{kick}} add views` does it all. By hand: `{{pm}} add @forinda/kickjs-view`, then
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
// src/views.ts
|
|
10
|
+
/// <reference types="@forinda/kickjs-view/virtual" />
|
|
11
|
+
import kickViews from 'virtual:kick-views'
|
|
12
|
+
import { createViews } from '@forinda/kickjs-view'
|
|
13
|
+
|
|
14
|
+
export const views = createViews({ ...kickViews, layout: 'layouts/main' })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
and `adapters: [KickView({ views })]` in `bootstrap()`. For `kick check:views` / `kick fmt:views`, register the CLI plugin in `kick.config.ts`: `import { viewCliPlugin } from '@forinda/kickjs-view/cli'` and `plugins: [viewCliPlugin]` (`kick add views` prints this line; `kick new --packages views` writes it). `virtual:kick-views` comes from `kickjsVitePlugin()`: `kick build` checks every template and ships them; `kick dev` reads `src/views` on each request.
|
|
18
|
+
|
|
19
|
+
**Where things go**
|
|
20
|
+
|
|
21
|
+
| Thing | File | Used as |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| Page | `src/views/users/show.kick` | `await ctx.render('users/show', { user })` |
|
|
24
|
+
| Layout | `src/views/layouts/main.kick` (`<slot />`, `<slot name="head">`) | `@layout('layouts/main')` or `createViews({ layout })` |
|
|
25
|
+
| Component | `src/views/components/user-card.kick` (`@input user`) | `<user-card [user]="u" />` |
|
|
26
|
+
| Pipe | an export of `src/views/pipes.ts` | `{{ total \| money }}` |
|
|
27
|
+
| Data every page gets | `createViews({ share: (ctx) => ({ user: ctx?.get('user') }) })` | `{{ user.email }}` |
|
|
28
|
+
|
|
29
|
+
**Syntax that trips people**
|
|
30
|
+
|
|
31
|
+
- `{{ expr }}` escapes. Expressions read data: **no function calls**, no object literals. Compute in the controller and pass the result.
|
|
32
|
+
- `class` and `style` can't be interpolated: use `[class.done]="task.done"` and `[style.width.px]="n"`. `[attr]="expr"` drops the attribute for `null`/`false`.
|
|
33
|
+
- `@if (items.length)`, not `@if (items)`: an empty array is truthy. Or `@for (x of items; track x.id) { … } @empty { … }`.
|
|
34
|
+
- `[flag]="false"` on a component input, not `flag="false"` (a non-empty string is truthy).
|
|
35
|
+
- A component tag needs a hyphen and matches `components/<path>.kick`, folders joined by `-` (`components/forms/text-field.kick` → `<forms-text-field>`). A missing or unknown input fails the check.
|
|
36
|
+
- `{{-- comment --}}` stays out of the output.
|
|
37
|
+
|
|
38
|
+
**Components with a script.** A top-level `<script client>` in a component is TypeScript that runs in the browser — typically a custom element that the component's markup contains. It ships once per page that renders the component, as `/_kick/c/<tag>.<hash>.js`. It can `import` npm packages and your own files (`@/…` aliases work): `kick build` bundles them into `dist/public/_kick/c/`, `kick dev` serves them through Vite. Running from source without either, a script that imports fails with "client scripts that import need kick dev or a kick build". Keep imported files browser-safe — whatever they import ships too.
|
|
39
|
+
|
|
40
|
+
**Check before claiming done**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
{{kick}} check:views # every template parsed and checked, as kick build does
|
|
44
|
+
{{kick}} fmt:views # format .kick files (--check in CI)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Errors name the file, line and column. An unknown pipe, input or slot, a `{{ }}` inside `<script>`/`<style>` or an `on*` attribute, and an unquoted attribute value are all check errors — fix the template, not the checker.
|
|
48
|
+
|
|
49
|
+
Full guide: https://kickjs.app/guide/views. Forms and validation: the `kickjs-views-forms` skill.
|