@donotdev/cli 0.0.37 → 0.1.0

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 (59) hide show
  1. package/LICENSE.md +21 -48
  2. package/dependencies-matrix.json +24 -24
  3. package/dist/bin/commands/agent-setup.js +6963 -123
  4. package/dist/bin/commands/build.js +4 -1
  5. package/dist/bin/commands/bump.js +23 -12
  6. package/dist/bin/commands/cacheout.js +17 -1
  7. package/dist/bin/commands/coach.js +4 -1
  8. package/dist/bin/commands/create-app.js +16 -2
  9. package/dist/bin/commands/create-project.js +17 -3
  10. package/dist/bin/commands/db.js +1708 -98
  11. package/dist/bin/commands/deploy.js +142 -96
  12. package/dist/bin/commands/dev.js +6 -5
  13. package/dist/bin/commands/doctor.js +4 -1
  14. package/dist/bin/commands/emu.js +6 -5
  15. package/dist/bin/commands/format.js +5 -3
  16. package/dist/bin/commands/get-demo.js +16 -2
  17. package/dist/bin/commands/make-admin.js +1717 -87
  18. package/dist/bin/commands/preview.js +6 -5
  19. package/dist/bin/commands/seed.js +1708 -98
  20. package/dist/bin/commands/setup-cicd.js +4 -1
  21. package/dist/bin/commands/setup.js +21 -18
  22. package/dist/bin/commands/staging.js +142 -96
  23. package/dist/bin/commands/sync-secrets.js +4 -1
  24. package/dist/bin/commands/type-check.js +4 -1
  25. package/dist/bin/commands/wai.js +4 -1
  26. package/dist/bin/dndev.js +21 -1
  27. package/dist/bin/donotdev.js +21 -1
  28. package/dist/index.js +170 -105
  29. package/package.json +2 -2
  30. package/templates/functions-supabase/supabase/functions/.env.example +12 -0
  31. package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
  32. package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
  33. package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
  34. package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
  35. package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
  36. package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
  37. package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
  38. package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
  39. package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
  40. package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
  41. package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
  42. package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
  43. package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
  44. package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
  45. package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
  46. package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
  47. package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
  48. package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
  49. package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
  50. package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
  51. package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
  52. package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
  53. package/templates/root-consumer/.claude/commands/brainstorm.md.example +28 -0
  54. package/templates/root-consumer/.claude/commands/design.md.example +31 -0
  55. package/templates/root-consumer/.claude/commands/grill.md.example +33 -6
  56. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
  57. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
  58. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +11 -5
  59. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +2 -1
