@donotdev/cli 0.0.24 → 0.0.26

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 (34) hide show
  1. package/README.md +7 -295
  2. package/dependencies-matrix.json +47 -135
  3. package/dist/bin/commands/agent-setup.js +3 -3
  4. package/dist/bin/commands/build.js +144 -143
  5. package/dist/bin/commands/bump.js +146 -145
  6. package/dist/bin/commands/cacheout.js +143 -142
  7. package/dist/bin/commands/coach.js +157 -152
  8. package/dist/bin/commands/create-app.js +23 -23
  9. package/dist/bin/commands/create-project.js +166 -165
  10. package/dist/bin/commands/db.js +46705 -46704
  11. package/dist/bin/commands/deploy.js +684 -580
  12. package/dist/bin/commands/dev.js +180 -160
  13. package/dist/bin/commands/doctor.js +153 -152
  14. package/dist/bin/commands/emu.js +174 -168
  15. package/dist/bin/commands/format.js +144 -143
  16. package/dist/bin/commands/get-demo.js +2 -2
  17. package/dist/bin/commands/make-admin.js +64122 -64043
  18. package/dist/bin/commands/preview.js +179 -160
  19. package/dist/bin/commands/seed.js +46705 -46704
  20. package/dist/bin/commands/setup-cicd.js +165 -159
  21. package/dist/bin/commands/setup.js +414 -214
  22. package/dist/bin/commands/staging.js +684 -580
  23. package/dist/bin/commands/sync-secrets.js +143 -142
  24. package/dist/bin/commands/type-check.js +143 -142
  25. package/dist/bin/commands/wai.js +1 -1
  26. package/dist/bin/dndev.js +79 -1
  27. package/dist/index.js +713 -593
  28. package/package.json +1 -1
  29. package/templates/root-consumer/.cursor/mcp.json.example +1 -1
  30. package/templates/root-consumer/.gemini/settings.json.example +1 -1
  31. package/templates/root-consumer/.mcp.json.example +1 -1
  32. package/templates/root-consumer/bunfig.toml.example +6 -53
  33. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +26 -9
  34. package/templates/root-consumer/vercel.json.example +2 -1
@@ -500,6 +500,148 @@ var init_cli_output = __esm({
500
500
  }
501
501
  });
502
502
 
