@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.
@@ -8607,6 +8607,28 @@ async function runQuestionnaire(questions, initialAnswers, showWIP, askFor) {
8607
8607
 
8608
8608
  // packages/tooling/src/scaffolding/create-app.ts
8609
8609
  init_utils();
8610
+
8611
+ // packages/tooling/src/scaffolding/scaffold-matrix.ts
8612
+ init_utils();
8613
+ function resolveDeployConfig(host, backend) {
8614
+ if (host === "none") return null;
8615
+ if (host === "firebase") return "firebase";
8616
+ if (backend === "supabase") return "vercel-supabase";
8617
+ return "vercel-vercel";
8618
+ }
8619
+ function getScaffoldParts(builder, host, functions, backend) {
8620
+ const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
8621
+ return {
8622
+ builder,
8623
+ backend,
8624
+ baseTemplate,
8625
+ overlay: backend !== "none" ? `overlay-${backend}` : null,
8626
+ deployConfig: resolveDeployConfig(host, backend),
8627
+ functionsTemplate: functions !== "none" ? `functions-${functions}` : null
8628
+ };
8629
+ }
8630
+
8631
+ // packages/tooling/src/scaffolding/create-app.ts
8610
8632
  init_cli_input();
8611
8633
  init_cli_output();
8612
8634
 
@@ -8791,28 +8813,6 @@ function generatePackageJson(templateName, mode, options = {}) {
8791
8813
  // packages/tooling/src/scaffolding/create-app.ts
8792
8814
  init_pathResolver();
8793
8815
  init_pathResolver();
8794
-
8795
- // packages/tooling/src/scaffolding/scaffold-matrix.ts
8796
- init_utils();
8797
- function resolveDeployConfig(host, backend) {
8798
- if (host === "none") return null;
8799
- if (host === "firebase") return "firebase";
8800
- if (backend === "supabase") return "vercel-supabase";
8801
- return "vercel-vercel";
8802
- }
8803
- function getScaffoldParts(builder, host, functions, backend) {
8804
- const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
8805
- return {
8806
- builder,
8807
- backend,
8808
- baseTemplate,
8809
- overlay: backend !== "none" ? `overlay-${backend}` : null,
8810
- deployConfig: resolveDeployConfig(host, backend),
8811
- functionsTemplate: functions !== "none" ? `functions-${functions}` : null
8812
- };
8813
- }
8814
-
8815
- // packages/tooling/src/scaffolding/create-app.ts
8816
8816
  var SHOW_WIP = process.env.SHOW_WIP === "true" || process.argv.includes("--wip");
8817
8817
  async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
8818
8818
  const isInteractive = !appName || !appConfig;
@@ -1014,6 +1014,148 @@ var init_cli_output = __esm({
1014
1014
  }
1015
1015
  });
1016
1016
 
1017
+ // packages/tooling/src/utils/errors.ts
1018
+ var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
1019
+ var init_errors = __esm({
1020
+ "packages/tooling/src/utils/errors.ts"() {
1021
+ "use strict";
1022
+ init_utils();
1023
+ DO_NOT_DEV_ERROR_CODES = {
1024
+ CONFIGURATION_ERROR: "configuration-error",
1025
+ CONFIG_NOT_FOUND: "config-not-found",
1026
+ CONFIG_INVALID: "config-invalid",
1027
+ PATH_RESOLUTION_ERROR: "path-resolution-error",
1028
+ FILE_OPERATION_ERROR: "file-operation-error",
1029
+ FILE_NOT_FOUND: "file-not-found",
1030
+ PERMISSION_DENIED: "permission-denied",
1031
+ GENERATION_ERROR: "generation-error",
1032
+ TEMPLATE_ERROR: "template-error",
1033
+ TEMPLATE_NOT_FOUND: "template-not-found",
1034
+ CLI_EXECUTION_ERROR: "cli-execution-error",
1035
+ COMMAND_NOT_FOUND: "command-not-found",
1036
+ COMMAND_FAILED: "command-failed",
1037
+ VALIDATION_ERROR: "validation-error",
1038
+ SCHEMA_ERROR: "schema-error",
1039
+ DEPENDENCY_ERROR: "dependency-error",
1040
+ DEPENDENCY_NOT_FOUND: "dependency-not-found",
1041
+ DEPENDENCY_VERSION_ERROR: "dependency-version-error",
1042
+ INVALID_ARGUMENT: "invalid-argument",
1043
+ MISSING_ARGUMENT: "missing-argument",
1044
+ MISSING_PROJECT_ID: "missing-project-id",
1045
+ FIREBASE_CLI_ERROR: "firebase-cli-error",
1046
+ DEPLOYMENT_FAILED: "deployment-failed",
1047
+ VERCEL_API_ERROR: "vercel-api-error",
1048
+ OPERATION_CANCELLED: "operation-cancelled",
1049
+ TIMEOUT_ERROR: "timeout-error",
1050
+ UNKNOWN_ERROR: "unknown-error"
1051
+ };
1052
+ DoNotDevError = class _DoNotDevError extends Error {
1053
+ /** The error code categorizing this error */
1054
+ code;
1055
+ /** Original error if this is wrapping another error */
1056
+ originalError;
1057
+ /** Additional context for the error */
1058
+ context;
1059
+ /** Whether this error should be displayed to the user */
1060
+ displayable;
1061
+ /**
1062
+ * Creates a new DoNotDev error
1063
+ *
1064
+ * @param {string} message - Error message
1065
+ * @param {DoNotDevErrorCode} code - Error code
1066
+ * @param {object} [options] - Additional error options
1067
+ * @param {Error} [options.originalError] - Original error if wrapping
1068
+ * @param {Record<string, any>} [options.context] - Additional context data
1069
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1070
+ */
1071
+ constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
1072
+ super(message);
1073
+ this.name = "DoNotDevError";
1074
+ this.code = code;
1075
+ this.originalError = options?.originalError;
1076
+ this.context = options?.context;
1077
+ this.displayable = options?.displayable !== false;
1078
+ Object.setPrototypeOf(this, _DoNotDevError.prototype);
1079
+ if (Error.captureStackTrace) {
1080
+ Error.captureStackTrace(this, _DoNotDevError);
1081
+ }
1082
+ }
1083
+ /**
1084
+ * Formats the error for logging or display
1085
+ *
1086
+ * @returns {string} Formatted error message with code
1087
+ */
1088
+ format() {
1089
+ return `[${this.code}] ${this.message}`;
1090
+ }
1091
+ /**
1092
+ * Creates a wrapped error from another error
1093
+ *
1094
+ * @param {Error} error - Original error to wrap
1095
+ * @param {string} [context] - Additional context for the error
1096
+ * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
1097
+ * @param {object} [options] - Additional error options
1098
+ * @param {Record<string, any>} [options.context] - Additional context data
1099
+ * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1100
+ * @returns {DoNotDevError} New DoNotDev error wrapping the original
1101
+ */
1102
+ static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
1103
+ if (!(error2 instanceof Error)) {
1104
+ return new _DoNotDevError(
1105
+ `Unknown error: ${String(error2)}`,
1106
+ code,
1107
+ options
1108
+ );
1109
+ }
1110
+ if (error2 instanceof _DoNotDevError) {
1111
+ if (!context) {
1112
+ return error2;
1113
+ }
1114
+ return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
1115
+ originalError: error2.originalError || error2,
1116
+ context: { ...error2.context, ...options?.context || {} },
1117
+ displayable: options?.displayable ?? error2.displayable
1118
+ });
1119
+ }
1120
+ const message = context ? `${context}: ${error2.message}` : error2.message;
1121
+ return new _DoNotDevError(message, code, {
1122
+ originalError: error2,
1123
+ context: options?.context,
1124
+ displayable: options?.displayable
1125
+ });
1126
+ }
1127
+ /**
1128
+ * Maps common error types to DoNotDevErrorCode
1129
+ *
1130
+ * @param {Error} error - Error to analyze
1131
+ * @returns {DoNotDevErrorCode} Mapped error code
1132
+ */
1133
+ static getErrorCodeFromError(error2) {
1134
+ if (error2 instanceof _DoNotDevError) {
1135
+ return error2.code;
1136
+ }
1137
+ const message = error2.message.toLowerCase();
1138
+ if (error2.name === "ValidationError" || message.includes("validation")) {
1139
+ return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
1140
+ }
1141
+ if (message.includes("not found") || message.includes("no such file")) {
1142
+ return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
1143
+ }
1144
+ if (message.includes("permission") || message.includes("access denied")) {
1145
+ return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
1146
+ }
1147
+ if (message.includes("timeout") || message.includes("timed out")) {
1148
+ return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
1149
+ }
1150
+ if (message.includes("dependency") || message.includes("module not found")) {
1151
+ return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
1152
+ }
1153
+ return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
1154
+ }
1155
+ };
1156
+ }
1157
+ });
1158
+
1017
1159
  // node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