package/dist/index.js CHANGED
@@ -3493,9 +3493,9 @@ var require_parse2 = __commonJS({
3493
3493
  const idx = prev.value.lastIndexOf("[");
3494
3494
  const pre = prev.value.slice(0, idx);
3495
3495
  const rest2 = prev.value.slice(idx + 2);
3496
- const posix2 = POSIX_REGEX_SOURCE[rest2];
3497
- if (posix2) {
3498
- prev.value = pre + posix2;
3496
+ const posix = POSIX_REGEX_SOURCE[rest2];
3497
+ if (posix) {
3498
+ prev.value = pre + posix;
3499
3499
  state.backtrack = true;
3500
3500
  advance();
3501
3501
  if (!bos.output && tokens.indexOf(prev) === 1) {
@@ -4017,7 +4017,7 @@ var require_picomatch = __commonJS({
4017
4017
  throw new TypeError("Expected pattern to be a non-empty string");
4018
4018
  }
4019
4019
  const opts = options || {};
4020
- const posix2 = utils.isWindows(options);
4020
+ const posix = utils.isWindows(options);
4021
4021
  const regex = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);
4022
4022
  const state = regex.state;
4023
4023
  delete regex.state;
@@ -4027,8 +4027,8 @@ var require_picomatch = __commonJS({
4027
4027
  isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
4028
4028
  }
4029
4029
  const matcher = (input, returnObject = false) => {
4030
- const { isMatch, match, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix2 });
4031
- const result = { glob: glob2, state, regex, posix: posix2, input, output, match, isMatch };
4030
+ const { isMatch, match, output } = picomatch.test(input, regex, options, { glob: glob2, posix });
4031
+ const result = { glob: glob2, state, regex, posix, input, output, match, isMatch };
4032
4032
  if (typeof opts.onResult === "function") {
4033
4033
  opts.onResult(result);
4034
4034
  }
@@ -4053,7 +4053,7 @@ var require_picomatch = __commonJS({
4053
4053
  }
4054
4054
  return matcher;
4055
4055
  };
4056
- picomatch.test = (input, regex, options, { glob: glob2, posix: posix2 } = {}) => {
4056
+ picomatch.test = (input, regex, options, { glob: glob2, posix } = {}) => {
4057
4057
  if (typeof input !== "string") {
4058
4058
  throw new TypeError("Expected input to be a string");
4059
4059
  }
@@ -4061,7 +4061,7 @@ var require_picomatch = __commonJS({
4061
4061
  return { isMatch: false, output: "" };
4062
4062
  }
4063
4063
  const opts = options || {};
4064
- const format = opts.format || (posix2 ? utils.toPosixSlashes : null);
4064
+ const format = opts.format || (posix ? utils.toPosixSlashes : null);
4065
4065
  let match = input === glob2;
4066
4066
  let output = match && format ? format(input) : input;
4067
4067
  if (match === false) {
@@ -4070,14 +4070,14 @@ var require_picomatch = __commonJS({
4070
4070
  }
4071
4071
  if (match === false || opts.capture === true) {
4072
4072
  if (opts.matchBase === true || opts.basename === true) {
4073
- match = picomatch.matchBase(input, regex, options, posix2);
4073
+ match = picomatch.matchBase(input, regex, options, posix);
4074
4074
  } else {
4075
4075
  match = regex.exec(output);
4076
4076
  }
4077
4077
  }
4078
4078
  return { isMatch: Boolean(match), match, output };
4079
4079
  };
4080
- picomatch.matchBase = (input, glob2, options, posix2 = utils.isWindows(options)) => {
4080
+ picomatch.matchBase = (input, glob2, options, posix = utils.isWindows(options)) => {
4081
4081
  const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
4082
4082
  return regex.test(path.basename(input));
4083
4083
  };
@@ -4268,9 +4268,9 @@ var require_micromatch = __commonJS({
4268
4268
  return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
4269
4269
  };
4270
4270
  micromatch.capture = (glob2, input, options) => {
4271
- let posix2 = utils.isWindows(options);
4271
+ let posix = utils.isWindows(options);
4272
4272
  let regex = picomatch.makeRe(String(glob2), { ...options, capture: true });
4273
- let match = regex.exec(posix2 ? utils.toPosixSlashes(input) : input);
4273
+ let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
4274
4274
  if (match) {
4275
4275
  return match.slice(1).map((v2) => v2 === void 0 ? "" : v2);
4276
4276
  }
@@ -4450,15 +4450,15 @@ var require_pattern = __commonJS({
4450
4450
  exports.removeDuplicateSlashes = removeDuplicateSlashes;
4451
4451
  function partitionAbsoluteAndRelative(patterns) {
4452
4452
  const absolute = [];
4453
- const relative4 = [];
4453
+ const relative3 = [];
4454
4454
  for (const pattern of patterns) {
4455
4455
  if (isAbsolute2(pattern)) {
4456
4456
  absolute.push(pattern);
4457
4457
  } else {
4458
- relative4.push(pattern);
4458
+ relative3.push(pattern);
4459
4459
  }
4460
4460
  }
4461
- return [absolute, relative4];
4461
+ return [absolute, relative3];
4462
4462
  }
4463
4463
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
4464
4464
  function isAbsolute2(pattern) {
@@ -4768,7 +4768,7 @@ var require_async = __commonJS({
4768
4768
  callSuccessCallback(callback, lstat);
4769
4769
  return;
4770
4770
  }
4771
- settings.fs.stat(path, (statError, stat2) => {
4771
+ settings.fs.stat(path, (statError, stat) => {
4772
4772
  if (statError !== null) {
4773
4773
  if (settings.throwErrorOnBrokenSymbolicLink) {
4774
4774
  callFailureCallback(callback, statError);
@@ -4778,9 +4778,9 @@ var require_async = __commonJS({
4778
4778
  return;
4779
4779
  }
4780
4780
  if (settings.markSymbolicLink) {
4781
- stat2.isSymbolicLink = () => true;
4781
+ stat.isSymbolicLink = () => true;
4782
4782
  }
4783
- callSuccessCallback(callback, stat2);
4783
+ callSuccessCallback(callback, stat);
4784
4784
  });
4785
4785
  });
4786
4786
  }
@@ -4807,11 +4807,11 @@ var require_sync = __commonJS({
4807
4807
  return lstat;
4808
4808
  }
4809
4809
  try {
4810
- const stat2 = settings.fs.statSync(path);
4810
+ const stat = settings.fs.statSync(path);
4811
4811
  if (settings.markSymbolicLink) {
4812
- stat2.isSymbolicLink = () => true;
4812
+ stat.isSymbolicLink = () => true;
4813
4813
  }
4814
- return stat2;
4814
+ return stat;
4815
4815
  } catch (error2) {
4816
4816
  if (!settings.throwErrorOnBrokenSymbolicLink) {
4817
4817
  return lstat;
@@ -4881,14 +4881,14 @@ var require_out = __commonJS({
4881
4881
  var sync = require_sync();
4882
4882
  var settings_1 = require_settings();
4883
4883
  exports.Settings = settings_1.default;
4884
- function stat2(path, optionsOrSettingsOrCallback, callback) {
4884
+ function stat(path, optionsOrSettingsOrCallback, callback) {
4885
4885
  if (typeof optionsOrSettingsOrCallback === "function") {
4886
4886
  async.read(path, getSettings(), optionsOrSettingsOrCallback);
4887
4887
  return;
4888
4888
  }
4889
4889
  async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
4890
4890
  }
4891
- exports.stat = stat2;
4891
+ exports.stat = stat;
4892
4892
  function statSync3(path, optionsOrSettings) {
4893
4893
  const settings = getSettings(optionsOrSettings);
4894
4894
  return sync.read(path, settings);
@@ -5058,7 +5058,7 @@ var require_async2 = __commonJS({
5058
5058
  readdirWithFileTypes(directory, settings, callback);
5059
5059
  return;
5060
5060
  }
5061
- readdir3(directory, settings, callback);
5061
+ readdir2(directory, settings, callback);
5062
5062
  }
5063
5063
  exports.read = read2;
5064
5064
  function readdirWithFileTypes(directory, settings, callback) {
@@ -5107,7 +5107,7 @@ var require_async2 = __commonJS({
5107
5107
  });
5108
5108
  };
5109
5109
  }
5110
- function readdir3(directory, settings, callback) {
5110
+ function readdir2(directory, settings, callback) {
5111
5111
  settings.fs.readdir(directory, (readdirError, names) => {
5112
5112
  if (readdirError !== null) {
5113
5113
  callFailureCallback(callback, readdirError);
@@ -5142,7 +5142,7 @@ var require_async2 = __commonJS({
5142
5142
  });
5143
5143
  });
5144
5144
  }
5145
- exports.readdir = readdir3;
5145
+ exports.readdir = readdir2;
5146
5146
  function callFailureCallback(callback, error2) {
5147
5147
  callback(error2);
5148
5148
  }
@@ -5167,7 +5167,7 @@ var require_sync2 = __commonJS({
5167
5167
  if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
5168
5168
  return readdirWithFileTypes(directory, settings);
5169
5169
  }
5170
- return readdir3(directory, settings);
5170
+ return readdir2(directory, settings);
5171
5171
  }
5172
5172
  exports.read = read2;
5173
5173
  function readdirWithFileTypes(directory, settings) {
@@ -5192,7 +5192,7 @@ var require_sync2 = __commonJS({
5192
5192
  });
5193
5193
  }
5194
5194
  exports.readdirWithFileTypes = readdirWithFileTypes;
5195
- function readdir3(directory, settings) {
5195
+ function readdir2(directory, settings) {
5196
5196
  const names = settings.fs.readdirSync(directory);
5197
5197
  return names.map((name) => {
5198
5198
  const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
@@ -5208,7 +5208,7 @@ var require_sync2 = __commonJS({
5208
5208
  return entry;
5209
5209
  });
5210
5210
  }
5211
- exports.readdir = readdir3;
5211
+ exports.readdir = readdir2;
5212
5212
  }
5213
5213
  });
5214
5214
 
@@ -6770,19 +6770,19 @@ var require_out4 = __commonJS({
6770
6770
  return utils.path.convertPathToPattern(source);
6771
6771
  }
6772
6772
  FastGlob2.convertPathToPattern = convertPathToPattern;
6773
- let posix2;
6774
- (function(posix3) {
6773
+ let posix;
6774
+ (function(posix2) {
6775
6775
  function escapePath2(source) {
6776
6776
  assertPatternsInput(source);
6777
6777
  return utils.path.escapePosixPath(source);
6778
6778
  }
6779
- posix3.escapePath = escapePath2;
6779
+ posix2.escapePath = escapePath2;
6780
6780
  function convertPathToPattern2(source) {
6781
6781
  assertPatternsInput(source);
6782
6782
  return utils.path.convertPosixPathToPattern(source);
6783
6783
  }
6784
- posix3.convertPathToPattern = convertPathToPattern2;
6785
- })(posix2 = FastGlob2.posix || (FastGlob2.posix = {}));
6784
+ posix2.convertPathToPattern = convertPathToPattern2;
6785
+ })(posix = FastGlob2.posix || (FastGlob2.posix = {}));
6786
6786
  let win32;
6787
6787
  (function(win322) {
6788
6788
  function escapePath2(source) {
@@ -7929,7 +7929,10 @@ var init_PathResolver = __esm({
7929
7929
  */
7930
7930
  getEmptyCjsModulePath() {
7931
7931
  const resolved = this.resolvePackage("@donotdev/core/empty");
7932
- if (!resolved) throw new Error("Cannot resolve @donotdev/core/empty \u2014 package setup is broken");
7932
+ if (!resolved)
7933
+ throw new Error(
7934
+ "Cannot resolve @donotdev/core/empty \u2014 package setup is broken"
7935
+ );
7933
7936
  return resolved;
7934
7937
  }
7935
7938
  // === PRIVATE METHODS ===
@@ -8365,8 +8368,8 @@ var init_pathResolver = __esm({
8365
8368
  if (normalizedTarget === normalizedRoot) {
8366
8369
  return true;
8367
8370
  }
8368
- const relative4 = getRelativePathBetween(normalizedRoot, normalizedTarget);
8369
- return Boolean(relative4) && !relative4.startsWith("../") && !relative4.startsWith("/") && !relative4.includes("..");
8371
+ const relative3 = getRelativePathBetween(normalizedRoot, normalizedTarget);
8372
+ return Boolean(relative3) && !relative3.startsWith("../") && !relative3.startsWith("/") && !relative3.includes("..");
8370
8373
  };
8371
8374
  }
8372
8375
  });
@@ -8764,7 +8767,7 @@ function checkCLI(command, args = ["--version"], useCache = true) {
8764
8767
  "-ExecutionPolicy",
8765
8768
  "Bypass",
8766
8769
  "-Command",
8767
- `& '${fullPath}' ${args.join(" ")}`
8770
+ `& '${fullPath}' ${args.map((a) => `'${a}'`).join(" ")}`
8768
8771
  ],
8769
8772
  {
8770
8773
  stdio: "pipe",
@@ -8786,7 +8789,7 @@ function checkCLI(command, args = ["--version"], useCache = true) {
8786
8789
  "-ExecutionPolicy",
8787
8790
  "Bypass",
8788
8791
  "-Command",
8789
- `${command} ${args.join(" ")}`
8792
+ `& '${command}' ${args.map((a) => `'${a}'`).join(" ")}`
8790
8793
  ],
8791
8794
  {
8792
8795
  stdio: "pipe",
@@ -8794,9 +8797,8 @@ function checkCLI(command, args = ["--version"], useCache = true) {
8794
8797
  }
8795
8798
  );
8796
8799
  } else {
8797
- result = spawnSync(`${command} ${args.join(" ")}`, {
8798
- stdio: "pipe",
8799
- shell: true
8800
+ result = spawnSync(command, args, {
8801
+ stdio: "pipe"
8800
8802
  });
8801
8803
  }
8802
8804
  const isAvailable = result.status === 0;
@@ -16760,8 +16762,8 @@ function detectAppsWithFunctions() {
16760
16762
  try {
16761
16763
  const appsList = readdirSync2(appsDir).filter((item) => {
16762
16764
  const itemPath = joinPath(appsDir, item);
16763
- const stat2 = statSync2(itemPath);
16764
- return stat2?.isDirectory() === true;
16765
+ const stat = statSync2(itemPath);
16766
+ return stat?.isDirectory() === true;
16765
16767
  });
16766
16768
  for (const app of appsList) {
16767
16769
  const functionsEnvFile = joinPath(appsDir, app, "functions", ".env");
@@ -17245,8 +17247,8 @@ async function deploySupabaseFunctions(appDir, config) {
17245
17247
  );
17246
17248
  const functionDirs = readdirSync2(functionsDir).filter((item) => {
17247
17249
  const itemPath = joinPath(functionsDir, item);
17248
- const stat2 = statSync2(itemPath);
17249
- return stat2?.isDirectory() === true;
17250
+ const stat = statSync2(itemPath);
17251
+ return stat?.isDirectory() === true;
17250
17252
  }).filter((dir) => {
17251
17253
  const indexPath = joinPath(functionsDir, dir, "index.ts");
17252
17254
  return pathExists(indexPath);
@@ -17264,14 +17266,18 @@ async function deploySupabaseFunctions(appDir, config) {
17264
17266
  for (const functionName of functionDirs) {
17265
17267
  s.start(`Deploying Edge Function: ${functionName}...`);
17266
17268
  try {
17267
- const result = spawnSync9("supabase", ["functions", "deploy", functionName], {
17268
- cwd: supabaseDir,
17269
- stdio: config.verbose ? "inherit" : "pipe",
17270
- env: {
17271
- ...process.env,
17272
- DNDEV_APP_ROOT: appDir
17269
+ const result = spawnSync9(
17270
+ "supabase",
17271
+ ["functions", "deploy", functionName],
17272
+ {
17273
+ cwd: supabaseDir,
17274
+ stdio: config.verbose ? "inherit" : "pipe",
17275
+ env: {
17276
+ ...process.env,
17277
+ DNDEV_APP_ROOT: appDir
17278
+ }
17273
17279
  }
17274
- });
17280
+ );
17275
17281
  if (result.status !== 0) {
17276
17282
  throw new Error(result.stderr?.toString() || "Deploy failed");
17277
17283
  }
@@ -17669,7 +17675,18 @@ function loadMatrix(mode) {
17669
17675
  return cachedMatrix;
17670
17676
  }
17671
17677
  function resolveGroup(groupName, matrix) {
17672
- return matrix.groups[groupName]?.packages || {};
17678
+ const group = matrix.groups[groupName];
17679
+ if (!group) return {};
17680
+ const result = {};
17681
+ if (group.includes) {
17682
+ for (const included of group.includes) {
17683
+ Object.assign(result, resolveGroup(included, matrix));
17684
+ }
17685
+ }
17686
+ if (group.packages) {
17687
+ Object.assign(result, group.packages);
17688
+ }
17689
+ return result;
17673
17690
  }
17674
17691
  function resolveGroups(groupNames, matrix) {
17675
17692
  const result = {};
@@ -17851,12 +17868,10 @@ function createAppEnv(appPath) {
17851
17868
  function spawnCrossPlatform(command, args, options) {
17852
17869
  const isWindows = platform() === "win32";
17853
17870
  const useShell = options.shell ?? isWindows;
17871
+ const { shell: _3, ...rest } = options;
17854
17872
  if (useShell) {
17855
- const fullCommand = `${command} ${args.join(" ")}`;
17856
- const { shell: _4, ...rest2 } = options;
17857
- return spawn(fullCommand, [], { ...rest2, shell: true });
17873
+ return spawn(command, args, { ...rest, shell: true });
17858
17874
  }
17859
- const { shell: _3, ...rest } = options;
17860
17875
  return spawn(command, args, rest);
17861
17876
  }
17862
17877
  function createEmulatorEnv(appPath, framework = "vite", options) {
@@ -17913,10 +17928,12 @@ function executeFirebaseCommand(args, options) {
17913
17928
  env: deployEnv
17914
17929
  };
17915
17930
  let result;
17916
- result = spawnSync2(`firebase ${args.join(" ")}`, {
17917
- ...spawnOptions,
17918
- shell: true
17919
- });
17931
+ const isWindows = platform() === "win32";
17932
+ if (isWindows) {
17933
+ result = spawnSync2("firebase", args, { ...spawnOptions, shell: true });
17934
+ } else {
17935
+ result = spawnSync2("firebase", args, spawnOptions);
17936
+ }
17920
17937
  if (result.error) {
17921
17938
  return {
17922
17939
  success: false,
@@ -18019,8 +18036,8 @@ function detectAvailableApps() {
18019
18036
  }
18020
18037
  return readdirSync2(appsDir).filter((item) => {
18021
18038
  const itemPath = joinPath(appsDir, item);
18022
- const stat2 = statSync2(itemPath);
18023
- return stat2?.isDirectory() === true;
18039
+ const stat = statSync2(itemPath);
18040
+ return stat?.isDirectory() === true;
18024
18041
  }).filter((app) => {
18025
18042
  const appDir = joinPath(appsDir, app);
18026
18043
  const firebaseJsonPath = joinPath(appDir, "firebase.json");
@@ -19746,8 +19763,6 @@ init_vercel_token();
19746
19763
  init_cli_output();
19747
19764
  init_pathResolver();
19748
19765
  import { createHash } from "node:crypto";
19749
- import { readFile, readdir as readdir2 } from "node:fs/promises";
19750
- import { join as join3, relative as relative3 } from "node:path";
19751
19766
  var VERCEL_API2 = "https://api.vercel.com";
19752
19767
  var UPLOAD_BATCH_SIZE = 10;
19753
19768
  var POLL_INTERVAL_MS = 3e3;
@@ -19762,17 +19777,18 @@ function teamQuery(orgId) {
19762
19777
  async function collectDistFiles(distDir) {
19763
19778
  const files = [];
19764
19779
  async function walk(dir) {
19765
- const entries = await readdir2(dir, { withFileTypes: true });
19780
+ const entries = await readdir(dir, {
19781
+ withFileTypes: true
19782
+ });
19766
19783
  for (const entry of entries) {
19767
- const fullPath = join3(dir, entry.name);
19784
+ const fullPath = joinPath(dir, entry.name);
19768
19785
  if (entry.isDirectory()) {
19769
19786
  await walk(fullPath);
19770
19787
  } else {
19771
- const content = await readFile(fullPath);
19788
+ const content = await read(fullPath, { format: "buffer" });
19772
19789
  const sha = createHash("sha1").update(content).digest("hex");
19773
- const rel = relative3(distDir, fullPath).split("\\").join("/");
19774
19790
  files.push({
19775
- relativePath: rel,
19791
+ relativePath: getRelativePathBetween(distDir, fullPath),
19776
19792
  content,
19777
19793
  sha,
19778
19794
  size: content.byteLength
@@ -19810,13 +19826,19 @@ async function uploadFiles(files, token, orgId) {
19810
19826
  );
19811
19827
  }
19812
19828
  }
19813
- function loadVercelConfig(appDir) {
19829
+ function sourceToRegex(source) {
19830
+ if (source.includes("(")) return source;
19831
+ let result = source.replace(/\./g, "\\.");
19832
+ result = result.replace(/:(\w+)\*/g, "(.+)");
19833
+ result = result.replace(/:(\w+)/g, "([^/]+)");
19834
+ return result;
19835
+ }
19836
+ function buildRoutes(appDir) {
19814
19837
  const configPath = joinPath(appDir, "vercel.json");
19815
- if (!pathExists(configPath)) return {};
19838
+ if (!pathExists(configPath)) return [];
19816
19839
  try {
19817
- const raw = readSync(configPath);
19818
- const config = JSON.parse(raw);
19819
- const result = {};
19840
+ const config = readSync(configPath);
19841
+ if (!config || typeof config !== "object") return [];
19820
19842
  const routes = [];
19821
19843
  if (Array.isArray(config.headers)) {
19822
19844
  for (const h2 of config.headers) {
@@ -19825,7 +19847,7 @@ function loadVercelConfig(appDir) {
19825
19847
  headersMap[entry.key] = entry.value;
19826
19848
  }
19827
19849
  routes.push({
19828
- src: h2.source,
19850
+ src: sourceToRegex(h2.source),
19829
19851
  headers: headersMap,
19830
19852
  continue: true
19831
19853
  });
@@ -19834,31 +19856,55 @@ function loadVercelConfig(appDir) {
19834
19856
  if (Array.isArray(config.redirects)) {
19835
19857
  for (const r2 of config.redirects) {
19836
19858
  routes.push({
19837
- src: r2.source,
19859
+ src: sourceToRegex(r2.source),
19838
19860
  dest: r2.destination,
19839
19861
  status: r2.statusCode ?? (r2.permanent ? 308 : 307)
19840
19862
  });
19841
19863
  }
19842
19864
  }
19843
- if (Array.isArray(config.rewrites)) {
19865
+ if (Array.isArray(config.rewrites) && config.rewrites.length > 0) {
19866
+ routes.push({ handle: "filesystem" });
19844
19867
  for (const rw of config.rewrites) {
19845
19868
  routes.push({
19846
- src: rw.source,
19869
+ src: sourceToRegex(rw.source),
19847
19870
  dest: rw.destination
19848
19871
  });
19849
19872
  }
19850
19873
  }
19851
- if (routes.length > 0) result.routes = routes;
19852
- if (config.cleanUrls != null) result.cleanUrls = config.cleanUrls;
19853
- if (config.trailingSlash != null) result.trailingSlash = config.trailingSlash;
19854
- return result;
19855
- } catch {
19856
- return {};
19874
+ return routes;
19875
+ } catch (err) {
19876
+ log.warn(
19877
+ `Failed to parse vercel.json: ${err instanceof Error ? err.message : String(err)}`
19878
+ );
19879
+ return [];
19880
+ }
19881
+ }
19882
+ function buildOutputConfig(appDir) {
19883
+ let routes = buildRoutes(appDir);
19884
+ const hasFilesystemHandle = routes.some(
19885
+ (r2) => "handle" in r2 && r2.handle === "filesystem"
19886
+ );
19887
+ if (!hasFilesystemHandle) {
19888
+ routes = [
19889
+ ...routes,
19890
+ { handle: "filesystem" },
19891
+ { src: "/(.*)", dest: "/index.html" }
19892
+ ];
19857
19893
  }
19894
+ const config = { version: 3, routes };
19895
+ const json = JSON.stringify(config, null, 2);
19896
+ const content = Buffer.from(json);
19897
+ const sha = createHash("sha1").update(content).digest("hex");
19898
+ log.debug(`Build Output config.json: ${routes.length} routes`);
19899
+ return {
19900
+ relativePath: ".vercel/output/config.json",
19901
+ content,
19902
+ sha,
19903
+ size: content.byteLength
19904
+ };
19858
19905
  }
19859
- async function createDeployment(files, token, orgId, projectId, projectName, appDir) {
19906
+ async function createDeployment(files, token, orgId, projectId, projectName) {
19860
19907
  const q2 = teamQuery(orgId);
19861
- const vercelConfig = loadVercelConfig(appDir);
19862
19908
  const body = {
19863
19909
  name: projectName,
19864
19910
  project: projectId,
@@ -19872,8 +19918,7 @@ async function createDeployment(files, token, orgId, projectId, projectName, app
19872
19918
  buildCommand: "",
19873
19919
  installCommand: "",
19874
19920
  outputDirectory: "."
19875
- },
19876
- ...vercelConfig
19921
+ }
19877
19922
  };
19878
19923
  const res = await fetch(`${VERCEL_API2}/v13/deployments${q2}`, {
19879
19924
  method: "POST",
@@ -19943,22 +19988,30 @@ async function deployVercelFrontend(appDir, _config) {
19943
19988
  const project = await validateProject(token, projectId, orgId);
19944
19989
  log.success(`Project accessible (${project.projectName})`);
19945
19990
  log.info("Collecting dist/ files...");
19946
- const files = await collectDistFiles(distDir);
19947
- if (files.length === 0) {
19948
- throw new Error("dist/ is empty \u2014 nothing to deploy.");
19949
- }
19950
- log.info(`Found ${files.length} files`);
19991
+ const distFiles = await collectDistFiles(distDir);
19992
+ if (distFiles.length === 0) {
19993
+ throw new Error("dist/ is empty - nothing to deploy.");
19994
+ }
19995
+ log.info(`Found ${distFiles.length} files`);
19996
+ const configFile = buildOutputConfig(appDir);
19997
+ const outputFiles = [
19998
+ configFile,
19999
+ ...distFiles.map((f) => ({
20000
+ ...f,
20001
+ relativePath: `.vercel/output/static/${f.relativePath}`
20002
+ }))
20003
+ ];
20004
+ log.debug(`Build Output: 1 config.json + ${distFiles.length} static files`);
19951
20005
  log.info("Uploading files to Vercel...");
19952
- await uploadFiles(files, token, orgId);
19953
- log.success(`${files.length} files uploaded`);
20006
+ await uploadFiles(outputFiles, token, orgId);
20007
+ log.success(`${outputFiles.length} files uploaded`);
19954
20008
  log.info("Creating production deployment...");
19955
20009
  const deployment = await createDeployment(
19956
- files,
20010
+ outputFiles,
19957
20011
  token,
19958
20012
  orgId,
19959
20013
  projectId,
19960
- project.projectName,
19961
- appDir
20014
+ project.projectName
19962
20015
  );
19963
20016
  log.info(`Deployment ${deployment.id} created, waiting...`);
19964
20017
  const ready = await waitForReady(deployment.id, token, orgId);
@@ -21381,7 +21434,7 @@ async function main9(_options, name) {
21381
21434
  const relativeMonorepoPath = executionMode === "development" ? calculateRelativePath(projectDirNormalized, monorepoRoot) : "";
21382
21435
  const primaryPlatform = Object.values(appConfigs).find(
21383
21436
  (c) => c.backend !== "none"
21384
- )?.backend ?? "firebase";
21437
+ )?.backend ?? "none";
21385
21438
  const hasVercel = Object.values(appConfigs).some(
21386
21439
  (c) => c.host === "vercel"
21387
21440
  );
@@ -22136,10 +22189,9 @@ async function runPrettier(rootDir, dryRun, verbose) {
22136
22189
  log.info("DRY RUN: Would run Prettier");
22137
22190
  return stats;
22138
22191
  }
22139
- const result = spawnSync10(`bunx ${prettierArgs.join(" ")}`, {
22192
+ const result = spawnSync10("bunx", prettierArgs, {
22140
22193
  cwd: rootDir,
22141
22194
  stdio: "pipe",
22142
- shell: true,
22143
22195
  encoding: "utf-8",
22144
22196
  env: { ...process.env }
22145
22197
  });
@@ -22292,6 +22344,19 @@ async function findCacheItems(targetDir, verbose) {
22292
22344
  check(joinPath(appPath, "node_modules", ".vite"));
22293
22345
  check(joinPath(appPath, "tsconfig.tsbuildinfo"));
22294
22346
  check(joinPath(appPath, "tsconfig.build.tsbuildinfo"));
22347
+ check(joinPath(appPath, "public", "route-manifest.json"));
22348
+ check(joinPath(appPath, "public", "theme-manifest.json"));
22349
+ check(joinPath(appPath, "public", "i18n-manifest.json"));
22350
+ check(joinPath(appPath, "public", "asset-manifest.json"));
22351
+ check(joinPath(appPath, "public", "seo-manifest.json"));
22352
+ check(joinPath(appPath, "public", "pwa-manifest.json"));
22353
+ check(joinPath(appPath, "public", "robots.txt"));
22354
+ check(joinPath(appPath, "public", "sitemap.xml"));
22355
+ check(joinPath(appPath, "public", "rss.xml"));
22356
+ check(joinPath(appPath, "public", "llms.txt"));
22357
+ check(joinPath(appPath, "public", "llms-full.txt"));
22358
+ check(joinPath(appPath, "public", "dndev-fonts.css"));
22359
+ check(joinPath(appPath, ".dndev-build"));
22295
22360
  }
22296
22361
  } catch (error2) {
22297
22362
  }
@@ -22310,8 +22375,8 @@ async function findCacheItems(targetDir, verbose) {
22310
22375
  for (const nestedPkg of nestedPackages) {
22311
22376
  const nestedPkgPath = joinPath(pkgPath, nestedPkg);
22312
22377
  try {
22313
- const stat2 = statSync2(nestedPkgPath);
22314
- if (stat2?.isDirectory()) {
22378
+ const stat = statSync2(nestedPkgPath);
22379
+ if (stat?.isDirectory()) {
22315
22380
  check(joinPath(nestedPkgPath, ".vite"));
22316
22381
  check(joinPath(nestedPkgPath, "dist"));
22317
22382
  check(joinPath(nestedPkgPath, "node_modules", ".vite"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/cli",
3
- "version": "0.0.37",
3
+ "version": "0.1.0",
4
4
  "description": "Command-line interface for DoNotDev Framework",
5
5
  "type": "module",
6
6
  "private": false,
@@ -50,7 +50,7 @@
50
50
  "scaffolding"
51
51
  ],
52
52
  "author": "AMBROISE PARK Consulting",
53
- "license": "SEE LICENSE IN LICENSE.md",
53
+ "license": "MIT",
54
54
  "engines": {
55
55
  "node": ">=20.0.0"
56
56
  },
@@ -9,3 +9,15 @@
9
9
  # =============================================================================
10
10
 
11
11
  SUPABASE_SECRET_KEY=
12
+
13
+ # =============================================================================
14
+ # OAuth Provider Credentials (server-side only)
15
+ # =============================================================================
16
+ # Add credentials for each OAuth provider you use.
17
+ # Get these from each provider's developer console.
18
+ # =============================================================================
19
+
20
+ # OAUTH_GITHUB_CLIENT_ID=
21
+ # OAUTH_GITHUB_CLIENT_SECRET=
22
+ # OAUTH_GOOGLE_CLIENT_ID=
23
+ # OAUTH_GOOGLE_CLIENT_SECRET=
@@ -0,0 +1,7 @@
1
+ // supabase/functions/disconnect-oauth/index.ts
2
+ // Supabase Edge Function — OAuth Disconnect
3
+ // Deploy: supabase functions deploy disconnect-oauth
4
+
5
+ import { createDisconnect } from '@donotdev/functions/supabase';
6
+
7
+ Deno.serve(createDisconnect());
@@ -0,0 +1,7 @@
1
+ // supabase/functions/exchange-token/index.ts
2
+ // Supabase Edge Function — OAuth Token Exchange
3
+ // Deploy: supabase functions deploy exchange-token
4
+
5
+ import { createExchangeToken } from '@donotdev/functions/supabase';
6
+
7
+ Deno.serve(createExchangeToken());