@quickback-dev/cli 0.60.0 → 0.60.2

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 (82) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +42 -14
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/commands/cursor.d.ts.map +1 -1
  5. package/dist/commands/cursor.js +6 -7
  6. package/dist/commands/cursor.js.map +1 -1
  7. package/dist/commands/deploy.d.ts.map +1 -1
  8. package/dist/commands/deploy.js +1 -9
  9. package/dist/commands/deploy.js.map +1 -1
  10. package/dist/commands/docs.d.ts.map +1 -1
  11. package/dist/commands/docs.js +3 -1
  12. package/dist/commands/docs.js.map +1 -1
  13. package/dist/commands/mcp.d.ts.map +1 -1
  14. package/dist/commands/mcp.js +3 -1
  15. package/dist/commands/mcp.js.map +1 -1
  16. package/dist/commands/migrations.d.ts.map +1 -1
  17. package/dist/commands/migrations.js +1 -9
  18. package/dist/commands/migrations.js.map +1 -1
  19. package/dist/docs/index.d.ts +25 -0
  20. package/dist/docs/index.d.ts.map +1 -0
  21. package/dist/docs/index.js +70 -0
  22. package/dist/docs/index.js.map +1 -0
  23. package/dist/docs/index.test.d.ts +2 -0
  24. package/dist/docs/index.test.d.ts.map +1 -0
  25. package/dist/docs/index.test.js +51 -0
  26. package/dist/docs/index.test.js.map +1 -0
  27. package/dist/index.js +1 -1
  28. package/dist/lib/api-client.d.ts +15 -0
  29. package/dist/lib/api-client.d.ts.map +1 -1
  30. package/dist/lib/api-client.js.map +1 -1
  31. package/dist/lib/auth.d.ts +0 -4
  32. package/dist/lib/auth.d.ts.map +1 -1
  33. package/dist/lib/auth.js +0 -16
  34. package/dist/lib/auth.js.map +1 -1
  35. package/dist/lib/compiler-stubs.d.ts +22 -67
  36. package/dist/lib/compiler-stubs.d.ts.map +1 -1
  37. package/dist/lib/compiler-stubs.js +35 -100
  38. package/dist/lib/compiler-stubs.js.map +1 -1
  39. package/dist/lib/copy-passthrough.d.ts +43 -0
  40. package/dist/lib/copy-passthrough.d.ts.map +1 -0
  41. package/dist/lib/copy-passthrough.js +118 -0
  42. package/dist/lib/copy-passthrough.js.map +1 -0
  43. package/dist/lib/copy-public-assets.d.ts +19 -22
  44. package/dist/lib/copy-public-assets.d.ts.map +1 -1
  45. package/dist/lib/copy-public-assets.js +20 -99
  46. package/dist/lib/copy-public-assets.js.map +1 -1
  47. package/dist/lib/copy-source-apps.d.ts +22 -20
  48. package/dist/lib/copy-source-apps.d.ts.map +1 -1
  49. package/dist/lib/copy-source-apps.js +21 -105
  50. package/dist/lib/copy-source-apps.js.map +1 -1
  51. package/dist/lib/file-writer.d.ts +0 -5
  52. package/dist/lib/file-writer.d.ts.map +1 -1
  53. package/dist/lib/file-writer.js +0 -17
  54. package/dist/lib/file-writer.js.map +1 -1
  55. package/dist/lib/prepare-output.d.ts.map +1 -1
  56. package/dist/lib/prepare-output.js +1 -9
  57. package/dist/lib/prepare-output.js.map +1 -1
  58. package/dist/skill/docs/changelog/index.md +49 -3
  59. package/dist/skill/docs/configure/index.md +3 -0
  60. package/dist/skill/docs/platform/database/d1.md +98 -0
  61. package/dist/skill/docs/platform/database/neon.md +14 -7
  62. package/dist/skill/docs/start/deploy-browser.md +35 -1
  63. package/dist/skill/docs/tooling/output.md +36 -0
  64. package/dist/templates/registry.d.ts +0 -5
  65. package/dist/templates/registry.d.ts.map +1 -1
  66. package/dist/templates/registry.js +0 -21
  67. package/dist/templates/registry.js.map +1 -1
  68. package/package.json +2 -3
  69. package/src/skill/docs/changelog/index.md +49 -3
  70. package/src/skill/docs/configure/index.md +3 -0
  71. package/src/skill/docs/platform/database/d1.md +98 -0
  72. package/src/skill/docs/platform/database/neon.md +14 -7
  73. package/src/skill/docs/start/deploy-browser.md +35 -1
  74. package/src/skill/docs/tooling/output.md +36 -0
  75. package/dist/docs/content.d.ts +0 -7
  76. package/dist/docs/content.d.ts.map +0 -1
  77. package/dist/docs/content.js +0 -737
  78. package/dist/docs/content.js.map +0 -1
  79. package/dist/lib/helpers.d.ts +0 -39
  80. package/dist/lib/helpers.d.ts.map +0 -1
  81. package/dist/lib/helpers.js +0 -299
  82. package/dist/lib/helpers.js.map +0 -1
