@wix/ditto-codegen-public 1.0.417 → 1.0.418

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 (2) hide show
  1. package/dist/out.js +23 -7
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -15065,6 +15065,7 @@ var require_environments = __commonJS({
15065
15065
  "dist/environments/index.js"(exports2) {
15066
15066
  "use strict";
15067
15067
  Object.defineProperty(exports2, "__esModule", { value: true });
15068
+ exports2.getValidatedCodegenEnvironment = getValidatedCodegenEnvironment;
15068
15069
  exports2.getCodegenEnvironmentConfig = getCodegenEnvironmentConfig;
15069
15070
  var types_1 = require_types_impl();
15070
15071
  var codegen_app_builder_config_1 = require_dist5();
@@ -15095,14 +15096,27 @@ var require_environments = __commonJS({
15095
15096
  gitConflictsRules: [SHARED_GIT_CONFLICTS_RULE, ...env.gitConflictsRules]
15096
15097
  };
15097
15098
  };
15099
+ var SUPPORTED_ENVIRONMENTS = [
15100
+ types_1.Environment.APP_BUILDER,
15101
+ types_1.Environment.STUDIO_2,
15102
+ types_1.Environment.HARMONY
15103
+ ];
15104
+ function getValidatedCodegenEnvironment() {
15105
+ const environment = process.env.CODEGEN_ENVIRONMENT;
15106
+ const supported = SUPPORTED_ENVIRONMENTS.find((e) => e === environment);
15107
+ if (!supported) {
15108
+ throw new Error(`Unsupported CODEGEN_ENVIRONMENT: ${environment ?? "(missing)"}. Valid values: ${SUPPORTED_ENVIRONMENTS.join(", ")}`);
15109
+ }
15110
+ return supported;
15111
+ }
15098
15112
  function getCodegenEnvironmentConfig() {
15099
- switch (process.env.CODEGEN_ENVIRONMENT) {
15113
+ const environment = getValidatedCodegenEnvironment();
15114
+ switch (environment) {
15100
15115
  case types_1.Environment.STUDIO_2:
15101
15116
  return withSharedRules(codegen_studio_2_config_1.studio2CodegenConfig);
15102
15117
  case types_1.Environment.HARMONY:
15103
15118
  return withSharedRules(codegen_harmony_config_1.harmonyCodegenConfig);
15104
15119
  case types_1.Environment.APP_BUILDER:
15105
- default:
15106
15120
  return withSharedRules({
15107
15121
  ...codegen_app_builder_config_1.appBuilderCodegenConfig,
15108
15122
  decisionCheckers: [
@@ -15157,13 +15171,12 @@ var require_config = __commonJS({
15157
15171
  ".astro/**"
15158
15172
  ];
15159
15173
  function getProviderConfig() {
15160
- const environment = process.env.CODEGEN_ENVIRONMENT;
15174
+ const environment = (0, environments_12.getValidatedCodegenEnvironment)();
15161
15175
  const chargingMode = (0, environments_12.getCodegenEnvironmentConfig)().chargingMode ?? "app";
15162
15176
  const headers = {
15163
15177
  // Tell the proxy which environment this request belongs to so it can
15164
- // select the matching upstream API key. Forwarded verbatim — the proxy
15165
- // owns validation and the default.
15166
- ...environment ? { [ditto_codegen_types_12.CODEGEN_ENVIRONMENT_HEADER]: environment } : {},
15178
+ // select the matching upstream API key.
15179
+ [ditto_codegen_types_12.CODEGEN_ENVIRONMENT_HEADER]: environment,
15167
15180
  // How the request is billed; the proxy resolves auth accordingly.
15168
15181
  [ditto_codegen_types_12.CODEGEN_CHARGING_MODE_HEADER]: chargingMode,
15169
15182
  // The user's Wix token — needed to resolve the account (credits mode) and
@@ -23392,7 +23405,10 @@ async function processJob(job) {
23392
23405
  });
23393
23406
  }
23394
23407
  (0, context_1.initCtx)().then((ctx) => {
23395
- main(ctx);
23408
+ main(ctx).catch((error) => {
23409
+ logger_1.logger.error("[Startup] CodeGen CLI failed", { error: String(error) });
23410
+ process.exit(1);
23411
+ });
23396
23412
  });
23397
23413
  /*! Bundled license information:
23398
23414
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.417",
3
+ "version": "1.0.418",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "c636d47542dc1c6a6ad09d6c3e6e36bfdf7f661cd340fcca90e2f1d6"
32
+ "falconPackageHash": "839c469a9096dcc7300096729448633fc891eca2aea31f67e593e890"
33
33
  }