create-stitchkit 0.6.18 → 0.6.19

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 (52) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cli.js +62 -27
  3. package/package.json +10 -9
  4. package/template/biome.json +4 -1
  5. package/template/bun.lock +303 -301
  6. package/template/e2e/starter.spec.ts +2 -2
  7. package/template/package.json +16 -16
  8. package/template/packages/backend/package.json +6 -6
  9. package/template/packages/backend/src/cleanup.ts +4 -7
  10. package/template/packages/backend/src/surface-manifest.test.ts +3 -3
  11. package/template/packages/config/package.json +3 -3
  12. package/template/packages/config/src/shutdown.ts +3 -4
  13. package/template/packages/config/src/variables.ts +5 -8
  14. package/template/packages/db/package.json +4 -4
  15. package/template/packages/frontend/package.json +29 -29
  16. package/template/packages/frontend/scripts/serve.ts +4 -4
  17. package/template/packages/frontend/src/components/ui/toaster.tsx +2 -2
  18. package/template/packages/frontend/src/env.ts +1 -2
  19. package/template/packages/frontend/src/lib/query-client.test.ts +1 -1
  20. package/template/packages/frontend/src/lib/query-client.ts +2 -3
  21. package/template/packages/frontend/src/lib/seo/cache-by-origin.ts +2 -2
  22. package/template/packages/frontend/src/lib/seo/request-origin.ts +5 -5
  23. package/template/packages/shared/package.json +2 -2
  24. package/template/packages/shared/src/contracts/board.ts +1 -3
  25. package/template/packages/shared/src/contracts/system.ts +1 -3
  26. package/template/scripts/acceptance-database.test.ts +4 -4
  27. package/template/scripts/acceptance-database.ts +4 -6
  28. package/template/scripts/acceptance-local.ts +6 -8
  29. package/template/scripts/build-stamp.test.ts +3 -5
  30. package/template/scripts/build-stamp.ts +8 -11
  31. package/template/scripts/check-authored.test.ts +16 -1
  32. package/template/scripts/check-authored.ts +7 -6
  33. package/template/scripts/client-boundary.test.ts +26 -8
  34. package/template/scripts/client-boundary.ts +30 -27
  35. package/template/scripts/declaration.test.ts +5 -7
  36. package/template/scripts/declaration.ts +14 -19
  37. package/template/scripts/deployment-preflight.ts +2 -3
  38. package/template/scripts/dev.ts +6 -8
  39. package/template/scripts/guide-paths.ts +2 -4
  40. package/template/scripts/readiness.ts +4 -5
  41. package/template/scripts/release-steps.test.ts +2 -4
  42. package/template/scripts/release-steps.ts +2 -2
  43. package/template/scripts/runtime-smoke.test.ts +6 -7
  44. package/template/scripts/serve-mode.test.ts +2 -2
  45. package/template/scripts/shutdown-budget.fixture.ts +3 -5
  46. package/template/scripts/shutdown-budget.test.ts +4 -8
  47. package/template/scripts/supervision-signal.test.ts +1 -1
  48. package/template/scripts/web-surface-smoke.ts +5 -8
  49. package/templates/agent/biome.json +4 -1
  50. package/templates/agent/package.json +11 -7
  51. package/templates/telegram-bot/biome.json +4 -1
  52. package/templates/telegram-bot/package.json +8 -4
package/CHANGELOG.md CHANGED
@@ -12,6 +12,33 @@ step is overwritten by the next release.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ## [0.6.19] - 2026-11-04
16
+
17
+ ### Changed
18
+
19
+ - Generated projects resolve stitchkit 0.119.0 and the template's dependencies at their latest
20
+ stable versions: Biome 2.6.5 (pinned to the version the scaffolder formats with), Playwright
21
+ 1.64.1, Next 16.4, framer-motion 14, `@wrksz/themes` 2, the MCP SDK 2.4 and Zod 4.6.7. The
22
+ template's code needs no change for the 0.119.0 breaking items: it uses the no-config factory with
23
+ literal endpoints, no tracking client and no GeoIP resolver.
24
+
25
+ ### Fixed
26
+
27
+ - Shared contracts create their factory without configuration and declare HTTP exposure on each
28
+ endpoint.
29
+ - Generated application workspaces use the destination slug as their package scope in manifests,
30
+ imports, scripts, guides and the lockfile, including the repository example. Browser-boundary
31
+ checks identify workspace packages by their manifests, so renaming a scope keeps the checks active.
32
+ - Scaffolding formats the completed project and organizes imports with its Biome configuration,
33
+ including with `--no-install`, so scope length and sort order do not leave a failing lint check.
34
+ The bounded formatter runs the native binary directly, so a timeout stops it before rollback.
35
+ - Agent and Telegram templates declare their own Biome dependency instead of inheriting a formatter
36
+ from a parent directory or downloading an undeclared version.
37
+ - Template comments describe current constraints and their reasons rather than narrating edits.
38
+ - Local Agent and Telegram template dependencies link the current workspace rather than retaining a
39
+ copied dependency snapshot. Both templates pin transitive Zod resolution to the repository's version
40
+ so frozen installs keep one schema type identity.
41
+
15
42
  ## [0.6.18] - 2026-11-02
