create-ailk 0.12.0 → 0.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ailk",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,8 +27,8 @@
27
27
  "tar": "^7.5.21"
28
28
  },
29
29
  "devDependencies": {
30
- "@working-theory/schema": "0.34.0",
31
- "@working-theory/templates": "0.34.0"
30
+ "@working-theory/schema": "0.34.1",
31
+ "@working-theory/templates": "0.34.1"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -1,5 +1,15 @@
1
1
  # @working-theory/database
2
2
 
3
+ ## 0.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#7566](https://github.com/Working-Theory-Labs/ai-launch-kit-internal/pull/7566) [`64a3245`](https://github.com/Working-Theory-Labs/ai-launch-kit-internal/commit/64a324556595861b42166a49d98a4c73cef5115a) Thanks [@samuelhenry](https://github.com/samuelhenry)! - `build` runs `prisma generate` first and always re-emits `dist/client` ([#7565](https://github.com/working-theory-labs/ai-launch-kit-internal/issues/7565)), so a stale or skipped generated client can no longer be built into a release. Before this, `build` was `tsc -b` alone: it never regenerated the client, and `tsc -b` trusted `tsconfig.build.tsbuildinfo`, so `database@0.14.0` shipped without `FlowCheckout` and `database@0.34.0` without `Spoke`, `SchedulingConnection` and `AppointmentOrigin`. `db:generate` is now `pnpm run build`, so it still generates and builds, once.
8
+
9
+ - Updated dependencies [[`4df3e2c`](https://github.com/Working-Theory-Labs/ai-launch-kit-internal/commit/4df3e2cd0f4d22471f7422ada4018040ecca402b)]:
10
+ - @working-theory/ids@0.9.1
11
+ - @working-theory/validation@0.34.1
12
+
3
13
  ## 0.34.0
4
14
 
5
15
  ### Minor Changes
@@ -0,0 +1,131 @@
1
+ /**
2
+ * @file build.test.ts
3
+ * @description The package `build` cannot emit a stale generated client
4
+ * (#7565). `build` used to be `tsc -b` alone: it never ran `prisma generate`,
5
+ * and `tsc -b` trusts `tsconfig.build.tsbuildinfo`, so a checkout whose
6
+ * generated client predated a schema change built — and reported as built —
7
+ * a dist missing the new models (database@0.14.0 shipped without
8
+ * FlowCheckout, database@0.34.0 without Spoke).
9
+ *
10
+ * The suite runs the package's REAL scripts and tsconfigs against a copy of
11
+ * the package in a temp dir, so it never touches this package's generated
12
+ * client or dist (the tenancy/flows configs still build `packages/ids` and
13
+ * `packages/validation` in place when those are stale, as any database build
14
+ * does). The copy keeps the real model-free `schema.prisma`
15
+ * (generator + datasource) and swaps the namespace schemas for one probe
16
+ * model, which keeps both builds to seconds. `node_modules` and the sibling
17
+ * `packages/` the tenancy/flows configs reference are symlinked in, and the
18
+ * root `tsconfig.base.json` is copied to where `extends` expects it.
19
+ */
20
+
21
+ import { execFileSync } from "node:child_process";
22
+ import {
23
+ cpSync,
24
+ existsSync,
25
+ mkdtempSync,
26
+ readFileSync,
27
+ rmSync,
28
+ symlinkSync,
29
+ writeFileSync,
30
+ } from "node:fs";
31
+ import { tmpdir } from "node:os";
32
+ import { join } from "node:path";
33
+
34
+ const PACKAGE_DIR = join(__dirname, "..");
35
+ const REPO_ROOT = join(PACKAGE_DIR, "..");
36
+
37
+ const PACKAGE_FILES = [
38
+ "package.json",
39
+ "prisma.config.ts",
40
+ "schema.prisma",
41
+ "tenancy.ts",
42
+ "tsconfig.build.json",
43
+ "tsconfig.tenancy.json",
44
+ "tsconfig.flows.json",
45
+ ];
46
+
47
+ const BUILD_TIMEOUT_MS = 180_000;
48
+
49
+ let root: string;
50
+ let db: string;
51
+
52
+ function run(script: string): void {
53
+ try {
54
+ execFileSync("pnpm", ["run", script], { cwd: db, stdio: "pipe" });
55
+ } catch (error) {
56
+ // tsc reports type errors on stdout, which execFileSync's message omits.
57
+ const { stdout } = error as { stdout?: Buffer };
58
+ throw new Error(`pnpm run ${script} failed:\n${stdout?.toString() ?? ""}`, {
59
+ cause: error,
60
+ });
61
+ }
62
+ }
63
+
64
+ function addModel(name: string): void {
65
+ writeFileSync(
66
+ join(db, `${name}.prisma`),
67
+ `model ${name} {\n id String @id\n}\n`,
68
+ );
69
+ }
70
+
71
+ function emitted(file: string): string {
72
+ return readFileSync(join(db, "dist", "client", "internal", file), "utf8");
73
+ }
74
+
75
+ beforeAll(() => {
76
+ root = mkdtempSync(join(tmpdir(), "ailk-database-build-"));
77
+ db = join(root, "database");
78
+ cpSync(
79
+ join(REPO_ROOT, "tsconfig.base.json"),
80
+ join(root, "tsconfig.base.json"),
81
+ );
82
+ symlinkSync(join(REPO_ROOT, "packages"), join(root, "packages"), "dir");
83
+ for (const file of PACKAGE_FILES) {
84
+ cpSync(join(PACKAGE_DIR, file), join(db, file));
85
+ }
86
+ cpSync(join(PACKAGE_DIR, "flows"), join(db, "flows"), { recursive: true });
87
+ symlinkSync(
88
+ join(PACKAGE_DIR, "node_modules"),
89
+ join(db, "node_modules"),
90
+ "dir",
91
+ );
92
+
93
+ // The state every release that shipped a stale client started from: the
94
+ // client was generated and built once, and tsc -b recorded it as built.
95
+ addModel("BuildProbeAlpha");
96
+ run("db:generate");
97
+ }, BUILD_TIMEOUT_MS);
98
+
99
+ afterAll(() => {
100
+ if (root) rmSync(root, { recursive: true, force: true });
101
+ });
102
+
103
+ describe("@working-theory/database build", () => {
104
+ it(
105
+ "emits a model added to the schema after the last build, despite an existing tsconfig.build.tsbuildinfo",
106
+ () => {
107
+ expect(existsSync(join(db, "tsconfig.build.tsbuildinfo"))).toBe(true);
108
+ expect(emitted("class.d.ts")).not.toContain("buildProbeBravo");
109
+
110
+ addModel("BuildProbeBravo");
111
+ run("build");
112
+
113
+ expect(emitted("class.d.ts")).toContain("get buildProbeBravo()");
114
+ expect(emitted("class.js")).toContain("BuildProbeBravo");
115
+ },
116
+ BUILD_TIMEOUT_MS,
117
+ );
118
+
119
+ it(
120
+ "re-emits a deleted dist/client although the generated sources did not change",
121
+ () => {
122
+ rmSync(join(db, "dist", "client"), { recursive: true, force: true });
123
+
124
+ run("build");
125
+
126
+ expect(emitted("class.d.ts")).toContain("get buildProbeAlpha()");
127
+ expect(emitted("class.js")).toContain("BuildProbeAlpha");
128
+ },
129
+ BUILD_TIMEOUT_MS,
130
+ );
131
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@working-theory/database",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "scripts": {
53
53
  "lint": "eslint .",
54
- "build": "tsc -b tsconfig.build.json && tsc -b tsconfig.tenancy.json && tsc -b tsconfig.flows.json",
55
- "db:generate": "prisma generate && pnpm run build",
54
+ "build": "prisma generate && tsc -b tsconfig.build.json --force && tsc -b tsconfig.tenancy.json && tsc -b tsconfig.flows.json",
55
+ "db:generate": "pnpm run build",
56
56
  "db:migrate": "prisma migrate dev",
57
57
  "db:migrate:deploy": "prisma migrate deploy",
58
58
  "db:push": "prisma db push",
package/versions.json CHANGED
@@ -1,52 +1,52 @@
1
1
  {
2
- "@working-theory/admin-ui": "0.34.0",
3
- "@working-theory/aeo": "0.34.0",
4
- "@working-theory/agent-context": "0.34.0",
2
+ "@working-theory/admin-ui": "0.34.1",
3
+ "@working-theory/aeo": "0.34.1",
4
+ "@working-theory/agent-context": "0.34.1",
5
5
  "@working-theory/agent-contract": "0.1.0",
6
6
  "@working-theory/agent-memory": "0.0.0",
7
7
  "@working-theory/ai": "0.1.0",
8
- "@working-theory/analytics": "0.34.0",
9
- "@working-theory/api-client": "0.34.0",
8
+ "@working-theory/analytics": "0.34.1",
9
+ "@working-theory/api-client": "0.34.1",
10
10
  "@working-theory/cda-filesystem": "0.0.0",
11
- "@working-theory/cli": "0.34.0",
12
- "@working-theory/common": "0.34.0",
11
+ "@working-theory/cli": "0.34.1",
12
+ "@working-theory/common": "0.34.1",
13
13
  "@working-theory/consent": "0.1.0",
14
- "@working-theory/content-adapters": "0.34.0",
15
- "@working-theory/content-projection": "0.34.0",
16
- "@working-theory/email": "0.34.0",
14
+ "@working-theory/content-adapters": "0.34.1",
15
+ "@working-theory/content-projection": "0.34.1",
16
+ "@working-theory/email": "0.34.1",
17
17
  "@working-theory/env": "0.0.0",
18
- "@working-theory/eslint-config": "0.34.0",
19
- "@working-theory/fumadocs-schema": "0.34.0",
20
- "@working-theory/ids": "0.9.0",
21
- "@working-theory/jsonld": "0.34.0",
22
- "@working-theory/license": "0.34.0",
23
- "@working-theory/metadata": "0.34.0",
24
- "@working-theory/observability": "0.34.0",
25
- "@working-theory/page-renderer": "0.34.0",
18
+ "@working-theory/eslint-config": "0.34.1",
19
+ "@working-theory/fumadocs-schema": "0.34.1",
20
+ "@working-theory/ids": "0.9.1",
21
+ "@working-theory/jsonld": "0.34.1",
22
+ "@working-theory/license": "0.34.1",
23
+ "@working-theory/metadata": "0.34.1",
24
+ "@working-theory/observability": "0.34.1",
25
+ "@working-theory/page-renderer": "0.34.1",
26
26
  "@working-theory/plugin-mcp": "0.1.1",
27
- "@working-theory/schema": "0.34.0",
28
- "@working-theory/schema-pack-registry": "0.34.0",
29
- "@working-theory/schema-validator": "0.34.0",
30
- "@working-theory/sections-registry": "0.34.0",
31
- "@working-theory/site-config": "0.34.0",
32
- "@working-theory/stripe-client": "0.34.0",
33
- "@working-theory/templates": "0.34.0",
34
- "@working-theory/theme": "0.34.0",
35
- "@working-theory/ui": "0.34.0",
36
- "@working-theory/validation": "0.34.0",
37
- "@working-theory/web-i18n": "0.34.0",
27
+ "@working-theory/schema": "0.34.1",
28
+ "@working-theory/schema-pack-registry": "0.34.1",
29
+ "@working-theory/schema-validator": "0.34.1",
30
+ "@working-theory/sections-registry": "0.34.1",
31
+ "@working-theory/site-config": "0.34.1",
32
+ "@working-theory/stripe-client": "0.34.1",
33
+ "@working-theory/templates": "0.34.1",
34
+ "@working-theory/theme": "0.34.1",
35
+ "@working-theory/ui": "0.34.1",
36
+ "@working-theory/validation": "0.34.1",
37
+ "@working-theory/web-i18n": "0.34.1",
38
38
  "@working-theory/billing-client": "0.0.0",
39
39
  "@working-theory/branding": "0.0.0",
40
40
  "@working-theory/license-client": "0.0.0",
41
41
  "@working-theory/license-manifest": "0.0.0",
42
42
  "@working-theory/partner-session": "0.0.0",
43
43
  "@working-theory/preview-protocol": "0.0.0",
44
- "@working-theory/ui-commerce": "0.23.11",
45
- "@working-theory/ui-docs-blog": "0.23.11",
46
- "@working-theory/ui-scheduling": "0.23.11",
47
- "@working-theory/ui-signal-collectors": "0.25.0",
44
+ "@working-theory/ui-commerce": "0.23.12",
45
+ "@working-theory/ui-docs-blog": "0.23.12",
46
+ "@working-theory/ui-scheduling": "0.23.12",
47
+ "@working-theory/ui-signal-collectors": "0.25.1",
48
48
  "@working-theory/web": "0.0.0",
49
49
  "@working-theory/api": "1.0.0",
50
50
  "@working-theory/mcp": "0.0.0",
51
- "@working-theory/database": "0.34.0"
51
+ "@working-theory/database": "0.34.1"
52
52
  }