@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
@@ -492,7 +492,7 @@ var init_cli_output = __esm({
492
492
 
493
493
  // packages/tooling/src/bundler/utils.ts
494
494
  import { Buffer } from "node:buffer";
495
- import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
495
+ import { copyFileSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
496
496
  import { createRequire } from "node:module";
497
497
  import { dirname, resolve } from "node:path";
498
498
  import process from "node:process";
@@ -529,11 +529,11 @@ init_utils();
529
529
  // packages/tooling/src/cli/agent-setup.ts
530
530
  init_utils();
531
531
  init_cli_output();
532
- import { join } from "path";
533
532
  import { existsSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
533
+ import { join } from "path";
534
534
  var mcpConfig = {
535
535
  command: "bunx",
536
- args: ["@donotdev/mcp-server"]
536
+ args: ["@donotdev/mcp-server@latest"]
537
537
  };
538
538
  function readJsonConfig(path, fallback) {
539
539
  try {
@@ -859,6 +859,148 @@ var init_cli_output = __esm({
859
859
  }
860
860
  });
861
861
 
862
+ // packages/tooling/src/utils/errors.ts
863
+ var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
864
+ var init_errors = __esm({
865
+ "packages/tooling/src/utils/errors.ts"() {
866
+ "use strict";
867
+ init_utils();
868
+ DO_NOT_DEV_ERROR_CODES = {
869
+ CONFIGURATION_ERROR: "configuration-error",
870
+ CONFIG_NOT_FOUND: "config-not-found",
871
+ CONFIG_INVALID: "config-invalid",
872
+ PATH_RESOLUTION_ERROR: "path-resolution-error",
873
+ FILE_OPERATION_ERROR: "file-operation-error",
874
+ FILE_NOT_FOUND: "file-not-found",
875
+ PERMISSION_DENIED: "permission-denied",
876
+ GENERATION_ERROR: "generation-error",
877
+ TEMPLATE_ERROR: "template-error",
878
+ TEMPLATE_NOT_FOUND: "template-not-found",
879
+ CLI_EXECUTION_ERROR: "cli-execution-error",
880
+ COMMAND_NOT_FOUND: "command-not-found",
881
+ COMMAND_FAILED: "command-failed",
882
+ VALIDATION_ERROR: "validation-error",
883
+ SCHEMA_ERROR: "schema-error",
884
+ DEPENDENCY_ERROR: "dependency-error",
885
+ DEPENDENCY_NOT_FOUND: "dependency-not-found",
886
+ DEPENDENCY_VERSION_ERROR: "dependency-version-error",
887
+ INVALID_ARGUMENT: "invalid-argument",
888
+ MISSING_ARGUMENT: "missing-argument",
889
+ MISSING_PROJECT_ID: "missing-project-id",
890
+ FIREBASE_CLI_ERROR: "firebase-cli-error",
891
+ DEPLOYMENT_FAILED: "deployment-failed",
892
+ VERCEL_API_ERROR: "vercel-api-error",
893
+ OPERATION_CANCELLED: "operation-cancelled",
894
+ TIMEOUT_ERROR: "timeout-error",
895
+ UNKNOWN_ERROR: "unknown-error"
896
+ };
897
+ DoNotDevError = class _DoNotDevError extends Error {
898
+ /** The error code categorizing this error */
899
+ code;
900
+ /** Original error if this is wrapping another error */
901
+ originalError;
902
+ /** Additional context for the error */
903
+ context;
904
+ /** Whether this error should be displayed to the user */
905
+ displayable;
906
+ /**
907
+ * Creates a new DoNotDev error
908
+ *
909
+ * @param {string} message - Error message
910
+ * @param {DoNotDevErrorCode} code - Error code
911
+ * @param {object} [options] - Additional error options
912
+ * @param {Error} [options.originalError] - Original error if wrapping
913
+ * @param {Record<string, any>} [options.context] - Additional context data
914
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
915
+ */
916
+ constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
917
+ super(message);
918
+ this.name = "DoNotDevError";
919
+ this.code = code;
920
+ this.originalError = options?.originalError;
921
+ this.context = options?.context;
922
+ this.displayable = options?.displayable !== false;
923
+ Object.setPrototypeOf(this, _DoNotDevError.prototype);
924
+ if (Error.captureStackTrace) {
925
+ Error.captureStackTrace(this, _DoNotDevError);
926
+ }
927
+ }
928
+ /**
929
+ * Formats the error for logging or display
930
+ *
931
+ * @returns {string} Formatted error message with code
932
+ */
933
+ format() {
934
+ return `[${this.code}] ${this.message}`;
935
+ }
936
+ /**
937
+ * Creates a wrapped error from another error
938
+ *
939
+ * @param {Error} error - Original error to wrap
940
+ * @param {string} [context] - Additional context for the error
941
+ * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
942
+ * @param {object} [options] - Additional error options
943
+ * @param {Record<string, any>} [options.context] - Additional context data
944
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
945
+ * @returns {DoNotDevError} New DoNotDev error wrapping the original
946
+ */
947
+ static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
948
+ if (!(error2 instanceof Error)) {
949
+ return new _DoNotDevError(
950
+ `Unknown error: ${String(error2)}`,
951
+ code,
952
+ options
953
+ );
954
+ }
955
+ if (error2 instanceof _DoNotDevError) {
956
+ if (!context) {
957
+ return error2;
958
+ }
959
+ return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
960
+ originalError: error2.originalError || error2,
961
+ context: { ...error2.context, ...options?.context || {} },
962
+ displayable: options?.displayable ?? error2.displayable
963
+ });
964
+ }
965
+ const message = context ? `${context}: ${error2.message}` : error2.message;
966
+ return new _DoNotDevError(message, code, {
967
+ originalError: error2,
968
+ context: options?.context,
969
+ displayable: options?.displayable
970
+ });
971
+ }
972
+ /**
973
+ * Maps common error types to DoNotDevErrorCode
974
+ *
975
+ * @param {Error} error - Error to analyze
976
+ * @returns {DoNotDevErrorCode} Mapped error code
977
+ */
978
+ static getErrorCodeFromError(error2) {
979
+ if (error2 instanceof _DoNotDevError) {
980
+ return error2.code;
981
+ }
982
+ const message = error2.message.toLowerCase();
983
+ if (error2.name === "ValidationError" || message.includes("validation")) {
984
+ return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
985
+ }
986
+ if (message.includes("not found") || message.includes("no such file")) {
987
+ return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
988
+ }
989
+ if (message.includes("permission") || message.includes("access denied")) {
990
+ return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
991
+ }
992
+ if (message.includes("timeout") || message.includes("timed out")) {
993
+ return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
994
+ }
995
+ if (message.includes("dependency") || message.includes("module not found")) {
996
+ return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
997
+ }
998
+ return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
999
+ }
1000
+ };
1001
+ }
1002
+ });
1003
+
862
1004
  // node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
863
1005
  var require_array = __commonJS({
864
1006
  "node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
@@ -7602,147 +7744,6 @@ var init_PathResolver = __esm({
7602
7744
  }
7603
7745
  });
7604
7746
 
7605
- // packages/tooling/src/utils/errors.ts
7606
- var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
7607
- var init_errors = __esm({
7608
- "packages/tooling/src/utils/errors.ts"() {
7609
- "use strict";
7610
- init_utils();
7611
- DO_NOT_DEV_ERROR_CODES = {
7612
- CONFIGURATION_ERROR: "configuration-error",
7613
- CONFIG_NOT_FOUND: "config-not-found",
7614
- CONFIG_INVALID: "config-invalid",
7615
- PATH_RESOLUTION_ERROR: "path-resolution-error",
7616
- FILE_OPERATION_ERROR: "file-operation-error",
7617
- FILE_NOT_FOUND: "file-not-found",
7618
- PERMISSION_DENIED: "permission-denied",
7619
- GENERATION_ERROR: "generation-error",
7620
- TEMPLATE_ERROR: "template-error",
7621
- TEMPLATE_NOT_FOUND: "template-not-found",
7622
- CLI_EXECUTION_ERROR: "cli-execution-error",
7623
- COMMAND_NOT_FOUND: "command-not-found",
7624
- COMMAND_FAILED: "command-failed",
7625
- VALIDATION_ERROR: "validation-error",
7626
- SCHEMA_ERROR: "schema-error",
7627
- DEPENDENCY_ERROR: "dependency-error",
7628
- DEPENDENCY_NOT_FOUND: "dependency-not-found",
7629
- DEPENDENCY_VERSION_ERROR: "dependency-version-error",
7630
- INVALID_ARGUMENT: "invalid-argument",
7631
- MISSING_ARGUMENT: "missing-argument",
7632
- MISSING_PROJECT_ID: "missing-project-id",
7633
- FIREBASE_CLI_ERROR: "firebase-cli-error",
7634
- DEPLOYMENT_FAILED: "deployment-failed",
7635
- OPERATION_CANCELLED: "operation-cancelled",
7636
- TIMEOUT_ERROR: "timeout-error",
7637
- UNKNOWN_ERROR: "unknown-error"
7638
- };
7639
- DoNotDevError = class _DoNotDevError extends Error {
7640
- /** The error code categorizing this error */
7641
- code;
7642
- /** Original error if this is wrapping another error */
7643
- originalError;
7644
- /** Additional context for the error */
7645
- context;
7646
- /** Whether this error should be displayed to the user */
7647
- displayable;
7648
- /**
7649
- * Creates a new DoNotDev error
7650
- *
7651
- * @param {string} message - Error message
7652
- * @param {DoNotDevErrorCode} code - Error code
7653
- * @param {object} [options] - Additional error options
7654
- * @param {Error} [options.originalError] - Original error if wrapping
7655
- * @param {Record<string, any>} [options.context] - Additional context data
7656
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7657
- */
7658
- constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7659
- super(message);
7660
- this.name = "DoNotDevError";
7661
- this.code = code;
7662
- this.originalError = options?.originalError;
7663
- this.context = options?.context;
7664
- this.displayable = options?.displayable !== false;
7665
- Object.setPrototypeOf(this, _DoNotDevError.prototype);
7666
- if (Error.captureStackTrace) {
7667
- Error.captureStackTrace(this, _DoNotDevError);
7668
- }
7669
- }
7670
- /**
7671
- * Formats the error for logging or display
7672
- *
7673
- * @returns {string} Formatted error message with code
7674
- */
7675
- format() {
7676
- return `[${this.code}] ${this.message}`;
7677
- }
7678
- /**
7679
- * Creates a wrapped error from another error
7680
- *
7681
- * @param {Error} error - Original error to wrap
7682
- * @param {string} [context] - Additional context for the error
7683
- * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
7684
- * @param {object} [options] - Additional error options
7685
- * @param {Record<string, any>} [options.context] - Additional context data
7686
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7687
- * @returns {DoNotDevError} New DoNotDev error wrapping the original
7688
- */
7689
- static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7690
- if (!(error2 instanceof Error)) {
7691
- return new _DoNotDevError(
7692
- `Unknown error: ${String(error2)}`,
7693
- code,
7694
- options
7695
- );
7696
- }
7697
- if (error2 instanceof _DoNotDevError) {
7698
- if (!context) {
7699
- return error2;
7700
- }
7701
- return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
7702
- originalError: error2.originalError || error2,
7703
- context: { ...error2.context, ...options?.context || {} },
7704
- displayable: options?.displayable ?? error2.displayable
7705
- });
7706
- }
7707
- const message = context ? `${context}: ${error2.message}` : error2.message;
7708
- return new _DoNotDevError(message, code, {
7709
- originalError: error2,
7710
- context: options?.context,
7711
- displayable: options?.displayable
7712
- });
7713
- }
7714
- /**
7715
- * Maps common error types to DoNotDevErrorCode
7716
- *
7717
- * @param {Error} error - Error to analyze
7718
- * @returns {DoNotDevErrorCode} Mapped error code
7719
- */
7720
- static getErrorCodeFromError(error2) {
7721
- if (error2 instanceof _DoNotDevError) {
7722
- return error2.code;
7723
- }
7724
- const message = error2.message.toLowerCase();
7725
- if (error2.name === "ValidationError" || message.includes("validation")) {
7726
- return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
7727
- }
7728
- if (message.includes("not found") || message.includes("no such file")) {
7729
- return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
7730
- }
7731
- if (message.includes("permission") || message.includes("access denied")) {
7732
- return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
7733
- }
7734
- if (message.includes("timeout") || message.includes("timed out")) {
7735
- return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
7736
- }
7737
- if (message.includes("dependency") || message.includes("module not found")) {
7738
- return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
7739
- }
7740
- return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
7741
- }
7742
- };
7743
- }
7744
- });
7745
-
7746
7747
  // packages/tooling/src/utils/pathResolver.ts
