@suluk/platform 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/generate.ts +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suluk/platform",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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/generate.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * testable. Stops short of `provision apply` — that's a live infra op the operator triggers.
6
6
  */
7
7
  import { type PlatformManifest, type Platform, isPlatform } from "./manifest";
8
- import { liftSystemBrand } from "./resolve";
9
8
  import { planPlatform, mergePackageJson, mergeWranglerToml, mergeGitignore, type PlatformPlan } from "./plan";
10
9
 
11
10
  export interface GenerateOptions {
@@ -29,8 +28,10 @@ export interface GenerateResult {
29
28
  export async function generatePlatform(input: PlatformManifest | Platform, opts: GenerateOptions): Promise<GenerateResult> {
30
29
  const log = opts.log ?? (() => {});
31
30
  const read = opts.read ?? (async () => null);
32
- const manifest = isPlatform(input) ? liftSystemBrand(input) : input;
33
- const plan = planPlatform(manifest);
31
+ // pass the ORIGINAL input to planPlatform — it normalizes AND extracts `system.wire`. (Lowering to a legacy manifest here
32
+ // would DROP the composition wires, since a lowered manifest carries no `wire`.)
33
+ const name = isPlatform(input) ? input.brand.name : input.name;
34
+ const plan = planPlatform(input);
34
35
  const written: string[] = [];
35
36
 
36
37
  // 1) the scaffold CONFIG first — so `shadcn add` has a package.json to install into + a components.json to resolve
@@ -78,6 +79,6 @@ export async function generatePlatform(input: PlatformManifest | Platform, opts:
78
79
  await opts.write("provision.config.ts", plan.provisionConfig);
79
80
  written.push("src/index.ts", "provision.config.ts");
80
81
 
81
- log(`✓ generated ${manifest.name}: ${plan.services.length} services. Next: bun install && suluk-provision apply`);
82
+ log(`✓ generated ${name}: ${plan.services.length} services. Next: bun install && suluk-provision apply`);
82
83
  return { plan, added, written };
83
84
  }