@happyvertical/smrt-core 0.49.5 → 0.49.6
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/README.md +49 -0
- package/dist/consumer-plugin/index.d.ts +19 -4
- package/dist/consumer-plugin/index.d.ts.map +1 -1
- package/dist/consumer-plugin/index.js +204 -6
- package/dist/consumer-plugin/index.js.map +1 -1
- package/dist/manifest/static-manifest.d.ts.map +1 -1
- package/dist/manifest/static-manifest.js +13 -7
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest/store.js.map +1 -1
- package/dist/manifest.json +13 -7
- package/dist/scanner/manifest-generator.d.ts +39 -0
- package/dist/scanner/manifest-generator.d.ts.map +1 -1
- package/dist/scanner/manifest-generator.js +79 -12
- package/dist/scanner/manifest-generator.js.map +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/vite-plugin/changes-route.d.ts.map +1 -1
- package/dist/vite-plugin/changes-route.js +4 -3
- package/dist/vite-plugin/changes-route.js.map +1 -1
- package/dist/vite-plugin/dev-plane-route.d.ts +2 -0
- package/dist/vite-plugin/dev-plane-route.d.ts.map +1 -1
- package/dist/vite-plugin/dev-plane-route.js +8 -5
- package/dist/vite-plugin/dev-plane-route.js.map +1 -1
- package/dist/vite-plugin/events-route.d.ts.map +1 -1
- package/dist/vite-plugin/events-route.js +4 -3
- package/dist/vite-plugin/events-route.js.map +1 -1
- package/dist/vite-plugin/index.d.ts.map +1 -1
- package/dist/vite-plugin/index.js +25 -40
- package/dist/vite-plugin/index.js.map +1 -1
- package/dist/vite-plugin/resources-route.d.ts +6 -0
- package/dist/vite-plugin/resources-route.d.ts.map +1 -1
- package/dist/vite-plugin/resources-route.js +30 -7
- package/dist/vite-plugin/resources-route.js.map +1 -1
- package/dist/vite-plugin/sveltekit-config-import.d.ts +19 -0
- package/dist/vite-plugin/sveltekit-config-import.d.ts.map +1 -0
- package/dist/vite-plugin/sveltekit-config-import.js +36 -0
- package/dist/vite-plugin/sveltekit-config-import.js.map +1 -0
- package/dist/vite-plugin/sveltekit-generator.d.ts +33 -2
- package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -1
- package/dist/vite-plugin/sveltekit-generator.js +181 -65
- package/dist/vite-plugin/sveltekit-generator.js.map +1 -1
- package/dist/vite-plugin/sveltekit-path.d.ts +8 -0
- package/dist/vite-plugin/sveltekit-path.d.ts.map +1 -0
- package/dist/vite-plugin/sveltekit-path.js +25 -0
- package/dist/vite-plugin/sveltekit-path.js.map +1 -0
- package/dist/vite-plugin/sveltekit-route-coordinator.d.ts +67 -0
- package/dist/vite-plugin/sveltekit-route-coordinator.d.ts.map +1 -0
- package/dist/vite-plugin/sveltekit-route-coordinator.js +321 -0
- package/dist/vite-plugin/sveltekit-route-coordinator.js.map +1 -0
- package/dist/vite-plugin/sync-apply-route.d.ts +1 -1
- package/dist/vite-plugin/sync-apply-route.d.ts.map +1 -1
- package/dist/vite-plugin/sync-apply-route.js +4 -3
- package/dist/vite-plugin/sync-apply-route.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AUTO_GENERATED_ROUTE_HEADER } from "./route-header.js";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveSvelteKitConfigImport } from "./sveltekit-config-import.js";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
5
|
import { join } from "node:path";
|
|
5
6
|
import { pathToFileURL } from "node:url";
|
|
@@ -100,6 +101,28 @@ function consumerHasSmrtUsers(projectRoot) {
|
|
|
100
101
|
return false;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
104
|
+
/** Whether this invocation will own the `_resources` output file. */
|
|
105
|
+
function willGenerateResourcesRoute(projectRoot, options) {
|
|
106
|
+
if (options.resourcesRoute?.enabled === false || !consumerHasSmrtUsers(projectRoot)) return false;
|
|
107
|
+
const routeDir = join(projectRoot, options.routesDir, "_resources");
|
|
108
|
+
for (const name of ["+server.ts", "+server.js"]) {
|
|
109
|
+
const file = join(routeDir, name);
|
|
110
|
+
if (!existsSync(file)) continue;
|
|
111
|
+
if (!readFileSync(file, "utf-8").startsWith("// Auto-generated by @smrt/core vite plugin")) return false;
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
/** Whether `_resources` is occupied by its generated utility or a preserved
|
|
116
|
+
* handwritten SvelteKit server module. This is used only by route collision
|
|
117
|
+
* preflight: the emitter remains file-aware and never overwrites handwriting. */
|
|
118
|
+
function reservesResourcesRoute(projectRoot, options) {
|
|
119
|
+
if (willGenerateResourcesRoute(projectRoot, options)) return true;
|
|
120
|
+
const routeDir = join(projectRoot, options.routesDir, "_resources");
|
|
121
|
+
return ["+server.ts", "+server.js"].some((name) => {
|
|
122
|
+
const file = join(routeDir, name);
|
|
123
|
+
return existsSync(file) && !readFileSync(file, "utf-8").startsWith("// Auto-generated by @smrt/core vite plugin");
|
|
124
|
+
});
|
|
125
|
+
}
|
|
103
126
|
/**
|
|
104
127
|
* Generate the `_resources/+server.ts` route. Returns true when a route was
|
|
105
128
|
* written. Disabled with `sveltekit: { resourcesRoute: { enabled: false } }`;
|
|
@@ -121,11 +144,11 @@ function generateResourcesRoute(projectRoot, options) {
|
|
|
121
144
|
return false;
|
|
122
145
|
}
|
|
123
146
|
if (!existsSync(routeDir)) mkdirSync(routeDir, { recursive: true });
|
|
124
|
-
writeFileSync(filePath, generateResourcesRouteTemplate(options), "utf-8");
|
|
147
|
+
writeFileSync(filePath, generateResourcesRouteTemplate(resolveSvelteKitConfigImport(projectRoot, routeDir, options), options), "utf-8");
|
|
125
148
|
console.log(`[smrt] Generated: ${filePath}`);
|
|
126
149
|
return true;
|
|
127
150
|
}
|
|
128
|
-
function generateResourcesRouteTemplate(options) {
|
|
151
|
+
function generateResourcesRouteTemplate(configImport, options) {
|
|
129
152
|
return `${AUTO_GENERATED_ROUTE_HEADER}
|
|
130
153
|
// DO NOT EDIT - changes will be overwritten
|
|
131
154
|
//
|
|
@@ -138,17 +161,17 @@ function generateResourcesRouteTemplate(options) {
|
|
|
138
161
|
import { createResourceListHandler } from '@happyvertical/smrt-users/sveltekit';
|
|
139
162
|
// Side effect: registers @smrt() classes in ObjectRegistry before the
|
|
140
163
|
// handler walks it (mirrors the generated CRUD/changes/events routes'
|
|
141
|
-
//
|
|
142
|
-
import '$
|
|
164
|
+
// configured SMRT config import).
|
|
165
|
+
import '${configImport}';
|
|
143
166
|
|
|
144
167
|
export const GET = createResourceListHandler({
|
|
145
168
|
ensureRegistry: async () => {
|
|
146
|
-
await import('$
|
|
169
|
+
await import('${configImport}');
|
|
147
170
|
},${options.kebabRoutes ? "\n kebabRoutes: true," : ""}
|
|
148
171
|
});
|
|
149
172
|
`;
|
|
150
173
|
}
|
|
151
174
|
//#endregion
|
|
152
|
-
export { consumerHasSmrtUsers, generateResourcesRoute };
|
|
175
|
+
export { consumerHasSmrtUsers, generateResourcesRoute, reservesResourcesRoute, willGenerateResourcesRoute };
|
|
153
176
|
|
|
154
177
|
//# sourceMappingURL=resources-route.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources-route.js","names":[],"sources":["../../src/vite-plugin/resources-route.ts"],"sourcesContent":["/**\n * SvelteKit `_resources` route generation — CLI discovery endpoint (#2663;\n * parent epic #2655).\n *\n * Emits `{routesDir}/_resources/+server.ts`: `GET /api/_resources`, the\n * endpoint the distributable CLI (`@happyvertical/smrt-app-cli`) reads to\n * learn which resources and commands it can invoke. Every other generated\n * route lives in `sveltekit-generator.ts` or a sibling emitter; this one is\n * kept in its own module for the same reason `changes-route.ts` and\n * `events-route.ts` are — a one-line registration hook in the shared\n * generator file.\n *\n * ## The dependency constraint\n *\n * The handler this route delegates to, `createResourceListHandler`, lives in\n * `@happyvertical/smrt-users` — and `smrt-users` depends on `smrt-core`, not\n * the reverse, so core cannot import it directly. That is not a problem for\n * *emitting* the import: the generated file is written into the consumer's\n * own `src/routes/`, where `@happyvertical/smrt-users` resolves through the\n * consumer's own dependency graph, exactly like the `@happyvertical/smrt-tenancy`\n * import `sveltekit-generator.ts`'s `generateTenantContextHelper` already\n * emits into tenant-scoped routes (see the comment above that function). The\n * only question is *when* it is safe to emit — a consumer that never took a\n * dependency on `smrt-users` must never receive a route whose import cannot\n * resolve, or a working build turns red.\n *\n * ## Detection mechanism\n *\n * Unlike the tenancy guard — which reads a semantic signal already present in\n * the manifest (whether any object is `@TenantScoped`, which itself implies\n * the app depends on `smrt-tenancy`) — nothing in the manifest indicates\n * whether a consumer has taken on `smrt-users`. Objects don't declare an\n * auth dependency; the app does, at the package level.\n *\n * So this route uses a **resolvable-dependency check**: does the exact\n * subpath the generated file imports — `@happyvertical/smrt-users/sveltekit`\n * — resolve from the consumer's `projectRoot`, via a `createRequire` rooted\n * at the consumer's own `package.json`? That is stronger than reading\n * `package.json`'s `dependencies` block (which can list a package that was\n * never installed) and, unlike a single hardcoded\n * `node_modules/@happyvertical/smrt-users/package.json` path, it uses\n * Node's real module resolution — so it also finds the package when a\n * workspace hoists shared dependencies to an ancestor `node_modules` (npm/\n * yarn workspaces, or pnpm with `node-linker=hoisted`) rather than\n * installing them directly under the consumer's own `projectRoot`.\n * Resolving the `/sveltekit` subpath specifically, rather than the\n * package's bare `package.json`, matters too: `smrt-users`'s `exports` map\n * does not list `./package.json`, so resolving that path would throw\n * `ERR_PACKAGE_PATH_NOT_EXPORTED` even when the package is genuinely\n * installed — resolving the subpath the route actually imports sidesteps\n * that and checks precisely the thing that must succeed at build time.\n *\n * An explicit `sveltekit: { resourcesRoute: { enabled: false } }` escape\n * hatch is also available, matching `changesRoute`/`eventsRoute`, for a\n * consumer that has `smrt-users` installed but wants to keep hand-writing\n * (or omit) `_resources`.\n *\n * ## Preserving a hand-written route\n *\n * Every consumer today hand-writes this route (the reference implementation\n * in the issue). `clearGeneratedRouteFiles` (in `sveltekit-generator.ts`)\n * already only deletes `+server.ts` files that start with\n * {@link AUTO_GENERATED_ROUTE_HEADER}, so a hand-written `_resources` route —\n * which never carries that header — survives the pre-generation sweep\n * untouched. This emitter additionally checks `existsSync` on the target\n * path before writing: by the time it runs, anything still there is\n * necessarily hand-written (a generator-owned copy would already have been\n * swept), so its mere presence is sufficient to skip generation and leave it\n * alone.\n *\n * Once a consumer's `_resources` route IS generator-owned (no hand-written\n * file present, `smrt-users` resolvable), its path is generator-owned for\n * `.gitignore` purposes too — it is included in `generatedRoutePaths` like\n * any other emitted route, so `updateGitignore` puts it in the managed\n * block. A project that migrated from a hand-written route to a fully\n * generated one may still carry a stale `# Application-owned rule` comment\n * above the same literal path from before the migration; `updateGitignore`\n * only ever touches its own managed block, so that stale comment is left as\n * project history for the consumer to clean up — the same way any other\n * manual `.gitignore` edit outside the managed block is preserved.\n */\n\nimport { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { AUTO_GENERATED_ROUTE_HEADER } from './route-header.js';\nimport type { SvelteKitOptions } from './sveltekit-generator.js';\n\n/**\n * Whether `@happyvertical/smrt-users/sveltekit` — the exact subpath the\n * generated route imports — is resolvable from the consumer at\n * `projectRoot`. See the module doc for why this check (rather than reading\n * `package.json`'s declared `dependencies`, or checking one hardcoded\n * physical path) is the chosen signal.\n */\nexport function consumerHasSmrtUsers(projectRoot: string): boolean {\n try {\n const consumerRequire = createRequire(\n pathToFileURL(join(projectRoot, 'package.json')).href,\n );\n consumerRequire.resolve('@happyvertical/smrt-users/sveltekit');\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Generate the `_resources/+server.ts` route. Returns true when a route was\n * written. Disabled with `sveltekit: { resourcesRoute: { enabled: false } }`;\n * skipped (with a log line) when `@happyvertical/smrt-users` is not\n * resolvable from the consumer, or when a hand-written route already\n * occupies the path.\n */\nexport function generateResourcesRoute(\n projectRoot: string,\n options: SvelteKitOptions,\n): boolean {\n if (options.resourcesRoute?.enabled === false) {\n return false;\n }\n\n if (!consumerHasSmrtUsers(projectRoot)) {\n console.log(\n '[smrt] Skipping _resources route - @happyvertical/smrt-users is not ' +\n 'resolvable; createResourceListHandler would not resolve in the ' +\n 'consumer build',\n );\n return false;\n }\n\n const routeDir = join(projectRoot, options.routesDir, '_resources');\n const filePath = join(routeDir, '+server.ts');\n\n // By this point in generation, clearGeneratedRouteFiles has already swept\n // any previously generator-owned copy at this path — anything still here\n // is necessarily hand-written. Preserve it rather than clobbering a\n // consumer's customized discovery route. Check every server-module\n // extension SvelteKit resolves by default (`.js` and `.ts` — see\n // https://svelte.dev/docs/kit/configuration#moduleExtensions), not only\n // `.ts`: a hand-written `+server.js` is invisible to a `.ts`-only check,\n // so the generator would write `+server.ts` alongside it and SvelteKit\n // would then refuse the route with \"Multiple endpoint files found\".\n const existingServerFile = ['+server.ts', '+server.js'].find((name) =>\n existsSync(join(routeDir, name)),\n );\n if (existingServerFile) {\n console.log(\n `[smrt] Preserving hand-written _resources route (${existingServerFile}, not generator-owned)`,\n );\n return false;\n }\n\n if (!existsSync(routeDir)) {\n mkdirSync(routeDir, { recursive: true });\n }\n writeFileSync(filePath, generateResourcesRouteTemplate(options), 'utf-8');\n console.log(`[smrt] Generated: ${filePath}`);\n return true;\n}\n\nfunction generateResourcesRouteTemplate(options: SvelteKitOptions): string {\n const kebabRoutesOption = options.kebabRoutes ? '\\n kebabRoutes: true,' : '';\n\n return `${AUTO_GENERATED_ROUTE_HEADER}\n// DO NOT EDIT - changes will be overwritten\n//\n// GET /api/_resources — CLI discovery endpoint (#2663). Returns the auth-aware\n// list of resources and commands the distributable CLI\n// (@happyvertical/smrt-app-cli) can invoke, derived from ObjectRegistry by\n// createResourceListHandler. Subsumes the route every consumer previously\n// hand-wrote (see the issue for the reference implementation this replaces).\n\nimport { createResourceListHandler } from '@happyvertical/smrt-users/sveltekit';\n// Side effect: registers @smrt() classes in ObjectRegistry before the\n// handler walks it (mirrors the generated CRUD/changes/events routes'\n// $lib/server/smrt import).\nimport '$lib/server/smrt';\n\nexport const GET = createResourceListHandler({\n ensureRegistry: async () => {\n await import('$lib/server/smrt');\n },${kebabRoutesOption}\n});\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,SAAgB,qBAAqB,aAA8B;CACjE,IAAI;EAIF,cAFE,cAAc,KAAK,aAAa,cAAc,CAAC,CAAC,CAAC,IAEnD,CAAA,CAAgB,QAAQ,qCAAqC;EAC7D,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,SAAgB,uBACd,aACA,SACS;CACT,IAAI,QAAQ,gBAAgB,YAAY,OACtC,OAAO;CAGT,IAAI,CAAC,qBAAqB,WAAW,GAAG;EACtC,QAAQ,IACN,mJAGF;EACA,OAAO;CACT;CAEA,MAAM,WAAW,KAAK,aAAa,QAAQ,WAAW,YAAY;CAClE,MAAM,WAAW,KAAK,UAAU,YAAY;CAW5C,MAAM,qBAAqB,CAAC,cAAc,YAAY,CAAC,CAAC,MAAM,SAC5D,WAAW,KAAK,UAAU,IAAI,CAAC,CACjC;CACA,IAAI,oBAAoB;EACtB,QAAQ,IACN,oDAAoD,mBAAmB,uBACzE;EACA,OAAO;CACT;CAEA,IAAI,CAAC,WAAW,QAAQ,GACtB,UAAU,UAAU,EAAE,WAAW,KAAK,CAAC;CAEzC,cAAc,UAAU,+BAA+B,OAAO,GAAG,OAAO;CACxE,QAAQ,IAAI,qBAAqB,UAAU;CAC3C,OAAO;AACT;AAEA,SAAS,+BAA+B,SAAmC;CAGzE,OAAO,GAAG,4BAA4B;;;;;;;;;;;;;;;;;;MAFZ,QAAQ,cAAc,2BAA2B,GAoBrD;;;AAGxB"}
|
|
1
|
+
{"version":3,"file":"resources-route.js","names":[],"sources":["../../src/vite-plugin/resources-route.ts"],"sourcesContent":["/**\n * SvelteKit `_resources` route generation — CLI discovery endpoint (#2663;\n * parent epic #2655).\n *\n * Emits `{routesDir}/_resources/+server.ts`: `GET /api/_resources`, the\n * endpoint the distributable CLI (`@happyvertical/smrt-app-cli`) reads to\n * learn which resources and commands it can invoke. Every other generated\n * route lives in `sveltekit-generator.ts` or a sibling emitter; this one is\n * kept in its own module for the same reason `changes-route.ts` and\n * `events-route.ts` are — a one-line registration hook in the shared\n * generator file.\n *\n * ## The dependency constraint\n *\n * The handler this route delegates to, `createResourceListHandler`, lives in\n * `@happyvertical/smrt-users` — and `smrt-users` depends on `smrt-core`, not\n * the reverse, so core cannot import it directly. That is not a problem for\n * *emitting* the import: the generated file is written into the consumer's\n * own `src/routes/`, where `@happyvertical/smrt-users` resolves through the\n * consumer's own dependency graph, exactly like the `@happyvertical/smrt-tenancy`\n * import `sveltekit-generator.ts`'s `generateTenantContextHelper` already\n * emits into tenant-scoped routes (see the comment above that function). The\n * only question is *when* it is safe to emit — a consumer that never took a\n * dependency on `smrt-users` must never receive a route whose import cannot\n * resolve, or a working build turns red.\n *\n * ## Detection mechanism\n *\n * Unlike the tenancy guard — which reads a semantic signal already present in\n * the manifest (whether any object is `@TenantScoped`, which itself implies\n * the app depends on `smrt-tenancy`) — nothing in the manifest indicates\n * whether a consumer has taken on `smrt-users`. Objects don't declare an\n * auth dependency; the app does, at the package level.\n *\n * So this route uses a **resolvable-dependency check**: does the exact\n * subpath the generated file imports — `@happyvertical/smrt-users/sveltekit`\n * — resolve from the consumer's `projectRoot`, via a `createRequire` rooted\n * at the consumer's own `package.json`? That is stronger than reading\n * `package.json`'s `dependencies` block (which can list a package that was\n * never installed) and, unlike a single hardcoded\n * `node_modules/@happyvertical/smrt-users/package.json` path, it uses\n * Node's real module resolution — so it also finds the package when a\n * workspace hoists shared dependencies to an ancestor `node_modules` (npm/\n * yarn workspaces, or pnpm with `node-linker=hoisted`) rather than\n * installing them directly under the consumer's own `projectRoot`.\n * Resolving the `/sveltekit` subpath specifically, rather than the\n * package's bare `package.json`, matters too: `smrt-users`'s `exports` map\n * does not list `./package.json`, so resolving that path would throw\n * `ERR_PACKAGE_PATH_NOT_EXPORTED` even when the package is genuinely\n * installed — resolving the subpath the route actually imports sidesteps\n * that and checks precisely the thing that must succeed at build time.\n *\n * An explicit `sveltekit: { resourcesRoute: { enabled: false } }` escape\n * hatch is also available, matching `changesRoute`/`eventsRoute`, for a\n * consumer that has `smrt-users` installed but wants to keep hand-writing\n * (or omit) `_resources`.\n *\n * ## Preserving a hand-written route\n *\n * Every consumer today hand-writes this route (the reference implementation\n * in the issue). `clearGeneratedRouteFiles` (in `sveltekit-generator.ts`)\n * already only deletes `+server.ts` files that start with\n * {@link AUTO_GENERATED_ROUTE_HEADER}, so a hand-written `_resources` route —\n * which never carries that header — survives the pre-generation sweep\n * untouched. This emitter additionally checks `existsSync` on the target\n * path before writing: by the time it runs, anything still there is\n * necessarily hand-written (a generator-owned copy would already have been\n * swept), so its mere presence is sufficient to skip generation and leave it\n * alone.\n *\n * Once a consumer's `_resources` route IS generator-owned (no hand-written\n * file present, `smrt-users` resolvable), its path is generator-owned for\n * `.gitignore` purposes too — it is included in `generatedRoutePaths` like\n * any other emitted route, so `updateGitignore` puts it in the managed\n * block. A project that migrated from a hand-written route to a fully\n * generated one may still carry a stale `# Application-owned rule` comment\n * above the same literal path from before the migration; `updateGitignore`\n * only ever touches its own managed block, so that stale comment is left as\n * project history for the consumer to clean up — the same way any other\n * manual `.gitignore` edit outside the managed block is preserved.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { AUTO_GENERATED_ROUTE_HEADER } from './route-header.js';\nimport { resolveSvelteKitConfigImport } from './sveltekit-config-import.js';\nimport type { SvelteKitOptions } from './sveltekit-generator.js';\n\n/**\n * Whether `@happyvertical/smrt-users/sveltekit` — the exact subpath the\n * generated route imports — is resolvable from the consumer at\n * `projectRoot`. See the module doc for why this check (rather than reading\n * `package.json`'s declared `dependencies`, or checking one hardcoded\n * physical path) is the chosen signal.\n */\nexport function consumerHasSmrtUsers(projectRoot: string): boolean {\n try {\n const consumerRequire = createRequire(\n pathToFileURL(join(projectRoot, 'package.json')).href,\n );\n consumerRequire.resolve('@happyvertical/smrt-users/sveltekit');\n return true;\n } catch {\n return false;\n }\n}\n\n/** Whether this invocation will own the `_resources` output file. */\nexport function willGenerateResourcesRoute(\n projectRoot: string,\n options: SvelteKitOptions,\n): boolean {\n if (\n options.resourcesRoute?.enabled === false ||\n !consumerHasSmrtUsers(projectRoot)\n ) {\n return false;\n }\n const routeDir = join(projectRoot, options.routesDir, '_resources');\n for (const name of ['+server.ts', '+server.js']) {\n const file = join(routeDir, name);\n if (!existsSync(file)) continue;\n if (!readFileSync(file, 'utf-8').startsWith(AUTO_GENERATED_ROUTE_HEADER)) {\n return false;\n }\n }\n return true;\n}\n\n/** Whether `_resources` is occupied by its generated utility or a preserved\n * handwritten SvelteKit server module. This is used only by route collision\n * preflight: the emitter remains file-aware and never overwrites handwriting. */\nexport function reservesResourcesRoute(\n projectRoot: string,\n options: SvelteKitOptions,\n): boolean {\n if (willGenerateResourcesRoute(projectRoot, options)) return true;\n const routeDir = join(projectRoot, options.routesDir, '_resources');\n return ['+server.ts', '+server.js'].some((name) => {\n const file = join(routeDir, name);\n return (\n existsSync(file) &&\n !readFileSync(file, 'utf-8').startsWith(AUTO_GENERATED_ROUTE_HEADER)\n );\n });\n}\n\n/**\n * Generate the `_resources/+server.ts` route. Returns true when a route was\n * written. Disabled with `sveltekit: { resourcesRoute: { enabled: false } }`;\n * skipped (with a log line) when `@happyvertical/smrt-users` is not\n * resolvable from the consumer, or when a hand-written route already\n * occupies the path.\n */\nexport function generateResourcesRoute(\n projectRoot: string,\n options: SvelteKitOptions,\n): boolean {\n if (options.resourcesRoute?.enabled === false) {\n return false;\n }\n\n if (!consumerHasSmrtUsers(projectRoot)) {\n console.log(\n '[smrt] Skipping _resources route - @happyvertical/smrt-users is not ' +\n 'resolvable; createResourceListHandler would not resolve in the ' +\n 'consumer build',\n );\n return false;\n }\n\n const routeDir = join(projectRoot, options.routesDir, '_resources');\n const filePath = join(routeDir, '+server.ts');\n\n // By this point in generation, clearGeneratedRouteFiles has already swept\n // any previously generator-owned copy at this path — anything still here\n // is necessarily hand-written. Preserve it rather than clobbering a\n // consumer's customized discovery route. Check every server-module\n // extension SvelteKit resolves by default (`.js` and `.ts` — see\n // https://svelte.dev/docs/kit/configuration#moduleExtensions), not only\n // `.ts`: a hand-written `+server.js` is invisible to a `.ts`-only check,\n // so the generator would write `+server.ts` alongside it and SvelteKit\n // would then refuse the route with \"Multiple endpoint files found\".\n const existingServerFile = ['+server.ts', '+server.js'].find((name) =>\n existsSync(join(routeDir, name)),\n );\n if (existingServerFile) {\n console.log(\n `[smrt] Preserving hand-written _resources route (${existingServerFile}, not generator-owned)`,\n );\n return false;\n }\n\n if (!existsSync(routeDir)) {\n mkdirSync(routeDir, { recursive: true });\n }\n writeFileSync(\n filePath,\n generateResourcesRouteTemplate(\n resolveSvelteKitConfigImport(projectRoot, routeDir, options),\n options,\n ),\n 'utf-8',\n );\n console.log(`[smrt] Generated: ${filePath}`);\n return true;\n}\n\nfunction generateResourcesRouteTemplate(\n configImport: string,\n options: SvelteKitOptions,\n): string {\n const kebabRoutesOption = options.kebabRoutes ? '\\n kebabRoutes: true,' : '';\n\n return `${AUTO_GENERATED_ROUTE_HEADER}\n// DO NOT EDIT - changes will be overwritten\n//\n// GET /api/_resources — CLI discovery endpoint (#2663). Returns the auth-aware\n// list of resources and commands the distributable CLI\n// (@happyvertical/smrt-app-cli) can invoke, derived from ObjectRegistry by\n// createResourceListHandler. Subsumes the route every consumer previously\n// hand-wrote (see the issue for the reference implementation this replaces).\n\nimport { createResourceListHandler } from '@happyvertical/smrt-users/sveltekit';\n// Side effect: registers @smrt() classes in ObjectRegistry before the\n// handler walks it (mirrors the generated CRUD/changes/events routes'\n// configured SMRT config import).\nimport '${configImport}';\n\nexport const GET = createResourceListHandler({\n ensureRegistry: async () => {\n await import('${configImport}');\n },${kebabRoutesOption}\n});\n`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGA,SAAgB,qBAAqB,aAA8B;CACjE,IAAI;EAIF,cAFE,cAAc,KAAK,aAAa,cAAc,CAAC,CAAC,CAAC,IAEnD,CAAA,CAAgB,QAAQ,qCAAqC;EAC7D,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,2BACd,aACA,SACS;CACT,IACE,QAAQ,gBAAgB,YAAY,SACpC,CAAC,qBAAqB,WAAW,GAEjC,OAAO;CAET,MAAM,WAAW,KAAK,aAAa,QAAQ,WAAW,YAAY;CAClE,KAAK,MAAM,QAAQ,CAAC,cAAc,YAAY,GAAG;EAC/C,MAAM,OAAO,KAAK,UAAU,IAAI;EAChC,IAAI,CAAC,WAAW,IAAI,GAAG;EACvB,IAAI,CAAC,aAAa,MAAM,OAAO,CAAC,CAAC,WAAA,6CAAsC,GACrE,OAAO;CAEX;CACA,OAAO;AACT;;;;AAKA,SAAgB,uBACd,aACA,SACS;CACT,IAAI,2BAA2B,aAAa,OAAO,GAAG,OAAO;CAC7D,MAAM,WAAW,KAAK,aAAa,QAAQ,WAAW,YAAY;CAClE,OAAO,CAAC,cAAc,YAAY,CAAC,CAAC,MAAM,SAAS;EACjD,MAAM,OAAO,KAAK,UAAU,IAAI;EAChC,OACE,WAAW,IAAI,KACf,CAAC,aAAa,MAAM,OAAO,CAAC,CAAC,WAAA,6CAAsC;CAEvE,CAAC;AACH;;;;;;;;AASA,SAAgB,uBACd,aACA,SACS;CACT,IAAI,QAAQ,gBAAgB,YAAY,OACtC,OAAO;CAGT,IAAI,CAAC,qBAAqB,WAAW,GAAG;EACtC,QAAQ,IACN,mJAGF;EACA,OAAO;CACT;CAEA,MAAM,WAAW,KAAK,aAAa,QAAQ,WAAW,YAAY;CAClE,MAAM,WAAW,KAAK,UAAU,YAAY;CAW5C,MAAM,qBAAqB,CAAC,cAAc,YAAY,CAAC,CAAC,MAAM,SAC5D,WAAW,KAAK,UAAU,IAAI,CAAC,CACjC;CACA,IAAI,oBAAoB;EACtB,QAAQ,IACN,oDAAoD,mBAAmB,uBACzE;EACA,OAAO;CACT;CAEA,IAAI,CAAC,WAAW,QAAQ,GACtB,UAAU,UAAU,EAAE,WAAW,KAAK,CAAC;CAEzC,cACE,UACA,+BACE,6BAA6B,aAAa,UAAU,OAAO,GAC3D,OACF,GACA,OACF;CACA,QAAQ,IAAI,qBAAqB,UAAU;CAC3C,OAAO;AACT;AAEA,SAAS,+BACP,cACA,SACQ;CAGR,OAAO,GAAG,4BAA4B;;;;;;;;;;;;;UAa9B,aAAa;;;;oBAIH,aAAa;MAnBL,QAAQ,cAAc,2BAA2B,GAoBrD;;;AAGxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the import specifier for the generated application's SMRT config.
|
|
3
|
+
*
|
|
4
|
+
* SvelteKit maps `src/lib` to `$lib`; preserve that concise public convention
|
|
5
|
+
* where possible. Configurations outside `src/lib` remain supported through a
|
|
6
|
+
* route-relative import so generated server routes do not assume an alias the
|
|
7
|
+
* consumer did not configure.
|
|
8
|
+
*/
|
|
9
|
+
export interface SvelteKitConfigImportOptions {
|
|
10
|
+
configPath?: string;
|
|
11
|
+
configFileName?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return an extensionless specifier because Vite resolves generated route
|
|
15
|
+
* imports through its source-module resolver. `routeDir` is the absolute
|
|
16
|
+
* directory which will contain the generated `+server.ts` file.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveSvelteKitConfigImport(projectRoot: string, routeDir: string, options: SvelteKitConfigImportOptions): string;
|
|
19
|
+
//# sourceMappingURL=sveltekit-config-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sveltekit-config-import.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/sveltekit-config-import.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAeD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,4BAA4B,GACpC,MAAM,CAYR"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { join, relative } from "node:path";
|
|
2
|
+
//#region src/vite-plugin/sveltekit-config-import.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the import specifier for the generated application's SMRT config.
|
|
5
|
+
*
|
|
6
|
+
* SvelteKit maps `src/lib` to `$lib`; preserve that concise public convention
|
|
7
|
+
* where possible. Configurations outside `src/lib` remain supported through a
|
|
8
|
+
* route-relative import so generated server routes do not assume an alias the
|
|
9
|
+
* consumer did not configure.
|
|
10
|
+
*/
|
|
11
|
+
var TYPESCRIPT_EXTENSION = /\.ts$/i;
|
|
12
|
+
function normalizePath(path) {
|
|
13
|
+
return path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
|
|
14
|
+
}
|
|
15
|
+
function moduleSpecifierPath(fileName) {
|
|
16
|
+
return fileName.replace(TYPESCRIPT_EXTENSION, "");
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Return an extensionless specifier because Vite resolves generated route
|
|
20
|
+
* imports through its source-module resolver. `routeDir` is the absolute
|
|
21
|
+
* directory which will contain the generated `+server.ts` file.
|
|
22
|
+
*/
|
|
23
|
+
function resolveSvelteKitConfigImport(projectRoot, routeDir, options) {
|
|
24
|
+
const configPath = normalizePath(options.configPath || "src/lib/server");
|
|
25
|
+
const configModule = moduleSpecifierPath(options.configFileName || "smrt.ts");
|
|
26
|
+
if (configPath === "src/lib" || configPath.startsWith("src/lib/")) {
|
|
27
|
+
const libPath = configPath.slice(7).replace(/^\//, "");
|
|
28
|
+
return libPath ? `$lib/${libPath}/${configModule}` : `$lib/${configModule}`;
|
|
29
|
+
}
|
|
30
|
+
const routeRelative = relative(routeDir, join(projectRoot, configPath, configModule)).replace(/\\/g, "/");
|
|
31
|
+
return routeRelative.startsWith(".") ? routeRelative : `./${routeRelative}`;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { resolveSvelteKitConfigImport };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=sveltekit-config-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sveltekit-config-import.js","names":[],"sources":["../../src/vite-plugin/sveltekit-config-import.ts"],"sourcesContent":["/**\n * Resolve the import specifier for the generated application's SMRT config.\n *\n * SvelteKit maps `src/lib` to `$lib`; preserve that concise public convention\n * where possible. Configurations outside `src/lib` remain supported through a\n * route-relative import so generated server routes do not assume an alias the\n * consumer did not configure.\n */\n\nimport { join, relative } from 'node:path';\n\nexport interface SvelteKitConfigImportOptions {\n configPath?: string;\n configFileName?: string;\n}\n\n// Generated config files have historically imported TypeScript files without\n// their `.ts` suffix. Keep every other supplied extension intact: it may carry\n// a consumer-selected module format (for example `.mts`).\nconst TYPESCRIPT_EXTENSION = /\\.ts$/i;\n\nfunction normalizePath(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/^\\.\\//, '').replace(/\\/+$/, '');\n}\n\nfunction moduleSpecifierPath(fileName: string): string {\n return fileName.replace(TYPESCRIPT_EXTENSION, '');\n}\n\n/**\n * Return an extensionless specifier because Vite resolves generated route\n * imports through its source-module resolver. `routeDir` is the absolute\n * directory which will contain the generated `+server.ts` file.\n */\nexport function resolveSvelteKitConfigImport(\n projectRoot: string,\n routeDir: string,\n options: SvelteKitConfigImportOptions,\n): string {\n const configPath = normalizePath(options.configPath || 'src/lib/server');\n const configModule = moduleSpecifierPath(options.configFileName || 'smrt.ts');\n\n if (configPath === 'src/lib' || configPath.startsWith('src/lib/')) {\n const libPath = configPath.slice('src/lib'.length).replace(/^\\//, '');\n return libPath ? `$lib/${libPath}/${configModule}` : `$lib/${configModule}`;\n }\n\n const configFile = join(projectRoot, configPath, configModule);\n const routeRelative = relative(routeDir, configFile).replace(/\\\\/g, '/');\n return routeRelative.startsWith('.') ? routeRelative : `./${routeRelative}`;\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAM,uBAAuB;AAE7B,SAAS,cAAc,MAAsB;CAC3C,OAAO,KAAK,QAAQ,OAAO,GAAG,CAAC,CAAC,QAAQ,SAAS,EAAE,CAAC,CAAC,QAAQ,QAAQ,EAAE;AACzE;AAEA,SAAS,oBAAoB,UAA0B;CACrD,OAAO,SAAS,QAAQ,sBAAsB,EAAE;AAClD;;;;;;AAOA,SAAgB,6BACd,aACA,UACA,SACQ;CACR,MAAM,aAAa,cAAc,QAAQ,cAAc,gBAAgB;CACvE,MAAM,eAAe,oBAAoB,QAAQ,kBAAkB,SAAS;CAE5E,IAAI,eAAe,aAAa,WAAW,WAAW,UAAU,GAAG;EACjE,MAAM,UAAU,WAAW,MAAM,CAAgB,CAAC,CAAC,QAAQ,OAAO,EAAE;EACpE,OAAO,UAAU,QAAQ,QAAQ,GAAG,iBAAiB,QAAQ;CAC/D;CAGA,MAAM,gBAAgB,SAAS,UADZ,KAAK,aAAa,YAAY,YACR,CAAU,CAAC,CAAC,QAAQ,OAAO,GAAG;CACvE,OAAO,cAAc,WAAW,GAAG,IAAI,gBAAgB,KAAK;AAC9D"}
|
|
@@ -8,6 +8,8 @@ export interface SvelteKitOptions {
|
|
|
8
8
|
objectsDir: string;
|
|
9
9
|
configPath?: string;
|
|
10
10
|
configFileName?: string;
|
|
11
|
+
/** Internal absolute consumer registration entrypoints for a coordinated host. */
|
|
12
|
+
consumerRegistrationPaths?: readonly string[];
|
|
11
13
|
/**
|
|
12
14
|
* Apply kebab-case to custom-method URL segments (e.g. `discoverFromUrl`
|
|
13
15
|
* becomes `/discover-from-url`). Opt-in for one minor; default flips in the
|
|
@@ -62,6 +64,8 @@ export interface SvelteKitOptions {
|
|
|
62
64
|
resourcesRoute?: {
|
|
63
65
|
enabled?: boolean;
|
|
64
66
|
};
|
|
67
|
+
/** Reject route paths owned by distinct selected identities before cleanup. */
|
|
68
|
+
rejectRouteCollisions?: boolean;
|
|
65
69
|
}
|
|
66
70
|
export interface ResolvedApiActionRouteConfig {
|
|
67
71
|
scope: 'item' | 'collection';
|
|
@@ -89,10 +93,37 @@ export declare function resolveApiActionRouteConfig(actionName: string, actionDe
|
|
|
89
93
|
}, apiConfig: unknown, routeOptions?: {
|
|
90
94
|
kebabRoutes?: boolean;
|
|
91
95
|
}, defaultScope?: 'item' | 'collection'): ResolvedApiActionRouteConfig;
|
|
96
|
+
/** Reject selected identities that would write the same endpoint file. */
|
|
97
|
+
export declare function assertNoCrossObjectRouteCollisions(projectRoot: string, manifest: SmartObjectManifest, options: SvelteKitOptions, exposureManifest: SmartObjectManifest, reservedRoutePaths?: ReadonlySet<string>): void;
|
|
92
98
|
/**
|
|
93
|
-
* Generates SvelteKit API routes from manifest
|
|
99
|
+
* Generates SvelteKit API routes from the selected route manifest.
|
|
100
|
+
* `semanticManifest` preserves the complete class inventory for authorization,
|
|
101
|
+
* STI ancestry, cache safety, and custom-action wireability when the route
|
|
102
|
+
* manifest is a deliberately selected output subset.
|
|
94
103
|
*/
|
|
95
|
-
export
|
|
104
|
+
export interface SvelteKitUtilityManifests {
|
|
105
|
+
sync: SmartObjectManifest;
|
|
106
|
+
changes: SmartObjectManifest;
|
|
107
|
+
events: SmartObjectManifest;
|
|
108
|
+
eventsSemantic: SmartObjectManifest;
|
|
109
|
+
/** Only the contribution that owns knowledge generation may reconcile it. */
|
|
110
|
+
clearKnowledgeRoute?: boolean;
|
|
111
|
+
/** Exact foreign producer outputs that this route root must neither clear nor overwrite. */
|
|
112
|
+
protectedRoutePaths?: ReadonlySet<string>;
|
|
113
|
+
/** Active foreign route roots that cleanup must not traverse through links. */
|
|
114
|
+
protectedRouteRoots?: ReadonlySet<string>;
|
|
115
|
+
}
|
|
116
|
+
/** Coordinator callbacks that run around validated generated-output mutation. */
|
|
117
|
+
export interface SvelteKitGenerationHooks {
|
|
118
|
+
beforeCleanup?: () => void | Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
export declare function generateSvelteKitRoutes(projectRoot: string, routeManifest: SmartObjectManifest, options: SvelteKitOptions, semanticManifest?: SmartObjectManifest, utilityManifests?: SvelteKitUtilityManifests, registrationManifest?: SmartObjectManifest, hooks?: SvelteKitGenerationHooks): Promise<void>;
|
|
121
|
+
/** Remove only SMRT header-owned SvelteKit handlers below one route root. */
|
|
122
|
+
export declare function clearGeneratedSvelteKitRouteFiles(routesRoot: string, excludedPaths?: ReadonlySet<string>, protectedRouteRoots?: ReadonlySet<string>, visitedRoots?: Set<string>): void;
|
|
123
|
+
/** Refresh the managed ignore block after an externally coordinated cleanup. */
|
|
124
|
+
export declare function reconcileSvelteKitRouteGitignore(projectRoot: string, routesDir: string): void;
|
|
125
|
+
/** Exact generated knowledge handler path for coordinator-owned cleanup. */
|
|
126
|
+
export declare function knowledgeRoutePath(projectRoot: string, options: SvelteKitOptions): string;
|
|
96
127
|
/**
|
|
97
128
|
* Partition an object's custom (non-CRUD) methods into the ones the API
|
|
98
129
|
* exposes and the ones it withholds, with a reason for each rejection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit-generator.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/sveltekit-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"sveltekit-generator.d.ts","sourceRoot":"","sources":["../../src/vite-plugin/sveltekit-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,KAAK,EAAE,qBAAqB,E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