16
43
 
17
44
  ### Added
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  // src/cli.ts
5
5
  import { readFile as readFile2 } from "fs/promises";
6
- import { basename as basename3, join as join2, resolve as resolve2 } from "path";
6
+ import { basename as basename3, join as join3, resolve as resolve2 } from "path";
7
7
  var {spawn } = globalThis.Bun;
8
8
 
9
9
  // src/identity.ts
@@ -272,8 +272,41 @@ function parseOptions(args) {
272
272
  // src/scaffold.ts
273
273
  import { lstat, mkdir, readdir, readFile, rm, writeFile } from "fs/promises";
274
274
  import { homedir } from "os";
275
- import { basename as basename2, dirname, extname, join, parse, relative, resolve, sep } from "path";
275
+ import { basename as basename2, dirname, extname, join as join2, parse, relative, resolve, sep } from "path";
276
+ import { z as z3 } from "zod";
277
+
278
+ // src/format.ts
279
+ import { execFileSync } from "child_process";
280
+ import { existsSync } from "fs";
281
+ import { createRequire } from "module";
282
+ import { join } from "path";
276
283
  import { z as z2 } from "zod";
284
+ var ProcessReportSchema = z2.object({
285
+ header: z2.object({ glibcVersionRuntime: z2.string().optional() })
286
+ });
287
+ function nativeBiome() {
288
+ const requireBiome = createRequire(import.meta.resolve("@biomejs/biome/bin/biome"));
289
+ const musl = process.platform === "linux" && ProcessReportSchema.parse(process.report.getReport()).header.glibcVersionRuntime === undefined;
290
+ const distribution = `@biomejs/cli-${process.platform}-${process.arch}${musl ? "-musl" : ""}`;
291
+ return requireBiome.resolve(`${distribution}/biome${process.platform === "win32" ? ".exe" : ""}`);
292
+ }
293
+ function defaultProjectFormatter() {
294
+ return { binary: nativeBiome(), timeoutMs: 15000 };
295
+ }
296
+ function formatProject(destination, formatter) {
297
+ if (!existsSync(join(destination, "biome.json")))
298
+ return;
299
+ execFileSync(formatter.binary, ["check", "--write", "--linter-enabled=false", "."], {
300
+ cwd: destination,
301
+ stdio: ["ignore", "pipe", "pipe"],
302
+ encoding: "utf8",
303
+ timeout: formatter.timeoutMs,
304
+ killSignal: "SIGKILL",
305
+ maxBuffer: 1024 * 1024
306
+ });
307
+ }
308
+
309
+ // src/scaffold.ts
277
310
  var TEXT_EXTENSIONS = new Set([
278
311
  ".cjs",
279
312
  ".css",
@@ -297,12 +330,12 @@ var TEMPLATE_RENAMES = new Map([
297
330
  ["_env.example.append", ".env.example"],
298
331
  ["_gitignore", ".gitignore"]
299
332
  ]);
300
- var RootManifestSchema = z2.looseObject({
301
- name: z2.string().min(1),
302
- catalog: z2.record(z2.string(), z2.string()).optional(),
303
- workspaces: z2.unknown().optional(),
304
- dependencies: z2.record(z2.string(), z2.string()).optional(),
305
- devDependencies: z2.record(z2.string(), z2.string()).optional()
333
+ var RootManifestSchema = z3.looseObject({
334
+ name: z3.string().min(1),
335
+ catalog: z3.record(z3.string(), z3.string()).optional(),
336
+ workspaces: z3.unknown().optional(),
337
+ dependencies: z3.record(z3.string(), z3.string()).optional(),
338
+ devDependencies: z3.record(z3.string(), z3.string()).optional()
306
339
  });
307
340
  var IGNORED_DIRECTORIES = new Set([
308
341
  ".next",
@@ -367,7 +400,7 @@ async function collectMaterialisedFiles(templateDirectory, directory, files) {
367
400
  const entries = await readdir(directory, { withFileTypes: true });
368
401
  entries.sort((left, right) => left.name.localeCompare(right.name));
369
402
  for (const entry of entries) {
370
- const sourcePath = join(directory, entry.name);
403
+ const sourcePath = join2(directory, entry.name);
371
404
  if (!shouldIncludeTemplatePath(templateDirectory, sourcePath))
372
405
  continue;
373
406
  if (entry.isDirectory()) {
@@ -379,7 +412,7 @@ async function collectMaterialisedFiles(templateDirectory, directory, files) {
379
412
  }
380
413
  const targetName = TEMPLATE_RENAMES.get(entry.name);
381
414
  const sourceRelativePath = relative(templateDirectory, sourcePath);
382
- const outputRelativePath = targetName ? join(dirname(sourceRelativePath), targetName) : sourceRelativePath;
415
+ const outputRelativePath = targetName ? join2(dirname(sourceRelativePath), targetName) : sourceRelativePath;
383
416
  const materialisedName = outputRelativePath.endsWith(".append") ? outputRelativePath.slice(0, -".append".length) : outputRelativePath;
384
417
  const fileExtension = extname(materialisedName);
385
418
  const content = TEXT_EXTENSIONS.has(fileExtension) || targetName ? await readFile(sourcePath, "utf8") : await readFile(sourcePath);
@@ -396,19 +429,20 @@ async function materialiseTemplateFiles(templateDirectory) {
396
429
  await collectMaterialisedFiles(templateDirectory, templateDirectory, files);
397
430
  return files;
398
431
  }
399
- async function writeMaterialisedFiles(destination, files) {
432
+ async function writeMaterialisedFiles(destination, files, slug) {
400
433
  for (const file of files) {
401
- const targetPath = join(destination, file.outputPath);
434
+ const targetPath = join2(destination, file.outputPath);
402
435
  await mkdir(dirname(targetPath), { recursive: true });
436
+ const content = typeof file.content === "string" ? file.content.replaceAll("@app/", `@${slug}/`) : file.content;
403
437
  if (file.append) {
404
- if (typeof file.content !== "string") {
438
+ if (typeof content !== "string") {
405
439
  throw new Error(`Append template entries must contain text: ${file.sourcePath}`);
406
440
  }
407
441
  const existing = await readFile(targetPath, "utf8");
408
442
  await writeFile(targetPath, `${existing.trimEnd()}
409
- ${file.content.trimStart()}`);
443
+ ${content.trimStart()}`);
410
444
  } else {
411
- await writeFile(targetPath, file.content);
445
+ await writeFile(targetPath, content);
412
446
  }
413
447
  }
414
448
  }
@@ -418,23 +452,23 @@ async function scaffoldProject(templateDirectory, destination, options = {}) {
418
452
  const destinationExisted = await assertDestinationAvailable(resolvedDestination);
419
453
  await mkdir(resolvedDestination, { recursive: true });
420
454
  try {
421
- await writeMaterialisedFiles(resolvedDestination, await materialiseTemplateFiles(templateDirectory));
455
+ await writeMaterialisedFiles(resolvedDestination, await materialiseTemplateFiles(templateDirectory), identity.slug);
422
456
  if (options.overlayDirectory) {
423
- await writeMaterialisedFiles(resolvedDestination, await materialiseTemplateFiles(options.overlayDirectory));
457
+ await writeMaterialisedFiles(resolvedDestination, await materialiseTemplateFiles(options.overlayDirectory), identity.slug);
424
458
  }
425
459
  if (options.lockfile === false) {
426
- await rm(join(resolvedDestination, "bun.lock"), { force: true });
460
+ await rm(join2(resolvedDestination, "bun.lock"), { force: true });
427
461
  }
428
- const declarationPath = join(resolvedDestination, "project.json");
462
+ const declarationPath = join2(resolvedDestination, "project.json");
429
463
  const declaration = withIdentity(JSON.parse(await readFile(declarationPath, "utf8")), identity);
430
464
  await writeFile(declarationPath, `${JSON.stringify(declaration, undefined, 2)}
431
465
  `);
432
466
  if (options.identityModule !== false) {
433
- const identityPath = join(resolvedDestination, APP_IDENTITY_PATH);
467
+ const identityPath = join2(resolvedDestination, APP_IDENTITY_PATH);
434
468
  await mkdir(dirname(identityPath), { recursive: true });
435
469
  await writeFile(identityPath, renderAppIdentityModule(declaration.identity));
436
470
  }
437
- const manifestPath = join(resolvedDestination, "package.json");
471
+ const manifestPath = join2(resolvedDestination, "package.json");
438
472
  const manifest = RootManifestSchema.parse(JSON.parse(await readFile(manifestPath, "utf8")));
439
473
  const catalog = options.stitchkitCatalogTarget ? { ...manifest.catalog ?? {}, stitchkit: options.stitchkitCatalogTarget } : manifest.catalog;
440
474
  const isWorkspace = manifest.workspaces !== undefined;
@@ -451,10 +485,10 @@ async function scaffoldProject(templateDirectory, destination, options = {}) {
451
485
  return dependencies;
452
486
  return {
453
487
  ...dependencies,
454
- ...dependencies.stitchkit?.startsWith("file:") && {
488
+ ...dependencies.stitchkit?.startsWith("link:") && {
455
489
  stitchkit: localReference("stitchkit")
456
490
  },
457
- ...dependencies["stitchkit-tui"]?.startsWith("file:") && {
491
+ ...dependencies["stitchkit-tui"]?.startsWith("link:") && {
458
492
  "stitchkit-tui": localReference("stitchkit-tui")
459
493
  }
460
494
  };
@@ -472,12 +506,13 @@ async function scaffoldProject(templateDirectory, destination, options = {}) {
472
506
  }
473
507
  }, undefined, 2)}
474
508
  `);
509
+ formatProject(resolvedDestination, options.formatter ?? defaultProjectFormatter());
475
510
  } catch (error) {
476
511
  if (!destinationExisted) {
477
512
  await rm(resolvedDestination, { recursive: true, force: true });
478
513
  } else {
479
514
  const entries = await readdir(resolvedDestination);
480
- await Promise.all(entries.map((entry) => rm(join(resolvedDestination, entry), { recursive: true, force: true })));
515
+ await Promise.all(entries.map((entry) => rm(join2(resolvedDestination, entry), { recursive: true, force: true })));
481
516
  }
482
517
  throw error;
483
518
  }
@@ -538,7 +573,7 @@ Created ${options.displayName ?? basename3(destination)}${mode}
538
573
  }
539
574
  }
540
575
  async function readStitchkitCatalogTarget(templateDirectory) {
541
- const manifest = JSON.parse(await readFile2(join2(templateDirectory, "package.json"), "utf8"));
576
+ const manifest = JSON.parse(await readFile2(join3(templateDirectory, "package.json"), "utf8"));
542
577
  if (typeof manifest !== "object" || manifest === null || !("catalog" in manifest) || typeof manifest.catalog !== "object" || manifest.catalog === null || !("stitchkit" in manifest.catalog) || typeof manifest.catalog.stitchkit !== "string") {
543
578
  throw new Error("Application template is missing catalog.stitchkit");
544
579
  }
@@ -549,8 +584,8 @@ if (import.meta.main) {
549
584
  }
550
585
  async function roleAddresses(destination) {
551
586
  try {
552
- const declaration = parseProjectDeclaration(JSON.parse(await readFile2(join2(destination, "project.json"), "utf8")));
553
- const environment = readEnvironmentExample(await readFile2(join2(destination, ".env.example"), "utf8"));
587
+ const declaration = parseProjectDeclaration(JSON.parse(await readFile2(join3(destination, "project.json"), "utf8")));
588
+ const environment = readEnvironmentExample(await readFile2(join3(destination, ".env.example"), "utf8"));
554
589
  const host = environment.BIND_HOST ?? "127.0.0.1";
555
590
  return declaration.roles.flatMap((role) => {
556
591
  const port = role.listener && environment[role.listener.portVariable];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-stitchkit",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
4
4
  "description": "Create a production-shaped Stitchkit application",
5
5
  "license": "MIT",
6
6
  "author": "Max Listov <maxlistov@gmail.com>",
@@ -74,21 +74,22 @@
74
74
  "prepublishOnly": "bun run check && bun run test && bun run build"
75
75
  },
76
76
  "dependencies": {
77
- "zod": "^4.6.5"
77
+ "@biomejs/biome": "2.6.5",
78
+ "zod": "^4.6.7"
78
79
  },
79
80
  "devDependencies": {
80
- "@opentui/core": "^0.5.12",
81
- "@opentui/react": "^0.5.12",
81
+ "@opentui/core": "^0.8.2",
82
+ "@opentui/react": "^0.8.2",
82
83
  "@openrouter/ai-sdk-provider": "^3.1.0",
83
- "@types/bun": "^1.4.2",
84
+ "@types/bun": "^1.4.4",
84
85
  "@types/react": "^19.3.0",
85
- "ai": "^7.0.111",
86
- "react": "^19.3.0",
87
- "stitchkit": "0.117.0",
86
+ "ai": "^7.0.162",
87
+ "react": "^19.3.1",
88
+ "stitchkit": "0.119.0",
88
89
  "typescript": "^7.0.2"
89
90
  },
90
91
  "engines": {
91
92
  "bun": ">=1.2.0"
92
93
  },
93
- "packageManager": "bun@1.4.2"
94
+ "packageManager": "bun@1.4.4"
94
95
  }
@@ -1,5 +1,8 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.6.5/schema.json",
3
+ "markdown": {
4
+ "formatter": { "enabled": false }
5
+ },
3
6
  "files": {
4
7
  "includes": [
5
8
  "**",