1018
1160
  var require_array = __commonJS({
1019
1161
  "node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
@@ -7757,147 +7899,6 @@ var init_PathResolver = __esm({
7757
7899
  }
7758
7900
  });
7759
7901
 
7760
- // packages/tooling/src/utils/errors.ts
7761
- var DO_NOT_DEV_ERROR_CODES, DoNotDevError;
7762
- var init_errors = __esm({
7763
- "packages/tooling/src/utils/errors.ts"() {
7764
- "use strict";
7765
- init_utils();
7766
- DO_NOT_DEV_ERROR_CODES = {
7767
- CONFIGURATION_ERROR: "configuration-error",
7768
- CONFIG_NOT_FOUND: "config-not-found",
7769
- CONFIG_INVALID: "config-invalid",
7770
- PATH_RESOLUTION_ERROR: "path-resolution-error",
7771
- FILE_OPERATION_ERROR: "file-operation-error",
7772
- FILE_NOT_FOUND: "file-not-found",
7773
- PERMISSION_DENIED: "permission-denied",
7774
- GENERATION_ERROR: "generation-error",
7775
- TEMPLATE_ERROR: "template-error",
7776
- TEMPLATE_NOT_FOUND: "template-not-found",
7777
- CLI_EXECUTION_ERROR: "cli-execution-error",
7778
- COMMAND_NOT_FOUND: "command-not-found",
7779
- COMMAND_FAILED: "command-failed",
7780
- VALIDATION_ERROR: "validation-error",
7781
- SCHEMA_ERROR: "schema-error",
7782
- DEPENDENCY_ERROR: "dependency-error",
7783
- DEPENDENCY_NOT_FOUND: "dependency-not-found",
7784
- DEPENDENCY_VERSION_ERROR: "dependency-version-error",
7785
- INVALID_ARGUMENT: "invalid-argument",
7786
- MISSING_ARGUMENT: "missing-argument",
7787
- MISSING_PROJECT_ID: "missing-project-id",
7788
- FIREBASE_CLI_ERROR: "firebase-cli-error",
7789
- DEPLOYMENT_FAILED: "deployment-failed",
7790
- OPERATION_CANCELLED: "operation-cancelled",
7791
- TIMEOUT_ERROR: "timeout-error",
7792
- UNKNOWN_ERROR: "unknown-error"
7793
- };
7794
- DoNotDevError = class _DoNotDevError extends Error {
7795
- /** The error code categorizing this error */
7796
- code;
7797
- /** Original error if this is wrapping another error */
7798
- originalError;
7799
- /** Additional context for the error */
7800
- context;
7801
- /** Whether this error should be displayed to the user */
7802
- displayable;
7803
- /**
7804
- * Creates a new DoNotDev error
7805
- *
7806
- * @param {string} message - Error message
7807
- * @param {DoNotDevErrorCode} code - Error code
7808
- * @param {object} [options] - Additional error options
7809
- * @param {Error} [options.originalError] - Original error if wrapping
7810
- * @param {Record<string, any>} [options.context] - Additional context data
7811
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7812
- */
7813
- constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7814
- super(message);
7815
- this.name = "DoNotDevError";
7816
- this.code = code;
7817
- this.originalError = options?.originalError;
7818
- this.context = options?.context;
7819
- this.displayable = options?.displayable !== false;
7820
- Object.setPrototypeOf(this, _DoNotDevError.prototype);
7821
- if (Error.captureStackTrace) {
7822
- Error.captureStackTrace(this, _DoNotDevError);
7823
- }
7824
- }
7825
- /**
7826
- * Formats the error for logging or display
7827
- *
7828
- * @returns {string} Formatted error message with code
7829
- */
7830
- format() {
7831
- return `[${this.code}] ${this.message}`;
7832
- }
7833
- /**
7834
- * Creates a wrapped error from another error
7835
- *
7836
- * @param {Error} error - Original error to wrap
7837
- * @param {string} [context] - Additional context for the error
7838
- * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
7839
- * @param {object} [options] - Additional error options
7840
- * @param {Record<string, any>} [options.context] - Additional context data
7841
- * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
7842
- * @returns {DoNotDevError} New DoNotDev error wrapping the original
7843
- */
7844
- static from(error2, context, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
7845
- if (!(error2 instanceof Error)) {
7846
- return new _DoNotDevError(
7847
- `Unknown error: ${String(error2)}`,
7848
- code,
7849
- options
7850
- );
7851
- }
7852
- if (error2 instanceof _DoNotDevError) {
7853
- if (!context) {
7854
- return error2;
7855
- }
7856
- return new _DoNotDevError(`${context}: ${error2.message}`, error2.code, {
7857
- originalError: error2.originalError || error2,
7858
- context: { ...error2.context, ...options?.context || {} },
7859
- displayable: options?.displayable ?? error2.displayable
7860
- });
7861
- }
7862
- const message = context ? `${context}: ${error2.message}` : error2.message;
7863
- return new _DoNotDevError(message, code, {
7864
- originalError: error2,
7865
- context: options?.context,
7866
- displayable: options?.displayable
7867
- });
7868
- }
7869
- /**
7870
- * Maps common error types to DoNotDevErrorCode
7871
- *
7872
- * @param {Error} error - Error to analyze
7873
- * @returns {DoNotDevErrorCode} Mapped error code
7874
- */
7875
- static getErrorCodeFromError(error2) {
7876
- if (error2 instanceof _DoNotDevError) {
7877
- return error2.code;
7878
- }
7879
- const message = error2.message.toLowerCase();
7880
- if (error2.name === "ValidationError" || message.includes("validation")) {
7881
- return DO_NOT_DEV_ERROR_CODES.VALIDATION_ERROR;
7882
- }
7883
- if (message.includes("not found") || message.includes("no such file")) {
7884
- return DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND;
7885
- }
7886
- if (message.includes("permission") || message.includes("access denied")) {
7887
- return DO_NOT_DEV_ERROR_CODES.PERMISSION_DENIED;
7888
- }
7889
- if (message.includes("timeout") || message.includes("timed out")) {
7890
- return DO_NOT_DEV_ERROR_CODES.TIMEOUT_ERROR;
7891
- }
7892
- if (message.includes("dependency") || message.includes("module not found")) {
7893
- return DO_NOT_DEV_ERROR_CODES.DEPENDENCY_ERROR;
7894
- }
7895
- return DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR;
7896
- }
7897
- };
7898
- }
7899
- });
7900
-
7901
7902
  // packages/tooling/src/utils/pathResolver.ts
