@wix/cli-app 1.1.108 → 1.1.110

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 (66) hide show
  1. package/build/{AddPermissionCommand-W3TQTL3X.js → AddPermissionCommand-Q4KCECD7.js} +2 -2
  2. package/build/{DevCommand-3HZJQQIQ.js → DevCommand-FMJ7PV2Y.js} +21 -12
  3. package/build/DevCommand-FMJ7PV2Y.js.map +1 -0
  4. package/build/{GenerateCommand-UQ3JHQTJ.js → GenerateCommand-FWS3352N.js} +8 -8
  5. package/build/{LogsCommand-JHADSYUE.js → LogsCommand-WC7U2CIH.js} +3 -3
  6. package/build/PreviewCommand-EWGRAYGG.js +19 -0
  7. package/build/ReleaseCommand-6BVMI7ZJ.js +23 -0
  8. package/build/{ServeCommand-IPKP6PJ2.js → ServeCommand-CTNSVG6Z.js} +3 -3
  9. package/build/{build-LZ3CJXNM.js → build-P3KW5SQM.js} +6 -6
  10. package/build/{chunk-FO7ABKNR.js → chunk-5KS3YYYM.js} +3 -3
  11. package/build/{chunk-RDXTHRJ4.js → chunk-7344VPG4.js} +2 -2
  12. package/build/{chunk-W5SE5OVE.js → chunk-AFDFFSHE.js} +13 -3
  13. package/build/{chunk-W5SE5OVE.js.map → chunk-AFDFFSHE.js.map} +1 -1
  14. package/build/{chunk-OKHXUGGH.js → chunk-AYUY2OUH.js} +2 -2
  15. package/build/{chunk-LOVLYP4H.js → chunk-BVW3JET5.js} +5 -5
  16. package/build/{chunk-IGC7QYU5.js → chunk-DATTYRD4.js} +2 -2
  17. package/build/{chunk-BER5YRAG.js → chunk-DKXRLVOD.js} +5 -2
  18. package/build/{chunk-BER5YRAG.js.map → chunk-DKXRLVOD.js.map} +1 -1
  19. package/build/{chunk-LWOWN5OI.js → chunk-F5QK4DS5.js} +5 -5
  20. package/build/{chunk-6OQZW27N.js → chunk-GNMDOF6K.js} +2 -2
  21. package/build/{chunk-UPQ6AZFY.js → chunk-K7RLYJLQ.js} +2 -2
  22. package/build/{chunk-7KESMWRI.js → chunk-NPOXJLJB.js} +33 -16
  23. package/build/{chunk-7KESMWRI.js.map → chunk-NPOXJLJB.js.map} +1 -1
  24. package/build/{chunk-PFAJ5ETM.js → chunk-SWB72JLJ.js} +2 -2
  25. package/build/{chunk-HAUIN5OS.js → chunk-SXJDV4SV.js} +6 -6
  26. package/build/{chunk-UN2TQTOP.js → chunk-UYA3TH5I.js} +61 -50
  27. package/build/chunk-UYA3TH5I.js.map +1 -0
  28. package/build/{chunk-Z4NG6X6T.js → chunk-YIBGA5R7.js} +2 -2
  29. package/build/{chunk-UEUJOHB4.js → chunk-YZQDICAQ.js} +3 -3
  30. package/build/{chunk-PBROWK34.js → chunk-ZHQREOZP.js} +3 -1
  31. package/build/chunk-ZHQREOZP.js.map +1 -0
  32. package/build/{chunk-MAZMH6ES.js → chunk-ZQMS7U6K.js} +6 -6
  33. package/build/index.js +59 -41
  34. package/build/index.js.map +1 -1
  35. package/build/{preview-OVNN2RP4.js → preview-ZPFX6WT3.js} +13 -13
  36. package/build/{release-OMLRH2VC.js → release-ZK2H4AB5.js} +15 -15
  37. package/build/{render-command-DIMIKL4B.js → render-command-3KPSE3BG.js} +6 -6
  38. package/package.json +2 -2
  39. package/build/DevCommand-3HZJQQIQ.js.map +0 -1
  40. package/build/PreviewCommand-WBQRDP7K.js +0 -19
  41. package/build/ReleaseCommand-3KDJB3KZ.js +0 -23
  42. package/build/chunk-PBROWK34.js.map +0 -1
  43. package/build/chunk-UN2TQTOP.js.map +0 -1
  44. /package/build/{AddPermissionCommand-W3TQTL3X.js.map → AddPermissionCommand-Q4KCECD7.js.map} +0 -0
  45. /package/build/{GenerateCommand-UQ3JHQTJ.js.map → GenerateCommand-FWS3352N.js.map} +0 -0
  46. /package/build/{LogsCommand-JHADSYUE.js.map → LogsCommand-WC7U2CIH.js.map} +0 -0
  47. /package/build/{PreviewCommand-WBQRDP7K.js.map → PreviewCommand-EWGRAYGG.js.map} +0 -0
  48. /package/build/{ReleaseCommand-3KDJB3KZ.js.map → ReleaseCommand-6BVMI7ZJ.js.map} +0 -0
  49. /package/build/{ServeCommand-IPKP6PJ2.js.map → ServeCommand-CTNSVG6Z.js.map} +0 -0
  50. /package/build/{build-LZ3CJXNM.js.map → build-P3KW5SQM.js.map} +0 -0
  51. /package/build/{chunk-FO7ABKNR.js.map → chunk-5KS3YYYM.js.map} +0 -0
  52. /package/build/{chunk-RDXTHRJ4.js.map → chunk-7344VPG4.js.map} +0 -0
  53. /package/build/{chunk-OKHXUGGH.js.map → chunk-AYUY2OUH.js.map} +0 -0
  54. /package/build/{chunk-LOVLYP4H.js.map → chunk-BVW3JET5.js.map} +0 -0
  55. /package/build/{chunk-IGC7QYU5.js.map → chunk-DATTYRD4.js.map} +0 -0
  56. /package/build/{chunk-LWOWN5OI.js.map → chunk-F5QK4DS5.js.map} +0 -0
  57. /package/build/{chunk-6OQZW27N.js.map → chunk-GNMDOF6K.js.map} +0 -0
  58. /package/build/{chunk-UPQ6AZFY.js.map → chunk-K7RLYJLQ.js.map} +0 -0
  59. /package/build/{chunk-PFAJ5ETM.js.map → chunk-SWB72JLJ.js.map} +0 -0
  60. /package/build/{chunk-HAUIN5OS.js.map → chunk-SXJDV4SV.js.map} +0 -0
  61. /package/build/{chunk-Z4NG6X6T.js.map → chunk-YIBGA5R7.js.map} +0 -0
  62. /package/build/{chunk-UEUJOHB4.js.map → chunk-YZQDICAQ.js.map} +0 -0
  63. /package/build/{chunk-MAZMH6ES.js.map → chunk-ZQMS7U6K.js.map} +0 -0
  64. /package/build/{preview-OVNN2RP4.js.map → preview-ZPFX6WT3.js.map} +0 -0
  65. /package/build/{release-OMLRH2VC.js.map → release-ZK2H4AB5.js.map} +0 -0
  66. /package/build/{render-command-DIMIKL4B.js.map → render-command-3KPSE3BG.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  require_react,
5
5
  useBiLogger,
6
6
  wixCliAppBiEvents
7
- } from "./chunk-W5SE5OVE.js";
7
+ } from "./chunk-AFDFFSHE.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-PFAJ5ETM.js.map
27
+ //# sourceMappingURL=chunk-SWB72JLJ.js.map
@@ -3,16 +3,16 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  PreviewCommand,
5
5
  assertBuildOutputExists
