@wix/cli-app 1.1.82 → 1.1.84

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 (90) hide show
  1. package/build/{AddPermissionCommand-SXPAYSAF.js → AddPermissionCommand-7NHTU6UK.js} +2 -2
  2. package/build/{CreateVersionCommand-CL7JTSHV.js → CreateVersionCommand-TMOTI3L2.js} +3 -3
  3. package/build/{DevCommand-NKKM4UEH.js → DevCommand-GI7FE4YH.js} +10 -10
  4. package/build/{GenerateCommand-EK35R76L.js → GenerateCommand-2WWALPNK.js} +8 -8
  5. package/build/{LogsCommand-NCV5AKYF.js → LogsCommand-DA7V6ZFA.js} +3 -3
  6. package/build/PreviewCommand-QNRNYIWF.js +19 -0
  7. package/build/ReleaseCommand-PTADV5RU.js +28 -0
  8. package/build/{ReleaseCommand-FJKPKE3Y.js.map → ReleaseCommand-PTADV5RU.js.map} +1 -1
  9. package/build/ServeCommand-APSJZ6O2.js +43 -0
  10. package/build/ServeCommand-APSJZ6O2.js.map +1 -0
  11. package/build/{build-VSYNDSED.js → build-IGJFWIV4.js} +26 -9
  12. package/build/build-IGJFWIV4.js.map +1 -0
  13. package/build/{chunk-WBXDIEUS.js → chunk-2XND6NQC.js} +2 -2
  14. package/build/{chunk-K4IODCQP.js → chunk-3X2VYRBF.js} +3 -5
  15. package/build/chunk-3X2VYRBF.js.map +1 -0
  16. package/build/{chunk-FGCBIHDS.js → chunk-4CJ4YXNM.js} +84 -17
  17. package/build/chunk-4CJ4YXNM.js.map +1 -0
  18. package/build/{chunk-5LGI6O3F.js → chunk-5LR3QCQE.js} +2 -2
  19. package/build/{chunk-QSLRE7OK.js → chunk-7TK2EJEL.js} +2 -2
  20. package/build/{chunk-HR6CTO67.js → chunk-7VPJQENX.js} +2 -2
  21. package/build/{chunk-XDWVTYW3.js → chunk-AA4VTHKI.js} +20 -2
  22. package/build/{chunk-XDWVTYW3.js.map → chunk-AA4VTHKI.js.map} +1 -1
  23. package/build/{chunk-I2PLZT4A.js → chunk-DBB3BUZK.js} +2 -2
  24. package/build/{chunk-75BL4FR5.js → chunk-ETXWRJRS.js} +5 -5
  25. package/build/{chunk-FTEVVMFS.js → chunk-FZVW2ZKM.js} +2 -2
  26. package/build/{chunk-IB2KM2Q7.js → chunk-HFK5BPUE.js} +7 -7
  27. package/build/{chunk-3LJH5WAS.js → chunk-IBZYUQSD.js} +5 -5
  28. package/build/{chunk-GGQMSU4O.js → chunk-JCCY3Z4D.js} +736 -294
  29. package/build/{chunk-GGQMSU4O.js.map → chunk-JCCY3Z4D.js.map} +1 -1
  30. package/build/{chunk-PGKXOCZN.js → chunk-LAUNVDO3.js} +273 -118
  31. package/build/chunk-LAUNVDO3.js.map +1 -0
  32. package/build/{chunk-3GSDI3OJ.js → chunk-PPW6CJVK.js} +2 -2
  33. package/build/{chunk-KU4PN6UU.js → chunk-SC46ZFM3.js} +3 -3
  34. package/build/{chunk-OGO22IKX.js → chunk-UTLT7RZ6.js} +3 -3
  35. package/build/{chunk-VARU4VGB.js → chunk-YXZEWHQ3.js} +7 -9
  36. package/build/{chunk-VARU4VGB.js.map → chunk-YXZEWHQ3.js.map} +1 -1
  37. package/build/cloudflare-runtime/entry.js +2 -2
  38. package/build/cloudflare-runtime/getRegisteredExtensions.js +1 -1
  39. package/build/index.js +34 -31
  40. package/build/index.js.map +1 -1
  41. package/build/platform-sdk/chunk-6NLQHDP6.js +2 -0
  42. package/build/platform-sdk/chunk-6NLQHDP6.js.map +1 -0
  43. package/build/platform-sdk/chunk-BGTZ3RNN.js +2 -0
  44. package/build/platform-sdk/chunk-BGTZ3RNN.js.map +1 -0
  45. package/build/platform-sdk/{chunk-3WHQP2RD.js → chunk-MM2KVUBI.js} +2 -2
  46. package/build/platform-sdk/dashboard.js +1 -1
  47. package/build/platform-sdk/editor.js +1 -1
  48. package/build/platform-sdk/sdk-context.js +1 -1
  49. package/build/platform-sdk/sdk-context.js.map +1 -1
  50. package/build/platform-sdk/site.js +1 -1
  51. package/build/{preview-CLBQELU3.js → preview-RO62F34N.js} +13 -14
  52. package/build/{preview-CLBQELU3.js.map → preview-RO62F34N.js.map} +1 -1
  53. package/build/{release-VZ2GWJE2.js → release-BC2WPQAP.js} +15 -16
  54. package/build/{release-VZ2GWJE2.js.map → release-BC2WPQAP.js.map} +1 -1
  55. package/build/{render-command-OT7HQRPA.js → render-command-DDRNTE6L.js} +6 -6
  56. package/package.json +11 -11
  57. package/build/PreviewCommand-KCCZ4ECQ.js +0 -20
  58. package/build/ReleaseCommand-FJKPKE3Y.js +0 -29
  59. package/build/ServeCommand-B4GJL65A.js +0 -169
  60. package/build/ServeCommand-B4GJL65A.js.map +0 -1
  61. package/build/build-VSYNDSED.js.map +0 -1
  62. package/build/chunk-FGCBIHDS.js.map +0 -1
  63. package/build/chunk-K4IODCQP.js.map +0 -1
  64. package/build/chunk-PGKXOCZN.js.map +0 -1
  65. package/build/chunk-PS7R6MWD.js +0 -92
  66. package/build/chunk-PS7R6MWD.js.map +0 -1
  67. package/build/platform-sdk/chunk-42XIZ4MH.js +0 -2
  68. package/build/platform-sdk/chunk-42XIZ4MH.js.map +0 -1
  69. package/build/platform-sdk/chunk-MQEY2AKT.js +0 -2
  70. package/build/platform-sdk/chunk-MQEY2AKT.js.map +0 -1
  71. /package/build/{AddPermissionCommand-SXPAYSAF.js.map → AddPermissionCommand-7NHTU6UK.js.map} +0 -0
  72. /package/build/{CreateVersionCommand-CL7JTSHV.js.map → CreateVersionCommand-TMOTI3L2.js.map} +0 -0
  73. /package/build/{DevCommand-NKKM4UEH.js.map → DevCommand-GI7FE4YH.js.map} +0 -0
  74. /package/build/{GenerateCommand-EK35R76L.js.map → GenerateCommand-2WWALPNK.js.map} +0 -0
  75. /package/build/{LogsCommand-NCV5AKYF.js.map → LogsCommand-DA7V6ZFA.js.map} +0 -0
  76. /package/build/{PreviewCommand-KCCZ4ECQ.js.map → PreviewCommand-QNRNYIWF.js.map} +0 -0
  77. /package/build/{chunk-WBXDIEUS.js.map → chunk-2XND6NQC.js.map} +0 -0
  78. /package/build/{chunk-5LGI6O3F.js.map → chunk-5LR3QCQE.js.map} +0 -0
  79. /package/build/{chunk-QSLRE7OK.js.map → chunk-7TK2EJEL.js.map} +0 -0
  80. /package/build/{chunk-HR6CTO67.js.map → chunk-7VPJQENX.js.map} +0 -0
  81. /package/build/{chunk-I2PLZT4A.js.map → chunk-DBB3BUZK.js.map} +0 -0
  82. /package/build/{chunk-75BL4FR5.js.map → chunk-ETXWRJRS.js.map} +0 -0
  83. /package/build/{chunk-FTEVVMFS.js.map → chunk-FZVW2ZKM.js.map} +0 -0
  84. /package/build/{chunk-IB2KM2Q7.js.map → chunk-HFK5BPUE.js.map} +0 -0
  85. /package/build/{chunk-3LJH5WAS.js.map → chunk-IBZYUQSD.js.map} +0 -0
  86. /package/build/{chunk-3GSDI3OJ.js.map → chunk-PPW6CJVK.js.map} +0 -0
  87. /package/build/{chunk-KU4PN6UU.js.map → chunk-SC46ZFM3.js.map} +0 -0
  88. /package/build/{chunk-OGO22IKX.js.map → chunk-UTLT7RZ6.js.map} +0 -0
  89. /package/build/platform-sdk/{chunk-3WHQP2RD.js.map → chunk-MM2KVUBI.js.map} +0 -0
  90. /package/build/{render-command-OT7HQRPA.js.map → render-command-DDRNTE6L.js.map} +0 -0
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  getBackendEventSlug,
5
5
  require_baseUniq
