@wix/cli-app 1.1.127 → 1.1.129

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 (69) hide show
  1. package/build/{AddPermissionCommand-JFRWIRZI.js → AddPermissionCommand-SWMX36RL.js} +2 -2
  2. package/build/{DevCommand-3PRNRUFO.js → DevCommand-WT3TK4N7.js} +10 -10
  3. package/build/{GenerateCommand-NKNV35NN.js → GenerateCommand-X3CVLXLM.js} +7 -7
  4. package/build/{LogsCommand-BIPYLEUC.js → LogsCommand-B6ZWCUVZ.js} +3 -3
  5. package/build/PreviewCommand-G7RZZRA5.js +19 -0
  6. package/build/ReleaseCommand-MHJQ6PC5.js +23 -0
  7. package/build/{ServeCommand-DUKZODY6.js → ServeCommand-7YN4VIKD.js} +3 -3
  8. package/build/{build-FG6B7OQH.js → build-5Z4UY34D.js} +24 -7
  9. package/build/build-5Z4UY34D.js.map +1 -0
  10. package/build/{chunk-4KUHW5B7.js → chunk-3FY2AOJE.js} +2 -2
  11. package/build/{chunk-C73XJ57U.js → chunk-6XLUQZ5F.js} +2 -2
  12. package/build/{chunk-ROHDWZI4.js → chunk-6Z3URTTC.js} +3 -3
  13. package/build/{chunk-4SRMFEJA.js → chunk-CN5TC5DV.js} +2 -2
  14. package/build/{chunk-EXDWGPUM.js → chunk-E5RQWCTJ.js} +6 -6
  15. package/build/{chunk-6OIVUPHF.js → chunk-EDDVKT7T.js} +6 -6
  16. package/build/{chunk-6EOYAASV.js → chunk-FJ7TH3XD.js} +4 -4
  17. package/build/{chunk-C75VAILG.js → chunk-G4S5FTS3.js} +2 -2
  18. package/build/{chunk-4EAHNYEH.js → chunk-HV62P45K.js} +2 -2
  19. package/build/{chunk-T3EBYWJV.js → chunk-M432FMZZ.js} +45 -2
  20. package/build/chunk-M432FMZZ.js.map +1 -0
  21. package/build/{chunk-LC6RJKUL.js → chunk-MXW7RVZQ.js} +2 -2
  22. package/build/{chunk-XPNO6MSO.js → chunk-MYW44QQC.js} +7 -7
  23. package/build/{chunk-XPNO6MSO.js.map → chunk-MYW44QQC.js.map} +1 -1
  24. package/build/{chunk-C55WMKMJ.js → chunk-URLY2YGI.js} +22 -4
  25. package/build/{chunk-C55WMKMJ.js.map → chunk-URLY2YGI.js.map} +1 -1
  26. package/build/{chunk-TCBGU4X6.js → chunk-VUTYEP7L.js} +4 -4
  27. package/build/{chunk-U5ROEYJA.js → chunk-VY54JSUP.js} +2 -2
  28. package/build/{chunk-F3FIVJZD.js → chunk-Y7QMQO2O.js} +2 -2
  29. package/build/{chunk-UNCNFFF6.js → chunk-YN6G2AVC.js} +160 -60
  30. package/build/chunk-YN6G2AVC.js.map +1 -0
  31. package/build/index.js +23 -23
  32. package/build/platform-sdk/dashboard.js +1 -1
  33. package/build/platform-sdk/dashboard.js.map +1 -1
  34. package/build/platform-sdk/editor.js +1 -1
  35. package/build/platform-sdk/editor.js.map +1 -1
  36. package/build/platform-sdk/site.js +1 -1
  37. package/build/platform-sdk/site.js.map +1 -1
  38. package/build/{preview-QT6BIZNI.js → preview-2FJE66R2.js} +12 -12
  39. package/build/{release-7ITKDBFT.js → release-YTUA7L5B.js} +14 -14
  40. package/build/{render-command-XRP2XSWT.js → render-command-2PXTOG5R.js} +5 -5
  41. package/package.json +4 -4
  42. package/build/PreviewCommand-FWV6LIFS.js +0 -19
  43. package/build/ReleaseCommand-ZG5W6RG4.js +0 -23
  44. package/build/build-FG6B7OQH.js.map +0 -1
  45. package/build/chunk-T3EBYWJV.js.map +0 -1
  46. package/build/chunk-UNCNFFF6.js.map +0 -1
  47. /package/build/{AddPermissionCommand-JFRWIRZI.js.map → AddPermissionCommand-SWMX36RL.js.map} +0 -0
  48. /package/build/{DevCommand-3PRNRUFO.js.map → DevCommand-WT3TK4N7.js.map} +0 -0
  49. /package/build/{GenerateCommand-NKNV35NN.js.map → GenerateCommand-X3CVLXLM.js.map} +0 -0
  50. /package/build/{LogsCommand-BIPYLEUC.js.map → LogsCommand-B6ZWCUVZ.js.map} +0 -0
  51. /package/build/{PreviewCommand-FWV6LIFS.js.map → PreviewCommand-G7RZZRA5.js.map} +0 -0
  52. /package/build/{ReleaseCommand-ZG5W6RG4.js.map → ReleaseCommand-MHJQ6PC5.js.map} +0 -0
  53. /package/build/{ServeCommand-DUKZODY6.js.map → ServeCommand-7YN4VIKD.js.map} +0 -0
  54. /package/build/{chunk-4KUHW5B7.js.map → chunk-3FY2AOJE.js.map} +0 -0
  55. /package/build/{chunk-C73XJ57U.js.map → chunk-6XLUQZ5F.js.map} +0 -0
  56. /package/build/{chunk-ROHDWZI4.js.map → chunk-6Z3URTTC.js.map} +0 -0
  57. /package/build/{chunk-4SRMFEJA.js.map → chunk-CN5TC5DV.js.map} +0 -0
  58. /package/build/{chunk-EXDWGPUM.js.map → chunk-E5RQWCTJ.js.map} +0 -0
  59. /package/build/{chunk-6OIVUPHF.js.map → chunk-EDDVKT7T.js.map} +0 -0
  60. /package/build/{chunk-6EOYAASV.js.map → chunk-FJ7TH3XD.js.map} +0 -0
  61. /package/build/{chunk-C75VAILG.js.map → chunk-G4S5FTS3.js.map} +0 -0
  62. /package/build/{chunk-4EAHNYEH.js.map → chunk-HV62P45K.js.map} +0 -0
  63. /package/build/{chunk-LC6RJKUL.js.map → chunk-MXW7RVZQ.js.map} +0 -0
  64. /package/build/{chunk-TCBGU4X6.js.map → chunk-VUTYEP7L.js.map} +0 -0
  65. /package/build/{chunk-U5ROEYJA.js.map → chunk-VY54JSUP.js.map} +0 -0
  66. /package/build/{chunk-F3FIVJZD.js.map → chunk-Y7QMQO2O.js.map} +0 -0
  67. /package/build/{preview-QT6BIZNI.js.map → preview-2FJE66R2.js.map} +0 -0
  68. /package/build/{release-7ITKDBFT.js.map → release-YTUA7L5B.js.map} +0 -0
  69. /package/build/{render-command-XRP2XSWT.js.map → render-command-2PXTOG5R.js.map} +0 -0