@@ -3,36 +3,21 @@
3
3
  *
4
4
  * Anything under `<projectRoot>/quickback/apps/<name>/` is copied verbatim
5
5
  * into `<outputDir>/src/apps/<name>/`, preserving directory structure. The
6
- * compiler never sees these files — they ride past it as bytes and land
7
- * alongside the SPA shells the compiler emits.
6
+ * compiler never sees these files — they land alongside the SPA shells it
7
+ * emits (`cms/`, `account/`).
8
8
  *
9
9
  * Why a separate folder from `quickback/public/`: `public/` is for static
10
- * binary assets (logos, fonts, OG images) that ride past the worker as
11
- * bytes. `apps/` is for hand-authored TypeScript / JavaScript / TSX apps
12
- * — companion mini-SPAs (e.g. `m/`, `admin/`) that live alongside the
13
- * compiler-emitted `cms/` and `account/` shells. Different conventions,
14
- * different ergonomics: this folder additionally skips `node_modules/`,
15
- * `dist/`, and `build/` so a casual `bun install` inside a hand-authored
16
- * app folder doesn't drag the world into the worker bundle.
10
+ * binary assets (logos, fonts, OG images). This folder is for hand-authored
11
+ * TypeScript / JavaScript / TSX — companion mini-SPAs (e.g. `m/`, `admin/`).
12
+ * Different conventions, different ergonomics: this lane additionally prunes
13
+ * `node_modules/`, `dist/`, `build/` and friends so a casual `bun install`
14
+ * inside an app folder doesn't drag the world into the worker bundle.
17
15
  *
18
- * Why bytes, not strings: the compiler manifest is a utf-8 string channel
19
- * which is fine for source code in practice, but corrupts any binary fixture
20
- * a source-authored app might bundle (sprite sheets, sample WAVs, etc.).
21
- * Routing the copy through `fs.copyFile` keeps everything intact.
22
- *
23
- * Why after the wipe-and-write: `prepareGeneratedDir` wipes `src/` based on
24
- * the compiler manifest. We restore the user's hand-authored tree on top of
25
- * the fresh write. Files removed from `quickback/apps/` disappear on the
26
- * next compile — no orphan tracking needed.
27
- *
28
- * Collisions with compiler-emitted paths (e.g. dropping a hand-authored
29
- * `cms/index.tsx` that would shadow the SPA shell) are rejected with a
30
- * clear error rather than silently overwritten.
16
+ * The copy mechanics for both lanes live in `copy-passthrough.ts`; this
17
+ * module supplies the folder name, the prune set, and the error type.
31
18
  */
32
- import { promises as fs } from 'fs';
33
- import { join, relative, sep } from 'path';
19
+ import { collisionMessage, copyPassthrough, } from './copy-passthrough.js';
34
20
  const APPS_DIR_NAME = 'apps';
35
- const TARGET_PREFIX = join('src', 'apps');
36
21
  /**
37
22
  * Subdirectories we never copy. Symmetric with what a developer would
38
23
  * `.gitignore` inside a hand-authored app folder. Not configurable for now —
@@ -43,14 +28,12 @@ const SKIP_DIRS = new Set(['node_modules', 'dist', 'build', '.next', '.turbo', '
43
28
  export class SourceAppCollisionError extends Error {
44
29
  collisions;
45
30
  constructor(collisions) {
46
- const lines = collisions.map((c) => ` • quickback/${APPS_DIR_NAME}/${c.sourcePath} → ${c.manifestPath} (already emitted by compiler)`);
47
- super([
48
- `quickback/${APPS_DIR_NAME}/ contains ${collisions.length} file(s) that would overwrite compiler output:`,
49
- ...lines,
50
- `Rename or remove these files. Reserved subpaths under src/apps/ include cms/ and account/ when those SPAs are enabled.`,
51
- ].join('\n'));
31
+ super(collisionMessage(APPS_DIR_NAME, collisions));
52
32
  this.name = 'SourceAppCollisionError';
53
- this.collisions = collisions;
33
+ this.collisions = collisions.map((c) => ({
34
+ sourcePath: c.relPath,
35
+ manifestPath: c.manifestPath,
36
+ }));
54
37
  }
55
38
  }
56
39
  /**
@@ -59,78 +42,11 @@ export class SourceAppCollisionError extends Error {
59
42
  * Returns `{ copied: 0 }` when the source folder is absent — apps/ is an
60
43
  * opt-in convention, not a required directory.
61
44
  */
