@happyvertical/smrt-template-sveltekit 0.51.26 → 0.51.31
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/AGENTS.md +3 -1
- package/package.json +15 -15
- package/template/AGENTS.md +5 -1
- package/template/README.md +5 -1
- package/template/package.json +11 -11
- package/template/scripts/smrt-worker.mjs +14 -0
package/AGENTS.md
CHANGED
|
@@ -17,7 +17,9 @@ It is the ground-up alternative to `smrt-saas-starter`.
|
|
|
17
17
|
- `runtime.profile` is the canonical infrastructure selector. Generated apps
|
|
18
18
|
expose deterministic `app:*` operations and keep runtime state outside source.
|
|
19
19
|
- The production baseline uses adapter-node with separate web, task-worker, and
|
|
20
|
-
schedule-worker processes.
|
|
20
|
+
schedule-worker processes. Workers import the build-compiled
|
|
21
|
+
`.smrt/runtime/register.js` (#3117) before creating runners so app-defined
|
|
22
|
+
jobs resolve the app's own objects. Its runtime image retains the generated manifest
|
|
21
23
|
and operator CLI needed by `app:doctor`, `app:export`, and `app:import`.
|
|
22
24
|
- Deployed authentication, asset, and secret readiness is delegated to
|
|
23
25
|
installed provider-owned probe modules; never replace it with truthy flags.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-template-sveltekit",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.31",
|
|
4
4
|
"description": "Minimal SvelteKit project template with s-m-r-t framework integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"directory": "packages/template-sveltekit"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@happyvertical/smrt-core": "0.51.
|
|
32
|
+
"@happyvertical/smrt-core": "0.51.31"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@happyvertical/smrt-app-runtime": "0.51.
|
|
36
|
-
"@happyvertical/smrt-assets": "0.51.
|
|
37
|
-
"@happyvertical/smrt-cli": "0.51.
|
|
38
|
-
"@happyvertical/smrt-config": "0.51.
|
|
39
|
-
"@happyvertical/smrt-jobs": "0.51.
|
|
40
|
-
"@happyvertical/smrt-playbooks": "0.51.
|
|
41
|
-
"@happyvertical/smrt-profiles": "0.51.
|
|
42
|
-
"@happyvertical/smrt-scanner": "0.51.
|
|
43
|
-
"@happyvertical/smrt-svelte": "0.51.
|
|
44
|
-
"@happyvertical/smrt-tenancy": "0.51.
|
|
45
|
-
"@happyvertical/smrt-ui": "0.51.
|
|
46
|
-
"@happyvertical/smrt-users": "0.51.
|
|
47
|
-
"@happyvertical/smrt-web": "0.51.
|
|
35
|
+
"@happyvertical/smrt-app-runtime": "0.51.31",
|
|
36
|
+
"@happyvertical/smrt-assets": "0.51.31",
|
|
37
|
+
"@happyvertical/smrt-cli": "0.51.31",
|
|
38
|
+
"@happyvertical/smrt-config": "0.51.31",
|
|
39
|
+
"@happyvertical/smrt-jobs": "0.51.31",
|
|
40
|
+
"@happyvertical/smrt-playbooks": "0.51.31",
|
|
41
|
+
"@happyvertical/smrt-profiles": "0.51.31",
|
|
42
|
+
"@happyvertical/smrt-scanner": "0.51.31",
|
|
43
|
+
"@happyvertical/smrt-svelte": "0.51.31",
|
|
44
|
+
"@happyvertical/smrt-tenancy": "0.51.31",
|
|
45
|
+
"@happyvertical/smrt-ui": "0.51.31",
|
|
46
|
+
"@happyvertical/smrt-users": "0.51.31",
|
|
47
|
+
"@happyvertical/smrt-web": "0.51.31",
|
|
48
48
|
"@happyvertical/sql": "^0.89.12",
|
|
49
49
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
50
50
|
"@playwright/test": "^1.63.0",
|
package/template/AGENTS.md
CHANGED
|
@@ -53,7 +53,11 @@ tools, WebMCP definitions, and agent/developer knowledge artifacts.
|
|
|
53
53
|
Keep the guard in place for SSR and seed live collections with SSR
|
|
54
54
|
`initialData`.
|
|
55
55
|
- Do not enable knowledge HTTP routes in production without explicit admin auth.
|
|
56
|
-
- Run task and schedule workers as separate deployed processes.
|
|
56
|
+
- Run task and schedule workers as separate deployed processes. The worker
|
|
57
|
+
imports `.smrt/runtime/register.js` (compiled by `pnpm build`) before any
|
|
58
|
+
runner starts, so jobs can target this app's own `@smrt()` objects; keep that
|
|
59
|
+
import ahead of runner creation and keep domain objects free of SvelteKit
|
|
60
|
+
virtual modules (`$env/*`, `$app/*`), which a worker cannot load. Extend the
|
|
57
61
|
portability adapter instead of converting database files. Deployed provider
|
|
58
62
|
readiness must come from installed modules that probe the real backing
|
|
59
63
|
services; environment booleans are not readiness evidence.
|
package/template/README.md
CHANGED
|
@@ -353,7 +353,11 @@ The adapter-node `Dockerfile` and `compose.yaml` provide the production path.
|
|
|
353
353
|
Compose gates the web and both workers on the one-shot, idempotent migration
|
|
354
354
|
service. The runtime image retains the generated manifest and operator CLI for
|
|
355
355
|
doctor/export/import. `pnpm worker` and `pnpm worker:schedule` are separate from
|
|
356
|
-
the web process.
|
|
356
|
+
the web process. Workers register the app's own objects from
|
|
357
|
+
`.smrt/runtime/register.js`, which `pnpm build` compiles, so a scheduled or
|
|
358
|
+
queued job may target objects in `src/lib/objects`; build before starting a
|
|
359
|
+
worker. A worker is a plain Node process: an object that imports a SvelteKit
|
|
360
|
+
virtual module (`$env/*`, `$app/*`) or a `.svelte` file cannot load there.
|
|
357
361
|
Logical export/import is manifest-driven JSON and refuses a non-empty target;
|
|
358
362
|
it orders parent tables first and defers nullable cycle edges until every row
|
|
359
363
|
exists. Export reads all model tables from one transaction snapshot. Every
|
package/template/package.json
CHANGED
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"svelte-check": "^4.7.6",
|
|
38
38
|
"typescript": "6.0.3",
|
|
39
39
|
"vite": "8.3.0",
|
|
40
|
-
"@happyvertical/smrt-cli": "^0.51.
|
|
40
|
+
"@happyvertical/smrt-cli": "^0.51.31"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@happyvertical/smrt-app-runtime": "^0.51.
|
|
44
|
-
"@happyvertical/smrt-config": "^0.51.
|
|
45
|
-
"@happyvertical/smrt-core": "^0.51.
|
|
46
|
-
"@happyvertical/smrt-jobs": "^0.51.
|
|
47
|
-
"@happyvertical/smrt-profiles": "^0.51.
|
|
48
|
-
"@happyvertical/smrt-svelte": "^0.51.
|
|
49
|
-
"@happyvertical/smrt-tenancy": "^0.51.
|
|
50
|
-
"@happyvertical/smrt-ui": "^0.51.
|
|
51
|
-
"@happyvertical/smrt-users": "^0.51.
|
|
52
|
-
"@happyvertical/smrt-web": "^0.51.
|
|
43
|
+
"@happyvertical/smrt-app-runtime": "^0.51.31",
|
|
44
|
+
"@happyvertical/smrt-config": "^0.51.31",
|
|
45
|
+
"@happyvertical/smrt-core": "^0.51.31",
|
|
46
|
+
"@happyvertical/smrt-jobs": "^0.51.31",
|
|
47
|
+
"@happyvertical/smrt-profiles": "^0.51.31",
|
|
48
|
+
"@happyvertical/smrt-svelte": "^0.51.31",
|
|
49
|
+
"@happyvertical/smrt-tenancy": "^0.51.31",
|
|
50
|
+
"@happyvertical/smrt-ui": "^0.51.31",
|
|
51
|
+
"@happyvertical/smrt-users": "^0.51.31",
|
|
52
|
+
"@happyvertical/smrt-web": "^0.51.31",
|
|
53
53
|
"@happyvertical/sql": "^0.89.12",
|
|
54
54
|
"@modelcontextprotocol/server": "^2.0.0"
|
|
55
55
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
3
5
|
import { initializeDeployedApplicationRuntime } from '@happyvertical/smrt-app-runtime';
|
|
4
6
|
import {
|
|
5
7
|
loadConfig,
|
|
@@ -15,6 +17,18 @@ if (configured.profile === 'local') {
|
|
|
15
17
|
}
|
|
16
18
|
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is required.');
|
|
17
19
|
|
|
20
|
+
// Register this application's own @smrt() objects (and the consumed packages'
|
|
21
|
+
// objects) before any runner resolves a job's objectType. `pnpm build`
|
|
22
|
+
// compiles the generated registration into this module; the web server's
|
|
23
|
+
// bundle is not importable from a separate Node process.
|
|
24
|
+
const registration = new URL('../.smrt/runtime/register.js', import.meta.url);
|
|
25
|
+
if (!existsSync(fileURLToPath(registration))) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
'Missing .smrt/runtime/register.js: run pnpm build before starting a worker.',
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
await import(registration.href);
|
|
31
|
+
|
|
18
32
|
const runtime = await initializeDeployedApplicationRuntime({
|
|
19
33
|
profile: configured.profile,
|
|
20
34
|
providers: {
|