@@ -2,13 +2,13 @@ import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  addUserFields
5
- } from "./chunk-LC6RJKUL.js";
5
+ } from "./chunk-MXW7RVZQ.js";
6
6
  import {
7
7
  messages_default
8
8
  } from "./chunk-ZHQREOZP.js";
9
9
  import {
10
10
  DebugLogProvider
11
- } from "./chunk-4SRMFEJA.js";
11
+ } from "./chunk-CN5TC5DV.js";
12
12
  import {
13
13
  AccountAuthProvider,
14
14
  BiProvider,
@@ -22,7 +22,7 @@ import {
22
22
  getDebugLogFilePath,
23
23
  isLoggedInToAccount,
24
24
  require_react
25
- } from "./chunk-C55WMKMJ.js";
25
+ } from "./chunk-URLY2YGI.js";
26
26
  import {
27
27
  __toESM,
28
28
  init_esm_shims
@@ -64,4 +64,4 @@ export {
64
64
  log,
65
65
  executeCommand
66
66
  };
67
- //# sourceMappingURL=chunk-TCBGU4X6.js.map
67
+ //# sourceMappingURL=chunk-VUTYEP7L.js.map
@@ -10,7 +10,7 @@ import {
10
10
  require_lib,
11
11
  require_react,
12
12
  useTranslation
13
- } from "./chunk-C55WMKMJ.js";
13
+ } from "./chunk-URLY2YGI.js";
14
14
  import {
15
15
  __toESM,
16
16
  init_esm_shims
@@ -179,4 +179,4 @@ export {
179
179
  docsExtensionTypeSchema,
180
180
  getGenerateFlowByDocsExtensionType
181
181
  };
182
- //# sourceMappingURL=chunk-U5ROEYJA.js.map
182
+ //# sourceMappingURL=chunk-VY54JSUP.js.map
@@ -4,7 +4,7 @@ import {
4
4
  require_react,
5
5
  useBiLogger,
6
6
  wixCliAppBiEvents
7
- } from "./chunk-C55WMKMJ.js";
7
+ } from "./chunk-URLY2YGI.js";
8
8
  import {
9
9
  __toESM,
10
10
  init_esm_shims
@@ -24,4 +24,4 @@ init_esm_shims();
24
24
  export {
25
25
  useWixCliAppBi
26
26
  };
27
- //# sourceMappingURL=chunk-F3FIVJZD.js.map
27
+ //# sourceMappingURL=chunk-Y7QMQO2O.js.map
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  getBackendEventSlug,
5
5
  require_baseUniq
6
- } from "./chunk-T3EBYWJV.js";
6
+ } from "./chunk-M432FMZZ.js";
7
7
  import {
8
8
  API_BASEURL_PLACEHOLDER,
9
9
  AlgorithmType,
@@ -37,6 +37,7 @@ import {
37
37
  RELATIVE_ASSET_PATH_REGEX,
38
38
  RegionType,
39
39
  SERVICE_PLUGINS_PATTERN,
40
+ SITE_COMPONENTS_CLIENT_STATICS_FOLDER,
40
41
  SITE_COMPONENTS_PANEL_PATTERN,
41
42
  SITE_COMPONENTS_PATTERN,
42
43
  SITE_COMPONENTS_PRESETS_PATTERN,
@@ -92,7 +93,7 @@ import {
92
93
  virtualSiteComponentPreviewScriptAssets,
93
94
  virtualSiteComponentScriptAssets,
94
95
  virtualSiteComponentSdkScriptAssets
95
- } from "./chunk-C55WMKMJ.js";
96
+ } from "./chunk-URLY2YGI.js";
96
97
  import {
97
98
  __commonJS,
98
99
  __esm,
@@ -38841,7 +38842,6 @@ var moduleBundleBuildBrowser = ({
38841
38842
  const virtualDashboardAssets = virtualDashboardScriptAssets(initialModel);
38842
38843
  const virtualCustomElementAssets = virtualCustomElementScriptAssets(initialModel);
38843
38844
  const virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
38844
- const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
38845
38845
  const virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(initialModel);
38846
38846
  const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
38847
38847
  const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
@@ -38850,7 +38850,7 @@ var moduleBundleBuildBrowser = ({
38850
38850
  apply: "build",
38851
38851
  resolveId(rawId) {
38852
38852
  const id = cleanId(rawId);
38853
- if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualSiteComponentAssets.has(id) || virtualSiteComponentSdkAssets.has(id) || virtualSiteComponentPreviewAssets.has(id) || virtualSiteComponentPanelAssets.has(id)) {
38853
+ if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualSiteComponentSdkAssets.has(id) || virtualSiteComponentPreviewAssets.has(id) || virtualSiteComponentPanelAssets.has(id)) {
38854
38854
  return id;
38855
38855
  }
38856
38856
  return null;
@@ -38869,21 +38869,10 @@ var moduleBundleBuildBrowser = ({
38869
38869
  if (customElementPanelComponent) {
38870
38870
  return getCustomElementPanelBuildTemplate(customElementPanelComponent);
38871
38871
  }
38872
- const siteComponent = virtualSiteComponentAssets.get(id);
38873
- if (siteComponent) {
38874
- return getSiteComponentBuildTemplate(appId, siteComponent);
38875
- }
38876
38872
  const siteSdkComponent = virtualSiteComponentSdkAssets.get(id);
38877
38873
  if (siteSdkComponent) {
38878
38874
  return getSiteComponentSdkBuildTemplate(siteSdkComponent);
38879
38875
  }
38880
- const siteComponentPreview = virtualSiteComponentPreviewAssets.get(id);
38881
- if (siteComponentPreview) {
38882
- return getSiteComponentPreviewBuildTemplate(
38883
- appId,
38884
- siteComponentPreview
38885
- );
38886
- }
38887
38876
  const siteComponentPanel = virtualSiteComponentPanelAssets.get(id);
38888
38877
  if (siteComponentPanel) {
38889
38878
  return getSiteComponentPanelBuildTemplate(siteComponentPanel);
@@ -38892,7 +38881,7 @@ var moduleBundleBuildBrowser = ({
38892
38881
  }
38893
38882
  };
38894
38883
  };
38895
- var moduleBundleBuildWorker = ({
38884
+ var moduleBundleBuildBlocks = ({
38896
38885
  initialModel
38897
38886
  }) => {
38898
38887
  const virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
@@ -38921,14 +38910,14 @@ var moduleBundleBuildWorker = ({
38921
38910
  }
38922
38911
  };
38923
38912
  };
38924
- var moduleBundleBuildSsr = ({
38913
+ var moduleBundleBuildSiteComponents = ({
38925
38914
  initialModel
38926
38915
  }) => {
38927
38916
  const { appId } = initialModel.config;
38928
38917
  const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
38929
38918
  const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
38930
38919
  return {
38931
- name: "wix:module-bundle-build-ssr",
38920
+ name: "wix:module-bundle-build-site-components",
38932
38921
  apply: "build",
38933
38922
  resolveId(rawId) {
38934
38923
  const id = cleanId(rawId);
@@ -39992,8 +39981,11 @@ var updateBlocksComponents = (manifest, blocksComponents) => {
39992
39981
  }
39993
39982
  return { ...manifest, components: updatedExtensions };
39994
39983
  };
39995
- var BASE_URL_PLACEHOLDER = "https://__BASE_URL_PLACEHOLDER__/";
39996
- var generateUrl = (path9) => `${BASE_URL_PLACEHOLDER}${path9.startsWith("/") ? path9.substring(1) : path9}`;
39984
+ var BASE_URL_PLACEHOLDER = "https://__base_url_placeholder__/";
39985
+ var generateUrl = (path9) => {
39986
+ const url = new URL(path9, BASE_URL_PLACEHOLDER);
39987
+ return url.toString();
39988
+ };
39997
39989
  var updateAppManifestComponents = ({
39998
39990
  manifest,
39999
39991
  backendServerUrl,
@@ -40025,7 +40017,7 @@ function getEmbeddedScriptEntries(model) {
40025
40017
  return new Set(entries);
40026
40018
  }
40027
40019
  function getEmbeddedScriptHtmlUrl(filename) {
40028
- return `${BASE_URL_PLACEHOLDER}${filename}`;
40020
+ return generateUrl(filename);
40029
40021
  }
40030
40022
  function embeddedScriptSDKSupport(options) {
40031
40023
  const { initialModel, type } = options;
@@ -40322,12 +40314,34 @@ function hashHtmlFiles() {
40322
40314
  // src/vite/plugins/exports-custodian.ts
40323
40315
  init_esm_shims();
40324
40316
  var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
40325
- var exportsCustodian = ({ initialModel }) => {
40317
+ var preserveSiteComponentPanelsExports = ({
40318
+ initialModel
40319
+ }) => {
40320
+ const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
40321
+ return {
40322
+ name: "wix:site-components:preserve-exports-panels",
40323
+ apply: "build",
40324
+ resolveId(id) {
40325
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
40326
+ return id;
40327
+ }
40328
+ return null;
40329
+ },
40330
+ load(id) {
40331
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
40332
+ return [...virtualSiteComponentPanelAssets.keys()].map((path9) => `import('${path9}');`).join("\n");
40333
+ }
40334
+ return null;
40335
+ }
40336
+ };
40337
+ };
40338
+ var preserveSiteComponentComponentsExports = ({
40339
+ initialModel
40340
+ }) => {
40326
40341
  const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
40327
40342
  const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
40328
- const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
40329
40343
  return {
40330
- name: "wix:exports-custodian",
40344
+ name: "wix:site-components:preserve-exports-components",
40331
40345
  apply: "build",
40332
40346
  resolveId(id) {
40333
40347
  if (id === EXPORTS_CUSTODIAN_ENTRY) {
@@ -40338,9 +40352,8 @@ var exportsCustodian = ({ initialModel }) => {
40338
40352
  load(id) {
40339
40353
  if (id === EXPORTS_CUSTODIAN_ENTRY) {
40340
40354
  return [
40341
- ...virtualSiteComponentAssets.keys(),
40342
40355
  ...virtualSiteComponentPreviewAssets.keys(),
40343
- ...virtualSiteComponentPanelAssets.keys()
40356
+ ...virtualSiteComponentAssets.keys()
40344
40357
  ].map((path9) => `import('${path9}');`).join("\n");
40345
40358
  }
40346
40359
  return null;
@@ -40351,6 +40364,7 @@ var exportsCustodian = ({ initialModel }) => {
40351
40364
  // src/vite/configs/build-command/base.ts
40352
40365
  init_esm_shims();
40353
40366
  import { join as join6 } from "node:path";
40367
+ import { normalizePath as normalizePath2 } from "vite";
40354
40368
 
40355
40369
  // src/vite/plugins/web-methods-plugin.ts
40356
40370
  init_esm_shims();
@@ -40507,9 +40521,15 @@ function getBaseViteConfig({ model, outputDir, customLogger }) {
40507
40521
  emptyOutDir: false,
40508
40522
  rollupOptions: {
40509
40523
  output: {
40510
- assetFileNames: join6(outputDir, "assets/[name].ch.[hash][extname]"),
40511
- chunkFileNames: join6(outputDir, "assets/[name].ch.[hash].js"),
40512
- entryFileNames: join6(outputDir, "assets/[name].ch.[hash].js")
40524
+ assetFileNames: normalizePath2(
40525
+ join6(outputDir, "assets/[name].ch.[hash][extname]")
40526
+ ),
40527
+ chunkFileNames: normalizePath2(
40528
+ join6(outputDir, "assets/[name].ch.[hash].js")
40529
+ ),
40530
+ entryFileNames: normalizePath2(
40531
+ join6(outputDir, "assets/[name].ch.[hash].js")
40532
+ )
40513
40533
  }
40514
40534
  }
40515
40535
  },
@@ -40548,21 +40568,12 @@ function getViteConfig2(model, options) {
40548
40568
  const virtualCustomElementScriptEntries = [
40549
40569
  ...virtualCustomElementScriptAssets(model)
40550
40570
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
40551
- const virtualSiteComponentScriptEntries = [
40552
- ...virtualSiteComponentScriptAssets(model)
40553
- ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
40554
40571
  const virtualSiteComponentSdkScriptEntries = [
40555
40572
  ...virtualSiteComponentSdkScriptAssets(model)
40556
40573
  ].map(([assetId, component]) => [
40557
40574
  `script-asset-${component.id}-sdk`,
40558
40575
  assetId
40559
40576
  ]);
40560
- const virtualSiteComponentPreviewScriptEntries = [
40561
- ...virtualSiteComponentPreviewScriptAssets(model)
40562
- ].map(([assetId, component]) => [
40563
- `script-asset-${component.id}-preview`,
40564
- assetId
40565
- ]);
40566
40577
  const virtualSiteComponentPanelScriptEntries = [
40567
40578
  ...virtualSiteComponentPanelScriptAssets(model)
40568
40579
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
@@ -40577,7 +40588,6 @@ function getViteConfig2(model, options) {
40577
40588
  const config = {
40578
40589
  build: {
40579
40590
  rollupOptions: {
40580
- external: ["@wix/services-manager-react"],
40581
40591
  /*
40582
40592
  * We need to preserve names of exports from our root modules for convention.
40583
40593
  * "strict" or "exports-only" will not work because it will create separated files with exports.
@@ -40591,13 +40601,11 @@ function getViteConfig2(model, options) {
40591
40601
  ...embeddedScriptEntries,
40592
40602
  ...virtualCustomElementHTMLEntries,
40593
40603
  ...virtualCustomElementScriptEntries,
40594
- ...virtualSiteComponentScriptEntries,
40595
40604
  ...virtualSiteComponentSdkScriptEntries,
40596
- ...virtualSiteComponentPreviewScriptEntries,
40597
40605
  ...virtualSiteComponentPanelScriptEntries,
40598
40606
  ...virtualSiteComponentPresetEntries
40599
40607
  ]),
40600
- ...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
40608
+ ...virtualSiteComponentPanelScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
40601
40609
  }
40602
40610
  }
40603
40611
  },
@@ -40621,7 +40629,7 @@ function getViteConfig2(model, options) {
40621
40629
  initialModel: model,
40622
40630
  ...options
40623
40631
  }),
40624
- exportsCustodian({ initialModel: model }),
40632
+ preserveSiteComponentPanelsExports({ initialModel: model }),
40625
40633
  configExtensionsFileEmitter(model)
40626
40634
  ],
40627
40635
  experimental: {
@@ -40688,15 +40696,100 @@ function getViteConfig3(model, options) {
40688
40696
  }
40689
40697
  }
40690
40698
  },
40691
- plugins: [moduleBundleBuildWorker({ initialModel: model })]
40699
+ plugins: [moduleBundleBuildBlocks({ initialModel: model })]
40692
40700
  };
40693
40701
  return mergeConfig2(config, baseConfig);
40694
40702
  }
40695
40703
 
40696
- // src/vite/configs/build-command/site-components-server.ts
40704
+ // src/vite/configs/build-command/site-components-client.ts
40697
40705
  init_esm_shims();
40698
40706
  import { mergeConfig as mergeConfig3 } from "vite";
40707
+
40708
+ // src/vite/configs/shared.ts
40709
+ init_esm_shims();
40710
+ var siteComponentsExternals = [
40711
+ "react",
40712
+ "react/jsx-runtime",
40713
+ "react/jsx-dev-runtime",
40714
+ "react-dom",
40715
+ "@wix/services-manager-react"
40716
+ ];
40717
+
40718
+ // src/vite/configs/build-command/site-components-client.ts
40699
40719
  function getViteConfig4(model, options) {
40720
+ const virtualSiteComponentScriptEntries = [
40721
+ ...virtualSiteComponentScriptAssets(model)
40722
+ ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
40723
+ const virtualSiteComponentPreviewScriptEntries = [
40724
+ ...virtualSiteComponentPreviewScriptAssets(model)
40725
+ ].map(([assetId, component]) => [
40726
+ `script-asset-${component.id}-preview`,
40727
+ assetId
40728
+ ]);
40729
+ const baseConfig = getBaseViteConfig({
40730
+ ...options,
40731
+ model,
40732
+ outputDir: SITE_COMPONENTS_CLIENT_STATICS_FOLDER
40733
+ });
40734
+ const config = {
40735
+ build: {
40736
+ rollupOptions: {
40737
+ external: siteComponentsExternals,
40738
+ /*
40739
+ * We need to preserve names of exports from our root modules for convention.
40740
+ * "strict" or "exports-only" will not work because it will create separated files with exports.
40741
+ * It will break our naive flow of extracting css, since we trying to take css from "root" module.
40742
+ */
40743
+ preserveEntrySignatures: "allow-extension",
40744
+ input: {
40745
+ ...Object.fromEntries([
40746
+ ...virtualSiteComponentScriptEntries,
40747
+ ...virtualSiteComponentPreviewScriptEntries
40748
+ ]),
40749
+ [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY
40750
+ }
40751
+ }
40752
+ },
40753
+ plugins: [
40754
+ moduleBundleBuildSiteComponents({ initialModel: model }),
40755
+ draftJs(),
40756
+ preserveSiteComponentComponentsExports({ initialModel: model })
40757
+ ],
40758
+ experimental: {
40759
+ /*
40760
+ When a js chunk loads any other async js chunk,
40761
+ Vite also preloads the async chunk's dependencies.
40762
+
40763
+ For example:
40764
+ in some source code: `import('./some-other-file.js');`
40765
+ in `some-other-file.js`: `import './some-stylesheet.css';`
40766
+
40767
+ When Vite builds the above, the emitted dynamic import
40768
+ would also append a preload tag for the emitted css file
40769
+
40770
+ Using `experimental.renderBuiltUrl` appends a JS expression as the baseUrl for this,
40771
+ Otherwise:
40772
+ - it would default to being relative to the page's origin
40773
+ - or we'd have to hardcode the `baseUrl` at build-time
40774
+ */
40775
+ renderBuiltUrl(filename, { hostType, hostId }) {
40776
+ if (hostType !== "js") {
40777
+ return { relative: true };
40778
+ }
40779
+ return {
40780
+ // https://github.com/wix-private/wix-cli/pull/900#discussion_r1201541691
40781
+ runtime: `import.meta.url.replace("${hostId}", "${filename}")`
40782
+ };
40783
+ }
40784
+ }
40785
+ };
40786
+ return mergeConfig3(config, baseConfig);
40787
+ }
40788
+
40789
+ // src/vite/configs/build-command/site-components-server.ts
40790
+ init_esm_shims();
40791
+ import { mergeConfig as mergeConfig4 } from "vite";
40792
+ function getViteConfig5(model, options) {
40700
40793
  const virtualSiteComponentScriptEntries = [
40701
40794
  ...virtualSiteComponentScriptAssets(model)
40702
40795
  ].map(
@@ -40726,7 +40819,7 @@ function getViteConfig4(model, options) {
40726
40819
  ssr: true,
40727
40820
  ssrEmitAssets: true,
40728
40821
  rollupOptions: {
40729
- external: ["react", "react-dom", "@wix/services-manager-react"],
40822
+ external: siteComponentsExternals,
40730
40823
  input: {
40731
40824
  [entryName]: entryPath
40732
40825
  },
@@ -40735,9 +40828,9 @@ function getViteConfig4(model, options) {
40735
40828
  }
40736
40829
  }
40737
40830
  },
40738
- plugins: [moduleBundleBuildSsr({ initialModel: model })]
40831
+ plugins: [moduleBundleBuildSiteComponents({ initialModel: model })]
40739
40832
  };
40740
- return mergeConfig3(config, baseConfig);
40833
+ return mergeConfig4(config, baseConfig);
40741
40834
  });
40742
40835
  }
40743
40836
 
@@ -40939,7 +41032,7 @@ function autoOrigin() {
40939
41032
  }
40940
41033
 
40941
41034
  // src/vite/configs/dev-command/client.ts
40942
- function getViteConfig5(model, options) {
41035
+ function getViteConfig6(model, options) {
40943
41036
  const { https, baseBackendUrl, port, origin } = options;
40944
41037
  const allowedHosts = origin ? [new URL(origin).hostname] : void 0;
40945
41038
  return {
@@ -41080,7 +41173,7 @@ var m = (n3) => ({
41080
41173
 
41081
41174
  // src/vite/configs/dev-command/site-components.ts
41082
41175
  var SITE_COMPONENTS_BASE = "/@gateway/site_components";
41083
- function getViteConfig6(model, options) {
41176
+ function getViteConfig7(model, options) {
41084
41177
  const { https, baseBackendUrl } = options;
41085
41178
  return {
41086
41179
  appType: "custom",
@@ -41097,7 +41190,6 @@ function getViteConfig6(model, options) {
41097
41190
  cacheDir: SITE_COMPONENTS_VITE_CACHE_DIR,
41098
41191
  optimizeDeps: {
41099
41192
  include: ["@wix/sdk-context"],
41100
- exclude: ["react", "react-dom"],
41101
41193
  entries: [
41102
41194
  SITE_COMPONENTS_PATTERN,
41103
41195
  SITE_COMPONENTS_PREVIEW_PATTERN,
@@ -41117,7 +41209,9 @@ function getViteConfig6(model, options) {
41117
41209
  projectFolder: model.projectFolder
41118
41210
  }),
41119
41211
  m({
41120
- externals: ["react", "react-dom", "@wix/services-manager-react"]
41212
+ externals: siteComponentsExternals.map(
41213
+ (external) => new RegExp(`^${external}$`)
41214
+ )
41121
41215
  }),
41122
41216
  fbjsHotfixPlugin(),
41123
41217
  draftJs(),
@@ -41728,6 +41822,7 @@ async function createAppManifest({
41728
41822
  return {
41729
41823
  compId: component.id,
41730
41824
  compType: ComponentType.EDITOR_REACT_COMPONENT,
41825
+ compName: component.editorElement.displayName || component.id,
41731
41826
  compData: {
41732
41827
  editorReactComponent: {
41733
41828
  type: component.elementType,
@@ -42204,11 +42299,11 @@ var siteComponentDevBuilder = (component) => {
42204
42299
  }
42205
42300
  };
42206
42301
  };
42207
- var siteComponentBuildBuilder = (component, { browserBuildOutput }, { siteComponentsServerBuildOutput }) => {
42302
+ var siteComponentBuildBuilder = (component, { browserBuildOutput }, { siteComponentsClientBuildOutput }, { siteComponentsServerBuildOutput }) => {
42208
42303
  const moduleId = virtualModuleIdForSiteComponentScriptAsset(component.id);
42209
42304
  const sdkModuleId = component.relativeSdkPath ? virtualModuleIdForSiteComponentSdkScriptAsset(component.id) : null;
42210
42305
  const previewModuleId = component.relativePreviewPath ? virtualModuleIdForSiteComponentPreview(component.id) : null;
42211
- if (!siteComponentsServerBuildOutput) {
42306
+ if (!siteComponentsClientBuildOutput || !siteComponentsServerBuildOutput) {
42212
42307
  throw new Error("Missing build output for site component");
42213
42308
  }
42214
42309
  const presets = {};
@@ -42262,7 +42357,7 @@ var siteComponentBuildBuilder = (component, { browserBuildOutput }, { siteCompon
42262
42357
  client: {
42263
42358
  ...definedResources.client ?? {},
42264
42359
  componentUrl: generateUrl(
42265
- extractModuleBundleName(browserBuildOutput, moduleId)
42360
+ extractModuleBundleName(siteComponentsClientBuildOutput, moduleId)
42266
42361
  ),
42267
42362
  cssUrl: cssUrl ? generateUrl(cssUrl) : void 0
42268
42363
  },
@@ -42281,7 +42376,10 @@ var siteComponentBuildBuilder = (component, { browserBuildOutput }, { siteCompon
42281
42376
  ...previewModuleId ? {
42282
42377
  editor: {
42283
42378
  componentUrl: generateUrl(
42284
- extractModuleBundleName(browserBuildOutput, previewModuleId)
42379
+ extractModuleBundleName(
42380
+ siteComponentsClientBuildOutput,
42381
+ previewModuleId
42382
+ )
42285
42383
  ),
42286
42384
  cssUrl: editorCssUrl ? generateUrl(editorCssUrl) : void 0
42287
42385
  }
@@ -42335,7 +42433,7 @@ function getComponentDevSourceBuilder(model, devSource, backendSource) {
42335
42433
  return source;
42336
42434
  };
42337
42435
  }
42338
- function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSource, backendSource, siteComponentsServerBuildSource) {
42436
+ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSource, backendSource, siteComponentsClientBuildSource, siteComponentsServerBuildSource) {
42339
42437
  return async (component) => {
42340
42438
  const source = (0, import_variant5.match)(component, {
42341
42439
  EmbeddedScript: (embeddedScriptComponent) => embeddedScriptBuilder(model, embeddedScriptComponent, {
@@ -42381,6 +42479,7 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
42381
42479
  SiteComponent: (component2) => siteComponentBuildBuilder(
42382
42480
  component2,
42383
42481
  browserBuildSource,
42482
+ siteComponentsClientBuildSource,
42384
42483
  siteComponentsServerBuildSource
42385
42484
  ),
42386
42485
  SiteComponentPanel: (component2) => siteComponentPanelBuilder(component2, {
@@ -42399,11 +42498,12 @@ export {
42399
42498
  updateTopology,
42400
42499
  updateAppManifestComponents,
42401
42500
  getMonitoringProvider,
42402
- getViteConfig5 as getViteConfig2,
42403
- getViteConfig6 as getViteConfig3,
42501
+ getViteConfig6 as getViteConfig2,
42502
+ getViteConfig7 as getViteConfig3,
42404
42503
  getViteConfig2 as getViteConfig4,
42405
42504
  getViteConfig3 as getViteConfig5,
42406
42505
  getViteConfig4 as getViteConfig6,
42506
+ getViteConfig5 as getViteConfig7,
42407
42507
  validateComponents,
42408
42508
  createCustomElementConfig,
42409
42509
  createAppManifest,
@@ -42415,4 +42515,4 @@ export {
42415
42515
  he/he.js:
42416
42516
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
42417
42517
  */
42418
- //# sourceMappingURL=chunk-UNCNFFF6.js.map
42518
+ //# sourceMappingURL=chunk-YN6G2AVC.js.map