503
+ // packages/tooling/src/utils/errors.ts
504
+ var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
505
+ var init_errors = __esm({
506
+ "packages/tooling/src/utils/errors.ts"() {
507
+ "use strict";
508
+ init_utils();
509
+ DO_NOT_DEV_ERROR_CODES = {
510
+ CONFIGURATION_ERROR: "configuration-error",
511
+ CONFIG_NOT_FOUND: "config-not-found",
512
+ CONFIG_INVALID: "config-invalid",
513
+ PATH_RESOLUTION_ERROR: "path-resolution-error",
514
+ FILE_OPERATION_ERROR: "file-operation-error",
515
+ FILE_NOT_FOUND: "file-not-found",
516
+ PERMISSION_DENIED: "permission-denied",
517
+ GENERATION_ERROR: "generation-error",
518
+ TEMPLATE_ERROR: "template-error",
519
+ TEMPLATE_NOT_FOUND: "template-not-found",
520
+ CLI_EXECUTION_ERROR: "cli-execution-error",
521
+ COMMAND_NOT_FOUND: "command-not-found",
522
+ COMMAND_FAILED: "command-failed",
523
+ VALIDATION_ERROR: "validation-error",
524
+ SCHEMA_ERROR: "schema-error",
525
+ DEPENDENCY_ERROR: "dependency-error",
526
+ DEPENDENCY_NOT_FOUND: "dependency-not-found",
527
+ DEPENDENCY_VERSION_ERROR: "dependency-version-error",
528
+ INVALID_ARGUMENT: "invalid-argument",
529
+ MISSING_ARGUMENT: "missing-argument",
530
+ MISSING_PROJECT_ID: "missing-project-id",
531
+ FIREBASE_CLI_ERROR: "firebase-cli-error",
532
+ DEPLOYMENT_FAILED: "deployment-failed",
533
+ VERCEL_API_ERROR: "vercel-api-error",
534
+ OPERATION_CANCELLED: "operation-cancelled",
535
+ TIMEOUT_ERROR: "timeout-error",
536
+ UNKNOWN_ERROR: "unknown-error"
537
+ };
538
+ DoNotDevError = class _DoNotDevError extends Error {
539
+ /** The error code categorizing this error */
540
+ code;
541
+ /** Original error if this is wrapping another error */
542
+ originalError;
543
+ /** Additional context for the error */
544
+ context;
545
+ /** Whether this error should be displayed to the user */
546
+ displayable;
547
+ /**
548
+ * Creates a new DoNotDev error
549
+ *
550
+ * @param {string} message - Error message
551
+ * @param {DoNotDevErrorCode} code - Error code
552
+ * @param {object} [options] - Additional error options
553
+ * @param {Error} [options.originalError] - Original error if wrapping
554
+ * @param {Record<string, any>} [options.context] - Additional context data
555
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
556
+ */
557
+ constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
558
+ super(message);
559
+ this.name = "DoNotDevError";
560
+ this.code = code;
561
+ this.originalError = options?.originalError;
562
+ this.context = options?.context;
563
+ this.displayable = options?.displayable !== false;
564
+ Object.setPrototypeOf(this, _DoNotDevError.prototype);
565
+ if (Error.captureStackTrace) {
566
+ Error.captureStackTrace(this, _DoNotDevError);
567
+ }
568
+ }
569
+ /**
570
+ * Formats the error for logging or display
571
+ *
572
+ * @returns {string} Formatted error message with code
573
+ */
574
+ format() {
575
+ return `[${this.code}] ${this.message}`;
576
+ }
577
+ /**
578
+ * Creates a wrapped error from another error
579
+ *
580
+ * @param {Error} error - Original error to wrap
581
+ * @param {string} [context] - Additional context for the error
582
+ * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
583
+ * @param {object} [options] - Additional error options
584
+ * @param {Record<string, any>} [options.context] - Additional context data
585
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
586
+ * @returns {DoNotDevError} New DoNotDev error wrapping the original
587
+ */
588
+ static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
589
+ if (!(error2 instanceof Error)) {
590
+ return new _DoNotDevError(
591
+ `Unknown error: ${String(error2)}`,
592
+ code,
593
+ options
594
+ );
595
+ }
596
+ if (error2 instanceof _DoNotDevError) {
597
+ if (!context) {
598
+ return error2;
599
+ }
600
+ return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
601
+ originalError: error2.originalError || error2,
602
+ context: { ...error2.context, ...options?.context || {} },
603
+ displayable: options?.displayable ?? error2.displayable
604
+ });
605
+ }
606
+ const message = context ? `${context}: ${error2.message}` : error2.message;
607
+ return new _DoNotDevError(message, code, {
608
+ originalError: error2,
609
+ context: options?.context,
610
+ displayable: options?.displayable
611
+ });
612
+ }
613
+ /**
614
+ * Maps common error types to DoNotDevErrorCode
615
+ *
616
+ * @param {Error} error - Error to analyze
617
+ * @returns {DoNotDevErrorCode} Mapped error code
618
+ */
619
+ static getErrorCodeFromError(error2) {
620
+ if (error2 instanceof _DoNotDevError) {
621
+ return error2.code;
622
+ }
623
+ const message = error2.message.toLowerCase();
624
+ if (error2.name === "ValidationError" || message.includes("validation")) {
625
+ return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
626
+ }
627
+ if (message.includes("not found") || message.includes("no such file")) {
628
+ return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
629
+ }
630
+ if (message.includes("permission") || message.includes("access denied")) {
631
+ return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
632
+ }
633
+ if (message.includes("timeout") || message.includes("timed out")) {
634
+ return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
635
+ }
636
+ if (message.includes("dependency") || message.includes("module not found")) {
637
+ return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
638
+ }
639
+ return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
640
+ }
641
+ };
642
+ }
643
+ });
644
+
503
645
  // node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