62
- export async function copySourceApps(options) {
63
- const sourceDir = join(options.projectRoot, 'quickback', APPS_DIR_NAME);
64
- if (!(await isDirectory(sourceDir))) {
65
- return { copied: 0, destPaths: [] };
66
- }
67
- const sources = await collectFiles(sourceDir);
68
- if (sources.length === 0) {
69
- return { copied: 0, sourceDir, destPaths: [] };
70
- }
71
- const manifestSet = new Set();
72
- for (const p of options.manifestPaths)
73
- manifestSet.add(toPosix(p));
74
- const collisions = [];
75
- const destPaths = [];
76
- for (const rel of sources) {
77
- const dest = join(TARGET_PREFIX, rel);
78
- const destPosix = toPosix(dest);
79
- if (manifestSet.has(destPosix)) {
80
- collisions.push({ sourcePath: toPosix(rel), manifestPath: destPosix });
81
- }
82
- destPaths.push(dest);
83
- }
84
- if (collisions.length > 0) {
85
- throw new SourceAppCollisionError(collisions);
86
- }
87
- for (const rel of sources) {
88
- const src = join(sourceDir, rel);
89
- const dest = join(options.outputDir, TARGET_PREFIX, rel);
90
- await fs.mkdir(join(dest, '..'), { recursive: true });
91
- await fs.copyFile(src, dest);
92
- }
93
- return { copied: sources.length, sourceDir, destPaths };
94
- }
95
- async function isDirectory(p) {
96
- try {
97
- const s = await fs.stat(p);
98
- return s.isDirectory();
99
- }
100
- catch {
101
- return false;
102
- }
103
- }
104
- /**
105
- * Walk a directory tree and return every regular file as a path relative
106
- * to the root. Hidden entries (`.DS_Store`, `.git/`, dotfiles) and the
107
- * `SKIP_DIRS` set (`node_modules/`, `dist/`, `build/`, etc.) are pruned —
108
- * accidentally bundling those would inflate the worker output and was a
109
- * top reason `quickback/public/` couldn't simply absorb this use case.
110
- */
111
- async function collectFiles(root) {
112
- const out = [];
113
- async function walk(dir) {
114
- const entries = await fs.readdir(dir, { withFileTypes: true });
115
- for (const entry of entries) {
116
- if (entry.name.startsWith('.'))
117
- continue;
118
- if (entry.isDirectory() && SKIP_DIRS.has(entry.name))
119
- continue;
120
- const full = join(dir, entry.name);
121
- if (entry.isDirectory()) {
122
- await walk(full);
123
- }
124
- else if (entry.isFile()) {
125
- out.push(relative(root, full));
126
- }
127
- }
128
- }
129
- await walk(root);
130
- out.sort();
131
- return out;
132
- }
133
- function toPosix(p) {
134
- return sep === '/' ? p : p.split(sep).join('/');
45
+ export function copySourceApps(options) {
46
+ return copyPassthrough({
47
+ dirName: APPS_DIR_NAME,
48
+ skipDirs: SKIP_DIRS,
49
+ collisionError: (collisions) => new SourceAppCollisionError(collisions),
50
+ }, options);
135
51
  }
136
52
  //# sourceMappingURL=copy-source-apps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy-source-apps.js","sourceRoot":"","sources":["../../src/lib/copy-source-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE3C,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAoB1F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,UAAU,CAAsD;IAEzE,YAAY,UAA+D;QACzE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,aAAa,IAAI,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,YAAY,gCAAgC,CAC1G,CAAC;QACF,KAAK,CACH;YACE,aAAa,aAAa,cAAc,UAAU,CAAC,MAAM,gDAAgD;YACzG,GAAG,KAAK;YACR,wHAAwH;SACzH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAA8B;IAE9B,MAA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EAAE,EAAE,CAAC,CAAC;YACvC,UAAU,EAAE,CAAC,CAAC,OAAO;YACrB,YAAY,EAAE,CAAC,CAAC,YAAY;SAC7B,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,OAA8B;IAE9B,OAAO,eAAe,CACpB;QACE,OAAO,EAAE,aAAa;QACtB,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,uBAAuB,CAAC,UAAU,CAAC;KACxE,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -9,7 +9,6 @@ export interface GeneratedFile {
9
9
  type?: string;
10
10
  feature?: string;
11
11
  }
12
- export declare function cleanOutputDir(dir: string): Promise<void>;
13
12
  /**
14
13
  * Write generated files to disk (overwrites all)
15
14
  */
@@ -23,8 +22,4 @@ export declare function writeFiles(outputDir: string, files: GeneratedFile[]): P
23
22
  * - Config files: Overwrite
24
23
  */
25
24
  export declare function writeFilesWithMerge(outputDir: string, files: GeneratedFile[]): Promise<void>;