7747
7748
  import { createRequire as createRequire2 } from "node:module";
7748
7749
  import {
@@ -7820,14 +7821,14 @@ var init_typed_file_operations = __esm({
7820
7821
  "packages/tooling/src/utils/typed-file-operations.ts"() {
7821
7822
  "use strict";
7822
7823
  init_utils();
7823
- init_pathResolver();
7824
7824
  init_errors();
7825
+ init_pathResolver();
7825
7826
  }
7826
7827
  });
7827
7828
 
7828
7829
  // packages/tooling/src/bundler/utils.ts
7829
7830
  import { Buffer } from "node:buffer";
7830
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7831
+ import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7831
7832
  import { createRequire as createRequire3 } from "node:module";
7832
7833
  import { dirname as dirname3, resolve as resolve3 } from "node:path";
7833
7834
  import process from "node:process";
@@ -838,6 +838,148 @@ var init_cli_output = __esm({
838
838
  }
839
839
  });
840
840
 
841
+ // packages/tooling/src/utils/errors.ts
842
+ var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
843
+ var init_errors = __esm({
844
+ "packages/tooling/src/utils/errors.ts"() {
845
+ "use strict";
846
+ init_utils();
847
+ DO_NOT_DEV_ERROR_CODES = {
848
+ CONFIGURATION_ERROR: "configuration-error",
849
+ CONFIG_NOT_FOUND: "config-not-found",
850
+ CONFIG_INVALID: "config-invalid",
851
+ PATH_RESOLUTION_ERROR: "path-resolution-error",
852
+ FILE_OPERATION_ERROR: "file-operation-error",
853
+ FILE_NOT_FOUND: "file-not-found",
854
+ PERMISSION_DENIED: "permission-denied",
855
+ GENERATION_ERROR: "generation-error",
856
+ TEMPLATE_ERROR: "template-error",
857
+ TEMPLATE_NOT_FOUND: "template-not-found",
858
+ CLI_EXECUTION_ERROR: "cli-execution-error",
859
+ COMMAND_NOT_FOUND: "command-not-found",
860
+ COMMAND_FAILED: "command-failed",
861
+ VALIDATION_ERROR: "validation-error",
862
+ SCHEMA_ERROR: "schema-error",
863
+ DEPENDENCY_ERROR: "dependency-error",
864
+ DEPENDENCY_NOT_FOUND: "dependency-not-found",
865
+ DEPENDENCY_VERSION_ERROR: "dependency-version-error",
866
+ INVALID_ARGUMENT: "invalid-argument",
867
+ MISSING_ARGUMENT: "missing-argument",
868
+ MISSING_PROJECT_ID: "missing-project-id",
869
+ FIREBASE_CLI_ERROR: "firebase-cli-error",
870
+ DEPLOYMENT_FAILED: "deployment-failed",
871
+ VERCEL_API_ERROR: "vercel-api-error",
872
+ OPERATION_CANCELLED: "operation-cancelled",
873
+ TIMEOUT_ERROR: "timeout-error",
874
+ UNKNOWN_ERROR: "unknown-error"
875
+ };
876
+ DoNotDevError = class _DoNotDevError extends Error {
877
+ /** The error code categorizing this error */
878
+ code;
879
+ /** Original error if this is wrapping another error */
880
+ originalError;
881
+ /** Additional context for the error */
882
+ context;
883
+ /** Whether this error should be displayed to the user */
884
+ displayable;
885
+ /**
886
+ * Creates a new DoNotDev error
887
+ *
888
+ * @param {string} message - Error message
889
+ * @param {DoNotDevErrorCode} code - Error code
890
+ * @param {object} [options] - Additional error options
891
+ * @param {Error} [options.originalError] - Original error if wrapping
892
+ * @param {Record<string, any>} [options.context] - Additional context data
893
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
894
+ */
895
+ constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
896
+ super(message);
897
+ this.name = "DoNotDevError";
898
+ this.code = code;
899
+ this.originalError = options?.originalError;
900
+ this.context = options?.context;
901
+ this.displayable = options?.displayable !== false;
902
+ Object.setPrototypeOf(this, _DoNotDevError.prototype);
903
+ if (Error.captureStackTrace) {
904
+ Error.captureStackTrace(this, _DoNotDevError);
905
+ }
906
+ }
907
+ /**
908
+ * Formats the error for logging or display
909
+ *
910
+ * @returns {string} Formatted error message with code
911
+ */
912
+ format() {
913
+ return `[${this.code}] ${this.message}`;
914
+ }
915
+ /**
916
+ * Creates a wrapped error from another error
917
+ *
918
+ * @param {Error} error - Original error to wrap
919
+ * @param {string} [context] - Additional context for the error
920
+ * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
921
+ * @param {object} [options] - Additional error options
922
+ * @param {Record<string, any>} [options.context] - Additional context data
923
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
924
+ * @returns {DoNotDevError} New DoNotDev error wrapping the original
925
+ */
926
+ static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
927
+ if (!(error2 instanceof Error)) {
928
+ return new _DoNotDevError(
929
+ `Unknown error: ${String(error2)}`,
930
+ code,
931
+ options
932
+ );
933
+ }
934
+ if (error2 instanceof _DoNotDevError) {
935
+ if (!context) {
936
+ return error2;
937
+ }
938
+ return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
939
+ originalError: error2.originalError || error2,
940
+ context: { ...error2.context, ...options?.context || {} },
941
+ displayable: options?.displayable ?? error2.displayable
942
+ });
943
+ }
944
+ const message = context ? `${context}: ${error2.message}` : error2.message;
945
+ return new _DoNotDevError(message, code, {
946
+ originalError: error2,
947
+ context: options?.context,
948
+ displayable: options?.displayable
949
+ });
950
+ }
951
+ /**
952
+ * Maps common error types to DoNotDevErrorCode
953
+ *
954
+ * @param {Error} error - Error to analyze
955
+ * @returns {DoNotDevErrorCode} Mapped error code
956
+ */
957
+ static getErrorCodeFromError(error2) {
958
+ if (error2 instanceof _DoNotDevError) {
959
+ return error2.code;
960
+ }
961
+ const message = error2.message.toLowerCase();
962
+ if (error2.name === "ValidationError" || message.includes("validation")) {
963
+ return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
964
+ }
965
+ if (message.includes("not found") || message.includes("no such file")) {
966
+ return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
967
+ }
968
+ if (message.includes("permission") || message.includes("access denied")) {
969
+ return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
970
+ }
971
+ if (message.includes("timeout") || message.includes("timed out")) {
972
+ return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
973
+ }
974
+ if (message.includes("dependency") || message.includes("module not found")) {
975
+ return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
976
+ }
977
+ return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
978
+ }
979
+ };
980
+ }
981
+ });
982
+
841
983
  // node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
