@wix/create-new 0.0.104 → 0.0.105

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.
@@ -13,7 +13,7 @@ import {
13
13
  require_lib,
14
14
  temporaryDirectory,
15
15
  updateEnvFile
16
- } from "./chunk-FPLWF45Q.js";
16
+ } from "./chunk-H4ZDAFAO.js";
17
17
  import {
18
18
  __toESM,
19
19
  init_esm_shims
@@ -115,4 +115,4 @@ async function generateApp({
115
115
  export {
116
116
  generateApp
117
117
  };
118
- //# sourceMappingURL=generator-JYIXHB6D.js.map
118
+ //# sourceMappingURL=generator-7VK2WAO7.js.map
package/build/index.js CHANGED
@@ -119,7 +119,7 @@ import {
119
119
  writeJson,
120
120
  writePackageJson,
121
121
  zod_default
122
- } from "./chunk-FPLWF45Q.js";
122
+ } from "./chunk-H4ZDAFAO.js";
123
123
  import {
124
124
  __commonJS,
125
125
  __dirname,
@@ -48217,9 +48217,21 @@ function findByPath(obj, path4, defaultValue, suffix) {
48217
48217
 
48218
48218
  // ../../node_modules/@wix/metro-runtime/es/build/url-resolver.js
48219
48219
  var USER_DOMAIN = "_";
48220
+ var WWW_BASE_DOMAIN = "www._base_domain_";
48221
+ var WILDCARD_PREFIX = "*.";
48220
48222
  var DOMAINS = ["wix.com", "editorx.com"];
48221
- var WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
48223
+ var WIX_API_DOMAINS = [
48224
+ "42.wixprod.net",
48225
+ "uw2-edt-1.wixprod.net",
48226
+ "virginia-edt.wixprod.net"
48227
+ ];
48222
48228
  var DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
48229
+ var HOST_ALIASES = {
48230
+ // payments.base44.com runs customised Business Manager, which needs to work exactly the same as normal BM on manage.wix.com
48231
+ "payments.base44.com": "manage.wix.com",
48232
+ // https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom
48233
+ "create.editorx.com": "editor.editorx.com"
48234
+ };
48223
48235
  var REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
48224
48236
  var REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
48225
48237
  var REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
@@ -48247,24 +48259,27 @@ function resolveDomain(host) {
48247
48259
  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");
48248
48260
  }
48249
48261
  function fixHostExceptions(host) {
48250
- return host.replace("create.editorx.com", "editor.editorx.com");
48262
+ return HOST_ALIASES[host] ?? host;
48251
48263
  }
48252
48264
  function resolveMappingsByDomain(domain, domainToMappings) {
48253
48265
  const mappings = domainToMappings[domain];
48254
48266
  if (mappings) {
48255
48267
  return mappings;
48256
48268
  }
48257
- const rootDomainMappings = resolveRootDomain(domain, domainToMappings);
48258
- if (!rootDomainMappings) {
48269
+ const matchedMappings = resolveRootDomain(domain, domainToMappings) ?? resolveWildcardDomain(domain, domainToMappings);
48270
+ if (!matchedMappings) {
48271
+ if (isBaseDomain(domain)) {
48272
+ const wwwMappings = domainToMappings[WWW_BASE_DOMAIN];
48273
+ if (wwwMappings) {
48274
+ return wwwMappings;
48275
+ }
48276
+ }
48259
48277
  const userMappings = domainToMappings[USER_DOMAIN];
48260
48278
  if (userMappings) {
48261
48279
  return userMappings;
48262
48280
  }
48263
- if (isBaseDomain(domain)) {
48264
- return domainToMappings[wwwBaseDomain];
48265
- }
48266
48281
  }
48267
- return rootDomainMappings ?? [];
48282
+ return matchedMappings ?? [];
48268
48283
  }
48269
48284
  function resolveRootDomain(domain, domainToMappings) {
48270
48285
  return Object.entries(domainToMappings).find(([entryDomain]) => {
@@ -48272,6 +48287,22 @@ function resolveRootDomain(domain, domainToMappings) {
48272
48287
  return rooDomainSegments.join(".") === entryDomain;
48273
48288
  })?.[1];
48274
48289
  }
48290
+ function resolveWildcardDomain(domain, domainToMappings) {
48291
+ const matchingEntries = Object.entries(domainToMappings).filter(([entryDomain]) => matchesWildcardDomain(domain, entryDomain));
48292
+ const [mostSpecificEntry] = matchingEntries.sort(([entryDomainA], [entryDomainB]) => entryDomainB.length - entryDomainA.length);
48293
+ if (!mostSpecificEntry) {
48294
+ return void 0;
48295
+ }
48296
+ const [, mappings] = mostSpecificEntry;
48297
+ return mappings;
48298
+ }
48299
+ function matchesWildcardDomain(domain, entryDomain) {
48300
+ if (!entryDomain.startsWith(WILDCARD_PREFIX)) {
48301
+ return false;
48302
+ }
48303
+ const suffix = entryDomain.slice(WILDCARD_PREFIX.length - 1);
48304
+ return domain.length > suffix.length && domain.endsWith(suffix);
48305
+ }
48275
48306
  function resolvePath(protoPath, mappings) {
48276
48307
  const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
48277
48308
  if (!mapping) {
@@ -48282,7 +48313,6 @@ function resolvePath(protoPath, mappings) {
48282
48313
  function isBaseDomain(domain) {
48283
48314
  return !!domain.match(/\._base_domain_$/);
48284
48315
  }
48285
- var wwwBaseDomain = "www._base_domain_";
48286
48316
 
48287
48317
  // ../../node_modules/@wix/metro-runtime/es/build/flatten-params.js
48288
48318
  init_esm_shims();
@@ -48383,7 +48413,7 @@ var ConverterType;
48383
48413
  (function(ConverterType2) {
48384
48414
  ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
48385
48415
  ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
48386
- })(ConverterType = ConverterType || (ConverterType = {}));
48416
+ })(ConverterType || (ConverterType = {}));
48387
48417
 
48388
48418
  // ../../node_modules/@wix/metro-runtime/es/build/serializer/serializer.js
48389
48419
  init_esm_shims();
@@ -49048,8 +49078,10 @@ function interceptRequest(client2, fn) {
49048
49078
  function createHttpClient({
49049
49079
  getAppToken,
49050
49080
  createHeaders: createHeaders2,
49081
+ cookies,
49051
49082
  type
49052
49083
  }) {
49084
+ const cookieHeader = Object.entries({ "XSRF-TOKEN": "nocheck", ...cookies }).map(([name, value2]) => `${name}=${value2}`).join("; ");
49053
49085
  const client2 = (0, import_http_client2.createHttpClient)({
49054
49086
  baseURL: baseUrls[type],
49055
49087
  ...type !== "standalone" ? {
@@ -49059,7 +49091,7 @@ function createHttpClient({
49059
49091
  ...createHeaders2?.(),
49060
49092
  // See https://wix.slack.com/archives/C0JLGMT28/p1667219337530909
49061
49093
  "X-XSRF-TOKEN": "nocheck",
49062
- Cookie: "XSRF-TOKEN=nocheck",
49094
+ Cookie: cookieHeader,
49063
49095
  "User-Agent": "wix-cli"
49064
49096
  }),
49065
49097
  proxy: false,
@@ -70327,9 +70359,10 @@ var import_react101 = __toESM(require_react(), 1);
70327
70359
  var HttpClientContext = (0, import_react101.createContext)(null);
70328
70360
  var HttpClientProvider = ({
70329
70361
  children,
70330
- headers
70362
+ headers,
70363
+ cookies
70331
70364
  }) => {
70332
- return /* @__PURE__ */ import_react101.default.createElement(HttpClientContext.Provider, { value: { headers } }, children);
70365
+ return /* @__PURE__ */ import_react101.default.createElement(HttpClientContext.Provider, { value: { headers, cookies } }, children);
70333
70366
  };
70334
70367
 
70335
70368
  // ../cli-http-client-react/src/useHttpClient.ts
@@ -70342,6 +70375,7 @@ function useHttpClient({
70342
70375
  return (0, import_react102.useMemo)(
70343
70376
  () => createHttpClient({
70344
70377
  type,
70378
+ cookies: context2?.cookies,
70345
70379
  getAppToken: () => getAppToken({ siteId }),
70346
70380
  createHeaders: () => ({
70347
70381
  ...createAuthHeaders?.({ siteId }),
@@ -77095,6 +77129,7 @@ var BackOfficeHostingPlatforms2;
77095
77129
  BackOfficeHostingPlatforms3["SYMPHONY"] = "SYMPHONY";
77096
77130
  BackOfficeHostingPlatforms3["BMR"] = "BMR";
77097
77131
  BackOfficeHostingPlatforms3["WIXEL_DASHBOARD"] = "WIXEL_DASHBOARD";
77132
+ BackOfficeHostingPlatforms3["CHANNELS_BACKOFFICE"] = "CHANNELS_BACKOFFICE";
77098
77133
  })(BackOfficeHostingPlatforms2 || (BackOfficeHostingPlatforms2 = {}));
77099
77134
  var BackOfficeScriptAssetType2;
77100
77135
  (function(BackOfficeScriptAssetType3) {
@@ -77391,6 +77426,7 @@ var ComponentType2;
77391
77426
  ComponentType3["EDITOR_EXPOSURE"] = "EDITOR_EXPOSURE";
77392
77427
  ComponentType3["TOOLS_PROVIDER_CONFIG"] = "TOOLS_PROVIDER_CONFIG";
77393
77428
  ComponentType3["APP_TOOLS"] = "APP_TOOLS";
77429
+ ComponentType3["ECOM_PURCHASE_RECOMMENDATIONS"] = "ECOM_PURCHASE_RECOMMENDATIONS";
77394
77430
  })(ComponentType2 || (ComponentType2 = {}));
77395
77431
  var AuthType;
77396
77432
  (function(AuthType2) {
@@ -78956,6 +78992,7 @@ var Tag2;
78956
78992
  Tag3["OWNER_CHECKOUT"] = "OWNER_CHECKOUT";
78957
78993
  Tag3["ECOM_PREVIEW_CHECKOUT"] = "ECOM_PREVIEW_CHECKOUT";
78958
78994
  Tag3["ALL_CATEGORIES"] = "ALL_CATEGORIES";
78995
+ Tag3["ECOM_TAX_GROUPS"] = "ECOM_TAX_GROUPS";
78959
78996
  })(Tag2 || (Tag2 = {}));
78960
78997
  var ThumbnailType2;
78961
78998
  (function(ThumbnailType3) {
@@ -79653,6 +79690,7 @@ var AssetType2;
79653
79690
  AssetType3["WIDGET"] = "WIDGET";
79654
79691
  AssetType3["FONT"] = "FONT";
79655
79692
  AssetType3["ICONS"] = "ICONS";
79693
+ AssetType3["STORY"] = "STORY";
79656
79694
  })(AssetType2 || (AssetType2 = {}));
79657
79695
  var FileMediaType;
79658
79696
  (function(FileMediaType2) {
@@ -79667,6 +79705,7 @@ var FileMediaType;
79667
79705
  var AnimationType;
79668
79706
  (function(AnimationType2) {
79669
79707
  AnimationType2["VIEW"] = "VIEW";
79708
+ AnimationType2["POINTER"] = "POINTER";
79670
79709
  })(AnimationType || (AnimationType = {}));
79671
79710
  var AppType3;
79672
79711
  (function(AppType6) {
@@ -80027,6 +80066,18 @@ var WidthType2;
80027
80066
  WidthType3["ORIGINAL"] = "ORIGINAL";
80028
80067
  WidthType3["FULL_WIDTH"] = "FULL_WIDTH";
80029
80068
  })(WidthType2 || (WidthType2 = {}));
80069
+ var PointerEffectType;
80070
+ (function(PointerEffectType2) {
80071
+ PointerEffectType2["AIRY"] = "AIRY";
80072
+ PointerEffectType2["BLOB"] = "BLOB";
80073
+ PointerEffectType2["BLUR"] = "BLUR";
80074
+ PointerEffectType2["SCALE"] = "SCALE";
80075
+ PointerEffectType2["SKEW"] = "SKEW";
80076
+ PointerEffectType2["SWIVEL"] = "SWIVEL";
80077
+ PointerEffectType2["TILT_3D"] = "TILT_3D";
80078
+ PointerEffectType2["TRACK"] = "TRACK";
80079
+ PointerEffectType2["TRACK_3D"] = "TRACK_3D";
80080
+ })(PointerEffectType || (PointerEffectType = {}));
80030
80081
  var BackgroundType2;
80031
80082
  (function(BackgroundType3) {
80032
80083
  BackgroundType3["COLOR"] = "COLOR";
@@ -82943,7 +82994,7 @@ function getTasks({
82943
82994
  cause: e2
82944
82995
  });
82945
82996
  }
82946
- const { generateApp } = await import("./generator-JYIXHB6D.js");
82997
+ const { generateApp } = await import("./generator-7VK2WAO7.js");
82947
82998
  await generateApp({
82948
82999
  packageName,
82949
83000
  packageFolder,
@@ -95303,7 +95354,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
95303
95354
  var package_default = {
95304
95355
  name: "@wix/create-new",
95305
95356
  description: "General entry point for creating Wix projects",
95306
- version: "0.0.104",
95357
+ version: "0.0.105",
95307
95358
  bin: "bin/index.cjs",
95308
95359
  devDependencies: {
95309
95360
  "@commander-js/extra-typings": "^13.0.0",