@donotdev/cli 0.0.25 → 0.0.27

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 (32) hide show
  1. package/README.md +7 -295
  2. package/dependencies-matrix.json +49 -21
  3. package/dist/bin/commands/agent-setup.js +1 -1
  4. package/dist/bin/commands/build.js +143 -142
  5. package/dist/bin/commands/bump.js +145 -144
  6. package/dist/bin/commands/cacheout.js +142 -141
  7. package/dist/bin/commands/coach.js +156 -151
  8. package/dist/bin/commands/create-app.js +22 -22
  9. package/dist/bin/commands/create-project.js +165 -164
  10. package/dist/bin/commands/db.js +46704 -46703
  11. package/dist/bin/commands/deploy.js +674 -575
  12. package/dist/bin/commands/dev.js +179 -159
  13. package/dist/bin/commands/doctor.js +152 -151
  14. package/dist/bin/commands/emu.js +186 -176
  15. package/dist/bin/commands/format.js +142 -141
  16. package/dist/bin/commands/get-demo.js +1 -1
  17. package/dist/bin/commands/make-admin.js +64133 -64040
  18. package/dist/bin/commands/preview.js +178 -159
  19. package/dist/bin/commands/seed.js +46704 -46703
  20. package/dist/bin/commands/setup-cicd.js +164 -158
  21. package/dist/bin/commands/setup.js +409 -209
  22. package/dist/bin/commands/staging.js +674 -575
  23. package/dist/bin/commands/sync-secrets.js +142 -141
  24. package/dist/bin/commands/type-check.js +142 -141
  25. package/dist/bin/dndev.js +93 -1
  26. package/dist/bin/donotdev.js +93 -1
  27. package/dist/index.js +713 -605
  28. package/package.json +1 -1
  29. package/templates/app-next/postcss.config.js.example +3 -54
  30. package/templates/root-consumer/bunfig.toml.example +6 -49
  31. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +19 -0
  32. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +50 -9
@@ -471,6 +471,148 @@ var init_cli_output = __esm({
471
471
  }
472
472
  });
473
473
 
