@wix/astro 2.11.0 → 2.13.0
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/CHANGELOG.md +329 -0
- package/build/dependencies/astro-auth/backend-runtime/{chunk-RTCWF7UX.js → chunk-IUZYED2S.js} +2 -2
- package/build/dependencies/astro-auth/backend-runtime/middleware/auth.js +1 -1
- package/build/dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js +1 -1
- package/build/dependencies/astro-backend-extensions/backend-runtime/{chunk-RHCMPH4V.js → chunk-F7JXR3EK.js} +4 -3
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupServicePlugin.js +1 -1
- package/build/dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.js +1 -1
- package/build/dependencies/astro-backend-extensions/{index.d.ts → types/index.d.ts} +15 -4
- package/build/dependencies/astro-backoffice-extensions/{index.d.ts → types/index.d.ts} +22 -1
- package/build/dependencies/astro-core/{index.d.ts → types/index.d.ts} +17 -6
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.d.ts +6 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/{index.js → customElementHmr.js} +3 -32
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.d.ts +1 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js +26 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.d.ts +5 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js +23 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.d.ts +6 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js +30 -0
- package/build/dependencies/astro-custom-elements-extensions/types/index.d.ts +27 -0
- package/build/dependencies/astro-embedded-scripts-extensions/{index.d.ts → types/index.d.ts} +2 -2
- package/build/dependencies/astro-site-component-panels-extensions/types/index.d.ts +21 -0
- package/build/dependencies/astro-site-components-extensions/types/index.d.ts +36 -0
- package/build/dependencies/astro-site-plugins-extensions/{index.d.ts → types/index.d.ts} +5 -3
- package/build/integration/builders.d.ts +321 -8
- package/build/integration/builders.js +12 -9
- package/build/integration/builders.js.map +1 -1
- package/build/integration/{chunk-OJIGUJIG.js → chunk-AT5HXBVK.js} +1709 -407
- package/build/integration/chunk-AT5HXBVK.js.map +1 -0
- package/build/integration/index.d.ts +1 -1
- package/build/integration/index.js +16 -28
- package/build/integration/index.js.map +1 -1
- package/package.json +9 -6
- package/build/builders.d.ts +0 -6
- package/build/builders.js +0 -42
- package/build/builders.js.map +0 -1
- package/build/dependencies/astro-auth/index.d.ts +0 -7
- package/build/dependencies/astro-auth/index.js +0 -301
- package/build/dependencies/astro-auth/index.js.map +0 -1
- package/build/dependencies/astro-backend-extensions/index.js +0 -7279
- package/build/dependencies/astro-backend-extensions/index.js.map +0 -1
- package/build/dependencies/astro-backoffice-extensions/index.js +0 -7159
- package/build/dependencies/astro-backoffice-extensions/index.js.map +0 -1
- package/build/dependencies/astro-core/index.js +0 -1055
- package/build/dependencies/astro-core/index.js.map +0 -1
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/index.d.ts +0 -11
- package/build/dependencies/astro-custom-elements-extensions/index.d.ts +0 -24
- package/build/dependencies/astro-custom-elements-extensions/index.js +0 -10082
- package/build/dependencies/astro-custom-elements-extensions/index.js.map +0 -1
- package/build/dependencies/astro-embedded-scripts-extensions/index.js +0 -8453
- package/build/dependencies/astro-embedded-scripts-extensions/index.js.map +0 -1
- package/build/dependencies/astro-html-embeds/index.d.ts +0 -5
- package/build/dependencies/astro-html-embeds/index.js +0 -25
- package/build/dependencies/astro-html-embeds/index.js.map +0 -1
- package/build/dependencies/astro-payment-links/index.d.ts +0 -5
- package/build/dependencies/astro-payment-links/index.js +0 -42
- package/build/dependencies/astro-payment-links/index.js.map +0 -1
- package/build/dependencies/astro-robots/index.d.ts +0 -5
- package/build/dependencies/astro-robots/index.js +0 -23
- package/build/dependencies/astro-robots/index.js.map +0 -1
- package/build/dependencies/astro-site-plugins-extensions/index.js +0 -49
- package/build/dependencies/astro-site-plugins-extensions/index.js.map +0 -1
- package/build/dependencies/astro-viewer-api/index.d.ts +0 -5
- package/build/dependencies/astro-viewer-api/index.js +0 -22
- package/build/dependencies/astro-viewer-api/index.js.map +0 -1
- package/build/index.d.ts +0 -16
- package/build/index.js +0 -56
- package/build/index.js.map +0 -1
- package/build/integration/chunk-OJIGUJIG.js.map +0 -1
|
@@ -175,10 +175,10 @@ var require_is_extglob = __commonJS({
|
|
|
175
175
|
if (typeof str !== "string" || str === "") {
|
|
176
176
|
return false;
|
|
177
177
|
}
|
|
178
|
-
var
|
|
179
|
-
while (
|
|
180
|
-
if (
|
|
181
|
-
str = str.slice(
|
|
178
|
+
var match2;
|
|
179
|
+
while (match2 = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
|
|
180
|
+
if (match2[2]) return true;
|
|
181
|
+
str = str.slice(match2.index + match2[0].length);
|
|
182
182
|
}
|
|
183
183
|
return false;
|
|
184
184
|
};
|
|
@@ -1657,8 +1657,8 @@ var require_utils2 = __commonJS({
|
|
|
1657
1657
|
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
1658
1658
|
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
1659
1659
|
exports.removeBackslashes = (str) => {
|
|
1660
|
-
return str.replace(REGEX_REMOVE_BACKSLASH, (
|
|
1661
|
-
return
|
|
1660
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
|
|
1661
|
+
return match2 === "\\" ? "" : match2;
|
|
1662
1662
|
});
|
|
1663
1663
|
};
|
|
1664
1664
|
exports.supportsLookbehinds = () => {
|
|
@@ -2281,10 +2281,10 @@ var require_parse2 = __commonJS({
|
|
|
2281
2281
|
push({ type: "text", value });
|
|
2282
2282
|
continue;
|
|
2283
2283
|
}
|
|
2284
|
-
const
|
|
2284
|
+
const match2 = /^\\+/.exec(remaining());
|
|
2285
2285
|
let slashes = 0;
|
|
2286
|
-
if (
|
|
2287
|
-
slashes =
|
|
2286
|
+
if (match2 && match2[0].length > 2) {
|
|
2287
|
+
slashes = match2[0].length;
|
|
2288
2288
|
state.index += slashes;
|
|
2289
2289
|
if (slashes % 2 !== 0) {
|
|
2290
2290
|
value += "\\";
|
|
@@ -2572,10 +2572,10 @@ var require_parse2 = __commonJS({
|
|
|
2572
2572
|
if (value === "$" || value === "^") {
|
|
2573
2573
|
value = `\\${value}`;
|
|
2574
2574
|
}
|
|
2575
|
-
const
|
|
2576
|
-
if (
|
|
2577
|
-
value +=
|
|
2578
|
-
state.index +=
|
|
2575
|
+
const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
2576
|
+
if (match2) {
|
|
2577
|
+
value += match2[0];
|
|
2578
|
+
state.index += match2[0].length;
|
|
2579
2579
|
}
|
|
2580
2580
|
push({ type: "text", value });
|
|
2581
2581
|
continue;
|
|
@@ -2786,11 +2786,11 @@ var require_parse2 = __commonJS({
|
|
|
2786
2786
|
case "**/.*":
|
|
2787
2787
|
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2788
2788
|
default: {
|
|
2789
|
-
const
|
|
2790
|
-
if (!
|
|
2791
|
-
const source2 = create(
|
|
2789
|
+
const match2 = /^(.*?)\.(\w+)$/.exec(str);
|
|
2790
|
+
if (!match2) return;
|
|
2791
|
+
const source2 = create(match2[1]);
|
|
2792
2792
|
if (!source2) return;
|
|
2793
|
-
return source2 + DOT_LITERAL +
|
|
2793
|
+
return source2 + DOT_LITERAL + match2[2];
|
|
2794
2794
|
}
|
|
2795
2795
|
}
|
|
2796
2796
|
};
|
|
@@ -2843,8 +2843,8 @@ var require_picomatch = __commonJS({
|
|
|
2843
2843
|
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
2844
2844
|
}
|
|
2845
2845
|
const matcher = (input, returnObject = false) => {
|
|
2846
|
-
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
2847
|
-
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
2846
|
+
const { isMatch, match: match2, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
2847
|
+
const result = { glob, state, regex, posix, input, output, match: match2, isMatch };
|
|
2848
2848
|
if (typeof opts.onResult === "function") {
|
|
2849
2849
|
opts.onResult(result);
|
|
2850
2850
|
}
|
|
@@ -2878,20 +2878,20 @@ var require_picomatch = __commonJS({
|
|
|
2878
2878
|
}
|
|
2879
2879
|
const opts = options || {};
|
|
2880
2880
|
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
2881
|
-
let
|
|
2882
|
-
let output =
|
|
2883
|
-
if (
|
|
2881
|
+
let match2 = input === glob;
|
|
2882
|
+
let output = match2 && format ? format(input) : input;
|
|
2883
|
+
if (match2 === false) {
|
|
2884
2884
|
output = format ? format(input) : input;
|
|
2885
|
-
|
|
2885
|
+
match2 = output === glob;
|
|
2886
2886
|
}
|
|
2887
|
-
if (
|
|
2887
|
+
if (match2 === false || opts.capture === true) {
|
|
2888
2888
|
if (opts.matchBase === true || opts.basename === true) {
|
|
2889
|
-
|
|
2889
|
+
match2 = picomatch.matchBase(input, regex, options, posix);
|
|
2890
2890
|
} else {
|
|
2891
|
-
|
|
2891
|
+
match2 = regex.exec(output);
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
|
-
return { isMatch: Boolean(
|
|
2894
|
+
return { isMatch: Boolean(match2), match: match2, output };
|
|
2895
2895
|
};
|
|
2896
2896
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
2897
2897
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
@@ -2989,8 +2989,8 @@ var require_micromatch = __commonJS({
|
|
|
2989
2989
|
if (negated) negatives++;
|
|
2990
2990
|
for (let item of list) {
|
|
2991
2991
|
let matched = isMatch(item, true);
|
|
2992
|
-
let
|
|
2993
|
-
if (!
|
|
2992
|
+
let match2 = negated ? !matched.isMatch : matched.isMatch;
|
|
2993
|
+
if (!match2) continue;
|
|
2994
2994
|
if (negated) {
|
|
2995
2995
|
omit.add(matched.output);
|
|
2996
2996
|
} else {
|
|
@@ -3086,9 +3086,9 @@ var require_micromatch = __commonJS({
|
|
|
3086
3086
|
micromatch.capture = (glob, input, options) => {
|
|
3087
3087
|
let posix = utils.isWindows(options);
|
|
3088
3088
|
let regex = picomatch.makeRe(String(glob), { ...options, capture: true });
|
|
3089
|
-
let
|
|
3090
|
-
if (
|
|
3091
|
-
return
|
|
3089
|
+
let match2 = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
|
3090
|
+
if (match2) {
|
|
3091
|
+
return match2.slice(1).map((v) => v === void 0 ? "" : v);
|
|
3092
3092
|
}
|
|
3093
3093
|
};
|
|
3094
3094
|
micromatch.makeRe = (...args) => picomatch.makeRe(...args);
|
|
@@ -5017,7 +5017,7 @@ var require_partial = __commonJS({
|
|
|
5017
5017
|
if (!pattern.complete && levels > section.length) {
|
|
5018
5018
|
return true;
|
|
5019
5019
|
}
|
|
5020
|
-
const
|
|
5020
|
+
const match2 = parts.every((part, index) => {
|
|
5021
5021
|
const segment = pattern.segments[index];
|
|
5022
5022
|
if (segment.dynamic && segment.patternRe.test(part)) {
|
|
5023
5023
|
return true;
|
|
@@ -5027,7 +5027,7 @@ var require_partial = __commonJS({
|
|
|
5027
5027
|
}
|
|
5028
5028
|
return false;
|
|
5029
5029
|
});
|
|
5030
|
-
if (
|
|
5030
|
+
if (match2) {
|
|
5031
5031
|
return true;
|
|
5032
5032
|
}
|
|
5033
5033
|
}
|
|
@@ -5643,7 +5643,7 @@ var require_ignore = __commonJS({
|
|
|
5643
5643
|
var RETURN_FALSE = () => false;
|
|
5644
5644
|
var sanitizeRange = (range) => range.replace(
|
|
5645
5645
|
REGEX_REGEXP_RANGE,
|
|
5646
|
-
(
|
|
5646
|
+
(match2, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match2 : EMPTY
|
|
5647
5647
|
);
|
|
5648
5648
|
var cleanRangeBackSlash = (slashes) => {
|
|
5649
5649
|
const { length: length3 } = slashes;
|
|
@@ -5695,7 +5695,7 @@ var require_ignore = __commonJS({
|
|
|
5695
5695
|
// > These special characters are often called "metacharacters".
|
|
5696
5696
|
[
|
|
5697
5697
|
/[\\$.|*+(){^]/g,
|
|
5698
|
-
(
|
|
5698
|
+
(match2) => `\\${match2}`
|
|
5699
5699
|
],
|
|
5700
5700
|
[
|
|
5701
5701
|
// > a question mark (?) matches a single character
|
|
@@ -5777,7 +5777,7 @@ var require_ignore = __commonJS({
|
|
|
5777
5777
|
// > can be used to match one of the characters in a range.
|
|
5778
5778
|
// `\` is escaped by step 3
|
|
5779
5779
|
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
|
|
5780
|
-
(
|
|
5780
|
+
(match2, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
|
|
5781
5781
|
],
|
|
5782
5782
|
// ending
|
|
5783
5783
|
[
|
|
@@ -5794,7 +5794,7 @@ var require_ignore = __commonJS({
|
|
|
5794
5794
|
// 'js*' will not match 'a.js'
|
|
5795
5795
|
// 'js/' will not match 'a.js'
|
|
5796
5796
|
// 'js' will match 'a.js' and 'a.js/'
|
|
5797
|
-
(
|
|
5797
|
+
(match2) => /\/$/.test(match2) ? `${match2}$` : `${match2}(?=$|\\/$)`
|
|
5798
5798
|
]
|
|
5799
5799
|
];
|
|
5800
5800
|
var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
|
|
@@ -6205,14 +6205,14 @@ var require_common3 = __commonJS({
|
|
|
6205
6205
|
return rewriteCookieProperty(headerElement, config, property);
|
|
6206
6206
|
});
|
|
6207
6207
|
}
|
|
6208
|
-
return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (
|
|
6208
|
+
return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), (match2, prefix, previousValue) => {
|
|
6209
6209
|
let newValue;
|
|
6210
6210
|
if (previousValue in config) {
|
|
6211
6211
|
newValue = config[previousValue];
|
|
6212
6212
|
} else if ("*" in config) {
|
|
6213
6213
|
newValue = config["*"];
|
|
6214
6214
|
} else {
|
|
6215
|
-
return
|
|
6215
|
+
return match2;
|
|
6216
6216
|
}
|
|
6217
6217
|
if (newValue) {
|
|
6218
6218
|
return prefix + newValue;
|
|
@@ -6435,14 +6435,14 @@ var require_ms = __commonJS({
|
|
|
6435
6435
|
if (str.length > 100) {
|
|
6436
6436
|
return;
|
|
6437
6437
|
}
|
|
6438
|
-
var
|
|
6438
|
+
var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
6439
6439
|
str
|
|
6440
6440
|
);
|
|
6441
|
-
if (!
|
|
6441
|
+
if (!match2) {
|
|
6442
6442
|
return;
|
|
6443
6443
|
}
|
|
6444
|
-
var n2 = parseFloat(
|
|
6445
|
-
var type = (
|
|
6444
|
+
var n2 = parseFloat(match2[1]);
|
|
6445
|
+
var type = (match2[2] || "ms").toLowerCase();
|
|
6446
6446
|
switch (type) {
|
|
6447
6447
|
case "years":
|
|
6448
6448
|
case "year":
|
|
@@ -6575,19 +6575,19 @@ var require_common4 = __commonJS({
|
|
|
6575
6575
|
args.unshift("%O");
|
|
6576
6576
|
}
|
|
6577
6577
|
let index = 0;
|
|
6578
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
6579
|
-
if (
|
|
6578
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => {
|
|
6579
|
+
if (match2 === "%%") {
|
|
6580
6580
|
return "%";
|
|
6581
6581
|
}
|
|
6582
6582
|
index++;
|
|
6583
6583
|
const formatter = createDebug.formatters[format];
|
|
6584
6584
|
if (typeof formatter === "function") {
|
|
6585
6585
|
const val = args[index];
|
|
6586
|
-
|
|
6586
|
+
match2 = formatter.call(self, val);
|
|
6587
6587
|
args.splice(index, 1);
|
|
6588
6588
|
index--;
|
|
6589
6589
|
}
|
|
6590
|
-
return
|
|
6590
|
+
return match2;
|
|
6591
6591
|
});
|
|
6592
6592
|
createDebug.formatArgs.call(self, args);
|
|
6593
6593
|
const logFn = self.log || createDebug.log;
|
|
@@ -6824,12 +6824,12 @@ var require_browser = __commonJS({
|
|
|
6824
6824
|
args.splice(1, 0, c, "color: inherit");
|
|
6825
6825
|
let index = 0;
|
|
6826
6826
|
let lastC = 0;
|
|
6827
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
6828
|
-
if (
|
|
6827
|
+
args[0].replace(/%[a-zA-Z%]/g, (match2) => {
|
|
6828
|
+
if (match2 === "%%") {
|
|
6829
6829
|
return;
|
|
6830
6830
|
}
|
|
6831
6831
|
index++;
|
|
6832
|
-
if (
|
|
6832
|
+
if (match2 === "%c") {
|
|
6833
6833
|
lastC = index;
|
|
6834
6834
|
}
|
|
6835
6835
|
});
|
|
@@ -10836,6 +10836,362 @@ var require_lib2 = __commonJS({
|
|
|
10836
10836
|
}
|
|
10837
10837
|
});
|
|
10838
10838
|
|
|
10839
|
+
// ../../node_modules/path-to-regexp/dist/index.js
|
|
10840
|
+
var require_dist = __commonJS({
|
|
10841
|
+
"../../node_modules/path-to-regexp/dist/index.js"(exports) {
|
|
10842
|
+
"use strict";
|
|
10843
|
+
init_esm_shims();
|
|
10844
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10845
|
+
exports.PathError = exports.TokenData = void 0;
|
|
10846
|
+
exports.parse = parse5;
|
|
10847
|
+
exports.compile = compile;
|
|
10848
|
+
exports.match = match2;
|
|
10849
|
+
exports.pathToRegexp = pathToRegexp;
|
|
10850
|
+
exports.stringify = stringify;
|
|
10851
|
+
var DEFAULT_DELIMITER = "/";
|
|
10852
|
+
var NOOP_VALUE = (value) => value;
|
|
10853
|
+
var ID_START = /^[$_\p{ID_Start}]$/u;
|
|
10854
|
+
var ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u;
|
|
10855
|
+
var SIMPLE_TOKENS = {
|
|
10856
|
+
// Groups.
|
|
10857
|
+
"{": "{",
|
|
10858
|
+
"}": "}",
|
|
10859
|
+
// Reserved.
|
|
10860
|
+
"(": "(",
|
|
10861
|
+
")": ")",
|
|
10862
|
+
"[": "[",
|
|
10863
|
+
"]": "]",
|
|
10864
|
+
"+": "+",
|
|
10865
|
+
"?": "?",
|
|
10866
|
+
"!": "!"
|
|
10867
|
+
};
|
|
10868
|
+
function escapeText2(str) {
|
|
10869
|
+
return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
|
|
10870
|
+
}
|
|
10871
|
+
function escape(str) {
|
|
10872
|
+
return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
|
|
10873
|
+
}
|
|
10874
|
+
var TokenData = class {
|
|
10875
|
+
constructor(tokens, originalPath) {
|
|
10876
|
+
this.tokens = tokens;
|
|
10877
|
+
this.originalPath = originalPath;
|
|
10878
|
+
}
|
|
10879
|
+
};
|
|
10880
|
+
exports.TokenData = TokenData;
|
|
10881
|
+
var PathError = class extends TypeError {
|
|
10882
|
+
constructor(message, originalPath) {
|
|
10883
|
+
let text = message;
|
|
10884
|
+
if (originalPath)
|
|
10885
|
+
text += `: ${originalPath}`;
|
|
10886
|
+
text += `; visit https://git.new/pathToRegexpError for info`;
|
|
10887
|
+
super(text);
|
|
10888
|
+
this.originalPath = originalPath;
|
|
10889
|
+
}
|
|
10890
|
+
};
|
|
10891
|
+
exports.PathError = PathError;
|
|
10892
|
+
function parse5(str, options = {}) {
|
|
10893
|
+
const { encodePath = NOOP_VALUE } = options;
|
|
10894
|
+
const chars2 = [...str];
|
|
10895
|
+
const tokens = [];
|
|
10896
|
+
let index = 0;
|
|
10897
|
+
let pos = 0;
|
|
10898
|
+
function name() {
|
|
10899
|
+
let value = "";
|
|
10900
|
+
if (ID_START.test(chars2[index])) {
|
|
10901
|
+
do {
|
|
10902
|
+
value += chars2[index++];
|
|
10903
|
+
} while (ID_CONTINUE.test(chars2[index]));
|
|
10904
|
+
} else if (chars2[index] === '"') {
|
|
10905
|
+
let quoteStart = index;
|
|
10906
|
+
while (index++ < chars2.length) {
|
|
10907
|
+
if (chars2[index] === '"') {
|
|
10908
|
+
index++;
|
|
10909
|
+
quoteStart = 0;
|
|
10910
|
+
break;
|
|
10911
|
+
}
|
|
10912
|
+
if (chars2[index] === "\\")
|
|
10913
|
+
index++;
|
|
10914
|
+
value += chars2[index];
|
|
10915
|
+
}
|
|
10916
|
+
if (quoteStart) {
|
|
10917
|
+
throw new PathError(`Unterminated quote at index ${quoteStart}`, str);
|
|
10918
|
+
}
|
|
10919
|
+
}
|
|
10920
|
+
if (!value) {
|
|
10921
|
+
throw new PathError(`Missing parameter name at index ${index}`, str);
|
|
10922
|
+
}
|
|
10923
|
+
return value;
|
|
10924
|
+
}
|
|
10925
|
+
while (index < chars2.length) {
|
|
10926
|
+
const value = chars2[index];
|
|
10927
|
+
const type = SIMPLE_TOKENS[value];
|
|
10928
|
+
if (type) {
|
|
10929
|
+
tokens.push({ type, index: index++, value });
|
|
10930
|
+
} else if (value === "\\") {
|
|
10931
|
+
tokens.push({ type: "escape", index: index++, value: chars2[index++] });
|
|
10932
|
+
} else if (value === ":") {
|
|
10933
|
+
tokens.push({ type: "param", index: index++, value: name() });
|
|
10934
|
+
} else if (value === "*") {
|
|
10935
|
+
tokens.push({ type: "wildcard", index: index++, value: name() });
|
|
10936
|
+
} else {
|
|
10937
|
+
tokens.push({ type: "char", index: index++, value });
|
|
10938
|
+
}
|
|
10939
|
+
}
|
|
10940
|
+
tokens.push({ type: "end", index, value: "" });
|
|
10941
|
+
function consumeUntil(endType) {
|
|
10942
|
+
const output = [];
|
|
10943
|
+
while (true) {
|
|
10944
|
+
const token = tokens[pos++];
|
|
10945
|
+
if (token.type === endType)
|
|
10946
|
+
break;
|
|
10947
|
+
if (token.type === "char" || token.type === "escape") {
|
|
10948
|
+
let path5 = token.value;
|
|
10949
|
+
let cur = tokens[pos];
|
|
10950
|
+
while (cur.type === "char" || cur.type === "escape") {
|
|
10951
|
+
path5 += cur.value;
|
|
10952
|
+
cur = tokens[++pos];
|
|
10953
|
+
}
|
|
10954
|
+
output.push({
|
|
10955
|
+
type: "text",
|
|
10956
|
+
value: encodePath(path5)
|
|
10957
|
+
});
|
|
10958
|
+
continue;
|
|
10959
|
+
}
|
|
10960
|
+
if (token.type === "param" || token.type === "wildcard") {
|
|
10961
|
+
output.push({
|
|
10962
|
+
type: token.type,
|
|
10963
|
+
name: token.value
|
|
10964
|
+
});
|
|
10965
|
+
continue;
|
|
10966
|
+
}
|
|
10967
|
+
if (token.type === "{") {
|
|
10968
|
+
output.push({
|
|
10969
|
+
type: "group",
|
|
10970
|
+
tokens: consumeUntil("}")
|
|
10971
|
+
});
|
|
10972
|
+
continue;
|
|
10973
|
+
}
|
|
10974
|
+
throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);
|
|
10975
|
+
}
|
|
10976
|
+
return output;
|
|
10977
|
+
}
|
|
10978
|
+
return new TokenData(consumeUntil("end"), str);
|
|
10979
|
+
}
|
|
10980
|
+
function compile(path5, options = {}) {
|
|
10981
|
+
const { encode: encode2 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
10982
|
+
const data2 = typeof path5 === "object" ? path5 : parse5(path5, options);
|
|
10983
|
+
const fn = tokensToFunction(data2.tokens, delimiter, encode2);
|
|
10984
|
+
return function path6(params = {}) {
|
|
10985
|
+
const [path7, ...missing] = fn(params);
|
|
10986
|
+
if (missing.length) {
|
|
10987
|
+
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
10988
|
+
}
|
|
10989
|
+
return path7;
|
|
10990
|
+
};
|
|
10991
|
+
}
|
|
10992
|
+
function tokensToFunction(tokens, delimiter, encode2) {
|
|
10993
|
+
const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode2));
|
|
10994
|
+
return (data2) => {
|
|
10995
|
+
const result = [""];
|
|
10996
|
+
for (const encoder of encoders) {
|
|
10997
|
+
const [value, ...extras] = encoder(data2);
|
|
10998
|
+
result[0] += value;
|
|
10999
|
+
result.push(...extras);
|
|
11000
|
+
}
|
|
11001
|
+
return result;
|
|
11002
|
+
};
|
|
11003
|
+
}
|
|
11004
|
+
function tokenToFunction(token, delimiter, encode2) {
|
|
11005
|
+
if (token.type === "text")
|
|
11006
|
+
return () => [token.value];
|
|
11007
|
+
if (token.type === "group") {
|
|
11008
|
+
const fn = tokensToFunction(token.tokens, delimiter, encode2);
|
|
11009
|
+
return (data2) => {
|
|
11010
|
+
const [value, ...missing] = fn(data2);
|
|
11011
|
+
if (!missing.length)
|
|
11012
|
+
return [value];
|
|
11013
|
+
return [""];
|
|
11014
|
+
};
|
|
11015
|
+
}
|
|
11016
|
+
const encodeValue = encode2 || NOOP_VALUE;
|
|
11017
|
+
if (token.type === "wildcard" && encode2 !== false) {
|
|
11018
|
+
return (data2) => {
|
|
11019
|
+
const value = data2[token.name];
|
|
11020
|
+
if (value == null)
|
|
11021
|
+
return ["", token.name];
|
|
11022
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
11023
|
+
throw new TypeError(`Expected "${token.name}" to be a non-empty array`);
|
|
11024
|
+
}
|
|
11025
|
+
return [
|
|
11026
|
+
value.map((value2, index) => {
|
|
11027
|
+
if (typeof value2 !== "string") {
|
|
11028
|
+
throw new TypeError(`Expected "${token.name}/${index}" to be a string`);
|
|
11029
|
+
}
|
|
11030
|
+
return encodeValue(value2);
|
|
11031
|
+
}).join(delimiter)
|
|
11032
|
+
];
|
|
11033
|
+
};
|
|
11034
|
+
}
|
|
11035
|
+
return (data2) => {
|
|
11036
|
+
const value = data2[token.name];
|
|
11037
|
+
if (value == null)
|
|
11038
|
+
return ["", token.name];
|
|
11039
|
+
if (typeof value !== "string") {
|
|
11040
|
+
throw new TypeError(`Expected "${token.name}" to be a string`);
|
|
11041
|
+
}
|
|
11042
|
+
return [encodeValue(value)];
|
|
11043
|
+
};
|
|
11044
|
+
}
|
|
11045
|
+
function match2(path5, options = {}) {
|
|
11046
|
+
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
11047
|
+
const { regexp, keys } = pathToRegexp(path5, options);
|
|
11048
|
+
const decoders = keys.map((key) => {
|
|
11049
|
+
if (decode === false)
|
|
11050
|
+
return NOOP_VALUE;
|
|
11051
|
+
if (key.type === "param")
|
|
11052
|
+
return decode;
|
|
11053
|
+
return (value) => value.split(delimiter).map(decode);
|
|
11054
|
+
});
|
|
11055
|
+
return function match3(input) {
|
|
11056
|
+
const m2 = regexp.exec(input);
|
|
11057
|
+
if (!m2)
|
|
11058
|
+
return false;
|
|
11059
|
+
const path6 = m2[0];
|
|
11060
|
+
const params = /* @__PURE__ */ Object.create(null);
|
|
11061
|
+
for (let i = 1; i < m2.length; i++) {
|
|
11062
|
+
if (m2[i] === void 0)
|
|
11063
|
+
continue;
|
|
11064
|
+
const key = keys[i - 1];
|
|
11065
|
+
const decoder = decoders[i - 1];
|
|
11066
|
+
params[key.name] = decoder(m2[i]);
|
|
11067
|
+
}
|
|
11068
|
+
return { path: path6, params };
|
|
11069
|
+
};
|
|
11070
|
+
}
|
|
11071
|
+
function pathToRegexp(path5, options = {}) {
|
|
11072
|
+
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
|
|
11073
|
+
const keys = [];
|
|
11074
|
+
const flags = sensitive ? "" : "i";
|
|
11075
|
+
const sources = [];
|
|
11076
|
+
for (const input of pathsToArray(path5, [])) {
|
|
11077
|
+
const data2 = typeof input === "object" ? input : parse5(input, options);
|
|
11078
|
+
for (const tokens of flatten(data2.tokens, 0, [])) {
|
|
11079
|
+
sources.push(toRegExpSource(tokens, delimiter, keys, data2.originalPath));
|
|
11080
|
+
}
|
|
11081
|
+
}
|
|
11082
|
+
let pattern = `^(?:${sources.join("|")})`;
|
|
11083
|
+
if (trailing)
|
|
11084
|
+
pattern += `(?:${escape(delimiter)}$)?`;
|
|
11085
|
+
pattern += end ? "$" : `(?=${escape(delimiter)}|$)`;
|
|
11086
|
+
const regexp = new RegExp(pattern, flags);
|
|
11087
|
+
return { regexp, keys };
|
|
11088
|
+
}
|
|
11089
|
+
function pathsToArray(paths, init2) {
|
|
11090
|
+
if (Array.isArray(paths)) {
|
|
11091
|
+
for (const p of paths)
|
|
11092
|
+
pathsToArray(p, init2);
|
|
11093
|
+
} else {
|
|
11094
|
+
init2.push(paths);
|
|
11095
|
+
}
|
|
11096
|
+
return init2;
|
|
11097
|
+
}
|
|
11098
|
+
function* flatten(tokens, index, init2) {
|
|
11099
|
+
if (index === tokens.length) {
|
|
11100
|
+
return yield init2;
|
|
11101
|
+
}
|
|
11102
|
+
const token = tokens[index];
|
|
11103
|
+
if (token.type === "group") {
|
|
11104
|
+
for (const seq of flatten(token.tokens, 0, init2.slice())) {
|
|
11105
|
+
yield* flatten(tokens, index + 1, seq);
|
|
11106
|
+
}
|
|
11107
|
+
} else {
|
|
11108
|
+
init2.push(token);
|
|
11109
|
+
}
|
|
11110
|
+
yield* flatten(tokens, index + 1, init2);
|
|
11111
|
+
}
|
|
11112
|
+
function toRegExpSource(tokens, delimiter, keys, originalPath) {
|
|
11113
|
+
let result = "";
|
|
11114
|
+
let backtrack = "";
|
|
11115
|
+
let isSafeSegmentParam = true;
|
|
11116
|
+
for (const token of tokens) {
|
|
11117
|
+
if (token.type === "text") {
|
|
11118
|
+
result += escape(token.value);
|
|
11119
|
+
backtrack += token.value;
|
|
11120
|
+
isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));
|
|
11121
|
+
continue;
|
|
11122
|
+
}
|
|
11123
|
+
if (token.type === "param" || token.type === "wildcard") {
|
|
11124
|
+
if (!isSafeSegmentParam && !backtrack) {
|
|
11125
|
+
throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath);
|
|
11126
|
+
}
|
|
11127
|
+
if (token.type === "param") {
|
|
11128
|
+
result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
|
|
11129
|
+
} else {
|
|
11130
|
+
result += `([\\s\\S]+)`;
|
|
11131
|
+
}
|
|
11132
|
+
keys.push(token);
|
|
11133
|
+
backtrack = "";
|
|
11134
|
+
isSafeSegmentParam = false;
|
|
11135
|
+
continue;
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
return result;
|
|
11139
|
+
}
|
|
11140
|
+
function negate(delimiter, backtrack) {
|
|
11141
|
+
if (backtrack.length < 2) {
|
|
11142
|
+
if (delimiter.length < 2)
|
|
11143
|
+
return `[^${escape(delimiter + backtrack)}]`;
|
|
11144
|
+
return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;
|
|
11145
|
+
}
|
|
11146
|
+
if (delimiter.length < 2) {
|
|
11147
|
+
return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;
|
|
11148
|
+
}
|
|
11149
|
+
return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`;
|
|
11150
|
+
}
|
|
11151
|
+
function stringifyTokens(tokens) {
|
|
11152
|
+
let value = "";
|
|
11153
|
+
let i = 0;
|
|
11154
|
+
function name(value2) {
|
|
11155
|
+
const isSafe = isNameSafe(value2) && isNextNameSafe(tokens[i]);
|
|
11156
|
+
return isSafe ? value2 : JSON.stringify(value2);
|
|
11157
|
+
}
|
|
11158
|
+
while (i < tokens.length) {
|
|
11159
|
+
const token = tokens[i++];
|
|
11160
|
+
if (token.type === "text") {
|
|
11161
|
+
value += escapeText2(token.value);
|
|
11162
|
+
continue;
|
|
11163
|
+
}
|
|
11164
|
+
if (token.type === "group") {
|
|
11165
|
+
value += `{${stringifyTokens(token.tokens)}}`;
|
|
11166
|
+
continue;
|
|
11167
|
+
}
|
|
11168
|
+
if (token.type === "param") {
|
|
11169
|
+
value += `:${name(token.name)}`;
|
|
11170
|
+
continue;
|
|
11171
|
+
}
|
|
11172
|
+
if (token.type === "wildcard") {
|
|
11173
|
+
value += `*${name(token.name)}`;
|
|
11174
|
+
continue;
|
|
11175
|
+
}
|
|
11176
|
+
throw new TypeError(`Unknown token type: ${token.type}`);
|
|
11177
|
+
}
|
|
11178
|
+
return value;
|
|
11179
|
+
}
|
|
11180
|
+
function stringify(data2) {
|
|
11181
|
+
return stringifyTokens(data2.tokens);
|
|
11182
|
+
}
|
|
11183
|
+
function isNameSafe(name) {
|
|
11184
|
+
const [first, ...rest] = name;
|
|
11185
|
+
return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));
|
|
11186
|
+
}
|
|
11187
|
+
function isNextNameSafe(token) {
|
|
11188
|
+
if (token && token.type === "text")
|
|
11189
|
+
return !ID_CONTINUE.test(token.value[0]);
|
|
11190
|
+
return true;
|
|
11191
|
+
}
|
|
11192
|
+
}
|
|
11193
|
+
});
|
|
11194
|
+
|
|
10839
11195
|
// ../astro-backend-extensions/src/integration.ts
|
|
10840
11196
|
init_esm_shims();
|
|
10841
11197
|
import { ok as ok2 } from "assert";
|
|
@@ -10843,6 +11199,7 @@ import { fileURLToPath as fileURLToPath4 } from "url";
|
|
|
10843
11199
|
|
|
10844
11200
|
// ../fs-utils/src/index.ts
|
|
10845
11201
|
init_esm_shims();
|
|
11202
|
+
import { randomBytes } from "crypto";
|
|
10846
11203
|
import {
|
|
10847
11204
|
access,
|
|
10848
11205
|
readFile as fsReadFile,
|
|
@@ -10850,8 +11207,8 @@ import {
|
|
|
10850
11207
|
mkdir,
|
|
10851
11208
|
rm
|
|
10852
11209
|
} from "fs/promises";
|
|
10853
|
-
import { EOL } from "os";
|
|
10854
|
-
import { dirname } from "path";
|
|
11210
|
+
import { EOL, tmpdir } from "os";
|
|
11211
|
+
import { dirname, join } from "path";
|
|
10855
11212
|
async function clearDir(dir) {
|
|
10856
11213
|
await rm(dir, { recursive: true });
|
|
10857
11214
|
await mkdir(dir);
|
|
@@ -10873,21 +11230,17 @@ async function writeJson(filePath, object, opts = { spaces: 2 }) {
|
|
|
10873
11230
|
await writeFile(filePath, toJsonString(object, opts));
|
|
10874
11231
|
}
|
|
10875
11232
|
|
|
10876
|
-
// ../astro-backend-extensions/src/build-components/buildComponents.ts
|
|
10877
|
-
init_esm_shims();
|
|
10878
|
-
import { join as join4 } from "path";
|
|
10879
|
-
|
|
10880
|
-
// ../astro-backend-extensions/src/build-components/buildServicePluginComponent.ts
|
|
10881
|
-
init_esm_shims();
|
|
10882
|
-
import { writeFile as writeFile2 } from "fs/promises";
|
|
10883
|
-
import { join as join2 } from "path";
|
|
10884
|
-
|
|
10885
11233
|
// ../vite-utils/src/index.ts
|
|
10886
11234
|
init_esm_shims();
|
|
10887
11235
|
import { ok } from "assert";
|
|
10888
|
-
import { join } from "path";
|
|
11236
|
+
import { join as join2 } from "path";
|
|
10889
11237
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10890
|
-
import {
|
|
11238
|
+
import {
|
|
11239
|
+
createServer,
|
|
11240
|
+
mergeConfig,
|
|
11241
|
+
build as viteBuild,
|
|
11242
|
+
normalizePath as viteNormalizePath
|
|
11243
|
+
} from "vite";
|
|
10891
11244
|
function appendToDevServerUrl(devServerUrl, relativePath) {
|
|
10892
11245
|
const url = new URL(
|
|
10893
11246
|
relativePath.replace(/^[\\/]/, "./"),
|
|
@@ -10895,33 +11248,111 @@ function appendToDevServerUrl(devServerUrl, relativePath) {
|
|
|
10895
11248
|
);
|
|
10896
11249
|
return url.toString();
|
|
10897
11250
|
}
|
|
11251
|
+
async function build(config) {
|
|
11252
|
+
const buildOutput = await viteBuild(config);
|
|
11253
|
+
return viteBuildOutputToRollupOutputs(buildOutput);
|
|
11254
|
+
}
|
|
11255
|
+
async function buildAll(configs) {
|
|
11256
|
+
const buildOutput = [];
|
|
11257
|
+
for (const config of configs) {
|
|
11258
|
+
const result = await viteBuild(config);
|
|
11259
|
+
if (Array.isArray(result)) {
|
|
11260
|
+
buildOutput.push(...result);
|
|
11261
|
+
} else if ("output" in result) {
|
|
11262
|
+
buildOutput.push(result);
|
|
11263
|
+
}
|
|
11264
|
+
}
|
|
11265
|
+
return viteBuildOutputToRollupOutputs(buildOutput);
|
|
11266
|
+
}
|
|
11267
|
+
async function createTemporaryViteServer(viteConfig) {
|
|
11268
|
+
const server = await createServer(
|
|
11269
|
+
mergeConfig(viteConfig, {
|
|
11270
|
+
logLevel: "silent",
|
|
11271
|
+
optimizeDeps: { noDiscovery: true },
|
|
11272
|
+
server: {
|
|
11273
|
+
middlewareMode: true,
|
|
11274
|
+
ws: false
|
|
11275
|
+
}
|
|
11276
|
+
})
|
|
11277
|
+
);
|
|
11278
|
+
return server;
|
|
11279
|
+
}
|
|
11280
|
+
function getAssetForModuleId({
|
|
11281
|
+
buildOutput,
|
|
11282
|
+
moduleId
|
|
11283
|
+
}) {
|
|
11284
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.fileName === moduleId);
|
|
11285
|
+
ok(asset);
|
|
11286
|
+
return asset;
|
|
11287
|
+
}
|
|
11288
|
+
function getAssetForName({
|
|
11289
|
+
name,
|
|
11290
|
+
buildOutput
|
|
11291
|
+
}) {
|
|
11292
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.names.includes(name));
|
|
11293
|
+
ok(asset);
|
|
11294
|
+
return asset;
|
|
11295
|
+
}
|
|
10898
11296
|
function getAssetUrlForModuleId({
|
|
10899
11297
|
baseUrl,
|
|
10900
11298
|
devServer,
|
|
10901
11299
|
moduleId
|
|
10902
11300
|
}) {
|
|
10903
|
-
const pathWithBase =
|
|
11301
|
+
const pathWithBase = join2(devServer.config.base, "@id", `${moduleId}?import`);
|
|
10904
11302
|
return appendToDevServerUrl(baseUrl, pathWithBase);
|
|
10905
11303
|
}
|
|
11304
|
+
function getChunkForEntryName({
|
|
11305
|
+
buildOutput,
|
|
11306
|
+
entryName
|
|
11307
|
+
}) {
|
|
11308
|
+
const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.isEntry && x.name === entryName);
|
|
11309
|
+
ok(chunk);
|
|
11310
|
+
return chunk;
|
|
11311
|
+
}
|
|
11312
|
+
function getChunkForModuleId({
|
|
11313
|
+
buildOutput,
|
|
11314
|
+
moduleId
|
|
11315
|
+
}) {
|
|
11316
|
+
const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.facadeModuleId === moduleId);
|
|
11317
|
+
ok(chunk);
|
|
11318
|
+
return chunk;
|
|
11319
|
+
}
|
|
11320
|
+
function getCssFileNameFromChunk(chunk) {
|
|
11321
|
+
return chunk.viteMetadata?.importedCss.values().next().value;
|
|
11322
|
+
}
|
|
10906
11323
|
function getLocalDevServerUrl(server) {
|
|
10907
11324
|
const [devServerUrl] = server.resolvedUrls?.local ?? [];
|
|
10908
11325
|
ok(devServerUrl != null);
|
|
10909
11326
|
return devServerUrl;
|
|
10910
11327
|
}
|
|
11328
|
+
async function loadFileWithVite(filename, server) {
|
|
11329
|
+
const module2 = await server.ssrLoadModule(filename).catch((error) => {
|
|
11330
|
+
if (error != null && typeof error === "object" && "code" in error && error.code === "ERR_LOAD_URL") {
|
|
11331
|
+
return null;
|
|
11332
|
+
}
|
|
11333
|
+
throw error;
|
|
11334
|
+
});
|
|
11335
|
+
return module2;
|
|
11336
|
+
}
|
|
10911
11337
|
function viteBuildOutputToRollupOutputs(viteBuildOutput) {
|
|
10912
|
-
const
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
} else if ("output" in viteBuildOutput) {
|
|
10916
|
-
result.push(viteBuildOutput);
|
|
10917
|
-
}
|
|
10918
|
-
return result;
|
|
11338
|
+
const isValidRollupOutput = "output" in viteBuildOutput || Array.isArray(viteBuildOutput);
|
|
11339
|
+
ok(isValidRollupOutput);
|
|
11340
|
+
return Array.isArray(viteBuildOutput) ? viteBuildOutput.flatMap((output) => output.output) : viteBuildOutput.output;
|
|
10919
11341
|
}
|
|
10920
11342
|
function normalizePath(id) {
|
|
10921
11343
|
const filePath = typeof id === "string" ? id : fileURLToPath2(id);
|
|
10922
|
-
return
|
|
11344
|
+
return viteNormalizePath(filePath);
|
|
10923
11345
|
}
|
|
10924
11346
|
|
|
11347
|
+
// ../astro-backend-extensions/src/build-components/buildComponents.ts
|
|
11348
|
+
init_esm_shims();
|
|
11349
|
+
import { join as join5 } from "path";
|
|
11350
|
+
|
|
11351
|
+
// ../astro-backend-extensions/src/build-components/buildServicePluginComponent.ts
|
|
11352
|
+
init_esm_shims();
|
|
11353
|
+
import { writeFile as writeFile2 } from "fs/promises";
|
|
11354
|
+
import { join as join3 } from "path";
|
|
11355
|
+
|
|
10925
11356
|
// ../../node_modules/outdent/lib-module/index.js
|
|
10926
11357
|
init_esm_shims();
|
|
10927
11358
|
function noop() {
|
|
@@ -10967,9 +11398,9 @@ var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
|
|
|
10967
11398
|
var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
|
|
10968
11399
|
function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
|
|
10969
11400
|
var indentationLevel = 0;
|
|
10970
|
-
var
|
|
10971
|
-
if (
|
|
10972
|
-
indentationLevel =
|
|
11401
|
+
var match2 = strings[0].match(reDetectIndentation);
|
|
11402
|
+
if (match2) {
|
|
11403
|
+
indentationLevel = match2[1].length;
|
|
10973
11404
|
}
|
|
10974
11405
|
var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
|
|
10975
11406
|
var reMatchIndent = new RegExp(reSource, "g");
|
|
@@ -11067,10 +11498,10 @@ async function buildServicePluginComponent({
|
|
|
11067
11498
|
entryFileName,
|
|
11068
11499
|
srcDir
|
|
11069
11500
|
}) {
|
|
11070
|
-
const directory =
|
|
11501
|
+
const directory = join3(codegenDir, compId);
|
|
11071
11502
|
await outputDir(directory);
|
|
11072
|
-
const entrypoint =
|
|
11073
|
-
const entryFilePath =
|
|
11503
|
+
const entrypoint = join3(directory, `entry.ts`);
|
|
11504
|
+
const entryFilePath = join3(srcDir, entryFileName);
|
|
11074
11505
|
await writeFile2(
|
|
11075
11506
|
entrypoint,
|
|
11076
11507
|
defaultOutdent`
|
|
@@ -11086,7 +11517,7 @@ async function buildServicePluginComponent({
|
|
|
11086
11517
|
// ../astro-backend-extensions/src/build-components/buildWebhookComponent.ts
|
|
11087
11518
|
init_esm_shims();
|
|
11088
11519
|
import { writeFile as writeFile3 } from "fs/promises";
|
|
11089
|
-
import { join as
|
|
11520
|
+
import { join as join4 } from "path";
|
|
11090
11521
|
var setupWebhookUrl = new URL(
|
|
11091
11522
|
"../dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.js",
|
|
11092
11523
|
import.meta.url
|
|
@@ -11097,10 +11528,10 @@ async function buildWebhookComponent({
|
|
|
11097
11528
|
entryFileName,
|
|
11098
11529
|
srcDir
|
|
11099
11530
|
}) {
|
|
11100
|
-
const directory =
|
|
11531
|
+
const directory = join4(codegenDir, compId);
|
|
11101
11532
|
await outputDir(directory);
|
|
11102
|
-
const entrypoint =
|
|
11103
|
-
const entryFilePath =
|
|
11533
|
+
const entrypoint = join4(directory, `entry.ts`);
|
|
11534
|
+
const entryFilePath = join4(srcDir, entryFileName);
|
|
11104
11535
|
await writeFile3(
|
|
11105
11536
|
entrypoint,
|
|
11106
11537
|
defaultOutdent`
|
|
@@ -11119,8 +11550,8 @@ async function buildComponents({
|
|
|
11119
11550
|
extensions,
|
|
11120
11551
|
srcDir
|
|
11121
11552
|
}) {
|
|
11122
|
-
const webhooksCodegenDir =
|
|
11123
|
-
const servicePluginsCodegenDir =
|
|
11553
|
+
const webhooksCodegenDir = join5(codegenDir, "webhooks");
|
|
11554
|
+
const servicePluginsCodegenDir = join5(codegenDir, "service-plugins");
|
|
11124
11555
|
for (const extension of extensions) {
|
|
11125
11556
|
switch (extension.type) {
|
|
11126
11557
|
case "EcomAdditionalFees": {
|
|
@@ -11192,11 +11623,91 @@ async function buildComponents({
|
|
|
11192
11623
|
|
|
11193
11624
|
// ../astro-backend-extensions/src/utils/createExtensionManifest.ts
|
|
11194
11625
|
init_esm_shims();
|
|
11195
|
-
|
|
11626
|
+
|
|
11627
|
+
// ../astro-backend-extensions/src/utils/legacyWebhookMap.ts
|
|
11628
|
+
init_esm_shims();
|
|
11629
|
+
var mapping = {
|
|
11630
|
+
AppInstalled: "APP_PROVISIONED_WEBHOOK",
|
|
11631
|
+
AppRemoved: "APP_REMOVED_WEBHOOK",
|
|
11632
|
+
"com.wix.bookings.api.v1.BookingNotification": "BOOKINGS.BOOKING.EVENTS",
|
|
11633
|
+
"com.wix.bookings.schedules.api.v1.ScheduleNotification": "BOOKINGS.SCHEDULES.EVENTS",
|
|
11634
|
+
"com.wix.ecommerce.cart.abandonment.api.v1.CartAbandonedEvent": "STORES_CART_ABANDONED_CART_WEBHOOK",
|
|
11635
|
+
"com.wix.ecommerce.cart.abandonment.api.v1.CartRecoveredEvent": "STORES_CART_RECOVERED_WEBHOOK",
|
|
11636
|
+
"com.wix.ecommerce.cart.api.v1.CartCompletedEvent": "STORES_CART_COMPLETED_WEBHOOK",
|
|
11637
|
+
"com.wix.ecommerce.cart.api.v1.CartCreatedEvent": "STORES_CART_CREATED_WEBHOOK",
|
|
11638
|
+
"com.wix.ecommerce.catalog.api.v1.CollectionChanged": "STORES_COLLECTION_CHANGED",
|
|
11639
|
+
"com.wix.ecommerce.catalog.api.v1.CollectionCreated": "STORES_COLLECTION_CREATED",
|
|
11640
|
+
"com.wix.ecommerce.catalog.api.v1.CollectionDeleted": "STORES_COLLECTION_DELETED",
|
|
11641
|
+
"com.wix.ecommerce.catalog.api.v1.ProductChanged": "STORES_PRODUCT_CHANGED",
|
|
11642
|
+
"com.wix.ecommerce.catalog.api.v1.ProductCreated": "STORES_PRODUCT_CREATED",
|
|
11643
|
+
"com.wix.ecommerce.catalog.api.v1.ProductDeleted": "STORES_PRODUCT_DELETED",
|
|
11644
|
+
"com.wix.ecommerce.catalog.api.v1.VariantsChanged": "STORES_VARIANTS_CHANGED",
|
|
11645
|
+
"com.wix.ecommerce.inventory.api.v1.InventoryItemChanged": "STORES_INVENTORY_ITEM_CHANGED",
|
|
11646
|
+
"com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged": "STORES_INVENTORY_VARIANTS_CHANGED",
|
|
11647
|
+
"com.wix.ecommerce.orders.api.v2.OrderEvent": "STORES_NEW_ORDER_WEBHOOK",
|
|
11648
|
+
"com.wix.payment.api.pay.v3.PaymentEvent": "CASHIER_PAYMENT_EVENT_WEBHOOK",
|
|
11649
|
+
"com.wixpress.bookings.resources.core.api.v1.resource.ResourceNotification": "BOOKINGS.RESOURCES.EVENTS",
|
|
11650
|
+
"com.wixpress.bookings.services.api.v1.CategoryNotification": "BOOKINGS.CATEGORIES.EVENTS",
|
|
11651
|
+
"com.wixpress.bookings.services.api.v1.FormNotification": "BOOKINGS.FORMS.EVENTS",
|
|
11652
|
+
"com.wixpress.bookings.services.api.v1.ServiceNotification": "BOOKINGS.SERVICES.EVENTS",
|
|
11653
|
+
"com.wixpress.emailsubscriptions.v1.EmailSubscriptionChanged": "EMAIL_SUBSCRIPTION_CHANGED",
|
|
11654
|
+
"com.wixpress.formbuilder.api.v1.FormSubmittedEvent": "CRM_FORM_SUBMITTED",
|
|
11655
|
+
FulfillmentCreated: "STORES_FULFILLMENT_CREATED",
|
|
11656
|
+
FulfillmentDeleted: "STORES_FULFILLMENT_DELETED",
|
|
11657
|
+
FulfillmentUpdated: "STORES_FULFILLMENT_UPDATED",
|
|
11658
|
+
NewMessageReceived: "WIX_CHAT_NEW_MESSAGE",
|
|
11659
|
+
OneTimePurchasesChanged: "wix.stores.v1.subscription_option_one_time_purcahse_changed",
|
|
11660
|
+
OrderCanceled: "STORES_ORDER_CANCEL_WEBHOOK",
|
|
11661
|
+
OrderPaid: "STORES_ORDER_PAID_WEBHOOK",
|
|
11662
|
+
OrderRefunded: "STORES_ORDER_REFUND_WEBHOOK",
|
|
11663
|
+
PaidPlanAutoRenewalCancelled: "APP_SUBSCRIPTION_CANCELLED_WEBHOOK",
|
|
11664
|
+
PaidPlanChanged: "APP_SUBSCRIPTION_CHANGED_WEBHOOK",
|
|
11665
|
+
PaidPlanPurchased: "APP_SUBSCRIPTION_CREATED_WEBHOOK",
|
|
11666
|
+
PlanConvertedToPaid: "APP-SUBSCRIPTION-CONVERTED-TO-PAID-WEBHOOK",
|
|
11667
|
+
PlanReactivated: "APP_SUBSCRIPTION_REACTIVATED_WEBHOOK",
|
|
11668
|
+
PlanTransferred: "APP_SUBSCRIPTION_TRANSFERRED_WEBHOOK",
|
|
11669
|
+
SitePropertiesUpdated: "SITE_PROPERTIES_UPDATED",
|
|
11670
|
+
SubscriptionOptionsAssignmentChangedForProduct: "wix.stores.v1.subscription_option_assigned",
|
|
11671
|
+
"wix.blog.v3.category_created": "wix.blog.category_created",
|
|
11672
|
+
"wix.blog.v3.category_deleted": "wix.blog.category_deleted",
|
|
11673
|
+
"wix.blog.v3.category_updated": "wix.blog.category_updated",
|
|
11674
|
+
"wix.blog.v3.post_created": "wix.blog.post_created",
|
|
11675
|
+
"wix.blog.v3.post_deleted": "wix.blog.post_deleted",
|
|
11676
|
+
"wix.blog.v3.post_liked": "wix.blog.post_liked",
|
|
11677
|
+
"wix.blog.v3.post_unliked": "wix.blog.post_unliked",
|
|
11678
|
+
"wix.events.events.EventCanceled": "EVENTS_EVENT_CANCELED_WEBHOOK",
|
|
11679
|
+
"wix.events.events.EventCreated": "EVENTS_EVENT_CREATED_WEBHOOK",
|
|
11680
|
+
"wix.events.events.EventDeleted": "EVENTS_EVENT_DELETED_WEBHOOK",
|
|
11681
|
+
"wix.events.events.EventEnded": "EVENTS_EVENT_ENDED_WEBHOOK",
|
|
11682
|
+
"wix.events.events.EventReminder": "EVENTS_EVENT_REMINDER",
|
|
11683
|
+
"wix.events.events.EventStarted": "EVENTS_EVENT_STARTED_WEBHOOK",
|
|
11684
|
+
"wix.events.events.EventUpdated": "EVENTS_EVENT_UPDATED_WEBHOOK",
|
|
11685
|
+
"wix.events.rsvp.events.RsvpCreated": "EVENTS_RSVP_CREATED_WEBHOOK",
|
|
11686
|
+
"wix.events.rsvp.events.RsvpDeleted": "EVENTS_RSVP_DELETED_WEBHOOK",
|
|
11687
|
+
"wix.events.rsvp.events.RsvpUpdated": "EVENTS_RSVP_UPDATED_WEBHOOK",
|
|
11688
|
+
"wix.events.ticketing.events.OrderConfirmed": "EVENTS_TICKETING_ORDER_CONFIRMED_WEBHOOK",
|
|
11689
|
+
"wix.events.ticketing.events.OrderDeleted": "EVENTS_TICKETING_ORDER_DELETED_WEBHOOK",
|
|
11690
|
+
"wix.events.ticketing.events.OrderInitiated": "EVENTS_TICKETING_ORDER_INITIATED_WEBHOOK",
|
|
11691
|
+
"wix.events.ticketing.events.OrderUpdated": "EVENTS_TICKETING_ORDER_UPDATED_WEBHOOK",
|
|
11692
|
+
"wix.events.ticketing.events.ReservationCreated": "EVENTS_TICKETING_RESERVATION_CREATED_WEBHOOK",
|
|
11693
|
+
"wix.events.ticketing.events.ReservationUpdated": "EVENTS_TICKETING_RESERVATION_UPDATED_WEBHOOK",
|
|
11694
|
+
"wix.events.ticketing.events.TicketDefinitionCreated": "EVENTS_TICKETING_TICKET_DEFINITION_CREATED_WEBHOOK",
|
|
11695
|
+
"wix.events.ticketing.events.TicketDefinitionDeleted": "EVENTS_TICKETING_TICKET_DEFINITION_DELETED_WEBHOOK",
|
|
11696
|
+
"wix.events.ticketing.events.TicketDefinitionUpdated": "EVENTS_TICKETING_TICKET_DEFINITION_UPDATED_WEBHOOK"
|
|
11697
|
+
};
|
|
11698
|
+
var legacyWebhookMap = new Map(Object.entries(mapping));
|
|
11699
|
+
|
|
11700
|
+
// ../astro-backend-extensions/src/utils/createExtensionManifest.ts
|
|
11701
|
+
async function createExtensionManifest({
|
|
11702
|
+
baseUrl,
|
|
11703
|
+
extension,
|
|
11704
|
+
temporaryViteServer
|
|
11705
|
+
}) {
|
|
11196
11706
|
switch (extension.type) {
|
|
11197
11707
|
case "EcomAdditionalFees": {
|
|
11198
11708
|
return {
|
|
11199
11709
|
compId: extension.options.id,
|
|
11710
|
+
compName: extension.options.name,
|
|
11200
11711
|
compType: "ECOM_ADDITIONAL_FEES",
|
|
11201
11712
|
compData: {
|
|
11202
11713
|
ecomAdditionalFees: {
|
|
@@ -11211,6 +11722,7 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11211
11722
|
case "EcomDiscountsTrigger": {
|
|
11212
11723
|
return {
|
|
11213
11724
|
compId: extension.options.id,
|
|
11725
|
+
compName: extension.options.name,
|
|
11214
11726
|
compType: "ECOM_DISCOUNTS_TRIGGER",
|
|
11215
11727
|
compData: {
|
|
11216
11728
|
ecomDiscountsTrigger: {
|
|
@@ -11225,6 +11737,7 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11225
11737
|
case "EcomGiftCardsProvider": {
|
|
11226
11738
|
return {
|
|
11227
11739
|
compId: extension.options.id,
|
|
11740
|
+
compName: extension.options.name,
|
|
11228
11741
|
compType: "GIFT_CARDS_PROVIDER",
|
|
11229
11742
|
compData: {
|
|
11230
11743
|
giftCardsProvider: {
|
|
@@ -11239,13 +11752,15 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11239
11752
|
case "EcomPaymentSettings": {
|
|
11240
11753
|
return {
|
|
11241
11754
|
compId: extension.options.id,
|
|
11755
|
+
compName: extension.options.name,
|
|
11242
11756
|
compType: "ECOM_PAYMENT_SETTINGS",
|
|
11243
11757
|
compData: {
|
|
11244
11758
|
ecomPaymentSettings: {
|
|
11245
11759
|
deploymentUri: appendToDevServerUrl(
|
|
11246
11760
|
baseUrl,
|
|
11247
11761
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11248
|
-
)
|
|
11762
|
+
),
|
|
11763
|
+
fallbackValueForRequires3dSecure: extension.options.fallbackValueForRequires3dSecure
|
|
11249
11764
|
}
|
|
11250
11765
|
}
|
|
11251
11766
|
};
|
|
@@ -11253,14 +11768,20 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11253
11768
|
case "EcomShippingRates": {
|
|
11254
11769
|
return {
|
|
11255
11770
|
compId: extension.options.id,
|
|
11771
|
+
compName: extension.options.name,
|
|
11256
11772
|
compType: "ECOM_SHIPPING_RATES",
|
|
11257
11773
|
compData: {
|
|
11258
11774
|
ecomShippingRates: {
|
|
11259
11775
|
name: extension.options.name,
|
|
11776
|
+
dashboardUrl: extension.options.dashboardUrl,
|
|
11260
11777
|
deploymentUri: appendToDevServerUrl(
|
|
11261
11778
|
baseUrl,
|
|
11262
11779
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11263
|
-
)
|
|
11780
|
+
),
|
|
11781
|
+
description: extension.options.description,
|
|
11782
|
+
fallbackDefinitionMandatory: extension.options.fallbackDefinitionMandatory,
|
|
11783
|
+
learnMoreUrl: extension.options.learnMoreUrl,
|
|
11784
|
+
thumbnailUrl: extension.options.thumbnailUrl
|
|
11264
11785
|
}
|
|
11265
11786
|
}
|
|
11266
11787
|
};
|
|
@@ -11268,20 +11789,37 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11268
11789
|
case "EcomValidations": {
|
|
11269
11790
|
return {
|
|
11270
11791
|
compId: extension.options.id,
|
|
11792
|
+
compName: extension.options.name,
|
|
11271
11793
|
compType: "ECOM_VALIDATIONS",
|
|
11272
11794
|
compData: {
|
|
11273
11795
|
ecomValidations: {
|
|
11274
11796
|
deploymentUri: appendToDevServerUrl(
|
|
11275
11797
|
baseUrl,
|
|
11276
11798
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11277
|
-
)
|
|
11799
|
+
),
|
|
11800
|
+
validateInCart: extension.options.validateInCart
|
|
11278
11801
|
}
|
|
11279
11802
|
}
|
|
11280
11803
|
};
|
|
11281
11804
|
}
|
|
11282
11805
|
case "Webhook": {
|
|
11806
|
+
const module2 = await loadFileWithVite(
|
|
11807
|
+
extension.options.source,
|
|
11808
|
+
temporaryViteServer
|
|
11809
|
+
);
|
|
11810
|
+
if (!isValidEventFileExport(module2)) {
|
|
11811
|
+
throw new Error(
|
|
11812
|
+
[
|
|
11813
|
+
`Invalid export for event source at \`${extension.options.source}\`.`,
|
|
11814
|
+
`Expected event listener call to be the default export.`
|
|
11815
|
+
].join("\n")
|
|
11816
|
+
);
|
|
11817
|
+
}
|
|
11818
|
+
const { slug } = module2.default();
|
|
11819
|
+
const webhookSlug = legacyWebhookMap.get(slug) ?? slug;
|
|
11283
11820
|
return {
|
|
11284
11821
|
compId: extension.options.id,
|
|
11822
|
+
compName: webhookSlug,
|
|
11285
11823
|
compType: "WEBHOOK",
|
|
11286
11824
|
compData: {
|
|
11287
11825
|
webhook: {
|
|
@@ -11289,13 +11827,25 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11289
11827
|
baseUrl,
|
|
11290
11828
|
`/_wix/extensions/webhooks/${extension.options.id}`
|
|
11291
11829
|
),
|
|
11292
|
-
webhookSlug
|
|
11830
|
+
webhookSlug
|
|
11293
11831
|
}
|
|
11294
11832
|
}
|
|
11295
11833
|
};
|
|
11296
11834
|
}
|
|
11297
11835
|
}
|
|
11298
11836
|
}
|
|
11837
|
+
function isValidEventFileExport(module2) {
|
|
11838
|
+
if (typeof module2 !== "object" || module2 == null) {
|
|
11839
|
+
return false;
|
|
11840
|
+
}
|
|
11841
|
+
if (!("default" in module2)) {
|
|
11842
|
+
return false;
|
|
11843
|
+
}
|
|
11844
|
+
if (typeof module2.default !== "function") {
|
|
11845
|
+
return false;
|
|
11846
|
+
}
|
|
11847
|
+
return true;
|
|
11848
|
+
}
|
|
11299
11849
|
|
|
11300
11850
|
// ../astro-backend-extensions/src/utils/filterSupportedExtensions.ts
|
|
11301
11851
|
init_esm_shims();
|
|
@@ -11719,11 +12269,11 @@ var normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
|
11719
12269
|
return nodePath.isAbsolute(path5) ? path5 : nodePath.join(cwd, path5);
|
|
11720
12270
|
};
|
|
11721
12271
|
var shouldExpandGlobstarDirectory = (pattern) => {
|
|
11722
|
-
const
|
|
11723
|
-
if (!
|
|
12272
|
+
const match2 = pattern?.match(/\*\*\/([^/]+)$/);
|
|
12273
|
+
if (!match2) {
|
|
11724
12274
|
return false;
|
|
11725
12275
|
}
|
|
11726
|
-
const dirname3 =
|
|
12276
|
+
const dirname3 = match2[1];
|
|
11727
12277
|
const hasWildcards = /[*?[\]{}]/.test(dirname3);
|
|
11728
12278
|
const hasExtension = nodePath.extname(dirname3) && !dirname3.startsWith(".");
|
|
11729
12279
|
return !hasWildcards && !hasExtension;
|
|
@@ -11937,6 +12487,7 @@ async function removeUnusedCodegenFiles({
|
|
|
11937
12487
|
var createIntegration = () => {
|
|
11938
12488
|
let srcDir = null;
|
|
11939
12489
|
let codegenDir = null;
|
|
12490
|
+
let temporaryViteServer = null;
|
|
11940
12491
|
return {
|
|
11941
12492
|
name: "@wix/astro/backend-extensions",
|
|
11942
12493
|
hooks: {
|
|
@@ -11974,15 +12525,33 @@ var createIntegration = () => {
|
|
|
11974
12525
|
await removeUnusedCodegenFiles({ codegenDir, extensions });
|
|
11975
12526
|
await buildComponents({ codegenDir, extensions, srcDir });
|
|
11976
12527
|
},
|
|
11977
|
-
"
|
|
12528
|
+
async "astro:server:done"() {
|
|
12529
|
+
await temporaryViteServer?.close();
|
|
12530
|
+
},
|
|
12531
|
+
async "wix:app-manifest:setup"({
|
|
11978
12532
|
model,
|
|
11979
12533
|
serverUrlPlaceholder: serverUrlPlaceholder2,
|
|
11980
12534
|
updateAppManifest
|
|
11981
12535
|
}) {
|
|
12536
|
+
ok2(srcDir != null);
|
|
12537
|
+
temporaryViteServer ??= await createTemporaryViteServer({
|
|
12538
|
+
root: srcDir,
|
|
12539
|
+
// this makes the temporary vite server have its own, separate, copy
|
|
12540
|
+
// of `@wix/sdk-context`, which means it runs in an isolated context
|
|
12541
|
+
// than that of the dev server.
|
|
12542
|
+
ssr: { noExternal: true }
|
|
12543
|
+
});
|
|
11982
12544
|
const extensions = model.extensions.filter(filterSupportedExtensions);
|
|
11983
12545
|
updateAppManifest({
|
|
11984
|
-
components:
|
|
11985
|
-
(extension) =>
|
|
12546
|
+
components: await Promise.all(
|
|
12547
|
+
extensions.map(async (extension) => {
|
|
12548
|
+
ok2(temporaryViteServer);
|
|
12549
|
+
return createExtensionManifest({
|
|
12550
|
+
baseUrl: serverUrlPlaceholder2,
|
|
12551
|
+
extension,
|
|
12552
|
+
temporaryViteServer
|
|
12553
|
+
});
|
|
12554
|
+
})
|
|
11986
12555
|
)
|
|
11987
12556
|
});
|
|
11988
12557
|
}
|
|
@@ -12063,12 +12632,12 @@ import { fileURLToPath as fileURLToPath5 } from "url";
|
|
|
12063
12632
|
|
|
12064
12633
|
// ../astro-backoffice-extensions/src/build-components/buildComponents.ts
|
|
12065
12634
|
init_esm_shims();
|
|
12066
|
-
import { join as
|
|
12635
|
+
import { join as join7 } from "path";
|
|
12067
12636
|
|
|
12068
12637
|
// ../astro-backoffice-extensions/src/build-components/buildBackofficeComponent.ts
|
|
12069
12638
|
init_esm_shims();
|
|
12070
12639
|
import { writeFile as writeFile4 } from "fs/promises";
|
|
12071
|
-
import { join as
|
|
12640
|
+
import { join as join6 } from "path";
|
|
12072
12641
|
var wrapComponentUrl = new URL(
|
|
12073
12642
|
"../dependencies/astro-backoffice-extensions/browser-runtime/wrapComponent.js",
|
|
12074
12643
|
import.meta.url
|
|
@@ -12079,10 +12648,10 @@ async function buildBackofficeComponent({
|
|
|
12079
12648
|
entryFileName,
|
|
12080
12649
|
srcDir
|
|
12081
12650
|
}) {
|
|
12082
|
-
const directory =
|
|
12651
|
+
const directory = join6(codegenDir, compId);
|
|
12083
12652
|
await outputDir(directory);
|
|
12084
|
-
const entryFilePath =
|
|
12085
|
-
const HocEntrypoint =
|
|
12653
|
+
const entryFilePath = join6(srcDir, entryFileName);
|
|
12654
|
+
const HocEntrypoint = join6(directory, `wrapper.tsx`);
|
|
12086
12655
|
await writeFile4(
|
|
12087
12656
|
HocEntrypoint,
|
|
12088
12657
|
defaultOutdent`
|
|
@@ -12092,7 +12661,7 @@ async function buildBackofficeComponent({
|
|
|
12092
12661
|
export const WrappedComponent = wrapComponent(Component);
|
|
12093
12662
|
`
|
|
12094
12663
|
);
|
|
12095
|
-
const entrypoint =
|
|
12664
|
+
const entrypoint = join6(directory, `entry.astro`);
|
|
12096
12665
|
await writeFile4(
|
|
12097
12666
|
entrypoint,
|
|
12098
12667
|
defaultOutdent`
|
|
@@ -12118,7 +12687,7 @@ async function buildComponents2({
|
|
|
12118
12687
|
extensions,
|
|
12119
12688
|
srcDir
|
|
12120
12689
|
}) {
|
|
12121
|
-
const backofficeCodegenDir =
|
|
12690
|
+
const backofficeCodegenDir = join7(codegenDir, "backoffice");
|
|
12122
12691
|
for (const extension of extensions) {
|
|
12123
12692
|
switch (extension.type) {
|
|
12124
12693
|
case "BackofficeExtensionMenuPlugin": {
|
|
@@ -12166,10 +12735,17 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12166
12735
|
case "BackofficeExtensionMenuPlugin": {
|
|
12167
12736
|
return {
|
|
12168
12737
|
compId: extension.options.id,
|
|
12738
|
+
compName: extension.options.title,
|
|
12169
12739
|
compType: "BACK_OFFICE_EXTENSION_MENU_ITEM",
|
|
12170
12740
|
compData: {
|
|
12171
12741
|
backOfficeExtensionMenuItem: {
|
|
12172
|
-
|
|
12742
|
+
action: extension.options.action,
|
|
12743
|
+
description: extension.options.description,
|
|
12744
|
+
extends: extension.options.extends,
|
|
12745
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12746
|
+
iconKey: extension.options.iconKey,
|
|
12747
|
+
subtitle: extension.options.subtitle,
|
|
12748
|
+
title: extension.options.title
|
|
12173
12749
|
}
|
|
12174
12750
|
}
|
|
12175
12751
|
};
|
|
@@ -12177,10 +12753,16 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12177
12753
|
case "BackofficeExtensionWidget": {
|
|
12178
12754
|
return {
|
|
12179
12755
|
compId: extension.options.id,
|
|
12756
|
+
compName: extension.options.title,
|
|
12180
12757
|
compType: "BACK_OFFICE_EXTENSION_WIDGET",
|
|
12181
12758
|
compData: {
|
|
12182
12759
|
backOfficeExtensionWidget: {
|
|
12183
|
-
|
|
12760
|
+
description: extension.options.description,
|
|
12761
|
+
extends: extension.options.extends,
|
|
12762
|
+
height: extension.options.height,
|
|
12763
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12764
|
+
iframeUrl,
|
|
12765
|
+
title: extension.options.title
|
|
12184
12766
|
}
|
|
12185
12767
|
}
|
|
12186
12768
|
};
|
|
@@ -12188,10 +12770,16 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12188
12770
|
case "BackofficeModal": {
|
|
12189
12771
|
return {
|
|
12190
12772
|
compId: extension.options.id,
|
|
12773
|
+
compName: extension.options.title,
|
|
12191
12774
|
compType: "BACK_OFFICE_MODAL",
|
|
12192
12775
|
compData: {
|
|
12193
12776
|
backOfficeModal: {
|
|
12194
|
-
|
|
12777
|
+
height: extension.options.height,
|
|
12778
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12779
|
+
iconKey: extension.options.iconKey,
|
|
12780
|
+
iframeUrl,
|
|
12781
|
+
title: extension.options.title,
|
|
12782
|
+
width: extension.options.width
|
|
12195
12783
|
}
|
|
12196
12784
|
}
|
|
12197
12785
|
};
|
|
@@ -12199,6 +12787,7 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12199
12787
|
case "BackofficePage": {
|
|
12200
12788
|
return {
|
|
12201
12789
|
compId: extension.options.id,
|
|
12790
|
+
compName: extension.options.title,
|
|
12202
12791
|
compType: "BACK_OFFICE_PAGE",
|
|
12203
12792
|
compData: {
|
|
12204
12793
|
backOfficePage: {
|
|
@@ -12331,7 +12920,7 @@ init_esm_shims();
|
|
|
12331
12920
|
// ../astro-core/src/integration.ts
|
|
12332
12921
|
init_esm_shims();
|
|
12333
12922
|
import { ok as ok5 } from "assert";
|
|
12334
|
-
import { join as
|
|
12923
|
+
import { join as join9 } from "path";
|
|
12335
12924
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
12336
12925
|
import { envField, passthroughImageService } from "astro/config";
|
|
12337
12926
|
|
|
@@ -12505,8 +13094,8 @@ function getLocalDevServerRootUrl(server) {
|
|
|
12505
13094
|
init_esm_shims();
|
|
12506
13095
|
import { ok as ok4 } from "assert";
|
|
12507
13096
|
import { createHash } from "crypto";
|
|
12508
|
-
import { join as
|
|
12509
|
-
import { mergeConfig } from "vite";
|
|
13097
|
+
import { join as join8 } from "path";
|
|
13098
|
+
import { mergeConfig as mergeConfig2 } from "vite";
|
|
12510
13099
|
function createExtensionViteConfigFactory({
|
|
12511
13100
|
command,
|
|
12512
13101
|
config: astroConfig,
|
|
@@ -12514,16 +13103,16 @@ function createExtensionViteConfigFactory({
|
|
|
12514
13103
|
}) {
|
|
12515
13104
|
let initialServerPort = 6001;
|
|
12516
13105
|
return (integrationName) => {
|
|
12517
|
-
return ({ name:
|
|
13106
|
+
return ({ name: extensionName2, config: extensionConfig }) => {
|
|
12518
13107
|
ok4(astroConfig.build?.outDir != null);
|
|
12519
13108
|
const hash = createShortHash(integrationName);
|
|
12520
|
-
const extensionId = `${hash}-${
|
|
13109
|
+
const extensionId = `${hash}-${extensionName2}`;
|
|
12521
13110
|
const outputDir2 = `_wix_${extensionId}`;
|
|
12522
13111
|
const commandConfig = {};
|
|
12523
13112
|
if (command === "serve") {
|
|
12524
13113
|
commandConfig.base = `${EXTENSION_PROXY_BASE}/${extensionId}/`;
|
|
12525
13114
|
}
|
|
12526
|
-
return
|
|
13115
|
+
return mergeConfig2(
|
|
12527
13116
|
{
|
|
12528
13117
|
build: {
|
|
12529
13118
|
assetsDir: outputDir2,
|
|
@@ -12532,20 +13121,20 @@ function createExtensionViteConfigFactory({
|
|
|
12532
13121
|
rollupOptions: {
|
|
12533
13122
|
output: {
|
|
12534
13123
|
assetFileNames: normalizePath(
|
|
12535
|
-
|
|
13124
|
+
join8(outputDir2, `[name]-[hash][extname]`)
|
|
12536
13125
|
),
|
|
12537
13126
|
chunkFileNames: normalizePath(
|
|
12538
|
-
|
|
13127
|
+
join8(outputDir2, `[name]-[hash].js`)
|
|
12539
13128
|
),
|
|
12540
13129
|
entryFileNames: normalizePath(
|
|
12541
|
-
|
|
13130
|
+
join8(outputDir2, `[name]-[hash].js`)
|
|
12542
13131
|
),
|
|
12543
13132
|
format: "esm"
|
|
12544
13133
|
}
|
|
12545
13134
|
},
|
|
12546
13135
|
target: astroConfig.build.target
|
|
12547
13136
|
},
|
|
12548
|
-
cacheDir:
|
|
13137
|
+
cacheDir: join8("node_modules", ".vite-wix", extensionId),
|
|
12549
13138
|
clearScreen: false,
|
|
12550
13139
|
configFile: false,
|
|
12551
13140
|
customLogger: astroConfig.customLogger,
|
|
@@ -12571,7 +13160,6 @@ function createShortHash(str) {
|
|
|
12571
13160
|
// ../astro-core/src/utils/createModel.ts
|
|
12572
13161
|
init_esm_shims();
|
|
12573
13162
|
import EventEmitter from "events";
|
|
12574
|
-
import { createServer, mergeConfig as mergeConfig2 } from "vite";
|
|
12575
13163
|
|
|
12576
13164
|
// ../astro-core/src/utils/loadEnvVars.ts
|
|
12577
13165
|
init_esm_shims();
|
|
@@ -13084,7 +13672,7 @@ function loadEnvVars({
|
|
|
13084
13672
|
logger,
|
|
13085
13673
|
rootDir
|
|
13086
13674
|
}) {
|
|
13087
|
-
const env2 = loadEnv("
|
|
13675
|
+
const env2 = loadEnv("production", rootDir, "");
|
|
13088
13676
|
const appId = env2[wixClientIdEnvVar];
|
|
13089
13677
|
if (appId == null) {
|
|
13090
13678
|
logger.error(
|
|
@@ -13144,10 +13732,9 @@ async function createModel({
|
|
|
13144
13732
|
srcDir
|
|
13145
13733
|
}) {
|
|
13146
13734
|
const { appId, env: env2 } = loadEnvVars({ logger, rootDir });
|
|
13147
|
-
const server = await
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
}
|
|
13735
|
+
const server = await createTemporaryViteServer({
|
|
13736
|
+
root: srcDir,
|
|
13737
|
+
ssr: { external: [] }
|
|
13151
13738
|
});
|
|
13152
13739
|
const extensions = await loadExtensions(server);
|
|
13153
13740
|
const model = new Model({
|
|
@@ -13159,33 +13746,9 @@ async function createModel({
|
|
|
13159
13746
|
});
|
|
13160
13747
|
return model;
|
|
13161
13748
|
}
|
|
13162
|
-
async function getTempViteServer({
|
|
13163
|
-
viteConfig
|
|
13164
|
-
}) {
|
|
13165
|
-
const tempViteServer = await createServer(
|
|
13166
|
-
mergeConfig2(viteConfig, {
|
|
13167
|
-
logLevel: "silent",
|
|
13168
|
-
optimizeDeps: { noDiscovery: true },
|
|
13169
|
-
server: {
|
|
13170
|
-
middlewareMode: true,
|
|
13171
|
-
ws: false
|
|
13172
|
-
},
|
|
13173
|
-
ssr: { external: [] }
|
|
13174
|
-
})
|
|
13175
|
-
);
|
|
13176
|
-
return tempViteServer;
|
|
13177
|
-
}
|
|
13178
13749
|
async function loadExtensions(server) {
|
|
13179
|
-
const
|
|
13180
|
-
|
|
13181
|
-
return null;
|
|
13182
|
-
}
|
|
13183
|
-
throw error;
|
|
13184
|
-
});
|
|
13185
|
-
if (mod) {
|
|
13186
|
-
return mod.default.extensions;
|
|
13187
|
-
}
|
|
13188
|
-
return [];
|
|
13750
|
+
const module2 = await loadFileWithVite("/extensions.ts", server);
|
|
13751
|
+
return module2 ? module2.default.extensions : [];
|
|
13189
13752
|
}
|
|
13190
13753
|
|
|
13191
13754
|
// ../astro-core/src/utils/generateBuildMetadata.ts
|
|
@@ -13216,7 +13779,7 @@ var createIntegration3 = ({
|
|
|
13216
13779
|
let astroServer;
|
|
13217
13780
|
const devServersToProxy = /* @__PURE__ */ new Set();
|
|
13218
13781
|
return {
|
|
13219
|
-
name: "@wix/astro
|
|
13782
|
+
name: "@wix/astro",
|
|
13220
13783
|
hooks: {
|
|
13221
13784
|
async "astro:config:setup"({
|
|
13222
13785
|
config: astroConfig,
|
|
@@ -13251,7 +13814,6 @@ var createIntegration3 = ({
|
|
|
13251
13814
|
domains: ["static.wixstatic.com"],
|
|
13252
13815
|
service: passthroughImageService()
|
|
13253
13816
|
},
|
|
13254
|
-
integrations,
|
|
13255
13817
|
vite: {
|
|
13256
13818
|
optimizeDeps: {
|
|
13257
13819
|
include: [
|
|
@@ -13348,8 +13910,8 @@ var createIntegration3 = ({
|
|
|
13348
13910
|
ok5(model);
|
|
13349
13911
|
const rootDir = fileURLToPath7(config.root);
|
|
13350
13912
|
const outDir = fileURLToPath7(config.outDir);
|
|
13351
|
-
const buildMetadataPath =
|
|
13352
|
-
const appManifestPath =
|
|
13913
|
+
const buildMetadataPath = join9(rootDir, ".wix/build-metadata.json");
|
|
13914
|
+
const appManifestPath = join9(outDir, "_wix/app-manifest.json");
|
|
13353
13915
|
const buildMetadata = await generateBuildMetadata(
|
|
13354
13916
|
appManifestPath,
|
|
13355
13917
|
config
|
|
@@ -13391,7 +13953,7 @@ init_esm_shims();
|
|
|
13391
13953
|
init_esm_shims();
|
|
13392
13954
|
import { ok as ok7 } from "assert";
|
|
13393
13955
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
13394
|
-
import {
|
|
13956
|
+
import { createServer as createServer2 } from "vite";
|
|
13395
13957
|
|
|
13396
13958
|
// ../astro-custom-elements-extensions/src/utils/filterSupportedExtensions.ts
|
|
13397
13959
|
init_esm_shims();
|
|
@@ -13401,15 +13963,14 @@ function filterSupportedExtensions3(extension) {
|
|
|
13401
13963
|
|
|
13402
13964
|
// ../astro-custom-elements-extensions/src/utils/getAssetUrl.ts
|
|
13403
13965
|
init_esm_shims();
|
|
13404
|
-
import {
|
|
13405
|
-
import { join as join9 } from "path";
|
|
13966
|
+
import { join as join10 } from "path";
|
|
13406
13967
|
function getAssetUrl({
|
|
13407
13968
|
buildOutput,
|
|
13408
13969
|
fileName,
|
|
13409
13970
|
viteDevServer
|
|
13410
13971
|
}) {
|
|
13411
13972
|
if (buildOutput) {
|
|
13412
|
-
return
|
|
13973
|
+
return getAssetForModuleId({ buildOutput, moduleId: fileName }).fileName;
|
|
13413
13974
|
}
|
|
13414
13975
|
if (viteDevServer) {
|
|
13415
13976
|
return getAssetUrlForDevServer({ fileName, viteDevServer });
|
|
@@ -13420,20 +13981,41 @@ function getAssetUrlForDevServer({
|
|
|
13420
13981
|
fileName,
|
|
13421
13982
|
viteDevServer
|
|
13422
13983
|
}) {
|
|
13423
|
-
return
|
|
13984
|
+
return join10(viteDevServer.config.base, fileName);
|
|
13985
|
+
}
|
|
13986
|
+
|
|
13987
|
+
// ../astro-custom-elements-extensions/src/utils/getChunkUrl.ts
|
|
13988
|
+
init_esm_shims();
|
|
13989
|
+
import { join as join11 } from "path";
|
|
13990
|
+
function getChunkUrl({
|
|
13991
|
+
buildOutput,
|
|
13992
|
+
fileName,
|
|
13993
|
+
viteDevServer
|
|
13994
|
+
}) {
|
|
13995
|
+
if (buildOutput) {
|
|
13996
|
+
return getChunkUrlForBuildOutput({ buildOutput, fileName });
|
|
13997
|
+
}
|
|
13998
|
+
if (viteDevServer) {
|
|
13999
|
+
return getChunkUrlForDevServer({ fileName, viteDevServer });
|
|
14000
|
+
}
|
|
14001
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
13424
14002
|
}
|
|
13425
14003
|
function getChunkUrlForBuildOutput({
|
|
13426
14004
|
buildOutput,
|
|
13427
14005
|
fileName
|
|
13428
14006
|
}) {
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
14007
|
+
return getChunkForModuleId({ buildOutput, moduleId: fileName }).fileName;
|
|
14008
|
+
}
|
|
14009
|
+
function getChunkUrlForDevServer({
|
|
14010
|
+
fileName,
|
|
14011
|
+
viteDevServer
|
|
14012
|
+
}) {
|
|
14013
|
+
return join11(viteDevServer.config.base, "@id", `${fileName}?import`);
|
|
13432
14014
|
}
|
|
13433
14015
|
|
|
13434
14016
|
// ../astro-custom-elements-extensions/src/vite/getViteConfig.ts
|
|
13435
14017
|
init_esm_shims();
|
|
13436
|
-
import { join as
|
|
14018
|
+
import { join as join13 } from "path";
|
|
13437
14019
|
|
|
13438
14020
|
// ../../node_modules/vite-plugin-externals/dist/es/src/index.js
|
|
13439
14021
|
init_esm_shims();
|
|
@@ -13933,12 +14515,12 @@ MagicString.prototype.indent = function indent(indentStr, options) {
|
|
|
13933
14515
|
});
|
|
13934
14516
|
}
|
|
13935
14517
|
var shouldIndentNextCharacter = options.indentStart !== false;
|
|
13936
|
-
var replacer = function(
|
|
14518
|
+
var replacer = function(match2) {
|
|
13937
14519
|
if (shouldIndentNextCharacter) {
|
|
13938
|
-
return "" + indentStr +
|
|
14520
|
+
return "" + indentStr + match2;
|
|
13939
14521
|
}
|
|
13940
14522
|
shouldIndentNextCharacter = true;
|
|
13941
|
-
return
|
|
14523
|
+
return match2;
|
|
13942
14524
|
};
|
|
13943
14525
|
this.intro = this.intro.replace(pattern, replacer);
|
|
13944
14526
|
var charIndex = 0;
|
|
@@ -14560,8 +15142,8 @@ Bundle.prototype.indent = function indent2(indentStr) {
|
|
|
14560
15142
|
trailingNewline = source.content.lastChar() === "\n";
|
|
14561
15143
|
});
|
|
14562
15144
|
if (this.intro) {
|
|
14563
|
-
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, function(
|
|
14564
|
-
return index > 0 ? indentStr +
|
|
15145
|
+
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, function(match2, index) {
|
|
15146
|
+
return index > 0 ? indentStr + match2 : match2;
|
|
14565
15147
|
});
|
|
14566
15148
|
}
|
|
14567
15149
|
return this;
|
|
@@ -15278,17 +15860,17 @@ pp$9.strictDirective = function(start) {
|
|
|
15278
15860
|
for (; ; ) {
|
|
15279
15861
|
skipWhiteSpace.lastIndex = start;
|
|
15280
15862
|
start += skipWhiteSpace.exec(this.input)[0].length;
|
|
15281
|
-
var
|
|
15282
|
-
if (!
|
|
15863
|
+
var match2 = literal.exec(this.input.slice(start));
|
|
15864
|
+
if (!match2) {
|
|
15283
15865
|
return false;
|
|
15284
15866
|
}
|
|
15285
|
-
if ((
|
|
15286
|
-
skipWhiteSpace.lastIndex = start +
|
|
15867
|
+
if ((match2[1] || match2[2]) === "use strict") {
|
|
15868
|
+
skipWhiteSpace.lastIndex = start + match2[0].length;
|
|
15287
15869
|
var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
|
|
15288
15870
|
var next = this.input.charAt(end);
|
|
15289
15871
|
return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
|
|
15290
15872
|
}
|
|
15291
|
-
start +=
|
|
15873
|
+
start += match2[0].length;
|
|
15292
15874
|
skipWhiteSpace.lastIndex = start;
|
|
15293
15875
|
start += skipWhiteSpace.exec(this.input)[0].length;
|
|
15294
15876
|
if (this.input[start] === ";") {
|
|
@@ -20530,43 +21112,158 @@ function compatSsrInOptions(options) {
|
|
|
20530
21112
|
|
|
20531
21113
|
// ../astro-custom-elements-extensions/src/vite/viteWrapCustomElementPlugin.ts
|
|
20532
21114
|
init_esm_shims();
|
|
20533
|
-
import
|
|
20534
|
-
|
|
21115
|
+
import React from "react";
|
|
21116
|
+
import ReactDOM from "react-dom";
|
|
21117
|
+
import { ok as ok6 } from "assert";
|
|
21118
|
+
import { join as join12, parse as parse4 } from "path";
|
|
21119
|
+
import { send } from "vite";
|
|
21120
|
+
var wrapCustomElementPath = normalizePath(
|
|
20535
21121
|
new URL(
|
|
20536
|
-
"../dependencies/astro-custom-elements-extensions/browser-runtime/
|
|
21122
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js",
|
|
20537
21123
|
import.meta.url
|
|
20538
21124
|
)
|
|
20539
21125
|
);
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
|
|
20543
|
-
|
|
20544
|
-
|
|
20545
|
-
|
|
20546
|
-
|
|
21126
|
+
var renderSettingsPanelPath = normalizePath(
|
|
21127
|
+
new URL(
|
|
21128
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js",
|
|
21129
|
+
import.meta.url
|
|
21130
|
+
)
|
|
21131
|
+
);
|
|
21132
|
+
var reactHmrPath = normalizePath(
|
|
21133
|
+
new URL(
|
|
21134
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js",
|
|
21135
|
+
import.meta.url
|
|
21136
|
+
)
|
|
21137
|
+
);
|
|
21138
|
+
var customElementHmrPath = normalizePath(
|
|
21139
|
+
new URL(
|
|
21140
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.js",
|
|
21141
|
+
import.meta.url
|
|
21142
|
+
)
|
|
21143
|
+
);
|
|
21144
|
+
function viteWrapCustomElementPlugin({
|
|
21145
|
+
getExtensions,
|
|
21146
|
+
srcDir
|
|
21147
|
+
}) {
|
|
21148
|
+
const getExtensionForModuleId = (baseId) => {
|
|
21149
|
+
const result = getExtensions().find(
|
|
20547
21150
|
(extension) => extension.options.id === baseId
|
|
20548
21151
|
);
|
|
20549
21152
|
return result;
|
|
20550
21153
|
};
|
|
21154
|
+
const htmlTemplate = ({
|
|
21155
|
+
dev,
|
|
21156
|
+
setupCode
|
|
21157
|
+
}) => {
|
|
21158
|
+
const reactFileSuffix = dev ? "development.js" : "production.min.js";
|
|
21159
|
+
const reactTemplate = defaultOutdent`
|
|
21160
|
+
<script crossorigin src="https://static.parastorage.com/unpkg/react@${React.version}/umd/react.${reactFileSuffix}"></script>
|
|
21161
|
+
<script crossorigin src="https://static.parastorage.com/unpkg/react-dom@${ReactDOM.version}/umd/react-dom.${reactFileSuffix}"></script>
|
|
21162
|
+
`;
|
|
21163
|
+
return defaultOutdent`
|
|
21164
|
+
<!DOCTYPE html>
|
|
21165
|
+
<html>
|
|
21166
|
+
<head>
|
|
21167
|
+
<meta charset="UTF-8" />
|
|
21168
|
+
<title>Settings Panel</title>
|
|
21169
|
+
</head>
|
|
21170
|
+
<body style="margin: 0">
|
|
21171
|
+
<div id="root"></div>
|
|
21172
|
+
${reactTemplate}
|
|
21173
|
+
<script type="module">
|
|
21174
|
+
${setupCode}
|
|
21175
|
+
</script>
|
|
21176
|
+
</body>
|
|
21177
|
+
</html>
|
|
21178
|
+
`;
|
|
21179
|
+
};
|
|
20551
21180
|
return {
|
|
20552
21181
|
name: "vite-wrap-custom-element-plugin",
|
|
21182
|
+
configureServer: async (server) => {
|
|
21183
|
+
server.middlewares.use(async (req, res, next) => {
|
|
21184
|
+
ok6(req.url != null);
|
|
21185
|
+
const parsedId = parseId(req.url.replace(server.config.base, ""));
|
|
21186
|
+
if (parsedId == null) {
|
|
21187
|
+
return next();
|
|
21188
|
+
}
|
|
21189
|
+
const { baseId, extension } = parsedId;
|
|
21190
|
+
if (extension === ".html") {
|
|
21191
|
+
const customElement2 = getExtensionForModuleId(baseId);
|
|
21192
|
+
if (customElement2?.options.settings != null) {
|
|
21193
|
+
const filePath = join12(srcDir, customElement2.options.settings);
|
|
21194
|
+
const transformedHtml = await server.transformIndexHtml(
|
|
21195
|
+
baseId,
|
|
21196
|
+
htmlTemplate({
|
|
21197
|
+
dev: true,
|
|
21198
|
+
setupCode: defaultOutdent`
|
|
21199
|
+
import { createComponentHmrWrapper } from '${reactHmrPath}';
|
|
21200
|
+
import { renderSettingsPanel } from '${renderSettingsPanelPath}';
|
|
21201
|
+
import SettingsPanel from '${normalizePath(filePath)}';
|
|
21202
|
+
|
|
21203
|
+
let WrappedComponent = SettingsPanel;
|
|
21204
|
+
|
|
21205
|
+
if (import.meta.hot) {
|
|
21206
|
+
import.meta.hot.accept('${normalizePath(filePath)}', (newModule) => {
|
|
21207
|
+
if (newModule?.default) {
|
|
21208
|
+
import.meta.hot.data.setComponent?.(newModule?.default);
|
|
21209
|
+
}
|
|
21210
|
+
});
|
|
21211
|
+
|
|
21212
|
+
WrappedComponent = createComponentHmrWrapper(SettingsPanel, import.meta.hot.data);
|
|
21213
|
+
}
|
|
21214
|
+
|
|
21215
|
+
renderSettingsPanel(WrappedComponent);
|
|
21216
|
+
`
|
|
21217
|
+
})
|
|
21218
|
+
);
|
|
21219
|
+
return send(req, res, transformedHtml, "html", {
|
|
21220
|
+
headers: server.config.server.headers
|
|
21221
|
+
});
|
|
21222
|
+
}
|
|
21223
|
+
throw new Error("Unexpected configuration");
|
|
21224
|
+
}
|
|
21225
|
+
return next();
|
|
21226
|
+
});
|
|
21227
|
+
},
|
|
20553
21228
|
load: {
|
|
20554
21229
|
handler(id) {
|
|
20555
|
-
const
|
|
20556
|
-
if (
|
|
20557
|
-
|
|
21230
|
+
const parsedId = parseId(id);
|
|
21231
|
+
if (parsedId == null) {
|
|
21232
|
+
return;
|
|
21233
|
+
}
|
|
21234
|
+
const { baseId, extension } = parsedId;
|
|
21235
|
+
if (extension === ".html") {
|
|
21236
|
+
const customElement3 = getExtensionForModuleId(baseId);
|
|
21237
|
+
if (customElement3?.options.settings != null) {
|
|
21238
|
+
const filePath = join12(srcDir, customElement3.options.settings);
|
|
21239
|
+
return htmlTemplate({
|
|
21240
|
+
dev: false,
|
|
21241
|
+
setupCode: defaultOutdent`
|
|
21242
|
+
import { renderSettingsPanel } from '${renderSettingsPanelPath}';
|
|
21243
|
+
import SettingsPanel from '${normalizePath(filePath)}';
|
|
21244
|
+
|
|
21245
|
+
renderSettingsPanel(SettingsPanel);
|
|
21246
|
+
`
|
|
21247
|
+
});
|
|
21248
|
+
}
|
|
21249
|
+
throw new Error("Unexpected configuration");
|
|
21250
|
+
}
|
|
21251
|
+
const customElement2 = getExtensionForModuleId(baseId);
|
|
21252
|
+
if (customElement2) {
|
|
21253
|
+
const filePath = join12(srcDir, customElement2.options.element);
|
|
20558
21254
|
return defaultOutdent`
|
|
20559
21255
|
import CustomElement from '${normalizePath(filePath)}';
|
|
20560
|
-
import { wrapCustomElement
|
|
21256
|
+
import { wrapCustomElement } from '${wrapCustomElementPath}';
|
|
21257
|
+
import { customElementHmr } from '${customElementHmrPath}';
|
|
20561
21258
|
|
|
20562
21259
|
if (import.meta.hot) {
|
|
20563
21260
|
import.meta.hot.accept(() => {});
|
|
20564
21261
|
import.meta.hot.accept(
|
|
20565
21262
|
'${normalizePath(filePath)}',
|
|
20566
21263
|
function({ default: NewCustomElement }) {
|
|
20567
|
-
|
|
21264
|
+
customElementHmr({
|
|
20568
21265
|
customElement: NewCustomElement,
|
|
20569
|
-
tagName: '${
|
|
21266
|
+
tagName: '${customElement2.options.tagName}',
|
|
20570
21267
|
});
|
|
20571
21268
|
}
|
|
20572
21269
|
);
|
|
@@ -20574,7 +21271,7 @@ function viteWrapCustomElementPlugin({
|
|
|
20574
21271
|
|
|
20575
21272
|
wrapCustomElement({
|
|
20576
21273
|
customElement: CustomElement,
|
|
20577
|
-
tagName: '${
|
|
21274
|
+
tagName: '${customElement2.options.tagName}',
|
|
20578
21275
|
});
|
|
20579
21276
|
`;
|
|
20580
21277
|
}
|
|
@@ -20583,7 +21280,8 @@ function viteWrapCustomElementPlugin({
|
|
|
20583
21280
|
order: "pre"
|
|
20584
21281
|
},
|
|
20585
21282
|
resolveId(id) {
|
|
20586
|
-
const
|
|
21283
|
+
const { name: baseId } = parse4(id);
|
|
21284
|
+
const extension = getExtensionForModuleId(baseId);
|
|
20587
21285
|
if (extension) {
|
|
20588
21286
|
return id;
|
|
20589
21287
|
}
|
|
@@ -20591,18 +21289,38 @@ function viteWrapCustomElementPlugin({
|
|
|
20591
21289
|
}
|
|
20592
21290
|
};
|
|
20593
21291
|
}
|
|
21292
|
+
function parseId(id) {
|
|
21293
|
+
const [rawId, query] = id.split("?");
|
|
21294
|
+
const params = new URLSearchParams(query);
|
|
21295
|
+
if (params.get("index") != null) {
|
|
21296
|
+
return null;
|
|
21297
|
+
}
|
|
21298
|
+
ok6(rawId != null);
|
|
21299
|
+
const { name: baseId, ext: extension } = parse4(rawId);
|
|
21300
|
+
return {
|
|
21301
|
+
baseId,
|
|
21302
|
+
extension
|
|
21303
|
+
};
|
|
21304
|
+
}
|
|
20594
21305
|
|
|
20595
21306
|
// ../astro-custom-elements-extensions/src/vite/getViteConfig.ts
|
|
20596
21307
|
function getViteConfig({
|
|
20597
21308
|
createExtensionViteConfig,
|
|
20598
21309
|
getExtensions,
|
|
21310
|
+
rootDir,
|
|
20599
21311
|
srcDir
|
|
20600
21312
|
}) {
|
|
20601
|
-
const input = getExtensions().
|
|
20602
|
-
|
|
20603
|
-
|
|
21313
|
+
const input = getExtensions().flatMap((extension) => {
|
|
21314
|
+
const entries = [`${extension.options.id}.js`];
|
|
21315
|
+
if (extension.options.settings != null) {
|
|
21316
|
+
entries.push(
|
|
21317
|
+
join13(rootDir, `custom-element-panels/${extension.options.id}.html`)
|
|
21318
|
+
);
|
|
21319
|
+
}
|
|
21320
|
+
return entries;
|
|
21321
|
+
});
|
|
20604
21322
|
const extensionsPaths = getExtensions().map((extension) => {
|
|
20605
|
-
return
|
|
21323
|
+
return join13(srcDir, extension.options.element);
|
|
20606
21324
|
});
|
|
20607
21325
|
return createExtensionViteConfig({
|
|
20608
21326
|
name: "custom-elements",
|
|
@@ -20613,7 +21331,13 @@ function getViteConfig({
|
|
|
20613
21331
|
}
|
|
20614
21332
|
},
|
|
20615
21333
|
optimizeDeps: {
|
|
20616
|
-
entries: [
|
|
21334
|
+
entries: [
|
|
21335
|
+
customElementHmrPath,
|
|
21336
|
+
wrapCustomElementPath,
|
|
21337
|
+
reactHmrPath,
|
|
21338
|
+
renderSettingsPanelPath,
|
|
21339
|
+
...extensionsPaths
|
|
21340
|
+
]
|
|
20617
21341
|
},
|
|
20618
21342
|
plugins: [
|
|
20619
21343
|
viteWrapCustomElementPlugin({ getExtensions, srcDir }),
|
|
@@ -20656,10 +21380,12 @@ var createIntegration4 = () => {
|
|
|
20656
21380
|
}) {
|
|
20657
21381
|
ok7(extensions);
|
|
20658
21382
|
ok7(srcDir != null);
|
|
21383
|
+
ok7(rootDir != null);
|
|
20659
21384
|
customDevServer = await createServer2(
|
|
20660
21385
|
getViteConfig({
|
|
20661
21386
|
createExtensionViteConfig,
|
|
20662
21387
|
getExtensions,
|
|
21388
|
+
rootDir,
|
|
20663
21389
|
srcDir
|
|
20664
21390
|
})
|
|
20665
21391
|
);
|
|
@@ -20676,16 +21402,15 @@ var createIntegration4 = () => {
|
|
|
20676
21402
|
return;
|
|
20677
21403
|
}
|
|
20678
21404
|
ok7(srcDir != null);
|
|
20679
|
-
|
|
21405
|
+
ok7(rootDir != null);
|
|
21406
|
+
customBuildOutput = await build(
|
|
20680
21407
|
getViteConfig({
|
|
20681
21408
|
createExtensionViteConfig,
|
|
20682
21409
|
getExtensions,
|
|
21410
|
+
rootDir,
|
|
20683
21411
|
srcDir
|
|
20684
21412
|
})
|
|
20685
21413
|
);
|
|
20686
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
20687
|
-
ok7(clientOutput);
|
|
20688
|
-
customBuildOutput = clientOutput;
|
|
20689
21414
|
},
|
|
20690
21415
|
async "wix:app-manifest:setup"({
|
|
20691
21416
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
@@ -20698,7 +21423,7 @@ var createIntegration4 = () => {
|
|
|
20698
21423
|
for (const extension of extensions) {
|
|
20699
21424
|
const scriptUrl = appendToDevServerUrl(
|
|
20700
21425
|
staticsUrlPlaceholder2,
|
|
20701
|
-
|
|
21426
|
+
getChunkUrl({
|
|
20702
21427
|
buildOutput: customBuildOutput,
|
|
20703
21428
|
fileName: `${extension.options.id}.js`,
|
|
20704
21429
|
viteDevServer: customDevServer
|
|
@@ -20710,12 +21435,37 @@ var createIntegration4 = () => {
|
|
|
20710
21435
|
compType: "CUSTOM_ELEMENT_WIDGET",
|
|
20711
21436
|
compData: {
|
|
20712
21437
|
customElementWidget: {
|
|
20713
|
-
base:
|
|
20714
|
-
|
|
20715
|
-
|
|
20716
|
-
|
|
21438
|
+
base: {
|
|
21439
|
+
name: extension.options.name
|
|
21440
|
+
},
|
|
21441
|
+
behaviors: {
|
|
21442
|
+
...extension.options.behaviors,
|
|
21443
|
+
...extension.options.settings != null ? {
|
|
21444
|
+
settings: {
|
|
21445
|
+
settingsUrl: appendToDevServerUrl(
|
|
21446
|
+
staticsUrlPlaceholder2,
|
|
21447
|
+
getAssetUrl({
|
|
21448
|
+
buildOutput: customBuildOutput,
|
|
21449
|
+
fileName: `custom-element-panels/${extension.options.id}.html`,
|
|
21450
|
+
viteDevServer: customDevServer
|
|
21451
|
+
})
|
|
21452
|
+
)
|
|
21453
|
+
}
|
|
21454
|
+
} : {}
|
|
21455
|
+
},
|
|
21456
|
+
dependencies: [],
|
|
21457
|
+
// TODO: frontend dependencies
|
|
21458
|
+
installation: {
|
|
21459
|
+
base: {
|
|
21460
|
+
autoAdd: extension.options.installation.autoAdd,
|
|
21461
|
+
essential: extension.options.installation.essential
|
|
21462
|
+
}
|
|
21463
|
+
},
|
|
20717
21464
|
presets: extension.options.presets ?? [],
|
|
20718
|
-
size:
|
|
21465
|
+
size: {
|
|
21466
|
+
height: extension.options.height,
|
|
21467
|
+
width: extension.options.width
|
|
21468
|
+
},
|
|
20719
21469
|
widgetData: {
|
|
20720
21470
|
scriptType: "ES_MODULE",
|
|
20721
21471
|
scriptUrl,
|
|
@@ -20751,7 +21501,7 @@ import { ok as ok10 } from "assert";
|
|
|
20751
21501
|
import {
|
|
20752
21502
|
dirname as dirname2,
|
|
20753
21503
|
isAbsolute as isAbsolutePath,
|
|
20754
|
-
join as
|
|
21504
|
+
join as join16,
|
|
20755
21505
|
relative
|
|
20756
21506
|
} from "path";
|
|
20757
21507
|
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
@@ -28620,15 +29370,15 @@ var getCodePoint = (
|
|
|
28620
29370
|
);
|
|
28621
29371
|
function getEscaper(regex, map) {
|
|
28622
29372
|
return function escape(data2) {
|
|
28623
|
-
let
|
|
29373
|
+
let match2;
|
|
28624
29374
|
let lastIndex = 0;
|
|
28625
29375
|
let result = "";
|
|
28626
|
-
while (
|
|
28627
|
-
if (lastIndex !==
|
|
28628
|
-
result += data2.substring(lastIndex,
|
|
29376
|
+
while (match2 = regex.exec(data2)) {
|
|
29377
|
+
if (lastIndex !== match2.index) {
|
|
29378
|
+
result += data2.substring(lastIndex, match2.index);
|
|
28629
29379
|
}
|
|
28630
|
-
result += map.get(
|
|
28631
|
-
lastIndex =
|
|
29380
|
+
result += map.get(match2[0].charCodeAt(0));
|
|
29381
|
+
lastIndex = match2.index + 1;
|
|
28632
29382
|
}
|
|
28633
29383
|
return result + data2.substring(lastIndex);
|
|
28634
29384
|
};
|
|
@@ -28766,7 +29516,7 @@ function parseFragment(fragmentContext, html, options) {
|
|
|
28766
29516
|
}
|
|
28767
29517
|
|
|
28768
29518
|
// ../astro-embedded-scripts-extensions/src/integration.ts
|
|
28769
|
-
import {
|
|
29519
|
+
import { createServer as createServer3 } from "vite";
|
|
28770
29520
|
|
|
28771
29521
|
// ../astro-embedded-scripts-extensions/src/utils/filterSupportedExtensions.ts
|
|
28772
29522
|
init_esm_shims();
|
|
@@ -28803,46 +29553,130 @@ function getAssetContentFromBuildOutput({
|
|
|
28803
29553
|
buildOutput,
|
|
28804
29554
|
fileName
|
|
28805
29555
|
}) {
|
|
28806
|
-
const asset = buildOutput.
|
|
29556
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.fileName === normalizePath(fileName));
|
|
28807
29557
|
ok8(asset);
|
|
28808
29558
|
return asset.source.toString();
|
|
28809
29559
|
}
|
|
28810
29560
|
|
|
28811
29561
|
// ../astro-embedded-scripts-extensions/src/utils/getViteConfig.ts
|
|
28812
29562
|
init_esm_shims();
|
|
28813
|
-
import { join as
|
|
29563
|
+
import { join as join15 } from "path";
|
|
28814
29564
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
28815
29565
|
|
|
28816
29566
|
// ../astro-embedded-scripts-extensions/src/utils/viteSdkSupportPlugin.ts
|
|
28817
29567
|
init_esm_shims();
|
|
28818
29568
|
import { ok as ok9 } from "assert";
|
|
28819
|
-
import { join as
|
|
29569
|
+
import { join as join14 } from "path";
|
|
28820
29570
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
29571
|
+
|
|
29572
|
+
// ../astro-embedded-scripts-extensions/src/utils/htmlUtils.ts
|
|
29573
|
+
init_esm_shims();
|
|
29574
|
+
function traverseModuleElements(node, visitor) {
|
|
29575
|
+
traverseNodes(node, (child) => {
|
|
29576
|
+
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
29577
|
+
child.attrs.some(
|
|
29578
|
+
(attr) => attr.name === "type" && attr.value === "module"
|
|
29579
|
+
) && // no inline scripts
|
|
29580
|
+
child.attrs.some((attr) => attr.name === "src")) {
|
|
29581
|
+
visitor(child);
|
|
29582
|
+
}
|
|
29583
|
+
if (nodeIsElement(child) && child.nodeName === "link" && // only modules
|
|
29584
|
+
child.attrs.some(
|
|
29585
|
+
(attr) => attr.name === "rel" && attr.value === "modulepreload"
|
|
29586
|
+
)) {
|
|
29587
|
+
visitor(child);
|
|
29588
|
+
}
|
|
29589
|
+
});
|
|
29590
|
+
}
|
|
29591
|
+
function traverseModuleScripts(node, visitor) {
|
|
29592
|
+
traverseNodes(node, (child) => {
|
|
29593
|
+
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
29594
|
+
child.attrs.some(
|
|
29595
|
+
(attr) => attr.name === "type" && attr.value === "module"
|
|
29596
|
+
)) {
|
|
29597
|
+
visitor(child);
|
|
29598
|
+
}
|
|
29599
|
+
});
|
|
29600
|
+
}
|
|
29601
|
+
function nodeIsElement(node) {
|
|
29602
|
+
return node.nodeName[0] !== "#";
|
|
29603
|
+
}
|
|
29604
|
+
function traverseNodes(node, visitor) {
|
|
29605
|
+
if (node.nodeName === "template") {
|
|
29606
|
+
node = node.content;
|
|
29607
|
+
}
|
|
29608
|
+
visitor(node);
|
|
29609
|
+
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") {
|
|
29610
|
+
for (const childNode of node.childNodes) {
|
|
29611
|
+
traverseNodes(childNode, visitor);
|
|
29612
|
+
}
|
|
29613
|
+
}
|
|
29614
|
+
}
|
|
29615
|
+
|
|
29616
|
+
// ../astro-embedded-scripts-extensions/src/utils/viteSdkSupportPlugin.ts
|
|
28821
29617
|
var setupContextUrl = new URL(
|
|
28822
29618
|
"../dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.js",
|
|
28823
29619
|
import.meta.url
|
|
28824
29620
|
);
|
|
29621
|
+
var setupContextPath = normalizePath(setupContextUrl);
|
|
28825
29622
|
function viteSdkSupportPlugin() {
|
|
28826
|
-
return
|
|
28827
|
-
|
|
28828
|
-
|
|
28829
|
-
|
|
28830
|
-
const
|
|
28831
|
-
|
|
29623
|
+
return [
|
|
29624
|
+
{
|
|
29625
|
+
name: "vite-sdk-add-context-import",
|
|
29626
|
+
transform(code, id) {
|
|
29627
|
+
const [, query] = id.split("?");
|
|
29628
|
+
const params = new URLSearchParams(query);
|
|
29629
|
+
if (params.get("add-sdk-context-setup") != null) {
|
|
29630
|
+
return defaultOutdent`
|
|
29631
|
+
import '${setupContextPath}';
|
|
29632
|
+
${code}
|
|
29633
|
+
`;
|
|
29634
|
+
}
|
|
29635
|
+
return code;
|
|
29636
|
+
},
|
|
29637
|
+
transformIndexHtml: {
|
|
29638
|
+
handler(html) {
|
|
29639
|
+
const fragment = parseFragment(html);
|
|
29640
|
+
traverseModuleScripts(fragment, (script) => {
|
|
29641
|
+
const src = script.attrs.find((attr) => attr.name === "src");
|
|
29642
|
+
if (src) {
|
|
29643
|
+
src.value = `${src.value}?add-sdk-context-setup`;
|
|
29644
|
+
} else {
|
|
29645
|
+
const textNode = script.childNodes[0];
|
|
29646
|
+
if (textNode && defaultTreeAdapter.isTextNode(textNode)) {
|
|
29647
|
+
textNode.value = defaultOutdent`
|
|
29648
|
+
import '${setupContextPath}';
|
|
29649
|
+
${textNode.value};
|
|
29650
|
+
`;
|
|
29651
|
+
}
|
|
29652
|
+
}
|
|
29653
|
+
});
|
|
29654
|
+
return serialize(fragment);
|
|
29655
|
+
},
|
|
29656
|
+
order: "pre"
|
|
29657
|
+
}
|
|
29658
|
+
},
|
|
29659
|
+
{
|
|
29660
|
+
name: "vite-sdk-add-accesstoken-script",
|
|
29661
|
+
transformIndexHtml: {
|
|
29662
|
+
handler(html, { bundle, server }) {
|
|
29663
|
+
const scriptPath = resolveRuntimeScriptPath({ bundle, server });
|
|
29664
|
+
return defaultOutdent`
|
|
28832
29665
|
<script type="module" accesstoken="true" crossorigin src="${scriptPath}"></script>
|
|
28833
29666
|
${html}
|
|
28834
29667
|
`;
|
|
28835
|
-
|
|
28836
|
-
|
|
29668
|
+
},
|
|
29669
|
+
order: "post"
|
|
29670
|
+
}
|
|
28837
29671
|
}
|
|
28838
|
-
|
|
29672
|
+
];
|
|
28839
29673
|
}
|
|
28840
29674
|
function resolveRuntimeScriptPath({
|
|
28841
29675
|
bundle,
|
|
28842
29676
|
server
|
|
28843
29677
|
}) {
|
|
28844
29678
|
if (server) {
|
|
28845
|
-
return
|
|
29679
|
+
return join14(server.config.base, "/@fs", fileURLToPath9(setupContextUrl));
|
|
28846
29680
|
}
|
|
28847
29681
|
if (bundle) {
|
|
28848
29682
|
const runtimeChunk = Object.values(bundle).find(
|
|
@@ -28871,7 +29705,7 @@ function getViteConfig2({
|
|
|
28871
29705
|
const input = [
|
|
28872
29706
|
setupContextUrl2,
|
|
28873
29707
|
...extensions.map(
|
|
28874
|
-
(embeddedScript2) =>
|
|
29708
|
+
(embeddedScript2) => join15(srcDir, embeddedScript2.options.source)
|
|
28875
29709
|
)
|
|
28876
29710
|
];
|
|
28877
29711
|
return createExtensionViteConfig({
|
|
@@ -28891,40 +29725,6 @@ function getViteConfig2({
|
|
|
28891
29725
|
});
|
|
28892
29726
|
}
|
|
28893
29727
|
|
|
28894
|
-
// ../astro-embedded-scripts-extensions/src/utils/htmlUtils.ts
|
|
28895
|
-
init_esm_shims();
|
|
28896
|
-
function traverseModuleScripts(node, visitor) {
|
|
28897
|
-
traverseNodes(node, (child) => {
|
|
28898
|
-
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
28899
|
-
child.attrs.some(
|
|
28900
|
-
(attr) => attr.name === "type" && attr.value === "module"
|
|
28901
|
-
) && // no inline scripts
|
|
28902
|
-
child.attrs.some((attr) => attr.name === "src")) {
|
|
28903
|
-
visitor(child);
|
|
28904
|
-
}
|
|
28905
|
-
if (nodeIsElement(child) && child.nodeName === "link" && // only modules
|
|
28906
|
-
child.attrs.some(
|
|
28907
|
-
(attr) => attr.name === "rel" && attr.value === "modulepreload"
|
|
28908
|
-
)) {
|
|
28909
|
-
visitor(child);
|
|
28910
|
-
}
|
|
28911
|
-
});
|
|
28912
|
-
}
|
|
28913
|
-
function nodeIsElement(node) {
|
|
28914
|
-
return node.nodeName[0] !== "#";
|
|
28915
|
-
}
|
|
28916
|
-
function traverseNodes(node, visitor) {
|
|
28917
|
-
if (node.nodeName === "template") {
|
|
28918
|
-
node = node.content;
|
|
28919
|
-
}
|
|
28920
|
-
visitor(node);
|
|
28921
|
-
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") {
|
|
28922
|
-
for (const childNode of node.childNodes) {
|
|
28923
|
-
traverseNodes(childNode, visitor);
|
|
28924
|
-
}
|
|
28925
|
-
}
|
|
28926
|
-
}
|
|
28927
|
-
|
|
28928
29728
|
// ../astro-embedded-scripts-extensions/src/utils/isAbsoluteUrl.ts
|
|
28929
29729
|
init_esm_shims();
|
|
28930
29730
|
function isAbsoluteUrl(url) {
|
|
@@ -28981,16 +29781,13 @@ var createIntegration5 = () => {
|
|
|
28981
29781
|
return;
|
|
28982
29782
|
}
|
|
28983
29783
|
ok10(srcDir != null);
|
|
28984
|
-
|
|
29784
|
+
customBuildOutput = await build(
|
|
28985
29785
|
getViteConfig2({
|
|
28986
29786
|
createExtensionViteConfig,
|
|
28987
29787
|
extensions,
|
|
28988
29788
|
srcDir
|
|
28989
29789
|
})
|
|
28990
29790
|
);
|
|
28991
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
28992
|
-
ok10(clientOutput);
|
|
28993
|
-
customBuildOutput = clientOutput;
|
|
28994
29791
|
},
|
|
28995
29792
|
async "wix:app-manifest:setup"({
|
|
28996
29793
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
@@ -29003,7 +29800,7 @@ var createIntegration5 = () => {
|
|
|
29003
29800
|
for (const extension of extensions) {
|
|
29004
29801
|
const fileName = relative(
|
|
29005
29802
|
rootDir,
|
|
29006
|
-
|
|
29803
|
+
join16(srcDir, extension.options.source)
|
|
29007
29804
|
);
|
|
29008
29805
|
const html = await getAssetContent({
|
|
29009
29806
|
buildOutput: customBuildOutput,
|
|
@@ -29011,7 +29808,7 @@ var createIntegration5 = () => {
|
|
|
29011
29808
|
viteDevServer: customDevServer
|
|
29012
29809
|
});
|
|
29013
29810
|
const fragment = parseFragment(html);
|
|
29014
|
-
|
|
29811
|
+
traverseModuleElements(fragment, (script) => {
|
|
29015
29812
|
const srcAttr = script.attrs.find(
|
|
29016
29813
|
(x) => x.name === "src" || x.name === "href"
|
|
29017
29814
|
);
|
|
@@ -29019,7 +29816,7 @@ var createIntegration5 = () => {
|
|
|
29019
29816
|
if (srcAttr.value.startsWith("//") || isAbsoluteUrl(srcAttr.value)) {
|
|
29020
29817
|
return;
|
|
29021
29818
|
}
|
|
29022
|
-
const normalizedValue = isAbsolutePath(srcAttr.value) ? srcAttr.value :
|
|
29819
|
+
const normalizedValue = isAbsolutePath(srcAttr.value) ? srcAttr.value : join16(
|
|
29023
29820
|
customDevServer?.config.base ?? "",
|
|
29024
29821
|
dirname2(fileName),
|
|
29025
29822
|
srcAttr.value
|
|
@@ -29029,6 +29826,7 @@ var createIntegration5 = () => {
|
|
|
29029
29826
|
});
|
|
29030
29827
|
components.push({
|
|
29031
29828
|
compId: extension.options.id,
|
|
29829
|
+
compName: extension.options.name,
|
|
29032
29830
|
compType: "EMBEDDED_SCRIPT",
|
|
29033
29831
|
compData: {
|
|
29034
29832
|
embeddedScriptComponentData: {
|
|
@@ -29036,6 +29834,7 @@ var createIntegration5 = () => {
|
|
|
29036
29834
|
allowedForFreeSite: true,
|
|
29037
29835
|
connectArticleUrl: "",
|
|
29038
29836
|
dependencies: [],
|
|
29837
|
+
// TODO: frontend dependencies
|
|
29039
29838
|
embedCategory: extension.options.scriptType,
|
|
29040
29839
|
loadOnce: true,
|
|
29041
29840
|
pages: "NONE_PAGES",
|
|
@@ -29067,12 +29866,11 @@ init_esm_shims();
|
|
|
29067
29866
|
|
|
29068
29867
|
// ../astro-site-component-panels-extensions/src/integration.ts
|
|
29069
29868
|
init_esm_shims();
|
|
29070
|
-
import { ok as
|
|
29071
|
-
import {
|
|
29869
|
+
import { ok as ok12 } from "assert";
|
|
29870
|
+
import { createServer as createServer4 } from "vite";
|
|
29072
29871
|
|
|
29073
29872
|
// ../astro-site-component-panels-extensions/src/utils/getComponentResources.ts
|
|
29074
29873
|
init_esm_shims();
|
|
29075
|
-
import { ok as ok12 } from "assert";
|
|
29076
29874
|
|
|
29077
29875
|
// ../astro-site-component-panels-extensions/src/vite/extensionPlugin.ts
|
|
29078
29876
|
init_esm_shims();
|
|
@@ -29080,7 +29878,7 @@ import { ok as ok11 } from "assert";
|
|
|
29080
29878
|
|
|
29081
29879
|
// ../astro-site-component-panels-extensions/src/utils/getSupportedExtensions.ts
|
|
29082
29880
|
init_esm_shims();
|
|
29083
|
-
import { join as
|
|
29881
|
+
import { join as join17 } from "path";
|
|
29084
29882
|
function getSupportedExtensions({
|
|
29085
29883
|
extensions,
|
|
29086
29884
|
srcDir
|
|
@@ -29090,7 +29888,7 @@ function getSupportedExtensions({
|
|
|
29090
29888
|
);
|
|
29091
29889
|
return siteComponentPanelExtensions.map((extension) => ({
|
|
29092
29890
|
...extension,
|
|
29093
|
-
componentPath:
|
|
29891
|
+
componentPath: join17(srcDir, extension.options.component)
|
|
29094
29892
|
}));
|
|
29095
29893
|
}
|
|
29096
29894
|
|
|
@@ -29204,13 +30002,12 @@ function getResourcesBuild({
|
|
|
29204
30002
|
extension
|
|
29205
30003
|
}) {
|
|
29206
30004
|
const moduleId = getVirtualModuleIdForComponent(extension.options.id);
|
|
29207
|
-
const chunk =
|
|
29208
|
-
|
|
29209
|
-
const
|
|
29210
|
-
const cssUrl = chunk.viteMetadata?.importedCss.values().next().value;
|
|
30005
|
+
const chunk = getChunkForModuleId({ buildOutput, moduleId });
|
|
30006
|
+
const componentFileName = chunk.fileName;
|
|
30007
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
29211
30008
|
return {
|
|
29212
|
-
bundleUrl: appendToDevServerUrl(baseUrl,
|
|
29213
|
-
cssUrl:
|
|
30009
|
+
bundleUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
30010
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
29214
30011
|
};
|
|
29215
30012
|
}
|
|
29216
30013
|
function getResourcesDev({
|
|
@@ -29344,7 +30141,7 @@ var createIntegration6 = () => {
|
|
|
29344
30141
|
createExtensionViteConfig,
|
|
29345
30142
|
setupExtensionProxy
|
|
29346
30143
|
}) {
|
|
29347
|
-
|
|
30144
|
+
ok12(model);
|
|
29348
30145
|
devServer = await createServer4(
|
|
29349
30146
|
getViteConfig3({
|
|
29350
30147
|
createExtensionViteConfig,
|
|
@@ -29355,27 +30152,24 @@ var createIntegration6 = () => {
|
|
|
29355
30152
|
setupExtensionProxy(devServer);
|
|
29356
30153
|
},
|
|
29357
30154
|
async "astro:server:done"() {
|
|
29358
|
-
|
|
30155
|
+
ok12(devServer);
|
|
29359
30156
|
await devServer.close();
|
|
29360
30157
|
},
|
|
29361
30158
|
async "wix:build:setup"({ createExtensionViteConfig }) {
|
|
29362
|
-
|
|
30159
|
+
ok12(model);
|
|
29363
30160
|
const extensions = getSupportedExtensions(model);
|
|
29364
30161
|
if (extensions.length === 0) {
|
|
29365
30162
|
return;
|
|
29366
30163
|
}
|
|
29367
|
-
|
|
30164
|
+
buildOutput = await build(
|
|
29368
30165
|
getViteConfig3({ createExtensionViteConfig, model })
|
|
29369
30166
|
);
|
|
29370
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(viteOutput);
|
|
29371
|
-
ok13(clientOutput);
|
|
29372
|
-
buildOutput = clientOutput;
|
|
29373
30167
|
},
|
|
29374
30168
|
async "wix:app-manifest:setup"({
|
|
29375
30169
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
29376
30170
|
updateAppManifest
|
|
29377
30171
|
}) {
|
|
29378
|
-
|
|
30172
|
+
ok12(model);
|
|
29379
30173
|
const extensions = getSupportedExtensions(model);
|
|
29380
30174
|
const components = [];
|
|
29381
30175
|
for (const extension of extensions) {
|
|
@@ -29419,84 +30213,146 @@ init_esm_shims();
|
|
|
29419
30213
|
|
|
29420
30214
|
// ../astro-site-components-extensions/src/integration.ts
|
|
29421
30215
|
init_esm_shims();
|
|
29422
|
-
import { ok as
|
|
29423
|
-
import {
|
|
30216
|
+
import { ok as ok14 } from "assert";
|
|
30217
|
+
import { createServer as createServer5 } from "vite";
|
|
29424
30218
|
|
|
29425
|
-
// ../astro-site-components-extensions/src/utils/
|
|
30219
|
+
// ../astro-site-components-extensions/src/utils/getPresets.ts
|
|
29426
30220
|
init_esm_shims();
|
|
29427
|
-
import {
|
|
30221
|
+
import { join as join20 } from "path";
|
|
29428
30222
|
|
|
29429
|
-
// ../astro-site-components-extensions/src/vite/
|
|
30223
|
+
// ../astro-site-components-extensions/src/vite/client/build-config.ts
|
|
29430
30224
|
init_esm_shims();
|
|
29431
|
-
import {
|
|
30225
|
+
import { join as join19 } from "path";
|
|
29432
30226
|
|
|
29433
|
-
// ../astro-site-components-extensions/src/
|
|
30227
|
+
// ../astro-site-components-extensions/src/vite/shared.ts
|
|
29434
30228
|
init_esm_shims();
|
|
29435
|
-
|
|
29436
|
-
|
|
29437
|
-
|
|
29438
|
-
|
|
29439
|
-
|
|
29440
|
-
|
|
29441
|
-
|
|
29442
|
-
|
|
29443
|
-
componentPath: join16(srcDir, extension.options.resources.client.component)
|
|
29444
|
-
}));
|
|
29445
|
-
}
|
|
29446
|
-
function filterSiteComponents(extension) {
|
|
29447
|
-
return extension.type === "SiteComponent";
|
|
29448
|
-
}
|
|
30229
|
+
var extensionName = "site-components";
|
|
30230
|
+
var externalDeps2 = [
|
|
30231
|
+
"react",
|
|
30232
|
+
"react/jsx-runtime",
|
|
30233
|
+
"react/jsx-dev-runtime",
|
|
30234
|
+
"react-dom",
|
|
30235
|
+
"@wix/services-manager-react"
|
|
30236
|
+
];
|
|
29449
30237
|
|
|
29450
|
-
// ../astro-site-components-extensions/src/vite/
|
|
29451
|
-
|
|
29452
|
-
|
|
29453
|
-
|
|
29454
|
-
|
|
29455
|
-
|
|
29456
|
-
|
|
29457
|
-
var
|
|
29458
|
-
|
|
29459
|
-
|
|
29460
|
-
|
|
29461
|
-
|
|
29462
|
-
);
|
|
29463
|
-
|
|
29464
|
-
|
|
29465
|
-
|
|
30238
|
+
// ../astro-site-components-extensions/src/vite/virtual-modules-plugin.ts
|
|
30239
|
+
init_esm_shims();
|
|
30240
|
+
|
|
30241
|
+
// ../vite-virtual-router-plugin/src/index.ts
|
|
30242
|
+
init_esm_shims();
|
|
30243
|
+
var import_path_to_regexp = __toESM(require_dist(), 1);
|
|
30244
|
+
import { ok as ok13 } from "assert";
|
|
30245
|
+
var RESOLVED_PREFIX = "\0";
|
|
30246
|
+
function createVirtualRouter() {
|
|
30247
|
+
const routes = [];
|
|
30248
|
+
return {
|
|
30249
|
+
route(path5, handler) {
|
|
30250
|
+
const matcher = (0, import_path_to_regexp.match)(path5);
|
|
30251
|
+
routes.push({
|
|
30252
|
+
handler,
|
|
30253
|
+
matcher
|
|
30254
|
+
});
|
|
30255
|
+
return this;
|
|
30256
|
+
},
|
|
30257
|
+
get routes() {
|
|
30258
|
+
return routes;
|
|
30259
|
+
}
|
|
30260
|
+
};
|
|
29466
30261
|
}
|
|
29467
|
-
function
|
|
30262
|
+
function viteVirtualRouterPlugin({ name, router }) {
|
|
29468
30263
|
let config = null;
|
|
29469
30264
|
return {
|
|
29470
|
-
name
|
|
30265
|
+
name,
|
|
29471
30266
|
configResolved(resolvedConfig) {
|
|
29472
30267
|
config = resolvedConfig;
|
|
29473
30268
|
},
|
|
29474
|
-
load(
|
|
29475
|
-
if (
|
|
29476
|
-
const
|
|
29477
|
-
const
|
|
29478
|
-
|
|
29479
|
-
|
|
29480
|
-
|
|
29481
|
-
|
|
29482
|
-
|
|
29483
|
-
|
|
29484
|
-
|
|
30269
|
+
load(rawId) {
|
|
30270
|
+
if (rawId.startsWith(RESOLVED_PREFIX)) {
|
|
30271
|
+
const id = rawId.replace(RESOLVED_PREFIX, "");
|
|
30272
|
+
for (const route of router.routes) {
|
|
30273
|
+
const result = route.matcher(id);
|
|
30274
|
+
if (result !== false) {
|
|
30275
|
+
ok13(config);
|
|
30276
|
+
return route.handler(result.params, {
|
|
30277
|
+
command: config.command,
|
|
30278
|
+
resolvedId: id
|
|
30279
|
+
});
|
|
29485
30280
|
}
|
|
29486
|
-
return getServeTemplate2(componentPath);
|
|
29487
30281
|
}
|
|
29488
30282
|
}
|
|
29489
30283
|
return null;
|
|
29490
30284
|
},
|
|
29491
30285
|
resolveId(id) {
|
|
29492
|
-
|
|
29493
|
-
|
|
30286
|
+
for (const route of router.routes) {
|
|
30287
|
+
if (route.matcher(id) !== false) {
|
|
30288
|
+
return `${RESOLVED_PREFIX}${id}`;
|
|
30289
|
+
}
|
|
29494
30290
|
}
|
|
29495
30291
|
return null;
|
|
29496
30292
|
}
|
|
29497
30293
|
};
|
|
29498
30294
|
}
|
|
29499
|
-
|
|
30295
|
+
|
|
30296
|
+
// ../astro-site-components-extensions/src/vite/client/virtual-module.ts
|
|
30297
|
+
init_esm_shims();
|
|
30298
|
+
|
|
30299
|
+
// ../astro-site-components-extensions/src/runtime/index.ts
|
|
30300
|
+
init_esm_shims();
|
|
30301
|
+
var sdkRuntimePath2 = normalizePath(
|
|
30302
|
+
new URL(
|
|
30303
|
+
"../dependencies/astro-site-components-extensions/browser-runtime/sdk.js",
|
|
30304
|
+
import.meta.url
|
|
30305
|
+
)
|
|
30306
|
+
);
|
|
30307
|
+
var hmrRuntimePath2 = normalizePath(
|
|
30308
|
+
new URL(
|
|
30309
|
+
"../dependencies/astro-site-components-extensions/browser-runtime/hmr.js",
|
|
30310
|
+
import.meta.url
|
|
30311
|
+
)
|
|
30312
|
+
);
|
|
30313
|
+
|
|
30314
|
+
// ../astro-site-components-extensions/src/utils/getSiteComponent.ts
|
|
30315
|
+
init_esm_shims();
|
|
30316
|
+
|
|
30317
|
+
// ../astro-site-components-extensions/src/utils/getSupportedExtensions.ts
|
|
30318
|
+
init_esm_shims();
|
|
30319
|
+
import { join as join18 } from "path";
|
|
30320
|
+
function getSupportedExtensions2({
|
|
30321
|
+
extensions,
|
|
30322
|
+
srcDir
|
|
30323
|
+
}) {
|
|
30324
|
+
const siteComponentExtensions = extensions.filter(filterSiteComponents);
|
|
30325
|
+
return siteComponentExtensions.map((extension) => {
|
|
30326
|
+
const componentPresets = Object.entries(
|
|
30327
|
+
extension.options.editorElement.presets ?? {}
|
|
30328
|
+
).map(([name, { source, ...config }]) => ({
|
|
30329
|
+
name,
|
|
30330
|
+
config,
|
|
30331
|
+
path: join18(srcDir, source),
|
|
30332
|
+
source
|
|
30333
|
+
}));
|
|
30334
|
+
return {
|
|
30335
|
+
...extension,
|
|
30336
|
+
componentPath: join18(srcDir, extension.options.resources.client.component),
|
|
30337
|
+
componentPresets,
|
|
30338
|
+
editorPreviewPath: extension.options.resources.editor?.component != null ? join18(srcDir, extension.options.resources.editor.component) : null,
|
|
30339
|
+
sdkPath: extension.options.resources.sdk != null ? join18(srcDir, extension.options.resources.sdk) : null
|
|
30340
|
+
};
|
|
30341
|
+
});
|
|
30342
|
+
}
|
|
30343
|
+
function filterSiteComponents(extension) {
|
|
30344
|
+
return extension.type === "SiteComponent";
|
|
30345
|
+
}
|
|
30346
|
+
|
|
30347
|
+
// ../astro-site-components-extensions/src/utils/getSiteComponent.ts
|
|
30348
|
+
function getSiteComponent(model, id) {
|
|
30349
|
+
return getSupportedExtensions2(model).find(
|
|
30350
|
+
(ext) => ext.options.id === id
|
|
30351
|
+
);
|
|
30352
|
+
}
|
|
30353
|
+
|
|
30354
|
+
// ../astro-site-components-extensions/src/vite/client/virtual-module.ts
|
|
30355
|
+
function getClientComponentBuildTemplate(componentPath) {
|
|
29500
30356
|
return defaultOutdent`
|
|
29501
30357
|
import { createContext } from '${sdkRuntimePath2}';
|
|
29502
30358
|
|
|
@@ -29505,7 +30361,7 @@ function getBuildTemplate2(componentPath) {
|
|
|
29505
30361
|
export { default } from '${componentPath}';
|
|
29506
30362
|
`;
|
|
29507
30363
|
}
|
|
29508
|
-
function
|
|
30364
|
+
function getClientComponentServeTemplate(componentPath) {
|
|
29509
30365
|
return defaultOutdent`
|
|
29510
30366
|
import { createContext } from '${sdkRuntimePath2}';
|
|
29511
30367
|
import { createComponentHmrWrapper } from '${hmrRuntimePath2}';
|
|
@@ -29528,89 +30384,531 @@ function getServeTemplate2(componentPath) {
|
|
|
29528
30384
|
export default WrappedComponent;
|
|
29529
30385
|
`;
|
|
29530
30386
|
}
|
|
29531
|
-
|
|
29532
|
-
|
|
29533
|
-
|
|
29534
|
-
|
|
29535
|
-
|
|
29536
|
-
|
|
29537
|
-
|
|
30387
|
+
function getVirtualModuleIdForClientComponent(componentId) {
|
|
30388
|
+
return `wix/component/${componentId}`;
|
|
30389
|
+
}
|
|
30390
|
+
function registerClientVirtualRoute({
|
|
30391
|
+
model,
|
|
30392
|
+
router
|
|
30393
|
+
}) {
|
|
30394
|
+
router.route(
|
|
30395
|
+
getVirtualModuleIdForClientComponent(":id"),
|
|
30396
|
+
({ id }, { command }) => {
|
|
30397
|
+
const extension = getSiteComponent(model, id);
|
|
30398
|
+
if (extension) {
|
|
30399
|
+
const componentPath = normalizePath(extension.componentPath);
|
|
30400
|
+
if (command === "build") {
|
|
30401
|
+
return getClientComponentBuildTemplate(componentPath);
|
|
30402
|
+
}
|
|
30403
|
+
return getClientComponentServeTemplate(componentPath);
|
|
30404
|
+
}
|
|
30405
|
+
return null;
|
|
30406
|
+
}
|
|
30407
|
+
);
|
|
30408
|
+
}
|
|
30409
|
+
|
|
30410
|
+
// ../astro-site-components-extensions/src/vite/editor/virtual-module.ts
|
|
30411
|
+
init_esm_shims();
|
|
30412
|
+
function getVirtualModuleIdForEditorComponent(componentId) {
|
|
30413
|
+
return `wix/component-editor/${componentId}`;
|
|
30414
|
+
}
|
|
30415
|
+
function registerEditorVirtualRoute({
|
|
30416
|
+
model,
|
|
30417
|
+
router
|
|
30418
|
+
}) {
|
|
30419
|
+
router.route(
|
|
30420
|
+
getVirtualModuleIdForEditorComponent(":id"),
|
|
30421
|
+
({ id }, { command }) => {
|
|
30422
|
+
const extension = getSiteComponent(model, id);
|
|
30423
|
+
if (extension?.editorPreviewPath != null) {
|
|
30424
|
+
const componentPath = normalizePath(extension.editorPreviewPath);
|
|
30425
|
+
if (command === "build") {
|
|
30426
|
+
return getClientComponentBuildTemplate(componentPath);
|
|
30427
|
+
}
|
|
30428
|
+
return getClientComponentServeTemplate(componentPath);
|
|
30429
|
+
}
|
|
30430
|
+
return null;
|
|
30431
|
+
}
|
|
30432
|
+
);
|
|
30433
|
+
}
|
|
30434
|
+
|
|
30435
|
+
// ../astro-site-components-extensions/src/vite/sdk/virtual-module.ts
|
|
30436
|
+
init_esm_shims();
|
|
30437
|
+
function getVirtualModuleIdForSdk(componentId) {
|
|
30438
|
+
return `wix/component-sdk/${componentId}`;
|
|
30439
|
+
}
|
|
30440
|
+
function registerSdkVirtualRoute({
|
|
30441
|
+
model,
|
|
30442
|
+
router
|
|
30443
|
+
}) {
|
|
30444
|
+
router.route(
|
|
30445
|
+
getVirtualModuleIdForSdk(":id"),
|
|
30446
|
+
({ id }, { command }) => {
|
|
30447
|
+
const extension = getSiteComponent(model, id);
|
|
30448
|
+
if (extension?.sdkPath != null) {
|
|
30449
|
+
const sdkPath = normalizePath(extension.sdkPath);
|
|
30450
|
+
if (command === "build") {
|
|
30451
|
+
return getBuildTemplate2(sdkPath);
|
|
30452
|
+
}
|
|
30453
|
+
return getServeTemplate2(sdkPath);
|
|
30454
|
+
}
|
|
30455
|
+
return null;
|
|
30456
|
+
}
|
|
30457
|
+
);
|
|
30458
|
+
}
|
|
30459
|
+
function getBuildTemplate2(sdkPath) {
|
|
30460
|
+
return defaultOutdent`
|
|
30461
|
+
export { default } from '${sdkPath}';
|
|
30462
|
+
`;
|
|
30463
|
+
}
|
|
30464
|
+
function getServeTemplate2(sdkPath) {
|
|
30465
|
+
return defaultOutdent`
|
|
30466
|
+
if (import.meta.hot) {
|
|
30467
|
+
import.meta.hot.accept((_) => {});
|
|
30468
|
+
}
|
|
30469
|
+
|
|
30470
|
+
export { default } from '${sdkPath}';
|
|
30471
|
+
`;
|
|
30472
|
+
}
|
|
30473
|
+
|
|
30474
|
+
// ../astro-site-components-extensions/src/vite/virtual-modules-plugin.ts
|
|
30475
|
+
function virtualModulesPlugin({ model }) {
|
|
30476
|
+
const router = createVirtualRouter();
|
|
30477
|
+
registerClientVirtualRoute({ model, router });
|
|
30478
|
+
registerEditorVirtualRoute({ model, router });
|
|
30479
|
+
registerSdkVirtualRoute({ model, router });
|
|
30480
|
+
return viteVirtualRouterPlugin({
|
|
30481
|
+
name: "wix:site-component-virtual-modules-plugin",
|
|
30482
|
+
router
|
|
30483
|
+
});
|
|
30484
|
+
}
|
|
30485
|
+
|
|
30486
|
+
// ../astro-site-components-extensions/src/vite/client/build-config.ts
|
|
30487
|
+
function getEntryNameForClientComponent(componentId) {
|
|
30488
|
+
return `component-${componentId}`;
|
|
30489
|
+
}
|
|
30490
|
+
function getEntryNameForPreset(componentId, presetName) {
|
|
30491
|
+
return `component-${componentId}-preset-${presetName}.css`;
|
|
30492
|
+
}
|
|
30493
|
+
var getClientBuildConfig = ({
|
|
30494
|
+
createExtensionViteConfig,
|
|
30495
|
+
extension: {
|
|
30496
|
+
componentPresets,
|
|
30497
|
+
options: { id }
|
|
30498
|
+
},
|
|
30499
|
+
model
|
|
30500
|
+
}) => {
|
|
30501
|
+
const input = {
|
|
30502
|
+
[getEntryNameForClientComponent(id)]: getVirtualModuleIdForClientComponent(id)
|
|
30503
|
+
};
|
|
30504
|
+
for (const { name, path: path5 } of componentPresets) {
|
|
30505
|
+
input[getEntryNameForPreset(id, name)] = path5;
|
|
30506
|
+
}
|
|
30507
|
+
return createExtensionViteConfig({
|
|
30508
|
+
name: join19(extensionName, "client"),
|
|
30509
|
+
config: {
|
|
30510
|
+
build: {
|
|
30511
|
+
rollupOptions: {
|
|
30512
|
+
external: externalDeps2,
|
|
30513
|
+
input,
|
|
30514
|
+
preserveEntrySignatures: "strict"
|
|
30515
|
+
}
|
|
30516
|
+
},
|
|
30517
|
+
plugins: [virtualModulesPlugin({ model })]
|
|
30518
|
+
}
|
|
30519
|
+
});
|
|
30520
|
+
};
|
|
30521
|
+
|
|
30522
|
+
// ../astro-site-components-extensions/src/utils/getPresets.ts
|
|
30523
|
+
function getPresets({
|
|
30524
|
+
baseUrl,
|
|
30525
|
+
buildOutput,
|
|
30526
|
+
devServer,
|
|
30527
|
+
extension
|
|
30528
|
+
}) {
|
|
30529
|
+
if (buildOutput) {
|
|
30530
|
+
return getPresetsBuild({ baseUrl, buildOutput, extension });
|
|
30531
|
+
}
|
|
30532
|
+
if (devServer) {
|
|
30533
|
+
return getPresetsDev({ baseUrl, devServer, extension });
|
|
30534
|
+
}
|
|
30535
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30536
|
+
}
|
|
30537
|
+
function getPresetsBuild({
|
|
30538
|
+
baseUrl,
|
|
30539
|
+
buildOutput,
|
|
30540
|
+
extension
|
|
30541
|
+
}) {
|
|
30542
|
+
return extension.componentPresets.reduce((acc, { name, config }) => {
|
|
30543
|
+
const { fileName } = getAssetForName({
|
|
30544
|
+
name: getEntryNameForPreset(extension.options.id, name),
|
|
30545
|
+
buildOutput
|
|
30546
|
+
});
|
|
30547
|
+
const cssUrl = appendToDevServerUrl(baseUrl, fileName);
|
|
30548
|
+
acc[name] = {
|
|
30549
|
+
...config,
|
|
30550
|
+
cssUrl,
|
|
30551
|
+
presetCssUrl: cssUrl
|
|
30552
|
+
};
|
|
30553
|
+
return acc;
|
|
30554
|
+
}, {});
|
|
30555
|
+
}
|
|
30556
|
+
function getPresetsDev({
|
|
30557
|
+
baseUrl,
|
|
30558
|
+
devServer,
|
|
30559
|
+
extension
|
|
30560
|
+
}) {
|
|
30561
|
+
return extension.componentPresets.reduce((acc, { name, config, path: path5 }) => {
|
|
30562
|
+
const cssUrl = appendToDevServerUrl(
|
|
30563
|
+
baseUrl,
|
|
30564
|
+
join20(devServer.config.base, "@fs", path5)
|
|
30565
|
+
);
|
|
30566
|
+
acc[name] = {
|
|
30567
|
+
...config,
|
|
30568
|
+
cssUrl,
|
|
30569
|
+
presetCssUrl: cssUrl
|
|
30570
|
+
};
|
|
30571
|
+
return acc;
|
|
30572
|
+
}, {});
|
|
30573
|
+
}
|
|
30574
|
+
|
|
30575
|
+
// ../astro-site-components-extensions/src/utils/getResources.ts
|
|
30576
|
+
init_esm_shims();
|
|
30577
|
+
|
|
30578
|
+
// ../astro-site-components-extensions/src/utils/getClientResource.ts
|
|
30579
|
+
init_esm_shims();
|
|
30580
|
+
function getClientResource({
|
|
30581
|
+
baseUrl,
|
|
30582
|
+
buildOutput,
|
|
30583
|
+
devServer,
|
|
30584
|
+
extension
|
|
29538
30585
|
}) {
|
|
29539
30586
|
if (buildOutput) {
|
|
29540
|
-
return
|
|
30587
|
+
return getClientResourceBuild({ baseUrl, buildOutput, extension });
|
|
29541
30588
|
}
|
|
29542
30589
|
if (devServer) {
|
|
29543
|
-
return
|
|
30590
|
+
return getClientResourceDev({ baseUrl, devServer, extension });
|
|
29544
30591
|
}
|
|
29545
30592
|
throw new Error("Unknown error: no build output or vite dev server");
|
|
29546
30593
|
}
|
|
29547
|
-
function
|
|
30594
|
+
function getClientResourceBuild({
|
|
29548
30595
|
baseUrl,
|
|
29549
30596
|
buildOutput,
|
|
29550
30597
|
extension
|
|
29551
30598
|
}) {
|
|
29552
|
-
const
|
|
29553
|
-
const chunk =
|
|
29554
|
-
|
|
29555
|
-
const
|
|
29556
|
-
const cssUrl = chunk.viteMetadata?.importedCss.values().next().value;
|
|
30599
|
+
const entryName = getEntryNameForClientComponent(extension.options.id);
|
|
30600
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30601
|
+
const componentFileName = chunk.fileName;
|
|
30602
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
29557
30603
|
return {
|
|
29558
|
-
|
|
29559
|
-
|
|
29560
|
-
cssUrl: cssUrl != null ? appendToDevServerUrl(baseUrl, cssUrl) : void 0
|
|
29561
|
-
}
|
|
30604
|
+
componentUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
30605
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
29562
30606
|
};
|
|
29563
30607
|
}
|
|
29564
|
-
function
|
|
30608
|
+
function getClientResourceDev({
|
|
29565
30609
|
baseUrl,
|
|
29566
30610
|
devServer,
|
|
29567
30611
|
extension
|
|
29568
30612
|
}) {
|
|
29569
|
-
const moduleId =
|
|
30613
|
+
const moduleId = getVirtualModuleIdForClientComponent(extension.options.id);
|
|
29570
30614
|
return {
|
|
29571
|
-
|
|
29572
|
-
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
29573
|
-
}
|
|
30615
|
+
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
29574
30616
|
};
|
|
29575
30617
|
}
|
|
29576
30618
|
|
|
29577
|
-
// ../astro-site-components-extensions/src/
|
|
30619
|
+
// ../astro-site-components-extensions/src/utils/getEditorResource.ts
|
|
29578
30620
|
init_esm_shims();
|
|
29579
|
-
|
|
29580
|
-
|
|
29581
|
-
|
|
29582
|
-
|
|
29583
|
-
|
|
29584
|
-
|
|
29585
|
-
|
|
29586
|
-
|
|
30621
|
+
|
|
30622
|
+
// ../astro-site-components-extensions/src/vite/editor/build-config.ts
|
|
30623
|
+
init_esm_shims();
|
|
30624
|
+
import { join as join21 } from "path";
|
|
30625
|
+
function getEntryNameForEditorComponent(componentId) {
|
|
30626
|
+
return `component-${componentId}-editor`;
|
|
30627
|
+
}
|
|
30628
|
+
var getEditorBuildConfig = ({
|
|
29587
30629
|
createExtensionViteConfig,
|
|
30630
|
+
extensionId,
|
|
29588
30631
|
model
|
|
29589
|
-
}) {
|
|
29590
|
-
const extensions = getSupportedExtensions2(model);
|
|
29591
|
-
const input = extensions.map(
|
|
29592
|
-
(extension) => [
|
|
29593
|
-
`component-${extension.options.id}`,
|
|
29594
|
-
getVirtualModuleIdForComponent2(extension.options.id)
|
|
29595
|
-
]
|
|
29596
|
-
);
|
|
30632
|
+
}) => {
|
|
29597
30633
|
return createExtensionViteConfig({
|
|
29598
|
-
name: "
|
|
30634
|
+
name: join21(extensionName, "editor"),
|
|
29599
30635
|
config: {
|
|
29600
30636
|
build: {
|
|
29601
30637
|
rollupOptions: {
|
|
29602
30638
|
external: externalDeps2,
|
|
29603
|
-
input:
|
|
29604
|
-
|
|
30639
|
+
input: {
|
|
30640
|
+
[getEntryNameForEditorComponent(extensionId)]: getVirtualModuleIdForEditorComponent(extensionId)
|
|
30641
|
+
},
|
|
29605
30642
|
preserveEntrySignatures: "strict"
|
|
29606
30643
|
}
|
|
29607
30644
|
},
|
|
30645
|
+
plugins: [virtualModulesPlugin({ model })]
|
|
30646
|
+
}
|
|
30647
|
+
});
|
|
30648
|
+
};
|
|
30649
|
+
|
|
30650
|
+
// ../astro-site-components-extensions/src/utils/getEditorResource.ts
|
|
30651
|
+
function getEditorResource({
|
|
30652
|
+
baseUrl,
|
|
30653
|
+
buildOutput,
|
|
30654
|
+
devServer,
|
|
30655
|
+
extension
|
|
30656
|
+
}) {
|
|
30657
|
+
if (extension.editorPreviewPath == null) {
|
|
30658
|
+
return;
|
|
30659
|
+
}
|
|
30660
|
+
if (buildOutput) {
|
|
30661
|
+
return getEditorResourceBuild({ baseUrl, buildOutput, extension });
|
|
30662
|
+
}
|
|
30663
|
+
if (devServer) {
|
|
30664
|
+
return getEditorResourceDev({ baseUrl, devServer, extension });
|
|
30665
|
+
}
|
|
30666
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30667
|
+
}
|
|
30668
|
+
function getEditorResourceBuild({
|
|
30669
|
+
baseUrl,
|
|
30670
|
+
buildOutput,
|
|
30671
|
+
extension
|
|
30672
|
+
}) {
|
|
30673
|
+
const entryName = getEntryNameForEditorComponent(extension.options.id);
|
|
30674
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30675
|
+
const componentFileName = chunk.fileName;
|
|
30676
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
30677
|
+
return {
|
|
30678
|
+
componentUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
30679
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
30680
|
+
};
|
|
30681
|
+
}
|
|
30682
|
+
function getEditorResourceDev({
|
|
30683
|
+
baseUrl,
|
|
30684
|
+
devServer,
|
|
30685
|
+
extension
|
|
30686
|
+
}) {
|
|
30687
|
+
const moduleId = getVirtualModuleIdForEditorComponent(extension.options.id);
|
|
30688
|
+
return {
|
|
30689
|
+
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
30690
|
+
};
|
|
30691
|
+
}
|
|
30692
|
+
|
|
30693
|
+
// ../astro-site-components-extensions/src/utils/getSdkResource.ts
|
|
30694
|
+
init_esm_shims();
|
|
30695
|
+
|
|
30696
|
+
// ../astro-site-components-extensions/src/vite/sdk/build-config.ts
|
|
30697
|
+
init_esm_shims();
|
|
30698
|
+
import { join as join22 } from "path";
|
|
30699
|
+
function getEntryNameForSdk(componentId) {
|
|
30700
|
+
return `component-${componentId}-sdk`;
|
|
30701
|
+
}
|
|
30702
|
+
var getSdkBuildConfig = ({
|
|
30703
|
+
createExtensionViteConfig,
|
|
30704
|
+
extensionId,
|
|
30705
|
+
model
|
|
30706
|
+
}) => {
|
|
30707
|
+
return createExtensionViteConfig({
|
|
30708
|
+
name: join22(extensionName, "sdk"),
|
|
30709
|
+
config: {
|
|
30710
|
+
build: {
|
|
30711
|
+
rollupOptions: {
|
|
30712
|
+
input: {
|
|
30713
|
+
[getEntryNameForSdk(extensionId)]: getVirtualModuleIdForSdk(extensionId)
|
|
30714
|
+
},
|
|
30715
|
+
output: {
|
|
30716
|
+
inlineDynamicImports: true
|
|
30717
|
+
}
|
|
30718
|
+
},
|
|
30719
|
+
ssr: true
|
|
30720
|
+
},
|
|
30721
|
+
plugins: [virtualModulesPlugin({ model })],
|
|
30722
|
+
ssr: {
|
|
30723
|
+
noExternal: true,
|
|
30724
|
+
target: "webworker"
|
|
30725
|
+
}
|
|
30726
|
+
}
|
|
30727
|
+
});
|
|
30728
|
+
};
|
|
30729
|
+
|
|
30730
|
+
// ../astro-site-components-extensions/src/utils/getSdkResource.ts
|
|
30731
|
+
function getSdkResource({
|
|
30732
|
+
baseUrl,
|
|
30733
|
+
buildOutput,
|
|
30734
|
+
devServer,
|
|
30735
|
+
extension
|
|
30736
|
+
}) {
|
|
30737
|
+
if (extension.sdkPath == null) {
|
|
30738
|
+
return;
|
|
30739
|
+
}
|
|
30740
|
+
if (buildOutput) {
|
|
30741
|
+
return getSdkResourceBuild({ baseUrl, buildOutput, extension });
|
|
30742
|
+
}
|
|
30743
|
+
if (devServer) {
|
|
30744
|
+
return getSdkResourceDev({ baseUrl, devServer, extension });
|
|
30745
|
+
}
|
|
30746
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30747
|
+
}
|
|
30748
|
+
function getSdkResourceBuild({
|
|
30749
|
+
baseUrl,
|
|
30750
|
+
buildOutput,
|
|
30751
|
+
extension
|
|
30752
|
+
}) {
|
|
30753
|
+
const entryName = getEntryNameForSdk(extension.options.id);
|
|
30754
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30755
|
+
const sdkFileName = chunk.fileName;
|
|
30756
|
+
return {
|
|
30757
|
+
url: appendToDevServerUrl(baseUrl, sdkFileName)
|
|
30758
|
+
};
|
|
30759
|
+
}
|
|
30760
|
+
function getSdkResourceDev({
|
|
30761
|
+
baseUrl,
|
|
30762
|
+
devServer,
|
|
30763
|
+
extension
|
|
30764
|
+
}) {
|
|
30765
|
+
const moduleId = getVirtualModuleIdForSdk(extension.options.id);
|
|
30766
|
+
return {
|
|
30767
|
+
url: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
30768
|
+
};
|
|
30769
|
+
}
|
|
30770
|
+
|
|
30771
|
+
// ../astro-site-components-extensions/src/utils/getServerResource.ts
|
|
30772
|
+
init_esm_shims();
|
|
30773
|
+
|
|
30774
|
+
// ../astro-site-components-extensions/src/vite/server/build-config.ts
|
|
30775
|
+
init_esm_shims();
|
|
30776
|
+
import { join as join23 } from "path";
|
|
30777
|
+
function getEntryNameForServerComponent(componentId) {
|
|
30778
|
+
return `component-${componentId}-server`;
|
|
30779
|
+
}
|
|
30780
|
+
var getServerBuildConfig = ({
|
|
30781
|
+
createExtensionViteConfig,
|
|
30782
|
+
extensionId,
|
|
30783
|
+
model
|
|
30784
|
+
}) => {
|
|
30785
|
+
return createExtensionViteConfig({
|
|
30786
|
+
name: join23(extensionName, "server"),
|
|
30787
|
+
config: {
|
|
30788
|
+
build: {
|
|
30789
|
+
rollupOptions: {
|
|
30790
|
+
external: externalDeps2,
|
|
30791
|
+
input: {
|
|
30792
|
+
[getEntryNameForServerComponent(extensionId)]: getVirtualModuleIdForClientComponent(extensionId)
|
|
30793
|
+
},
|
|
30794
|
+
output: {
|
|
30795
|
+
inlineDynamicImports: true
|
|
30796
|
+
}
|
|
30797
|
+
},
|
|
30798
|
+
ssr: true
|
|
30799
|
+
},
|
|
30800
|
+
plugins: [virtualModulesPlugin({ model })],
|
|
30801
|
+
ssr: {
|
|
30802
|
+
noExternal: true,
|
|
30803
|
+
target: "node"
|
|
30804
|
+
}
|
|
30805
|
+
}
|
|
30806
|
+
});
|
|
30807
|
+
};
|
|
30808
|
+
|
|
30809
|
+
// ../astro-site-components-extensions/src/utils/getServerResource.ts
|
|
30810
|
+
function getServerResource({
|
|
30811
|
+
baseUrl,
|
|
30812
|
+
buildOutput,
|
|
30813
|
+
devServer,
|
|
30814
|
+
extension
|
|
30815
|
+
}) {
|
|
30816
|
+
if (buildOutput) {
|
|
30817
|
+
return getServerResourceBuild({ baseUrl, buildOutput, extension });
|
|
30818
|
+
}
|
|
30819
|
+
if (devServer) {
|
|
30820
|
+
return;
|
|
30821
|
+
}
|
|
30822
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30823
|
+
}
|
|
30824
|
+
function getServerResourceBuild({
|
|
30825
|
+
baseUrl,
|
|
30826
|
+
buildOutput,
|
|
30827
|
+
extension
|
|
30828
|
+
}) {
|
|
30829
|
+
const entryName = getEntryNameForServerComponent(extension.options.id);
|
|
30830
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30831
|
+
const componentFileName = chunk.fileName;
|
|
30832
|
+
return {
|
|
30833
|
+
url: appendToDevServerUrl(baseUrl, componentFileName)
|
|
30834
|
+
};
|
|
30835
|
+
}
|
|
30836
|
+
|
|
30837
|
+
// ../astro-site-components-extensions/src/utils/getResources.ts
|
|
30838
|
+
function getResources2(buildContext) {
|
|
30839
|
+
const { extension } = buildContext;
|
|
30840
|
+
return {
|
|
30841
|
+
...extension.options.resources,
|
|
30842
|
+
client: getClientResource(buildContext),
|
|
30843
|
+
editor: getEditorResource(buildContext),
|
|
30844
|
+
sdk: getSdkResource(buildContext),
|
|
30845
|
+
server: getServerResource(buildContext)
|
|
30846
|
+
};
|
|
30847
|
+
}
|
|
30848
|
+
|
|
30849
|
+
// ../astro-site-components-extensions/src/vite/configs/build.ts
|
|
30850
|
+
init_esm_shims();
|
|
30851
|
+
function getBuildViteConfigs({
|
|
30852
|
+
createExtensionViteConfig,
|
|
30853
|
+
model
|
|
30854
|
+
}) {
|
|
30855
|
+
const extensions = getSupportedExtensions2(model);
|
|
30856
|
+
return extensions.reduce((acc, extension) => {
|
|
30857
|
+
const {
|
|
30858
|
+
editorPreviewPath,
|
|
30859
|
+
options: { id: extensionId },
|
|
30860
|
+
sdkPath
|
|
30861
|
+
} = extension;
|
|
30862
|
+
acc.push(
|
|
30863
|
+
getClientBuildConfig({
|
|
30864
|
+
createExtensionViteConfig,
|
|
30865
|
+
extension,
|
|
30866
|
+
model
|
|
30867
|
+
}),
|
|
30868
|
+
getServerBuildConfig({
|
|
30869
|
+
createExtensionViteConfig,
|
|
30870
|
+
extensionId,
|
|
30871
|
+
model
|
|
30872
|
+
})
|
|
30873
|
+
);
|
|
30874
|
+
if (editorPreviewPath != null) {
|
|
30875
|
+
acc.push(
|
|
30876
|
+
getEditorBuildConfig({
|
|
30877
|
+
createExtensionViteConfig,
|
|
30878
|
+
extensionId,
|
|
30879
|
+
model
|
|
30880
|
+
})
|
|
30881
|
+
);
|
|
30882
|
+
}
|
|
30883
|
+
if (sdkPath != null) {
|
|
30884
|
+
acc.push(
|
|
30885
|
+
getSdkBuildConfig({
|
|
30886
|
+
createExtensionViteConfig,
|
|
30887
|
+
extensionId,
|
|
30888
|
+
model
|
|
30889
|
+
})
|
|
30890
|
+
);
|
|
30891
|
+
}
|
|
30892
|
+
return acc;
|
|
30893
|
+
}, []);
|
|
30894
|
+
}
|
|
30895
|
+
|
|
30896
|
+
// ../astro-site-components-extensions/src/vite/configs/dev.ts
|
|
30897
|
+
init_esm_shims();
|
|
30898
|
+
function getDevViteConfig({
|
|
30899
|
+
createExtensionViteConfig,
|
|
30900
|
+
model
|
|
30901
|
+
}) {
|
|
30902
|
+
const extensionEntries = getSupportedExtensions2(model).map((ext) => [
|
|
30903
|
+
ext.componentPath,
|
|
30904
|
+
...ext.sdkPath != null ? [ext.sdkPath] : [],
|
|
30905
|
+
...ext.editorPreviewPath != null ? [ext.editorPreviewPath] : []
|
|
30906
|
+
]).flat();
|
|
30907
|
+
return createExtensionViteConfig({
|
|
30908
|
+
name: extensionName,
|
|
30909
|
+
config: {
|
|
29608
30910
|
optimizeDeps: {
|
|
29609
|
-
entries: [
|
|
29610
|
-
...extensions.map((ext) => ext.componentPath),
|
|
29611
|
-
sdkRuntimePath2,
|
|
29612
|
-
hmrRuntimePath2
|
|
29613
|
-
]
|
|
30911
|
+
entries: [...extensionEntries, sdkRuntimePath2, hmrRuntimePath2]
|
|
29614
30912
|
},
|
|
29615
30913
|
plugins: [
|
|
29616
30914
|
m({
|
|
@@ -29618,7 +30916,7 @@ function getViteConfig4({
|
|
|
29618
30916
|
(external) => new RegExp(`^${external}$`)
|
|
29619
30917
|
)
|
|
29620
30918
|
}),
|
|
29621
|
-
|
|
30919
|
+
virtualModulesPlugin({ model })
|
|
29622
30920
|
]
|
|
29623
30921
|
}
|
|
29624
30922
|
});
|
|
@@ -29639,44 +30937,41 @@ var createIntegration7 = () => {
|
|
|
29639
30937
|
createExtensionViteConfig,
|
|
29640
30938
|
setupExtensionProxy
|
|
29641
30939
|
}) {
|
|
29642
|
-
|
|
30940
|
+
ok14(model);
|
|
29643
30941
|
customDevServer = await createServer5(
|
|
29644
|
-
|
|
30942
|
+
getDevViteConfig({ createExtensionViteConfig, model })
|
|
29645
30943
|
);
|
|
29646
30944
|
await customDevServer.listen();
|
|
29647
30945
|
setupExtensionProxy(customDevServer);
|
|
29648
30946
|
},
|
|
29649
30947
|
async "astro:server:done"() {
|
|
29650
|
-
|
|
30948
|
+
ok14(customDevServer);
|
|
29651
30949
|
await customDevServer.close();
|
|
29652
30950
|
},
|
|
29653
30951
|
async "wix:build:setup"({ createExtensionViteConfig }) {
|
|
29654
|
-
|
|
30952
|
+
ok14(model);
|
|
29655
30953
|
const extensions = getSupportedExtensions2(model);
|
|
29656
30954
|
if (extensions.length === 0) {
|
|
29657
30955
|
return;
|
|
29658
30956
|
}
|
|
29659
|
-
|
|
29660
|
-
|
|
30957
|
+
customBuildOutput = await buildAll(
|
|
30958
|
+
getBuildViteConfigs({ createExtensionViteConfig, model })
|
|
29661
30959
|
);
|
|
29662
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
29663
|
-
ok16(clientOutput);
|
|
29664
|
-
customBuildOutput = clientOutput;
|
|
29665
30960
|
},
|
|
29666
30961
|
async "wix:app-manifest:setup"({
|
|
29667
30962
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
29668
30963
|
updateAppManifest
|
|
29669
30964
|
}) {
|
|
29670
|
-
|
|
30965
|
+
ok14(model);
|
|
29671
30966
|
const extensions = getSupportedExtensions2(model);
|
|
29672
30967
|
const components = [];
|
|
29673
30968
|
for (const extension of extensions) {
|
|
29674
|
-
const
|
|
30969
|
+
const buildContext = {
|
|
29675
30970
|
baseUrl: staticsUrlPlaceholder2,
|
|
29676
30971
|
buildOutput: customBuildOutput,
|
|
29677
30972
|
devServer: customDevServer,
|
|
29678
30973
|
extension
|
|
29679
|
-
}
|
|
30974
|
+
};
|
|
29680
30975
|
components.push({
|
|
29681
30976
|
compId: extension.options.id,
|
|
29682
30977
|
compType: "EDITOR_REACT_COMPONENT",
|
|
@@ -29684,8 +30979,11 @@ var createIntegration7 = () => {
|
|
|
29684
30979
|
editorReactComponent: {
|
|
29685
30980
|
type: extension.options.type,
|
|
29686
30981
|
description: extension.options.description,
|
|
29687
|
-
editorElement:
|
|
29688
|
-
|
|
30982
|
+
editorElement: {
|
|
30983
|
+
...extension.options.editorElement,
|
|
30984
|
+
presets: getPresets(buildContext)
|
|
30985
|
+
},
|
|
30986
|
+
resources: getResources2(buildContext)
|
|
29689
30987
|
}
|
|
29690
30988
|
}
|
|
29691
30989
|
});
|
|
@@ -29730,7 +31028,11 @@ var createIntegration8 = () => {
|
|
|
29730
31028
|
compType: "WIDGET_PLUGIN",
|
|
29731
31029
|
compData: {
|
|
29732
31030
|
widgetPlugin: {
|
|
29733
|
-
installation:
|
|
31031
|
+
installation: {
|
|
31032
|
+
base: {
|
|
31033
|
+
autoAdd: sitePlugin2.options.installation.autoAdd
|
|
31034
|
+
}
|
|
31035
|
+
},
|
|
29734
31036
|
marketData: sitePlugin2.options.marketData,
|
|
29735
31037
|
placements: sitePlugin2.options.placements,
|
|
29736
31038
|
referenceComponentId: sitePlugin2.options.referenceComponentId
|
|
@@ -29837,4 +31139,4 @@ queue-microtask/index.js:
|
|
|
29837
31139
|
run-parallel/index.js:
|
|
29838
31140
|
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
29839
31141
|
*/
|
|
29840
|
-
//# sourceMappingURL=chunk-
|
|
31142
|
+
//# sourceMappingURL=chunk-AT5HXBVK.js.map
|