@wix/cli-app 1.1.82 → 1.1.83

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 (89) hide show
  1. package/build/{AddPermissionCommand-SXPAYSAF.js → AddPermissionCommand-5X3K4KUG.js} +2 -2
  2. package/build/{CreateVersionCommand-CL7JTSHV.js → CreateVersionCommand-XWWXAFOX.js} +3 -3
  3. package/build/{DevCommand-NKKM4UEH.js → DevCommand-EOEGQX2B.js} +10 -10
  4. package/build/{GenerateCommand-EK35R76L.js → GenerateCommand-IOFKL3RC.js} +8 -8
  5. package/build/{LogsCommand-NCV5AKYF.js → LogsCommand-23QQRT3D.js} +3 -3
  6. package/build/PreviewCommand-FBODGF7Y.js +19 -0
  7. package/build/ReleaseCommand-SNCMQQXK.js +28 -0
  8. package/build/{ReleaseCommand-FJKPKE3Y.js.map → ReleaseCommand-SNCMQQXK.js.map} +1 -1
  9. package/build/ServeCommand-SGREOUDA.js +43 -0
  10. package/build/ServeCommand-SGREOUDA.js.map +1 -0
  11. package/build/{build-VSYNDSED.js → build-PYB5PAZO.js} +6 -6
  12. package/build/{chunk-K4IODCQP.js → chunk-3X2VYRBF.js} +3 -5
  13. package/build/chunk-3X2VYRBF.js.map +1 -0
  14. package/build/{chunk-3GSDI3OJ.js → chunk-4PXJSX4C.js} +2 -2
  15. package/build/{chunk-FGCBIHDS.js → chunk-5TP6T6QK.js} +84 -17
  16. package/build/chunk-5TP6T6QK.js.map +1 -0
  17. package/build/{chunk-HR6CTO67.js → chunk-63VDDLLQ.js} +2 -2
  18. package/build/{chunk-VARU4VGB.js → chunk-AN77SZN2.js} +7 -9
  19. package/build/{chunk-VARU4VGB.js.map → chunk-AN77SZN2.js.map} +1 -1
  20. package/build/{chunk-FTEVVMFS.js → chunk-E4UNGBQY.js} +2 -2
  21. package/build/{chunk-OGO22IKX.js → chunk-GGDJQXOX.js} +3 -3
  22. package/build/{chunk-KU4PN6UU.js → chunk-KLBXSZ6R.js} +3 -3
  23. package/build/{chunk-75BL4FR5.js → chunk-QREADZZF.js} +5 -5
  24. package/build/{chunk-PGKXOCZN.js → chunk-SIJDKP2Q.js} +242 -85
  25. package/build/chunk-SIJDKP2Q.js.map +1 -0
  26. package/build/{chunk-3LJH5WAS.js → chunk-TJFERWU7.js} +5 -5
  27. package/build/{chunk-WBXDIEUS.js → chunk-VB3AXXRP.js} +2 -2
  28. package/build/{chunk-XDWVTYW3.js → chunk-VLQG5SQF.js} +20 -2
  29. package/build/{chunk-XDWVTYW3.js.map → chunk-VLQG5SQF.js.map} +1 -1
  30. package/build/{chunk-5LGI6O3F.js → chunk-WNR36YTI.js} +2 -2
  31. package/build/{chunk-I2PLZT4A.js → chunk-Y4GJ3NS4.js} +2 -2
  32. package/build/{chunk-QSLRE7OK.js → chunk-ZCUJ356B.js} +2 -2
  33. package/build/{chunk-GGQMSU4O.js → chunk-ZLLXHWZF.js} +588 -249
  34. package/build/{chunk-GGQMSU4O.js.map → chunk-ZLLXHWZF.js.map} +1 -1
  35. package/build/{chunk-IB2KM2Q7.js → chunk-ZOZ5LJV7.js} +7 -7
  36. package/build/cloudflare-runtime/entry.js +1 -1
  37. package/build/cloudflare-runtime/getRegisteredExtensions.js +1 -1
  38. package/build/index.js +34 -31
  39. package/build/index.js.map +1 -1
  40. package/build/platform-sdk/chunk-6NLQHDP6.js +2 -0
  41. package/build/platform-sdk/chunk-6NLQHDP6.js.map +1 -0
  42. package/build/platform-sdk/chunk-BGTZ3RNN.js +2 -0
  43. package/build/platform-sdk/chunk-BGTZ3RNN.js.map +1 -0
  44. package/build/platform-sdk/{chunk-3WHQP2RD.js → chunk-MM2KVUBI.js} +2 -2
  45. package/build/platform-sdk/dashboard.js +1 -1
  46. package/build/platform-sdk/editor.js +1 -1
  47. package/build/platform-sdk/sdk-context.js +1 -1
  48. package/build/platform-sdk/sdk-context.js.map +1 -1
  49. package/build/platform-sdk/site.js +1 -1
  50. package/build/{preview-CLBQELU3.js → preview-PIFWQKW3.js} +13 -14
  51. package/build/{preview-CLBQELU3.js.map → preview-PIFWQKW3.js.map} +1 -1
  52. package/build/{release-VZ2GWJE2.js → release-6Z6LMTRW.js} +15 -16
  53. package/build/{release-VZ2GWJE2.js.map → release-6Z6LMTRW.js.map} +1 -1
  54. package/build/{render-command-OT7HQRPA.js → render-command-3G25G5MU.js} +6 -6
  55. package/package.json +6 -6
  56. package/build/PreviewCommand-KCCZ4ECQ.js +0 -20
  57. package/build/ReleaseCommand-FJKPKE3Y.js +0 -29
  58. package/build/ServeCommand-B4GJL65A.js +0 -169
  59. package/build/ServeCommand-B4GJL65A.js.map +0 -1
  60. package/build/chunk-FGCBIHDS.js.map +0 -1
  61. package/build/chunk-K4IODCQP.js.map +0 -1
  62. package/build/chunk-PGKXOCZN.js.map +0 -1
  63. package/build/chunk-PS7R6MWD.js +0 -92
  64. package/build/chunk-PS7R6MWD.js.map +0 -1
  65. package/build/platform-sdk/chunk-42XIZ4MH.js +0 -2
  66. package/build/platform-sdk/chunk-42XIZ4MH.js.map +0 -1
  67. package/build/platform-sdk/chunk-MQEY2AKT.js +0 -2
  68. package/build/platform-sdk/chunk-MQEY2AKT.js.map +0 -1
  69. /package/build/{AddPermissionCommand-SXPAYSAF.js.map → AddPermissionCommand-5X3K4KUG.js.map} +0 -0
  70. /package/build/{CreateVersionCommand-CL7JTSHV.js.map → CreateVersionCommand-XWWXAFOX.js.map} +0 -0
  71. /package/build/{DevCommand-NKKM4UEH.js.map → DevCommand-EOEGQX2B.js.map} +0 -0
  72. /package/build/{GenerateCommand-EK35R76L.js.map → GenerateCommand-IOFKL3RC.js.map} +0 -0
  73. /package/build/{LogsCommand-NCV5AKYF.js.map → LogsCommand-23QQRT3D.js.map} +0 -0
  74. /package/build/{PreviewCommand-KCCZ4ECQ.js.map → PreviewCommand-FBODGF7Y.js.map} +0 -0
  75. /package/build/{build-VSYNDSED.js.map → build-PYB5PAZO.js.map} +0 -0
  76. /package/build/{chunk-3GSDI3OJ.js.map → chunk-4PXJSX4C.js.map} +0 -0
  77. /package/build/{chunk-HR6CTO67.js.map → chunk-63VDDLLQ.js.map} +0 -0
  78. /package/build/{chunk-FTEVVMFS.js.map → chunk-E4UNGBQY.js.map} +0 -0
  79. /package/build/{chunk-OGO22IKX.js.map → chunk-GGDJQXOX.js.map} +0 -0
  80. /package/build/{chunk-KU4PN6UU.js.map → chunk-KLBXSZ6R.js.map} +0 -0
  81. /package/build/{chunk-75BL4FR5.js.map → chunk-QREADZZF.js.map} +0 -0
  82. /package/build/{chunk-3LJH5WAS.js.map → chunk-TJFERWU7.js.map} +0 -0
  83. /package/build/{chunk-WBXDIEUS.js.map → chunk-VB3AXXRP.js.map} +0 -0
  84. /package/build/{chunk-5LGI6O3F.js.map → chunk-WNR36YTI.js.map} +0 -0
  85. /package/build/{chunk-I2PLZT4A.js.map → chunk-Y4GJ3NS4.js.map} +0 -0
  86. /package/build/{chunk-QSLRE7OK.js.map → chunk-ZCUJ356B.js.map} +0 -0
  87. /package/build/{chunk-IB2KM2Q7.js.map → chunk-ZOZ5LJV7.js.map} +0 -0
  88. /package/build/platform-sdk/{chunk-3WHQP2RD.js.map → chunk-MM2KVUBI.js.map} +0 -0
  89. /package/build/{render-command-OT7HQRPA.js.map → render-command-3G25G5MU.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-VLQG5SQF.js";
7
7
  import {
8
8
  BLOCKS_WIDGETS_PANELS_PATTERN,
9
9
  BLOCKS_WIDGETS_PATTERN,
@@ -29,6 +29,7 @@ import {
29
29
  RELATIVE_ASSET_PATH_REGEX,
30
30
  RegionType,
31
31
  SERVICE_PLUGINS_PATTERN,
32
+ SITE_COMPONENTS_PATTERN,
32
33
  SITE_PLUGINS_PANEL_PATTERN,
33
34
  SITE_PLUGINS_PLUGIN_PATTERN,
34
35
  SITE_WIDGETS_ELEMENT_PATTERN,
@@ -62,10 +63,12 @@ import {
62
63
  virtualModuleIdForCustomElementPanelScriptAsset,
63
64
  virtualModuleIdForCustomElementScriptAsset,
64
65
  virtualModuleIdForScriptAsset,
66
+ virtualModuleIdForSiteComponentScriptAsset,
65
67
  virtualPathForCustomElementPanelHTMLAsset,
66
68
  virtualPathForHTMLAsset,
69
+ virtualSiteComponentScriptAssets,
67
70
  z
68
- } from "./chunk-GGQMSU4O.js";
71
+ } from "./chunk-ZLLXHWZF.js";
69
72
  import {
70
73
  __commonJS,
71
74
  __esm,
@@ -29204,7 +29207,7 @@ async function optimizeCjsDependency({
29204
29207
  });
29205
29208
  });
29206
29209
  const [output] = Object.entries(metafile.outputs).find(
29207
- ([, output2]) => output2.entryPoint && path2.resolve(projectFolder, output2.entryPoint) === url
29210
+ ([, output2]) => output2.entryPoint && path2.resolve(projectFolder, output2.entryPoint) === path2.resolve(url)
29208
29211
  ) ?? [];
29209
29212
  if (!output) {
29210
29213
  throw new CliError({
@@ -37067,6 +37070,15 @@ var getCustomElementPanelBuildTemplate = (customElementPanelComponent) => {
37067
37070
  `;
37068
37071
  };
37069
37072
 
37073
+ // src/vite/plugins/module-bundle/site-components.ts
37074
+ init_esm_shims();
37075
+ var getSiteComponentDevTemplate = (component) => {
37076
+ return `export { default } from '${getComponentPathWithHMR(component.relativePath)}';`;
37077
+ };
37078
+ var getSiteComponentBuildTemplate = (component) => {
37079
+ return `export { default } from '/${component.relativePath}';`;
37080
+ };
37081
+
37070
37082
  // src/vite/plugins/module-bundle/plugin.ts
37071
37083
  var postfixRE2 = /[?#].*$/s;
37072
37084
  var cleanId = (url) => url.replace(postfixRE2, "");
@@ -37080,13 +37092,14 @@ var moduleBundleDev = ({
37080
37092
  let virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
37081
37093
  let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
37082
37094
  let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
37095
+ let virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37083
37096
  let serverInstance;
37084
37097
  return {
37085
37098
  name: "wix:module-bundle",
37086
37099
  apply: "serve",
37087
37100
  resolveId(rawId) {
37088
37101
  const id = cleanId(rawId);
37089
- if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id)) {
37102
+ if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id) || virtualSiteComponentAssets.has(id)) {
37090
37103
  return id;
37091
37104
  }
37092
37105
  return null;
@@ -37129,6 +37142,13 @@ var moduleBundleDev = ({
37129
37142
  server.moduleGraph.invalidateModule(moduleBundle);
37130
37143
  }
37131
37144
  }
37145
+ virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37146
+ for (const scriptId of virtualSiteComponentAssets.keys()) {
37147
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
37148
+ if (moduleBundle) {
37149
+ server.moduleGraph.invalidateModule(moduleBundle);
37150
+ }
37151
+ }
37132
37152
  });
37133
37153
  },
37134
37154
  load(rawId) {
@@ -37157,6 +37177,10 @@ var moduleBundleDev = ({
37157
37177
  if (blocksPanelComponent) {
37158
37178
  return getBlocksPanelDevTemplate(blocksPanelComponent);
37159
37179
  }
37180
+ const siteComponent = virtualSiteComponentAssets.get(id);
37181
+ if (siteComponent) {
37182
+ return getSiteComponentDevTemplate(siteComponent);
37183
+ }
37160
37184
  return null;
37161
37185
  }
37162
37186
  };
@@ -37168,12 +37192,13 @@ var moduleBundleBuildBrowser = ({
37168
37192
  const virtualDashboardAssets = virtualDashboardScriptAssets(initialModel);
37169
37193
  const virtualCustomElementAssets = virtualCustomElementScriptAssets(initialModel);
37170
37194
  const virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
37195
+ const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
37171
37196
  return {
37172
37197
  name: "wix:module-bundle",
37173
37198
  apply: "build",
37174
37199
  resolveId(rawId) {
37175
37200
  const id = cleanId(rawId);
37176
- if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id)) {
37201
+ if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualSiteComponentAssets.has(id)) {
37177
37202
  return id;
37178
37203
  }
37179
37204
  return null;
@@ -37192,6 +37217,10 @@ var moduleBundleBuildBrowser = ({
37192
37217
  if (customElementPanelComponent) {
37193
37218
  return getCustomElementPanelBuildTemplate(customElementPanelComponent);
37194
37219
  }
37220
+ const siteComponent = virtualSiteComponentAssets.get(id);
37221
+ if (siteComponent) {
37222
+ return getSiteComponentBuildTemplate(siteComponent);
37223
+ }
37195
37224
  return null;
37196
37225
  }
37197
37226
  };
@@ -38853,12 +38882,15 @@ function webMethodsPlugin({
38853
38882
  }
38854
38883
  await init;
38855
38884
  const [, exports] = parse(code);
38885
+ const pathToFile = normalizeGlobbyPattern(
38886
+ path6.relative(projectFolder, url)
38887
+ );
38856
38888
  const mappedExports = exports.map(
38857
38889
  ({ ln: method }) => defaultOutdent`
38858
38890
  export const ${method} = async (...args) => {
38859
38891
  return await callWebMethod({
38860
38892
  args,
38861
- filename: '${path6.relative(projectFolder, url)}',
38893
+ filename: '${pathToFile}',
38862
38894
  method: '${method}',
38863
38895
  baseURL: __webMethodsBaseUrl,
38864
38896
  });
@@ -38905,6 +38937,78 @@ function hashHtmlFiles() {
38905
38937
  };
38906
38938
  }
38907
38939
 
38940
+ // src/vite/plugins/exports-custodian.ts
38941
+ init_esm_shims();
38942
+ var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
38943
+ var exportsCustodian = ({
38944
+ initialModel,
38945
+ type,
38946
+ projectModelWatcher
38947
+ }) => {
38948
+ let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
38949
+ let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
38950
+ let virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
38951
+ return {
38952
+ name: "wix:exports-custodian",
38953
+ resolveId(id) {
38954
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
38955
+ return id;
38956
+ }
38957
+ return null;
38958
+ },
38959
+ configureServer(server) {
38960
+ if (type === "dev" /* dev */) {
38961
+ projectModelWatcher.onChange((model) => {
38962
+ virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(model);
38963
+ for (const scriptId of virtualBlocksWidgetAssets.keys()) {
38964
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38965
+ if (moduleBundle) {
38966
+ server.moduleGraph.invalidateModule(moduleBundle);
38967
+ }
38968
+ }
38969
+ virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(model);
38970
+ for (const scriptId of virtualBlocksWidgetPanelAssets.keys()) {
38971
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38972
+ if (moduleBundle) {
38973
+ server.moduleGraph.invalidateModule(moduleBundle);
38974
+ }
38975
+ }
38976
+ virtualSiteComponentAssets = virtualSiteComponentScriptAssets(model);
38977
+ for (const scriptId of virtualSiteComponentAssets.keys()) {
38978
+ const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38979
+ if (moduleBundle) {
38980
+ server.moduleGraph.invalidateModule(moduleBundle);
38981
+ }
38982
+ }
38983
+ });
38984
+ }
38985
+ },
38986
+ load(id) {
38987
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
38988
+ return [
38989
+ ...Array.from(virtualBlocksWidgetAssets.keys()).map(
38990
+ (path9, index) => `
38991
+ import { init as init${index}, api as api${index} } from '${path9}';
38992
+ init${index}();
38993
+ api${index}();
38994
+ `
38995
+ ),
38996
+ ...Array.from(virtualBlocksWidgetPanelAssets.keys()).map(
38997
+ (path9, index) => `
38998
+ import { init as initPanel${index} } from '${path9}';
38999
+ initPanel${index}();
39000
+ `
39001
+ ),
39002
+ ...Array.from(virtualSiteComponentAssets.keys()).map(
39003
+ (path9) => `import('${path9}');`
39004
+ )
39005
+ ].join("\n");
39006
+ }
39007
+ return null;
39008
+ }
39009
+ };
39010
+ };
39011
+
38908
39012
  // src/vite/configs/build-command/browser.ts
38909
39013
  async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38910
39014
  const virtualDashboardHTMLEntries = [
@@ -38920,6 +39024,9 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38920
39024
  const virtualCustomElementScriptEntries = [
38921
39025
  ...virtualCustomElementScriptAssets(model)
38922
39026
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39027
+ const virtualSiteComponentScriptEntries = [
39028
+ ...virtualSiteComponentScriptAssets(model)
39029
+ ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
38923
39030
  const { monitoring } = model.config;
38924
39031
  const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
38925
39032
  appId: model.config.appId,
@@ -38947,7 +39054,8 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38947
39054
  SITE_WIDGETS_ELEMENT_PATTERN,
38948
39055
  SITE_WIDGETS_PANEL_PATTERN,
38949
39056
  SITE_PLUGINS_PLUGIN_PATTERN,
38950
- SITE_PLUGINS_PANEL_PATTERN
39057
+ SITE_PLUGINS_PANEL_PATTERN,
39058
+ SITE_COMPONENTS_PATTERN
38951
39059
  ]
38952
39060
  },
38953
39061
  server: {},
@@ -38961,8 +39069,10 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
38961
39069
  ...virtualDashboardScriptEntries,
38962
39070
  ...embeddedScriptEntries,
38963
39071
  ...virtualCustomElementHTMLEntries,
38964
- ...virtualCustomElementScriptEntries
38965
- ])
39072
+ ...virtualCustomElementScriptEntries,
39073
+ ...virtualSiteComponentScriptEntries
39074
+ ]),
39075
+ ...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
38966
39076
  },