842
984
  var require_array = __commonJS({
843
985
  "node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
@@ -7581,147 +7723,6 @@ var init_PathResolver = __esm({
7581
7723
  }
7582
7724
  });
7583
7725
 
7584
- // packages/tooling/src/utils/errors.ts
7585
- var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
7586
- var init_errors = __esm({
7587
- "packages/tooling/src/utils/errors.ts"() {
7588
- "use strict";
7589
- init_utils();
7590
- DO_NOT_DEV_ERROR_CODES = {
7591
- CONFIGURATION_ERROR: "configuration-error",
7592
- CONFIG_NOT_FOUND: "config-not-found",
7593
- CONFIG_INVALID: "config-invalid",
7594
- PATH_RESOLUTION_ERROR: "path-resolution-error",
7595
- FILE_OPERATION_ERROR: "file-operation-error",
7596
- FILE_NOT_FOUND: "file-not-found",
7597
- PERMISSION_DENIED: "permission-denied",
7598
- GENERATION_ERROR: "generation-error",
7599
- TEMPLATE_ERROR: "template-error",
7600
- TEMPLATE_NOT_FOUND: "template-not-found",
7601
- CLI_EXECUTION_ERROR: "cli-execution-error",
7602
- COMMAND_NOT_FOUND: "command-not-found",
7603
- COMMAND_FAILED: "command-failed",
7604
- VALIDATION_ERROR: "validation-error",
7605
- SCHEMA_ERROR: "schema-error",
7606
- DEPENDENCY_ERROR: "dependency-error",
7607
- DEPENDENCY_NOT_FOUND: "dependency-not-found",
7608
- DEPENDENCY_VERSION_ERROR: "dependency-version-error",
7609
- INVALID_ARGUMENT: "invalid-argument",
7610
- MISSING_ARGUMENT: "missing-argument",
7611
- MISSING_PROJECT_ID: "missing-project-id",
7612
- FIREBASE_CLI_ERROR: "firebase-cli-error",
7613
- DEPLOYMENT_FAILED: "deployment-failed",
7614
- OPERATION_CANCELLED: "operation-cancelled",
7615
- TIMEOUT_ERROR: "timeout-error",
7616
- UNKNOWN_ERROR: "unknown-error"
7617
- };
7618
- DoNotDevError = class _DoNotDevError extends Error {
7619
- /** The error code categorizing this error */
7620
- code;
7621
- /** Original error if this is wrapping another error */
7622
- originalError;
7623
- /** Additional context for the error */
7624
- context;
7625
- /** Whether this error should be displayed to the user */
7626
- displayable;
7627
- /**
7628
- * Creates a new DoNotDev error
7629
- *
7630
- * @param {string} message - Error message
7631
- * @param {DoNotDevErrorCode} code - Error code
7632
- * @param {object} [options] - Additional error options
7633
- * @param {Error} [options.originalError] - Original error if wrapping
7634
- * @param {Record<string, any>} [options.context] - Additional context data
7635
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7636
- */
7637
- constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7638
- super(message);
7639
- this.name = "DoNotDevError";
7640
- this.code = code;
7641
- this.originalError = options?.originalError;
7642
- this.context = options?.context;
7643
- this.displayable = options?.displayable !== false;
7644
- Object.setPrototypeOf(this, _DoNotDevError.prototype);
7645
- if (Error.captureStackTrace) {
7646
- Error.captureStackTrace(this, _DoNotDevError);
7647
- }
7648
- }
7649
- /**
7650
- * Formats the error for logging or display
7651
- *
7652
- * @returns {string} Formatted error message with code
7653
- */
7654
- format() {
7655
- return `[${this.code}] ${this.message}`;
7656
- }
7657
- /**
7658
- * Creates a wrapped error from another error
7659
- *
7660
- * @param {Error} error - Original error to wrap
7661
- * @param {string} [context] - Additional context for the error
7662
- * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
7663
- * @param {object} [options] - Additional error options
7664
- * @param {Record<string, any>} [options.context] - Additional context data
7665
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7666
- * @returns {DoNotDevError} New DoNotDev error wrapping the original
7667
- */
7668
- static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7669
- if (!(error2 instanceof Error)) {
7670
- return new _DoNotDevError(
7671
- `Unknown error: ${String(error2)}`,
7672
- code,
7673
- options
7674
- );
7675
- }
7676
- if (error2 instanceof _DoNotDevError) {
7677
- if (!context) {
7678
- return error2;
7679
- }
7680
- return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
7681
- originalError: error2.originalError || error2,
7682
- context: { ...error2.context, ...options?.context || {} },
7683
- displayable: options?.displayable ?? error2.displayable
7684
- });
7685
- }
7686
- const message = context ? `${context}: ${error2.message}` : error2.message;
7687
- return new _DoNotDevError(message, code, {
7688
- originalError: error2,
7689
- context: options?.context,
7690
- displayable: options?.displayable
7691
- });
7692
- }
7693
- /**
7694
- * Maps common error types to DoNotDevErrorCode
7695
- *
7696
- * @param {Error} error - Error to analyze
7697
- * @returns {DoNotDevErrorCode} Mapped error code
7698
- */
7699
- static getErrorCodeFromError(error2) {
7700
- if (error2 instanceof _DoNotDevError) {
7701
- return error2.code;
7702
- }
7703
- const message = error2.message.toLowerCase();
7704
- if (error2.name === "ValidationError" || message.includes("validation")) {
7705
- return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
7706
- }
7707
- if (message.includes("not found") || message.includes("no such file")) {
7708
- return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
7709
- }
7710
- if (message.includes("permission") || message.includes("access denied")) {
7711
- return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
7712
- }
7713
- if (message.includes("timeout") || message.includes("timed out")) {
7714
- return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
7715
- }
7716
- if (message.includes("dependency") || message.includes("module not found")) {
7717
- return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
7718
- }
7719
- return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
7720
- }
7721
- };
7722
- }
7723
- });
7724
-
7725
7726
  // packages/tooling/src/utils/pathResolver.ts
