@donotdev/cli 0.0.25 → 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.
- package/README.md +7 -295
- package/dependencies-matrix.json +46 -134
- package/dist/bin/commands/agent-setup.js +1 -1
- package/dist/bin/commands/build.js +143 -142
- package/dist/bin/commands/bump.js +145 -144
- package/dist/bin/commands/cacheout.js +142 -141
- package/dist/bin/commands/coach.js +156 -151
- package/dist/bin/commands/create-app.js +22 -22
- package/dist/bin/commands/create-project.js +165 -164
- package/dist/bin/commands/db.js +46704 -46703
- package/dist/bin/commands/deploy.js +674 -575
- package/dist/bin/commands/dev.js +179 -159
- package/dist/bin/commands/doctor.js +152 -151
- package/dist/bin/commands/emu.js +173 -167
- package/dist/bin/commands/format.js +142 -141
- package/dist/bin/commands/get-demo.js +1 -1
- package/dist/bin/commands/make-admin.js +64121 -64042
- package/dist/bin/commands/preview.js +178 -159
- package/dist/bin/commands/seed.js +46704 -46703
- package/dist/bin/commands/setup-cicd.js +164 -158
- package/dist/bin/commands/setup.js +409 -209
- package/dist/bin/commands/staging.js +674 -575
- package/dist/bin/commands/sync-secrets.js +142 -141
- package/dist/bin/commands/type-check.js +142 -141
- package/dist/bin/dndev.js +79 -1
- package/dist/index.js +705 -590
- package/package.json +1 -1
- package/templates/root-consumer/bunfig.toml.example +6 -49
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +26 -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 {
|
|
@@ -485,6 +485,148 @@ var init_cli_output = __esm({
|
|
|
485
485
|
}
|
|
486
486
|
});
|
|
487
487
|
|
|
488
|
+
// packages/tooling/src/utils/errors.ts
|
|
489
|
+
var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
|
|
490
|
+
var init_errors = __esm({
|
|
491
|
+
"packages/tooling/src/utils/errors.ts"() {
|
|
492
|
+
"use strict";
|
|
493
|
+
init_utils();
|
|
494
|
+
DO_NOT_DEV_ERROR_CODES = {
|
|
495
|
+
CONFIGURATION_ERROR: "configuration-error",
|
|
496
|
+
CONFIG_NOT_FOUND: "config-not-found",
|
|
497
|
+
CONFIG_INVALID: "config-invalid",
|
|
498
|
+
PATH_RESOLUTION_ERROR: "path-resolution-error",
|
|
499
|
+
FILE_OPERATION_ERROR: "file-operation-error",
|
|
500
|
+
FILE_NOT_FOUND: "file-not-found",
|
|
501
|
+
PERMISSION_DENIED: "permission-denied",
|
|
502
|
+
GENERATION_ERROR: "generation-error",
|
|
503
|
+
TEMPLATE_ERROR: "template-error",
|
|
504
|
+
TEMPLATE_NOT_FOUND: "template-not-found",
|
|
505
|
+
CLI_EXECUTION_ERROR: "cli-execution-error",
|
|
506
|
+
COMMAND_NOT_FOUND: "command-not-found",
|
|
507
|
+
COMMAND_FAILED: "command-failed",
|
|
508
|
+
VALIDATION_ERROR: "validation-error",
|
|
509
|
+
SCHEMA_ERROR: "schema-error",
|
|
510
|
+
DEPENDENCY_ERROR: "dependency-error",
|
|
511
|
+
DEPENDENCY_NOT_FOUND: "dependency-not-found",
|
|
512
|
+
DEPENDENCY_VERSION_ERROR: "dependency-version-error",
|
|
513
|
+
INVALID_ARGUMENT: "invalid-argument",
|
|
514
|
+
MISSING_ARGUMENT: "missing-argument",
|
|
515
|
+
MISSING_PROJECT_ID: "missing-project-id",
|
|
516
|
+
FIREBASE_CLI_ERROR: "firebase-cli-error",
|
|
517
|
+
DEPLOYMENT_FAILED: "deployment-failed",
|
|
518
|
+
VERCEL_API_ERROR: "vercel-api-error",
|
|
519
|
+
OPERATION_CANCELLED: "operation-cancelled",
|
|
520
|
+
TIMEOUT_ERROR: "timeout-error",
|
|
521
|
+
UNKNOWN_ERROR: "unknown-error"
|
|
522
|
+
};
|
|
523
|
+
DoNotDevError = class _DoNotDevError extends Error {
|
|
524
|
+
/** The error code categorizing this error */
|
|
525
|
+
code;
|
|
526
|
+
/** Original error if this is wrapping another error */
|
|
527
|
+
originalError;
|
|
528
|
+
/** Additional context for the error */
|
|
529
|
+
context;
|
|
530
|
+
/** Whether this error should be displayed to the user */
|
|
531
|
+
displayable;
|
|
532
|
+
/**
|
|
533
|
+
* Creates a new DoNotDev error
|
|
534
|
+
*
|
|
535
|
+
* @param {string} message - Error message
|
|
536
|
+
* @param {DoNotDevErrorCode} code - Error code
|
|
537
|
+
* @param {object} [options] - Additional error options
|
|
538
|
+
* @param {Error} [options.originalError] - Original error if wrapping
|
|
539
|
+
* @param {Record<string, any>} [options.context] - Additional context data
|
|
540
|
+
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
541
|
+
*/
|
|
542
|
+
constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
|
|
543
|
+
super(message);
|
|
544
|
+
this.name = "DoNotDevError";
|
|
545
|
+
this.code = code;
|
|
546
|
+
this.originalError = options?.originalError;
|
|
547
|
+
this.context = options?.context;
|
|
548
|
+
this.displayable = options?.displayable !== false;
|
|
549
|
+
Object.setPrototypeOf(this, _DoNotDevError.prototype);
|
|
550
|
+
if (Error.captureStackTrace) {
|
|
551
|
+
Error.captureStackTrace(this, _DoNotDevError);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Formats the error for logging or display
|
|
556
|
+
*
|
|
557
|
+
* @returns {string} Formatted error message with code
|
|
558
|
+
*/
|
|
559
|
+
format() {
|
|
560
|
+
return `[${this.code}] ${this.message}`;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Creates a wrapped error from another error
|
|
564
|
+
*
|
|
565
|
+
* @param {Error} error - Original error to wrap
|
|
566
|
+
* @param {string} [context] - Additional context for the error
|
|
567
|
+
* @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
|
|
568
|
+
* @param {object} [options] - Additional error options
|
|
569
|
+
* @param {Record<string, any>} [options.context] - Additional context data
|
|
570
|
+
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
571
|
+
* @returns {DoNotDevError} New DoNotDev error wrapping the original
|
|
572
|
+
*/
|
|
573
|
+
static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
|
|
574
|
+
if (!(error2 instanceof Error)) {
|
|
575
|
+
return new _DoNotDevError(
|
|
576
|
+
`Unknown error: ${String(error2)}`,
|
|
577
|
+
code,
|
|
578
|
+
options
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
if (error2 instanceof _DoNotDevError) {
|
|
582
|
+
if (!context) {
|
|
583
|
+
return error2;
|
|
584
|
+
}
|
|
585
|
+
return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
|
|
586
|
+
originalError: error2.originalError || error2,
|
|
587
|
+
context: { ...error2.context, ...options?.context || {} },
|
|
588
|
+
displayable: options?.displayable ?? error2.displayable
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
const message = context ? `${context}: ${error2.message}` : error2.message;
|
|
592
|
+
return new _DoNotDevError(message, code, {
|
|
593
|
+
originalError: error2,
|
|
594
|
+
context: options?.context,
|
|
595
|
+
displayable: options?.displayable
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Maps common error types to DoNotDevErrorCode
|
|
600
|
+
*
|
|
601
|
+
* @param {Error} error - Error to analyze
|
|
602
|
+
* @returns {DoNotDevErrorCode} Mapped error code
|
|
603
|
+
*/
|
|
604
|
+
static getErrorCodeFromError(error2) {
|
|
605
|
+
if (error2 instanceof _DoNotDevError) {
|
|
606
|
+
return error2.code;
|
|
607
|
+
}
|
|
608
|
+
const message = error2.message.toLowerCase();
|
|
609
|
+
if (error2.name === "ValidationError" || message.includes("validation")) {
|
|
610
|
+
return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
|
|
611
|
+
}
|
|
612
|
+
if (message.includes("not found") || message.includes("no such file")) {
|
|
613
|
+
return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
|
|
614
|
+
}
|
|
615
|
+
if (message.includes("permission") || message.includes("access denied")) {
|
|
616
|
+
return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
|
|
617
|
+
}
|
|
618
|
+
if (message.includes("timeout") || message.includes("timed out")) {
|
|
619
|
+
return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
|
|
620
|
+
}
|
|
621
|
+
if (message.includes("dependency") || message.includes("module not found")) {
|
|
622
|
+
return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
|
|
623
|
+
}
|
|
624
|
+
return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
|
|
488
630
|
// node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
|
|
489
631
|
var require_array = __commonJS({
|
|
490
632
|
"node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
|
|
@@ -7228,147 +7370,6 @@ var init_PathResolver = __esm({
|
|
|
7228
7370
|
}
|
|
7229
7371
|
});
|
|
7230
7372
|
|
|
7231
|
-
// packages/tooling/src/utils/errors.ts
|
|
7232
|
-
var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
|
|
7233
|
-
var init_errors = __esm({
|
|
7234
|
-
"packages/tooling/src/utils/errors.ts"() {
|
|
7235
|
-
"use strict";
|
|
7236
|
-
init_utils();
|
|
7237
|
-
DO_NOT_DEV_ERROR_CODES = {
|
|
7238
|
-
CONFIGURATION_ERROR: "configuration-error",
|
|
7239
|
-
CONFIG_NOT_FOUND: "config-not-found",
|
|
7240
|
-
CONFIG_INVALID: "config-invalid",
|
|
7241
|
-
PATH_RESOLUTION_ERROR: "path-resolution-error",
|
|
7242
|
-
FILE_OPERATION_ERROR: "file-operation-error",
|
|
7243
|
-
FILE_NOT_FOUND: "file-not-found",
|
|
7244
|
-
PERMISSION_DENIED: "permission-denied",
|
|
7245
|
-
GENERATION_ERROR: "generation-error",
|
|
7246
|
-
TEMPLATE_ERROR: "template-error",
|
|
7247
|
-
TEMPLATE_NOT_FOUND: "template-not-found",
|
|
7248
|
-
CLI_EXECUTION_ERROR: "cli-execution-error",
|
|
7249
|
-
COMMAND_NOT_FOUND: "command-not-found",
|
|
7250
|
-
COMMAND_FAILED: "command-failed",
|
|
7251
|
-
VALIDATION_ERROR: "validation-error",
|
|
7252
|
-
SCHEMA_ERROR: "schema-error",
|
|
7253
|
-
DEPENDENCY_ERROR: "dependency-error",
|
|
7254
|
-
DEPENDENCY_NOT_FOUND: "dependency-not-found",
|
|
7255
|
-
DEPENDENCY_VERSION_ERROR: "dependency-version-error",
|
|
7256
|
-
INVALID_ARGUMENT: "invalid-argument",
|
|
7257
|
-
MISSING_ARGUMENT: "missing-argument",
|
|
7258
|
-
MISSING_PROJECT_ID: "missing-project-id",
|
|
7259
|
-
FIREBASE_CLI_ERROR: "firebase-cli-error",
|
|
7260
|
-
DEPLOYMENT_FAILED: "deployment-failed",
|
|
7261
|
-
OPERATION_CANCELLED: "operation-cancelled",
|
|
7262
|
-
TIMEOUT_ERROR: "timeout-error",
|
|
7263
|
-
UNKNOWN_ERROR: "unknown-error"
|
|
7264
|
-
};
|
|
7265
|
-
DoNotDevError = class _DoNotDevError extends Error {
|
|
7266
|
-
/** The error code categorizing this error */
|
|
7267
|
-
code;
|
|
7268
|
-
/** Original error if this is wrapping another error */
|
|
7269
|
-
originalError;
|
|
7270
|
-
/** Additional context for the error */
|
|
7271
|
-
context;
|
|
7272
|
-
/** Whether this error should be displayed to the user */
|
|
7273
|
-
displayable;
|
|
7274
|
-
/**
|
|
7275
|
-
* Creates a new DoNotDev error
|
|
7276
|
-
*
|
|
7277
|
-
* @param {string} message - Error message
|
|
7278
|
-
* @param {DoNotDevErrorCode} code - Error code
|
|
7279
|
-
* @param {object} [options] - Additional error options
|
|
7280
|
-
* @param {Error} [options.originalError] - Original error if wrapping
|
|
7281
|
-
* @param {Record<string, any>} [options.context] - Additional context data
|
|
7282
|
-
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
7283
|
-
*/
|
|
7284
|
-
constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
|
|
7285
|
-
super(message);
|
|
7286
|
-
this.name = "DoNotDevError";
|
|
7287
|
-
this.code = code;
|
|
7288
|
-
this.originalError = options?.originalError;
|
|
7289
|
-
this.context = options?.context;
|
|
7290
|
-
this.displayable = options?.displayable !== false;
|
|
7291
|
-
Object.setPrototypeOf(this, _DoNotDevError.prototype);
|
|
7292
|
-
if (Error.captureStackTrace) {
|
|
7293
|
-
Error.captureStackTrace(this, _DoNotDevError);
|
|
7294
|
-
}
|
|
7295
|
-
}
|
|
7296
|
-
/**
|
|
7297
|
-
* Formats the error for logging or display
|
|
7298
|
-
*
|
|
7299
|
-
* @returns {string} Formatted error message with code
|
|
7300
|
-
*/
|
|
7301
|
-
format() {
|
|
7302
|
-
return `[${this.code}] ${this.message}`;
|
|
7303
|
-
}
|
|
7304
|
-
/**
|
|
7305
|
-
* Creates a wrapped error from another error
|
|
7306
|
-
*
|
|
7307
|
-
* @param {Error} error - Original error to wrap
|
|
7308
|
-
* @param {string} [context] - Additional context for the error
|
|
7309
|
-
* @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
|
|
7310
|
-
* @param {object} [options] - Additional error options
|
|
7311
|
-
* @param {Record<string, any>} [options.context] - Additional context data
|
|
7312
|
-
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
7313
|
-
* @returns {DoNotDevError} New DoNotDev error wrapping the original
|
|
7314
|
-
*/
|
|
7315
|
-
static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
|
|
7316
|
-
if (!(error2 instanceof Error)) {
|
|
7317
|
-
return new _DoNotDevError(
|
|
7318
|
-
`Unknown error: ${String(error2)}`,
|
|
7319
|
-
code,
|
|
7320
|
-
options
|
|
7321
|
-
);
|
|
7322
|
-
}
|
|
7323
|
-
if (error2 instanceof _DoNotDevError) {
|
|
7324
|
-
if (!context) {
|
|
7325
|
-
return error2;
|
|
7326
|
-
}
|
|
7327
|
-
return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
|
|
7328
|
-
originalError: error2.originalError || error2,
|
|
7329
|
-
context: { ...error2.context, ...options?.context || {} },
|
|
7330
|
-
displayable: options?.displayable ?? error2.displayable
|
|
7331
|
-
});
|
|
7332
|
-
}
|
|
7333
|
-
const message = context ? `${context}: ${error2.message}` : error2.message;
|
|
7334
|
-
return new _DoNotDevError(message, code, {
|
|
7335
|
-
originalError: error2,
|
|
7336
|
-
context: options?.context,
|
|
7337
|
-
displayable: options?.displayable
|
|
7338
|
-
});
|
|
7339
|
-
}
|
|
7340
|
-
/**
|
|
7341
|
-
* Maps common error types to DoNotDevErrorCode
|
|
7342
|
-
*
|
|
7343
|
-
* @param {Error} error - Error to analyze
|
|
7344
|
-
* @returns {DoNotDevErrorCode} Mapped error code
|
|
7345
|
-
*/
|
|
7346
|
-
static getErrorCodeFromError(error2) {
|
|
7347
|
-
if (error2 instanceof _DoNotDevError) {
|
|
7348
|
-
return error2.code;
|
|
7349
|
-
}
|
|
7350
|
-
const message = error2.message.toLowerCase();
|
|
7351
|
-
if (error2.name === "ValidationError" || message.includes("validation")) {
|
|
7352
|
-
return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
|
|
7353
|
-
}
|
|
7354
|
-
if (message.includes("not found") || message.includes("no such file")) {
|
|
7355
|
-
return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
|
|
7356
|
-
}
|
|
7357
|
-
if (message.includes("permission") || message.includes("access denied")) {
|
|
7358
|
-
return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
|
|
7359
|
-
}
|
|
7360
|
-
if (message.includes("timeout") || message.includes("timed out")) {
|
|
7361
|
-
return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
|
|
7362
|
-
}
|
|
7363
|
-
if (message.includes("dependency") || message.includes("module not found")) {
|
|
7364
|
-
return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
|
|
7365
|
-
}
|
|
7366
|
-
return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
|
|
7367
|
-
}
|
|
7368
|
-
};
|
|
7369
|
-
}
|
|
7370
|
-
});
|
|
7371
|
-
|
|
7372
7373
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7373
7374
|
import { createRequire as createRequire2 } from "node:module";
|
|
7374
7375
|
import {
|
|
@@ -7427,8 +7428,8 @@ var init_typed_file_operations = __esm({
|
|
|
7427
7428
|
"packages/tooling/src/utils/typed-file-operations.ts"() {
|
|
7428
7429
|
"use strict";
|
|
7429
7430
|
init_utils();
|
|
7430
|
-
init_pathResolver();
|
|
7431
7431
|
init_errors();
|
|
7432
|
+
init_pathResolver();
|
|
7432
7433
|
}
|
|
7433
7434
|
});
|
|
7434
7435
|
|
|
@@ -7783,22 +7784,26 @@ var init_checklist_vercel = __esm({
|
|
|
7783
7784
|
action: "Create a Vercel token",
|
|
7784
7785
|
where: "Vercel Dashboard > Settings > Tokens",
|
|
7785
7786
|
dashboardUrl: "https://vercel.com/account/tokens",
|
|
7786
|
-
target:
|
|
7787
|
+
target: ".dndev.secrets",
|
|
7787
7788
|
hint: "VERCEL_TOKEN=your_token_here"
|
|
7788
7789
|
});
|
|
7789
7790
|
steps.push({
|
|
7790
|
-
action: "Copy
|
|
7791
|
+
action: "Copy Project ID",
|
|
7791
7792
|
where: "Vercel Dashboard > Project > Settings > General",
|
|
7792
7793
|
dashboardUrl: "https://vercel.com/dashboard",
|
|
7793
|
-
target: `${appRelative}/.env
|
|
7794
|
-
hint:
|
|
7795
|
-
|
|
7796
|
-
|
|
7794
|
+
target: `${appRelative}/.env`,
|
|
7795
|
+
hint: "VERCEL_PROJECT_ID=prj_..."
|
|
7796
|
+
});
|
|
7797
|
+
steps.push({
|
|
7798
|
+
action: "Copy Org ID (team/pro accounts only \u2014 skip for hobby/free)",
|
|
7799
|
+
where: "Vercel Dashboard > Settings > General > Team ID",
|
|
7800
|
+
dashboardUrl: "https://vercel.com/dashboard",
|
|
7801
|
+
target: `${appRelative}/.env`,
|
|
7802
|
+
hint: "VERCEL_ORG_ID=team_... (only if you have a team account)"
|
|
7797
7803
|
});
|
|
7798
7804
|
return {
|
|
7799
7805
|
provider: "Vercel",
|
|
7800
|
-
steps
|
|
7801
|
-
prerequisite: "Install Vercel CLI: npm install -g vercel"
|
|
7806
|
+
steps
|
|
7802
7807
|
};
|
|
7803
7808
|
}
|
|
7804
7809
|
};
|
|
@@ -7998,8 +8003,8 @@ init_utils();
|
|
|
7998
8003
|
// packages/tooling/src/cli/coach/coach.ts
|
|
7999
8004
|
init_utils();
|
|
8000
8005
|
init_cli_output();
|
|
8001
|
-
init_pathResolver();
|
|
8002
8006
|
init_cross_app_detection();
|
|
8007
|
+
init_pathResolver();
|
|
8003
8008
|
var CHECKLIST_ORDER = [
|
|
8004
8009
|
async () => (await Promise.resolve().then(() => (init_checklist_firebase(), checklist_firebase_exports))).firebaseChecklist,
|
|
8005
8010
|
async () => (await Promise.resolve().then(() => (init_checklist_supabase(), checklist_supabase_exports))).supabaseChecklist,
|