38967
39077
  output: {
38968
39078
  assetFileNames: "assets/[name].ch.[hash][extname]",
@@ -39004,6 +39114,10 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
39004
39114
  initialModel: model,
39005
39115
  ...options
39006
39116
  }),
39117
+ exportsCustodian({
39118
+ initialModel: model,
39119
+ ...options
39120
+ }),
39007
39121
  configExtensionsFileEmitter(model),
39008
39122
  ...monitoringPlugins ?? [],
39009
39123
  src_default({
@@ -39047,69 +39161,6 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
39047
39161
  // src/vite/configs/build-command/worker.ts
39048
39162
  init_esm_shims();
39049
39163
  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
39164
  async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
39114
39165
  const virtualBlocksScriptEntries = [
39115
39166
  ...virtualBlocksWidgetScriptAssets(model),
@@ -39412,6 +39463,9 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39412
39463
  ...virtualBlocksWidgetScriptAssets(model),
39413
39464
  ...virtualBlocksWidgetPanelScriptAssets(model)
39414
39465
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39466
+ const virtualSiteComponentScriptEntries = [
39467
+ ...virtualSiteComponentScriptAssets(model)
39468
+ ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
39415
39469
  const { monitoring } = model.config;
39416
39470
  const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime4.getMonitoringVitePlugins)({
39417
39471
  appId: model.config.appId,
@@ -39440,7 +39494,8 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39440
39494
  SITE_PLUGINS_PLUGIN_PATTERN,
39441
39495
  SITE_PLUGINS_PANEL_PATTERN,
39442
39496
  BLOCKS_WIDGETS_PATTERN,
39443
- BLOCKS_WIDGETS_PANELS_PATTERN
39497
+ BLOCKS_WIDGETS_PANELS_PATTERN,
39498
+ SITE_COMPONENTS_PATTERN
39444
39499
  ]
39445
39500
  },
39446
39501
  server: {},
@@ -39455,7 +39510,8 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
39455
39510
  ...embeddedScriptEntries,
39456
39511
  ...virtualCustomElementHTMLEntries,
39457
39512
  ...virtualCustomElementScriptEntries,
39458
- ...virtualBlocksScriptEntries
39513
+ ...virtualBlocksScriptEntries,
39514
+ ...virtualSiteComponentScriptEntries
39459
39515
  ]),
39460
39516
  ...virtualBlocksScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
39461
39517
  },