504
646
  var require_array = __commonJS({
505
647
  "node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
@@ -7243,147 +7385,6 @@ var init_PathResolver = __esm({
7243
7385
  }
7244
7386
  });
7245
7387
 
7246
- // packages/tooling/src/utils/errors.ts
7247
- var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
7248
- var init_errors = __esm({
7249
- "packages/tooling/src/utils/errors.ts"() {
7250
- "use strict";
7251
- init_utils();
7252
- DO_NOT_DEV_ERROR_CODES = {
7253
- CONFIGURATION_ERROR: "configuration-error",
7254
- CONFIG_NOT_FOUND: "config-not-found",
7255
- CONFIG_INVALID: "config-invalid",
7256
- PATH_RESOLUTION_ERROR: "path-resolution-error",
7257
- FILE_OPERATION_ERROR: "file-operation-error",
7258
- FILE_NOT_FOUND: "file-not-found",
7259
- PERMISSION_DENIED: "permission-denied",
7260
- GENERATION_ERROR: "generation-error",
7261
- TEMPLATE_ERROR: "template-error",
7262
- TEMPLATE_NOT_FOUND: "template-not-found",
7263
- CLI_EXECUTION_ERROR: "cli-execution-error",
7264
- COMMAND_NOT_FOUND: "command-not-found",
7265
- COMMAND_FAILED: "command-failed",
7266
- VALIDATION_ERROR: "validation-error",
7267
- SCHEMA_ERROR: "schema-error",
7268
- DEPENDENCY_ERROR: "dependency-error",
7269
- DEPENDENCY_NOT_FOUND: "dependency-not-found",
7270
- DEPENDENCY_VERSION_ERROR: "dependency-version-error",
7271
- INVALID_ARGUMENT: "invalid-argument",
7272
- MISSING_ARGUMENT: "missing-argument",
7273
- MISSING_PROJECT_ID: "missing-project-id",
7274
- FIREBASE_CLI_ERROR: "firebase-cli-error",
7275
- DEPLOYMENT_FAILED: "deployment-failed",
7276
- OPERATION_CANCELLED: "operation-cancelled",
7277
- TIMEOUT_ERROR: "timeout-error",
7278
- UNKNOWN_ERROR: "unknown-error"
7279
- };
7280
- DoNotDevError = class _DoNotDevError extends Error {
7281
- /** The error code categorizing this error */
7282
- code;
7283
- /** Original error if this is wrapping another error */
7284
- originalError;
7285
- /** Additional context for the error */
7286
- context;
7287
- /** Whether this error should be displayed to the user */
7288
- displayable;
7289
- /**
7290
- * Creates a new DoNotDev error
7291
- *
7292
- * @param {string} message - Error message
7293
- * @param {DoNotDevErrorCode} code - Error code
7294
- * @param {object} [options] - Additional error options
7295
- * @param {Error} [options.originalError] - Original error if wrapping
7296
- * @param {Record<string, any>} [options.context] - Additional context data
7297
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7298
- */
7299
- constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7300
- super(message);
7301
- this.name = "DoNotDevError";
7302
- this.code = code;
7303
- this.originalError = options?.originalError;
7304
- this.context = options?.context;
7305
- this.displayable = options?.displayable !== false;
7306
- Object.setPrototypeOf(this, _DoNotDevError.prototype);
7307
- if (Error.captureStackTrace) {
7308
- Error.captureStackTrace(this, _DoNotDevError);
7309
- }
7310
- }
7311
- /**
7312
- * Formats the error for logging or display
7313
- *
7314
- * @returns {string} Formatted error message with code
7315
- */
7316
- format() {
7317
- return `[${this.code}] ${this.message}`;
7318
- }
7319
- /**
7320
- * Creates a wrapped error from another error
7321
- *
7322
- * @param {Error} error - Original error to wrap
7323
- * @param {string} [context] - Additional context for the error
7324
- * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
7325
- * @param {object} [options] - Additional error options
7326
- * @param {Record<string, any>} [options.context] - Additional context data
7327
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7328
- * @returns {DoNotDevError} New DoNotDev error wrapping the original
7329
- */
7330
- static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7331
- if (!(error2 instanceof Error)) {
7332
- return new _DoNotDevError(
7333
- `Unknown error: ${String(error2)}`,
7334
- code,
7335
- options
7336
- );
7337
- }
7338
- if (error2 instanceof _DoNotDevError) {
7339
- if (!context) {
7340
- return error2;
7341
- }
7342
- return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
7343
- originalError: error2.originalError || error2,
7344
- context: { ...error2.context, ...options?.context || {} },
7345
- displayable: options?.displayable ?? error2.displayable
7346
- });
7347
- }
7348
- const message = context ? `${context}: ${error2.message}` : error2.message;
7349
- return new _DoNotDevError(message, code, {
7350
- originalError: error2,
7351
- context: options?.context,
7352
- displayable: options?.displayable
7353
- });
7354
- }
7355
- /**
7356
- * Maps common error types to DoNotDevErrorCode
7357
- *
7358
- * @param {Error} error - Error to analyze
7359
- * @returns {DoNotDevErrorCode} Mapped error code
7360
- */
7361
- static getErrorCodeFromError(error2) {
7362
- if (error2 instanceof _DoNotDevError) {
7363
- return error2.code;
7364
- }
7365
- const message = error2.message.toLowerCase();
7366
- if (error2.name === "ValidationError" || message.includes("validation")) {
7367
- return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
7368
- }
7369
- if (message.includes("not found") || message.includes("no such file")) {
7370
- return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
7371
- }
7372
- if (message.includes("permission") || message.includes("access denied")) {
7373
- return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
7374
- }
7375
- if (message.includes("timeout") || message.includes("timed out")) {
7376
- return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
7377
- }
7378
- if (message.includes("dependency") || message.includes("module not found")) {
7379
- return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
7380
- }
7381
- return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
7382
- }
7383
- };
7384
- }
7385
- });
7386
-
7387
7388
  // packages/tooling/src/utils/pathResolver.ts