7726
7727
  import { createRequire as createRequire2 } from "node:module";
7727
7728
  import {
@@ -7906,7 +7907,7 @@ var init_pathResolver = __esm({
7906
7907
 
7907
7908
  // packages/tooling/src/bundler/utils.ts
7908
7909
  import { Buffer } from "node:buffer";
7909
- import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7910
+ import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7910
7911
  import { createRequire as createRequire3 } from "node:module";
7911
7912
  import { dirname as dirname3, resolve as resolve3 } from "node:path";
7912
7913
  import process from "node:process";
@@ -8310,9 +8311,6 @@ function generatePackageJson(templateName, mode, options = {}) {
8310
8311
 
8311
8312
  // packages/tooling/src/maintenance/bump.ts
8312
8313
  init_utils();
8313
- init_cli_input();
8314
- init_cli_output();
8315
- init_pathResolver();
8316
8314
 
8317
8315
  // packages/tooling/src/maintenance/sync-apps.ts
8318
8316
  init_utils();
@@ -8717,6 +8715,9 @@ async function syncDocumentation(options = {}) {
8717
8715
  }
8718
8716
 
8719
8717
  // packages/tooling/src/maintenance/bump.ts
8718
+ init_cli_input();
8719
+ init_cli_output();
8720
+ init_pathResolver();
8720
8721
  async function queryNpmLatest(packageName) {
8721
8722
  try {
8722
8723
  const res = await fetch(`https://registry.npmjs.org/${packageName}/latest`);