6
- } from "./chunk-XDWVTYW3.js";
6
+ } from "./chunk-AA4VTHKI.js";
7
7
  import {
8
8
  BLOCKS_WIDGETS_PANELS_PATTERN,
9
9
  BLOCKS_WIDGETS_PATTERN,
@@ -29,6 +29,8 @@ import {
29
29
  RELATIVE_ASSET_PATH_REGEX,
30
30
  RegionType,
31
31
  SERVICE_PLUGINS_PATTERN,
32
+ SITE_COMPONENTS_PATTERN,
33
+ SITE_COMPONENTS_SDK_PATTERN,
32
34
  SITE_PLUGINS_PANEL_PATTERN,
33
35
  SITE_PLUGINS_PLUGIN_PATTERN,
34
36
  SITE_WIDGETS_ELEMENT_PATTERN,
@@ -39,7 +41,6 @@ import {
39
41
  ensureDataDirExists,
40
42
  getAppBackendBuildFolder,
41
43
  getAppBrowserBuildFolder,
42
- getAppBuildFolder,
43
44
  getAppWorkerBuildFolder,
44
45
  getBackendOptimizedDir,
45
46
  getDataDirPath,
@@ -62,10 +63,14 @@ import {
62
63
  virtualModuleIdForCustomElementPanelScriptAsset,
63
64
  virtualModuleIdForCustomElementScriptAsset,
64
65
  virtualModuleIdForScriptAsset,
66
+ virtualModuleIdForSiteComponentScriptAsset,
67
+ virtualModuleIdForSiteComponentSdkScriptAsset,
65
68
  virtualPathForCustomElementPanelHTMLAsset,
66
69
  virtualPathForHTMLAsset,
70
+ virtualSiteComponentScriptAssets,
71
+ virtualSiteComponentSdkScriptAssets,
67
72
  z
68
- } from "./chunk-GGQMSU4O.js";
73
+ } from "./chunk-JCCY3Z4D.js";
69
74
  import {
70
75
  __commonJS,
71
76
  __esm,
@@ -29204,7 +29209,7 @@ async function optimizeCjsDependency({
29204
29209
  });
29205
29210
  });
29206
29211
  const [output] = Object.entries(metafile.outputs).find(
29207
- ([, output2]) => output2.entryPoint && path2.resolve(projectFolder, output2.entryPoint) === url
29212
+ ([, output2]) => output2.entryPoint && path2.resolve(projectFolder, output2.entryPoint) === path2.resolve(url)
29208
29213
  ) ?? [];
29209
29214
  if (!output) {
29210
29215
  throw new CliError({
@@ -36864,6 +36869,24 @@ var getComponentHMRTemplate = (id, root) => {
36864
36869
  `;
36865
36870
  };
36866
36871
 
36872
+ // src/vite/plugins/hmr/site-component.ts
36873
+ init_esm_shims();
36874
+ var SITE_COMPONENT_SDK_HMR_PARAMETER = "site-component-sdk-hmr";
36875
+ var SITE_COMPONENT_SDK_HMR_PARAMETER_RE = new RegExp(
36876
+ `[?&]${SITE_COMPONENT_SDK_HMR_PARAMETER}\\b`
36877
+ );
36878
+ var getSiteComponentSdkPathWithHMR = (relativePath) => `/${relativePath}?${SITE_COMPONENT_SDK_HMR_PARAMETER}`;
36879
+ var getSiteComponentSdkHMRTemplate = (id, root) => {
36880
+ const originalId = id.replace(SITE_COMPONENT_SDK_HMR_PARAMETER_RE, "").replace(root, "");
36881
+ return defaultOutdent`
36882
+ if (import.meta.hot) {
36883
+ import.meta.hot.accept((_) => {});
36884
+ }
36885
+
36886
+ export { default } from '${originalId}';
36887
+ `;
36888
+ };
36889
+
36867
36890
  // src/vite/plugins/hmr/plugin.ts
36868
36891
  function hmr() {
36869
36892
  let root;
@@ -36889,6 +36912,11 @@ function hmr() {
36889
36912
  code: getCustomElementHMRTemplate(id, root)
36890
36913
  };
36891
36914
  }
36915
+ if (SITE_COMPONENT_SDK_HMR_PARAMETER_RE.test(id)) {
36916
+ return {
36917
+ code: getSiteComponentSdkHMRTemplate(id, root)
36918
+ };
36919
+ }
36892
36920
  return null;
36893
36921
  }
36894
36922
  };
@@ -37067,6 +37095,21 @@ var getCustomElementPanelBuildTemplate = (customElementPanelComponent) => {
37067
37095
  `;
37068
37096
  };
37069
37097
 
37098
+ // src/vite/plugins/module-bundle/site-components.ts
37099
+ init_esm_shims();
37100
+ var getSiteComponentDevTemplate = (component) => {
37101
+ return `export { default } from '${getComponentPathWithHMR(component.relativePath)}';`;
37102
+ };
37103
+ var getSiteComponentBuildTemplate = (component) => {
37104
+ return `export { default } from '/${component.relativePath}';`;
37105
+ };
37106
+ var getSiteComponentSdkDevTemplate = (component) => {
37107
+ return `export { default } from '${getSiteComponentSdkPathWithHMR(component.relativeSdkPath)}';`;
37108
+ };
37109
+ var getSiteComponentSdkBuildTemplate = (component) => {
37110
+ return `export { default } from '/${component.relativeSdkPath}';`;
37111
+ };
37112
+
37070
37113
  // src/vite/plugins/module-bundle/plugin.ts
37071
37114
  var postfixRE2 = /[?#].*$/s;
37072
37115
  var cleanId = (url) => url.replace(postfixRE2, "");
@@ -37080,13 +37123,15 @@ var moduleBundleDev = ({
37080
37123
  let virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
37081
37124
  let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
37082
37125
  let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
37126
+ let virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37127
+ let virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(initialModel);
37083
37128
  let serverInstance;
37084
37129
  return {
37085
37130
  name: "wix:module-bundle",
37086
37131
  apply: "serve",
37087
37132
  resolveId(rawId) {
37088
37133
  const id = cleanId(rawId);
37089
- if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id)) {
37134
+ if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id) || virtualSiteComponentAssets.has(id) || virtualSiteComponentSdkAssets.has(id)) {
37090
37135
  return id;
37091
37136
  }
37092
37137
  return null;
@@ -37129,6 +37174,20 @@ var moduleBundleDev = ({
37129
37174
  server.moduleGraph.invalidateModule(moduleBundle);
37130
37175
  }
37131
37176
  }
37177
+ virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37178
+ for (const scriptId of virtualSiteComponentAssets.keys()) {
37179
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
37180
+ if (moduleBundle) {
37181
+ server.moduleGraph.invalidateModule(moduleBundle);
37182
+ }
37183
+ }
37184
+ virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(initialModel);
37185
+ for (const scriptId of virtualSiteComponentSdkAssets.keys()) {
37186
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
37187
+ if (moduleBundle) {
37188
+ server.moduleGraph.invalidateModule(moduleBundle);
37189
+ }
37190
+ }
37132
37191
  });
37133
37192
  },
37134
37193
  load(rawId) {
@@ -37157,6 +37216,14 @@ var moduleBundleDev = ({
37157
37216
  if (blocksPanelComponent) {
37158
37217
  return getBlocksPanelDevTemplate(blocksPanelComponent);
37159
37218
  }
37219
+ const siteComponent = virtualSiteComponentAssets.get(id);
37220
+ if (siteComponent) {
37221
+ return getSiteComponentDevTemplate(siteComponent);
37222
+ }
37223
+ const siteSdkComponent = virtualSiteComponentSdkAssets.get(id);
37224
+ if (siteSdkComponent) {
37225
+ return getSiteComponentSdkDevTemplate(siteSdkComponent);
37226
+ }
37160
37227
  return null;
37161
37228
  }
37162
37229
  };
@@ -37168,12 +37235,13 @@ var moduleBundleBuildBrowser = ({
37168
37235
  const virtualDashboardAssets = virtualDashboardScriptAssets(initialModel);
37169
37236
  const virtualCustomElementAssets = virtualCustomElementScriptAssets(initialModel);
37170
37237
  const virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
37238
+ const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37171
37239
  return {
37172
37240
  name: "wix:module-bundle",
37173
37241
  apply: "build",
37174
37242
  resolveId(rawId) {
37175
37243
  const id = cleanId(rawId);
37176
- if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id)) {
37244
+ if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualSiteComponentAssets.has(id)) {
37177
37245
  return id;
37178
37246
  }
37179
37247
  return null;
@@ -37192,6 +37260,10 @@ var moduleBundleBuildBrowser = ({
37192
37260
  if (customElementPanelComponent) {
37193
37261
  return getCustomElementPanelBuildTemplate(customElementPanelComponent);
37194
37262
  }
37263
+ const siteComponent = virtualSiteComponentAssets.get(id);
37264
+ if (siteComponent) {
37265
+ return getSiteComponentBuildTemplate(siteComponent);
37266
+ }
37195
37267
  return null;
37196
37268
  }
37197
37269
  };
@@ -37201,12 +37273,14 @@ var moduleBundleBuildWorker = ({
37201
37273
  }) => {
37202
37274
  const virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
37203
37275
  const virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
37276
+ const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37277
+ const virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(initialModel);
37204
37278
  return {
37205
37279
  name: "wix:module-bundle",
37206
37280
  apply: "build",
37207
37281
  resolveId(rawId) {
37208
37282
  const id = cleanId(rawId);
37209
- if (virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id)) {
37283
+ if (virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id) || virtualSiteComponentAssets.has(id) || virtualSiteComponentSdkAssets.has(id)) {
37210
37284
  return id;
37211
37285
  }
37212
37286
  return null;
@@ -37221,6 +37295,14 @@ var moduleBundleBuildWorker = ({
37221
37295
  if (blocksPanelComponent) {
37222
37296
  return getBlocksPanelBuildTemplate(blocksPanelComponent);
37223
37297
  }
37298
+ const siteComponent = virtualSiteComponentAssets.get(id);
37299
+ if (siteComponent) {
37300
+ return getSiteComponentBuildTemplate(siteComponent);
37301
+ }
37302
+ const siteSdkComponent = virtualSiteComponentSdkAssets.get(id);
37303
+ if (siteSdkComponent) {
37304
+ return getSiteComponentSdkBuildTemplate(siteSdkComponent);
37305
+ }
37224
37306
  return null;
37225
37307
  }
37226
37308
  };
@@ -38853,12 +38935,15 @@ function webMethodsPlugin({
38853
38935
  }
38854
38936
  await init;
38855
38937
  const [, exports] = parse(code);
38938
+ const pathToFile = normalizeGlobbyPattern(
38939
+ path6.relative(projectFolder, url)
38940
+ );
38856
38941
  const mappedExports = exports.map(
38857
38942
  ({ ln: method }) => defaultOutdent`
38858
38943
  export const ${method} = async (...args) => {
38859
38944
  return await callWebMethod({
38860
38945
  args,
38861
- filename: '${path6.relative(projectFolder, url)}',
38946
+ filename: '${pathToFile}',
38862
38947
  method: '${method}',
38863
38948
  baseURL: __webMethodsBaseUrl,
38864
38949
  });
@@ -38905,6 +38990,29 @@ function hashHtmlFiles() {
38905
38990
  };
38906
38991
  }
38907
38992
 
38993
+ // src/vite/plugins/exports-custodian.ts
38994
+ init_esm_shims();
38995
+ var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
38996
+ var exportsCustodian = ({ initialModel }) => {
38997
+ const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
38998
+ return {
38999
+ name: "wix:exports-custodian",
39000
+ apply: "build",
39001
+ resolveId(id) {
39002
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
39003
+ return id;
39004
+ }
39005
+ return null;
39006
+ },
39007
+ load(id) {
39008
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
39009
+ return Array.from(virtualSiteComponentAssets.keys()).map((path9) => `import('${path9}');`).join("\n");
39010
+ }
39011
+ return null;
39012
+ }
39013
+ };
39014
+ };
39015
+
38908
39016
  // src/vite/configs/build-command/browser.ts
38909
39017
  async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38910
39018
  const virtualDashboardHTMLEntries = [
@@ -38920,6 +39028,9 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38920
39028
  const virtualCustomElementScriptEntries = [
38921
39029
  ...virtualCustomElementScriptAssets(model)
38922
39030
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39031
+ const virtualSiteComponentScriptEntries = [
39032
+ ...virtualSiteComponentScriptAssets(model)
39033
+ ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
38923
39034
  const { monitoring } = model.config;
38924
39035
  const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
38925
39036
  appId: model.config.appId,
@@ -38939,17 +39050,6 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38939
39050
  logLevel: "info",
38940
39051
  publicDir: false,
38941
39052
  base: `/${BROWSER_STATICS_FOLDER}`,
38942
- optimizeDeps: {
38943
- entries: [
38944
- DASHBOARD_PAGES_PATTERN,
38945
- DASHBOARD_PLUGINS_PATTERN,
38946
- DASHBOARD_MODALS_PATTERN,
38947
- SITE_WIDGETS_ELEMENT_PATTERN,
38948
- SITE_WIDGETS_PANEL_PATTERN,
38949
- SITE_PLUGINS_PLUGIN_PATTERN,
38950
- SITE_PLUGINS_PANEL_PATTERN
38951
- ]
38952
- },
38953
39053
  server: {},
38954
39054
  build: {
38955
39055
  sourcemap: true,
@@ -38961,8 +39061,10 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38961
39061
  ...virtualDashboardScriptEntries,
38962
39062
  ...embeddedScriptEntries,
38963
39063
  ...virtualCustomElementHTMLEntries,
38964
- ...virtualCustomElementScriptEntries
38965
- ])
39064
+ ...virtualCustomElementScriptEntries,
39065
+ ...virtualSiteComponentScriptEntries
39066
+ ]),
39067
+ ...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
38966
39068
  },
38967
39069
  output: {
38968
39070
  assetFileNames: "assets/[name].ch.[hash][extname]",
@@ -39004,6 +39106,7 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
39004
39106
  initialModel: model,
39005
39107
  ...options
39006
39108
  }),
39109
+ exportsCustodian({ initialModel: model }),
39007
39110
  configExtensionsFileEmitter(model),
39008
39111
  ...monitoringPlugins ?? [],
39009
39112
  src_default({
@@ -39047,74 +39150,20 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
39047
39150
  // src/vite/configs/build-command/worker.ts
39048
39151
  init_esm_shims();
39049
39152
  var import_monitoring_buildtime3 = __toESM(require_build(), 1);
39050
-
39051
- // src/vite/plugins/exports-custodian.ts
39052
- init_esm_shims();
39053
- var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
39054
- var exportsCustodian = ({
39055
- initialModel,
39056
- type,
39057
- projectModelWatcher
39058
- }) => {
39059
- let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
39060
- let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
39061
- return {
39062
- name: "wix:exports-custodian",
39063
- resolveId(id) {
39064
- if (id === EXPORTS_CUSTODIAN_ENTRY) {
39065
- return id;
39066
- }
39067
- return null;
39068
- },
39069
- configureServer(server) {
39070
- if (type === "dev" /* dev */) {
39071
- projectModelWatcher.onChange((model) => {
39072
- virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(model);
39073
- for (const scriptId of virtualBlocksWidgetAssets.keys()) {
39074
- const moduleBundle = server.moduleGraph.getModuleById(scriptId);
39075
- if (moduleBundle) {
39076
- server.moduleGraph.invalidateModule(moduleBundle);
39077
- }
39078
- }
39079
- virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(model);
39080
- for (const scriptId of virtualBlocksWidgetPanelAssets.keys()) {
39081
- const moduleBundle = server.moduleGraph.getModuleById(scriptId);
39082
- if (moduleBundle) {
39083
- server.moduleGraph.invalidateModule(moduleBundle);
39084
- }
39085
- }
39086
- });
39087
- }
39088
- },
39089
- load(id) {
39090
- if (id === EXPORTS_CUSTODIAN_ENTRY) {
39091
- return [
39092
- ...Array.from(virtualBlocksWidgetAssets.keys()).map(
39093
- (path9, index) => `
39094
- import { init as init${index}, api as api${index} } from '${path9}';
39095
- init${index}();
39096
- api${index}();
39097
- `
39098
- ),
39099
- ...Array.from(virtualBlocksWidgetPanelAssets.keys()).map(
39100
- (path9, index) => `
39101
- import { init as initPanel${index} } from '${path9}';
39102
- initPanel${index}();
39103
- `
39104
- )
39105
- ].join("\n");
39106
- }
39107
- return null;
39108
- }
39109
- };
39110
- };
39111
-
39112
- // src/vite/configs/build-command/worker.ts
39113
39153
  async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
39114
39154
  const virtualBlocksScriptEntries = [
39115
39155
  ...virtualBlocksWidgetScriptAssets(model),
39116
39156
  ...virtualBlocksWidgetPanelScriptAssets(model)
39117
39157
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39158
+ const virtualSiteComponentScriptEntries = [
39159
+ ...virtualSiteComponentScriptAssets(model)
39160
+ ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39161
+ const virtualSiteComponentSdkScriptEntries = [
39162
+ ...virtualSiteComponentSdkScriptAssets(model)
39163
+ ].map(([assetId, component]) => [
39164
+ `script-asset-${component.id}-sdk`,
39165
+ assetId
39166
+ ]);
39118
39167
  const { monitoring } = model.config;
39119
39168
  const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime3.getMonitoringVitePlugins)({
39120
39169
  appId: model.config.appId,
@@ -39133,9 +39182,6 @@ async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
39133
39182
  clearScreen: false,
39134
39183
  logLevel: "info",
39135
39184
  publicDir: false,
39136
- optimizeDeps: {
39137
- entries: [BLOCKS_WIDGETS_PATTERN, BLOCKS_WIDGETS_PANELS_PATTERN]
39138
- },
39139
39185
  server: {},
39140
39186
  ssr: {
39141
39187
  target: "webworker",
@@ -39147,8 +39193,11 @@ async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
39147
39193
  outDir: getAppWorkerBuildFolder(model.projectFolder),
39148
39194
  rollupOptions: {
39149
39195
  input: {
39150
- ...Object.fromEntries(virtualBlocksScriptEntries),
39151
- [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY
39196
+ ...Object.fromEntries([
39197
+ ...virtualBlocksScriptEntries,
39198
+ ...virtualSiteComponentScriptEntries,
39199
+ ...virtualSiteComponentSdkScriptEntries
39200
+ ])
39152
39201
  },
39153
39202
  output: {
39154
39203
  assetFileNames: "assets/[name].ch.[hash][extname]",
@@ -39179,10 +39228,6 @@ async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
39179
39228
  initialModel: model,
39180
39229
  ...options
39181
39230
  }),
39182
- exportsCustodian({
39183
- initialModel: model,
39184
- ...options
39185
- }),
39186
39231
  ...monitoringPlugins ?? [],
39187
39232
  src_default({
39188
39233
  ignoreConfigErrors: true,
@@ -39440,13 +39485,13 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39440
39485
  SITE_PLUGINS_PLUGIN_PATTERN,
39441
39486
  SITE_PLUGINS_PANEL_PATTERN,
39442
39487
  BLOCKS_WIDGETS_PATTERN,
39443
- BLOCKS_WIDGETS_PANELS_PATTERN
39488
+ BLOCKS_WIDGETS_PANELS_PATTERN,
39489
+ SITE_COMPONENTS_PATTERN,
39490
+ SITE_COMPONENTS_SDK_PATTERN
39444
39491
  ]
39445
39492
  },
39446
39493
  server: {},
39447
39494
  build: {
39448
- sourcemap: true,
39449
- outDir: getAppBuildFolder(model.projectFolder),
39450
39495
  rollupOptions: {
39451
39496
  input: {
39452
39497
  ...Object.fromEntries([
@@ -39456,13 +39501,7 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39456
39501
  ...virtualCustomElementHTMLEntries,
39457
39502
  ...virtualCustomElementScriptEntries,
39458
39503
  ...virtualBlocksScriptEntries
39459
- ]),
39460
- ...virtualBlocksScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
39461
- },
39462
- output: {
39463
- assetFileNames: "assets/[name].ch.[hash][extname]",
39464
- chunkFileNames: "assets/[name].ch.[hash].js",
39465
- entryFileNames: "assets/[name].ch.[hash].js"
39504
+ ])
39466
39505
  }
39467
39506
  }
39468
39507
  },
@@ -39503,10 +39542,6 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39503
39542
  initialModel: model,
39504
39543
  ...options
39505
39544
  }),
39506
- exportsCustodian({
39507
- initialModel: model,
39508
- ...options
39509
- }),
39510
39545
  configExtensionsFileEmitter(model),
39511
39546
  ...monitoringPlugins ?? [],
39512
39547
  src_default({
@@ -39629,6 +39664,11 @@ var validateComponents = (components) => {
39629
39664
  name: marketData.name,
39630
39665
  type: "site-plugin",
39631
39666
  path: replaceExtension(relativePath, "json")
39667
+ }),
39668
+ SiteComponent: ({ relativePath }) => ({
39669
+ name: relativePath,
39670
+ type: "site-component",
39671
+ path: replaceExtension(relativePath, "json")
39632
39672
  })
39633
39673
  })
39634
39674
  ).sort((a, b) => a.name.localeCompare(b.name)),
@@ -40067,6 +40107,20 @@ async function createAppManifest({
40067
40107
  }
40068
40108
  }
40069
40109
  };
40110
+ },
40111
+ SiteComponent: async (component) => {
40112
+ return {
40113
+ compId: component.id,
40114
+ compType: ComponentType.EDITOR_REACT_COMPONENT,
40115
+ compData: {
40116
+ editorReactComponent: {
40117
+ type: `platform.builder.${appId}_${component.id}`,
40118
+ description: component.description,
40119
+ editorElement: component.editorElement,
40120
+ resources: { ...await componentSourceBuilder(component) }
40121
+ }
40122
+ }
40123
+ };
40070
40124
  }
40071
40125
  })
40072
40126
  )
@@ -40117,18 +40171,24 @@ function extractBundleAssetFileName(buildOutput, fileName) {
40117
40171
  }
40118
40172
  return output.fileName;
40119
40173
  }
40120
- function extractModuleBundleName(buildOutput, moduleId) {
40174
+ function extractModuleBundleChunk(buildOutput, moduleId) {
40121
40175
  const outputs = extractBuildOutputs(buildOutput);
40122
- const output = outputs.find(
40123
- (output2) => output2.type === "chunk" && output2.facadeModuleId === moduleId
40124
- );
40176
+ const output = outputs.filter((output2) => output2.type === "chunk").find((output2) => output2.facadeModuleId === moduleId);
40125
40177
  if (!output) {
40126
40178
  throw new CliError({
40127
40179
  code: CliErrorCode.ViteModuleBundleNotFound(),
40128
40180
  cause: null
40129
40181
  });
40130
40182
  }
40131
- return output.fileName;
40183
+ return output;
40184
+ }
40185
+ function extractModuleBundleName(buildOutput, moduleId) {
40186
+ return extractModuleBundleChunk(buildOutput, moduleId).fileName;
40187
+ }
40188
+ function extractModuleBundleCss(buildOutput, moduleId) {
40189
+ const output = extractModuleBundleChunk(buildOutput, moduleId);
40190
+ const importedCss = output.viteMetadata?.importedCss;
40191
+ return importedCss?.values().next().value;
40132
40192
  }
40133
40193
  function extractModuleBundleContent(buildOutput, fileName) {
40134
40194
  const output = extractAssetOutput(buildOutput, fileName);
@@ -40300,6 +40360,47 @@ var blocksPanelBuilder = (component, source) => {
40300
40360
  componentUrl
40301
40361
  };
40302
40362
  };
40363
+ var siteComponentBuilder = (component, browserSource, workerSource) => {
40364
+ const moduleId = virtualModuleIdForSiteComponentScriptAsset(component.id);
40365
+ const sdkModuleId = component.relativeSdkPath ? virtualModuleIdForSiteComponentSdkScriptAsset(component.id) : null;
40366
+ if (browserSource.buildSource == null || workerSource?.buildSource?.workerBuildOutput == null) {
40367
+ return {
40368
+ client: {
40369
+ componentUrl: `/@id/${moduleId}?import`
40370
+ },
40371
+ server: {
40372
+ url: ""
40373
+ },
40374
+ ...sdkModuleId ? { sdk: { url: `/@id/${sdkModuleId}?import` } } : {}
40375
+ };
40376
+ }
40377
+ return {
40378
+ client: {
40379
+ componentUrl: extractModuleBundleName(
40380
+ browserSource.buildSource.browserBuildOutput,
40381
+ moduleId
40382
+ ),
40383
+ cssUrl: extractModuleBundleCss(
40384
+ browserSource.buildSource.browserBuildOutput,
40385
+ moduleId
40386
+ )
40387
+ },
40388
+ server: {
40389
+ url: extractModuleBundleName(
40390
+ workerSource.buildSource.workerBuildOutput,
40391
+ moduleId
40392
+ )
40393
+ },
40394
+ ...sdkModuleId ? {
40395
+ sdk: {
40396
+ url: extractModuleBundleName(
40397
+ workerSource.buildSource.workerBuildOutput,
40398
+ sdkModuleId
40399
+ )
40400
+ }
40401
+ } : {}
40402
+ };
40403
+ };
40303
40404
  function getComponentDevSourceBuilder(model, devSource, backendSource) {
40304
40405
  return async (component) => {
40305
40406
  const source = (0, import_variant6.match)(component, {
@@ -40326,7 +40427,8 @@ function getComponentDevSourceBuilder(model, devSource, backendSource) {
40326
40427
  Event: (component2) => eventSourceBuilder(component2, model, backendSource),
40327
40428
  ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
40328
40429
  Monitoring: () => {
40329
- }
40430
+ },
40431
+ SiteComponent: (component2) => siteComponentBuilder(component2, { devSource })
40330
40432
  });
40331
40433
  return source;
40332
40434
  };
@@ -40373,7 +40475,12 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
40373
40475
  Event: (component2) => eventSourceBuilder(component2, model, backendSource),
40374
40476
  ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
40375
40477
  Monitoring: () => {
40376
- }
40478
+ },
40479
+ SiteComponent: (component2) => siteComponentBuilder(
40480
+ component2,
40481
+ { buildSource: browserBuildSource },
40482
+ { buildSource: workerBuildSource }
40483
+ )
40377
40484
  });
40378
40485
  return source;
40379
40486
  };
@@ -40838,6 +40945,31 @@ var monitoringSchema = z.object({
40838
40945
  ])
40839
40946
  })
40840
40947
  });
40948
+ var siteComponentSourceSchema = z.object({
40949
+ client: z.object({
40950
+ componentUrl: z.string(),
40951
+ cssUrl: z.string().optional()
40952
+ }),
40953
+ server: z.object({
40954
+ url: z.string()
40955
+ }),
40956
+ sdk: z.object({
40957
+ url: z.string()
40958
+ }).optional()
40959
+ });
40960
+ var siteComponentSchema = z.object({
40961
+ compType: z.literal(ComponentType.EDITOR_REACT_COMPONENT),
40962
+ compId: z.string(),
40963
+ compName: z.string().optional(),
40964
+ compData: z.object({
40965
+ editorReactComponent: z.object({
40966
+ type: z.string().min(5),
40967
+ description: z.string().min(5),
40968
+ resources: siteComponentSourceSchema,
40969
+ editorElement: z.unknown()
40970
+ })
40971
+ })
40972
+ });
40841
40973
  var componentSchema = z.discriminatedUnion("compType", [
40842
40974
  backofficePageSchema,
40843
40975
  backofficeExtensionSchema,
@@ -40862,7 +40994,8 @@ var componentSchema = z.discriminatedUnion("compType", [
40862
40994
  ecomPaymentSettingsSchema,
40863
40995
  ecomGiftCardsProviderSchema,
40864
40996
  topologySchema,
40865
- monitoringSchema
40997
+ monitoringSchema,
40998
+ siteComponentSchema
40866
40999
  ]);
40867
41000
  var appManifestSchema = z.object({
40868
41001
  appId: z.string(),
@@ -41015,6 +41148,18 @@ var updateBrowserComponentsWithBaseUrl = (appManifest, baseUrl) => {
41015
41148
  )
41016
41149
  };
41017
41150
  }
41151
+ if (compType === ComponentType.EDITOR_REACT_COMPONENT) {
41152
+ compData.editorReactComponent.resources.client.componentUrl = normalizeUrl(
41153
+ compData.editorReactComponent.resources.client.componentUrl,
41154
+ normalizedBaseUrl
41155
+ );
41156
+ if (compData.editorReactComponent.resources.client.cssUrl) {
41157
+ compData.editorReactComponent.resources.client.cssUrl = normalizeUrl(
41158
+ compData.editorReactComponent.resources.client.cssUrl,
41159
+ normalizedBaseUrl
41160
+ );
41161
+ }
41162
+ }
41018
41163
  }
41019
41164
  return clonedManifest;
41020
41165
  };
@@ -41044,6 +41189,18 @@ var updateWorkerComponentsWithBaseUrl = (appManifest, workerBaseUrl) => {
41044
41189
  originUrl.searchParams.set(bundleUrlQueryParam, normalizedBundleUrl);
41045
41190
  compData.panel.url = originUrl.toString();
41046
41191
  }
41192
+ if (compType === ComponentType.EDITOR_REACT_COMPONENT) {
41193
+ compData.editorReactComponent.resources.server.url = normalizeUrl2(
41194
+ compData.editorReactComponent.resources.server.url,
41195
+ normalizedWorkerBaseUrl
41196
+ );
41197
+ if (compData.editorReactComponent.resources.sdk) {
41198
+ compData.editorReactComponent.resources.sdk.url = normalizeUrl2(
41199
+ compData.editorReactComponent.resources.sdk.url,
41200
+ normalizedWorkerBaseUrl
41201
+ );
41202
+ }
41203
+ }
41047
41204
  }
41048
41205
  return clonedManifest;
41049
41206
  };
@@ -41240,10 +41397,8 @@ export {
41240
41397
  getViteConfig2 as getViteConfig3,
41241
41398
  getViteConfig3 as getViteConfig4,
41242
41399
  readAppManifest,
41243
- updateBrowserComponentsWithBaseUrl,
41244
41400
  updateMonitoring,
41245
41401
  updateTopology,
41246
- updateBlocksComponents,
41247
41402
  updateAppManifestComponents,
41248
41403
  validateComponents,
41249
41404
  createCustomElementConfig,
@@ -41256,4 +41411,4 @@ export {
41256
41411
  he/he.js:
41257
41412
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
41258
41413
  */
41259
- //# sourceMappingURL=chunk-PGKXOCZN.js.map
41414
+ //# sourceMappingURL=chunk-LAUNVDO3.js.map