26
- /**
27
- * Write a single file
28
- */
29
- export declare function writeFile(filePath: string, content: string): Promise<void>;
30
25
  //# sourceMappingURL=file-writer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/lib/file-writer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAOD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/D;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWzF;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BlG;AAkED;;GAEG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhF"}
1
+ {"version":3,"file":"file-writer.d.ts","sourceRoot":"","sources":["../../src/lib/file-writer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID;;GAEG;AACH,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAWzF;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BlG"}
@@ -6,16 +6,7 @@
6
6
  import { promises as fs } from 'fs';
7
7
  import { join, dirname } from 'path';
8
8
  import { pathExists, runWithLimit } from './async-utils.js';
9
- /**
10
- * Clean and recreate output directory (used for testing only)
11
- */
12
9
  const WRITE_CONCURRENCY = 16;
13
- export async function cleanOutputDir(dir) {
14
- if (await pathExists(dir)) {
15
- await fs.rm(dir, { recursive: true, force: true });
16
- }
17
- await fs.mkdir(dir, { recursive: true });
18
- }
19
10
  /**
20
11
  * Write generated files to disk (overwrites all)
21
12
  */
@@ -126,12 +117,4 @@ async function mergePackageJson(existingPath, newContent) {
126
117
  return newContent;
127
118
  }
128
119
  }
129
- /**
130
- * Write a single file
131
- */
132
- export async function writeFile(filePath, content) {
133
- const dir = dirname(filePath);
134
- await fs.mkdir(dir, { recursive: true });
135
- await fs.writeFile(filePath, content, 'utf-8');
136
- }
137
120
  //# sourceMappingURL=file-writer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/lib/file-writer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAS5D;;GAEG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,IAAI,MAAM,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,SAAiB,EAAE,KAAsB;IACxE,MAAM,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAElC,0BAA0B;QAC1B,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE7C,aAAa;QACb,MAAM,EAAE,CAAC,SAAS,CAAC,QAA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{ promises as fs } from 'fs';
23
23
  import { join, sep } from 'path';
24
+ import { pathExists } from './async-utils.js';
24
25
  const DEFAULT_ARCHIVE_KEEP = 3;
