@jskit-ai/agent-docs 0.1.364 → 0.1.366
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/guide/agent/app-extras/mobile-capacitor.md +5 -0
- package/guide/agent/app-setup/authentication.md +10 -8
- package/guide/agent/app-setup/database-layer.md +51 -39
- package/guide/agent/app-setup/existing-application-migration.md +3 -1
- package/guide/agent/app-setup/upgrading-jskit.md +13 -3
- package/guide/agent/framework/application-operations.md +9 -0
- package/guide/agent/framework/client-features.md +22 -0
- package/guide/agent/framework/speed-pass.md +6 -94
- package/guide/agent/framework/test-pass.md +210 -0
- package/guide/agent/framework/typed-features.md +64 -1
- package/guide/agent/framework/ui-operations.md +43 -8
- package/guide/agent/index.md +40 -4
- package/guide/agent/recipes/another-language.md +129 -0
- package/guide/agent/recipes/file-uploads-and-images.md +125 -0
- package/guide/agent/recipes/installable-app.md +383 -0
- package/guide/agent/recipes/invite-people-with-roles.md +142 -0
- package/guide/agent/recipes/offline-study.md +163 -0
- package/guide/agent/recipes/payments-and-subscriptions.md +156 -0
- package/guide/agent/recipes/reminders-and-digests.md +153 -0
- package/guide/agent/recipes/usefulness-study.md +137 -0
- package/package.json +1 -1
- package/patterns/minimal-foundation/PATTERN.md +2 -0
- package/patterns/minimal-foundation/example/AGENTS.md +54 -101
- package/patterns/minimal-foundation/example/gitignore +1 -1
- package/patterns/minimal-foundation/example/package.json +3 -3
- package/patterns/minimal-foundation/example/server/lib/loggerOptions.js +6 -3
- package/patterns/minimal-foundation/example/server.js +1 -1
- package/patterns/minimal-foundation/example/vite.config.mjs +3 -2
- package/patterns/shell-foundation/PATTERN.md +2 -0
- package/patterns/shell-foundation/example/AGENTS.md +54 -101
- package/patterns/shell-foundation/example/gitignore +1 -1
- package/patterns/shell-foundation/example/package.json +4 -4
- package/patterns/shell-foundation/example/server/lib/loggerOptions.js +6 -3
- package/patterns/shell-foundation/example/server.js +1 -1
- package/patterns/shell-foundation/example/vite.config.mjs +3 -2
- package/reference/autogen/PATTERN_INDEX.md +36 -36
- package/reference/autogen/packages/agent-docs.md +2 -2
- package/reference/autogen/packages/assistant-runtime.md +4 -0
- package/reference/autogen/packages/auth-provider-local-core.md +1 -0
- package/reference/autogen/packages/auth-web.md +3 -2
- package/reference/autogen/packages/database-runtime.md +5 -17
- package/reference/autogen/packages/material-web.md +4 -0
- package/reference/autogen/tooling/config-eslint.md +8 -0
- package/reference/autogen/tooling/jskit-catalog.md +58 -5
- package/skills/jskit/SKILL.md +8 -4
- package/skills/jskit/references/app-operations.md +9 -0
- package/skills/jskit/references/client-features.md +22 -0
- package/skills/jskit/references/database-layer.md +51 -39
- package/skills/jskit/references/existing-application-migration.md +3 -1
- package/skills/jskit/references/heuristics/INDEX.md +2 -2
- package/skills/jskit/references/heuristics/client-requests.md +3 -1
- package/skills/jskit/references/heuristics/crud-authoring.md +10 -0
- package/skills/jskit/references/heuristics/placements.md +1 -0
- package/skills/jskit/references/heuristics/ui-testing.md +10 -7
- package/skills/jskit/references/pattern-index.md +36 -36
- package/skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md +2 -0
- package/skills/jskit/references/patterns/app/minimal-foundation/example/AGENTS.md +54 -101
- package/skills/jskit/references/patterns/app/minimal-foundation/example/gitignore +1 -1
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/app/minimal-foundation/example/server/lib/loggerOptions.js +6 -3
- package/skills/jskit/references/patterns/app/minimal-foundation/example/server.js +1 -1
- package/skills/jskit/references/patterns/app/minimal-foundation/example/vite.config.mjs +3 -2
- package/skills/jskit/references/patterns/app/shell-foundation/PATTERN.md +2 -0
- package/skills/jskit/references/patterns/app/shell-foundation/example/AGENTS.md +54 -101
- package/skills/jskit/references/patterns/app/shell-foundation/example/gitignore +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
- package/skills/jskit/references/patterns/app/shell-foundation/example/server/lib/loggerOptions.js +6 -3
- package/skills/jskit/references/patterns/app/shell-foundation/example/server.js +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/vite.config.mjs +3 -2
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/connectors/calendar-cli/example/package.json +4 -4
- package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +1 -1
- package/skills/jskit/references/patterns/database/mysql-application/PATTERN.md +6 -5
- package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +2 -2
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +4 -4
- package/skills/jskit/references/speed-pass.md +5 -93
- package/skills/jskit/references/test-pass.md +205 -0
- package/skills/jskit/references/typed-features.md +64 -1
- package/skills/jskit/references/ui-operations.md +43 -8
|
@@ -1,103 +1,56 @@
|
|
|
1
1
|
# App Agent Instructions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
repeat-start regression proof.
|
|
58
|
-
|
|
59
|
-
Tests run in parallel within the machine's test budget: run node's test
|
|
60
|
-
runner through `jskit test` (`npm test`), with `--databases` once the app has a
|
|
61
|
-
database so each file running at once gets its own copy of `TEST_DB_NAME`,
|
|
62
|
-
Playwright through `browserTestConfig()`, and take Vitest's `maxWorkers` from
|
|
63
|
-
`testConcurrency()` of
|
|
64
|
-
`@jskit-ai/jskit-catalog/test-budget`; never one file at a time or a fixed
|
|
65
|
-
count. Isolate files that collide (their own port, temporary directory and
|
|
66
|
-
database) instead of serialising them; a file that truly must run alone says
|
|
67
|
-
why on its first line, `// jskit-test: alone - <reason>`. Plain `jskit check`
|
|
68
|
-
fails anything else
|
|
69
|
-
(`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`).
|
|
70
|
-
|
|
71
|
-
Keep verification output small. Run the relevant cases together, save complete
|
|
72
|
-
stdout/stderr to local artifacts, and preserve the exit status. Report counts,
|
|
73
|
-
duration, failed case names and artifact paths; read only actionable failure
|
|
74
|
-
excerpts. Do not dump full JSON/TAP reports, passing assertions, request logs or
|
|
75
|
-
traces into agent context. Wait on the existing run instead of restarting it or
|
|
76
|
-
repeatedly printing unchanged output. Keep startup and cleanup errors visible.
|
|
77
|
-
For browser evidence, use existing automated cases, targeted locators and
|
|
78
|
-
meaningful visual checkpoints. Avoid a full DOM snapshot or screenshot after
|
|
79
|
-
every action; retain the required viewport, identity and security checks.
|
|
80
|
-
|
|
81
|
-
Pages never start with a page header, title block, welcome heading, or other
|
|
82
|
-
standalone heading copy. Start with the useful content and actions. If the user
|
|
83
|
-
wants a heading, they will ask for or add one.
|
|
84
|
-
|
|
85
|
-
Selection fields never show a stored id as text. A select, autocomplete or
|
|
86
|
-
combobox whose options load from the server, or whose value is a record id,
|
|
87
|
-
uses `SelectField` from `@jskit-ai/http-web/client/components/SelectField` with
|
|
88
|
-
`loading` while the options load, not a raw `v-select`, `v-autocomplete` or
|
|
89
|
-
`v-combobox`. The lint rule `jskit/selection-field` reports a raw one whose
|
|
90
|
-
items are not fixed (a list written out, a top-level `const` holding one, or an
|
|
91
|
-
import from a `shared` module) and a `SelectField` over loaded items without
|
|
92
|
-
`loading`; a justified case says why in
|
|
93
|
-
`<!-- readable-check: allow selection-field - data: <reason> -->` above it.
|
|
94
|
-
That `loading` is not a spinner: Vuetify draws it as the field's own thin
|
|
95
|
-
progress line along its underline, the built-in loading state the Material 3
|
|
96
|
-
rules keep (`https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3#components-state-and-feedback`).
|
|
97
|
-
What those rules avoid is an ad-hoc spinner: a circular indicator on a button
|
|
98
|
-
or in place of content, or a whole-page one. Count spinners by what renders,
|
|
99
|
-
not by `loading` props.
|
|
100
|
-
|
|
101
|
-
Copied pattern source is ordinary application source. Do not add generator
|
|
102
|
-
provenance, receipts, completion ledgers, or tooling-operation history. Keep
|
|
103
|
-
changes scoped to the user request and verify runtime behavior directly.
|
|
3
|
+
<!-- jskit:begin app guidance (written by npx jskit agents; edit outside this block) -->
|
|
4
|
+
## JSKIT
|
|
5
|
+
|
|
6
|
+
This app is built on JSKIT. Its guide,
|
|
7
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/`, and its pattern
|
|
8
|
+
library, `https://mobily-enterprises.github.io/jskit-ai/patterns/`, describe
|
|
9
|
+
the current JSKIT release. `@jskit-ai/agent-docs` is not an app dependency, so
|
|
10
|
+
the guide has no copy under `node_modules`. Keep the app on the current release
|
|
11
|
+
(`npm run jskit:update`) so the two agree. A pattern whose owner runtime package
|
|
12
|
+
is installed is also in that package's `patterns/` folder, at the app's
|
|
13
|
+
version. Never install a runtime package only to read its documentation.
|
|
14
|
+
|
|
15
|
+
Read the guide's page before the work it covers:
|
|
16
|
+
|
|
17
|
+
- code that reads or writes a database table:
|
|
18
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/data-access`
|
|
19
|
+
- server code (a feature, provider, action, service, repository, route, error
|
|
20
|
+
or test):
|
|
21
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features`
|
|
22
|
+
- client code (a composable, component, client factory or client provider):
|
|
23
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/client-features`
|
|
24
|
+
- code that sends email, SMS, push notifications or payments, calls another
|
|
25
|
+
system, or depends on where the app runs (`APP_ENV`):
|
|
26
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/environments`
|
|
27
|
+
- a screen:
|
|
28
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3`
|
|
29
|
+
- tests:
|
|
30
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`,
|
|
31
|
+
and browser tests:
|
|
32
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`
|
|
33
|
+
- a new capability: the pattern library; read the narrow pattern completely
|
|
34
|
+
before implementing.
|
|
35
|
+
|
|
36
|
+
`npm run verify` runs the checks listed in
|
|
37
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#running-the-checks`.
|
|
38
|
+
`npm test` runs every Node test file; `npm test -- <file>` runs exactly that
|
|
39
|
+
file. Each finding links the guide section that explains it: fix it in the
|
|
40
|
+
code, and excuse one only with the guide's `readable-check: allow` comment and
|
|
41
|
+
reason prefix.
|
|
42
|
+
|
|
43
|
+
Where the host provides a managed browser runner, such as Vibe64's, every
|
|
44
|
+
Playwright suite runs through it from the first run, on a declared test target:
|
|
45
|
+
give the runner the package script (on Vibe64,
|
|
46
|
+
`vibe64-helper playwright --target test-app npm-run test:e2e`), and never start
|
|
47
|
+
`npx playwright test`, `playwright test` or `npm run test:e2e` yourself. Specs
|
|
48
|
+
that write run only on a test target with its own database, never on the
|
|
49
|
+
person's development target or database. The browser tests guide above shows
|
|
50
|
+
the test target's declaration.
|
|
51
|
+
<!-- jskit:end app guidance -->
|
|
52
|
+
|
|
53
|
+
## This app
|
|
54
|
+
|
|
55
|
+
Write this app's own rules here, outside the JSKIT block, which
|
|
56
|
+
`npm run jskit:update` rewrites.
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@local/main": "0.1.0",
|
|
36
36
|
"@fastify/static": "^10.1.3",
|
|
37
37
|
"@jskit-ai/kernel": "0.2.35",
|
|
38
|
-
"@jskit-ai/material-web": "0.1.
|
|
38
|
+
"@jskit-ai/material-web": "0.1.15",
|
|
39
39
|
"@tanstack/vue-query": "^5.101.0",
|
|
40
40
|
"fastify": "^5.12.7",
|
|
41
41
|
"pino": "^10.3.1",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@vue/devtools-api": "^8.2.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@jskit-ai/config-eslint": "0.1.
|
|
53
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
52
|
+
"@jskit-ai/config-eslint": "0.1.254",
|
|
53
|
+
"@jskit-ai/jskit-catalog": "0.2.118",
|
|
54
54
|
"@playwright/test": "1.61.1",
|
|
55
55
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
56
56
|
"eslint": "^10.8.0",
|
package/skills/jskit/references/patterns/app/minimal-foundation/example/server/lib/loggerOptions.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import pino from "pino";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The Fastify logger's options
|
|
5
|
-
*
|
|
4
|
+
* The Fastify logger's options: the level LOG_LEVEL names, info without one (`jskit test` and the browser test servers
|
|
5
|
+
* set warn, so a test server does not log every request), and, since Fastify's logger serializes only the `err` key,
|
|
6
|
+
* the same serializer under `error`, which keeps the message and stack of `logger.error({ error }, "...")`.
|
|
7
|
+
* @param {import("@jskit-ai/kernel/server/types").RuntimeEnv} runtimeEnv
|
|
6
8
|
*/
|
|
7
|
-
function buildLoggerOptions() {
|
|
9
|
+
function buildLoggerOptions(runtimeEnv) {
|
|
8
10
|
return {
|
|
11
|
+
level: String(runtimeEnv.LOG_LEVEL || "").trim() || "info",
|
|
9
12
|
serializers: {
|
|
10
13
|
error: pino.stdSerializers.err
|
|
11
14
|
}
|
|
@@ -93,7 +93,7 @@ function canServeStaticFile(distRoot, relativePath) {
|
|
|
93
93
|
*/
|
|
94
94
|
async function createServer({ runtimeEnv }) {
|
|
95
95
|
const app = Fastify({
|
|
96
|
-
logger: buildLoggerOptions(),
|
|
96
|
+
logger: buildLoggerOptions(runtimeEnv),
|
|
97
97
|
// The proxies in front of the server (TRUSTED_PROXIES; loopback without it), so request.ip and the rate limits
|
|
98
98
|
// counted by it are each client's address behind them.
|
|
99
99
|
trustProxy: resolveTrustedProxies(runtimeEnv),
|
|
@@ -35,8 +35,9 @@ export default defineConfig({
|
|
|
35
35
|
}),
|
|
36
36
|
VueRouter({
|
|
37
37
|
routesFolder: "src/pages",
|
|
38
|
-
// Generated on the first Vite dev/build scan and intentionally gitignored.
|
|
39
|
-
|
|
38
|
+
// Generated on the first Vite dev/build scan and intentionally gitignored. It stays outside src, which the
|
|
39
|
+
// browser tests' frontend build reads: a file written there while it builds keeps that build from being reused.
|
|
40
|
+
dts: "types/typed-router.d.ts",
|
|
40
41
|
nestedChildren: false
|
|
41
42
|
}),
|
|
42
43
|
vue(),
|
|
@@ -73,6 +73,8 @@ not convert those choices into a generator questionnaire.
|
|
|
73
73
|
`server.js` takes `API_BASE_PATH` and `toRequestPathname` from the kernel's
|
|
74
74
|
`shared/surface/paths`. `server/lib/envFile.js` loads `.env` once per process
|
|
75
75
|
for every entry point. `server/lib/loggerOptions.js` gives Fastify's logger
|
|
76
|
+
the level `LOG_LEVEL` names, info without one (`jskit test` and the browser
|
|
77
|
+
test servers set warn, so a test server does not log every request), and
|
|
76
78
|
pino's error serializer under `error` as well as `err`, so
|
|
77
79
|
`logger.error({ error }, "...")` keeps the error's message and stack. `eslint.config.mjs` holds
|
|
78
80
|
server and shared code to every typed-features rule (`typedFeaturesConfig`),
|
|
@@ -1,103 +1,56 @@
|
|
|
1
1
|
# App Agent Instructions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
repeat-start regression proof.
|
|
58
|
-
|
|
59
|
-
Tests run in parallel within the machine's test budget: run node's test
|
|
60
|
-
runner through `jskit test` (`npm test`), with `--databases` once the app has a
|
|
61
|
-
database so each file running at once gets its own copy of `TEST_DB_NAME`,
|
|
62
|
-
Playwright through `browserTestConfig()`, and take Vitest's `maxWorkers` from
|
|
63
|
-
`testConcurrency()` of
|
|
64
|
-
`@jskit-ai/jskit-catalog/test-budget`; never one file at a time or a fixed
|
|
65
|
-
count. Isolate files that collide (their own port, temporary directory and
|
|
66
|
-
database) instead of serialising them; a file that truly must run alone says
|
|
67
|
-
why on its first line, `// jskit-test: alone - <reason>`. Plain `jskit check`
|
|
68
|
-
fails anything else
|
|
69
|
-
(`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`).
|
|
70
|
-
|
|
71
|
-
Keep verification output small. Run the relevant cases together, save complete
|
|
72
|
-
stdout/stderr to local artifacts, and preserve the exit status. Report counts,
|
|
73
|
-
duration, failed case names and artifact paths; read only actionable failure
|
|
74
|
-
excerpts. Do not dump full JSON/TAP reports, passing assertions, request logs or
|
|
75
|
-
traces into agent context. Wait on the existing run instead of restarting it or
|
|
76
|
-
repeatedly printing unchanged output. Keep startup and cleanup errors visible.
|
|
77
|
-
For browser evidence, use existing automated cases, targeted locators and
|
|
78
|
-
meaningful visual checkpoints. Avoid a full DOM snapshot or screenshot after
|
|
79
|
-
every action; retain the required viewport, identity and security checks.
|
|
80
|
-
|
|
81
|
-
Pages never start with a page header, title block, welcome heading, or other
|
|
82
|
-
standalone heading copy. Start with the useful content and actions. If the user
|
|
83
|
-
wants a heading, they will ask for or add one.
|
|
84
|
-
|
|
85
|
-
Selection fields never show a stored id as text. A select, autocomplete or
|
|
86
|
-
combobox whose options load from the server, or whose value is a record id,
|
|
87
|
-
uses `SelectField` from `@jskit-ai/http-web/client/components/SelectField` with
|
|
88
|
-
`loading` while the options load, not a raw `v-select`, `v-autocomplete` or
|
|
89
|
-
`v-combobox`. The lint rule `jskit/selection-field` reports a raw one whose
|
|
90
|
-
items are not fixed (a list written out, a top-level `const` holding one, or an
|
|
91
|
-
import from a `shared` module) and a `SelectField` over loaded items without
|
|
92
|
-
`loading`; a justified case says why in
|
|
93
|
-
`<!-- readable-check: allow selection-field - data: <reason> -->` above it.
|
|
94
|
-
That `loading` is not a spinner: Vuetify draws it as the field's own thin
|
|
95
|
-
progress line along its underline, the built-in loading state the Material 3
|
|
96
|
-
rules keep (`https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3#components-state-and-feedback`).
|
|
97
|
-
What those rules avoid is an ad-hoc spinner: a circular indicator on a button
|
|
98
|
-
or in place of content, or a whole-page one. Count spinners by what renders,
|
|
99
|
-
not by `loading` props.
|
|
100
|
-
|
|
101
|
-
Copied pattern source is ordinary application source. Do not add generator
|
|
102
|
-
provenance, receipts, completion ledgers, or tooling-operation history. Keep
|
|
103
|
-
changes scoped to the user request and verify runtime behavior directly.
|
|
3
|
+
<!-- jskit:begin app guidance (written by npx jskit agents; edit outside this block) -->
|
|
4
|
+
## JSKIT
|
|
5
|
+
|
|
6
|
+
This app is built on JSKIT. Its guide,
|
|
7
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/`, and its pattern
|
|
8
|
+
library, `https://mobily-enterprises.github.io/jskit-ai/patterns/`, describe
|
|
9
|
+
the current JSKIT release. `@jskit-ai/agent-docs` is not an app dependency, so
|
|
10
|
+
the guide has no copy under `node_modules`. Keep the app on the current release
|
|
11
|
+
(`npm run jskit:update`) so the two agree. A pattern whose owner runtime package
|
|
12
|
+
is installed is also in that package's `patterns/` folder, at the app's
|
|
13
|
+
version. Never install a runtime package only to read its documentation.
|
|
14
|
+
|
|
15
|
+
Read the guide's page before the work it covers:
|
|
16
|
+
|
|
17
|
+
- code that reads or writes a database table:
|
|
18
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/data-access`
|
|
19
|
+
- server code (a feature, provider, action, service, repository, route, error
|
|
20
|
+
or test):
|
|
21
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features`
|
|
22
|
+
- client code (a composable, component, client factory or client provider):
|
|
23
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/client-features`
|
|
24
|
+
- code that sends email, SMS, push notifications or payments, calls another
|
|
25
|
+
system, or depends on where the app runs (`APP_ENV`):
|
|
26
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/environments`
|
|
27
|
+
- a screen:
|
|
28
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/material-3`
|
|
29
|
+
- tests:
|
|
30
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#test-files-run-in-parallel`,
|
|
31
|
+
and browser tests:
|
|
32
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/ui-operations#browser-verification`
|
|
33
|
+
- a new capability: the pattern library; read the narrow pattern completely
|
|
34
|
+
before implementing.
|
|
35
|
+
|
|
36
|
+
`npm run verify` runs the checks listed in
|
|
37
|
+
`https://mobily-enterprises.github.io/jskit-ai/guide/framework/typed-features#running-the-checks`.
|
|
38
|
+
`npm test` runs every Node test file; `npm test -- <file>` runs exactly that
|
|
39
|
+
file. Each finding links the guide section that explains it: fix it in the
|
|
40
|
+
code, and excuse one only with the guide's `readable-check: allow` comment and
|
|
41
|
+
reason prefix.
|
|
42
|
+
|
|
43
|
+
Where the host provides a managed browser runner, such as Vibe64's, every
|
|
44
|
+
Playwright suite runs through it from the first run, on a declared test target:
|
|
45
|
+
give the runner the package script (on Vibe64,
|
|
46
|
+
`vibe64-helper playwright --target test-app npm-run test:e2e`), and never start
|
|
47
|
+
`npx playwright test`, `playwright test` or `npm run test:e2e` yourself. Specs
|
|
48
|
+
that write run only on a test target with its own database, never on the
|
|
49
|
+
person's development target or database. The browser tests guide above shows
|
|
50
|
+
the test target's declaration.
|
|
51
|
+
<!-- jskit:end app guidance -->
|
|
52
|
+
|
|
53
|
+
## This app
|
|
54
|
+
|
|
55
|
+
Write this app's own rules here, outside the JSKIT block, which
|
|
56
|
+
`npm run jskit:update` rewrites.
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@local/main": "0.1.0",
|
|
36
36
|
"@fastify/static": "^10.1.3",
|
|
37
37
|
"@jskit-ai/kernel": "0.2.35",
|
|
38
|
-
"@jskit-ai/material-web": "0.1.
|
|
38
|
+
"@jskit-ai/material-web": "0.1.15",
|
|
39
39
|
"@tanstack/vue-query": "^5.101.0",
|
|
40
40
|
"fastify": "^5.12.7",
|
|
41
41
|
"pino": "^10.3.1",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"vue-router": "^5.3.1",
|
|
46
46
|
"vuetify": "^4.3.0",
|
|
47
47
|
"@jskit-ai/http-runtime": "0.2.36",
|
|
48
|
-
"@jskit-ai/shell-web": "0.2.
|
|
48
|
+
"@jskit-ai/shell-web": "0.2.56",
|
|
49
49
|
"@fastify/fast-json-stringify-compiler": "^5.1.0",
|
|
50
50
|
"@vue/devtools-api": "^8.2.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@jskit-ai/config-eslint": "0.1.
|
|
54
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
53
|
+
"@jskit-ai/config-eslint": "0.1.254",
|
|
54
|
+
"@jskit-ai/jskit-catalog": "0.2.118",
|
|
55
55
|
"@playwright/test": "1.61.1",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
57
57
|
"eslint": "^10.8.0",
|
package/skills/jskit/references/patterns/app/shell-foundation/example/server/lib/loggerOptions.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import pino from "pino";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The Fastify logger's options
|
|
5
|
-
*
|
|
4
|
+
* The Fastify logger's options: the level LOG_LEVEL names, info without one (`jskit test` and the browser test servers
|
|
5
|
+
* set warn, so a test server does not log every request), and, since Fastify's logger serializes only the `err` key,
|
|
6
|
+
* the same serializer under `error`, which keeps the message and stack of `logger.error({ error }, "...")`.
|
|
7
|
+
* @param {import("@jskit-ai/kernel/server/types").RuntimeEnv} runtimeEnv
|
|
6
8
|
*/
|
|
7
|
-
function buildLoggerOptions() {
|
|
9
|
+
function buildLoggerOptions(runtimeEnv) {
|
|
8
10
|
return {
|
|
11
|
+
level: String(runtimeEnv.LOG_LEVEL || "").trim() || "info",
|
|
9
12
|
serializers: {
|
|
10
13
|
error: pino.stdSerializers.err
|
|
11
14
|
}
|
|
@@ -93,7 +93,7 @@ function canServeStaticFile(distRoot, relativePath) {
|
|
|
93
93
|
*/
|
|
94
94
|
async function createServer({ runtimeEnv }) {
|
|
95
95
|
const app = Fastify({
|
|
96
|
-
logger: buildLoggerOptions(),
|
|
96
|
+
logger: buildLoggerOptions(runtimeEnv),
|
|
97
97
|
// The proxies in front of the server (TRUSTED_PROXIES; loopback without it), so request.ip and the rate limits
|
|
98
98
|
// counted by it are each client's address behind them.
|
|
99
99
|
trustProxy: resolveTrustedProxies(runtimeEnv),
|
|
@@ -35,8 +35,9 @@ export default defineConfig({
|
|
|
35
35
|
}),
|
|
36
36
|
VueRouter({
|
|
37
37
|
routesFolder: "src/pages",
|
|
38
|
-
// Generated on the first Vite dev/build scan and intentionally gitignored.
|
|
39
|
-
|
|
38
|
+
// Generated on the first Vite dev/build scan and intentionally gitignored. It stays outside src, which the
|
|
39
|
+
// browser tests' frontend build reads: a file written there while it builds keeps that build from being reused.
|
|
40
|
+
dts: "types/typed-router.d.ts",
|
|
40
41
|
nestedChildren: false
|
|
41
42
|
}),
|
|
42
43
|
vue(),
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"private": true,
|
|
3
3
|
"type": "module",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
6
|
-
"@jskit-ai/database-runtime-mysql": "0.1.
|
|
7
|
-
"@jskit-ai/oidc-issuer-core": "0.1.
|
|
5
|
+
"@jskit-ai/database-runtime": "0.1.292",
|
|
6
|
+
"@jskit-ai/database-runtime-mysql": "0.1.290",
|
|
7
|
+
"@jskit-ai/oidc-issuer-core": "0.1.61"
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
"db:migrate:status": "knex --knexfile ./knexfile.js migrate:list"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@jskit-ai/connectors-core": "0.2.
|
|
11
|
-
"@jskit-ai/connector-google-calendar": "0.2.
|
|
12
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/database-runtime-mysql": "0.1.
|
|
10
|
+
"@jskit-ai/connectors-core": "0.2.60",
|
|
11
|
+
"@jskit-ai/connector-google-calendar": "0.2.60",
|
|
12
|
+
"@jskit-ai/database-runtime": "0.1.292",
|
|
13
|
+
"@jskit-ai/database-runtime-mysql": "0.1.290",
|
|
14
14
|
"@jskit-ai/kernel": "0.2.35",
|
|
15
15
|
"knex": "^3.1.0"
|
|
16
16
|
}
|
|
@@ -69,9 +69,10 @@ application's workflow has no `postgres` service, `POSTGRES_*` variables, port
|
|
|
69
69
|
Tests get their own databases from
|
|
70
70
|
`@jskit-ai/database-runtime/server/testDatabases`. The `test` script runs
|
|
71
71
|
`jskit test --databases`: each Node test file running at once gets its own
|
|
72
|
-
copy of `TEST_DB_NAME` (`<name>`, `<name>_1`, ...), restored from a
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
copy of `TEST_DB_NAME` (`<name>`, `<name>_1`, ...), restored from a snapshot
|
|
73
|
+
of the current migrations' schema and the rows they write, kept on the server
|
|
74
|
+
in `<TEST_DB_NAME>_0`, whose tables each copy's are made from there (`INSERT
|
|
75
|
+
... SELECT`), and which `npm ci` leaves. The snapshot is replayed once, and
|
|
75
76
|
again only when a migration's name or contents or `package-lock.json` change;
|
|
76
77
|
a file that migrates or drops tables leaves its copy to be restored before the
|
|
77
78
|
next file takes it.
|
|
@@ -82,8 +83,8 @@ next file takes it.
|
|
|
82
83
|
server its own copy of `BROWSER_TEST_DB_NAME`, restored from the same kind of
|
|
83
84
|
snapshot and seeded in one transaction by the app's fixture `seed`, which
|
|
84
85
|
restores any migration-owned baseline rows the app needs. Every server serves
|
|
85
|
-
the production build. When the run stops, the launcher
|
|
86
|
-
|
|
86
|
+
the production build. When the run stops, the launcher stops its servers;
|
|
87
|
+
`BROWSER_TEST_DB_NAME`, its copies and the snapshot stay for the next run, which restores them. Both refuse the application's database (`DB_NAME`,
|
|
87
88
|
`DATABASE_URL`'s, the Knex connection's), `STAGING_DB_NAME`,
|
|
88
89
|
`PRODUCTION_DB_NAME` and the other test database and its copies. Provision `TEST_DB_NAME`, `BROWSER_TEST_DB_NAME` and
|
|
89
90
|
their numbered copies with grants for the application account (a `<app>_%`
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "jskit test --databases"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jskit-ai/database-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/database-runtime-postgres": "0.1.
|
|
12
|
+
"@jskit-ai/database-runtime": "0.1.292",
|
|
13
|
+
"@jskit-ai/database-runtime-postgres": "0.1.289"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"./shared": "./src/shared/index.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@jskit-ai/crud-core": "0.2.
|
|
13
|
+
"@jskit-ai/crud-core": "0.2.61",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.228",
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
15
|
+
"@jskit-ai/users-core": "0.2.72"
|
|
16
16
|
},
|
|
17
17
|
"jskit": {
|
|
18
18
|
"kind": "runtime",
|