@intelligo-dev/cli 1.0.0-beta.1 → 1.0.0-beta.13

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 (103) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +63 -0
  3. package/dist/bin.js +85 -37
  4. package/dist/bin.js.map +1 -1
  5. package/dist/commands/add.d.ts +22 -1
  6. package/dist/commands/add.d.ts.map +1 -1
  7. package/dist/commands/add.js +61 -4
  8. package/dist/commands/add.js.map +1 -1
  9. package/dist/commands/create-flow.d.ts +34 -0
  10. package/dist/commands/create-flow.d.ts.map +1 -0
  11. package/dist/commands/create-flow.js +180 -0
  12. package/dist/commands/create-flow.js.map +1 -0
  13. package/dist/commands/create.d.ts +23 -6
  14. package/dist/commands/create.d.ts.map +1 -1
  15. package/dist/commands/create.js +45 -13
  16. package/dist/commands/create.js.map +1 -1
  17. package/dist/commands/doctor.d.ts +14 -3
  18. package/dist/commands/doctor.d.ts.map +1 -1
  19. package/dist/commands/doctor.js +293 -37
  20. package/dist/commands/doctor.js.map +1 -1
  21. package/dist/commands/migrate-check.d.ts +54 -1
  22. package/dist/commands/migrate-check.d.ts.map +1 -1
  23. package/dist/commands/migrate-check.js +101 -5
  24. package/dist/commands/migrate-check.js.map +1 -1
  25. package/dist/commands/migrate.d.ts +97 -0
  26. package/dist/commands/migrate.d.ts.map +1 -0
  27. package/dist/commands/migrate.js +147 -0
  28. package/dist/commands/migrate.js.map +1 -0
  29. package/dist/commands/upgrade-check.d.ts +5 -5
  30. package/dist/commands/upgrade-check.d.ts.map +1 -1
  31. package/dist/commands/upgrade-check.js +19 -6
  32. package/dist/commands/upgrade-check.js.map +1 -1
  33. package/dist/env-files.d.ts +12 -0
  34. package/dist/env-files.d.ts.map +1 -0
  35. package/dist/env-files.js +29 -0
  36. package/dist/env-files.js.map +1 -0
  37. package/dist/index.d.ts +9 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +9 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/manifest.d.ts +9 -15
  42. package/dist/manifest.d.ts.map +1 -1
  43. package/dist/manifest.js +5 -16
  44. package/dist/manifest.js.map +1 -1
  45. package/dist/migrations.d.ts +3 -6
  46. package/dist/migrations.d.ts.map +1 -1
  47. package/dist/migrations.js +3 -6
  48. package/dist/migrations.js.map +1 -1
  49. package/dist/model-catalogue.d.ts +14 -0
  50. package/dist/model-catalogue.d.ts.map +1 -0
  51. package/dist/model-catalogue.js +34 -0
  52. package/dist/model-catalogue.js.map +1 -0
  53. package/dist/registry-items.d.ts +56 -0
  54. package/dist/registry-items.d.ts.map +1 -0
  55. package/dist/registry-items.js +103 -0
  56. package/dist/registry-items.js.map +1 -0
  57. package/package.json +36 -10
  58. package/src/bin.ts +264 -0
  59. package/src/commands/add.ts +244 -0
  60. package/src/commands/create-flow.ts +228 -0
  61. package/src/commands/create.ts +139 -0
  62. package/src/commands/doctor.ts +487 -0
  63. package/src/commands/migrate-check.ts +257 -0
  64. package/src/commands/migrate.ts +234 -0
  65. package/src/commands/upgrade-check.ts +157 -0
  66. package/src/env-files.ts +31 -0
  67. package/src/index.ts +39 -0
  68. package/src/manifest.ts +93 -0
  69. package/src/migrations-dir.ts +25 -0
  70. package/src/migrations.ts +133 -0
  71. package/src/model-catalogue.ts +35 -0
  72. package/src/registry-items.ts +132 -0
  73. package/templates/admin-page/admin-page.tsx.tpl +2 -3
  74. package/templates/app-scaffold/assistant-route.ts.tpl +2 -2
  75. package/templates/app-scaffold/auth-route.ts.tpl +10 -0
  76. package/templates/app-scaffold/components.json.tpl +6 -2
  77. package/templates/app-scaffold/db-schema.ts.tpl +29 -0
  78. package/templates/app-scaffold/drizzle-journal.json.tpl +5 -0
  79. package/templates/app-scaffold/drizzle.config.ts.tpl +45 -0
  80. package/templates/app-scaffold/env.example.tpl +65 -1
  81. package/templates/app-scaffold/globals.css.tpl +172 -281
  82. package/templates/app-scaffold/i18n-request.ts.tpl +25 -0
  83. package/templates/app-scaffold/instrumentation.ts.tpl +21 -0
  84. package/templates/app-scaffold/intelligo.ts.tpl +104 -9
  85. package/templates/app-scaffold/layout.tsx.tpl +18 -1
  86. package/templates/app-scaffold/lib-utils.ts.tpl +1 -6
  87. package/templates/app-scaffold/next.config.mjs.tpl +2 -0
  88. package/templates/app-scaffold/package.json.tpl +31 -17
  89. package/templates/app-scaffold/page.tsx.tpl +16 -0
  90. package/templates/app-scaffold/plans.ts.tpl +32 -13
  91. package/templates/app-scaffold/{middleware.ts.tpl → proxy.ts.tpl} +6 -0
  92. package/templates/app-scaffold/sonner.tsx.tpl +42 -20
  93. package/templates/app-scaffold/stripe-webhook-route.ts.tpl +24 -0
  94. package/templates/app-scaffold/theme-provider.tsx.tpl +6 -4
  95. package/templates/app-scaffold/tsconfig.json.tpl +20 -4
  96. package/templates/app-scaffold/use-mobile.ts.tpl +19 -0
  97. package/templates/app-scaffold/workspace-bootstrap.ts.tpl +30 -0
  98. package/templates/maintenance/maintenance-route.ts.tpl +119 -0
  99. package/templates/manifest.json +57 -18
  100. package/templates/registry-items.json +116 -0
  101. package/templates/registry-requires.json +156 -0
  102. package/templates/usage-page/usage-page.tsx.tpl +23 -8
  103. package/templates/billing-page/billing-page.tsx.tpl +0 -72