25
26
  /**
26
27
  * Archive then wipe the target dir, in preparation for a fresh write.
@@ -75,15 +76,6 @@ export async function pruneArchives(archiveBase, prefix, keep) {
75
76
  await fs.rm(join(archiveBase, old), { recursive: true, force: true }).catch(() => { });
76
77
  }
77
78
  }
78
- async function pathExists(p) {
79
- try {
80
- await fs.access(p);
81
- return true;
82
- }
83
- catch {
84
- return false;
85
- }
86
- }
87
79
  function normalizePath(p) {
88
80
  return sep === '/' ? p : p.split(sep).join('/');
89
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prepare-output.js","sourceRoot":"","sources":["../../src/lib/prepare-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAsB/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAiB,EACjB,SAAiB,EACjB,QAA0B,EAC1B,UAA0B,EAAE;IAE5B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAE9C,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IACvD,CAAC;IAED,MAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;IACxE,IAAI,sBAAsB,GAAG,KAAK,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CA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AI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
@@ -8,6 +8,34 @@ The current release series. Older entries are archived by version range:
8
8
  - [v0.20 – v0.29](/changelog/v0.2x)
9
9
  - [v0.18 and earlier](/changelog/v0.1x)
10
10
 
11
+ ## v0.60.1 — August 3, 2026
12
+
13
+ ### Fix: moved files no longer leave orphans behind
14
+
15
+ Upgrading to v0.60 left the old `openapi.json`, `asyncapi.json`, and
16
+ `schema-registry.json` sitting at your project root. The compiler wrote the new
17
+ copies under `src/apps/__quickback/spec/`, but nothing removed the old ones —
18
+ on a real project that was **6.7 MB of stale specs**, still committed, that
19
+ tooling pointed at the old path kept reading in place of the live ones.
20
+
21
+ That is worse than a clean break: a stale spec drifts from your API silently,
22
+ where a missing file fails immediately.
23
+
24
+ The root cause was structural, not a one-off. The compiler's output is a
25
+ manifest of files to **write**, with no way to express "and drop what you wrote
26
+ last time at a path I no longer use." The CLI's pre-write wipe covers `src/`
27
+ only, so any path that relocates outside `src/` leaves an orphan forever.
28
+
29
+ The compiler now also returns **retired paths**, and the CLI deletes them on
30
+ your next compile. See [Retired paths](/tooling/output#retired-paths).
31
+
32
+ Every filter errs toward keeping a file, because a wrong deletion is
33
+ unrecoverable while a missed one is only untidy — a moved path is removed only
34
+ once its replacement is actually emitted, a path the current compile still
35
+ writes is never removed, and nothing may escape the output directory.
36
+
37
+ No action needed: recompile and the stale files go.
38
+
11
39
  ## v0.60.0 — August 3, 2026
12
40
 
13
41
  ### Spec blobs move out of the Worker bundle
@@ -20,9 +48,23 @@ binding](https://developers.cloudflare.com/workers/static-assets/).
20
48
  Previously the specs shipped as text imports parsed lazily on first request.
21
49
  That kept their object graphs out of the isolate startup window, but the *bytes*
22
50
  still sat in the script V8 has to parse on every cold start. On a large API
23
- that is measured in megabytes — one real project carried 6.7 MB of a 23.7 MB
24
- bundle — spent to serve discovery routes most callers never request. As assets
25
- they leave the bundle entirely.
51
+ that is measured in megabytes, spent to serve discovery routes most callers
52
+ never request. As assets they leave the bundle entirely.
53
+
54
+ Measured on a 40-feature production API (paired runs, alternating, same
55
+ machine):
56
+
57
+ | | Before | After | |
58
+ |---|---|---|---|
59
+ | Bundle (raw) | 23,610 KiB | 17,218 KiB | **−6,392 KiB (−27%)** |
60
+ | Bundle (gzip) | 3,027 KiB | 2,762 KiB | −266 KiB (−8.8%) |
61
+ | Startup CPU (median) | 258 ms | 232 ms | −26 ms (−10%) |
62
+ | of which GC | 77 ms | 70 ms | −7 ms |
63
+
64
+ The bundle numbers are exact. The CPU figure is a local `wrangler check
65
+ startup` median whose run-to-run ranges overlap, so treat −10% as the shape of
66
+ the win rather than a precise constant — and note it scales with spec size: a
67
+ project with a small spec will see little.
26
68
 
27
69
  Two consequences worth knowing:
28
70
 
@@ -48,6 +90,10 @@ structure](/tooling/output#spec-blobs-are-assets-not-bundle).
48
90
  > `api-types.gen.ts` is **unaffected** — the compiler still generates it at the
49
91
  > project root, which is why most projects never invoke `openapi-typescript`
50
92
  > directly and need no change at all.
93
+ >
94
+ > On your first compile after upgrading, the CLI deletes the now-orphaned root
95
+ > copies. It only does so for blobs it just re-emitted under the new path, so an
96
+ > older compiler that still writes to the root is never second-guessed.
51
97
 
52
98
 
53
99
  ## v0.59.1 — July 29, 2026
@@ -107,10 +107,13 @@ Every optional top-level key the config accepts is listed below. You never have
107
107
  | `agents` | `boolean \| object` | AI/agent discovery surface (`robots.txt`, `llms.txt`, MCP, OAuth discovery) — see [Agents](/configure/agents) |
108
108
  | `security` | `object \| false` | HTTP response security headers (CSP, HSTS, COOP/COEP, Referrer/Permissions-Policy) — see [Security Headers](/configure/security) |
109
109
  | `openapi` | `object` | OpenAPI spec generation (`generate`, `publish`, `docs: 'scalar' \| 'swagger'`, `types`) — see [OpenAPI](/api/openapi) |
110
+ | `types` | `boolean \| object` | Quickback's first-party TypeScript contract (`output`, `brandIds`) — see [TypeScript](/api/typescript) |
110
111
  | `schemaRegistry` | `object` | Schema registry generation for the CMS (`{ generate: false }` to disable) — see [Schema Registry](/ui/admin/schema-registry) |
111
112
  | `etag` | `object` | ETag caching for GET responses (`{ enabled: false }` to disable) — see [Caching & ETags](/api/caching) |
112
113
  | `email` | `object` | Email delivery config (`provider`, `from`, `fromName`, `region`) — see [Email Configuration](#email-configuration) |
114
+ | `push` | `object` | Web Push (VAPID keys, TTL/urgency defaults, queue fan-out) — see [Push](/platform/push) |
113
115
  | `bindings` | `object` | Extra Cloudflare bindings (durable objects, queues, R2, services, `vars`, AI) — see [Bindings](/configure/bindings) |
116
+ | `environments` | `object` | Named deployment targets (`dev`/`staging`/`production`) → one `[env.<name>]` Wrangler stanza each, on Cloudflare D1 or Neon Hyperdrive — see [D1](/platform/database/d1#named-cloudflare-deployment-environments) and [Neon](/platform/database/neon#named-cloudflare-deployment-environments) |
114
117
  | `compiler` | `object` | Compiler internals — `features.auditFields: false`, `migrations.renames` (headless CI), Neon `migrations.foreignKeys`, `securityContracts`, `injectId`, `routes` |
115
118
  | `build` | `object` | Build options (`outputDir`, `packageManager`, `dependencies`) — see [Custom Dependencies](#custom-dependencies) |
116
119
  | `dev` | `object` | Local development settings (`port`, `api`, `cms`, `account`, `hostnames`) — see [Variables](/configure/variables) |
@@ -140,6 +140,104 @@ wrangler d1 create my-app-files
140
140
  > `wrangler d1 create` dance only when you need to control provisioning yourself.
141
141
 
142
142
 
143
+ ## Named Cloudflare deployment environments
144
+
145
+ The bindings above describe a single deploy target. A project that needs
146
+ isolated `dev` / `staging` / `production` Workers — each with its own D1
147
+ databases — declares them under the top-level `environments` block instead of
148
+ hand-maintaining a second `wrangler.dev.toml`:
149
+
150
+ ```typescript title="quickback/quickback.config.ts"
151
+ export default defineConfig({
152
+ name: "my-app",
153
+ providers: {
154
+ runtime: defineRuntime("cloudflare"),
155
+ database: defineDatabase("cloudflare-d1", {}),
156
+ auth: defineAuth("better-auth"),
157
+ },
158
+ environments: {
159
+ dev: {
160
+ domain: "api-dev.example.com",
161
+ // `name` is optional — defaults to `${config.name}-${key}` ("my-app-dev")
162
+ worker: {
163
+ env: "dev",
164
+ workersDev: true,
165
+ previewUrls: false,
166
+ vars: { BETTER_AUTH_URL: "https://api-dev.example.com" },
167
+ requiredSecrets: ["BETTER_AUTH_SECRET"],
168
+ bindings: {
169
+ d1: {
170
+ auth: { databaseId: "…", databaseName: "my-app-auth-dev" },
171
+ features: { databaseId: "…", databaseName: "my-app-features-dev" },
172
+ },
173
+ },
174
+ },
175
+ },
176
+ production: {
177
+ domain: "api.example.com",
178
+ worker: {
179
+ env: "production",
180
+ workersDev: true,
181
+ previewUrls: false,
182
+ vars: { BETTER_AUTH_URL: "https://api.example.com" },
183
+ requiredSecrets: ["BETTER_AUTH_SECRET"],
184
+ bindings: {
185
+ d1: {
186
+ auth: { databaseId: "…", databaseName: "my-app-auth-prod" },
187
+ features: { databaseId: "…", databaseName: "my-app-features-prod" },
188
+ },
189
+ },
190
+ },
191
+ },
192
+ },
193
+ });
194
+ ```
195
+
196
+ Each entry emits one `[env.<name>]` stanza. Wrangler does **not** inherit
197
+ bindings or vars into a named environment, so Quickback repeats the full set
198
+ per target: `[[env.<name>.d1_databases]]` for every role the primary config
199
+ declares, plus `vars`, required secrets, KV, rate-limits, Cloudflare Email,
200
+ queue producers/consumers, R2 buckets, and the `[assets]` block. Binding names
201
+ and `migrations_dir` inherit from the primary config so runtime code reads by
202
+ binding name unchanged across environments; only `database_id` (and optionally
203
+ `database_name`) is per-environment.
204
+
205
+ While `environments` is present, the primary top-level binding blocks are
206
+ suppressed and there is no bare `deploy` script — every deployment names its
207
+ target:
208
+
209
+ ```bash
210
+ npm run deploy:dev # wrangler deploy --env dev
211
+ npm run deploy:production # wrangler deploy --env production
212
+
213
+ npm run db:migrate:dev:auth:remote # wrangler d1 migrations apply my-app-auth-dev --remote
214
+ npm run db:migrate:dev:remote # fan-out over every declared role
215
+ ```
216
+
217
+ The contract fails closed:
218
+
219
+ - Better Auth is required, and a logical `dev` target must exist (it is what
220
+ `npm run dev` selects).
221
+ - Every D1 role the primary config declares — `auth`, `features`, plus `audit`
222
+ and `webhooks` when enabled — needs its own `databaseId` per environment.
223
+ A missing role is a compile error, not a Worker that boots without a
224
+ database.
225
+ - The same `database_id` cannot appear in two environments; sharing one would
226
+ race the migration ledger.
227
+ - `requiredSecrets` and `rateLimits` must match the generated runtime
228
+ inventory exactly, so adding a feature tells you which override changed.
229
+ - `workersDev: true` and `previewUrls: false` must be explicit on each target.
230
+
231
+ Set secrets per target: `wrangler secret put BETTER_AUTH_SECRET --env dev`.
232
+
233
+ > `environments` may live at the top level (preferred) or under
234
+ > `providers.database.environments` (the original placement, still accepted).
235
+ > Declaring it in both places is a compile error. The same block powers
236
+ > [Neon Hyperdrive projects](/platform/database/neon#named-cloudflare-deployment-environments),
237
+ > which swap `bindings.d1` for `bindings.hyperdrive` and add a Neon `branch` per
238
+ > target.
239
+
240
+
143
241
  ## Accessing Data via API
144
242
 
145
243
  All data access in Quickback goes through the generated API endpoints—never direct database queries. This ensures security rules (firewall, access, guards, masking) are always enforced.
@@ -83,9 +83,15 @@ transactions (see [Interactive transactions](#interactive-transactions)).
83
83
  ## Named Cloudflare deployment environments
84
84
 
85
85
  Neon Hyperdrive projects can declare isolated Worker targets under
86
- `providers.database.environments`. A logical `dev` / `prod` pair on a project
87
- named `attend-v2` deploys through Wrangler as `attend-v2-dev` and
88
- `attend-v2-prod`:
86
+ `environments`. A logical `dev` / `prod` pair on a project named `attend-v2`
87
+ deploys through Wrangler as `attend-v2-dev` and `attend-v2-prod`:
88
+
89
+ > `environments` reads from either the **top-level** `environments` slot (the
90
+ > preferred placement, and the one the config scaffold advertises) or the
91
+ > original `providers.database.environments` slot shown below. Both are accepted
92
+ > and behave identically; declaring the block in **both** places is a compile
93
+ > error, because there would be no single source of truth.
94
+
89
95
 
90
96
  ```typescript title="quickback/quickback.config.ts"
91
97
  export default defineConfig({
@@ -215,10 +221,11 @@ maps to its configured Wrangler environment. Apply that branch's migrations
215
221
  first; migrations intentionally remain a separate target-owned step.
216
222
 
217
223
  Projects that omit `environments` retain the existing `wrangler.toml` and
218
- package scripts byte-for-byte. Named environments are currently restricted to
219
- Neon with `connectionMode: "hyperdrive"` and Better Auth; Quickback rejects
220
- other providers or partial binding sets instead of emitting a Worker that can
221
- deploy but fail at runtime.
224
+ package scripts byte-for-byte. Named environments require Better Auth, plus
225
+ either Neon with `connectionMode: "hyperdrive"` (this page) or Cloudflare D1
226
+ (see [Named deployment environments](/platform/database/d1#named-cloudflare-deployment-environments)).
227
+ Quickback rejects other providers or partial binding sets instead of emitting a
228
+ Worker that can deploy but fail at runtime.
222
229
 
223
230
  ## Environment variables
224
231
 
@@ -75,6 +75,40 @@ What's requested, and why:
75
75
 
76
76
  Nothing broader is requested — no zone, DNS, billing, or account-management access.
77
77
 
78
+ If you cancel at Cloudflare's consent screen — or Cloudflare ends the attempt for any other reason — you land back in Start with the card explaining what happened and a **Try Cloudflare again** button. Nothing is stored on a cancelled attempt, and a connection you already had is left untouched.
79
+
80
+ ## Connection states and recovery
81
+
82
+ The deploy card is the whole connection UI: it reports the state of your Cloudflare connection and offers exactly one thing to do about it.
83
+
84
+ | What you see | What happened | What to do |
85
+ |---|---|---|
86
+ | **Connect your Cloudflare account** | No connection stored | **Continue with Cloudflare** |
87
+ | Masked email badge, green | Connected and healthy | Deploy |
88
+ | "This connection expires in N minutes" | The access token is near the end of its life | Nothing yet — reconnect when it lapses |
89
+ | Badge turns amber, "· reconnect" | Token expired, grant revoked in Cloudflare, or the connection was deleted | **Reconnect Cloudflare** — one consent, same connection record |
90
+ | "This Cloudflare connection can't …" | The grant is missing a permission a deploy needs (an older connection, or a scope your OAuth client didn't allow) | **Reconnect Cloudflare** to grant the rest |
91
+ | "This Cloudflare login isn't a member of any account" | The identity you connected belongs to no Cloudflare account | Create or join an account in the Cloudflare dashboard, then reconnect |
92
+ | "Couldn't reach the deploy service…" | Transient failure talking to Quickback or Cloudflare | **Try again** |
93
+ | "Browser deploys are still rolling out" | Your session isn't in the rollout | Use [`quickback deploy`](/start/deploy) |
94
+
95
+ Deploy is disabled while a reconnect is pending, so a deploy never starts on a connection that can't finish it. If a connection dies *during* a deploy, the failure comes back as a reconnect prompt rather than a raw error — the deploy is safe to re-run after reconnecting, because provisioning adopts and migrations apply once.
96
+
97
+ ### Reconnecting
98
+
99
+ **Reconnect** re-runs the same consent and lands on the **same connection record** — your account picker, deploys, and claim links all keep working. Reconnecting is also how you widen a grant that's missing a permission.
100
+
101
+ ### Connecting more than one Cloudflare account
102
+
103
+ Connect a second Cloudflare login with **Connect another** and the card grows a login picker above the account picker. Start remembers which one you deployed with last and preselects it.
104
+
105
+ ### Disconnecting vs. revoking
106
+
107
+ Two different things, and you usually want both:
108
+
109
+ - **Disconnect** (in the card) makes Quickback forget the connection and its stored token. It doesn't touch anything in your Cloudflare account, and it never touches deployed apps — they're plain Workers in your account and keep running.
110
+ - **Revoke** (Cloudflare dashboard → **My Profile → Access Management → Connected Applications**, linked from the card) withdraws the grant itself. The stored ciphertext becomes useless immediately; the next thing Start tries turns into a reconnect prompt.
111
+
78
112
  ## Where your token lives
79
113
 
80
114
  The OAuth token never reaches your browser, the chat model, or the compiler. It is held by the deploy service and:
@@ -83,7 +117,7 @@ The OAuth token never reaches your browser, the chat model, or the compiler. It
83
117
  - bound to its connection record (the ciphertext is unusable if copied elsewhere);
84
118
  - decrypted only inside the API calls of an active deploy, then discarded.
85
119
 
86
- Tokens expire; when one does, Start shows a reconnect prompt and a fresh consent re-issues it onto the same connection. Revoking in Cloudflare kills the token immediately — the stored ciphertext becomes useless.
120
+ Tokens expire; when one does, Start shows a reconnect prompt and a fresh consent re-issues it onto the same connection. Revoking in Cloudflare kills the token immediately — the stored ciphertext becomes useless, and the card turns the next failed call into that same reconnect prompt. See [Connection states and recovery](#connection-states-and-recovery) for the full set.
87
121
 
88
122
  ## Secrets on the deployed app
89
123
 
@@ -127,6 +127,42 @@ an asset is served only when the Worker fetches it. That is what keeps
127
127
  > most projects never need to run `openapi-typescript` by hand.
128
128
 
129
129
 
130
+ ## Retired Paths
131
+
132
+ The compiler's output is a manifest of files to **write**. It has no way to say
133
+ "and drop the thing you wrote last time at a path I no longer use."
134
+
135
+ For most moves that gap is invisible: the CLI wipes `src/` from the manifest
136
+ before each write, so relocating a file *within* `src/` cleans up after itself.
137
+ It bites the moment a path crosses that boundary — v0.60 moved the spec blobs
138
+ from the project root into `src/apps/__quickback/spec/`, and the root copies
139
+ survived every later compile as multi-MB orphans that tooling kept reading.
140
+
141
+ So the compiler now also returns **retired paths** — things it used to emit and
142
+ no longer does — and the CLI deletes them:
143
+
144
+ ```
145
+ ● Removed 3 retired file(s):
146
+ openapi.json (spec blobs moved under the assets dir so they leave the Worker bundle)
147
+ asyncapi.json (spec blobs moved under the assets dir so they leave the Worker bundle)
148
+ schema-registry.json (spec blobs moved under the assets dir so they leave the Worker bundle)
149
+ ```
150
+
151
+ Every filter errs toward keeping a file, because a wrong deletion is
152
+ unrecoverable while a missed one is only untidy:
153
+
154
+ - A retired path that was **moved** is only deleted once its replacement is
155
+ actually in this compile's manifest. Disable the surface
156
+ (`openapi.generate: false`) and neither path is emitted, so nothing is
157
+ removed.
158
+ - A path the current manifest still writes is **never** deleted — that is what
159
+ keeps an older compiler, which still writes to the old location, from having
160
+ its live output pulled out from under it.
161
+ - The CLI re-checks both conditions itself and refuses any path that would
162
+ escape the output directory.
163
+
164
+ Nothing under `src/` is ever listed: the wipe already covers it.
165
+
130
166
  ## Generated Package Dependency Security
131
167
 
132
168
  For projects using Better Auth, the generated `package.json` keeps the stable
@@ -6,10 +6,7 @@
6
6
  export interface TemplateDefinition {
7
7
  name: string;
8
8
  description: string;
9
- category: "auth" | "saas" | "api" | "payments";
10
9
  tags: string[];
11
- author: string;
12
- version: string;
13
10
  includes: string[];
14
11
  preset: string;
15
12
  requiresCloudflare: boolean;
@@ -18,7 +15,5 @@ export declare const TEMPLATE_REGISTRY: Record<string, TemplateDefinition>;
18
15
  export declare const TEMPLATE_ALIASES: Record<string, string>;
19
16
  export declare function getTemplate(nameOrAlias: string): TemplateDefinition | undefined;
20
17
  export declare function listTemplates(): TemplateDefinition[];
21
- export declare function listTemplateNames(): string[];
22
- export declare function listAliases(): Record<string, string>;
23
18
  export declare function formatTemplateList(): string;
24
19
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CA4DhE,CAAC;AAKF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASnD,CAAC;AAEF,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAG/E;AAED,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAEpD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAED,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEpD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAgB3C"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;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