7388
7389
  import { createRequire as createRequire2 } from "node:module";
7389
7390
  import {
@@ -7442,14 +7443,14 @@ var init_typed_file_operations = __esm({
7442
7443
  "packages/tooling/src/utils/typed-file-operations.ts"() {
7443
7444
  "use strict";
7444
7445
  init_utils();
7445
- init_pathResolver();
7446
7446
  init_errors();
7447
+ init_pathResolver();
7447
7448
  }
7448
7449
  });
7449
7450
 
7450
7451
  // packages/tooling/src/bundler/utils.ts
7451
7452
  import { Buffer } from "node:buffer";
7452
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7453
+ import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7453
7454
  import { createRequire as createRequire3 } from "node:module";
7454
7455
  import { dirname as dirname3, resolve as resolve3 } from "node:path";
7455
7456
  import process from "node:process";
@@ -7622,10 +7623,6 @@ function loadDndevSecrets(projectRoot) {
7622
7623
  }
7623
7624
  function resolveSecret(name, projectRoot, opts) {
7624
7625
  const appDir = opts?.appDir ?? projectRoot;
7625
- const envValue = process.env[name];
7626
- if (envValue) {
7627
- return { value: envValue, source: "process.env" };
7628
- }
7629
7626
  const secrets = loadDndevSecrets(projectRoot);
7630
7627
  if (secrets[name]) {
7631
7628
  return { value: secrets[name], source: ".dndev.secrets" };
@@ -7636,6 +7633,10 @@ function resolveSecret(name, projectRoot, opts) {
7636
7633
  source: ".dndev.secrets"
7637
7634
  };
7638
7635
  }
7636
+ const envValue = process.env[name];
7637
+ if (envValue) {
7638
+ return { value: envValue, source: "process.env" };
7639
+ }
7639
7640
  const legacyPaths = LEGACY_PATHS[name];
7640
7641
  if (legacyPaths) {
7641
7642
  for (const relPath of legacyPaths) {
@@ -7671,8 +7672,8 @@ var init_secrets_resolver = __esm({
7671
7672
  "packages/tooling/src/utils/secrets-resolver.ts"() {
7672
7673
  "use strict";
7673
7674
  init_utils();
7674
- init_pathResolver();
7675
7675
  init_cli_output();
7676
+ init_pathResolver();
7676
7677
  LEGACY_PATHS = {
7677
7678
  VERCEL_TOKEN: [".env.local"],
7678
7679
  SUPABASE_SECRET_KEY: ["supabase/functions/.env", "functions/.env"],
@@ -7870,8 +7871,8 @@ var init_check_firebase = __esm({
7870
7871
  "packages/tooling/src/cli/doctor/check-firebase.ts"() {
7871
7872
  "use strict";
7872
7873
  init_utils();
7873
- init_pathResolver();
7874
7874
  init_cross_app_detection();
7875
+ init_pathResolver();
7875
7876
  firebaseCheck = {
7876
7877
  id: "firebase",
7877
7878
  name: "Firebase",
@@ -8030,10 +8031,10 @@ var init_check_supabase = __esm({
8030
8031
  "packages/tooling/src/cli/doctor/check-supabase.ts"() {
8031
8032
  "use strict";
8032
8033
  init_utils();
8033
- init_pathResolver();
8034
8034
  init_cross_app_detection();
8035
- init_supabase();
8035
+ init_pathResolver();
8036
8036
  init_secrets_resolver();
8037
+ init_supabase();
8037
8038
  supabaseCheck = {
8038
8039
  id: "supabase",
8039
8040
  name: "Supabase",
@@ -8243,8 +8244,8 @@ init_utils();
8243
8244
  // packages/tooling/src/cli/doctor/doctor.ts
8244
8245
  init_utils();
8245
8246
  init_cli_output();
8246
- init_pathResolver();
8247
8247
  init_cross_app_detection();
8248
+ init_pathResolver();
8248
8249
  var CHECK_REGISTRY = [
8249
8250
  { id: "env", load: async () => (await Promise.resolve().then(() => (init_check_env(), check_env_exports))).envCheck },
8250
8251
  {