@@ -39629,6 +39685,11 @@ var validateComponents = (components) => {
39629
39685
  name: marketData.name,
39630
39686
  type: "site-plugin",
39631
39687
  path: replaceExtension(relativePath, "json")
39688
+ }),
39689
+ SiteComponent: ({ relativePath }) => ({
39690
+ name: relativePath,
39691
+ type: "site-component",
39692
+ path: replaceExtension(relativePath, "json")
39632
39693
  })
39633
39694
  })
39634
39695
  ).sort((a, b) => a.name.localeCompare(b.name)),
@@ -40067,6 +40128,20 @@ async function createAppManifest({
40067
40128
  }
40068
40129
  }
40069
40130
  };
40131
+ },
40132
+ SiteComponent: async (component) => {
40133
+ return {
40134
+ compId: component.id,
40135
+ compType: ComponentType.EDITOR_REACT_COMPONENT,
40136
+ compData: {
40137
+ editorReactComponent: {
40138
+ type: `platform.builder.${appId}_${component.id}`,
40139
+ description: component.description,
40140
+ editorElement: component.editorElement,
40141
+ resources: { ...await componentSourceBuilder(component) }
40142
+ }
40143
+ }
40144
+ };
40070
40145
  }
40071
40146
  })
40072
40147
  )