@@ -1 +1 @@
1
- {"version":3,"file":"migrate-check.js","sourceRoot":"","sources":["../../src/commands/migrate-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAkBtD,oDAAoD;AACpD,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CA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pC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC;QACjC,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,SAAS,EAAE,CAAC,CAAC,SAAS;KACvB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * `intelligo migrate` — apply the framework's migration chain.
3
+ *
4
+ * A consumer application has two migration chains in one database:
5
+ * the framework's, shipped inside `@intelligo-dev/core` (its `.sql`
6
+ * files and journal are in the package's `files`), and its own, which
7
+ * drizzle-kit generates from the tables the application owns. They
8
+ * must not share a journal — drizzle-kit applies by timestamp, so a
9
+ * framework migration published after the consumer generated one of
10
+ * theirs would be silently skipped — and a consumer cannot write into
11
+ * `node_modules` anyway. So the framework chain is applied by this
12
+ * command, into drizzle's default `drizzle.__drizzle_migrations`
13
+ * table, and the consumer's chain by `drizzle-kit migrate` from their
14
+ * own `drizzle.config.ts`, into a table of its own (the scaffold sets
15
+ * `migrations.table` to `__app_migrations`).
16
+ *
17
+ * Migrations are selected by content hash (what `migrate --check`
18
+ * compares), not by drizzle's journal-timestamp rule, and are recorded
19
+ * in the same table drizzle's migrator writes — see
20
+ * `readPendingMigrations` for why.
21
+ *
22
+ * The one thing this refuses to do is guess. A database with the
23
+ * framework's tables but no migration records was provisioned with
24
+ * `db:push`; applying the whole chain to it would fail part-way (not
25
+ * every migration is `IF NOT EXISTS`-guarded) and leave the records
26
+ * half-written. Baselining is the fix, and it is deliberately a manual
27
+ * step — see `packages/core/src/db/migrations/README.md`.
28
+ */
29
+ import { type MigrateCheckResult } from "./migrate-check.js";
30
+ export type ApplyDecision = {
31
+ action: "apply";
32
+ pending: string[];
33
+ /** Recorded as applied without running: the schema is already there. */
34
+ adopted: string[];
35
+ } | {
36
+ action: "noop";
37
+ } | {
38
+ action: "refuse";
39
+ reason: string;
40
+ };
41
+ /**
42
+ * What to do with a database, given the check result and whether the
43
+ * framework's schema already exists in it. Pure, so the three states
44
+ * that matter — empty, push-provisioned, behind — are unit-testable
45
+ * without a database.
46
+ */
47
+ export declare function decideApply(check: MigrateCheckResult, schemaExists: boolean): ApplyDecision;
48
+ type QueryFn = (sql: string) => Promise<Array<Record<string, unknown>>>;
49
+ /**
50
+ * One migration ready to run: its statements and the journal entry it
51
+ * will be recorded under. `createdAt` is the journal's `when`, which is
52
+ * what drizzle-kit writes to `created_at` too, so records made here and
53
+ * records made by drizzle's own migrator are indistinguishable.
54
+ */
55
+ export type PendingMigration = {
56
+ tag: string;
57
+ hash: string;
58
+ createdAt: number;
59
+ statements: string[];
60
+ };
61
+ /**
62
+ * Read the pending migrations off disk, in journal order.
63
+ *
64
+ * The chain is applied by content hash — the same key `migrate --check`
65
+ * compares — and not by drizzle's rule of "every entry whose journal
66
+ * timestamp is greater than the last applied row's". That rule depends
67
+ * on `when` values increasing monotonically, which a hand-numbered
68
+ * journal does not guarantee: an entry numbered below an applied one is
69
+ * skipped silently while the check reports it pending. Selecting by hash makes "pending" mean exactly what the check says.
70
+ */
71
+ export declare function readPendingMigrations(migrationsDir: string, pendingTags: string[]): PendingMigration[];
72
+ /** The records table drizzle's migrator uses, created the way it creates it. */
73
+ export declare const MIGRATIONS_TABLE_SQL: string[];
74
+ export type ApplyMigrationsOptions = {
75
+ migrationsDir: string;
76
+ /** Runs a read-only query and returns its rows. */
77
+ query: QueryFn;
78
+ /**
79
+ * Applies the given migrations in order, all in one transaction,
80
+ * recording each in `drizzle.__drizzle_migrations` as it goes.
81
+ */
82
+ run: (pending: PendingMigration[]) => Promise<void>;
83
+ };
84
+ export type ApplyMigrationsResult = ApplyDecision & {
85
+ /** After the run, for the summary line and for `noop` detection. */
86
+ chainLength: number;
87
+ };
88
+ /**
89
+ * `users` is the first table the framework creates (auth), so its
90
+ * presence with no migration records is the push-provisioned signature.
91
+ */
92
+ export declare const SCHEMA_PROBE_SQL = "SELECT to_regclass('public.users') AS rel";
93
+ export declare function applyMigrations(options: ApplyMigrationsOptions): Promise<ApplyMigrationsResult>;
94
+ export declare function formatApplyResult(r: ApplyMigrationsResult): string;
95
+ export declare function applyExitCode(r: ApplyMigrationsResult): number;
96
+ export {};
97
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,aAAa,GACrB;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GACD;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,kBAAkB,EACzB,YAAY,EAAE,OAAO,GACpB,aAAa,CA8Cf;AAED,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EAAE,GACpB,gBAAgB,EAAE,CAqBpB;AAED,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,UAGhC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,GAAG,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,8CAA8C,CAAC;AAE5E,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAwBhC;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAgBlE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * `intelligo migrate` — apply the framework's migration chain.
3
+ *
4
+ * A consumer application has two migration chains in one database:
5
+ * the framework's, shipped inside `@intelligo-dev/core` (its `.sql`
6
+ * files and journal are in the package's `files`), and its own, which
7
+ * drizzle-kit generates from the tables the application owns. They
8
+ * must not share a journal — drizzle-kit applies by timestamp, so a
9
+ * framework migration published after the consumer generated one of
10
+ * theirs would be silently skipped — and a consumer cannot write into
11
+ * `node_modules` anyway. So the framework chain is applied by this
12
+ * command, into drizzle's default `drizzle.__drizzle_migrations`
13
+ * table, and the consumer's chain by `drizzle-kit migrate` from their
14
+ * own `drizzle.config.ts`, into a table of its own (the scaffold sets
15
+ * `migrations.table` to `__app_migrations`).
16
+ *
17
+ * Migrations are selected by content hash (what `migrate --check`
18
+ * compares), not by drizzle's journal-timestamp rule, and are recorded
19
+ * in the same table drizzle's migrator writes — see
20
+ * `readPendingMigrations` for why.
21
+ *
22
+ * The one thing this refuses to do is guess. A database with the
23
+ * framework's tables but no migration records was provisioned with
24
+ * `db:push`; applying the whole chain to it would fail part-way (not
25
+ * every migration is `IF NOT EXISTS`-guarded) and leave the records
26
+ * half-written. Baselining is the fix, and it is deliberately a manual
27
+ * step — see `packages/core/src/db/migrations/README.md`.
28
+ */
29
+ import { readFileSync } from "node:fs";
30
+ import path from "node:path";
31
+ import { hashMigration, isPartialLegacy, migrateCheck, } from "./migrate-check.js";
32
+ /**
33
+ * What to do with a database, given the check result and whether the
34
+ * framework's schema already exists in it. Pure, so the three states
35
+ * that matter — empty, push-provisioned, behind — are unit-testable
36
+ * without a database.
37
+ */
38
+ export function decideApply(check, schemaExists) {
39
+ if (check.unknown.length > 0) {
40
+ return {
41
+ action: "refuse",
42
+ reason: `Database is ahead: ${check.unknown.length} applied migration(s) are ` +
43
+ `not in this checkout (${check.unknown.join(", ")}). Upgrade ` +
44
+ `@intelligo-dev/core before migrating, or restore the database.`,
45
+ };
46
+ }
47
+ if (isPartialLegacy(check)) {
48
+ return {
49
+ action: "refuse",
50
+ reason: `This database ran ${check.legacy.length} of the ` +
51
+ `${check.legacyChainLength} pre-1.0 migrations. Finish that chain ` +
52
+ `with @intelligo-dev/core 1.0.0-beta.7 (\`intelligo migrate\`) ` +
53
+ `before upgrading.`,
54
+ };
55
+ }
56
+ if (check.adoptable) {
57
+ const [baseline, ...rest] = check.pending;
58
+ return {
59
+ action: "apply",
60
+ adopted: baseline ? [baseline] : [],
61
+ pending: rest,
62
+ };
63
+ }
64
+ if (check.unmanaged && schemaExists) {
65
+ return {
66
+ action: "refuse",
67
+ reason: `This database has the framework's tables but no migration records — ` +
68
+ `it was provisioned with db:push. Baseline it before running migrate, ` +
69
+ `otherwise all ${check.chain.length} migrations would be applied to ` +
70
+ `tables that already exist. See README.md in @intelligo-dev/core's ` +
71
+ `src/db/migrations.`,
72
+ };
73
+ }
74
+ if (check.pending.length === 0)
75
+ return { action: "noop" };
76
+ return { action: "apply", pending: check.pending, adopted: [] };
77
+ }
78
+ /**
79
+ * Read the pending migrations off disk, in journal order.
80
+ *
81
+ * The chain is applied by content hash — the same key `migrate --check`
82
+ * compares — and not by drizzle's rule of "every entry whose journal
83
+ * timestamp is greater than the last applied row's". That rule depends
84
+ * on `when` values increasing monotonically, which a hand-numbered
85
+ * journal does not guarantee: an entry numbered below an applied one is
86
+ * skipped silently while the check reports it pending. Selecting by hash makes "pending" mean exactly what the check says.
87
+ */
88
+ export function readPendingMigrations(migrationsDir, pendingTags) {
89
+ const journal = JSON.parse(readFileSync(path.join(migrationsDir, "meta", "_journal.json"), "utf8"));
90
+ const byTag = new Map((journal.entries ?? []).map((e) => [e.tag, e]));
91
+ return pendingTags.map((tag) => {
92
+ const entry = byTag.get(tag);
93
+ if (!entry)
94
+ throw new Error(`${tag} is pending but not in the journal`);
95
+ const sql = readFileSync(path.join(migrationsDir, `${tag}.sql`), "utf8");
96
+ const statements = (entry.breakpoints === false
97
+ ? [sql]
98
+ : sql.split("--> statement-breakpoint"))
99
+ .map((s) => s.trim())
100
+ .filter((s) => s.length > 0);
101
+ return { tag, hash: hashMigration(sql), createdAt: entry.when, statements };
102
+ });
103
+ }
104
+ /** The records table drizzle's migrator uses, created the way it creates it. */
105
+ export const MIGRATIONS_TABLE_SQL = [
106
+ `CREATE SCHEMA IF NOT EXISTS "drizzle"`,
107
+ `CREATE TABLE IF NOT EXISTS "drizzle"."__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint)`,
108
+ ];
109
+ /**
110
+ * `users` is the first table the framework creates (auth), so its
111
+ * presence with no migration records is the push-provisioned signature.
112
+ */
113
+ export const SCHEMA_PROBE_SQL = `SELECT to_regclass('public.users') AS rel`;
114
+ export async function applyMigrations(options) {
115
+ const check = await migrateCheck(options.migrationsDir, async (sql) => (await options.query(sql)));
116
+ const probe = await options.query(SCHEMA_PROBE_SQL);
117
+ const schemaExists = probe.length > 0 && probe[0].rel != null;
118
+ const decision = decideApply(check, schemaExists);
119
+ if (decision.action === "apply") {
120
+ // An adopted migration is recorded with no statements: its schema is
121
+ // already in the database.
122
+ const adopted = readPendingMigrations(options.migrationsDir, decision.adopted).map((m) => ({ ...m, statements: [] }));
123
+ await options.run([
124
+ ...adopted,
125
+ ...readPendingMigrations(options.migrationsDir, decision.pending),
126
+ ]);
127
+ }
128
+ return { ...decision, chainLength: check.chain.length };
129
+ }
130
+ export function formatApplyResult(r) {
131
+ switch (r.action) {
132
+ case "refuse":
133
+ return `✗ ${r.reason}`;
134
+ case "noop":
135
+ return `✓ Nothing to apply (${r.chainLength}/${r.chainLength} applied)`;
136
+ case "apply":
137
+ return [
138
+ ...r.adopted.map((tag) => `✓ Adopted ${tag}: this database ran the pre-1.0 chain, so its schema is already there`),
139
+ `✓ Applied ${r.pending.length} migration(s):`,
140
+ ...r.pending.map((tag) => ` ${tag}`),
141
+ ].join("\n");
142
+ }
143
+ }
144
+ export function applyExitCode(r) {
145
+ return r.action === "refuse" ? 1 : 0;
146
+ }
147
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAY5B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,KAAyB,EACzB,YAAqB;IAErB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,MAAM,EACJ,sBAAsB,KAAK,CAAC,OAAO,CAAC,MAAM,4BAA4B;gBACtE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AK,MAAM;YACT,OAAO,uBAAuB,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,WAAW,CAAC;QAC1E,KAAK,OAAO;YACV,OAAO;gBACL,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CACd,CAAC,GAAG,EAAE,EAAE,CACN,aAAa,GAAG,uEAAuE,CAC1F;gBACD,aAAa,CAAC,CAAC,OAAO,CAAC,MAAM,gBAAgB;gBAC7C,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC;aACxC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,CAAwB;IACpD,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * `intelligo upgrade --check`
3
3
  *
4
- * Reports what a template upgrade would do, and does nothing. The
5
- * promise in ADR-0002 is that dependency upgrades never overwrite
6
- * consumer source, so the interesting output is not "these files
7
- * changed upstream" but "these changed upstream AND you have edited
4
+ * Reports what a template upgrade would do, and does nothing. Upgrades
5
+ * never overwrite consumer source, so the interesting output is not
6
+ * "these templates changed" but "these changed AND you have edited
8
7
  * them" — the set where the consumer has to make a decision.
9
8
  */
10
9
  export type UpgradeItem = {
@@ -17,8 +16,9 @@ export type UpgradeItem = {
17
16
  * - `conflict` — template changed AND the consumer edited the file
18
17
  * - `customized` — consumer edited it; template unchanged
19
18
  * - `deleted` — consumer removed it
19
+ * - `new` — the template has a file this app was never given
20
20
  */
21
- state: "current" | "outdated" | "conflict" | "customized" | "deleted";
21
+ state: "current" | "outdated" | "conflict" | "customized" | "deleted" | "new";
22
22
  };
23
23
  export type UpgradeReport = {
24
24
  installedVersion: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-check.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;CACvE,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAwDxE;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CA0B5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CAE7D"}
1
+ {"version":3,"file":"upgrade-check.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade-check.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;CAC/E,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAkExE;AAaD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CA2B5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,CAE7D"}
@@ -1,15 +1,14 @@
1
1
  /**
2
2
  * `intelligo upgrade --check`
3
3
  *
4
- * Reports what a template upgrade would do, and does nothing. The
5
- * promise in ADR-0002 is that dependency upgrades never overwrite
6
- * consumer source, so the interesting output is not "these files
7
- * changed upstream" but "these changed upstream AND you have edited
4
+ * Reports what a template upgrade would do, and does nothing. Upgrades
5
+ * never overwrite consumer source, so the interesting output is not
6
+ * "these templates changed" but "these changed AND you have edited
8
7
  * them" — the set where the consumer has to make a decision.
9
8
  */
10
9
  import { existsSync, readFileSync } from "node:fs";
11
10
  import path from "node:path";
12
- import { readCatalogue } from "./add.js";
11
+ import { readCatalogue, substitute } from "./add.js";
13
12
  import { hashContents, readManifest } from "../manifest.js";
14
13
  export function upgradeCheck(options) {
15
14
  const manifest = readManifest(options.appRoot);
@@ -28,6 +27,9 @@ export function upgradeCheck(options) {
28
27
  if (spec)
29
28
  report.templateVersion[feature] = spec.templateVersion;
30
29
  const targetToTemplate = new Map((spec?.files ?? []).map((f) => [f.target, f.template]));
30
+ for (const target of newFiles(spec, entry.files)) {
31
+ report.items.push({ feature, path: target, state: "new" });
32
+ }
31
33
  for (const file of entry.files) {
32
34
  const abs = path.join(options.appRoot, file.path);
33
35
  if (!existsSync(abs)) {
@@ -36,10 +38,13 @@ export function upgradeCheck(options) {
36
38
  }
37
39
  const localHash = hashContents(readFileSync(abs, "utf8"));
38
40
  const customized = localHash !== file.hash;
41
+ // Compare against the template as it would be written for THIS
42
+ // app: the recorded hash is of substituted content, so the raw
43
+ // template never matches a file carrying a placeholder.
39
44
  const templateRel = targetToTemplate.get(file.path);
40
45
  let templateChanged = false;
41
46
  if (templateRel) {
42
- const templateHash = hashContents(readFileSync(path.join(options.templatesDir, templateRel), "utf8"));
47
+ const templateHash = hashContents(substitute(readFileSync(path.join(options.templatesDir, templateRel), "utf8"), entry.variables));
43
48
  templateChanged = templateHash !== file.hash;
44
49
  }
45
50
  report.items.push({
@@ -57,6 +62,13 @@ export function upgradeCheck(options) {
57
62
  }
58
63
  return report;
59
64
  }
65
+ /** The feature's files the manifest has no record of: added to the template since. */
66
+ function newFiles(spec, recorded) {
67
+ const known = new Set(recorded.map((file) => file.path));
68
+ return (spec?.files ?? [])
69
+ .map((file) => file.target)
70
+ .filter((target) => !known.has(target));
71
+ }
60
72
  export function formatUpgradeReport(r) {
61
73
  if (r.items.length === 0) {
62
74
  return "No generated files recorded — nothing to upgrade.";
@@ -67,6 +79,7 @@ export function formatUpgradeReport(r) {
67
79
  conflict: "! template changed AND you edited it — review the diff",
68
80
  customized: "= yours (template unchanged)",
69
81
  deleted: "✗ removed by you",
82
+ new: "+ new in the template — `intelligo add` writes it",
70
83
  };
71
84
  const lines = [];
72
85
  for (const [feature, installed] of Object.entries(r.installedVersion)) {
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-check.js","sourceRoot":"","sources":["../../src/commands/upgrade-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AA2B3E,MAAM,UAAU,YAAY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AM,MAAM,EAAE;YACxC,CAAC,CAAC,GAAG,OAAO,KAAK,SAAS,EAAE,CAC/B,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,CAAC;YAChE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAgB;IACnD,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The env files a Next.js app reads, in the order it reads them: an
3
+ * earlier file wins, and a variable already set in the shell wins over
4
+ * every file.
5
+ *
6
+ * `migrate` and `doctor` run outside Next, so without this a fresh app
7
+ * whose `DATABASE_URL` lives in `.env.local` — exactly what the
8
+ * quickstart says to do — would fail with "DATABASE_URL is required".
9
+ */
10
+ export declare const ENV_FILES: readonly [".env.local", ".env"];
11
+ export declare function loadAppEnv(root: string, env?: NodeJS.ProcessEnv): string[];
12
+ //# sourceMappingURL=env-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-files.d.ts","sourceRoot":"","sources":["../src/env-files.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,iCAAkC,CAAC;AAEzD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CAYV"}
@@ -0,0 +1,29 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { parseEnv } from "node:util";
4
+ /**
5
+ * The env files a Next.js app reads, in the order it reads them: an
6
+ * earlier file wins, and a variable already set in the shell wins over
7
+ * every file.
8
+ *
9
+ * `migrate` and `doctor` run outside Next, so without this a fresh app
10
+ * whose `DATABASE_URL` lives in `.env.local` — exactly what the
11
+ * quickstart says to do — would fail with "DATABASE_URL is required".
12
+ */
13
+ export const ENV_FILES = [".env.local", ".env"];
14
+ export function loadAppEnv(root, env = process.env) {
15
+ const loaded = [];
16
+ for (const name of ENV_FILES) {
17
+ const file = path.join(root, name);
18
+ if (!existsSync(file))
19
+ continue;
20
+ const values = parseEnv(readFileSync(file, "utf8"));
21
+ for (const [key, value] of Object.entries(values)) {
22
+ if (env[key] === undefined)
23
+ env[key] = value;
24
+ }
25
+ loaded.push(name);
26
+ }
27
+ return loaded;
28
+ }
29
+ //# sourceMappingURL=env-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-files.js","sourceRoot":"","sources":["../src/env-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,MAAM,CAAU,CAAC;AAEzD,MAAM,UAAU,UAAU,CACxB,IAAY,EACZ,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAAS;QAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACpD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/C,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,4 +7,13 @@
7
7
  export { runChecks, formatResults, exitCodeFor, type CheckResult, type DoctorOptions, } from "./commands/doctor.js";
8
8
  export { migrateCheck, hashMigration, formatMigrateCheck, migrateCheckExitCode, type MigrateCheckResult, } from "./commands/migrate-check.js";
9
9
  export { readMigrationChain, inspectMigrationChain, type MigrationChain, type ChainProblem, } from "./migrations.js";
10
+ /**
11
+ * Where the framework's chain lives. Exported because a consumer's own
12
+ * operational scripts — baselining a push-provisioned database, a
13
+ * one-off audit — otherwise hardcode
14
+ * `node_modules/@intelligo-dev/core/src/db/migrations`, which is right
15
+ * in an application and wrong in the framework repository, and which
16
+ * silently stops being either if the package layout ever changes.
17
+ */
18
+ export { resolveMigrationsDir, MIGRATION_LOCATIONS } from "./migrations-dir.js";
10
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -7,4 +7,13 @@
7
7
  export { runChecks, formatResults, exitCodeFor, } from "./commands/doctor.js";
8
8
  export { migrateCheck, hashMigration, formatMigrateCheck, migrateCheckExitCode, } from "./commands/migrate-check.js";
9
9
  export { readMigrationChain, inspectMigrationChain, } from "./migrations.js";
10
+ /**
11
+ * Where the framework's chain lives. Exported because a consumer's own
12
+ * operational scripts — baselining a push-provisioned database, a
13
+ * one-off audit — otherwise hardcode
14
+ * `node_modules/@intelligo-dev/core/src/db/migrations`, which is right
15
+ * in an application and wrong in the framework repository, and which
16
+ * silently stops being either if the package layout ever changes.
17
+ */
18
+ export { resolveMigrationsDir, MIGRATION_LOCATIONS } from "./migrations-dir.js";
10
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,GAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,GAGZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GAGtB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Generated-source manifest.
3
3
  *
4
4
  * Intelligo generates starting source into the consumer's repository
5
- * and then stops owning it (ADR-0002). That promise needs a mechanism,
5
+ * and then stops owning it. That promise needs a mechanism,
6
6
  * because "never overwrite a customized file" requires knowing which
7
7
  * files were generated, from which template version, and whether the
8
8
  * consumer has since edited them.
@@ -25,6 +25,13 @@ export type GeneratedFile = {
25
25
  export type FeatureEntry = {
26
26
  templateVersion: string;
27
27
  files: GeneratedFile[];
28
+ /**
29
+ * Placeholder substitutions the files were generated with
30
+ * (`__APP_NAME__` → "acme"). Recorded so an upgrade check can hash the
31
+ * template *as it would be written for this app*; the raw template
32
+ * would make every substituted file look permanently outdated.
33
+ */
34
+ variables?: Record<string, string>;
28
35
  };
29
36
  export type Manifest = {
30
37
  schemaVersion: 1;
@@ -35,24 +42,11 @@ export declare function hashContents(contents: string): string;
35
42
  export declare function emptyManifest(frameworkVersion: string): Manifest;
36
43
  export declare function readManifest(appRoot: string): Manifest | null;
37
44
  export declare function writeManifest(appRoot: string, manifest: Manifest): void;
38
- /**
39
- * What happened to a generated file since it was written.
40
- *
41
- * `customized` is the state the whole mechanism exists to detect: the
42
- * consumer owns that file now, and an upgrade must not touch it.
43
- */
44
- export type FileState = "unchanged" | "customized" | "deleted";
45
- export type FileStatus = {
46
- path: string;
47
- state: FileState;
48
- };
49
- export declare function inspectFile(appRoot: string, file: GeneratedFile): FileStatus;
50
- export declare function inspectFeature(appRoot: string, entry: FeatureEntry): FileStatus[];
51
45
  /**
52
46
  * Record a feature's generated files, replacing any previous entry for
53
47
  * the same feature — re-generating is how a consumer accepts a new
54
48
  * template version, and the recorded hashes must then describe what is
55
49
  * actually on disk.
56
50
  */
57
- export declare function recordFeature(manifest: Manifest, feature: string, templateVersion: string, files: GeneratedFile[]): Manifest;
51
+ export declare function recordFeature(manifest: Manifest, feature: string, templateVersion: string, files: GeneratedFile[], variables?: Record<string, string>): Manifest;
58
52
  //# sourceMappingURL=manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,eAAO,MAAM,aAAa,4BAA4B,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG;IAC1B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,aAAa,EAAE,CAAC,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,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M,MAAM,QAAQ,GAAG;IACrB,aAAa,EAAE,CAAC,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,CAEhE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAI7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAKvE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,aAAa,EAAE,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,QAAQ,CAUV"}
package/dist/manifest.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Generated-source manifest.
3
3
  *
4
4
  * Intelligo generates starting source into the consumer's repository
5
- * and then stops owning it (ADR-0002). That promise needs a mechanism,
5
+ * and then stops owning it. That promise needs a mechanism,
6
6
  * because "never overwrite a customized file" requires knowing which
7
7
  * files were generated, from which template version, and whether the
8
8
  * consumer has since edited them.
@@ -34,31 +34,20 @@ export function readManifest(appRoot) {
34
34
  export function writeManifest(appRoot, manifest) {
35
35
  writeFileSync(path.join(appRoot, MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}\n`);
36
36
  }
37
- export function inspectFile(appRoot, file) {
38
- const abs = path.join(appRoot, file.path);
39
- if (!existsSync(abs))
40
- return { path: file.path, state: "deleted" };
41
- const current = hashContents(readFileSync(abs, "utf8"));
42
- return {
43
- path: file.path,
44
- state: current === file.hash ? "unchanged" : "customized",
45
- };
46
- }
47
- export function inspectFeature(appRoot, entry) {
48
- return entry.files.map((f) => inspectFile(appRoot, f));
49
- }
50
37
  /**
51
38
  * Record a feature's generated files, replacing any previous entry for
52
39
  * the same feature — re-generating is how a consumer accepts a new
53
40
  * template version, and the recorded hashes must then describe what is
54
41
  * actually on disk.
55
42
  */
56
- export function recordFeature(manifest, feature, templateVersion, files) {
43
+ export function recordFeature(manifest, feature, templateVersion, files, variables) {
57
44
  return {
58
45
  ...manifest,
59
46
  features: {
60
47
  ...manifest.features,
61
- [feature]: { templateVersion, files },
48
+ [feature]: variables
49
+ ? { templateVersion, files, variables }
50
+ : { templateVersion, files },
62
51
  },
63
52
  };
64
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,yBAAyB,CAAC;AAoBvD,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,gBAAwB;IACpD,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OA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sB,EACtB,SAAkC;IAElC,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE;YACR,GAAG,QAAQ,CAAC,QAAQ;YACpB,CAAC,OAAO,CAAC,EAAE,SAAS;gBAClB,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE;gBACvC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE;SAC/B;KACF,CAAC;AACJ,CAAC"}
@@ -3,12 +3,9 @@
3
3
  *
4
4
  * Drizzle keeps two sources of truth: the `.sql` files on disk and
5
5
  * `meta/_journal.json`, which is what `drizzle-kit migrate` actually
6
- * reads. Nothing keeps them in step. In this repo the journal stopped
7
- * at entry 11 while 39 files accumulated, so `migrate` silently
8
- * applied a quarter of the chain and every environment was really
9
- * provisioned by `drizzle-kit push` from `schema.ts` instead — which
10
- * is how a migration shipped documenting a unique constraint on a
11
- * column no migration created.
6
+ * reads. Nothing keeps them in step: a file missing from the journal is
7
+ * silently skipped by `migrate`, while `drizzle-kit push` from
8
+ * `schema.ts` hides the gap.
12
9
  *
13
10
  * The drift is invisible until someone provisions a database from the
14
11
  * migrations, at which point it is a production incident rather than a