@suluk/platform 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/catalog.ts +2 -0
- package/test/plan.test.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suluk/platform",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The platform generator (C051): write one `definePlatform` manifest → it plans the shadcn-registry adds, generates the wired Hono entry, and merges each module's provision fragment into a single provision.config. The manifest compiles to a shadcn-add list + a C047 provision.config; the generator runs the adds + `@suluk/provision`. Turns the Suluk backend registry into a one-command platform. CANDIDATE tooling.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
package/src/catalog.ts
CHANGED
|
@@ -25,6 +25,8 @@ export const CATALOG: Record<string, CatalogEntry> = {
|
|
|
25
25
|
keys: { mount: { kind: "route", path: "/keys", symbol: "keysRoutes", from: "./routes/keys" }, provision: { symbol: "keysProvision", from: "./src/provision/keys" } },
|
|
26
26
|
billing: { mount: { kind: "route", path: "/billing", symbol: "billingRoutes", from: "./routes/billing" }, provision: { symbol: "billingProvision", from: "./src/provision/billing" } },
|
|
27
27
|
cost: { mount: { kind: "route", path: "/cost", symbol: "costRoutes", from: "./routes/cost" }, provision: { symbol: "costProvision", from: "./src/provision/cost" } },
|
|
28
|
+
erasure: { mount: { kind: "route", path: "/erasure", symbol: "erasureRoutes", from: "./routes/erasure" }, provision: { symbol: "erasureProvision", from: "./src/provision/erasure" } },
|
|
29
|
+
email: { mount: { kind: "route", path: "/email", symbol: "emailRoutes", from: "./routes/email" } }, // stateless binding — no provision fragment (C052)
|
|
28
30
|
logs: { mount: { kind: "route", path: "/logs", symbol: "logsRoutes", from: "./routes/logs" }, provision: { symbol: "logsProvision", from: "./src/provision/logs" } },
|
|
29
31
|
// dev/CI tooling — pulled in as files, no runtime mount, no provision fragment.
|
|
30
32
|
journeys: { mount: { kind: "dev" } },
|
package/test/plan.test.ts
CHANGED
|
@@ -47,6 +47,23 @@ describe("cost (route + provision) + dev modules (journeys/audit — files only)
|
|
|
47
47
|
expect(plan.provisionConfig).toContain("mergeProvision([authProvision, creditsProvision, costProvision, logsProvision])");
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
test("erasure mounts an /erasure route and contributes a provision fragment", () => {
|
|
51
|
+
const p = planPlatform(definePlatform({ name: "e", registry: "acme/reg", services: ["auth", "erasure"] }));
|
|
52
|
+
expect(p.entry).toContain('import { erasureRoutes } from "./routes/erasure";');
|
|
53
|
+
expect(p.entry).toContain('app.route("/erasure", erasureRoutes());');
|
|
54
|
+
expect(p.provisionConfig).toContain('import { erasureProvision } from "./src/provision/erasure";');
|
|
55
|
+
expect(p.provisionConfig).toContain("mergeProvision([authProvision, erasureProvision])");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("email mounts an /email route but contributes NO provision fragment (stateless binding)", () => {
|
|
59
|
+
const p = planPlatform(definePlatform({ name: "m", registry: "acme/reg", services: ["auth", "email", "credits"] }));
|
|
60
|
+
expect(p.entry).toContain('import { emailRoutes } from "./routes/email";');
|
|
61
|
+
expect(p.entry).toContain('app.route("/email", emailRoutes());');
|
|
62
|
+
// email has no provision fragment, so the merge is just auth + credits.
|
|
63
|
+
expect(p.provisionConfig).not.toContain("emailProvision");
|
|
64
|
+
expect(p.provisionConfig).toContain("mergeProvision([authProvision, creditsProvision])");
|
|
65
|
+
});
|
|
66
|
+
|
|
50
67
|
test("dev modules add shadcn refs but NO entry mount and NO provision fragment", () => {
|
|
51
68
|
expect(plan.adds).toContain("acme/reg/journeys");
|
|
52
69
|
expect(plan.adds).toContain("acme/reg/audit");
|