@wix/cli 1.1.148 → 1.1.150
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.
- package/agents/instructions.md +84 -0
- package/build/{DevCommand-QSEX33CH.js → DevCommand-BEEUZFP6.js} +50 -38
- package/build/DevCommand-BEEUZFP6.js.map +1 -0
- package/build/{EnvPullCommand-6FOYVETB.js → EnvPullCommand-22WYBFTO.js} +3 -3
- package/build/{EnvRemoveCommand-BDX7BG4C.js → EnvRemoveCommand-H6VFMJLM.js} +2 -2
- package/build/{EnvSetCommand-YV7KQDTG.js → EnvSetCommand-TDY5NJDM.js} +2 -2
- package/build/{GenerateCommand-SARUYR3M.js → GenerateCommand-WJB2UILL.js} +3 -3
- package/build/{LoginCommand-ULOYAGDX.js → LoginCommand-JV2P5FVD.js} +2 -2
- package/build/{PreviewCommand-D6P52RJP.js → PreviewCommand-4KGWWAOZ.js} +5 -5
- package/build/{PromoteCommand-CJUQIMD7.js → PromoteCommand-GG36WPXX.js} +5 -5
- package/build/{ReleaseCommand-FAHUZJYF.js → ReleaseCommand-5ADFVNOT.js} +12 -15
- package/build/ReleaseCommand-5ADFVNOT.js.map +1 -0
- package/build/{chunk-CGXS2RLO.js → chunk-6B3FQNMV.js} +2 -2
- package/build/{chunk-VGSKNKR5.js → chunk-72CAXPDG.js} +128 -51
- package/build/chunk-72CAXPDG.js.map +1 -0
- package/build/{chunk-WUQ34TQE.js → chunk-EVV3LZAI.js} +2 -2
- package/build/{chunk-2OAP2LLX.js → chunk-VT3OGC5F.js} +2 -2
- package/build/{chunk-DLDELYVB.js → chunk-W34JWURA.js} +1 -2
- package/build/{chunk-4GSO6VQT.js → chunk-WBI2P4YN.js} +2 -2
- package/build/{chunk-DUJVHVKZ.js → chunk-X37NAAXG.js} +4 -3
- package/build/chunk-X37NAAXG.js.map +1 -0
- package/build/{chunk-WOLJ45IG.js → chunk-YYY4GDEZ.js} +137 -359
- package/build/chunk-YYY4GDEZ.js.map +1 -0
- package/build/{env-pull-MXPEH223.js → env-pull-ENQPMILC.js} +4 -4
- package/build/index.js +6 -6
- package/build/{preview-GCYV2BWG.js → preview-M4QT6YMK.js} +6 -6
- package/build/{render-command-QYBNOZ2B.js → render-command-H3NMLDRT.js} +2 -2
- package/build/{render-command-CMTVNSQY.js → render-command-TH5F34LX.js} +3 -3
- package/build/{src-WCTCENDD.js → src-FZRIREVI.js} +20 -20
- package/build/src-FZRIREVI.js.map +1 -0
- package/package.json +4 -3
- package/build/DevCommand-QSEX33CH.js.map +0 -1
- package/build/ReleaseCommand-FAHUZJYF.js.map +0 -1
- package/build/chunk-DUJVHVKZ.js.map +0 -1
- package/build/chunk-VGSKNKR5.js.map +0 -1
- package/build/chunk-WOLJ45IG.js.map +0 -1
- package/build/src-WCTCENDD.js.map +0 -1
- /package/build/{EnvPullCommand-6FOYVETB.js.map → EnvPullCommand-22WYBFTO.js.map} +0 -0
- /package/build/{EnvRemoveCommand-BDX7BG4C.js.map → EnvRemoveCommand-H6VFMJLM.js.map} +0 -0
- /package/build/{EnvSetCommand-YV7KQDTG.js.map → EnvSetCommand-TDY5NJDM.js.map} +0 -0
- /package/build/{GenerateCommand-SARUYR3M.js.map → GenerateCommand-WJB2UILL.js.map} +0 -0
- /package/build/{LoginCommand-ULOYAGDX.js.map → LoginCommand-JV2P5FVD.js.map} +0 -0
- /package/build/{PreviewCommand-D6P52RJP.js.map → PreviewCommand-4KGWWAOZ.js.map} +0 -0
- /package/build/{PromoteCommand-CJUQIMD7.js.map → PromoteCommand-GG36WPXX.js.map} +0 -0
- /package/build/{chunk-CGXS2RLO.js.map → chunk-6B3FQNMV.js.map} +0 -0
- /package/build/{chunk-WUQ34TQE.js.map → chunk-EVV3LZAI.js.map} +0 -0
- /package/build/{chunk-2OAP2LLX.js.map → chunk-VT3OGC5F.js.map} +0 -0
- /package/build/{chunk-DLDELYVB.js.map → chunk-W34JWURA.js.map} +0 -0
- /package/build/{chunk-4GSO6VQT.js.map → chunk-WBI2P4YN.js.map} +0 -0
- /package/build/{env-pull-MXPEH223.js.map → env-pull-ENQPMILC.js.map} +0 -0
- /package/build/{preview-GCYV2BWG.js.map → preview-M4QT6YMK.js.map} +0 -0
- /package/build/{render-command-QYBNOZ2B.js.map → render-command-H3NMLDRT.js.map} +0 -0
- /package/build/{render-command-CMTVNSQY.js.map → render-command-TH5F34LX.js.map} +0 -0
|
@@ -2,25 +2,23 @@ import { createRequire as _createRequire } from 'node:module';
|
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
useDevCenterClient
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EVV3LZAI.js";
|
|
6
6
|
import {
|
|
7
7
|
wixCliAction,
|
|
8
8
|
wixCliAppFlowStepsAnswers
|
|
9
9
|
} from "./chunk-SC2W3WT3.js";
|
|
10
10
|
import {
|
|
11
11
|
AlgorithmType,
|
|
12
|
-
BACKEND_WORKER_COMPONENT_ID,
|
|
13
12
|
ComponentType,
|
|
14
13
|
ElementType,
|
|
15
14
|
EmbedCategory,
|
|
16
15
|
EmbeddedScriptPlacement,
|
|
17
16
|
PanelMode,
|
|
18
|
-
PlatformType,
|
|
19
17
|
Width,
|
|
20
18
|
deploymentTopologySchema,
|
|
21
19
|
getDeploymentTopologyPath,
|
|
22
20
|
useProjectModel
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-W34JWURA.js";
|
|
24
22
|
import {
|
|
25
23
|
useHttpClient
|
|
26
24
|
} from "./chunk-EYV3FS5W.js";
|
|
@@ -3079,9 +3077,9 @@ ${trace}`);
|
|
|
3079
3077
|
Object.defineProperty(exports2, "__esModule", {
|
|
3080
3078
|
value: true
|
|
3081
3079
|
});
|
|
3082
|
-
exports2.default =
|
|
3080
|
+
exports2.default = isType2;
|
|
3083
3081
|
var _index = require_definitions();
|
|
3084
|
-
function
|
|
3082
|
+
function isType2(nodeType, targetType) {
|
|
3085
3083
|
if (nodeType === targetType) return true;
|
|
3086
3084
|
if (nodeType == null) return false;
|
|
3087
3085
|
if (_index.ALIAS_KEYS[targetType]) return false;
|
|
@@ -35765,7 +35763,7 @@ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toS
|
|
|
35765
35763
|
return false;
|
|
35766
35764
|
}
|
|
35767
35765
|
}
|
|
35768
|
-
function
|
|
35766
|
+
function isType2(node) {
|
|
35769
35767
|
return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node);
|
|
35770
35768
|
}
|
|
35771
35769
|
var nodes = exports2.nodes = {
|
|
@@ -35801,7 +35799,7 @@ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toS
|
|
|
35801
35799
|
VariableDeclaration(node) {
|
|
35802
35800
|
for (let i = 0; i < node.declarations.length; i++) {
|
|
35803
35801
|
const declar = node.declarations[i];
|
|
35804
|
-
let enabled = isHelper(declar.id) && !
|
|
35802
|
+
let enabled = isHelper(declar.id) && !isType2(declar.init);
|
|
35805
35803
|
if (!enabled && declar.init) {
|
|
35806
35804
|
const state = crawl(declar.init);
|
|
35807
35805
|
enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
|
|
@@ -43382,7 +43380,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
43382
43380
|
isIdentifier,
|
|
43383
43381
|
isLiteral,
|
|
43384
43382
|
isStringLiteral,
|
|
43385
|
-
isType:
|
|
43383
|
+
isType: isType2,
|
|
43386
43384
|
matchesPattern: _matchesPattern
|
|
43387
43385
|
} = _t;
|
|
43388
43386
|
function matchesPattern(pattern, allowPartial) {
|
|
@@ -43412,7 +43410,7 @@ ${" ".repeat(indentSize)}`);
|
|
|
43412
43410
|
};
|
|
43413
43411
|
}
|
|
43414
43412
|
function isNodeType(type) {
|
|
43415
|
-
return
|
|
43413
|
+
return isType2(this.type, type);
|
|
43416
43414
|
}
|
|
43417
43415
|
function canHaveVariableDeclarationOrExpression() {
|
|
43418
43416
|
return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
|
|
@@ -107148,7 +107146,7 @@ var embeddedScriptConfigSchema = external_exports.object({
|
|
|
107148
107146
|
"An enum indicating where in the page's DOM the HTML code will be injected."
|
|
107149
107147
|
)
|
|
107150
107148
|
}).strict();
|
|
107151
|
-
var
|
|
107149
|
+
var PlatformType = (0, import_variant2.variant)({
|
|
107152
107150
|
Site: {},
|
|
107153
107151
|
Editor: {},
|
|
107154
107152
|
Dashboard: {},
|
|
@@ -107419,6 +107417,48 @@ var siteComponentPanelConfigSchema = external_exports.object({
|
|
|
107419
107417
|
panelMode: external_exports.enum([PanelMode.overlay]).optional()
|
|
107420
107418
|
}).strict();
|
|
107421
107419
|
|
|
107420
|
+
// ../cli-astro-commands/src/files/app.config.ts
|
|
107421
|
+
init_esm_shims();
|
|
107422
|
+
async function readAppConfig(projectFolder, writeDebugLog) {
|
|
107423
|
+
const configPath = getAppConfigPath(projectFolder);
|
|
107424
|
+
const isConfigExist = await pathExists(configPath);
|
|
107425
|
+
if (!isConfigExist) {
|
|
107426
|
+
return null;
|
|
107427
|
+
}
|
|
107428
|
+
try {
|
|
107429
|
+
const json = await readJson(configPath);
|
|
107430
|
+
const appConfig = await appConfigSchema.safeParseAsync(json);
|
|
107431
|
+
if (!appConfig.success) {
|
|
107432
|
+
return null;
|
|
107433
|
+
}
|
|
107434
|
+
return appConfig.data;
|
|
107435
|
+
} catch (e) {
|
|
107436
|
+
writeDebugLog?.(e);
|
|
107437
|
+
return null;
|
|
107438
|
+
}
|
|
107439
|
+
}
|
|
107440
|
+
async function saveAppConfig(projectFolder, config) {
|
|
107441
|
+
const currentConfig = await readAppConfig(projectFolder) ?? {};
|
|
107442
|
+
const newConfig = {
|
|
107443
|
+
...currentConfig,
|
|
107444
|
+
...config
|
|
107445
|
+
};
|
|
107446
|
+
await writeJson(getAppConfigPath(projectFolder), newConfig);
|
|
107447
|
+
}
|
|
107448
|
+
|
|
107449
|
+
// ../cli-astro-commands/src/site/ResolveSite.tsx
|
|
107450
|
+
init_esm_shims();
|
|
107451
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
107452
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
107453
|
+
|
|
107454
|
+
// ../cli-site-selector/src/index.ts
|
|
107455
|
+
init_esm_shims();
|
|
107456
|
+
|
|
107457
|
+
// ../cli-site-selector/src/SiteSelector.tsx
|
|
107458
|
+
init_esm_shims();
|
|
107459
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
107460
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
107461
|
+
|
|
107422
107462
|
// ../site-list-client/src/index.ts
|
|
107423
107463
|
init_esm_shims();
|
|
107424
107464
|
|
|
@@ -107648,48 +107688,6 @@ function useSiteListClient() {
|
|
|
107648
107688
|
return usePanoramaMethodLogger(client);
|
|
107649
107689
|
}
|
|
107650
107690
|
|
|
107651
|
-
// ../cli-astro-commands/src/files/app.config.ts
|
|
107652
|
-
init_esm_shims();
|
|
107653
|
-
async function readAppConfig(projectFolder, writeDebugLog) {
|
|
107654
|
-
const configPath = getAppConfigPath(projectFolder);
|
|
107655
|
-
const isConfigExist = await pathExists(configPath);
|
|
107656
|
-
if (!isConfigExist) {
|
|
107657
|
-
return null;
|
|
107658
|
-
}
|
|
107659
|
-
try {
|
|
107660
|
-
const json = await readJson(configPath);
|
|
107661
|
-
const appConfig = await appConfigSchema.safeParseAsync(json);
|
|
107662
|
-
if (!appConfig.success) {
|
|
107663
|
-
return null;
|
|
107664
|
-
}
|
|
107665
|
-
return appConfig.data;
|
|
107666
|
-
} catch (e) {
|
|
107667
|
-
writeDebugLog?.(e);
|
|
107668
|
-
return null;
|
|
107669
|
-
}
|
|
107670
|
-
}
|
|
107671
|
-
async function saveAppConfig(projectFolder, config) {
|
|
107672
|
-
const currentConfig = await readAppConfig(projectFolder) ?? {};
|
|
107673
|
-
const newConfig = {
|
|
107674
|
-
...currentConfig,
|
|
107675
|
-
...config
|
|
107676
|
-
};
|
|
107677
|
-
await writeJson(getAppConfigPath(projectFolder), newConfig);
|
|
107678
|
-
}
|
|
107679
|
-
|
|
107680
|
-
// ../cli-astro-commands/src/site/ResolveSite.tsx
|
|
107681
|
-
init_esm_shims();
|
|
107682
|
-
var import_react11 = __toESM(require_react(), 1);
|
|
107683
|
-
var import_variant8 = __toESM(require_lib(), 1);
|
|
107684
|
-
|
|
107685
|
-
// ../cli-site-selector/src/index.ts
|
|
107686
|
-
init_esm_shims();
|
|
107687
|
-
|
|
107688
|
-
// ../cli-site-selector/src/SiteSelector.tsx
|
|
107689
|
-
init_esm_shims();
|
|
107690
|
-
var import_react10 = __toESM(require_react(), 1);
|
|
107691
|
-
var import_variant7 = __toESM(require_lib(), 1);
|
|
107692
|
-
|
|
107693
107691
|
// ../cli-site-selector/src/SiteTypeSelect.tsx
|
|
107694
107692
|
init_esm_shims();
|
|
107695
107693
|
var import_react4 = __toESM(require_react(), 1);
|
|
@@ -108093,14 +108091,13 @@ var ResolveSite = ({ state, onSubmit }) => {
|
|
|
108093
108091
|
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, (0, import_variant8.match)(state, {
|
|
108094
108092
|
NotConfigured: (0, import_variant8.constant)(
|
|
108095
108093
|
/* @__PURE__ */ import_react11.default.createElement(Alert, { type: "insight" }, "You don't have a Development Site currently configured")
|
|
108096
|
-
)
|
|
108097
|
-
NotFound: ({ id }) => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(Alert, { type: "error" }, /* @__PURE__ */ import_react11.default.createElement(Text, null, "Your currently configured Development Site was not found (", id, ")")), /* @__PURE__ */ import_react11.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react11.default.createElement(Text, null, "This may happen because the site was deleted or your access has been revoked."), /* @__PURE__ */ import_react11.default.createElement(Text, null, "Please select another Development Site to continue.")))
|
|
108094
|
+
)
|
|
108098
108095
|
}), /* @__PURE__ */ import_react11.default.createElement(
|
|
108099
108096
|
SiteSelector,
|
|
108100
108097
|
{
|
|
108101
108098
|
appId: model.config.appId,
|
|
108102
108099
|
biLogger,
|
|
108103
|
-
onSubmit,
|
|
108100
|
+
onSubmit: (site) => onSubmit(site.id),
|
|
108104
108101
|
onError: exit
|
|
108105
108102
|
}
|
|
108106
108103
|
));
|
|
@@ -108116,26 +108113,9 @@ init_esm_shims();
|
|
|
108116
108113
|
var import_variant9 = __toESM(require_lib(), 1);
|
|
108117
108114
|
var SiteState = (0, import_variant9.variant)({
|
|
108118
108115
|
NotConfigured: {},
|
|
108119
|
-
NotFound: (0, import_variant9.fields)(),
|
|
108120
108116
|
Resolved: (0, import_variant9.fields)()
|
|
108121
108117
|
});
|
|
108122
108118
|
|
|
108123
|
-
// ../cli-astro-commands/src/site/resolve-configured-site.ts
|
|
108124
|
-
init_esm_shims();
|
|
108125
|
-
async function resolveConfiguredSite({
|
|
108126
|
-
siteListClient: { getSite },
|
|
108127
|
-
siteId
|
|
108128
|
-
}) {
|
|
108129
|
-
if (!siteId) {
|
|
108130
|
-
return SiteState.NotConfigured();
|
|
108131
|
-
}
|
|
108132
|
-
const site = await getSite(siteId, true);
|
|
108133
|
-
if (!site) {
|
|
108134
|
-
return SiteState.NotFound({ id: siteId });
|
|
108135
|
-
}
|
|
108136
|
-
return SiteState.Resolved({ site });
|
|
108137
|
-
}
|
|
108138
|
-
|
|
108139
108119
|
// ../cli-astro-commands/src/site/SiteProvider.tsx
|
|
108140
108120
|
var SiteProvider = ({ children }) => {
|
|
108141
108121
|
const exit = useExit();
|
|
@@ -108143,18 +108123,15 @@ var SiteProvider = ({ children }) => {
|
|
|
108143
108123
|
model: { projectFolder, config }
|
|
108144
108124
|
} = useProjectModel();
|
|
108145
108125
|
const writeDebugLog = useDebugLog();
|
|
108146
|
-
const siteListClient = useSiteListClient();
|
|
108147
108126
|
const { status, merge } = useAsync(async () => {
|
|
108148
|
-
|
|
108149
|
-
|
|
108150
|
-
siteId: config.projectType === "Site" ? config.siteId : (await readAppConfig(projectFolder, writeDebugLog))?.siteId
|
|
108151
|
-
});
|
|
108127
|
+
const siteId = config.projectType === "Site" ? config.siteId : (await readAppConfig(projectFolder, writeDebugLog))?.siteId;
|
|
108128
|
+
return siteId ? SiteState.Resolved({ siteId }) : SiteState.NotConfigured();
|
|
108152
108129
|
}, []);
|
|
108153
108130
|
const setSite = (0, import_react13.useCallback)(
|
|
108154
|
-
async (
|
|
108131
|
+
async (siteId) => {
|
|
108155
108132
|
try {
|
|
108156
|
-
await saveAppConfig(projectFolder, { siteId
|
|
108157
|
-
merge({ result: SiteState.Resolved({
|
|
108133
|
+
await saveAppConfig(projectFolder, { siteId });
|
|
108134
|
+
merge({ result: SiteState.Resolved({ siteId }) });
|
|
108158
108135
|
} catch (e) {
|
|
108159
108136
|
throw new CliError({
|
|
108160
108137
|
code: CliErrorCode.FailedToSaveDevelopmentSite({
|
|
@@ -108167,7 +108144,7 @@ var SiteProvider = ({ children }) => {
|
|
|
108167
108144
|
[merge, projectFolder]
|
|
108168
108145
|
);
|
|
108169
108146
|
const handleResolveSite = (0, import_react13.useCallback)(
|
|
108170
|
-
(
|
|
108147
|
+
(siteId) => setSite(siteId).catch(exit),
|
|
108171
108148
|
[exit, setSite]
|
|
108172
108149
|
);
|
|
108173
108150
|
return (0, import_variant10.match)(status, {
|
|
@@ -108176,25 +108153,21 @@ var SiteProvider = ({ children }) => {
|
|
|
108176
108153
|
Success: ({ result: state }) => {
|
|
108177
108154
|
return (0, import_variant10.match)(state, {
|
|
108178
108155
|
NotConfigured: (variant5) => /* @__PURE__ */ import_react13.default.createElement(ResolveSite, { state: variant5, onSubmit: handleResolveSite }),
|
|
108179
|
-
|
|
108180
|
-
Resolved: ({ site }) => /* @__PURE__ */ import_react13.default.createElement(
|
|
108156
|
+
Resolved: ({ siteId }) => /* @__PURE__ */ import_react13.default.createElement(
|
|
108181
108157
|
SiteContext.Provider,
|
|
108182
108158
|
{
|
|
108183
108159
|
value: {
|
|
108184
|
-
|
|
108160
|
+
siteId,
|
|
108185
108161
|
setSite
|
|
108186
108162
|
}
|
|
108187
108163
|
},
|
|
108188
|
-
typeof children === "function" ? children(
|
|
108164
|
+
typeof children === "function" ? children(siteId) : children
|
|
108189
108165
|
)
|
|
108190
108166
|
});
|
|
108191
108167
|
}
|
|
108192
108168
|
});
|
|
108193
108169
|
};
|
|
108194
108170
|
|
|
108195
|
-
// ../cli-astro-commands/src/site/index.ts
|
|
108196
|
-
init_esm_shims();
|
|
108197
|
-
|
|
108198
108171
|
// ../cli-astro-commands/src/site/useSite.ts
|
|
108199
108172
|
init_esm_shims();
|
|
108200
108173
|
var import_react14 = __toESM(require_react(), 1);
|
|
@@ -108206,266 +108179,97 @@ function useSite() {
|
|
|
108206
108179
|
return context;
|
|
108207
108180
|
}
|
|
108208
108181
|
|
|
108209
|
-
// ../cli-astro-commands/src/components/PreviewCommand/hooks/useUpdateManifest.ts
|
|
108210
|
-
init_esm_shims();
|
|
108211
|
-
var import_react15 = __toESM(require_react(), 1);
|
|
108212
|
-
var componentHandlers = {
|
|
108213
|
-
[ComponentType.WEBHOOK]: ({ component, serverUrl, tunnelUrl }) => {
|
|
108214
|
-
component.compData.webhook.callbackUrl = normalizeUrl(
|
|
108215
|
-
component.compData.webhook.callbackUrl,
|
|
108216
|
-
tunnelUrl ?? serverUrl
|
|
108217
|
-
);
|
|
108218
|
-
},
|
|
108219
|
-
[ComponentType.BACK_OFFICE_PAGE]: ({ component, serverUrl }) => {
|
|
108220
|
-
component.compData.backOfficePage.iframeUrl = normalizeUrl(
|
|
108221
|
-
component.compData.backOfficePage.iframeUrl,
|
|
108222
|
-
serverUrl
|
|
108223
|
-
);
|
|
108224
|
-
},
|
|
108225
|
-
[ComponentType.BACK_OFFICE_EXTENSION_WIDGET]: ({ component, serverUrl }) => {
|
|
108226
|
-
component.compData.backOfficeExtensionWidget.iframeUrl = normalizeUrl(
|
|
108227
|
-
component.compData.backOfficeExtensionWidget.iframeUrl,
|
|
108228
|
-
serverUrl
|
|
108229
|
-
);
|
|
108230
|
-
},
|
|
108231
|
-
[ComponentType.BACK_OFFICE_MODAL]: ({ component, serverUrl }) => {
|
|
108232
|
-
component.compData.backOfficeModal.iframeUrl = normalizeUrl(
|
|
108233
|
-
component.compData.backOfficeModal.iframeUrl,
|
|
108234
|
-
serverUrl
|
|
108235
|
-
);
|
|
108236
|
-
},
|
|
108237
|
-
[ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM]: ({
|
|
108238
|
-
component,
|
|
108239
|
-
serverUrl
|
|
108240
|
-
}) => {
|
|
108241
|
-
component.compData.backOfficeExtensionMenuItem.iframeUrl = normalizeUrl(
|
|
108242
|
-
component.compData.backOfficeExtensionMenuItem.iframeUrl,
|
|
108243
|
-
serverUrl
|
|
108244
|
-
);
|
|
108245
|
-
},
|
|
108246
|
-
[ComponentType.ECOM_SHIPPING_RATES]: ({
|
|
108247
|
-
component,
|
|
108248
|
-
serverUrl,
|
|
108249
|
-
tunnelUrl
|
|
108250
|
-
}) => {
|
|
108251
|
-
component.compData.ecomShippingRates.deploymentUri = normalizeUrl(
|
|
108252
|
-
component.compData.ecomShippingRates.deploymentUri,
|
|
108253
|
-
tunnelUrl ?? serverUrl
|
|
108254
|
-
);
|
|
108255
|
-
},
|
|
108256
|
-
[ComponentType.ECOM_ADDITIONAL_FEES]: ({
|
|
108257
|
-
component,
|
|
108258
|
-
serverUrl,
|
|
108259
|
-
tunnelUrl
|
|
108260
|
-
}) => {
|
|
108261
|
-
component.compData.ecomAdditionalFees.deploymentUri = normalizeUrl(
|
|
108262
|
-
component.compData.ecomAdditionalFees.deploymentUri,
|
|
108263
|
-
tunnelUrl ?? serverUrl
|
|
108264
|
-
);
|
|
108265
|
-
},
|
|
108266
|
-
[ComponentType.ECOM_DISCOUNTS_TRIGGER]: ({
|
|
108267
|
-
component,
|
|
108268
|
-
serverUrl,
|
|
108269
|
-
tunnelUrl
|
|
108270
|
-
}) => {
|
|
108271
|
-
component.compData.ecomDiscountsTrigger.deploymentUri = normalizeUrl(
|
|
108272
|
-
component.compData.ecomDiscountsTrigger.deploymentUri,
|
|
108273
|
-
tunnelUrl ?? serverUrl
|
|
108274
|
-
);
|
|
108275
|
-
},
|
|
108276
|
-
[ComponentType.ECOM_VALIDATIONS]: ({ component, serverUrl, tunnelUrl }) => {
|
|
108277
|
-
component.compData.ecomValidations.deploymentUri = normalizeUrl(
|
|
108278
|
-
component.compData.ecomValidations.deploymentUri,
|
|
108279
|
-
tunnelUrl ?? serverUrl
|
|
108280
|
-
);
|
|
108281
|
-
},
|
|
108282
|
-
[ComponentType.ECOM_PAYMENT_SETTINGS]: ({
|
|
108283
|
-
component,
|
|
108284
|
-
serverUrl,
|
|
108285
|
-
tunnelUrl
|
|
108286
|
-
}) => {
|
|
108287
|
-
component.compData.ecomPaymentSettings.deploymentUri = normalizeUrl(
|
|
108288
|
-
component.compData.ecomPaymentSettings.deploymentUri,
|
|
108289
|
-
tunnelUrl ?? serverUrl
|
|
108290
|
-
);
|
|
108291
|
-
},
|
|
108292
|
-
[ComponentType.GIFT_CARDS_PROVIDER]: ({
|
|
108293
|
-
component,
|
|
108294
|
-
serverUrl,
|
|
108295
|
-
tunnelUrl
|
|
108296
|
-
}) => {
|
|
108297
|
-
component.compData.giftCardsProvider.deploymentUri = normalizeUrl(
|
|
108298
|
-
component.compData.giftCardsProvider.deploymentUri,
|
|
108299
|
-
tunnelUrl ?? serverUrl
|
|
108300
|
-
);
|
|
108301
|
-
},
|
|
108302
|
-
[ComponentType.BOOKINGS_PRICING_PROVIDER]: ({
|
|
108303
|
-
component,
|
|
108304
|
-
serverUrl,
|
|
108305
|
-
tunnelUrl
|
|
108306
|
-
}) => {
|
|
108307
|
-
component.compData.bookingsPricingProvider.deploymentUri = normalizeUrl(
|
|
108308
|
-
component.compData.bookingsPricingProvider.deploymentUri,
|
|
108309
|
-
tunnelUrl ?? serverUrl
|
|
108310
|
-
);
|
|
108311
|
-
},
|
|
108312
|
-
[ComponentType.TOPOLOGY]: ({ component, serverUrl, tunnelUrl }) => {
|
|
108313
|
-
component.compData.topology.topology.backendApiUrl = tunnelUrl ?? serverUrl;
|
|
108314
|
-
}
|
|
108315
|
-
};
|
|
108316
|
-
function useUpdateManifest() {
|
|
108317
|
-
const updateManifest = (0, import_react15.useCallback)(
|
|
108318
|
-
(manifest, serverUrl, tunnelUrl) => {
|
|
108319
|
-
const clone = structuredClone(manifest);
|
|
108320
|
-
for (const component of clone.components) {
|
|
108321
|
-
const handler = getHandler(
|
|
108322
|
-
component,
|
|
108323
|
-
componentHandlers
|
|
108324
|
-
);
|
|
108325
|
-
handler?.({
|
|
108326
|
-
component,
|
|
108327
|
-
serverUrl,
|
|
108328
|
-
tunnelUrl
|
|
108329
|
-
});
|
|
108330
|
-
}
|
|
108331
|
-
return clone;
|
|
108332
|
-
},
|
|
108333
|
-
[]
|
|
108334
|
-
);
|
|
108335
|
-
const updateManifestWithBackendWorker = (0, import_react15.useCallback)(
|
|
108336
|
-
(manifest, deploymentId, deploymentUrl, label, commitHash) => {
|
|
108337
|
-
const clone = structuredClone(manifest);
|
|
108338
|
-
clone.components.push({
|
|
108339
|
-
compId: BACKEND_WORKER_COMPONENT_ID,
|
|
108340
|
-
compType: ComponentType.BACKEND_WORKER,
|
|
108341
|
-
compData: {
|
|
108342
|
-
backendWorker: {
|
|
108343
|
-
deploymentId,
|
|
108344
|
-
deploymentUrl,
|
|
108345
|
-
label,
|
|
108346
|
-
commitHash
|
|
108347
|
-
}
|
|
108348
|
-
}
|
|
108349
|
-
});
|
|
108350
|
-
return clone;
|
|
108351
|
-
},
|
|
108352
|
-
[]
|
|
108353
|
-
);
|
|
108354
|
-
return {
|
|
108355
|
-
updateManifest,
|
|
108356
|
-
updateManifestWithBackendWorker
|
|
108357
|
-
};
|
|
108358
|
-
}
|
|
108359
|
-
function getHandler(component, handlers) {
|
|
108360
|
-
return handlers[component.compType];
|
|
108361
|
-
}
|
|
108362
|
-
function normalizeUrl(inputUrl, baseUrl) {
|
|
108363
|
-
if (!inputUrl) {
|
|
108364
|
-
return baseUrl;
|
|
108365
|
-
}
|
|
108366
|
-
if (URL.canParse(inputUrl)) {
|
|
108367
|
-
return inputUrl;
|
|
108368
|
-
}
|
|
108369
|
-
const base = new URL(baseUrl);
|
|
108370
|
-
const normalizedUrl = new URL(inputUrl, base);
|
|
108371
|
-
if (base.search) {
|
|
108372
|
-
normalizedUrl.search = base.search;
|
|
108373
|
-
}
|
|
108374
|
-
return normalizedUrl.href;
|
|
108375
|
-
}
|
|
108376
|
-
|
|
108377
108182
|
// ../cli-astro-commands/src/components/PlatformLink/PlatformLink.tsx
|
|
108378
108183
|
init_esm_shims();
|
|
108379
|
-
var
|
|
108184
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
108380
108185
|
var PlatformLink = ({ url, label }) => {
|
|
108381
|
-
return /* @__PURE__ */
|
|
108186
|
+
return /* @__PURE__ */ import_react15.default.createElement(Box_default, { marginRight: 1 }, /* @__PURE__ */ import_react15.default.createElement(PointerSmallIcon, null), /* @__PURE__ */ import_react15.default.createElement(Box_default, { marginLeft: 1 }, /* @__PURE__ */ import_react15.default.createElement(Link, { url }, label)));
|
|
108382
108187
|
};
|
|
108383
108188
|
|
|
108384
|
-
// ../cli-astro-commands/src/components/
|
|
108189
|
+
// ../cli-astro-commands/src/components/PlatformLink/RedirectLink.tsx
|
|
108385
108190
|
init_esm_shims();
|
|
108386
|
-
var
|
|
108191
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
108387
108192
|
var import_variant11 = __toESM(require_lib(), 1);
|
|
108388
|
-
|
|
108389
|
-
|
|
108390
|
-
const
|
|
108391
|
-
const
|
|
108392
|
-
|
|
108393
|
-
|
|
108394
|
-
|
|
108395
|
-
|
|
108396
|
-
|
|
108397
|
-
|
|
108398
|
-
|
|
108399
|
-
|
|
108400
|
-
|
|
108401
|
-
|
|
108402
|
-
|
|
108403
|
-
elgarRedirectUrl.searchParams.append("experiments", `${spec}#true`);
|
|
108193
|
+
import { URL as URL2 } from "node:url";
|
|
108194
|
+
var createAppInstallerUrl = (redirectUrl, options) => {
|
|
108195
|
+
const { appId, versionOverrideId } = options;
|
|
108196
|
+
const installerUrl = new URL2(`https://www.wix.com/app-installer`);
|
|
108197
|
+
installerUrl.searchParams.append("appId", appId);
|
|
108198
|
+
installerUrl.searchParams.append("versionOverrideId", versionOverrideId);
|
|
108199
|
+
installerUrl.searchParams.append("postInstallationUrl", redirectUrl);
|
|
108200
|
+
return installerUrl.toString();
|
|
108201
|
+
};
|
|
108202
|
+
var createRedirectLink = (options) => {
|
|
108203
|
+
const { platform, tenantId, appId, versionOverrideId } = options;
|
|
108204
|
+
const url = new URL2("https://dev.wix.com/wix-cli-redirect-service/redirect");
|
|
108205
|
+
url.searchParams.append("platform", platform);
|
|
108206
|
+
if (versionOverrideId) {
|
|
108207
|
+
url.searchParams.append("versionOverrideId", versionOverrideId);
|
|
108404
108208
|
}
|
|
108405
|
-
|
|
108406
|
-
|
|
108407
|
-
|
|
108209
|
+
if (!tenantId) {
|
|
108210
|
+
return createAppInstallerUrl(url.toString(), {
|
|
108211
|
+
appId: options.appId,
|
|
108212
|
+
versionOverrideId: options.versionOverrideId
|
|
108213
|
+
});
|
|
108214
|
+
}
|
|
108215
|
+
if (tenantId) {
|
|
108216
|
+
url.searchParams.append("tenantId", tenantId);
|
|
108217
|
+
}
|
|
108218
|
+
url.searchParams.append("appId", appId);
|
|
108219
|
+
return url.toString();
|
|
108408
108220
|
};
|
|
108409
|
-
|
|
108221
|
+
var RedirectLink = ({
|
|
108222
|
+
platform,
|
|
108223
|
+
armTag,
|
|
108224
|
+
tenantId
|
|
108225
|
+
}) => {
|
|
108410
108226
|
const { model } = useProjectModel();
|
|
108411
|
-
const
|
|
108412
|
-
|
|
108413
|
-
(
|
|
108414
|
-
|
|
108415
|
-
armTag
|
|
108416
|
-
}) => {
|
|
108417
|
-
return resolvePlatformUrl(platformType, {
|
|
108418
|
-
site,
|
|
108419
|
-
appId: model.config.appId,
|
|
108420
|
-
tag: armTag
|
|
108421
|
-
});
|
|
108422
|
-
},
|
|
108423
|
-
[site, model.config.appId]
|
|
108424
|
-
);
|
|
108425
|
-
}
|
|
108426
|
-
function resolvePlatformUrl(platformType, options) {
|
|
108427
|
-
const { site, tag, appId } = options;
|
|
108428
|
-
const url = (0, import_variant11.match)(platformType, {
|
|
108429
|
-
Dashboard: () => new URL(`dashboard/${site.id}`, "https://manage.wix.com/"),
|
|
108430
|
-
Editor: () => {
|
|
108431
|
-
const editorUrl = new URL(`https://manage.wix.com/editor/${site.id}`);
|
|
108432
|
-
editorUrl.searchParams.append("etpa", appId);
|
|
108433
|
-
return editorUrl;
|
|
108434
|
-
},
|
|
108435
|
-
Site: () => {
|
|
108436
|
-
return site.viewUrl ? new URL(site.viewUrl) : void 0;
|
|
108437
|
-
}
|
|
108227
|
+
const label = (0, import_variant11.match)(platform, {
|
|
108228
|
+
editor: () => "Editor",
|
|
108229
|
+
dashboard: () => "Dashboard",
|
|
108230
|
+
site: () => "Site"
|
|
108438
108231
|
});
|
|
108439
|
-
|
|
108440
|
-
|
|
108441
|
-
|
|
108442
|
-
|
|
108443
|
-
|
|
108444
|
-
|
|
108445
|
-
}
|
|
108446
|
-
}
|
|
108232
|
+
const url = createRedirectLink({
|
|
108233
|
+
platform,
|
|
108234
|
+
appId: model.config.appId,
|
|
108235
|
+
versionOverrideId: armTag,
|
|
108236
|
+
tenantId
|
|
108237
|
+
});
|
|
108238
|
+
return /* @__PURE__ */ import_react16.default.createElement(Box_default, { marginRight: 1 }, /* @__PURE__ */ import_react16.default.createElement(PointerSmallIcon, null), /* @__PURE__ */ import_react16.default.createElement(Box_default, { marginLeft: 1 }, /* @__PURE__ */ import_react16.default.createElement(Link, { url }, label)));
|
|
108239
|
+
};
|
|
108447
108240
|
|
|
108448
108241
|
// ../cli-astro-commands/src/hooks/useUpdateDeploymentTopology.ts
|
|
108449
108242
|
init_esm_shims();
|
|
108450
|
-
function useUpdateDeploymentTopology() {
|
|
108243
|
+
function useUpdateDeploymentTopology(siteId) {
|
|
108451
108244
|
const {
|
|
108452
108245
|
model: { projectFolder, config }
|
|
108453
108246
|
} = useProjectModel();
|
|
108454
|
-
const resolvePlatformUrl2 = useResolvePlatformUrl();
|
|
108455
108247
|
return useAsyncCallback(async (_, props) => {
|
|
108456
108248
|
const { environment, siteUrl, armTag } = props;
|
|
108457
|
-
const _siteUrl = siteUrl ??
|
|
108458
|
-
|
|
108459
|
-
|
|
108249
|
+
const _siteUrl = siteUrl ?? createRedirectLink({
|
|
108250
|
+
platform: "site",
|
|
108251
|
+
appId: config.appId,
|
|
108252
|
+
versionOverrideId: armTag,
|
|
108253
|
+
...siteId ? {
|
|
108254
|
+
tenantId: siteId
|
|
108255
|
+
} : null
|
|
108460
108256
|
});
|
|
108461
|
-
const editorUrl = config.projectType === "App" ?
|
|
108462
|
-
|
|
108463
|
-
|
|
108257
|
+
const editorUrl = config.projectType === "App" ? createRedirectLink({
|
|
108258
|
+
platform: "editor",
|
|
108259
|
+
appId: config.appId,
|
|
108260
|
+
versionOverrideId: armTag,
|
|
108261
|
+
...siteId ? {
|
|
108262
|
+
tenantId: siteId
|
|
108263
|
+
} : null
|
|
108464
108264
|
}) : void 0;
|
|
108465
|
-
const dashboardUrl =
|
|
108466
|
-
|
|
108467
|
-
|
|
108468
|
-
|
|
108265
|
+
const dashboardUrl = config.projectType === "App" ? createRedirectLink({
|
|
108266
|
+
platform: "dashboard",
|
|
108267
|
+
appId: config.appId,
|
|
108268
|
+
versionOverrideId: armTag,
|
|
108269
|
+
...siteId ? {
|
|
108270
|
+
tenantId: siteId
|
|
108271
|
+
} : null
|
|
108272
|
+
}) : `https://manage.wix.com/dashboard/${siteId}?apps-override=${armTag}`;
|
|
108469
108273
|
const topology = await readDeploymentTopology(projectFolder);
|
|
108470
108274
|
topology[environment] = {
|
|
108471
108275
|
id: armTag,
|
|
@@ -108501,43 +108305,17 @@ async function readDeploymentTopology(projectFolder) {
|
|
|
108501
108305
|
return {};
|
|
108502
108306
|
}
|
|
108503
108307
|
|
|
108504
|
-
// ../cli-astro-commands/src/components/PreviewCommand/app-flow/LivesiteLinkForApp.tsx
|
|
108505
|
-
init_esm_shims();
|
|
108506
|
-
var import_react18 = __toESM(require_react(), 1);
|
|
108507
|
-
var LivesiteLinkForApp = ({ armTag }) => {
|
|
108508
|
-
const resolvePlatformUrl2 = useResolvePlatformUrl();
|
|
108509
|
-
const siteUrl = resolvePlatformUrl2({
|
|
108510
|
-
platformType: PlatformType.Site(),
|
|
108511
|
-
armTag
|
|
108512
|
-
});
|
|
108513
|
-
return siteUrl ? /* @__PURE__ */ import_react18.default.createElement(PlatformLink, { url: siteUrl, label: "Site" }) : /* @__PURE__ */ import_react18.default.createElement(Box_default, { marginRight: 1 }, /* @__PURE__ */ import_react18.default.createElement(PointerSmallIcon, null), /* @__PURE__ */ import_react18.default.createElement(Box_default, { marginLeft: 1 }, /* @__PURE__ */ import_react18.default.createElement(Text, { skin: "secondary", underline: true }, "Site (publish your site to enable preview)")));
|
|
108514
|
-
};
|
|
108515
|
-
|
|
108516
|
-
// ../cli-astro-commands/src/components/PlatformLink/EditorLink.tsx
|
|
108517
|
-
init_esm_shims();
|
|
108518
|
-
var import_react19 = __toESM(require_react(), 1);
|
|
108519
|
-
var EditorLink = ({ armTag }) => {
|
|
108520
|
-
const resolvePlatformUrl2 = useResolvePlatformUrl();
|
|
108521
|
-
const editorUrl = resolvePlatformUrl2({
|
|
108522
|
-
platformType: PlatformType.Editor(),
|
|
108523
|
-
armTag
|
|
108524
|
-
});
|
|
108525
|
-
return /* @__PURE__ */ import_react19.default.createElement(PlatformLink, { url: editorUrl, label: "Editor" });
|
|
108526
|
-
};
|
|
108527
|
-
|
|
108528
108308
|
export {
|
|
108529
108309
|
useARMClient,
|
|
108530
|
-
useUpdateManifest,
|
|
108531
|
-
PlatformLink,
|
|
108532
108310
|
readAppConfig,
|
|
108533
108311
|
saveAppConfig,
|
|
108534
108312
|
SiteSelector,
|
|
108535
108313
|
SiteProvider,
|
|
108536
|
-
|
|
108537
|
-
|
|
108314
|
+
PlatformLink,
|
|
108315
|
+
createRedirectLink,
|
|
108316
|
+
RedirectLink,
|
|
108538
108317
|
useUpdateDeploymentTopology,
|
|
108539
|
-
|
|
108540
|
-
EditorLink
|
|
108318
|
+
useSite
|
|
108541
108319
|
};
|
|
108542
108320
|
/*! Bundled license information:
|
|
108543
108321
|
|
|
@@ -108593,4 +108371,4 @@ export {
|
|
|
108593
108371
|
*)
|
|
108594
108372
|
*)
|
|
108595
108373
|
*/
|
|
108596
|
-
//# sourceMappingURL=chunk-
|
|
108374
|
+
//# sourceMappingURL=chunk-YYY4GDEZ.js.map
|