6
- } from "./chunk-MAZMH6ES.js";
6
+ } from "./chunk-ZQMS7U6K.js";
7
7
  import {
8
8
  useARMClient
9
- } from "./chunk-7KESMWRI.js";
9
+ } from "./chunk-NPOXJLJB.js";
10
10
  import {
11
11
  useWixCliAppBi
12
- } from "./chunk-PFAJ5ETM.js";
12
+ } from "./chunk-SWB72JLJ.js";
13
13
  import {
14
14
  useBackendComponents
15
- } from "./chunk-Z4NG6X6T.js";
15
+ } from "./chunk-YIBGA5R7.js";
16
16
  import {
17
17
  Alert,
18
18
  Box_default,
@@ -36,7 +36,7 @@ import {
36
36
  useAsyncCallback,
37
37
  useProjectModel,
38
38
  useTranslation
39
- } from "./chunk-W5SE5OVE.js";
39
+ } from "./chunk-AFDFFSHE.js";
40
40
  import {
41
41
  __toESM,
42
42
  init_esm_shims
@@ -399,4 +399,4 @@ export {
399
399
  ReleaseVersionType,
400
400
  ReleaseCommand
401
401
  };
402
- //# sourceMappingURL=chunk-HAUIN5OS.js.map
402
+ //# sourceMappingURL=chunk-SXJDV4SV.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-RDXTHRJ4.js";
6
+ } from "./chunk-7344VPG4.js";
7
7
  import {
8
8
  API_BASEURL_PLACEHOLDER,
9
9
  AlgorithmType,
@@ -82,7 +82,7 @@ import {
82
82
  virtualSiteComponentScriptAssets,
83
83
  virtualSiteComponentSdkScriptAssets,
84
84
  z
85
- } from "./chunk-W5SE5OVE.js";
85
+ } from "./chunk-AFDFFSHE.js";
86
86
  import {
87
87
  __commonJS,
88
88
  __esm,
@@ -37978,6 +37978,10 @@ var import_monitoring_buildtime = __toESM(require_build(), 1);
37978
37978
  // src/vite/vite-server-url.ts
37979
37979
  init_esm_shims();
37980
37980
  function getViteServerUrl2(viteServer) {
37981
+ const origin = viteServer.config.server.origin;
37982
+ if (origin && URL.canParse(origin)) {
37983
+ return origin;
37984
+ }
37981
37985
  const viteAddress = viteServer.resolvedUrls?.local[0];
37982
37986
  if (!viteAddress) {
37983
37987
  throw new Error("Vite server listening but no URL.");
@@ -38280,7 +38284,10 @@ var CUSTOM_ELEMENT_HMR_PARAMETER = "custom-element-hmr";
38280
38284
  var CUSTOM_ELEMENT_HMR_RE = new RegExp(
38281
38285
  `[?&]${CUSTOM_ELEMENT_HMR_PARAMETER}=([^&]+)`
38282
38286
  );
38283
- var getCustomElementPathWithHMR = (resolvedUrls, component) => `${resolvedUrls ? resolvedUrls.local[0] : "/"}${component.relativePath}?${CUSTOM_ELEMENT_HMR_PARAMETER}=${component.tagName}`;
38287
+ var getCustomElementPathWithHMR = (base, component) => new URL(
38288
+ `${component.relativePath}?${CUSTOM_ELEMENT_HMR_PARAMETER}=${component.tagName}`,
38289
+ base
38290
+ ).toString();
38284
38291
  var getCustomElementHMRTemplate = (id, root) => {
38285
38292
  const originalId = id.replace(root, "");
38286
38293
  const originalCustomElementPath = originalId.replace(
@@ -38535,12 +38542,9 @@ var getCustomElementBaseTemplate = (path10, tagName, appId) => (
38535
38542
  })();
38536
38543
  `
38537
38544
  );
38538
- var getCustomElementDevTemplate = (appId, serverInstance, customElementComponent) => {
38545
+ var getCustomElementDevTemplate = (appId, base, customElementComponent) => {
38539
38546
  return getCustomElementBaseTemplate(
38540
- getCustomElementPathWithHMR(
38541
- serverInstance.resolvedUrls,
38542
- customElementComponent
38543
- ),
38547
+ getCustomElementPathWithHMR(base, customElementComponent),
38544
38548
  customElementComponent.tagName,
38545
38549
  appId
38546
38550
  );
@@ -38678,21 +38682,21 @@ var moduleBundleDev = ({
38678
38682
  server.moduleGraph.invalidateModule(moduleBundle);
38679
38683
  }
38680
38684
  }
38681
- virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
38685
+ virtualSiteComponentAssets = virtualSiteComponentScriptAssets(model);
38682
38686
  for (const scriptId of virtualSiteComponentAssets.keys()) {
38683
38687
  const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38684
38688
  if (moduleBundle) {
38685
38689
  server.moduleGraph.invalidateModule(moduleBundle);
38686
38690
  }
38687
38691
  }
38688
- virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(initialModel);
38692
+ virtualSiteComponentSdkAssets = virtualSiteComponentSdkScriptAssets(model);
38689
38693
  for (const scriptId of virtualSiteComponentSdkAssets.keys()) {
38690
38694
  const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38691
38695
  if (moduleBundle) {
38692
38696
  server.moduleGraph.invalidateModule(moduleBundle);
38693
38697
  }
38694
38698
  }
38695
- virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
38699
+ virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(model);
38696
38700
  for (const scriptId of virtualSiteComponentPanelAssets.keys()) {
38697
38701
  const moduleBundle = server.moduleGraph.getModuleById(scriptId);
38698
38702
  if (moduleBundle) {
@@ -38711,7 +38715,7 @@ var moduleBundleDev = ({
38711
38715
  if (customElementComponent) {
38712
38716
  return getCustomElementDevTemplate(
38713
38717
  appId,
38714
- serverInstance,
38718
+ getViteServerUrl2(serverInstance),
38715
38719
  customElementComponent
38716
38720
  );
38717
38721
  }
@@ -39664,18 +39668,37 @@ function ssl() {
39664
39668
 
39665
39669
  // src/vite/plugins/auto-origin.ts
39666
39670
  init_esm_shims();
39671
+ import { dirname as dirname3, isAbsolute as isAbsolute2, join as join5 } from "node:path";
39667
39672
  var originPlaceholder = "__WIX_ORIGIN_PLACEHOLDER__";
39673
+ function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
39674
+ const url = new URL(assetUrl, viteAddress).href;
39675
+ if (assetUrl.startsWith("/@vite")) {
39676
+ return url;
39677
+ }
39678
+ if (isAbsolute2(assetUrl)) {
39679
+ return url;
39680
+ }
39681
+ return new URL(join5(dirname3(originalUrl), assetUrl), viteAddress).href;
39682
+ }
39668
39683
  function autoOrigin() {
39669
- let origin = null;
39684
+ let viteServer;
39685
+ let origin;
39670
39686
  return {
39671
39687
  name: "wix:auto-origin",
39672
39688
  apply: "serve",
39673
- config: () => ({
39674
- server: {
39675
- origin: originPlaceholder
39689
+ config: (config) => {
39690
+ if (config.server?.origin) {
39691
+ origin = config.server.origin;
39692
+ return;
39676
39693
  }
39677
- }),
39694
+ return {
39695
+ server: {
39696
+ origin: originPlaceholder
39697
+ }
39698
+ };
39699
+ },
39678
39700
  configureServer: (server) => {
39701
+ viteServer = server;
39679
39702
  server.middlewares.use((_req, _res, next) => {
39680
39703
  origin ??= getViteServerUrl2(server).replace(/\/$/, "");
39681
39704
  next();
@@ -39692,42 +39715,23 @@ function autoOrigin() {
39692
39715
  });
39693
39716
  }
39694
39717
  return code.replaceAll(originPlaceholder, origin);
39695
- }
39696
- };
39697
- }
39698
-
39699
- // src/vite/plugins/absolute-html-url.ts
39700
- init_esm_shims();
39701
- import { dirname as dirname3, isAbsolute as isAbsolute2, join as join5 } from "node:path";
39702
- import { URL as URL2 } from "node:url";
39703
- function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
39704
- let url = new URL2(assetUrl, viteAddress).href;
39705
- if (assetUrl.startsWith("/@vite")) {
39706
- return url;
39707
- }
39708
- if (!isAbsolute2(assetUrl)) {
39709
- const assetPath = join5(dirname3(originalUrl), assetUrl);
39710
- url = new URL2(assetPath, viteAddress).href;
39711
- }
39712
- return url;
39713
- }
39714
- function absoluteHtmlUrl() {
39715
- let viteDevServer;
39716
- return {
39717
- name: "wix:absolute-html-url",
39718
- apply: "serve",
39719
- configureServer(viteServer) {
39720
- viteDevServer = viteServer;
39721
39718
  },
39719
+ // Similar problem reported in vite repo: https://github.com/vitejs/vite/issues/14263
39720
+ // Clarification:
39721
+ // Embedded scripts will be added to the user's website.
39722
+ // If it has a relative URL, for example: `<script type="module" src="./logger.ts"></script>`,
39723
+ // the browser will attempt to load the script from the website's domain,
39724
+ // resulting in a URL like this: `https://artemdem7.wixsite.com/logger.ts`, which is unavailable.
39725
+ // To make it work, we need to use an absolute URL to load the script from the localhost.
39722
39726
  transformIndexHtml: {
39723
39727
  order: "post",
39724
39728
  handler(html, { originalUrl }) {
39729
+ origin ??= getViteServerUrl2(viteServer).replace(/\/$/, "");
39725
39730
  if (!originalUrl) {
39726
- throw new Error("Cannot find asset URL.");
39731
+ return;
39727
39732
  }
39728
- const viteAddress = viteDevServer.resolvedUrls?.local[0];
39729
39733
  const regexReplace = (_, prefix, assetUrl, suffix) => {
39730
- const url = getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress);
39734
+ const url = getAbsoluteAssetUrl(originalUrl, assetUrl, origin);
39731
39735
  return `${prefix}${url}${suffix}`;
39732
39736
  };
39733
39737
  return html.replaceAll(
@@ -39744,7 +39748,8 @@ function absoluteHtmlUrl() {
39744
39748
 
39745
39749
  // src/vite/configs/dev.ts
39746
39750
  function getViteConfig5(model, options) {
39747
- const { https, baseBackendUrl } = options;
39751
+ const { https, baseBackendUrl, port, origin } = options;
39752
+ const allowedHosts = origin ? [new URL(origin).hostname] : void 0;
39748
39753
  return {
39749
39754
  configFile: false,
39750
39755
  root: model.projectFolder,
@@ -39770,7 +39775,14 @@ function getViteConfig5(model, options) {
39770
39775
  SITE_COMPONENTS_PRESETS_PATTERN
39771
39776
  ]
39772
39777
  },
39773
- server: { cors: { origin: true } },
39778
+ server: {
39779
+ cors: { origin: true },
39780
+ port,
39781
+ strictPort: !!port,
39782
+ host: !!origin,
39783
+ allowedHosts,
39784
+ origin
39785
+ },
39774
39786
  define: {
39775
39787
  ...baseBackendUrl ? {
39776
39788
  "import.meta.env.BASE_API_URL": JSON.stringify(
@@ -39800,7 +39812,6 @@ function getViteConfig5(model, options) {
39800
39812
  ...options
39801
39813
  }),
39802
39814
  autoOrigin(),
39803
- absoluteHtmlUrl(),
39804
39815
  embeddedScriptSDKSupport({
39805
39816
  type: "dev" /* dev */,
39806
39817
  initialModel: model,
@@ -42120,4 +42131,4 @@ export {
42120
42131
  he/he.js:
42121
42132
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
42122
42133
  */
42123
- //# sourceMappingURL=chunk-UN2TQTOP.js.map
42134
+ //# sourceMappingURL=chunk-UYA3TH5I.js.map