474
+ // packages/tooling/src/utils/errors.ts
475
+ var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
476
+ var init_errors = __esm({
477
+ "packages/tooling/src/utils/errors.ts"() {
478
+ "use strict";
479
+ init_utils();
480
+ DO_NOT_DEV_ERROR_CODES = {
481
+ CONFIGURATION_ERROR: "configuration-error",
482
+ CONFIG_NOT_FOUND: "config-not-found",
483
+ CONFIG_INVALID: "config-invalid",
484
+ PATH_RESOLUTION_ERROR: "path-resolution-error",
485
+ FILE_OPERATION_ERROR: "file-operation-error",
486
+ FILE_NOT_FOUND: "file-not-found",
487
+ PERMISSION_DENIED: "permission-denied",
488
+ GENERATION_ERROR: "generation-error",
489
+ TEMPLATE_ERROR: "template-error",
490
+ TEMPLATE_NOT_FOUND: "template-not-found",
491
+ CLI_EXECUTION_ERROR: "cli-execution-error",
492
+ COMMAND_NOT_FOUND: "command-not-found",
493
+ COMMAND_FAILED: "command-failed",
494
+ VALIDATION_ERROR: "validation-error",
495
+ SCHEMA_ERROR: "schema-error",
496
+ DEPENDENCY_ERROR: "dependency-error",
497
+ DEPENDENCY_NOT_FOUND: "dependency-not-found",
498
+ DEPENDENCY_VERSION_ERROR: "dependency-version-error",
499
+ INVALID_ARGUMENT: "invalid-argument",
500
+ MISSING_ARGUMENT: "missing-argument",
501
+ MISSING_PROJECT_ID: "missing-project-id",
502
+ FIREBASE_CLI_ERROR: "firebase-cli-error",
503
+ DEPLOYMENT_FAILED: "deployment-failed",
504
+ VERCEL_API_ERROR: "vercel-api-error",
505
+ OPERATION_CANCELLED: "operation-cancelled",
506
+ TIMEOUT_ERROR: "timeout-error",
507
+ UNKNOWN_ERROR: "unknown-error"
508
+ };
509
+ DoNotDevError = class _DoNotDevError extends Error {
510
+ /** The error code categorizing this error */
511
+ code;
512
+ /** Original error if this is wrapping another error */
513
+ originalError;
514
+ /** Additional context for the error */
515
+ context;
516
+ /** Whether this error should be displayed to the user */
517
+ displayable;
518
+ /**
519
+ * Creates a new DoNotDev error
520
+ *
521
+ * @param {string} message - Error message
522
+ * @param {DoNotDevErrorCode} code - Error code
523
+ * @param {object} [options] - Additional error options
524
+ * @param {Error} [options.originalError] - Original error if wrapping
525
+ * @param {Record<string, any>} [options.context] - Additional context data
526
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
527
+ */
528
+ constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
529
+ super(message);
530
+ this.name = "DoNotDevError";
531
+ this.code = code;
532
+ this.originalError = options?.originalError;
533
+ this.context = options?.context;
534
+ this.displayable = options?.displayable !== false;
535
+ Object.setPrototypeOf(this, _DoNotDevError.prototype);
536
+ if (Error.captureStackTrace) {
537
+ Error.captureStackTrace(this, _DoNotDevError);
538
+ }
539
+ }
540
+ /**
541
+ * Formats the error for logging or display
542
+ *
543
+ * @returns {string} Formatted error message with code
544
+ */
545
+ format() {
546
+ return `[${this.code}] ${this.message}`;
547
+ }
548
+ /**
549
+ * Creates a wrapped error from another error
550
+ *
551
+ * @param {Error} error - Original error to wrap
552
+ * @param {string} [context] - Additional context for the error
553
+ * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
554
+ * @param {object} [options] - Additional error options
555
+ * @param {Record<string, any>} [options.context] - Additional context data
556
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
557
+ * @returns {DoNotDevError} New DoNotDev error wrapping the original
558
+ */
559
+ static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
560
+ if (!(error2 instanceof Error)) {
561
+ return new _DoNotDevError(
562
+ `Unknown error: ${String(error2)}`,
563
+ code,
564
+ options
565
+ );
566
+ }
567
+ if (error2 instanceof _DoNotDevError) {
568
+ if (!context) {
569
+ return error2;
570
+ }
571
+ return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
572
+ originalError: error2.originalError || error2,
573
+ context: { ...error2.context, ...options?.context || {} },
574
+ displayable: options?.displayable ?? error2.displayable
575
+ });
576
+ }
577
+ const message = context ? `${context}: ${error2.message}` : error2.message;
578
+ return new _DoNotDevError(message, code, {
579
+ originalError: error2,
580
+ context: options?.context,
581
+ displayable: options?.displayable
582
+ });
583
+ }
584
+ /**
585
+ * Maps common error types to DoNotDevErrorCode
586
+ *
587
+ * @param {Error} error - Error to analyze
588
+ * @returns {DoNotDevErrorCode} Mapped error code
589
+ */
590
+ static getErrorCodeFromError(error2) {
591
+ if (error2 instanceof _DoNotDevError) {
592
+ return error2.code;
593
+ }
594
+ const message = error2.message.toLowerCase();
595
+ if (error2.name === "ValidationError" || message.includes("validation")) {
596
+ return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
597
+ }
598
+ if (message.includes("not found") || message.includes("no such file")) {
599
+ return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
600
+ }
601
+ if (message.includes("permission") || message.includes("access denied")) {
602
+ return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
603
+ }
604
+ if (message.includes("timeout") || message.includes("timed out")) {
605
+ return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
606
+ }
607
+ if (message.includes("dependency") || message.includes("module not found")) {
608
+ return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
609
+ }
610
+ return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
611
+ }
612
+ };
613
+ }
614
+ });
615
+
474
616
  // node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
