@wix/ditto-codegen-public 1.0.384 → 1.0.385

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 +40 -30
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -10840,6 +10840,7 @@ var require_CodeGenService = __commonJS({
10840
10840
  path: ext.path,
10841
10841
  extensionType: ext.extensionType,
10842
10842
  title: ext.title,
10843
+ isSpi: ext.isSpi,
10843
10844
  files: ext.files.map((f) => ({
10844
10845
  path: f.path,
10845
10846
  operation: FILE_OPERATION[f.operation] ?? types_1.FileOperation.UNKNOWN_FILE_OPERATION
@@ -11353,8 +11354,9 @@ var require_constants5 = __commonJS({
11353
11354
  "dist/opencode-integration/task-tracker/constants.js"(exports2) {
11354
11355
  "use strict";
11355
11356
  Object.defineProperty(exports2, "__esModule", { value: true });
11356
- exports2.BUILDER_TO_EXTENSION_LABEL = exports2.WIX_MCP_SERVER_NAME = exports2.CONTAINER_ROOT_PREFIX = void 0;
11357
+ exports2.WIX_MCP_SERVER_NAME = exports2.CONTAINER_ROOT_PREFIX = void 0;
11357
11358
  exports2.resolveFileOperation = resolveFileOperation;
11359
+ exports2.isSpiExtension = isSpiExtension;
11358
11360
  exports2.normalizeFilePath = normalizeFilePath;
11359
11361
  exports2.isExtensionsFile = isExtensionsFile;
11360
11362
  exports2.detectExtension = detectExtension;
@@ -11375,28 +11377,35 @@ var require_constants5 = __commonJS({
11375
11377
  }
11376
11378
  return null;
11377
11379
  }
11378
- exports2.BUILDER_TO_EXTENSION_LABEL = {
11379
- dashboardPage: "dashboard page",
11380
- dashboardModal: "dashboard modal",
11381
- dashboardPlugin: "dashboard plugin",
11382
- dashboardMenuPlugin: "dashboard menu plugin",
11383
- embeddedScript: "embedded script",
11384
- event: "backend event",
11385
- customElement: "custom element",
11386
- siteComponent: "editor react component",
11387
- editorReactComponent: "editor react component",
11388
- sitePlugin: "site plugin",
11389
- ecomShippingRates: "service plugin",
11390
- ecomAdditionalFees: "service plugin",
11391
- ecomValidations: "service plugin",
11392
- ecomDiscountTriggers: "service plugin",
11393
- ecomGiftCards: "service plugin",
11394
- ecomPaymentSettings: "service plugin",
11395
- bookingsStaffSortingProvider: "service plugin",
11396
- contextProvider: "context provider",
11397
- functionLibrary: "function library",
11398
- dataCollections: "data collection"
11399
- };
11380
+ var SPI_EXTENSION_TYPES = [
11381
+ "ecomShippingRates",
11382
+ "ecomAdditionalFees",
11383
+ "ecomValidations",
11384
+ "ecomDiscountTriggers",
11385
+ "ecomGiftCards",
11386
+ "ecomPaymentSettings",
11387
+ "bookingsStaffSortingProvider"
11388
+ ];
11389
+ var BUILDER_EXTENSION_TYPES = [
11390
+ "dashboardPage",
11391
+ "dashboardModal",
11392
+ "dashboardPlugin",
11393
+ "dashboardMenuPlugin",
11394
+ "embeddedScript",
11395
+ "event",
11396
+ "customElement",
11397
+ "siteComponent",
11398
+ "editorReactComponent",
11399
+ "sitePlugin",
11400
+ ...SPI_EXTENSION_TYPES,
11401
+ "contextProvider",
11402
+ "functionLibrary",
11403
+ "dataCollections"
11404
+ ];
11405
+ var SPI_EXTENSION_TYPE_SET = new Set(SPI_EXTENSION_TYPES);
11406
+ function isSpiExtension(extensionType) {
11407
+ return SPI_EXTENSION_TYPE_SET.has(extensionType);
11408
+ }
11400
11409
  function normalizeFilePath(filePath) {
11401
11410
  return filePath.replace(exports2.CONTAINER_ROOT_PREFIX, "");
11402
11411
  }
@@ -11404,9 +11413,9 @@ var require_constants5 = __commonJS({
11404
11413
  return EXTENSION_FILE_PATTERN.test(filePath);
11405
11414
  }
11406
11415
  function detectExtension(content) {
11407
- for (const [extensionType, label] of Object.entries(exports2.BUILDER_TO_EXTENSION_LABEL)) {
11416
+ for (const extensionType of BUILDER_EXTENSION_TYPES) {
11408
11417
  if (content.includes(`extensions.${extensionType}(`) || content.includes(`experimentalExtensions.${extensionType}(`)) {
11409
- return { extensionType, label };
11418
+ return extensionType;
11410
11419
  }
11411
11420
  }
11412
11421
  return null;
@@ -15813,7 +15822,8 @@ var require_collect_extensions_created = __commonJS({
15813
15822
  path: definitionPath,
15814
15823
  extensionType,
15815
15824
  title: (0, constants_1.extractExtensionDisplayTitle)(contentForTitle, titlePath),
15816
- files: [...files]
15825
+ files: [...files],
15826
+ isSpi: (0, constants_1.isSpiExtension)(extensionType)
15817
15827
  });
15818
15828
  async function collectDataCollectionEntries(outputPath, parentExtensionFile, folderFiles) {
15819
15829
  const entries = [];
@@ -15840,16 +15850,16 @@ var require_collect_extensions_created = __commonJS({
15840
15850
  continue;
15841
15851
  try {
15842
15852
  const content = await (0, promises_1.readFile)(resolveFilePath(outputPath, fileChange.path), "utf-8");
15843
- const detected = (0, constants_1.detectExtension)(content);
15844
- if (!detected)
15853
+ const extensionType = (0, constants_1.detectExtension)(content);
15854
+ if (!extensionType)
15845
15855
  continue;
15846
15856
  const folderFiles = files.filter((file) => isFileInExtensionFolder(file.path, fileChange.path));
15847
- if (detected.extensionType === "dataCollections") {
15857
+ if (extensionType === "dataCollections") {
15848
15858
  const dataCollectionEntries = await collectDataCollectionEntries(outputPath, fileChange, folderFiles);
15849
15859
  results.push(...dataCollectionEntries);
15850
15860
  continue;
15851
15861
  }
15852
- results.push(buildJobExtension(fileChange.path, detected.extensionType, content, fileChange.path, folderFiles));
15862
+ results.push(buildJobExtension(fileChange.path, extensionType, content, fileChange.path, folderFiles));
15853
15863
  } catch {
15854
15864
  continue;
15855
15865
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.384",
3
+ "version": "1.0.385",
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": "9b169b82fd27ad66070b5b9211071a3775eed2985a3006f2f89789fb"
32
+ "falconPackageHash": "5f06712568df646c3f5e3252edb7f7cd16e99e7b27e710c506b70686"
33
33
  }