@donotdev/cli 0.2.2 → 0.2.3

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 (45) hide show
  1. package/dependencies-matrix.json +39 -38
  2. package/dist/bin/commands/agent-setup.js +135 -67
  3. package/dist/bin/commands/build.js +288 -232
  4. package/dist/bin/commands/bump.js +293 -250
  5. package/dist/bin/commands/cacheout.js +59 -49
  6. package/dist/bin/commands/coach.js +80 -50
  7. package/dist/bin/commands/create-app.js +501 -228
  8. package/dist/bin/commands/create-project.js +377 -241
  9. package/dist/bin/commands/db.js +1873 -1804
  10. package/dist/bin/commands/deploy.js +476 -287
  11. package/dist/bin/commands/dev.js +139 -108
  12. package/dist/bin/commands/doctor.js +91 -57
  13. package/dist/bin/commands/emu.js +196 -154
  14. package/dist/bin/commands/format.js +83 -50
  15. package/dist/bin/commands/get-demo.js +422 -197
  16. package/dist/bin/commands/make-admin.js +813 -707
  17. package/dist/bin/commands/preview.js +139 -108
  18. package/dist/bin/commands/seed.js +1874 -1809
  19. package/dist/bin/commands/setup-cicd.js +258 -204
  20. package/dist/bin/commands/setup.js +346 -247
  21. package/dist/bin/commands/staging.js +476 -287
  22. package/dist/bin/commands/sync-secrets.js +472 -141
  23. package/dist/bin/commands/type-check.js +163 -119
  24. package/dist/bin/commands/wai.js +53 -46
  25. package/dist/bin/dndev.js +10 -1
  26. package/dist/bin/donotdev.js +18 -8
  27. package/dist/index.js +590 -373
  28. package/package.json +2 -2
  29. package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  30. package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +1 -1
  31. package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +1 -1
  32. package/templates/app-next/src/app/AppDocument.tsx.example +57 -0
  33. package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
  34. package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  35. package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +1 -1
  36. package/templates/app-next/src/pages/legal/TermsPage.tsx.example +1 -1
  37. package/templates/app-vite/src/pages/FormPageExample.tsx.example +21 -16
  38. package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  39. package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +1 -1
  40. package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +1 -1
  41. package/templates/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
  42. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
  43. package/templates/root-consumer/.gitignore.example +7 -1
  44. package/templates/app-next/src/app/layout.tsx.example +0 -80
  45. package/templates/app-next/src/app/not-found.tsx.example +0 -40
@@ -82,25 +82,29 @@ var init_main = __esm({
82
82
  }
83
83
  });
84
84
 