475
617
  var require_array = __commonJS({
476
618
  "node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
@@ -7214,147 +7356,6 @@ var init_PathResolver = __esm({
7214
7356
  }
7215
7357
  });
7216
7358
 
7217
- // packages/tooling/src/utils/errors.ts
7218
- var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
7219
- var init_errors = __esm({
7220
- "packages/tooling/src/utils/errors.ts"() {
7221
- "use strict";
7222
- init_utils();
7223
- DO_NOT_DEV_ERROR_CODES = {
7224
- CONFIGURATION_ERROR: "configuration-error",
7225
- CONFIG_NOT_FOUND: "config-not-found",
7226
- CONFIG_INVALID: "config-invalid",
7227
- PATH_RESOLUTION_ERROR: "path-resolution-error",
7228
- FILE_OPERATION_ERROR: "file-operation-error",
7229
- FILE_NOT_FOUND: "file-not-found",
7230
- PERMISSION_DENIED: "permission-denied",
7231
- GENERATION_ERROR: "generation-error",
7232
- TEMPLATE_ERROR: "template-error",
7233
- TEMPLATE_NOT_FOUND: "template-not-found",
7234
- CLI_EXECUTION_ERROR: "cli-execution-error",
7235
- COMMAND_NOT_FOUND: "command-not-found",
7236
- COMMAND_FAILED: "command-failed",
7237
- VALIDATION_ERROR: "validation-error",
7238
- SCHEMA_ERROR: "schema-error",
7239
- DEPENDENCY_ERROR: "dependency-error",
7240
- DEPENDENCY_NOT_FOUND: "dependency-not-found",
7241
- DEPENDENCY_VERSION_ERROR: "dependency-version-error",
7242
- INVALID_ARGUMENT: "invalid-argument",
7243
- MISSING_ARGUMENT: "missing-argument",
7244
- MISSING_PROJECT_ID: "missing-project-id",
7245
- FIREBASE_CLI_ERROR: "firebase-cli-error",
7246
- DEPLOYMENT_FAILED: "deployment-failed",
7247
- OPERATION_CANCELLED: "operation-cancelled",
7248
- TIMEOUT_ERROR: "timeout-error",
7249
- UNKNOWN_ERROR: "unknown-error"
7250
- };
7251
- DoNotDevError = class _DoNotDevError extends Error {
7252
- /** The error code categorizing this error */
7253
- code;
7254
- /** Original error if this is wrapping another error */
7255
- originalError;
7256
- /** Additional context for the error */
7257
- context;
7258
- /** Whether this error should be displayed to the user */
7259
- displayable;
7260
- /**
7261
- * Creates a new DoNotDev error
7262
- *
7263
- * @param {string} message - Error message
7264
- * @param {DoNotDevErrorCode} code - Error code
7265
- * @param {object} [options] - Additional error options
7266
- * @param {Error} [options.originalError] - Original error if wrapping
7267
- * @param {Record<string, any>} [options.context] - Additional context data
7268
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7269
- */
7270
- constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7271
- super(message);
7272
- this.name = "DoNotDevError";
7273
- this.code = code;
7274
- this.originalError = options?.originalError;
7275
- this.context = options?.context;
7276
- this.displayable = options?.displayable !== false;
7277
- Object.setPrototypeOf(this, _DoNotDevError.prototype);
7278
- if (Error.captureStackTrace) {
7279
- Error.captureStackTrace(this, _DoNotDevError);
7280
- }
7281
- }
7282
- /**
7283
- * Formats the error for logging or display
7284
- *
7285
- * @returns {string} Formatted error message with code
7286
- */
7287
- format() {
7288
- return `[${this.code}] ${this.message}`;
7289
- }
7290
- /**
7291
- * Creates a wrapped error from another error
7292
- *
7293
- * @param {Error} error - Original error to wrap
7294
- * @param {string} [context] - Additional context for the error
7295
- * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
7296
- * @param {object} [options] - Additional error options
7297
- * @param {Record<string, any>} [options.context] - Additional context data
7298
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7299
- * @returns {DoNotDevError} New DoNotDev error wrapping the original
7300
- */
7301
- static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7302
- if (!(error2 instanceof Error)) {
7303
- return new _DoNotDevError(
7304
- `Unknown error: ${String(error2)}`,
7305
- code,
7306
- options
7307
- );
7308
- }
7309
- if (error2 instanceof _DoNotDevError) {
7310
- if (!context) {
7311
- return error2;
7312
- }
7313
- return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
7314
- originalError: error2.originalError || error2,
7315
- context: { ...error2.context, ...options?.context || {} },
7316
- displayable: options?.displayable ?? error2.displayable
7317
- });
7318
- }
7319
- const message = context ? `${context}: ${error2.message}` : error2.message;
7320
- return new _DoNotDevError(message, code, {
7321
- originalError: error2,
7322
- context: options?.context,
7323
- displayable: options?.displayable
7324
- });
7325
- }
7326
- /**
7327
- * Maps common error types to DoNotDevErrorCode
7328
- *
7329
- * @param {Error} error - Error to analyze
7330
- * @returns {DoNotDevErrorCode} Mapped error code
7331
- */
7332
- static getErrorCodeFromError(error2) {
7333
- if (error2 instanceof _DoNotDevError) {
7334
- return error2.code;
7335
- }
7336
- const message = error2.message.toLowerCase();
7337
- if (error2.name === "ValidationError" || message.includes("validation")) {
7338
- return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
7339
- }
7340
- if (message.includes("not found") || message.includes("no such file")) {
7341
- return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
7342
- }
7343
- if (message.includes("permission") || message.includes("access denied")) {
7344
- return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
7345
- }
7346
- if (message.includes("timeout") || message.includes("timed out")) {
7347
- return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
7348
- }
7349
- if (message.includes("dependency") || message.includes("module not found")) {
7350
- return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
7351
- }
7352
- return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
7353
- }
7354
- };
7355
- }
7356
- });
7357
-
7358
7359
  // packages/tooling/src/utils/pathResolver.ts
7359
7360
  import { createRequire as createRequire2 } from "node:module";
7360
7361
  import {
@@ -8209,8 +8209,8 @@ function generatePackageJson(templateName, mode, options = {}) {
8209
8209
 
8210
8210
  // packages/tooling/src/scaffolding/get-demo.ts
8211
8211
  init_utils();
8212
- init_cli_output();
8213
8212
  init_cli_input();
8213
+ init_cli_output();
8214
8214
  init_pathResolver();
8215
8215
  async function main(options) {
8216
8216
  Ie("get-demo");