@suluk/platform 0.3.0 → 0.3.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/plan.ts +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suluk/platform",
3
- "version": "0.3.0",
3
+ "version": "0.3.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/plan.ts CHANGED
@@ -239,14 +239,19 @@ function buildGitignore(): string {
239
239
  }
240
240
 
241
241
  /** Merge the generated .gitignore into an existing one — APPEND any missing entries (never skip-if-present, so an app's
242
- * minimal .gitignore can't leave `.env`/`.env.temp` UNIGNORED and risk committing secrets). Dedup, preserve app entries. */
242
+ * minimal .gitignore can't leave `.env.keys`/`.env.temp` UNIGNORED and risk committing the private key). Dedup, preserve app
243
+ * entries. ENCRYPTED-ENV TRANSITION: if the new baseline ignores `.env.keys` (the private key) but NOT `.env`, a plaintext-era
244
+ * `.env` ignore is REMOVED — the .env is now COMMITTED with its values encrypted, so ignoring it is wrong (and safe to undo). */
243
245
  export function mergeGitignore(generated: string, existing: string | null): string {
244
246
  if (!existing) return generated;
245
247
  const norm = (s: string) => s.trim().replace(/\/$/, "");
246
- const have = new Set(existing.split("\n").map(norm).filter(Boolean));
248
+ const genLines = generated.split("\n").map(norm);
249
+ const encryptedModel = genLines.includes(".env.keys") && !genLines.includes(".env");
250
+ const existingClean = encryptedModel ? existing.split("\n").filter((l) => norm(l) !== ".env").join("\n") : existing;
251
+ const have = new Set(existingClean.split("\n").map(norm).filter(Boolean));
247
252
  const add = generated.split("\n").filter((l) => l.trim() && !have.has(norm(l)));
248
- if (!add.length) return existing.endsWith("\n") ? existing : existing + "\n";
249
- const base = existing.replace(/\n*$/, "");
253
+ if (!add.length) return existingClean.endsWith("\n") ? existingClean : existingClean + "\n";
254
+ const base = existingClean.replace(/\n*$/, "");
250
255
  return `${base}\n${add.join("\n")}\n`;
251
256
  }
252
257