85
- // node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
86
- var require_src = __commonJS({
87
- "node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
88
- "use strict";
85
+ // node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
86
+ var ESC, CSI, cursor, erase, clear;
87
+ var init_dist3 = __esm({
88
+ "node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js"() {
89
89
  init_utils2();
90
- var ESC = "\x1B";
91
- var CSI = `${ESC}[`;
92
- var beep = "\x07";
93
- var cursor3 = {
90
+ ESC = "\x1B";
91
+ CSI = `${ESC}[`;
92
+ cursor = {
94
93
  to(x, y) {
95
- if (!y) return `${CSI}${x + 1}G`;
94
+ if (!y)
95
+ return `${CSI}${x + 1}G`;
96
96
  return `${CSI}${y + 1};${x + 1}H`;
97
97
  },
98
98
  move(x, y) {
99
99
  let ret = "";
100
- if (x < 0) ret += `${CSI}${-x}D`;
101
- else if (x > 0) ret += `${CSI}${x}C`;
102
- if (y < 0) ret += `${CSI}${-y}A`;
103
- else if (y > 0) ret += `${CSI}${y}B`;
100
+ if (x < 0)
101
+ ret += `${CSI}${-x}D`;
102
+ else if (x > 0)
103
+ ret += `${CSI}${x}C`;
104
+ if (y < 0)
105
+ ret += `${CSI}${-y}A`;
106
+ else if (y > 0)
107
+ ret += `${CSI}${y}B`;
104
108
  return ret;
105
109
  },
106
110
  up: (count = 1) => `${CSI}${count}A`,
@@ -115,11 +119,7 @@ var require_src = __commonJS({
115
119
  save: `${ESC}7`,
116
120
  restore: `${ESC}8`
117
121
  };
118
- var scroll = {
119
- up: (count = 1) => `${CSI}S`.repeat(count),
120
- down: (count = 1) => `${CSI}T`.repeat(count)
121
- };
122
- var erase3 = {
122
+ erase = {
123
123
  screen: `${CSI}2J`,
124
124
  up: (count = 1) => `${CSI}1J`.repeat(count),
125
125
  down: (count = 1) => `${CSI}J`.repeat(count),
@@ -127,28 +127,31 @@ var require_src = __commonJS({
127
127
  lineEnd: `${CSI}K`,
128
128
  lineStart: `${CSI}1K`,
129
129
  lines(count) {
130
- let clear = "";
130
+ let clear2 = "";
131
131
  for (let i2 = 0; i2 < count; i2++)
132
- clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
132
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
133
133
  if (count)
134
- clear += cursor3.left;
135
- return clear;
134
+ clear2 += cursor.left;
135
+ return clear2;
136
136
  }
137
137
  };
138
- module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
138
+ clear = {
139
+ screen: `${ESC}c`
140
+ };
139
141
  }
140
142
  });
141
143
 
142
- // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
144
+ // node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
143
145
  import { styleText } from "node:util";
144
146
  import { stdout, stdin } from "node:process";
145
147
  import { ReadStream } from "node:tty";
146
- var import_sisteransi, a$1, t, settings, R;
147
- var init_dist3 = __esm({
148
- "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
148
+ var a$1, t, settings, R;
149
+ var init_dist4 = __esm({
150
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
149
151
  init_utils2();
150
152
  init_main();
151
- import_sisteransi = __toESM(require_src(), 1);
153
+ init_dist3();
154
+ init_dist2();
152
155
  a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
153
156
  t = [
154
157
  "January",
@@ -197,7 +200,7 @@ var init_dist3 = __esm({
197
200
  }
198
201
  });
199
202
 
200
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
203
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
201
204
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
202
205
  import process$1 from "node:process";
203
206
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -208,17 +211,17 @@ function isUnicodeSupported() {
208
211
  }
209
212
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
210
213
  }
211
- var import_sisteransi2, unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, u2, SELECT_INSTRUCTIONS, i;
212
- var init_dist4 = __esm({
213
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
214
+ var unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, u2, SELECT_INSTRUCTIONS, i;
215
+ var init_dist5 = __esm({
216
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
214
217
  init_utils2();
215
- init_dist3();
216
- init_dist3();
218
+ init_dist4();
219
+ init_dist4();
217
220
  init_main();
218
221
  init_dist2();
219
- import_sisteransi2 = __toESM(require_src(), 1);
222
+ init_dist3();
220
223
  unicode = isUnicodeSupported();
221
- unicodeOr = (o, e) => unicode ? o : e;
224
+ unicodeOr = (e, o) => unicode ? e : o;
222
225
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
223
226
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
224
227
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -255,9 +258,9 @@ var init_dist4 = __esm({
255
258
  secondarySymbol: r2 = styleText2("gray", S_BAR),
256
259
  output: m = process.stdout,
257
260
  spacing: l = 1,
258
- withGuide: c
261
+ withGuide: c2
259
262
  } = {}) => {
260
- const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
263
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
261
264
  for (let i2 = 0; i2 < l; i2++)
262
265
  t2.push(f);
263
266
  const g = Array.isArray(s) ? s : s.split(`
@@ -351,8 +354,8 @@ var init_cli_output = __esm({
351
354
  "packages/tooling/src/utils/cli-output.ts"() {
352
355
  "use strict";
353
356
  init_utils2();
354
- init_dist4();
355
- init_dist4();
357
+ init_dist5();
358
+ init_dist5();
356
359
  colors = {
357
360
  reset: "\x1B[0m",
358
361
  // Success (green)
@@ -503,7 +506,7 @@ var init_errors = __esm({
503
506
  * @param {DoNotDevErrorCode} code - Error code
504
507
  * @param {object} [options] - Additional error options
505
508
  * @param {Error} [options.originalError] - Original error if wrapping
506
- * @param {Record<string, any>} [options.context] - Additional context data
509
+ * @param {Record<string, unknown>} [options.context] - Additional context data
507
510
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
508
511
  */
509
512
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -533,7 +536,7 @@ var init_errors = __esm({
533
536
  * @param {string} [context] - Additional context for the error
534
537
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
535
538
  * @param {object} [options] - Additional error options
536
- * @param {Record<string, any>} [options.context] - Additional context data
539
+ * @param {Record<string, unknown>} [options.context] - Additional context data
537
540
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
538
541
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
539
542
  */
@@ -6584,6 +6587,9 @@ import {
6584
6587
  extname
6585
6588
  } from "node:path";
6586
6589
  import { fileURLToPath } from "node:url";
6590
+ function isEexistError(error2) {
6591
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
6592
+ }
6587
6593
  function safeExecuteAsync(fn, message) {
6588
6594
  return fn().catch((error2) => {
6589
6595
  throw new Error(
@@ -6955,7 +6961,7 @@ var init_PathResolver = __esm({
6955
6961
  try {
6956
6962
  await fs.promises.mkdir(dir, { recursive: true });
6957
6963
  } catch (error2) {
6958
- if (error2?.code !== "EEXIST") throw error2;
6964
+ if (!isEexistError(error2)) throw error2;
6959
6965
  }
6960
6966
  const detectedFormat = this._detectFormat(filePath, format);
6961
6967
  let writeContent;
@@ -7017,7 +7023,7 @@ var init_PathResolver = __esm({
7017
7023
  try {
7018
7024
  fs.mkdirSync(dir, { recursive: true });
7019
7025
  } catch (error2) {
7020
- if (error2?.code !== "EEXIST") throw error2;
7026
+ if (!isEexistError(error2)) throw error2;
7021
7027
  }
7022
7028
  const detectedFormat = this._detectFormat(filePath, format);
7023
7029
  let writeContent;
@@ -7074,7 +7080,7 @@ var init_PathResolver = __esm({
7074
7080
  try {
7075
7081
  await fs.promises.mkdir(dir, { recursive: true });
7076
7082
  } catch (error2) {
7077
- if (error2?.code !== "EEXIST") throw error2;
7083
+ if (!isEexistError(error2)) throw error2;
7078
7084
  }
7079
7085
  try {
7080
7086
  return await safeExecuteAsync(async () => {
@@ -7116,7 +7122,7 @@ var init_PathResolver = __esm({
7116
7122
  try {
7117
7123
  fs.mkdirSync(dir, { recursive: true });
7118
7124
  } catch (error2) {
7119
- if (error2?.code !== "EEXIST") throw error2;
7125
+ if (!isEexistError(error2)) throw error2;
7120
7126
  }
7121
7127
  try {
7122
7128
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -7232,7 +7238,7 @@ var init_PathResolver = __esm({
7232
7238
  try {
7233
7239
  await fs.promises.mkdir(dirPath, { recursive: true });
7234
7240
  } catch (error2) {
7235
- if (error2?.code !== "EEXIST") throw error2;
7241
+ if (!isEexistError(error2)) throw error2;
7236
7242
  }
7237
7243
  }
7238
7244
  /**
@@ -7244,7 +7250,7 @@ var init_PathResolver = __esm({
7244
7250
  try {
7245
7251
  fs.mkdirSync(dirPath, { recursive: true });
7246
7252
  } catch (error2) {
7247
- if (error2?.code !== "EEXIST") throw error2;
7253
+ if (!isEexistError(error2)) throw error2;
7248
7254
  }
7249
7255
  }
7250
7256
  /**
@@ -7493,6 +7499,7 @@ var init_PathResolver = __esm({
7493
7499
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
7494
7500
  * @returns Resolved patterns with absolute paths
7495
7501
  */
7502
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- why: mirrors the public PathResolver.d.ts signature; tightening it is a breaking change (any-audit)
7496
7503
  async resolvePatterns(patternType) {
7497
7504
  if (!constants.getPatternsFor) {
7498
7505
  return { framework: [], consumer: [], all: [] };
@@ -7647,6 +7654,9 @@ import {
7647
7654
  } from "node:path";
7648
7655
  import { fileURLToPath as fileURLToPath2 } from "node:url";
7649
7656
  function readdirSync3(dirPath, options) {
7657
+ if (options !== null && typeof options === "object" && options.withFileTypes === true) {
7658
+ return pathResolverInstance.readdirSync(dirPath, options);
7659
+ }
7650
7660
  return pathResolverInstance.readdirSync(dirPath, options);
7651
7661
  }
7652
7662
  async function glob(pattern, options = {}) {
@@ -7768,7 +7778,7 @@ async function findCacheItems(targetDir, verbose) {
7768
7778
  check(joinPath(targetDir, "tsconfig.tsbuildinfo"));
7769
7779
  check(joinPath(targetDir, "tsconfig.build.tsbuildinfo"));
7770
7780
  const generatedFiles = await glob(
7771
- ["**/*.generated.log", "**/*.generated.ts"],
7781
+ ["**/*.generated.log"],
7772
7782
  {
7773
7783
  cwd: targetDir,
7774
7784
  absolute: true,
@@ -86,25 +86,29 @@ var init_main = __esm({
86
86
  }
87
87
  });
88
88
 
89
- // node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
90
- var require_src = __commonJS({
91
- "node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
92
- "use strict";
89
+ // node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
90
+ var ESC, CSI, cursor, erase, clear;
91
+ var init_dist3 = __esm({
92
+ "node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js"() {
93
93
  init_utils2();
94
- var ESC = "\x1B";
95
- var CSI = `${ESC}[`;
96
- var beep = "\x07";
97
- var cursor3 = {
94
+ ESC = "\x1B";
95
+ CSI = `${ESC}[`;
96
+ cursor = {
98
97
  to(x, y) {
99
- if (!y) return `${CSI}${x + 1}G`;
98
+ if (!y)
99
+ return `${CSI}${x + 1}G`;
100
100
  return `${CSI}${y + 1};${x + 1}H`;
101
101
  },
102
102
  move(x, y) {
103
103
  let ret = "";
104
- if (x < 0) ret += `${CSI}${-x}D`;
105
- else if (x > 0) ret += `${CSI}${x}C`;
106
- if (y < 0) ret += `${CSI}${-y}A`;
107
- else if (y > 0) ret += `${CSI}${y}B`;
104
+ if (x < 0)
105
+ ret += `${CSI}${-x}D`;
106
+ else if (x > 0)
107
+ ret += `${CSI}${x}C`;
108
+ if (y < 0)
109
+ ret += `${CSI}${-y}A`;
110
+ else if (y > 0)
111
+ ret += `${CSI}${y}B`;
108
112
  return ret;
109
113
  },
110
114
  up: (count = 1) => `${CSI}${count}A`,
@@ -119,11 +123,7 @@ var require_src = __commonJS({
119
123
  save: `${ESC}7`,
120
124
  restore: `${ESC}8`
121
125
  };
122
- var scroll = {
123
- up: (count = 1) => `${CSI}S`.repeat(count),
124
- down: (count = 1) => `${CSI}T`.repeat(count)
125
- };
126
- var erase3 = {
126
+ erase = {
127
127
  screen: `${CSI}2J`,
128
128
  up: (count = 1) => `${CSI}1J`.repeat(count),
129
129
  down: (count = 1) => `${CSI}J`.repeat(count),
@@ -131,28 +131,31 @@ var require_src = __commonJS({
131
131
  lineEnd: `${CSI}K`,
132
132
  lineStart: `${CSI}1K`,
133
133
  lines(count) {
134
- let clear = "";
134
+ let clear2 = "";
135
135
  for (let i2 = 0; i2 < count; i2++)
136
- clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
136
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
137
137
  if (count)
138
- clear += cursor3.left;
139
- return clear;
138
+ clear2 += cursor.left;
139
+ return clear2;
140
140
  }
141
141
  };
142
- module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
142
+ clear = {
143
+ screen: `${ESC}c`
144
+ };
143
145
  }
144
146
  });
145
147
 
146
- // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
148
+ // node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
147
149
  import { styleText } from "node:util";
148
150
  import { stdout, stdin } from "node:process";
149
151
  import { ReadStream } from "node:tty";
150
- var import_sisteransi, a$1, t, settings, R;
151
- var init_dist3 = __esm({
152
- "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
152
+ var a$1, t, settings, R;
153
+ var init_dist4 = __esm({
154
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
153
155
  init_utils2();
154
156
  init_main();
155
- import_sisteransi = __toESM(require_src(), 1);
157
+ init_dist3();
158
+ init_dist2();
156
159
  a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
157
160
  t = [
158
161
  "January",
@@ -201,7 +204,7 @@ var init_dist3 = __esm({
201
204
  }
202
205
  });
203
206
 
204
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
207
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
205
208
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
206
209
  import process$1 from "node:process";
207
210
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -212,17 +215,17 @@ function isUnicodeSupported() {
212
215
  }
213
216
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
214
217
  }
215
- var import_sisteransi2, unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, intro, outro, u2, SELECT_INSTRUCTIONS, i;
216
- var init_dist4 = __esm({
217
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
218
+ var unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, intro, outro, u2, SELECT_INSTRUCTIONS, i;
219
+ var init_dist5 = __esm({
220
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
218
221
  init_utils2();
219
- init_dist3();
220
- init_dist3();
222
+ init_dist4();
223
+ init_dist4();
221
224
  init_main();
222
225
  init_dist2();
223
- import_sisteransi2 = __toESM(require_src(), 1);
226
+ init_dist3();
224
227
  unicode = isUnicodeSupported();
225
- unicodeOr = (o, e) => unicode ? o : e;
228
+ unicodeOr = (e, o) => unicode ? e : o;
226
229
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
227
230
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
228
231
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -259,9 +262,9 @@ var init_dist4 = __esm({
259
262
  secondarySymbol: r2 = styleText2("gray", S_BAR),
260
263
  output: m = process.stdout,
261
264
  spacing: l = 1,
262
- withGuide: c
265
+ withGuide: c2
263
266
  } = {}) => {
264
- const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
267
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
265
268
  for (let i2 = 0; i2 < l; i2++)
266
269
  t2.push(f);
267
270
  const g = Array.isArray(s) ? s : s.split(`
@@ -367,8 +370,8 @@ var init_cli_output = __esm({
367
370
  "packages/tooling/src/utils/cli-output.ts"() {
368
371
  "use strict";
369
372
  init_utils2();
370
- init_dist4();
371
- init_dist4();
373
+ init_dist5();
374
+ init_dist5();
372
375
  colors = {
373
376
  reset: "\x1B[0m",
374
377
  // Success (green)
@@ -519,7 +522,7 @@ var init_errors = __esm({
519
522
  * @param {DoNotDevErrorCode} code - Error code
520
523
  * @param {object} [options] - Additional error options
521
524
  * @param {Error} [options.originalError] - Original error if wrapping
522
- * @param {Record<string, any>} [options.context] - Additional context data
525
+ * @param {Record<string, unknown>} [options.context] - Additional context data
523
526
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
524
527
  */
525
528
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -549,7 +552,7 @@ var init_errors = __esm({
549
552
  * @param {string} [context] - Additional context for the error
550
553
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
551
554
  * @param {object} [options] - Additional error options
552
- * @param {Record<string, any>} [options.context] - Additional context data
555
+ * @param {Record<string, unknown>} [options.context] - Additional context data
553
556
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
554
557
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
555
558
  */
@@ -6600,6 +6603,9 @@ import {
6600
6603
  extname
6601
6604
  } from "node:path";
6602
6605
  import { fileURLToPath } from "node:url";
6606
+ function isEexistError(error2) {
6607
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
6608
+ }
6603
6609
  function safeExecuteAsync(fn, message) {
6604
6610
  return fn().catch((error2) => {
6605
6611
  throw new Error(
@@ -6971,7 +6977,7 @@ var init_PathResolver = __esm({
6971
6977
  try {
6972
6978
  await fs.promises.mkdir(dir, { recursive: true });
6973
6979
  } catch (error2) {
6974
- if (error2?.code !== "EEXIST") throw error2;
6980
+ if (!isEexistError(error2)) throw error2;
6975
6981
  }
6976
6982
  const detectedFormat = this._detectFormat(filePath, format);
6977
6983
  let writeContent;
@@ -7033,7 +7039,7 @@ var init_PathResolver = __esm({
7033
7039
  try {
7034
7040
  fs.mkdirSync(dir, { recursive: true });
7035
7041
  } catch (error2) {
7036
- if (error2?.code !== "EEXIST") throw error2;
7042
+ if (!isEexistError(error2)) throw error2;
7037
7043
  }
7038
7044
  const detectedFormat = this._detectFormat(filePath, format);
7039
7045
  let writeContent;
@@ -7090,7 +7096,7 @@ var init_PathResolver = __esm({
7090
7096
  try {
7091
7097
  await fs.promises.mkdir(dir, { recursive: true });
7092
7098
  } catch (error2) {
7093
- if (error2?.code !== "EEXIST") throw error2;
7099
+ if (!isEexistError(error2)) throw error2;
7094
7100
  }
7095
7101
  try {
7096
7102
  return await safeExecuteAsync(async () => {
@@ -7132,7 +7138,7 @@ var init_PathResolver = __esm({
7132
7138
  try {
7133
7139
  fs.mkdirSync(dir, { recursive: true });
7134
7140
  } catch (error2) {
7135
- if (error2?.code !== "EEXIST") throw error2;
7141
+ if (!isEexistError(error2)) throw error2;
7136
7142
  }
7137
7143
  try {
7138
7144
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -7248,7 +7254,7 @@ var init_PathResolver = __esm({
7248
7254
  try {
7249
7255
  await fs.promises.mkdir(dirPath, { recursive: true });
7250
7256
  } catch (error2) {
7251
- if (error2?.code !== "EEXIST") throw error2;
7257
+ if (!isEexistError(error2)) throw error2;
7252
7258
  }
7253
7259
  }
7254
7260
  /**
@@ -7260,7 +7266,7 @@ var init_PathResolver = __esm({
7260
7266
  try {
7261
7267
  fs.mkdirSync(dirPath, { recursive: true });
7262
7268
  } catch (error2) {
7263
- if (error2?.code !== "EEXIST") throw error2;
7269
+ if (!isEexistError(error2)) throw error2;
7264
7270
  }
7265
7271
  }
7266
7272
  /**
@@ -7509,6 +7515,7 @@ var init_PathResolver = __esm({
7509
7515
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
7510
7516
  * @returns Resolved patterns with absolute paths
7511
7517
  */
7518
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- why: mirrors the public PathResolver.d.ts signature; tightening it is a breaking change (any-audit)
7512
7519
  async resolvePatterns(patternType) {
7513
7520
  if (!constants.getPatternsFor) {
7514
7521
  return { framework: [], consumer: [], all: [] };
@@ -7663,6 +7670,9 @@ import {
7663
7670
  } from "node:path";
7664
7671
  import { fileURLToPath as fileURLToPath2 } from "node:url";
7665
7672
  function readdirSync3(dirPath, options) {
7673
+ if (options !== null && typeof options === "object" && options.withFileTypes === true) {
7674
+ return pathResolverInstance.readdirSync(dirPath, options);
7675
+ }
7666
7676
  return pathResolverInstance.readdirSync(dirPath, options);
7667
7677
  }
7668
7678
  var pathResolverInstance, normalizePath, pathExists, readSync, statSync2, joinPath;
@@ -7712,6 +7722,25 @@ var init_typed_file_operations = __esm({
7712
7722
  }
7713
7723
  });
7714
7724
 
7725
+ // packages/tooling/src/utils/type-guards.ts
7726
+ function requireText(value, filePath) {
7727
+ if (typeof value !== "string") {
7728
+ throw new DoNotDevError(
7729
+ `Cannot read text file: ${filePath}`,
7730
+ DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND,
7731
+ { context: { filePath } }
7732
+ );
7733
+ }
7734
+ return value;
7735
+ }
7736
+ var init_type_guards = __esm({
7737
+ "packages/tooling/src/utils/type-guards.ts"() {
7738
+ "use strict";
7739
+ init_utils2();
7740
+ init_errors();
7741
+ }
7742
+ });
7743
+
7715
7744
  // packages/tooling/src/bundler/utils.ts
7716
7745
  import { Buffer as Buffer2 } from "node:buffer";
7717
7746
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -7813,7 +7842,7 @@ function analyzeApp(appPath, appName) {
7813
7842
  try {
7814
7843
  const envPath = joinPath(appPath, ".env");
7815
7844
  if (pathExists(envPath)) {
7816
- const envContent = readSync(envPath);
7845
+ const envContent = requireText(readSync(envPath), envPath);
7817
7846
  if (envContent.match(/VITE_SUPABASE_URL=.+/)) {
7818
7847
  hasSupabase = true;
7819
7848
  }
@@ -7860,7 +7889,7 @@ function analyzeApp(appPath, appName) {
7860
7889
  try {
7861
7890
  const envPath = joinPath(appPath, ".env");
7862
7891
  if (pathExists(envPath)) {
7863
- const envContent = readSync(envPath);
7892
+ const envContent = requireText(readSync(envPath), envPath);
7864
7893
  const urlMatch = envContent.match(/VITE_SUPABASE_URL=(.+)/);
7865
7894
  if (urlMatch && urlMatch[1]) {
7866
7895
  url = urlMatch[1].trim();
@@ -7964,6 +7993,7 @@ var init_app_detection = __esm({
7964
7993
  init_utils2();
7965
7994
  init_pathResolver();
7966
7995
  init_typed_file_operations();
7996
+ init_type_guards();
7967
7997
  PROVIDERS_CANDIDATES = [
7968
7998
  "src/config/providers.ts",
7969
7999
  "src/config/providers.tsx",