@wix/create-app 0.0.243 → 0.0.244

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.
@@ -14,7 +14,7 @@ import {
14
14
  require_is_git_url,
15
15
  require_lib,
16
16
  require_semver
17
- } from "./chunk-6P5R3I5H.js";
17
+ } from "./chunk-V6PDDX7X.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __require,
@@ -3986,4 +3986,4 @@ ejs/lib/ejs.js:
3986
3986
  * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
3987
3987
  *)
3988
3988
  */
3989
- //# sourceMappingURL=generator-R6MCAQJ7.js.map
3989
+ //# sourceMappingURL=generator-6OIH2MBC.js.map
package/build/index.js CHANGED
@@ -100,7 +100,7 @@ import {
100
100
  setupTestEnv,
101
101
  writeJson,
102
102
  zod_default
103
- } from "./chunk-6P5R3I5H.js";
103
+ } from "./chunk-V6PDDX7X.js";
104
104
  import {
105
105
  __commonJS,
106
106
  __dirname,
@@ -40910,9 +40910,21 @@ function findByPath(obj, path4, defaultValue, suffix) {
40910
40910
 
40911
40911
  // ../../node_modules/@wix/metro-runtime/es/build/url-resolver.js
40912
40912
  var USER_DOMAIN = "_";
40913
+ var WWW_BASE_DOMAIN = "www._base_domain_";
40914
+ var WILDCARD_PREFIX = "*.";
40913
40915
  var DOMAINS = ["wix.com", "editorx.com"];
40914
- var WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
40916
+ var WIX_API_DOMAINS = [
40917
+ "42.wixprod.net",
40918
+ "uw2-edt-1.wixprod.net",
40919
+ "virginia-edt.wixprod.net"
40920
+ ];
40915
40921
  var DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
40922
+ var HOST_ALIASES = {
40923
+ // payments.base44.com runs customised Business Manager, which needs to work exactly the same as normal BM on manage.wix.com
40924
+ "payments.base44.com": "manage.wix.com",
40925
+ // https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom
40926
+ "create.editorx.com": "editor.editorx.com"
40927
+ };
40916
40928
  var REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
40917
40929
  var REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
40918
40930
  var REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
@@ -40940,24 +40952,27 @@ function resolveDomain(host) {
40940
40952
  return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, "._base_domain_").replace(REGEX_CAPTURE_API_DOMAINS, "._api_base_domain_").replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, "*.dev.wix-code.com");
40941
40953
  }
40942
40954
  function fixHostExceptions(host) {
40943
- return host.replace("create.editorx.com", "editor.editorx.com");
40955
+ return HOST_ALIASES[host] ?? host;
40944
40956
  }