@@ -40117,18 +40192,24 @@ function extractBundleAssetFileName(buildOutput, fileName) {
40117
40192
  }
40118
40193
  return output.fileName;
40119
40194
  }
40120
- function extractModuleBundleName(buildOutput, moduleId) {
40195
+ function extractModuleBundleChunk(buildOutput, moduleId) {
40121
40196
  const outputs = extractBuildOutputs(buildOutput);
40122
- const output = outputs.find(
40123
- (output2) => output2.type === "chunk" && output2.facadeModuleId === moduleId
40124
- );
40197
+ const output = outputs.filter((output2) => output2.type === "chunk").find((output2) => output2.facadeModuleId === moduleId);
40125
40198
  if (!output) {
40126
40199
  throw new CliError({
40127
40200
  code: CliErrorCode.ViteModuleBundleNotFound(),
40128
40201
  cause: null
40129
40202
  });
40130
40203
  }
40131
- return output.fileName;
40204
+ return output;
40205
+ }
40206
+ function extractModuleBundleName(buildOutput, moduleId) {
40207
+ return extractModuleBundleChunk(buildOutput, moduleId).fileName;
40208
+ }
40209
+ function extractModuleBundleCss(buildOutput, moduleId) {
40210
+ const output = extractModuleBundleChunk(buildOutput, moduleId);
40211
+ const importedCss = output.viteMetadata?.importedCss;
40212
+ return importedCss?.values().next().value;
40132
40213
  }
40133
40214
  function extractModuleBundleContent(buildOutput, fileName) {
40134
40215
  const output = extractAssetOutput(buildOutput, fileName);
@@ -40300,6 +40381,34 @@ var blocksPanelBuilder = (component, source) => {
40300
40381
  componentUrl
40301
40382
  };
40302
40383
  };
40384
+ var siteComponentBuilder = (component, source) => {
40385
+ const moduleId = virtualModuleIdForSiteComponentScriptAsset(component.id);
40386
+ if (source.buildSource == null) {
40387
+ return {
40388
+ client: {
40389
+ componentUrl: `/@id/${moduleId}?import`
40390
+ },
40391
+ server: {
40392
+ url: ""
40393
+ }
40394
+ };
40395
+ }
40396
+ return {
40397
+ client: {
40398
+ componentUrl: extractModuleBundleName(
40399
+ source.buildSource.browserBuildOutput,
40400
+ moduleId
40401
+ ),
40402
+ cssUrl: extractModuleBundleCss(
40403
+ source.buildSource.browserBuildOutput,
40404
+ moduleId
40405
+ )
40406
+ },
40407
+ server: {
40408
+ url: "https://wix.com/"
40409
+ }
40410
+ };
40411
+ };
40303
40412
  function getComponentDevSourceBuilder(model, devSource, backendSource) {
40304
40413
  return async (component) => {
40305
40414
  const source = (0, import_variant6.match)(component, {
@@ -40326,7 +40435,8 @@ function getComponentDevSourceBuilder(model, devSource, backendSource) {
40326
40435
  Event: (component2) => eventSourceBuilder(component2, model, backendSource),
40327
40436
  ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
40328
40437
  Monitoring: () => {
40329
- }
40438
+ },
40439
+ SiteComponent: (component2) => siteComponentBuilder(component2, { devSource })
40330
40440
  });
40331
40441
  return source;
40332
40442
  };
@@ -40373,7 +40483,10 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
40373
40483
  Event: (component2) => eventSourceBuilder(component2, model, backendSource),
40374
40484
  ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
40375
40485
  Monitoring: () => {
40376
- }
40486
+ },
40487
+ SiteComponent: (component2) => siteComponentBuilder(component2, {
40488
+ buildSource: browserBuildSource
40489
+ })
40377
40490
  });