7902
7903
  var pathResolver_exports = {};
7903
7904
  __export(pathResolver_exports, {
@@ -8327,8 +8328,8 @@ var init_typed_file_operations = __esm({
8327
8328
  "packages/tooling/src/utils/typed-file-operations.ts"() {
8328
8329
  "use strict";
8329
8330
  init_utils();
8330
- init_pathResolver();
8331
8331
  init_errors();
8332
+ init_pathResolver();
8332
8333
  }
8333
8334
  });
8334
8335
 
@@ -8927,6 +8928,28 @@ async function runQuestionnaire(questions, initialAnswers, showWIP, askFor) {
8927
8928
 
8928
8929
  // packages/tooling/src/scaffolding/create-app.ts
8929
8930
  init_utils();
8931
+
8932
+ // packages/tooling/src/scaffolding/scaffold-matrix.ts
8933
+ init_utils();
8934
+ function resolveDeployConfig(host, backend) {
8935
+ if (host === "none") return null;
8936
+ if (host === "firebase") return "firebase";
8937
+ if (backend === "supabase") return "vercel-supabase";
8938
+ return "vercel-vercel";
8939
+ }
8940
+ function getScaffoldParts(builder, host, functions, backend) {
8941
+ const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
8942
+ return {
8943
+ builder,
8944
+ backend,
8945
+ baseTemplate,
8946
+ overlay: backend !== "none" ? `overlay-${backend}` : null,
8947
+ deployConfig: resolveDeployConfig(host, backend),
8948
+ functionsTemplate: functions !== "none" ? `functions-${functions}` : null
8949
+ };
8950
+ }
8951
+
8952
+ // packages/tooling/src/scaffolding/create-app.ts
8930
8953
  init_cli_input();
8931
8954
  init_cli_output();
8932
8955
 
@@ -9111,28 +9134,6 @@ function generatePackageJson(templateName, mode, options = {}) {
9111
9134
  // packages/tooling/src/scaffolding/create-app.ts
9112
9135
  init_pathResolver();
9113
9136
  init_pathResolver();
9114
-
9115
- // packages/tooling/src/scaffolding/scaffold-matrix.ts
9116
- init_utils();
9117
- function resolveDeployConfig(host, backend) {
9118
- if (host === "none") return null;
9119
- if (host === "firebase") return "firebase";
9120
- if (backend === "supabase") return "vercel-supabase";
9121
- return "vercel-vercel";
9122
- }
9123
- function getScaffoldParts(builder, host, functions, backend) {
9124
- const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
9125
- return {
9126
- builder,
9127
- backend,
9128
- baseTemplate,
9129
- overlay: backend !== "none" ? `overlay-${backend}` : null,
9130
- deployConfig: resolveDeployConfig(host, backend),
9131
- functionsTemplate: functions !== "none" ? `functions-${functions}` : null
9132
- };
9133
- }
9134
-
9135
- // packages/tooling/src/scaffolding/create-app.ts
9136
9137
  var SHOW_WIP = process.env.SHOW_WIP === "true" || process.argv.includes("--wip");
9137
9138
  async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9138
9139
  const isInteractive = !appName || !appConfig;