40945
40957
  function resolveMappingsByDomain(domain, domainToMappings) {
40946
40958
  const mappings = domainToMappings[domain];
40947
40959
  if (mappings) {
40948
40960
  return mappings;
40949
40961
  }
40950
- const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
40951
- if (!rootDomainMappings) {
40962
+ const matchedMappings = resolveRootDomain(domain, domainToMappings) ?? resolveWildcardDomain(domain, domainToMappings);
40963
+ if (!matchedMappings) {
40964
+ if (isBaseDomain(domain)) {
40965
+ const wwwMappings = domainToMappings[WWW_BASE_DOMAIN];
40966
+ if (wwwMappings) {
40967
+ return wwwMappings;
40968
+ }
40969
+ }
40952
40970
  const userMappings = domainToMappings[USER_DOMAIN];
40953
40971
  if (userMappings) {
40954
40972
  return userMappings;
40955
40973
  }
40956
- if (isBaseDomain(domain)) {
40957
- return domainToMappings[wwwBaseDomain];
40958
- }
40959
40974
  }
40960
- return rootDomainMappings ?? [];
40975
+ return matchedMappings ?? [];
40961
40976
  }
40962
40977
  function resolveRootDomain(domain, domainToMappings) {
40963
40978
  return Object.entries(domainToMappings).find(([entryDomain]) => {
@@ -40965,6 +40980,22 @@ function resolveRootDomain(domain, domainToMappings) {
40965
40980
  return rooDomainSegments.join(".") === entryDomain;
40966
40981
  })?.[1];
40967
40982
  }
40983
+ function resolveWildcardDomain(domain, domainToMappings) {
40984
+ const matchingEntries = Object.entries(domainToMappings).filter(([entryDomain]) => matchesWildcardDomain(domain, entryDomain));
40985
+ const [mostSpecificEntry] = matchingEntries.sort(([entryDomainA], [entryDomainB]) => entryDomainB.length - entryDomainA.length);
40986
+ if (!mostSpecificEntry) {
40987
+ return void 0;
40988
+ }
40989
+ const [, mappings] = mostSpecificEntry;
40990
+ return mappings;
40991
+ }
40992
+ function matchesWildcardDomain(domain, entryDomain) {
40993
+ if (!entryDomain.startsWith(WILDCARD_PREFIX)) {
40994
+ return false;
40995
+ }
40996
+ const suffix = entryDomain.slice(WILDCARD_PREFIX.length - 1);
40997
+ return domain.length > suffix.length && domain.endsWith(suffix);
40998
+ }
40968
40999
  function resolvePath(protoPath, mappings) {
40969
41000
  const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
40970
41001
  if (!mapping) {
@@ -40975,7 +41006,6 @@ function resolvePath(protoPath, mappings) {
40975
41006
  function isBaseDomain(domain) {
40976
41007
  return !!domain.match(/\._base_domain_$/);
40977
41008
  }
40978
- var wwwBaseDomain = "www._base_domain_";
40979
41009
 
40980
41010
  // ../../node_modules/@wix/metro-runtime/es/build/flatten-params.js
40981
41011
  init_esm_shims();
@@ -41076,7 +41106,7 @@ var ConverterType;
41076
41106
  (function(ConverterType2) {
41077
41107
  ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
41078
41108
  ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
41079
- })(ConverterType = ConverterType || (ConverterType = {}));
41109
+ })(ConverterType || (ConverterType = {}));
41080
41110
 
41081
41111
  // ../../node_modules/@wix/metro-runtime/es/build/serializer/serializer.js
41082
41112
  init_esm_shims();
@@ -41741,8 +41771,10 @@ function interceptRequest(client2, fn) {
41741
41771
  function createHttpClient({
41742
41772
  getAppToken,
41743
41773
  createHeaders: createHeaders2,
41774
+ cookies,
41744
41775
  type
41745
41776
  }) {
41777
+ const cookieHeader = Object.entries({ "XSRF-TOKEN": "nocheck", ...cookies }).map(([name, value2]) => `${name}=${value2}`).join("; ");
41746
41778
  const client2 = (0, import_http_client2.createHttpClient)({
41747
41779
  baseURL: baseUrls[type],
41748
41780
  ...type !== "standalone" ? {
@@ -41752,7 +41784,7 @@ function createHttpClient({
41752
41784
  ...createHeaders2?.(),
41753
41785
  // See https://wix.slack.com/archives/C0JLGMT28/p1667219337530909
41754
41786
  "X-XSRF-TOKEN": "nocheck",
41755
- Cookie: "XSRF-TOKEN=nocheck",
41787
+ Cookie: cookieHeader,
41756
41788
  "User-Agent": "wix-cli"
41757
41789
  }),
41758
41790
  proxy: false,
@@ -55568,9 +55600,10 @@ var import_react94 = __toESM(require_react(), 1);
55568
55600
  var HttpClientContext = (0, import_react94.createContext)(null);
55569
55601
  var HttpClientProvider = ({
55570
55602
  children,
55571
- headers
55603
+ headers,
55604
+ cookies
55572
55605
  }) => {
55573
- return /* @__PURE__ */ import_react94.default.createElement(HttpClientContext.Provider, { value: { headers } }, children);
55606
+ return /* @__PURE__ */ import_react94.default.createElement(HttpClientContext.Provider, { value: { headers, cookies } }, children);
55574
55607
  };
55575
55608
 
55576
55609
  // ../cli-http-client-react/src/useHttpClient.ts
@@ -55583,6 +55616,7 @@ function useHttpClient({
55583
55616
  return (0, import_react95.useMemo)(
55584
55617
  () => createHttpClient({
55585
55618
  type,
55619
+ cookies: context2?.cookies,
55586
55620
  getAppToken: () => getAppToken({ siteId }),
55587
55621
  createHeaders: () => ({
55588
55622
  ...createAuthHeaders?.({ siteId }),
@@ -56804,7 +56838,7 @@ init_esm_shims();
56804
56838
  var package_default = {
56805
56839
  name: "@wix/create-app",
56806
56840
  description: "Create Wix apps",
56807
- version: "0.0.243",
56841
+ version: "0.0.244",
56808
56842
  author: "Ihor Machuzhak",
56809
56843
  bin: "bin/index.cjs",
56810
56844
  devDependencies: {
@@ -63166,6 +63200,7 @@ var BackOfficeHostingPlatforms2;
63166
63200
  BackOfficeHostingPlatforms3["SYMPHONY"] = "SYMPHONY";
63167
63201
  BackOfficeHostingPlatforms3["BMR"] = "BMR";
63168
63202
  BackOfficeHostingPlatforms3["WIXEL_DASHBOARD"] = "WIXEL_DASHBOARD";
63203
+ BackOfficeHostingPlatforms3["CHANNELS_BACKOFFICE"] = "CHANNELS_BACKOFFICE";
63169
63204
  })(BackOfficeHostingPlatforms2 || (BackOfficeHostingPlatforms2 = {}));
63170
63205
  var BackOfficeScriptAssetType2;
63171
63206
  (function(BackOfficeScriptAssetType3) {
@@ -63462,6 +63497,7 @@ var ComponentType2;
63462
63497
  ComponentType3["EDITOR_EXPOSURE"] = "EDITOR_EXPOSURE";
63463
63498
  ComponentType3["TOOLS_PROVIDER_CONFIG"] = "TOOLS_PROVIDER_CONFIG";
63464
63499
  ComponentType3["APP_TOOLS"] = "APP_TOOLS";
63500
+ ComponentType3["ECOM_PURCHASE_RECOMMENDATIONS"] = "ECOM_PURCHASE_RECOMMENDATIONS";
63465
63501
  })(ComponentType2 || (ComponentType2 = {}));
63466
63502
  var AuthType;
63467
63503
  (function(AuthType2) {
@@ -65027,6 +65063,7 @@ var Tag2;
65027
65063
  Tag3["OWNER_CHECKOUT"] = "OWNER_CHECKOUT";
65028
65064
  Tag3["ECOM_PREVIEW_CHECKOUT"] = "ECOM_PREVIEW_CHECKOUT";
65029
65065
  Tag3["ALL_CATEGORIES"] = "ALL_CATEGORIES";
65066
+ Tag3["ECOM_TAX_GROUPS"] = "ECOM_TAX_GROUPS";
65030
65067
  })(Tag2 || (Tag2 = {}));
65031
65068
  var ThumbnailType2;
65032
65069
  (function(ThumbnailType3) {
@@ -65724,6 +65761,7 @@ var AssetType2;
65724
65761
  AssetType3["WIDGET"] = "WIDGET";
65725
65762
  AssetType3["FONT"] = "FONT";
65726
65763
  AssetType3["ICONS"] = "ICONS";
65764
+ AssetType3["STORY"] = "STORY";
65727
65765
  })(AssetType2 || (AssetType2 = {}));
65728
65766
  var FileMediaType;
65729
65767
  (function(FileMediaType2) {
@@ -65738,6 +65776,7 @@ var FileMediaType;
65738
65776
  var AnimationType;
65739
65777
  (function(AnimationType2) {
65740
65778
  AnimationType2["VIEW"] = "VIEW";
65779
+ AnimationType2["POINTER"] = "POINTER";
65741
65780
  })(AnimationType || (AnimationType = {}));
65742
65781
  var AppType3;
65743
65782
  (function(AppType5) {
@@ -66098,6 +66137,18 @@ var WidthType2;
66098
66137
  WidthType3["ORIGINAL"] = "ORIGINAL";
66099
66138
  WidthType3["FULL_WIDTH"] = "FULL_WIDTH";
66100
66139
  })(WidthType2 || (WidthType2 = {}));
66140
+ var PointerEffectType;
66141
+ (function(PointerEffectType2) {
66142
+ PointerEffectType2["AIRY"] = "AIRY";
66143
+ PointerEffectType2["BLOB"] = "BLOB";
66144
+ PointerEffectType2["BLUR"] = "BLUR";
66145
+ PointerEffectType2["SCALE"] = "SCALE";
66146
+ PointerEffectType2["SKEW"] = "SKEW";
66147
+ PointerEffectType2["SWIVEL"] = "SWIVEL";
66148
+ PointerEffectType2["TILT_3D"] = "TILT_3D";
66149
+ PointerEffectType2["TRACK"] = "TRACK";
66150
+ PointerEffectType2["TRACK_3D"] = "TRACK_3D";
66151
+ })(PointerEffectType || (PointerEffectType = {}));
66101
66152
  var BackgroundType2;
66102
66153
  (function(BackgroundType3) {
66103
66154
  BackgroundType3["COLOR"] = "COLOR";
@@ -67842,7 +67893,7 @@ function getTasks({
67842
67893
  cause: e2
67843
67894
  });
67844
67895
  }
67845
- const { generateApp } = await import("./generator-R6MCAQJ7.js");
67896
+ const { generateApp } = await import("./generator-6OIH2MBC.js");
67846
67897
  await generateApp({
67847
67898
  packageName,
67848
67899
  packageFolder,