40378
40491
  return source;
40379
40492
  };
@@ -40838,6 +40951,28 @@ var monitoringSchema = z.object({
40838
40951
  ])
40839
40952
  })
40840
40953
  });
40954
+ var siteComponentSourceSchema = z.object({
40955
+ client: z.object({
40956
+ componentUrl: z.string(),
40957
+ cssUrl: z.string().optional()
40958
+ }),
40959
+ server: z.object({
40960
+ url: z.string()
40961
+ })
40962
+ });
40963
+ var siteComponentSchema = z.object({
40964
+ compType: z.literal(ComponentType.EDITOR_REACT_COMPONENT),
40965
+ compId: z.string(),
40966
+ compName: z.string().optional(),
40967
+ compData: z.object({
40968
+ editorReactComponent: z.object({
40969
+ type: z.string().min(5),
40970
+ description: z.string().min(5),
40971
+ resources: siteComponentSourceSchema,
40972
+ editorElement: z.unknown()
40973
+ })
40974
+ })
40975
+ });
40841
40976
  var componentSchema = z.discriminatedUnion("compType", [
40842
40977
  backofficePageSchema,
40843
40978
  backofficeExtensionSchema,
@@ -40862,7 +40997,8 @@ var componentSchema = z.discriminatedUnion("compType", [
40862
40997
  ecomPaymentSettingsSchema,
40863
40998
  ecomGiftCardsProviderSchema,
40864
40999
  topologySchema,
40865
- monitoringSchema
41000
+ monitoringSchema,
41001
+ siteComponentSchema
40866
41002
  ]);
40867
41003
  var appManifestSchema = z.object({
40868
41004
  appId: z.string(),
@@ -41015,6 +41151,29 @@ var updateBrowserComponentsWithBaseUrl = (appManifest, baseUrl) => {
41015
41151
  )
41016
41152
  };
41017
41153
  }
41154
+ if (compType === ComponentType.EDITOR_REACT_COMPONENT) {
41155
+ compData.editorReactComponent = {
41156
+ ...compData.editorReactComponent,
41157
+ resources: {
41158
+ client: {
41159
+ componentUrl: normalizeUrl(
41160
+ compData.editorReactComponent.resources.client.componentUrl,
41161
+ normalizedBaseUrl
41162
+ ),
41163
+ cssUrl: compData.editorReactComponent.resources.client.cssUrl && normalizeUrl(
41164
+ compData.editorReactComponent.resources.client.cssUrl,
41165
+ normalizedBaseUrl
41166
+ )
41167
+ },
41168
+ server: {
41169
+ url: normalizeUrl(
41170
+ compData.editorReactComponent.resources.server.url,
41171
+ normalizedBaseUrl
41172
+ )
41173
+ }
41174
+ }
41175
+ };
41176
+ }
41018
41177
  }
41019
41178
  return clonedManifest;
41020
41179
  };
@@ -41240,10 +41399,8 @@ export {
41240
41399
  getViteConfig2 as getViteConfig3,
41241
41400
  getViteConfig3 as getViteConfig4,
41242
41401
  readAppManifest,
41243
- updateBrowserComponentsWithBaseUrl,
41244
41402
  updateMonitoring,
41245
41403
  updateTopology,
41246
- updateBlocksComponents,
41247
41404
  updateAppManifestComponents,
41248
41405
  validateComponents,
41249
41406
  createCustomElementConfig,
@@ -41256,4 +41413,4 @@ export {
41256
41413
  he/he.js:
41257
41414
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
41258
41415
  */
41259
- //# sourceMappingURL=chunk-PGKXOCZN.js.map
41416
+ //# sourceMappingURL=chunk-SIJDKP2Q.js.map