@wix/cli-app 1.1.125 → 1.1.127
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/build/{AddPermissionCommand-IZV3UDJQ.js → AddPermissionCommand-JFRWIRZI.js} +2 -2
- package/build/{DevCommand-4Q2GY2MV.js → DevCommand-3PRNRUFO.js} +10 -10
- package/build/{GenerateCommand-JM3UR2B4.js → GenerateCommand-NKNV35NN.js} +7 -7
- package/build/{LogsCommand-OWXS7FSS.js → LogsCommand-BIPYLEUC.js} +3 -3
- package/build/PreviewCommand-FWV6LIFS.js +19 -0
- package/build/ReleaseCommand-ZG5W6RG4.js +23 -0
- package/build/{ServeCommand-3O6WV3OG.js → ServeCommand-DUKZODY6.js} +3 -3
- package/build/{build-PZPA4VW6.js → build-FG6B7OQH.js} +17 -12
- package/build/build-FG6B7OQH.js.map +1 -0
- package/build/{chunk-Q66WJZYR.js → chunk-4EAHNYEH.js} +2 -2
- package/build/{chunk-SUFNUPR2.js → chunk-4KUHW5B7.js} +2 -2
- package/build/{chunk-22M4W7BK.js → chunk-4SRMFEJA.js} +2 -2
- package/build/{chunk-IJDV4MGV.js → chunk-6EOYAASV.js} +4 -4
- package/build/{chunk-F5KDSDTS.js → chunk-6OIVUPHF.js} +6 -6
- package/build/{chunk-3QYQCPHD.js → chunk-C55WMKMJ.js} +150 -18
- package/build/{chunk-3QYQCPHD.js.map → chunk-C55WMKMJ.js.map} +1 -1
- package/build/{chunk-PJNY3IAX.js → chunk-C73XJ57U.js} +2 -2
- package/build/{chunk-XKYWADFI.js → chunk-C75VAILG.js} +2 -2
- package/build/{chunk-4CLUA5K6.js → chunk-EXDWGPUM.js} +6 -6
- package/build/{chunk-73IEEATV.js → chunk-F3FIVJZD.js} +2 -2
- package/build/{chunk-VHUNARG2.js → chunk-LC6RJKUL.js} +2 -2
- package/build/{chunk-EPKRIM3V.js → chunk-ROHDWZI4.js} +3 -3
- package/build/{chunk-VWANLXSD.js → chunk-T3EBYWJV.js} +9 -2
- package/build/{chunk-VWANLXSD.js.map → chunk-T3EBYWJV.js.map} +1 -1
- package/build/{chunk-5VPCVH55.js → chunk-TCBGU4X6.js} +4 -4
- package/build/{chunk-XGXONE7F.js → chunk-U5ROEYJA.js} +2 -2
- package/build/{chunk-XDVS5U63.js → chunk-UNCNFFF6.js} +384 -396
- package/build/chunk-UNCNFFF6.js.map +1 -0
- package/build/{chunk-UP5R334C.js → chunk-XPNO6MSO.js} +7 -7
- package/build/index.js +23 -23
- package/build/platform-sdk/editor.js +2 -2
- package/build/platform-sdk/editor.js.map +1 -1
- package/build/platform-sdk/site.js.map +1 -1
- package/build/{preview-Z7R5SNFJ.js → preview-QT6BIZNI.js} +12 -12
- package/build/{release-IGJBVIMI.js → release-7ITKDBFT.js} +14 -14
- package/build/{render-command-M7ACRQFE.js → render-command-XRP2XSWT.js} +5 -5
- package/package.json +3 -3
- package/build/PreviewCommand-P75NAWNH.js +0 -19
- package/build/ReleaseCommand-C7MKXJQR.js +0 -23
- package/build/build-PZPA4VW6.js.map +0 -1
- package/build/chunk-XDVS5U63.js.map +0 -1
- /package/build/{AddPermissionCommand-IZV3UDJQ.js.map → AddPermissionCommand-JFRWIRZI.js.map} +0 -0
- /package/build/{DevCommand-4Q2GY2MV.js.map → DevCommand-3PRNRUFO.js.map} +0 -0
- /package/build/{GenerateCommand-JM3UR2B4.js.map → GenerateCommand-NKNV35NN.js.map} +0 -0
- /package/build/{LogsCommand-OWXS7FSS.js.map → LogsCommand-BIPYLEUC.js.map} +0 -0
- /package/build/{PreviewCommand-P75NAWNH.js.map → PreviewCommand-FWV6LIFS.js.map} +0 -0
- /package/build/{ReleaseCommand-C7MKXJQR.js.map → ReleaseCommand-ZG5W6RG4.js.map} +0 -0
- /package/build/{ServeCommand-3O6WV3OG.js.map → ServeCommand-DUKZODY6.js.map} +0 -0
- /package/build/{chunk-Q66WJZYR.js.map → chunk-4EAHNYEH.js.map} +0 -0
- /package/build/{chunk-SUFNUPR2.js.map → chunk-4KUHW5B7.js.map} +0 -0
- /package/build/{chunk-22M4W7BK.js.map → chunk-4SRMFEJA.js.map} +0 -0
- /package/build/{chunk-IJDV4MGV.js.map → chunk-6EOYAASV.js.map} +0 -0
- /package/build/{chunk-F5KDSDTS.js.map → chunk-6OIVUPHF.js.map} +0 -0
- /package/build/{chunk-PJNY3IAX.js.map → chunk-C73XJ57U.js.map} +0 -0
- /package/build/{chunk-XKYWADFI.js.map → chunk-C75VAILG.js.map} +0 -0
- /package/build/{chunk-4CLUA5K6.js.map → chunk-EXDWGPUM.js.map} +0 -0
- /package/build/{chunk-73IEEATV.js.map → chunk-F3FIVJZD.js.map} +0 -0
- /package/build/{chunk-VHUNARG2.js.map → chunk-LC6RJKUL.js.map} +0 -0
- /package/build/{chunk-EPKRIM3V.js.map → chunk-ROHDWZI4.js.map} +0 -0
- /package/build/{chunk-5VPCVH55.js.map → chunk-TCBGU4X6.js.map} +0 -0
- /package/build/{chunk-XGXONE7F.js.map → chunk-U5ROEYJA.js.map} +0 -0
- /package/build/{chunk-UP5R334C.js.map → chunk-XPNO6MSO.js.map} +0 -0
- /package/build/{preview-Z7R5SNFJ.js.map → preview-QT6BIZNI.js.map} +0 -0
- /package/build/{release-IGJBVIMI.js.map → release-7ITKDBFT.js.map} +0 -0
- /package/build/{render-command-M7ACRQFE.js.map → render-command-XRP2XSWT.js.map} +0 -0
|
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getBackendEventSlug,
|
|
5
5
|
require_baseUniq
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T3EBYWJV.js";
|
|
7
7
|
import {
|
|
8
8
|
API_BASEURL_PLACEHOLDER,
|
|
9
9
|
AlgorithmType,
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
MonitoringType,
|
|
34
34
|
PRESETS_DIR,
|
|
35
35
|
PanelContentType,
|
|
36
|
+
PanelMode,
|
|
36
37
|
RELATIVE_ASSET_PATH_REGEX,
|
|
37
38
|
RegionType,
|
|
38
39
|
SERVICE_PLUGINS_PATTERN,
|
|
@@ -41,12 +42,12 @@ import {
|
|
|
41
42
|
SITE_COMPONENTS_PRESETS_PATTERN,
|
|
42
43
|
SITE_COMPONENTS_PREVIEW_PATTERN,
|
|
43
44
|
SITE_COMPONENTS_SDK_PATTERN,
|
|
45
|
+
SITE_COMPONENTS_SERVER_STATICS_FOLDER,
|
|
44
46
|
SITE_COMPONENTS_VITE_CACHE_DIR,
|
|
45
47
|
SITE_PLUGINS_PANEL_PATTERN,
|
|
46
48
|
SITE_PLUGINS_PLUGIN_PATTERN,
|
|
47
49
|
SITE_WIDGETS_ELEMENT_PATTERN,
|
|
48
50
|
SITE_WIDGETS_PANEL_PATTERN,
|
|
49
|
-
SSR_STATICS_FOLDER,
|
|
50
51
|
WEB_METHOD_PATTERN,
|
|
51
52
|
WIX_CONFIG_FILENAME,
|
|
52
53
|
WORKER_STATICS_FOLDER,
|
|
@@ -91,7 +92,7 @@ import {
|
|
|
91
92
|
virtualSiteComponentPreviewScriptAssets,
|
|
92
93
|
virtualSiteComponentScriptAssets,
|
|
93
94
|
virtualSiteComponentSdkScriptAssets
|
|
94
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-C55WMKMJ.js";
|
|
95
96
|
import {
|
|
96
97
|
__commonJS,
|
|
97
98
|
__esm,
|
|
@@ -30954,6 +30955,7 @@ function getViteConfig(model, options, { appSecret, webhookPublicKey }) {
|
|
|
30954
30955
|
|
|
30955
30956
|
// src/vite/configs/build-command/browser.ts
|
|
30956
30957
|
init_esm_shims();
|
|
30958
|
+
import { mergeConfig } from "vite";
|
|
30957
30959
|
|
|
30958
30960
|
// ../../node_modules/vite-plugin-externals/dist/es/src/index.js
|
|
30959
30961
|
init_esm_shims();
|
|
@@ -38976,232 +38978,6 @@ init_esm_shims();
|
|
|
38976
38978
|
var import_variant = __toESM(require_lib(), 1);
|
|
38977
38979
|
import { join as join4 } from "node:path";
|
|
38978
38980
|
var import_node_html_parser = __toESM(require_dist(), 1);
|
|
38979
|
-
function getEmbeddedScriptEntries(model) {
|
|
38980
|
-
const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => join4(model.projectFolder, comp.relativePath));
|
|
38981
|
-
return new Set(entries);
|
|
38982
|
-
}
|
|
38983
|
-
function getEmbeddedScriptHtmlUrl(filename) {
|
|
38984
|
-
return `__STATICS_BASE_URL_PLACEHOLDER__${filename}`;
|
|
38985
|
-
}
|
|
38986
|
-
function embeddedScriptSDKSupport(options) {
|
|
38987
|
-
const { initialModel, type } = options;
|
|
38988
|
-
const query = "?wix-context-internal";
|
|
38989
|
-
const virtualModuleId = "virtual:wix-context-module";
|
|
38990
|
-
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
38991
|
-
const virtualScriptId = "virtual:wix-context-reexport-script";
|
|
38992
|
-
const resolvedVirtualScriptId = `\0${virtualScriptId}`;
|
|
38993
|
-
let id;
|
|
38994
|
-
let fileName;
|
|
38995
|
-
let entriesSet = getEmbeddedScriptEntries(initialModel);
|
|
38996
|
-
return [
|
|
38997
|
-
{
|
|
38998
|
-
name: "wix:embedded-script-sdk-support-modules",
|
|
38999
|
-
enforce: "pre",
|
|
39000
|
-
resolveId(id2) {
|
|
39001
|
-
if (id2 === virtualModuleId) {
|
|
39002
|
-
return resolvedVirtualModuleId;
|
|
39003
|
-
}
|
|
39004
|
-
if (id2.endsWith(virtualScriptId)) {
|
|
39005
|
-
return resolvedVirtualScriptId;
|
|
39006
|
-
}
|
|
39007
|
-
return null;
|
|
39008
|
-
},
|
|
39009
|
-
load(id2) {
|
|
39010
|
-
if (id2 === resolvedVirtualModuleId) {
|
|
39011
|
-
return defaultOutdent`
|
|
39012
|
-
import { enableClient } from '@wix/cli-app/internal/platform-sdk/site';
|
|
39013
|
-
const { injectGetAccessToken } = enableClient('${initialModel.config.appId}');
|
|
39014
|
-
export const injectAccessTokenFunction = (getAppToken) => {
|
|
39015
|
-
injectGetAccessToken(getAppToken);
|
|
39016
|
-
};
|
|
39017
|
-
`;
|
|
39018
|
-
}
|
|
39019
|
-
if (id2 === resolvedVirtualScriptId) {
|
|
39020
|
-
return `export * from '${virtualModuleId}';`;
|
|
39021
|
-
}
|
|
39022
|
-
return null;
|
|
39023
|
-
}
|
|
39024
|
-
},
|
|
39025
|
-
{
|
|
39026
|
-
name: "wix:embedded-script-sdk-support-serve",
|
|
39027
|
-
apply: "serve",
|
|
39028
|
-
enforce: "pre",
|
|
39029
|
-
configureServer() {
|
|
39030
|
-
if (type === "dev" /* dev */) {
|
|
39031
|
-
options.projectModelWatcher.onChange((model) => {
|
|
39032
|
-
entriesSet = getEmbeddedScriptEntries(model);
|
|
39033
|
-
});
|
|
39034
|
-
}
|
|
39035
|
-
},
|
|
39036
|
-
transform(code, id2) {
|
|
39037
|
-
if (id2.endsWith(query)) {
|
|
39038
|
-
const s2 = new MagicString(code);
|
|
39039
|
-
s2.prepend(`import '${virtualModuleId}';
|
|
39040
|
-
`);
|
|
39041
|
-
return {
|
|
39042
|
-
code: s2.toString(),
|
|
39043
|
-
map: s2.generateMap()
|
|
39044
|
-
};
|
|
39045
|
-
}
|
|
39046
|
-
return null;
|
|
39047
|
-
},
|
|
39048
|
-
transformIndexHtml: {
|
|
39049
|
-
order: "pre",
|
|
39050
|
-
handler(html, ctx) {
|
|
39051
|
-
if (entriesSet.has(ctx.filename)) {
|
|
39052
|
-
const root = (0, import_node_html_parser.parse)(html);
|
|
39053
|
-
const scripts = root.querySelectorAll('script[type="module"]');
|
|
39054
|
-
for (const script of scripts) {
|
|
39055
|
-
const src = script.getAttribute("src");
|
|
39056
|
-
if (src) {
|
|
39057
|
-
script.setAttribute("src", `${src}${query}`);
|
|
39058
|
-
} else {
|
|
39059
|
-
script.innerHTML = `import '${virtualModuleId}';
|
|
39060
|
-
${script.innerHTML}`;
|
|
39061
|
-
}
|
|
39062
|
-
}
|
|
39063
|
-
return {
|
|
39064
|
-
tags: [
|
|
39065
|
-
{
|
|
39066
|
-
tag: "script",
|
|
39067
|
-
attrs: {
|
|
39068
|
-
type: "module",
|
|
39069
|
-
accesstoken: "true",
|
|
39070
|
-
src: virtualScriptId
|
|
39071
|
-
}
|
|
39072
|
-
}
|
|
39073
|
-
],
|
|
39074
|
-
html: root.toString()
|
|
39075
|
-
};
|
|
39076
|
-
}
|
|
39077
|
-
return html;
|
|
39078
|
-
}
|
|
39079
|
-
}
|
|
39080
|
-
},
|
|
39081
|
-
{
|
|
39082
|
-
name: "wix:embedded-script-sdk-support-build-pre",
|
|
39083
|
-
apply: "build",
|
|
39084
|
-
enforce: "pre",
|
|
39085
|
-
transformIndexHtml: {
|
|
39086
|
-
order: "pre",
|
|
39087
|
-
handler(html, ctx) {
|
|
39088
|
-
if (entriesSet.has(ctx.filename)) {
|
|
39089
|
-
return {
|
|
39090
|
-
tags: [
|
|
39091
|
-
{
|
|
39092
|
-
tag: "script",
|
|
39093
|
-
attrs: {
|
|
39094
|
-
type: "module",
|
|
39095
|
-
src: virtualModuleId
|
|
39096
|
-
}
|
|
39097
|
-
}
|
|
39098
|
-
],
|
|
39099
|
-
html
|
|
39100
|
-
};
|
|
39101
|
-
}
|
|
39102
|
-
return html;
|
|
39103
|
-
}
|
|
39104
|
-
}
|
|
39105
|
-
},
|
|
39106
|
-
{
|
|
39107
|
-
name: "wix:embedded-script-sdk-support-build-post",
|
|
39108
|
-
apply: "build",
|
|
39109
|
-
enforce: "pre",
|
|
39110
|
-
buildStart() {
|
|
39111
|
-
this.emitFile({
|
|
39112
|
-
type: "chunk",
|
|
39113
|
-
id: virtualModuleId,
|
|
39114
|
-
preserveSignature: "exports-only"
|
|
39115
|
-
});
|
|
39116
|
-
id = this.emitFile({
|
|
39117
|
-
type: "chunk",
|
|
39118
|
-
id: virtualScriptId,
|
|
39119
|
-
preserveSignature: "exports-only"
|
|
39120
|
-
});
|
|
39121
|
-
},
|
|
39122
|
-
generateBundle() {
|
|
39123
|
-
fileName = this.getFileName(id);
|
|
39124
|
-
},
|
|
39125
|
-
transformIndexHtml(html, ctx) {
|
|
39126
|
-
if (entriesSet.has(ctx.filename)) {
|
|
39127
|
-
return {
|
|
39128
|
-
tags: [
|
|
39129
|
-
{
|
|
39130
|
-
tag: "script",
|
|
39131
|
-
attrs: {
|
|
39132
|
-
type: "module",
|
|
39133
|
-
crossorigin: true,
|
|
39134
|
-
accesstoken: "true",
|
|
39135
|
-
src: getEmbeddedScriptHtmlUrl(fileName)
|
|
39136
|
-
}
|
|
39137
|
-
}
|
|
39138
|
-
],
|
|
39139
|
-
html
|
|
39140
|
-
};
|
|
39141
|
-
}
|
|
39142
|
-
return html;
|
|
39143
|
-
}
|
|
39144
|
-
}
|
|
39145
|
-
];
|
|
39146
|
-
}
|
|
39147
|
-
|
|
39148
|
-
// src/vite/plugins/monitoring.ts
|
|
39149
|
-
init_esm_shims();
|
|
39150
|
-
var import_monitoring_buildtime2 = __toESM(require_build(), 1);
|
|
39151
|
-
|
|
39152
|
-
// src/app-manifest/monitoring.ts
|
|
39153
|
-
init_esm_shims();
|
|
39154
|
-
var getMonitoringProvider = (monitoring2) => {
|
|
39155
|
-
if ("sentry" in monitoring2) {
|
|
39156
|
-
return {
|
|
39157
|
-
type: MonitoringType.SENTRY,
|
|
39158
|
-
sentryOptions: monitoring2.sentry
|
|
39159
|
-
};
|
|
39160
|
-
}
|
|
39161
|
-
return monitoring2.custom;
|
|
39162
|
-
};
|
|
39163
|
-
|
|
39164
|
-
// src/vite/plugins/monitoring.ts
|
|
39165
|
-
function monitoring({ initialModel }) {
|
|
39166
|
-
const { monitoring: monitoring2 } = initialModel.config;
|
|
39167
|
-
if (!monitoring2) {
|
|
39168
|
-
return null;
|
|
39169
|
-
}
|
|
39170
|
-
try {
|
|
39171
|
-
return (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
|
|
39172
|
-
appId: initialModel.config.appId,
|
|
39173
|
-
silent: true,
|
|
39174
|
-
provider: getMonitoringProvider(monitoring2)
|
|
39175
|
-
});
|
|
39176
|
-
} catch (e) {
|
|
39177
|
-
throw new CliError({
|
|
39178
|
-
cause: e,
|
|
39179
|
-
code: CliErrorCode.FailedToCreateMonitoringVitePlugin({
|
|
39180
|
-
configPath: WIX_CONFIG_FILENAME
|
|
39181
|
-
})
|
|
39182
|
-
});
|
|
39183
|
-
}
|
|
39184
|
-
}
|
|
39185
|
-
|
|
39186
|
-
// src/vite/plugins/fbjs-hotfix-plugin.ts
|
|
39187
|
-
init_esm_shims();
|
|
39188
|
-
function fbjsHotfixPlugin() {
|
|
39189
|
-
return {
|
|
39190
|
-
name: "fbjs-hotfix",
|
|
39191
|
-
transform(code, id) {
|
|
39192
|
-
if (id.endsWith("node_modules/fbjs/lib/UnicodeBidi.js")) {
|
|
39193
|
-
return {
|
|
39194
|
-
code: code.replaceAll("\\u17D8", "")
|
|
39195
|
-
};
|
|
39196
|
-
}
|
|
39197
|
-
return null;
|
|
39198
|
-
}
|
|
39199
|
-
};
|
|
39200
|
-
}
|
|
39201
|
-
|
|
39202
|
-
// src/vite/plugins/config-extensions-file-emitter.ts
|
|
39203
|
-
init_esm_shims();
|
|
39204
|
-
import { join as join5, basename as basename2 } from "node:path";
|
|
39205
38981
|
|
|
39206
38982
|
// ../cli-app-manifest/build/index.js
|
|
39207
38983
|
init_esm_shims();
|
|
@@ -39574,7 +39350,8 @@ var panelComponentDataSchema = external_exports.object({
|
|
|
39574
39350
|
Width.UNKNOWN_WIDTH
|
|
39575
39351
|
]),
|
|
39576
39352
|
height: external_exports.number().min(150)
|
|
39577
|
-
}).optional()
|
|
39353
|
+
}).optional(),
|
|
39354
|
+
panelMode: external_exports.enum([PanelMode.overlay]).optional()
|
|
39578
39355
|
}).and(panelContentSchema);
|
|
39579
39356
|
var panelSchema = external_exports.object({
|
|
39580
39357
|
compId: external_exports.string(),
|
|
@@ -39813,7 +39590,7 @@ var siteComponentSchema = external_exports.object({
|
|
|
39813
39590
|
compName: external_exports.string().optional(),
|
|
39814
39591
|
compData: external_exports.object({
|
|
39815
39592
|
editorReactComponent: external_exports.object({
|
|
39816
|
-
type: external_exports.string().min(1)
|
|
39593
|
+
type: external_exports.string().min(1),
|
|
39817
39594
|
description: external_exports.string().min(5),
|
|
39818
39595
|
resources: siteComponentResourcesSchema,
|
|
39819
39596
|
installation: external_exports.unknown(),
|
|
@@ -40242,7 +40019,179 @@ var updateAppManifestComponents = ({
|
|
|
40242
40019
|
return updatedManifest;
|
|
40243
40020
|
};
|
|
40244
40021
|
|
|
40022
|
+
// src/vite/plugins/embedded-script-sdk-support.ts
|
|
40023
|
+
function getEmbeddedScriptEntries(model) {
|
|
40024
|
+
const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => join4(model.projectFolder, comp.relativePath));
|
|
40025
|
+
return new Set(entries);
|
|
40026
|
+
}
|
|
40027
|
+
function getEmbeddedScriptHtmlUrl(filename) {
|
|
40028
|
+
return `${BASE_URL_PLACEHOLDER}${filename}`;
|
|
40029
|
+
}
|
|
40030
|
+
function embeddedScriptSDKSupport(options) {
|
|
40031
|
+
const { initialModel, type } = options;
|
|
40032
|
+
const query = "?wix-context-internal";
|
|
40033
|
+
const virtualModuleId = "virtual:wix-context-module";
|
|
40034
|
+
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
40035
|
+
const virtualScriptId = "virtual:wix-context-reexport-script";
|
|
40036
|
+
const resolvedVirtualScriptId = `\0${virtualScriptId}`;
|
|
40037
|
+
let id;
|
|
40038
|
+
let fileName;
|
|
40039
|
+
let entriesSet = getEmbeddedScriptEntries(initialModel);
|
|
40040
|
+
return [
|
|
40041
|
+
{
|
|
40042
|
+
name: "wix:embedded-script-sdk-support-modules",
|
|
40043
|
+
enforce: "pre",
|
|
40044
|
+
resolveId(id2) {
|
|
40045
|
+
if (id2 === virtualModuleId) {
|
|
40046
|
+
return resolvedVirtualModuleId;
|
|
40047
|
+
}
|
|
40048
|
+
if (id2.endsWith(virtualScriptId)) {
|
|
40049
|
+
return resolvedVirtualScriptId;
|
|
40050
|
+
}
|
|
40051
|
+
return null;
|
|
40052
|
+
},
|
|
40053
|
+
load(id2) {
|
|
40054
|
+
if (id2 === resolvedVirtualModuleId) {
|
|
40055
|
+
return defaultOutdent`
|
|
40056
|
+
import { enableClient } from '@wix/cli-app/internal/platform-sdk/site';
|
|
40057
|
+
const { injectGetAccessToken } = enableClient('${initialModel.config.appId}');
|
|
40058
|
+
export const injectAccessTokenFunction = (getAppToken) => {
|
|
40059
|
+
injectGetAccessToken(getAppToken);
|
|
40060
|
+
};
|
|
40061
|
+
`;
|
|
40062
|
+
}
|
|
40063
|
+
if (id2 === resolvedVirtualScriptId) {
|
|
40064
|
+
return `export * from '${virtualModuleId}';`;
|
|
40065
|
+
}
|
|
40066
|
+
return null;
|
|
40067
|
+
}
|
|
40068
|
+
},
|
|
40069
|
+
{
|
|
40070
|
+
name: "wix:embedded-script-sdk-support-serve",
|
|
40071
|
+
apply: "serve",
|
|
40072
|
+
enforce: "pre",
|
|
40073
|
+
configureServer() {
|
|
40074
|
+
if (type === "dev" /* dev */) {
|
|
40075
|
+
options.projectModelWatcher.onChange((model) => {
|
|
40076
|
+
entriesSet = getEmbeddedScriptEntries(model);
|
|
40077
|
+
});
|
|
40078
|
+
}
|
|
40079
|
+
},
|
|
40080
|
+
transform(code, id2) {
|
|
40081
|
+
if (id2.endsWith(query)) {
|
|
40082
|
+
const s2 = new MagicString(code);
|
|
40083
|
+
s2.prepend(`import '${virtualModuleId}';
|
|
40084
|
+
`);
|
|
40085
|
+
return {
|
|
40086
|
+
code: s2.toString(),
|
|
40087
|
+
map: s2.generateMap()
|
|
40088
|
+
};
|
|
40089
|
+
}
|
|
40090
|
+
return null;
|
|
40091
|
+
},
|
|
40092
|
+
transformIndexHtml: {
|
|
40093
|
+
order: "pre",
|
|
40094
|
+
handler(html, ctx) {
|
|
40095
|
+
if (entriesSet.has(ctx.filename)) {
|
|
40096
|
+
const root = (0, import_node_html_parser.parse)(html);
|
|
40097
|
+
const scripts = root.querySelectorAll('script[type="module"]');
|
|
40098
|
+
for (const script of scripts) {
|
|
40099
|
+
const src = script.getAttribute("src");
|
|
40100
|
+
if (src) {
|
|
40101
|
+
script.setAttribute("src", `${src}${query}`);
|
|
40102
|
+
} else {
|
|
40103
|
+
script.innerHTML = `import '${virtualModuleId}';
|
|
40104
|
+
${script.innerHTML}`;
|
|
40105
|
+
}
|
|
40106
|
+
}
|
|
40107
|
+
return {
|
|
40108
|
+
tags: [
|
|
40109
|
+
{
|
|
40110
|
+
tag: "script",
|
|
40111
|
+
attrs: {
|
|
40112
|
+
type: "module",
|
|
40113
|
+
accesstoken: "true",
|
|
40114
|
+
src: virtualScriptId
|
|
40115
|
+
}
|
|
40116
|
+
}
|
|
40117
|
+
],
|
|
40118
|
+
html: root.toString()
|
|
40119
|
+
};
|
|
40120
|
+
}
|
|
40121
|
+
return html;
|
|
40122
|
+
}
|
|
40123
|
+
}
|
|
40124
|
+
},
|
|
40125
|
+
{
|
|
40126
|
+
name: "wix:embedded-script-sdk-support-build-pre",
|
|
40127
|
+
apply: "build",
|
|
40128
|
+
enforce: "pre",
|
|
40129
|
+
transformIndexHtml: {
|
|
40130
|
+
order: "pre",
|
|
40131
|
+
handler(html, ctx) {
|
|
40132
|
+
if (entriesSet.has(ctx.filename)) {
|
|
40133
|
+
return {
|
|
40134
|
+
tags: [
|
|
40135
|
+
{
|
|
40136
|
+
tag: "script",
|
|
40137
|
+
attrs: {
|
|
40138
|
+
type: "module",
|
|
40139
|
+
src: virtualModuleId
|
|
40140
|
+
}
|
|
40141
|
+
}
|
|
40142
|
+
],
|
|
40143
|
+
html
|
|
40144
|
+
};
|
|
40145
|
+
}
|
|
40146
|
+
return html;
|
|
40147
|
+
}
|
|
40148
|
+
}
|
|
40149
|
+
},
|
|
40150
|
+
{
|
|
40151
|
+
name: "wix:embedded-script-sdk-support-build-post",
|
|
40152
|
+
apply: "build",
|
|
40153
|
+
enforce: "pre",
|
|
40154
|
+
buildStart() {
|
|
40155
|
+
this.emitFile({
|
|
40156
|
+
type: "chunk",
|
|
40157
|
+
id: virtualModuleId,
|
|
40158
|
+
preserveSignature: "exports-only"
|
|
40159
|
+
});
|
|
40160
|
+
id = this.emitFile({
|
|
40161
|
+
type: "chunk",
|
|
40162
|
+
id: virtualScriptId,
|
|
40163
|
+
preserveSignature: "exports-only"
|
|
40164
|
+
});
|
|
40165
|
+
},
|
|
40166
|
+
generateBundle() {
|
|
40167
|
+
fileName = this.getFileName(id);
|
|
40168
|
+
},
|
|
40169
|
+
transformIndexHtml(html, ctx) {
|
|
40170
|
+
if (entriesSet.has(ctx.filename)) {
|
|
40171
|
+
return {
|
|
40172
|
+
tags: [
|
|
40173
|
+
{
|
|
40174
|
+
tag: "script",
|
|
40175
|
+
attrs: {
|
|
40176
|
+
type: "module",
|
|
40177
|
+
crossorigin: true,
|
|
40178
|
+
accesstoken: "true",
|
|
40179
|
+
src: getEmbeddedScriptHtmlUrl(fileName)
|
|
40180
|
+
}
|
|
40181
|
+
}
|
|
40182
|
+
],
|
|
40183
|
+
html
|
|
40184
|
+
};
|
|
40185
|
+
}
|
|
40186
|
+
return html;
|
|
40187
|
+
}
|
|
40188
|
+
}
|
|
40189
|
+
];
|
|
40190
|
+
}
|
|
40191
|
+
|
|
40245
40192
|
// src/vite/plugins/config-extensions-file-emitter.ts
|
|
40193
|
+
init_esm_shims();
|
|
40194
|
+
import { join as join5, basename as basename2 } from "node:path";
|
|
40246
40195
|
var import_types_impl = __toESM(require_types_impl(), 1);
|
|
40247
40196
|
async function processPresetsThumbnailUrls(presets, basePath, emitAssetFile) {
|
|
40248
40197
|
for (const preset of Object.values(presets)) {
|
|
@@ -40344,6 +40293,65 @@ function configExtensionsFileEmitter(model) {
|
|
|
40344
40293
|
};
|
|
40345
40294
|
}
|
|
40346
40295
|
|
|
40296
|
+
// src/vite/plugins/hash-html-files.ts
|
|
40297
|
+
init_esm_shims();
|
|
40298
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
40299
|
+
import { extname } from "node:path";
|
|
40300
|
+
function getHash(text) {
|
|
40301
|
+
return createHash2("sha256").update(text).digest("hex").substring(0, 8);
|
|
40302
|
+
}
|
|
40303
|
+
function hashHtmlFiles() {
|
|
40304
|
+
return {
|
|
40305
|
+
name: "hash-html-files",
|
|
40306
|
+
enforce: "post",
|
|
40307
|
+
generateBundle(_, bundle) {
|
|
40308
|
+
for (const id of Object.keys(bundle)) {
|
|
40309
|
+
const outputAsset = bundle[id];
|
|
40310
|
+
if (outputAsset?.type === "asset" && extname(outputAsset.fileName) === ".html") {
|
|
40311
|
+
const newFileName = outputAsset.fileName.replace(
|
|
40312
|
+
/(\.html)$/,
|
|
40313
|
+
`.ch.${getHash(outputAsset.source.toString())}.html`
|
|
40314
|
+
);
|
|
40315
|
+
outputAsset.fileName = newFileName;
|
|
40316
|
+
}
|
|
40317
|
+
}
|
|
40318
|
+
}
|
|
40319
|
+
};
|
|
40320
|
+
}
|
|
40321
|
+
|
|
40322
|
+
// src/vite/plugins/exports-custodian.ts
|
|
40323
|
+
init_esm_shims();
|
|
40324
|
+
var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
|
|
40325
|
+
var exportsCustodian = ({ initialModel }) => {
|
|
40326
|
+
const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
|
|
40327
|
+
const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
|
|
40328
|
+
const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
|
|
40329
|
+
return {
|
|
40330
|
+
name: "wix:exports-custodian",
|
|
40331
|
+
apply: "build",
|
|
40332
|
+
resolveId(id) {
|
|
40333
|
+
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
40334
|
+
return id;
|
|
40335
|
+
}
|
|
40336
|
+
return null;
|
|
40337
|
+
},
|
|
40338
|
+
load(id) {
|
|
40339
|
+
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
40340
|
+
return [
|
|
40341
|
+
...virtualSiteComponentAssets.keys(),
|
|
40342
|
+
...virtualSiteComponentPreviewAssets.keys(),
|
|
40343
|
+
...virtualSiteComponentPanelAssets.keys()
|
|
40344
|
+
].map((path9) => `import('${path9}');`).join("\n");
|
|
40345
|
+
}
|
|
40346
|
+
return null;
|
|
40347
|
+
}
|
|
40348
|
+
};
|
|
40349
|
+
};
|
|
40350
|
+
|
|
40351
|
+
// src/vite/configs/build-command/base.ts
|
|
40352
|
+
init_esm_shims();
|
|
40353
|
+
import { join as join6 } from "node:path";
|
|
40354
|
+
|
|
40347
40355
|
// src/vite/plugins/web-methods-plugin.ts
|
|
40348
40356
|
init_esm_shims();
|
|
40349
40357
|
import path5 from "node:path";
|
|
@@ -40404,61 +40412,60 @@ function webMethodsPlugin({
|
|
|
40404
40412
|
};
|
|
40405
40413
|
}
|
|
40406
40414
|
|
|
40407
|
-
// src/vite/plugins/
|
|
40415
|
+
// src/vite/plugins/fbjs-hotfix-plugin.ts
|
|
40408
40416
|
init_esm_shims();
|
|
40409
|
-
|
|
40410
|
-
import { extname } from "node:path";
|
|
40411
|
-
function getHash(text) {
|
|
40412
|
-
return createHash2("sha256").update(text).digest("hex").substring(0, 8);
|
|
40413
|
-
}
|
|
40414
|
-
function hashHtmlFiles() {
|
|
40417
|
+
function fbjsHotfixPlugin() {
|
|
40415
40418
|
return {
|
|
40416
|
-
name: "
|
|
40417
|
-
|
|
40418
|
-
|
|
40419
|
-
|
|
40420
|
-
|
|
40421
|
-
|
|
40422
|
-
const newFileName = outputAsset.fileName.replace(
|
|
40423
|
-
/(\.html)$/,
|
|
40424
|
-
`.ch.${getHash(outputAsset.source.toString())}.html`
|
|
40425
|
-
);
|
|
40426
|
-
outputAsset.fileName = newFileName;
|
|
40427
|
-
}
|
|
40419
|
+
name: "fbjs-hotfix",
|
|
40420
|
+
transform(code, id) {
|
|
40421
|
+
if (id.endsWith("node_modules/fbjs/lib/UnicodeBidi.js")) {
|
|
40422
|
+
return {
|
|
40423
|
+
code: code.replaceAll("\\u17D8", "")
|
|
40424
|
+
};
|
|
40428
40425
|
}
|
|
40426
|
+
return null;
|
|
40429
40427
|
}
|
|
40430
40428
|
};
|
|
40431
40429
|
}
|
|
40432
40430
|
|
|
40433
|
-
// src/vite/plugins/
|
|
40431
|
+
// src/vite/plugins/monitoring.ts
|
|
40434
40432
|
init_esm_shims();
|
|
40435
|
-
var
|
|
40436
|
-
|
|
40437
|
-
|
|
40438
|
-
|
|
40439
|
-
|
|
40440
|
-
|
|
40441
|
-
|
|
40442
|
-
|
|
40443
|
-
|
|
40444
|
-
|
|
40445
|
-
|
|
40446
|
-
|
|
40447
|
-
return null;
|
|
40448
|
-
},
|
|
40449
|
-
load(id) {
|
|
40450
|
-
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
40451
|
-
return [
|
|
40452
|
-
...virtualSiteComponentAssets.keys(),
|
|
40453
|
-
...virtualSiteComponentPreviewAssets.keys(),
|
|
40454
|
-
...virtualSiteComponentPanelAssets.keys()
|
|
40455
|
-
].map((path9) => `import('${path9}');`).join("\n");
|
|
40456
|
-
}
|
|
40457
|
-
return null;
|
|
40458
|
-
}
|
|
40459
|
-
};
|
|
40433
|
+
var import_monitoring_buildtime2 = __toESM(require_build(), 1);
|
|
40434
|
+
|
|
40435
|
+
// src/app-manifest/monitoring.ts
|
|
40436
|
+
init_esm_shims();
|
|
40437
|
+
var getMonitoringProvider = (monitoring2) => {
|
|
40438
|
+
if ("sentry" in monitoring2) {
|
|
40439
|
+
return {
|
|
40440
|
+
type: MonitoringType.SENTRY,
|
|
40441
|
+
sentryOptions: monitoring2.sentry
|
|
40442
|
+
};
|
|
40443
|
+
}
|
|
40444
|
+
return monitoring2.custom;
|
|
40460
40445
|
};
|
|
40461
40446
|
|
|
40447
|
+
// src/vite/plugins/monitoring.ts
|
|
40448
|
+
function monitoring({ initialModel }) {
|
|
40449
|
+
const { monitoring: monitoring2 } = initialModel.config;
|
|
40450
|
+
if (!monitoring2) {
|
|
40451
|
+
return null;
|
|
40452
|
+
}
|
|
40453
|
+
try {
|
|
40454
|
+
return (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
|
|
40455
|
+
appId: initialModel.config.appId,
|
|
40456
|
+
silent: true,
|
|
40457
|
+
provider: getMonitoringProvider(monitoring2)
|
|
40458
|
+
});
|
|
40459
|
+
} catch (e) {
|
|
40460
|
+
throw new CliError({
|
|
40461
|
+
cause: e,
|
|
40462
|
+
code: CliErrorCode.FailedToCreateMonitoringVitePlugin({
|
|
40463
|
+
configPath: WIX_CONFIG_FILENAME
|
|
40464
|
+
})
|
|
40465
|
+
});
|
|
40466
|
+
}
|
|
40467
|
+
}
|
|
40468
|
+
|
|
40462
40469
|
// src/vite/plugins/force-hash-refresh.ts
|
|
40463
40470
|
init_esm_shims();
|
|
40464
40471
|
import path6 from "node:path";
|
|
@@ -40485,6 +40492,47 @@ var forceHashRefresh = () => {
|
|
|
40485
40492
|
};
|
|
40486
40493
|
};
|
|
40487
40494
|
|
|
40495
|
+
// src/vite/configs/build-command/base.ts
|
|
40496
|
+
function getBaseViteConfig({ model, outputDir, customLogger }) {
|
|
40497
|
+
return {
|
|
40498
|
+
configFile: false,
|
|
40499
|
+
root: model.projectFolder,
|
|
40500
|
+
customLogger,
|
|
40501
|
+
clearScreen: false,
|
|
40502
|
+
logLevel: "info",
|
|
40503
|
+
publicDir: false,
|
|
40504
|
+
build: {
|
|
40505
|
+
sourcemap: true,
|
|
40506
|
+
outDir: getAppBuildFolder(model.projectFolder),
|
|
40507
|
+
emptyOutDir: false,
|
|
40508
|
+
rollupOptions: {
|
|
40509
|
+
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")
|
|
40513
|
+
}
|
|
40514
|
+
}
|
|
40515
|
+
},
|
|
40516
|
+
define: {
|
|
40517
|
+
"import.meta.env.BASE_API_URL": JSON.stringify(
|
|
40518
|
+
`${API_BASEURL_PLACEHOLDER}/functions`
|
|
40519
|
+
)
|
|
40520
|
+
},
|
|
40521
|
+
plugins: [
|
|
40522
|
+
webMethodsPlugin({
|
|
40523
|
+
projectFolder: model.projectFolder
|
|
40524
|
+
}),
|
|
40525
|
+
fbjsHotfixPlugin(),
|
|
40526
|
+
monitoring({ initialModel: model }),
|
|
40527
|
+
src_default({
|
|
40528
|
+
ignoreConfigErrors: true,
|
|
40529
|
+
root: model.projectFolder
|
|
40530
|
+
}),
|
|
40531
|
+
forceHashRefresh()
|
|
40532
|
+
]
|
|
40533
|
+
};
|
|
40534
|
+
}
|
|
40535
|
+
|
|
40488
40536
|
// src/vite/configs/build-command/browser.ts
|
|
40489
40537
|
function getViteConfig2(model, options) {
|
|
40490
40538
|
const virtualDashboardHTMLEntries = [
|
|
@@ -40521,17 +40569,13 @@ function getViteConfig2(model, options) {
|
|
|
40521
40569
|
const virtualSiteComponentPresetEntries = [
|
|
40522
40570
|
...virtualSiteComponentPresetAssets(model)
|
|
40523
40571
|
].map(([assetId, assetPath]) => [assetId, assetPath]);
|
|
40524
|
-
|
|
40525
|
-
|
|
40526
|
-
|
|
40527
|
-
|
|
40528
|
-
|
|
40529
|
-
|
|
40530
|
-
publicDir: false,
|
|
40531
|
-
server: {},
|
|
40572
|
+
const baseConfig = getBaseViteConfig({
|
|
40573
|
+
...options,
|
|
40574
|
+
model,
|
|
40575
|
+
outputDir: BROWSER_STATICS_FOLDER
|
|
40576
|
+
});
|
|
40577
|
+
const config = {
|
|
40532
40578
|
build: {
|
|
40533
|
-
sourcemap: true,
|
|
40534
|
-
outDir: getAppBuildFolder(model.projectFolder),
|
|
40535
40579
|
rollupOptions: {
|
|
40536
40580
|
external: ["@wix/services-manager-react"],
|
|
40537
40581
|
/*
|
|
@@ -40554,24 +40598,10 @@ function getViteConfig2(model, options) {
|
|
|
40554
40598
|
...virtualSiteComponentPresetEntries
|
|
40555
40599
|
]),
|
|
40556
40600
|
...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
|
|
40557
|
-
},
|
|
40558
|
-
output: {
|
|
40559
|
-
assetFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
|
|
40560
|
-
chunkFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
|
|
40561
|
-
entryFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash].js`
|
|
40562
40601
|
}
|
|
40563
40602
|
}
|
|
40564
40603
|
},
|
|
40565
|
-
define: {
|
|
40566
|
-
"import.meta.env.BASE_API_URL": JSON.stringify(
|
|
40567
|
-
`${API_BASEURL_PLACEHOLDER}/functions`
|
|
40568
|
-
)
|
|
40569
|
-
},
|
|
40570
40604
|
plugins: [
|
|
40571
|
-
webMethodsPlugin({
|
|
40572
|
-
projectFolder: model.projectFolder
|
|
40573
|
-
}),
|
|
40574
|
-
fbjsHotfixPlugin(),
|
|
40575
40605
|
moduleBundleBuildBrowser({
|
|
40576
40606
|
initialModel: model
|
|
40577
40607
|
}),
|
|
@@ -40592,13 +40622,7 @@ function getViteConfig2(model, options) {
|
|
|
40592
40622
|
...options
|
|
40593
40623
|
}),
|
|
40594
40624
|
exportsCustodian({ initialModel: model }),
|
|
40595
|
-
configExtensionsFileEmitter(model)
|
|
40596
|
-
monitoring({ initialModel: model }),
|
|
40597
|
-
src_default({
|
|
40598
|
-
ignoreConfigErrors: true,
|
|
40599
|
-
root: model.projectFolder
|
|
40600
|
-
}),
|
|
40601
|
-
forceHashRefresh()
|
|
40625
|
+
configExtensionsFileEmitter(model)
|
|
40602
40626
|
],
|
|
40603
40627
|
experimental: {
|
|
40604
40628
|
/*
|
|
@@ -40631,69 +40655,47 @@ function getViteConfig2(model, options) {
|
|
|
40631
40655
|
}
|
|
40632
40656
|
}
|
|
40633
40657
|
};
|
|
40658
|
+
return mergeConfig(config, baseConfig);
|
|
40634
40659
|
}
|
|
40635
40660
|
|
|
40636
40661
|
// src/vite/configs/build-command/worker.ts
|
|
40637
40662
|
init_esm_shims();
|
|
40663
|
+
import { mergeConfig as mergeConfig2 } from "vite";
|
|
40638
40664
|
function getViteConfig3(model, options) {
|
|
40639
40665
|
const virtualBlocksScriptEntries = [
|
|
40640
40666
|
...virtualBlocksWidgetScriptAssets(model),
|
|
40641
40667
|
...virtualBlocksWidgetPanelScriptAssets(model)
|
|
40642
40668
|
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
40643
|
-
|
|
40644
|
-
|
|
40645
|
-
|
|
40646
|
-
|
|
40647
|
-
|
|
40648
|
-
|
|
40649
|
-
publicDir: false,
|
|
40650
|
-
server: {},
|
|
40669
|
+
const baseConfig = getBaseViteConfig({
|
|
40670
|
+
...options,
|
|
40671
|
+
model,
|
|
40672
|
+
outputDir: WORKER_STATICS_FOLDER
|
|
40673
|
+
});
|
|
40674
|
+
const config = {
|
|
40651
40675
|
ssr: {
|
|
40652
40676
|
target: "webworker",
|
|
40653
40677
|
noExternal: true
|
|
40654
40678
|
},
|
|
40655
40679
|
build: {
|
|
40656
40680
|
ssr: true,
|
|
40657
|
-
sourcemap: true,
|
|
40658
|
-
outDir: getAppBuildFolder(model.projectFolder),
|
|
40659
40681
|
rollupOptions: {
|
|
40660
40682
|
input: {
|
|
40661
40683
|
...Object.fromEntries(virtualBlocksScriptEntries)
|
|
40662
40684
|
},
|
|
40663
40685
|
output: {
|
|
40664
|
-
assetFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
|
|
40665
|
-
chunkFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
|
|
40666
|
-
entryFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
|
|
40667
40686
|
// Need it to preserve shapes of our exports from virtual module bundles
|
|
40668
40687
|
minifyInternalExports: false
|
|
40669
40688
|
}
|
|
40670
40689
|
}
|
|
40671
40690
|
},
|
|
40672
|
-
|
|
40673
|
-
"import.meta.env.BASE_API_URL": JSON.stringify(
|
|
40674
|
-
`${API_BASEURL_PLACEHOLDER}/functions`
|
|
40675
|
-
)
|
|
40676
|
-
},
|
|
40677
|
-
plugins: [
|
|
40678
|
-
webMethodsPlugin({
|
|
40679
|
-
projectFolder: model.projectFolder
|
|
40680
|
-
}),
|
|
40681
|
-
fbjsHotfixPlugin(),
|
|
40682
|
-
moduleBundleBuildWorker({
|
|
40683
|
-
initialModel: model
|
|
40684
|
-
}),
|
|
40685
|
-
monitoring({ initialModel: model }),
|
|
40686
|
-
src_default({
|
|
40687
|
-
ignoreConfigErrors: true,
|
|
40688
|
-
root: model.projectFolder
|
|
40689
|
-
}),
|
|
40690
|
-
forceHashRefresh()
|
|
40691
|
-
]
|
|
40691
|
+
plugins: [moduleBundleBuildWorker({ initialModel: model })]
|
|
40692
40692
|
};
|
|
40693
|
+
return mergeConfig2(config, baseConfig);
|
|
40693
40694
|
}
|
|
40694
40695
|
|
|
40695
|
-
// src/vite/configs/build-command/
|
|
40696
|
+
// src/vite/configs/build-command/site-components-server.ts
|
|
40696
40697
|
init_esm_shims();
|
|
40698
|
+
import { mergeConfig as mergeConfig3 } from "vite";
|
|
40697
40699
|
function getViteConfig4(model, options) {
|
|
40698
40700
|
const virtualSiteComponentScriptEntries = [
|
|
40699
40701
|
...virtualSiteComponentScriptAssets(model)
|
|
@@ -40710,56 +40712,32 @@ function getViteConfig4(model, options) {
|
|
|
40710
40712
|
...virtualSiteComponentScriptEntries,
|
|
40711
40713
|
...virtualSiteComponentPreviewScriptEntries
|
|
40712
40714
|
].map(([entryName, entryPath]) => {
|
|
40713
|
-
|
|
40714
|
-
|
|
40715
|
-
|
|
40716
|
-
|
|
40717
|
-
|
|
40718
|
-
|
|
40719
|
-
publicDir: false,
|
|
40720
|
-
server: {},
|
|
40715
|
+
const baseConfig = getBaseViteConfig({
|
|
40716
|
+
...options,
|
|
40717
|
+
model,
|
|
40718
|
+
outputDir: SITE_COMPONENTS_SERVER_STATICS_FOLDER
|
|
40719
|
+
});
|
|
40720
|
+
const config = {
|
|
40721
40721
|
ssr: {
|
|
40722
40722
|
target: "node",
|
|
40723
40723
|
noExternal: true
|
|
40724
40724
|
},
|
|
40725
40725
|
build: {
|
|
40726
40726
|
ssr: true,
|
|
40727
|
-
sourcemap: true,
|
|
40728
40727
|
ssrEmitAssets: true,
|
|
40729
|
-
outDir: getAppBuildFolder(model.projectFolder),
|
|
40730
|
-
emptyOutDir: false,
|
|
40731
40728
|
rollupOptions: {
|
|
40732
40729
|
external: ["react", "react-dom", "@wix/services-manager-react"],
|
|
40733
40730
|
input: {
|
|
40734
40731
|
[entryName]: entryPath
|
|
40735
40732
|
},
|
|
40736
40733
|
output: {
|
|
40737
|
-
assetFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
|
|
40738
|
-
chunkFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
|
|
40739
|
-
entryFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
|
|
40740
40734
|
inlineDynamicImports: true
|
|
40741
40735
|
}
|
|
40742
40736
|
}
|
|
40743
40737
|
},
|
|
40744
|
-
|
|
40745
|
-
"import.meta.env.BASE_API_URL": JSON.stringify(
|
|
40746
|
-
`${API_BASEURL_PLACEHOLDER}/functions`
|
|
40747
|
-
)
|
|
40748
|
-
},
|
|
40749
|
-
plugins: [
|
|
40750
|
-
webMethodsPlugin({
|
|
40751
|
-
projectFolder: model.projectFolder
|
|
40752
|
-
}),
|
|
40753
|
-
fbjsHotfixPlugin(),
|
|
40754
|
-
moduleBundleBuildSsr({ initialModel: model }),
|
|
40755
|
-
monitoring({ initialModel: model }),
|
|
40756
|
-
src_default({
|
|
40757
|
-
ignoreConfigErrors: true,
|
|
40758
|
-
root: model.projectFolder
|
|
40759
|
-
}),
|
|
40760
|
-
forceHashRefresh()
|
|
40761
|
-
]
|
|
40738
|
+
plugins: [moduleBundleBuildSsr({ initialModel: model })]
|
|
40762
40739
|
};
|
|
40740
|
+
return mergeConfig3(config, baseConfig);
|
|
40763
40741
|
});
|
|
40764
40742
|
}
|
|
40765
40743
|
|
|
@@ -40882,7 +40860,7 @@ function ssl() {
|
|
|
40882
40860
|
|
|
40883
40861
|
// src/vite/plugins/auto-origin.ts
|
|
40884
40862
|
init_esm_shims();
|
|
40885
|
-
import { dirname as dirname2, isAbsolute as isAbsolute2, join as
|
|
40863
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join7 } from "node:path";
|
|
40886
40864
|
var originPlaceholder = "__WIX_ORIGIN_PLACEHOLDER__";
|
|
40887
40865
|
function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
|
|
40888
40866
|
const url = new URL(assetUrl, viteAddress).href;
|
|
@@ -40892,7 +40870,7 @@ function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
|
|
|
40892
40870
|
if (isAbsolute2(assetUrl)) {
|
|
40893
40871
|
return url;
|
|
40894
40872
|
}
|
|
40895
|
-
return new URL(
|
|
40873
|
+
return new URL(join7(dirname2(originalUrl), assetUrl), viteAddress).href;
|
|
40896
40874
|
}
|
|
40897
40875
|
function autoOrigin() {
|
|
40898
40876
|
let viteServer;
|
|
@@ -41269,13 +41247,13 @@ init_esm_shims();
|
|
|
41269
41247
|
var import_variant4 = __toESM(require_lib(), 1);
|
|
41270
41248
|
var import_uniqWith = __toESM(require_uniqWith(), 1);
|
|
41271
41249
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
41272
|
-
import { dirname as dirname3, join as
|
|
41250
|
+
import { dirname as dirname3, join as join8 } from "node:path";
|
|
41273
41251
|
function isTruthy(x) {
|
|
41274
41252
|
return x != null && x !== false;
|
|
41275
41253
|
}
|
|
41276
41254
|
function parseImageField(asset, relativePath) {
|
|
41277
41255
|
if (RELATIVE_ASSET_PATH_REGEX.test(asset)) {
|
|
41278
|
-
return generateUrl(
|
|
41256
|
+
return generateUrl(join8(dirname3(`/${relativePath}`), asset));
|
|
41279
41257
|
}
|
|
41280
41258
|
return asset;
|
|
41281
41259
|
}
|
|
@@ -41752,7 +41730,7 @@ async function createAppManifest({
|
|
|
41752
41730
|
compType: ComponentType.EDITOR_REACT_COMPONENT,
|
|
41753
41731
|
compData: {
|
|
41754
41732
|
editorReactComponent: {
|
|
41755
|
-
type: component.elementType
|
|
41733
|
+
type: component.elementType,
|
|
41756
41734
|
description: component.description,
|
|
41757
41735
|
editorElement: {
|
|
41758
41736
|
...component.editorElement,
|
|
@@ -41786,7 +41764,8 @@ async function createAppManifest({
|
|
|
41786
41764
|
height: component.height ?? 150,
|
|
41787
41765
|
width: component.width ?? Width.UNKNOWN_WIDTH
|
|
41788
41766
|
},
|
|
41789
|
-
contentType: PanelContentType.code
|
|
41767
|
+
contentType: PanelContentType.code,
|
|
41768
|
+
panelMode: component.panelMode
|
|
41790
41769
|
}
|
|
41791
41770
|
}
|
|
41792
41771
|
};
|
|
@@ -41806,7 +41785,7 @@ async function createAppManifest({
|
|
|
41806
41785
|
// src/app-manifest/component-source.ts
|
|
41807
41786
|
init_esm_shims();
|
|
41808
41787
|
var import_variant5 = __toESM(require_lib(), 1);
|
|
41809
|
-
import path8, { dirname as dirname4, join as
|
|
41788
|
+
import path8, { dirname as dirname4, join as join9 } from "node:path";
|
|
41810
41789
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
41811
41790
|
|
|
41812
41791
|
// src/app-manifest/build-output-data-extractor.ts
|
|
@@ -41919,7 +41898,7 @@ async function getEventDevSlugs(component, backendDevServerUrl) {
|
|
|
41919
41898
|
}
|
|
41920
41899
|
async function getRegisteredExtensions(model) {
|
|
41921
41900
|
const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);
|
|
41922
|
-
const outputFilepath =
|
|
41901
|
+
const outputFilepath = join9(
|
|
41923
41902
|
backendBuildFolder,
|
|
41924
41903
|
"getRegisteredExtensions.mjs"
|
|
41925
41904
|
);
|
|
@@ -42147,14 +42126,14 @@ var siteComponentDevBuilder = (component) => {
|
|
|
42147
42126
|
const elements = traverseElementsWithPresetFn(
|
|
42148
42127
|
component.elements,
|
|
42149
42128
|
(elementsStructure, presetName, presetConfig) => {
|
|
42150
|
-
const elementPath =
|
|
42129
|
+
const elementPath = join9(
|
|
42151
42130
|
elementsStructure.reduce(
|
|
42152
|
-
(acc, elementName) =>
|
|
42131
|
+
(acc, elementName) => join9(acc, ELEMENTS_DIR, elementName),
|
|
42153
42132
|
""
|
|
42154
42133
|
)
|
|
42155
42134
|
);
|
|
42156
42135
|
const presetCssUrl = generateUrl(
|
|
42157
|
-
|
|
42136
|
+
join9(
|
|
42158
42137
|
dirname4(component.relativePath),
|
|
42159
42138
|
elementPath,
|
|
42160
42139
|
PRESETS_DIR,
|
|
@@ -42177,7 +42156,7 @@ var siteComponentDevBuilder = (component) => {
|
|
|
42177
42156
|
const presets = component.presets ? Object.entries(component.presets).reduce(
|
|
42178
42157
|
(acc, [presetName, presetConfig]) => {
|
|
42179
42158
|
const presetCssUrl = generateUrl(
|
|
42180
|
-
|
|
42159
|
+
join9(
|
|
42181
42160
|
dirname4(component.relativePath),
|
|
42182
42161
|
PRESETS_DIR,
|
|
42183
42162
|
`${presetName}.css`
|
|
@@ -42225,11 +42204,11 @@ var siteComponentDevBuilder = (component) => {
|
|
|
42225
42204
|
}
|
|
42226
42205
|
};
|
|
42227
42206
|
};
|
|
42228
|
-
var siteComponentBuildBuilder = (component, { browserBuildOutput }, {
|
|
42207
|
+
var siteComponentBuildBuilder = (component, { browserBuildOutput }, { siteComponentsServerBuildOutput }) => {
|
|
42229
42208
|
const moduleId = virtualModuleIdForSiteComponentScriptAsset(component.id);
|
|
42230
42209
|
const sdkModuleId = component.relativeSdkPath ? virtualModuleIdForSiteComponentSdkScriptAsset(component.id) : null;
|
|
42231
42210
|
const previewModuleId = component.relativePreviewPath ? virtualModuleIdForSiteComponentPreview(component.id) : null;
|
|
42232
|
-
if (!
|
|
42211
|
+
if (!siteComponentsServerBuildOutput) {
|
|
42233
42212
|
throw new Error("Missing build output for site component");
|
|
42234
42213
|
}
|
|
42235
42214
|
const presets = {};
|
|
@@ -42270,8 +42249,11 @@ var siteComponentBuildBuilder = (component, { browserBuildOutput }, { ssrBuildOu
|
|
|
42270
42249
|
}
|
|
42271
42250
|
);
|
|
42272
42251
|
const definedResources = component.resources ?? {};
|
|
42273
|
-
const cssUrl = extractModuleBundleCss(
|
|
42274
|
-
|
|
42252
|
+
const cssUrl = extractModuleBundleCss(
|
|
42253
|
+
siteComponentsServerBuildOutput,
|
|
42254
|
+
moduleId
|
|
42255
|
+
);
|
|
42256
|
+
const editorCssUrl = previewModuleId ? extractModuleBundleCss(siteComponentsServerBuildOutput, previewModuleId) : void 0;
|
|
42275
42257
|
return {
|
|
42276
42258
|
presets,
|
|
42277
42259
|
elements,
|
|
@@ -42286,7 +42268,9 @@ var siteComponentBuildBuilder = (component, { browserBuildOutput }, { ssrBuildOu
|
|
|
42286
42268
|
},
|
|
42287
42269
|
server: {
|
|
42288
42270
|
...definedResources.server ?? {},
|
|
42289
|
-
url: generateUrl(
|
|
42271
|
+
url: generateUrl(
|
|
42272
|
+
extractModuleBundleName(siteComponentsServerBuildOutput, moduleId)
|
|
42273
|
+
)
|
|
42290
42274
|
},
|
|
42291
42275
|
sdk: sdkModuleId ? {
|
|
42292
42276
|
...definedResources.sdk ?? {},
|
|
@@ -42351,7 +42335,7 @@ function getComponentDevSourceBuilder(model, devSource, backendSource) {
|
|
|
42351
42335
|
return source;
|
|
42352
42336
|
};
|
|
42353
42337
|
}
|
|
42354
|
-
function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSource, backendSource,
|
|
42338
|
+
function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSource, backendSource, siteComponentsServerBuildSource) {
|
|
42355
42339
|
return async (component) => {
|
|
42356
42340
|
const source = (0, import_variant5.match)(component, {
|
|
42357
42341
|
EmbeddedScript: (embeddedScriptComponent) => embeddedScriptBuilder(model, embeddedScriptComponent, {
|
|
@@ -42394,7 +42378,11 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
|
|
|
42394
42378
|
ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
|
|
42395
42379
|
Monitoring: () => {
|
|
42396
42380
|
},
|
|
42397
|
-
SiteComponent: (component2) => siteComponentBuildBuilder(
|
|
42381
|
+
SiteComponent: (component2) => siteComponentBuildBuilder(
|
|
42382
|
+
component2,
|
|
42383
|
+
browserBuildSource,
|
|
42384
|
+
siteComponentsServerBuildSource
|
|
42385
|
+
),
|
|
42398
42386
|
SiteComponentPanel: (component2) => siteComponentPanelBuilder(component2, {
|
|
42399
42387
|
buildSource: browserBuildSource
|
|
42400
42388
|
})
|
|
@@ -42406,13 +42394,13 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
|
|
|
42406
42394
|
export {
|
|
42407
42395
|
getViteConfig,
|
|
42408
42396
|
getViteServerUrl2 as getViteServerUrl,
|
|
42409
|
-
getMonitoringProvider,
|
|
42410
|
-
getViteConfig5 as getViteConfig2,
|
|
42411
|
-
getViteConfig6 as getViteConfig3,
|
|
42412
42397
|
readAppManifest,
|
|
42413
42398
|
updateMonitoring,
|
|
42414
42399
|
updateTopology,
|
|
42415
42400
|
updateAppManifestComponents,
|
|
42401
|
+
getMonitoringProvider,
|
|
42402
|
+
getViteConfig5 as getViteConfig2,
|
|
42403
|
+
getViteConfig6 as getViteConfig3,
|
|
42416
42404
|
getViteConfig2 as getViteConfig4,
|
|
42417
42405
|
getViteConfig3 as getViteConfig5,
|
|
42418
42406
|
getViteConfig4 as getViteConfig6,
|
|
@@ -42427,4 +42415,4 @@ export {
|
|
|
42427
42415
|
he/he.js:
|
|
42428
42416
|
(*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
|
|
42429
42417
|
*/
|
|
42430
|
-
//# sourceMappingURL=chunk-
|
|
42418
|
+
//# sourceMappingURL=chunk-UNCNFFF6.js.map
|