@wix/astro 2.10.1 → 2.12.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 +319 -0
- package/build/dependencies/astro-auth/browser-runtime/setup.js +1 -1
- package/build/dependencies/astro-backend-extensions/types/index.d.ts +89 -0
- package/build/dependencies/astro-backoffice-extensions/types/index.d.ts +68 -0
- package/build/dependencies/astro-core/types/index.d.ts +106 -0
- 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 -34
- 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/browser-runtime/setupContext.js +6 -10
- package/build/dependencies/astro-embedded-scripts-extensions/types/index.d.ts +18 -0
- package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.js +26 -0
- package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.js +12 -0
- package/build/dependencies/astro-site-component-panels-extensions/types/index.d.ts +21 -0
- package/build/dependencies/astro-site-components-extensions/browser-runtime/sdk.js +21 -0
- package/build/dependencies/astro-site-components-extensions/types/index.d.ts +36 -0
- package/build/dependencies/astro-site-plugins-extensions/types/index.d.ts +22 -0
- package/build/integration/builders.d.ts +322 -7
- package/build/integration/builders.js +18 -13
- package/build/integration/builders.js.map +1 -1
- package/build/integration/{chunk-JFJIM45R.js → chunk-UBCQK5ZU.js} +1859 -436
- package/build/integration/chunk-UBCQK5ZU.js.map +1 -0
- package/build/integration/index.d.ts +1 -1
- package/build/integration/index.js +28 -38
- package/build/integration/index.js.map +1 -1
- package/package.json +10 -6
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/index.d.ts +0 -11
- package/build/integration/chunk-JFJIM45R.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
|
};
|
|
@@ -326,18 +326,18 @@ var require_glob_parent = __commonJS({
|
|
|
326
326
|
var isGlob = require_is_glob();
|
|
327
327
|
var pathPosixDirname = __require("path").posix.dirname;
|
|
328
328
|
var isWin32 = __require("os").platform() === "win32";
|
|
329
|
-
var
|
|
329
|
+
var slash2 = "/";
|
|
330
330
|
var backslash = /\\/g;
|
|
331
331
|
var enclosure = /[\{\[].*[\}\]]$/;
|
|
332
332
|
var globby2 = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
333
333
|
var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
334
334
|
module2.exports = function globParent(str, opts) {
|
|
335
335
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
336
|
-
if (options.flipBackslashes && isWin32 && str.indexOf(
|
|
337
|
-
str = str.replace(backslash,
|
|
336
|
+
if (options.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) {
|
|
337
|
+
str = str.replace(backslash, slash2);
|
|
338
338
|
}
|
|
339
339
|
if (enclosure.test(str)) {
|
|
340
|
-
str +=
|
|
340
|
+
str += slash2;
|
|
341
341
|
}
|
|
342
342
|
str += "a";
|
|
343
343
|
do {
|
|
@@ -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);
|
|
@@ -3266,15 +3266,15 @@ var require_pattern = __commonJS({
|
|
|
3266
3266
|
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
3267
3267
|
function partitionAbsoluteAndRelative(patterns) {
|
|
3268
3268
|
const absolute = [];
|
|
3269
|
-
const
|
|
3269
|
+
const relative2 = [];
|
|
3270
3270
|
for (const pattern of patterns) {
|
|
3271
3271
|
if (isAbsolute(pattern)) {
|
|
3272
3272
|
absolute.push(pattern);
|
|
3273
3273
|
} else {
|
|
3274
|
-
|
|
3274
|
+
relative2.push(pattern);
|
|
3275
3275
|
}
|
|
3276
3276
|
}
|
|
3277
|
-
return [absolute,
|
|
3277
|
+
return [absolute, relative2];
|
|
3278
3278
|
}
|
|
3279
3279
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
3280
3280
|
function isAbsolute(pattern) {
|
|
@@ -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
|
});
|
|
@@ -7615,8 +7615,8 @@ var require_follow_redirects = __commonJS({
|
|
|
7615
7615
|
}
|
|
7616
7616
|
return parsed;
|
|
7617
7617
|
}
|
|
7618
|
-
function resolveUrl(
|
|
7619
|
-
return useNativeURL ? new URL2(
|
|
7618
|
+
function resolveUrl(relative2, base) {
|
|
7619
|
+
return useNativeURL ? new URL2(relative2, base) : parseUrl(url.resolve(base, relative2));
|
|
7620
7620
|
}
|
|
7621
7621
|
function validateUrl(input) {
|
|
7622
7622
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -9842,7 +9842,7 @@ var require_rimraf = __commonJS({
|
|
|
9842
9842
|
var fs4 = require_graceful_fs();
|
|
9843
9843
|
var path5 = __require("path");
|
|
9844
9844
|
var assert = __require("assert");
|
|
9845
|
-
var
|
|
9845
|
+
var isWindows = process.platform === "win32";
|
|
9846
9846
|
function defaults(options) {
|
|
9847
9847
|
const methods = [
|
|
9848
9848
|
"unlink",
|
|
@@ -9891,7 +9891,7 @@ var require_rimraf = __commonJS({
|
|
|
9891
9891
|
if (er && er.code === "ENOENT") {
|
|
9892
9892
|
return cb(null);
|
|
9893
9893
|
}
|
|
9894
|
-
if (er && er.code === "EPERM" &&
|
|
9894
|
+
if (er && er.code === "EPERM" && isWindows) {
|
|
9895
9895
|
return fixWinEPERM(p, options, er, cb);
|
|
9896
9896
|
}
|
|
9897
9897
|
if (st && st.isDirectory()) {
|
|
@@ -9903,7 +9903,7 @@ var require_rimraf = __commonJS({
|
|
|
9903
9903
|
return cb(null);
|
|
9904
9904
|
}
|
|
9905
9905
|
if (er2.code === "EPERM") {
|
|
9906
|
-
return
|
|
9906
|
+
return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
|
|
9907
9907
|
}
|
|
9908
9908
|
if (er2.code === "EISDIR") {
|
|
9909
9909
|
return rmdir(p, options, er2, cb);
|
|
@@ -10011,7 +10011,7 @@ var require_rimraf = __commonJS({
|
|
|
10011
10011
|
if (er.code === "ENOENT") {
|
|
10012
10012
|
return;
|
|
10013
10013
|
}
|
|
10014
|
-
if (er.code === "EPERM" &&
|
|
10014
|
+
if (er.code === "EPERM" && isWindows) {
|
|
10015
10015
|
fixWinEPERMSync(p, options, er);
|
|
10016
10016
|
}
|
|
10017
10017
|
}
|
|
@@ -10025,7 +10025,7 @@ var require_rimraf = __commonJS({
|
|
|
10025
10025
|
if (er.code === "ENOENT") {
|
|
10026
10026
|
return;
|
|
10027
10027
|
} else if (er.code === "EPERM") {
|
|
10028
|
-
return
|
|
10028
|
+
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
|
|
10029
10029
|
} else if (er.code !== "EISDIR") {
|
|
10030
10030
|
throw er;
|
|
10031
10031
|
}
|
|
@@ -10051,7 +10051,7 @@ var require_rimraf = __commonJS({
|
|
|
10051
10051
|
assert(p);
|
|
10052
10052
|
assert(options);
|
|
10053
10053
|
options.readdirSync(p).forEach((f) => rimrafSync(path5.join(p, f), options));
|
|
10054
|
-
if (
|
|
10054
|
+
if (isWindows) {
|
|
10055
10055
|
const startTime = Date.now();
|
|
10056
10056
|
do {
|
|
10057
10057
|
try {
|
|
@@ -10407,10 +10407,10 @@ var require_symlink = __commonJS({
|
|
|
10407
10407
|
});
|
|
10408
10408
|
}
|
|
10409
10409
|
function _createSymlink(srcpath, dstpath, type, callback) {
|
|
10410
|
-
symlinkPaths(srcpath, dstpath, (err,
|
|
10410
|
+
symlinkPaths(srcpath, dstpath, (err, relative2) => {
|
|
10411
10411
|
if (err) return callback(err);
|
|
10412
|
-
srcpath =
|
|
10413
|
-
symlinkType(
|
|
10412
|
+
srcpath = relative2.toDst;
|
|
10413
|
+
symlinkType(relative2.toCwd, type, (err2, type2) => {
|
|
10414
10414
|
if (err2) return callback(err2);
|
|
10415
10415
|
const dir = path5.dirname(dstpath);
|
|
10416
10416
|
pathExists2(dir, (err3, dirExists) => {
|
|
@@ -10435,9 +10435,9 @@ var require_symlink = __commonJS({
|
|
|
10435
10435
|
const dstStat = fs4.statSync(dstpath);
|
|
10436
10436
|
if (areIdentical(srcStat, dstStat)) return;
|
|
10437
10437
|
}
|
|
10438
|
-
const
|
|
10439
|
-
srcpath =
|
|
10440
|
-
type = symlinkTypeSync(
|
|
10438
|
+
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
10439
|
+
srcpath = relative2.toDst;
|
|
10440
|
+
type = symlinkTypeSync(relative2.toCwd, type);
|
|
10441
10441
|
const dir = path5.dirname(dstpath);
|
|
10442
10442
|
const exists = fs4.existsSync(dir);
|
|
10443
10443
|
if (exists) return fs4.symlinkSync(srcpath, dstpath, type);
|
|
@@ -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";
|
|
@@ -10852,17 +11208,10 @@ import {
|
|
|
10852
11208
|
} from "fs/promises";
|
|
10853
11209
|
import { EOL } from "os";
|
|
10854
11210
|
import { dirname } from "path";
|
|
10855
|
-
import process2 from "process";
|
|
10856
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10857
|
-
var isWindows = process2.platform === "win32";
|
|
10858
11211
|
async function clearDir(dir) {
|
|
10859
11212
|
await rm(dir, { recursive: true });
|
|
10860
11213
|
await mkdir(dir);
|
|
10861
11214
|
}
|
|
10862
|
-
function normalizePath(id) {
|
|
10863
|
-
const filePath = typeof id === "string" ? id : fileURLToPath2(id);
|
|
10864
|
-
return isWindows ? slash(filePath) : filePath;
|
|
10865
|
-
}
|
|
10866
11215
|
async function outputDir(dir) {
|
|
10867
11216
|
await mkdir(dir, { recursive: true });
|
|
10868
11217
|
}
|
|
@@ -10879,18 +11228,102 @@ async function writeFile(filePath, str) {
|
|
|
10879
11228
|
async function writeJson(filePath, object, opts = { spaces: 2 }) {
|
|
10880
11229
|
await writeFile(filePath, toJsonString(object, opts));
|
|
10881
11230
|
}
|
|
10882
|
-
function slash(path5) {
|
|
10883
|
-
return path5.replaceAll("\\", "/");
|
|
10884
|
-
}
|
|
10885
11231
|
|
|
10886
11232
|
// ../astro-backend-extensions/src/build-components/buildComponents.ts
|
|
10887
11233
|
init_esm_shims();
|
|
10888
|
-
import { join as
|
|
11234
|
+
import { join as join4 } from "path";
|
|
10889
11235
|
|
|
10890
11236
|
// ../astro-backend-extensions/src/build-components/buildServicePluginComponent.ts
|
|
10891
11237
|
init_esm_shims();
|
|
10892
11238
|
import { writeFile as writeFile2 } from "fs/promises";
|
|
11239
|
+
import { join as join2 } from "path";
|
|
11240
|
+
|
|
11241
|
+
// ../vite-utils/src/index.ts
|
|
11242
|
+
init_esm_shims();
|
|
11243
|
+
import { ok } from "assert";
|
|
10893
11244
|
import { join } from "path";
|
|
11245
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
11246
|
+
import { build as viteBuild, normalizePath as viteNormalizePath } from "vite";
|
|
11247
|
+
function appendToDevServerUrl(devServerUrl, relativePath) {
|
|
11248
|
+
const url = new URL(
|
|
11249
|
+
relativePath.replace(/^[\\/]/, "./"),
|
|
11250
|
+
devServerUrl.endsWith("/") ? devServerUrl : `${devServerUrl}/`
|
|
11251
|
+
);
|
|
11252
|
+
return url.toString();
|
|
11253
|
+
}
|
|
11254
|
+
async function build(config) {
|
|
11255
|
+
const buildOutput = await viteBuild(config);
|
|
11256
|
+
return viteBuildOutputToRollupOutputs(buildOutput);
|
|
11257
|
+
}
|
|
11258
|
+
async function buildAll(configs) {
|
|
11259
|
+
const buildOutput = [];
|
|
11260
|
+
for (const config of configs) {
|
|
11261
|
+
const result = await viteBuild(config);
|
|
11262
|
+
if (Array.isArray(result)) {
|
|
11263
|
+
buildOutput.push(...result);
|
|
11264
|
+
} else if ("output" in result) {
|
|
11265
|
+
buildOutput.push(result);
|
|
11266
|
+
}
|
|
11267
|
+
}
|
|
11268
|
+
return viteBuildOutputToRollupOutputs(buildOutput);
|
|
11269
|
+
}
|
|
11270
|
+
function getAssetForModuleId({
|
|
11271
|
+
buildOutput,
|
|
11272
|
+
moduleId
|
|
11273
|
+
}) {
|
|
11274
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.fileName === moduleId);
|
|
11275
|
+
ok(asset);
|
|
11276
|
+
return asset;
|
|
11277
|
+
}
|
|
11278
|
+
function getAssetForName({
|
|
11279
|
+
name,
|
|
11280
|
+
buildOutput
|
|
11281
|
+
}) {
|
|
11282
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.names.includes(name));
|
|
11283
|
+
ok(asset);
|
|
11284
|
+
return asset;
|
|
11285
|
+
}
|
|
11286
|
+
function getAssetUrlForModuleId({
|
|
11287
|
+
baseUrl,
|
|
11288
|
+
devServer,
|
|
11289
|
+
moduleId
|
|
11290
|
+
}) {
|
|
11291
|
+
const pathWithBase = join(devServer.config.base, "@id", `${moduleId}?import`);
|
|
11292
|
+
return appendToDevServerUrl(baseUrl, pathWithBase);
|
|
11293
|
+
}
|
|
11294
|
+
function getChunkForEntryName({
|
|
11295
|
+
buildOutput,
|
|
11296
|
+
entryName
|
|
11297
|
+
}) {
|
|
11298
|
+
const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.isEntry && x.name === entryName);
|
|
11299
|
+
ok(chunk);
|
|
11300
|
+
return chunk;
|
|
11301
|
+
}
|
|
11302
|
+
function getChunkForModuleId({
|
|
11303
|
+
buildOutput,
|
|
11304
|
+
moduleId
|
|
11305
|
+
}) {
|
|
11306
|
+
const chunk = buildOutput.filter((x) => x.type === "chunk").find((x) => x.facadeModuleId === moduleId);
|
|
11307
|
+
ok(chunk);
|
|
11308
|
+
return chunk;
|
|
11309
|
+
}
|
|
11310
|
+
function getCssFileNameFromChunk(chunk) {
|
|
11311
|
+
return chunk.viteMetadata?.importedCss.values().next().value;
|
|
11312
|
+
}
|
|
11313
|
+
function getLocalDevServerUrl(server) {
|
|
11314
|
+
const [devServerUrl] = server.resolvedUrls?.local ?? [];
|
|
11315
|
+
ok(devServerUrl != null);
|
|
11316
|
+
return devServerUrl;
|
|
11317
|
+
}
|
|
11318
|
+
function viteBuildOutputToRollupOutputs(viteBuildOutput) {
|
|
11319
|
+
const isValidRollupOutput = "output" in viteBuildOutput || Array.isArray(viteBuildOutput);
|
|
11320
|
+
ok(isValidRollupOutput);
|
|
11321
|
+
return Array.isArray(viteBuildOutput) ? viteBuildOutput.flatMap((output) => output.output) : viteBuildOutput.output;
|
|
11322
|
+
}
|
|
11323
|
+
function normalizePath(id) {
|
|
11324
|
+
const filePath = typeof id === "string" ? id : fileURLToPath2(id);
|
|
11325
|
+
return viteNormalizePath(filePath);
|
|
11326
|
+
}
|
|
10894
11327
|
|
|
10895
11328
|
// ../../node_modules/outdent/lib-module/index.js
|
|
10896
11329
|
init_esm_shims();
|
|
@@ -10937,9 +11370,9 @@ var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
|
|
|
10937
11370
|
var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
|
|
10938
11371
|
function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
|
|
10939
11372
|
var indentationLevel = 0;
|
|
10940
|
-
var
|
|
10941
|
-
if (
|
|
10942
|
-
indentationLevel =
|
|
11373
|
+
var match2 = strings[0].match(reDetectIndentation);
|
|
11374
|
+
if (match2) {
|
|
11375
|
+
indentationLevel = match2[1].length;
|
|
10943
11376
|
}
|
|
10944
11377
|
var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
|
|
10945
11378
|
var reMatchIndent = new RegExp(reSource, "g");
|
|
@@ -11037,10 +11470,10 @@ async function buildServicePluginComponent({
|
|
|
11037
11470
|
entryFileName,
|
|
11038
11471
|
srcDir
|
|
11039
11472
|
}) {
|
|
11040
|
-
const directory =
|
|
11473
|
+
const directory = join2(codegenDir, compId);
|
|
11041
11474
|
await outputDir(directory);
|
|
11042
|
-
const entrypoint =
|
|
11043
|
-
const entryFilePath =
|
|
11475
|
+
const entrypoint = join2(directory, `entry.ts`);
|
|
11476
|
+
const entryFilePath = join2(srcDir, entryFileName);
|
|
11044
11477
|
await writeFile2(
|
|
11045
11478
|
entrypoint,
|
|
11046
11479
|
defaultOutdent`
|
|
@@ -11056,7 +11489,7 @@ async function buildServicePluginComponent({
|
|
|
11056
11489
|
// ../astro-backend-extensions/src/build-components/buildWebhookComponent.ts
|
|
11057
11490
|
init_esm_shims();
|
|
11058
11491
|
import { writeFile as writeFile3 } from "fs/promises";
|
|
11059
|
-
import { join as
|
|
11492
|
+
import { join as join3 } from "path";
|
|
11060
11493
|
var setupWebhookUrl = new URL(
|
|
11061
11494
|
"../dependencies/astro-backend-extensions/backend-runtime/runtime/setupWebhook.js",
|
|
11062
11495
|
import.meta.url
|
|
@@ -11067,10 +11500,10 @@ async function buildWebhookComponent({
|
|
|
11067
11500
|
entryFileName,
|
|
11068
11501
|
srcDir
|
|
11069
11502
|
}) {
|
|
11070
|
-
const directory =
|
|
11503
|
+
const directory = join3(codegenDir, compId);
|
|
11071
11504
|
await outputDir(directory);
|
|
11072
|
-
const entrypoint =
|
|
11073
|
-
const entryFilePath =
|
|
11505
|
+
const entrypoint = join3(directory, `entry.ts`);
|
|
11506
|
+
const entryFilePath = join3(srcDir, entryFileName);
|
|
11074
11507
|
await writeFile3(
|
|
11075
11508
|
entrypoint,
|
|
11076
11509
|
defaultOutdent`
|
|
@@ -11089,8 +11522,8 @@ async function buildComponents({
|
|
|
11089
11522
|
extensions,
|
|
11090
11523
|
srcDir
|
|
11091
11524
|
}) {
|
|
11092
|
-
const webhooksCodegenDir =
|
|
11093
|
-
const servicePluginsCodegenDir =
|
|
11525
|
+
const webhooksCodegenDir = join4(codegenDir, "webhooks");
|
|
11526
|
+
const servicePluginsCodegenDir = join4(codegenDir, "service-plugins");
|
|
11094
11527
|
for (const extension of extensions) {
|
|
11095
11528
|
switch (extension.type) {
|
|
11096
11529
|
case "EcomAdditionalFees": {
|
|
@@ -11162,47 +11595,12 @@ async function buildComponents({
|
|
|
11162
11595
|
|
|
11163
11596
|
// ../astro-backend-extensions/src/utils/createExtensionManifest.ts
|
|
11164
11597
|
init_esm_shims();
|
|
11165
|
-
|
|
11166
|
-
// ../vite-utils/src/index.ts
|
|
11167
|
-
init_esm_shims();
|
|
11168
|
-
import { ok } from "assert";
|
|
11169
|
-
import { join as join4 } from "path";
|
|
11170
|
-
function appendToDevServerUrl(devServerUrl, relativePath) {
|
|
11171
|
-
const url = new URL(
|
|
11172
|
-
relativePath.replace(/^[\\/]/, "./"),
|
|
11173
|
-
devServerUrl.endsWith("/") ? devServerUrl : `${devServerUrl}/`
|
|
11174
|
-
);
|
|
11175
|
-
return url.toString();
|
|
11176
|
-
}
|
|
11177
|
-
function getAssetUrlForModuleId({
|
|
11178
|
-
baseUrl,
|
|
11179
|
-
devServer,
|
|
11180
|
-
moduleId
|
|
11181
|
-
}) {
|
|
11182
|
-
const pathWithBase = join4(devServer.config.base, "@id", `${moduleId}?import`);
|
|
11183
|
-
return appendToDevServerUrl(baseUrl, pathWithBase);
|
|
11184
|
-
}
|
|
11185
|
-
function getLocalDevServerUrl(server) {
|
|
11186
|
-
const [devServerUrl] = server.resolvedUrls?.local ?? [];
|
|
11187
|
-
ok(devServerUrl != null);
|
|
11188
|
-
return devServerUrl;
|
|
11189
|
-
}
|
|
11190
|
-
function viteBuildOutputToRollupOutputs(viteBuildOutput) {
|
|
11191
|
-
const result = [];
|
|
11192
|
-
if (Array.isArray(viteBuildOutput)) {
|
|
11193
|
-
result.push(...viteBuildOutput);
|
|
11194
|
-
} else if ("output" in viteBuildOutput) {
|
|
11195
|
-
result.push(viteBuildOutput);
|
|
11196
|
-
}
|
|
11197
|
-
return result;
|
|
11198
|
-
}
|
|
11199
|
-
|
|
11200
|
-
// ../astro-backend-extensions/src/utils/createExtensionManifest.ts
|
|
11201
11598
|
function createExtensionManifest(extension, baseUrl) {
|
|
11202
11599
|
switch (extension.type) {
|
|
11203
11600
|
case "EcomAdditionalFees": {
|
|
11204
11601
|
return {
|
|
11205
11602
|
compId: extension.options.id,
|
|
11603
|
+
compName: extension.options.name,
|
|
11206
11604
|
compType: "ECOM_ADDITIONAL_FEES",
|
|
11207
11605
|
compData: {
|
|
11208
11606
|
ecomAdditionalFees: {
|
|
@@ -11217,6 +11615,7 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11217
11615
|
case "EcomDiscountsTrigger": {
|
|
11218
11616
|
return {
|
|
11219
11617
|
compId: extension.options.id,
|
|
11618
|
+
compName: extension.options.name,
|
|
11220
11619
|
compType: "ECOM_DISCOUNTS_TRIGGER",
|
|
11221
11620
|
compData: {
|
|
11222
11621
|
ecomDiscountsTrigger: {
|
|
@@ -11231,6 +11630,7 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11231
11630
|
case "EcomGiftCardsProvider": {
|
|
11232
11631
|
return {
|
|
11233
11632
|
compId: extension.options.id,
|
|
11633
|
+
compName: extension.options.name,
|
|
11234
11634
|
compType: "GIFT_CARDS_PROVIDER",
|
|
11235
11635
|
compData: {
|
|
11236
11636
|
giftCardsProvider: {
|
|
@@ -11245,13 +11645,15 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11245
11645
|
case "EcomPaymentSettings": {
|
|
11246
11646
|
return {
|
|
11247
11647
|
compId: extension.options.id,
|
|
11648
|
+
compName: extension.options.name,
|
|
11248
11649
|
compType: "ECOM_PAYMENT_SETTINGS",
|
|
11249
11650
|
compData: {
|
|
11250
11651
|
ecomPaymentSettings: {
|
|
11251
11652
|
deploymentUri: appendToDevServerUrl(
|
|
11252
11653
|
baseUrl,
|
|
11253
11654
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11254
|
-
)
|
|
11655
|
+
),
|
|
11656
|
+
fallbackValueForRequires3dSecure: extension.options.fallbackValueForRequires3dSecure
|
|
11255
11657
|
}
|
|
11256
11658
|
}
|
|
11257
11659
|
};
|
|
@@ -11259,14 +11661,20 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11259
11661
|
case "EcomShippingRates": {
|
|
11260
11662
|
return {
|
|
11261
11663
|
compId: extension.options.id,
|
|
11664
|
+
compName: extension.options.name,
|
|
11262
11665
|
compType: "ECOM_SHIPPING_RATES",
|
|
11263
11666
|
compData: {
|
|
11264
11667
|
ecomShippingRates: {
|
|
11265
11668
|
name: extension.options.name,
|
|
11669
|
+
dashboardUrl: extension.options.dashboardUrl,
|
|
11266
11670
|
deploymentUri: appendToDevServerUrl(
|
|
11267
11671
|
baseUrl,
|
|
11268
11672
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11269
|
-
)
|
|
11673
|
+
),
|
|
11674
|
+
description: extension.options.description,
|
|
11675
|
+
fallbackDefinitionMandatory: extension.options.fallbackDefinitionMandatory,
|
|
11676
|
+
learnMoreUrl: extension.options.learnMoreUrl,
|
|
11677
|
+
thumbnailUrl: extension.options.thumbnailUrl
|
|
11270
11678
|
}
|
|
11271
11679
|
}
|
|
11272
11680
|
};
|
|
@@ -11274,13 +11682,15 @@ function createExtensionManifest(extension, baseUrl) {
|
|
|
11274
11682
|
case "EcomValidations": {
|
|
11275
11683
|
return {
|
|
11276
11684
|
compId: extension.options.id,
|
|
11685
|
+
compName: extension.options.name,
|
|
11277
11686
|
compType: "ECOM_VALIDATIONS",
|
|
11278
11687
|
compData: {
|
|
11279
11688
|
ecomValidations: {
|
|
11280
11689
|
deploymentUri: appendToDevServerUrl(
|
|
11281
11690
|
baseUrl,
|
|
11282
11691
|
`/_wix/extensions/service-plugins/${extension.options.id}`
|
|
11283
|
-
)
|
|
11692
|
+
),
|
|
11693
|
+
validateInCart: extension.options.validateInCart
|
|
11284
11694
|
}
|
|
11285
11695
|
}
|
|
11286
11696
|
};
|
|
@@ -11316,7 +11726,7 @@ import { basename } from "path";
|
|
|
11316
11726
|
|
|
11317
11727
|
// ../../node_modules/globby/index.js
|
|
11318
11728
|
init_esm_shims();
|
|
11319
|
-
import
|
|
11729
|
+
import process3 from "process";
|
|
11320
11730
|
import fs3 from "fs";
|
|
11321
11731
|
import nodePath from "path";
|
|
11322
11732
|
import { Readable } from "stream";
|
|
@@ -11596,14 +12006,14 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
11596
12006
|
init_esm_shims();
|
|
11597
12007
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
11598
12008
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
11599
|
-
import
|
|
12009
|
+
import process2 from "process";
|
|
11600
12010
|
import fs2 from "fs";
|
|
11601
12011
|
import fsPromises2 from "fs/promises";
|
|
11602
12012
|
import path3 from "path";
|
|
11603
12013
|
|
|
11604
12014
|
// ../../node_modules/slash/index.js
|
|
11605
12015
|
init_esm_shims();
|
|
11606
|
-
function
|
|
12016
|
+
function slash(path5) {
|
|
11607
12017
|
const isExtendedLengthPath = path5.startsWith("\\\\?\\");
|
|
11608
12018
|
if (isExtendedLengthPath) {
|
|
11609
12019
|
return path5;
|
|
@@ -11646,13 +12056,13 @@ var applyBaseToPattern = (pattern, base) => {
|
|
|
11646
12056
|
return isNegative ? "!" + result : result;
|
|
11647
12057
|
};
|
|
11648
12058
|
var parseIgnoreFile = (file, cwd) => {
|
|
11649
|
-
const base =
|
|
12059
|
+
const base = slash(path3.relative(cwd, path3.dirname(file.filePath)));
|
|
11650
12060
|
return file.content.split(/\r?\n/).filter((line) => line && !line.startsWith("#")).map((pattern) => applyBaseToPattern(pattern, base));
|
|
11651
12061
|
};
|
|
11652
12062
|
var toRelativePath = (fileOrDirectory, cwd) => {
|
|
11653
|
-
cwd =
|
|
12063
|
+
cwd = slash(cwd);
|
|
11654
12064
|
if (path3.isAbsolute(fileOrDirectory)) {
|
|
11655
|
-
if (
|
|
12065
|
+
if (slash(fileOrDirectory).startsWith(cwd)) {
|
|
11656
12066
|
return path3.relative(cwd, fileOrDirectory);
|
|
11657
12067
|
}
|
|
11658
12068
|
throw new Error(`Path ${fileOrDirectory} is not in cwd ${cwd}`);
|
|
@@ -11674,11 +12084,11 @@ var getIsIgnoredPredicate = (files, cwd) => {
|
|
|
11674
12084
|
if (fileOrDirectory === void 0) {
|
|
11675
12085
|
return false;
|
|
11676
12086
|
}
|
|
11677
|
-
return fileOrDirectory ? ignores.ignores(
|
|
12087
|
+
return fileOrDirectory ? ignores.ignores(slash(fileOrDirectory)) : false;
|
|
11678
12088
|
};
|
|
11679
12089
|
};
|
|
11680
12090
|
var normalizeOptions = (options = {}) => ({
|
|
11681
|
-
cwd: toPath(options.cwd) ??
|
|
12091
|
+
cwd: toPath(options.cwd) ?? process2.cwd(),
|
|
11682
12092
|
suppressErrors: Boolean(options.suppressErrors),
|
|
11683
12093
|
deep: typeof options.deep === "number" ? options.deep : Number.POSITIVE_INFINITY,
|
|
11684
12094
|
ignore: [...options.ignore ?? [], ...defaultIgnoredDirectories]
|
|
@@ -11725,11 +12135,11 @@ var normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
|
11725
12135
|
return nodePath.isAbsolute(path5) ? path5 : nodePath.join(cwd, path5);
|
|
11726
12136
|
};
|
|
11727
12137
|
var shouldExpandGlobstarDirectory = (pattern) => {
|
|
11728
|
-
const
|
|
11729
|
-
if (!
|
|
12138
|
+
const match2 = pattern?.match(/\*\*\/([^/]+)$/);
|
|
12139
|
+
if (!match2) {
|
|
11730
12140
|
return false;
|
|
11731
12141
|
}
|
|
11732
|
-
const dirname3 =
|
|
12142
|
+
const dirname3 = match2[1];
|
|
11733
12143
|
const hasWildcards = /[*?[\]{}]/.test(dirname3);
|
|
11734
12144
|
const hasExtension = nodePath.extname(dirname3) && !dirname3.startsWith(".");
|
|
11735
12145
|
return !hasWildcards && !hasExtension;
|
|
@@ -11739,7 +12149,7 @@ var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
11739
12149
|
return files ? files.map((file) => nodePath.posix.join(directoryPath, `**/${nodePath.extname(file) ? file : `${file}${extensionGlob}`}`)) : [nodePath.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
11740
12150
|
};
|
|
11741
12151
|
var directoryToGlob = async (directoryPaths, {
|
|
11742
|
-
cwd =
|
|
12152
|
+
cwd = process3.cwd(),
|
|
11743
12153
|
files,
|
|
11744
12154
|
extensions
|
|
11745
12155
|
} = {}) => {
|
|
@@ -11754,7 +12164,7 @@ var directoryToGlob = async (directoryPaths, {
|
|
|
11754
12164
|
return globs.flat();
|
|
11755
12165
|
};
|
|
11756
12166
|
var directoryToGlobSync = (directoryPaths, {
|
|
11757
|
-
cwd =
|
|
12167
|
+
cwd = process3.cwd(),
|
|
11758
12168
|
files,
|
|
11759
12169
|
extensions
|
|
11760
12170
|
} = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
@@ -12005,18 +12415,18 @@ function ecomAdditionalFees(options) {
|
|
|
12005
12415
|
};
|
|
12006
12416
|
}
|
|
12007
12417
|
|
|
12008
|
-
// ../astro-backend-extensions/src/builders/
|
|
12418
|
+
// ../astro-backend-extensions/src/builders/ecomDiscountTriggers.ts
|
|
12009
12419
|
init_esm_shims();
|
|
12010
|
-
function
|
|
12420
|
+
function ecomDiscountTriggers(options) {
|
|
12011
12421
|
return {
|
|
12012
12422
|
type: "EcomDiscountsTrigger",
|
|
12013
12423
|
options
|
|
12014
12424
|
};
|
|
12015
12425
|
}
|
|
12016
12426
|
|
|
12017
|
-
// ../astro-backend-extensions/src/builders/
|
|
12427
|
+
// ../astro-backend-extensions/src/builders/ecomGiftCards.ts
|
|
12018
12428
|
init_esm_shims();
|
|
12019
|
-
function
|
|
12429
|
+
function ecomGiftCards(options) {
|
|
12020
12430
|
return {
|
|
12021
12431
|
type: "EcomGiftCardsProvider",
|
|
12022
12432
|
options
|
|
@@ -12172,10 +12582,17 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12172
12582
|
case "BackofficeExtensionMenuPlugin": {
|
|
12173
12583
|
return {
|
|
12174
12584
|
compId: extension.options.id,
|
|
12585
|
+
compName: extension.options.title,
|
|
12175
12586
|
compType: "BACK_OFFICE_EXTENSION_MENU_ITEM",
|
|
12176
12587
|
compData: {
|
|
12177
12588
|
backOfficeExtensionMenuItem: {
|
|
12178
|
-
|
|
12589
|
+
action: extension.options.action,
|
|
12590
|
+
description: extension.options.description,
|
|
12591
|
+
extends: extension.options.extends,
|
|
12592
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12593
|
+
iconKey: extension.options.iconKey,
|
|
12594
|
+
subtitle: extension.options.subtitle,
|
|
12595
|
+
title: extension.options.title
|
|
12179
12596
|
}
|
|
12180
12597
|
}
|
|
12181
12598
|
};
|
|
@@ -12183,10 +12600,16 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12183
12600
|
case "BackofficeExtensionWidget": {
|
|
12184
12601
|
return {
|
|
12185
12602
|
compId: extension.options.id,
|
|
12603
|
+
compName: extension.options.title,
|
|
12186
12604
|
compType: "BACK_OFFICE_EXTENSION_WIDGET",
|
|
12187
12605
|
compData: {
|
|
12188
12606
|
backOfficeExtensionWidget: {
|
|
12189
|
-
|
|
12607
|
+
description: extension.options.description,
|
|
12608
|
+
extends: extension.options.extends,
|
|
12609
|
+
height: extension.options.height,
|
|
12610
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12611
|
+
iframeUrl,
|
|
12612
|
+
title: extension.options.title
|
|
12190
12613
|
}
|
|
12191
12614
|
}
|
|
12192
12615
|
};
|
|
@@ -12194,10 +12617,16 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12194
12617
|
case "BackofficeModal": {
|
|
12195
12618
|
return {
|
|
12196
12619
|
compId: extension.options.id,
|
|
12620
|
+
compName: extension.options.title,
|
|
12197
12621
|
compType: "BACK_OFFICE_MODAL",
|
|
12198
12622
|
compData: {
|
|
12199
12623
|
backOfficeModal: {
|
|
12200
|
-
|
|
12624
|
+
height: extension.options.height,
|
|
12625
|
+
hostingPlatform: "BUSINESS_MANAGER",
|
|
12626
|
+
iconKey: extension.options.iconKey,
|
|
12627
|
+
iframeUrl,
|
|
12628
|
+
title: extension.options.title,
|
|
12629
|
+
width: extension.options.width
|
|
12201
12630
|
}
|
|
12202
12631
|
}
|
|
12203
12632
|
};
|
|
@@ -12205,6 +12634,7 @@ function createExtensionManifest2(extension, baseUrl) {
|
|
|
12205
12634
|
case "BackofficePage": {
|
|
12206
12635
|
return {
|
|
12207
12636
|
compId: extension.options.id,
|
|
12637
|
+
compName: extension.options.title,
|
|
12208
12638
|
compType: "BACK_OFFICE_PAGE",
|
|
12209
12639
|
compData: {
|
|
12210
12640
|
backOfficePage: {
|
|
@@ -12520,10 +12950,10 @@ function createExtensionViteConfigFactory({
|
|
|
12520
12950
|
}) {
|
|
12521
12951
|
let initialServerPort = 6001;
|
|
12522
12952
|
return (integrationName) => {
|
|
12523
|
-
return ({ name:
|
|
12953
|
+
return ({ name: extensionName2, config: extensionConfig }) => {
|
|
12524
12954
|
ok4(astroConfig.build?.outDir != null);
|
|
12525
12955
|
const hash = createShortHash(integrationName);
|
|
12526
|
-
const extensionId = `${hash}-${
|
|
12956
|
+
const extensionId = `${hash}-${extensionName2}`;
|
|
12527
12957
|
const outputDir2 = `_wix_${extensionId}`;
|
|
12528
12958
|
const commandConfig = {};
|
|
12529
12959
|
if (command === "serve") {
|
|
@@ -12537,9 +12967,15 @@ function createExtensionViteConfigFactory({
|
|
|
12537
12967
|
outDir: astroConfig.build.outDir,
|
|
12538
12968
|
rollupOptions: {
|
|
12539
12969
|
output: {
|
|
12540
|
-
assetFileNames:
|
|
12541
|
-
|
|
12542
|
-
|
|
12970
|
+
assetFileNames: normalizePath(
|
|
12971
|
+
join7(outputDir2, `[name]-[hash][extname]`)
|
|
12972
|
+
),
|
|
12973
|
+
chunkFileNames: normalizePath(
|
|
12974
|
+
join7(outputDir2, `[name]-[hash].js`)
|
|
12975
|
+
),
|
|
12976
|
+
entryFileNames: normalizePath(
|
|
12977
|
+
join7(outputDir2, `[name]-[hash].js`)
|
|
12978
|
+
),
|
|
12543
12979
|
format: "esm"
|
|
12544
12980
|
}
|
|
12545
12981
|
},
|
|
@@ -12768,16 +13204,16 @@ var ansi_styles_default = ansiStyles;
|
|
|
12768
13204
|
|
|
12769
13205
|
// ../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
12770
13206
|
init_esm_shims();
|
|
12771
|
-
import
|
|
13207
|
+
import process4 from "process";
|
|
12772
13208
|
import os from "os";
|
|
12773
13209
|
import tty from "tty";
|
|
12774
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
13210
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process4.argv) {
|
|
12775
13211
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
12776
13212
|
const position = argv.indexOf(prefix + flag);
|
|
12777
13213
|
const terminatorPosition = argv.indexOf("--");
|
|
12778
13214
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
12779
13215
|
}
|
|
12780
|
-
var { env } =
|
|
13216
|
+
var { env } = process4;
|
|
12781
13217
|
var flagForceColor;
|
|
12782
13218
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
12783
13219
|
flagForceColor = 0;
|
|
@@ -12833,7 +13269,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
12833
13269
|
if (env.TERM === "dumb") {
|
|
12834
13270
|
return min;
|
|
12835
13271
|
}
|
|
12836
|
-
if (
|
|
13272
|
+
if (process4.platform === "win32") {
|
|
12837
13273
|
const osRelease = os.release().split(".");
|
|
12838
13274
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
12839
13275
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
@@ -13117,18 +13553,21 @@ var Model = class extends EventEmitter {
|
|
|
13117
13553
|
appId;
|
|
13118
13554
|
env;
|
|
13119
13555
|
extensions;
|
|
13556
|
+
srcDir;
|
|
13120
13557
|
server;
|
|
13121
13558
|
constructor({
|
|
13122
13559
|
appId,
|
|
13123
13560
|
env: env2,
|
|
13124
13561
|
extensions,
|
|
13125
|
-
server
|
|
13562
|
+
server,
|
|
13563
|
+
srcDir
|
|
13126
13564
|
}) {
|
|
13127
13565
|
super();
|
|
13128
13566
|
this.appId = appId;
|
|
13129
13567
|
this.env = env2;
|
|
13130
13568
|
this.extensions = extensions;
|
|
13131
13569
|
this.server = server;
|
|
13570
|
+
this.srcDir = srcDir;
|
|
13132
13571
|
this.server.watcher.on("change", async () => {
|
|
13133
13572
|
this.extensions = await loadExtensions(this.server);
|
|
13134
13573
|
this.emit("change");
|
|
@@ -13151,7 +13590,8 @@ async function createModel({
|
|
|
13151
13590
|
appId,
|
|
13152
13591
|
env: env2,
|
|
13153
13592
|
extensions,
|
|
13154
|
-
server
|
|
13593
|
+
server,
|
|
13594
|
+
srcDir
|
|
13155
13595
|
});
|
|
13156
13596
|
return model;
|
|
13157
13597
|
}
|
|
@@ -13212,7 +13652,7 @@ var createIntegration3 = ({
|
|
|
13212
13652
|
let astroServer;
|
|
13213
13653
|
const devServersToProxy = /* @__PURE__ */ new Set();
|
|
13214
13654
|
return {
|
|
13215
|
-
name: "@wix/astro
|
|
13655
|
+
name: "@wix/astro",
|
|
13216
13656
|
hooks: {
|
|
13217
13657
|
async "astro:config:setup"({
|
|
13218
13658
|
config: astroConfig,
|
|
@@ -13247,7 +13687,6 @@ var createIntegration3 = ({
|
|
|
13247
13687
|
domains: ["static.wixstatic.com"],
|
|
13248
13688
|
service: passthroughImageService()
|
|
13249
13689
|
},
|
|
13250
|
-
integrations,
|
|
13251
13690
|
vite: {
|
|
13252
13691
|
optimizeDeps: {
|
|
13253
13692
|
include: [
|
|
@@ -13387,7 +13826,7 @@ init_esm_shims();
|
|
|
13387
13826
|
init_esm_shims();
|
|
13388
13827
|
import { ok as ok7 } from "assert";
|
|
13389
13828
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
13390
|
-
import {
|
|
13829
|
+
import { createServer as createServer2 } from "vite";
|
|
13391
13830
|
|
|
13392
13831
|
// ../astro-custom-elements-extensions/src/utils/filterSupportedExtensions.ts
|
|
13393
13832
|
init_esm_shims();
|
|
@@ -13397,7 +13836,6 @@ function filterSupportedExtensions3(extension) {
|
|
|
13397
13836
|
|
|
13398
13837
|
// ../astro-custom-elements-extensions/src/utils/getAssetUrl.ts
|
|
13399
13838
|
init_esm_shims();
|
|
13400
|
-
import { ok as ok6 } from "assert";
|
|
13401
13839
|
import { join as join9 } from "path";
|
|
13402
13840
|
function getAssetUrl({
|
|
13403
13841
|
buildOutput,
|
|
@@ -13405,7 +13843,7 @@ function getAssetUrl({
|
|
|
13405
13843
|
viteDevServer
|
|
13406
13844
|
}) {
|
|
13407
13845
|
if (buildOutput) {
|
|
13408
|
-
return
|
|
13846
|
+
return getAssetForModuleId({ buildOutput, moduleId: fileName }).fileName;
|
|
13409
13847
|
}
|
|
13410
13848
|
if (viteDevServer) {
|
|
13411
13849
|
return getAssetUrlForDevServer({ fileName, viteDevServer });
|
|
@@ -13416,19 +13854,41 @@ function getAssetUrlForDevServer({
|
|
|
13416
13854
|
fileName,
|
|
13417
13855
|
viteDevServer
|
|
13418
13856
|
}) {
|
|
13419
|
-
return join9(viteDevServer.config.base,
|
|
13857
|
+
return join9(viteDevServer.config.base, fileName);
|
|
13858
|
+
}
|
|
13859
|
+
|
|
13860
|
+
// ../astro-custom-elements-extensions/src/utils/getChunkUrl.ts
|
|
13861
|
+
init_esm_shims();
|
|
13862
|
+
import { join as join10 } from "path";
|
|
13863
|
+
function getChunkUrl({
|
|
13864
|
+
buildOutput,
|
|
13865
|
+
fileName,
|
|
13866
|
+
viteDevServer
|
|
13867
|
+
}) {
|
|
13868
|
+
if (buildOutput) {
|
|
13869
|
+
return getChunkUrlForBuildOutput({ buildOutput, fileName });
|
|
13870
|
+
}
|
|
13871
|
+
if (viteDevServer) {
|
|
13872
|
+
return getChunkUrlForDevServer({ fileName, viteDevServer });
|
|
13873
|
+
}
|
|
13874
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
13420
13875
|
}
|
|
13421
13876
|
function getChunkUrlForBuildOutput({
|
|
13422
13877
|
buildOutput,
|
|
13423
13878
|
fileName
|
|
13424
13879
|
}) {
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13880
|
+
return getChunkForModuleId({ buildOutput, moduleId: fileName }).fileName;
|
|
13881
|
+
}
|
|
13882
|
+
function getChunkUrlForDevServer({
|
|
13883
|
+
fileName,
|
|
13884
|
+
viteDevServer
|
|
13885
|
+
}) {
|
|
13886
|
+
return join10(viteDevServer.config.base, "@id", `${fileName}?import`);
|
|
13428
13887
|
}
|
|
13429
13888
|
|
|
13430
|
-
// ../astro-custom-elements-extensions/src/
|
|
13889
|
+
// ../astro-custom-elements-extensions/src/vite/getViteConfig.ts
|
|
13431
13890
|
init_esm_shims();
|
|
13891
|
+
import { join as join12 } from "path";
|
|
13432
13892
|
|
|
13433
13893
|
// ../../node_modules/vite-plugin-externals/dist/es/src/index.js
|
|
13434
13894
|
init_esm_shims();
|
|
@@ -13928,12 +14388,12 @@ MagicString.prototype.indent = function indent(indentStr, options) {
|
|
|
13928
14388
|
});
|
|
13929
14389
|
}
|
|
13930
14390
|
var shouldIndentNextCharacter = options.indentStart !== false;
|
|
13931
|
-
var replacer = function(
|
|
14391
|
+
var replacer = function(match2) {
|
|
13932
14392
|
if (shouldIndentNextCharacter) {
|
|
13933
|
-
return "" + indentStr +
|
|
14393
|
+
return "" + indentStr + match2;
|
|
13934
14394
|
}
|
|
13935
14395
|
shouldIndentNextCharacter = true;
|
|
13936
|
-
return
|
|
14396
|
+
return match2;
|
|
13937
14397
|
};
|
|
13938
14398
|
this.intro = this.intro.replace(pattern, replacer);
|
|
13939
14399
|
var charIndex = 0;
|
|
@@ -14555,8 +15015,8 @@ Bundle.prototype.indent = function indent2(indentStr) {
|
|
|
14555
15015
|
trailingNewline = source.content.lastChar() === "\n";
|
|
14556
15016
|
});
|
|
14557
15017
|
if (this.intro) {
|
|
14558
|
-
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, function(
|
|
14559
|
-
return index > 0 ? indentStr +
|
|
15018
|
+
this.intro = indentStr + this.intro.replace(/^[^\n]/gm, function(match2, index) {
|
|
15019
|
+
return index > 0 ? indentStr + match2 : match2;
|
|
14560
15020
|
});
|
|
14561
15021
|
}
|
|
14562
15022
|
return this;
|
|
@@ -15273,17 +15733,17 @@ pp$9.strictDirective = function(start) {
|
|
|
15273
15733
|
for (; ; ) {
|
|
15274
15734
|
skipWhiteSpace.lastIndex = start;
|
|
15275
15735
|
start += skipWhiteSpace.exec(this.input)[0].length;
|
|
15276
|
-
var
|
|
15277
|
-
if (!
|
|
15736
|
+
var match2 = literal.exec(this.input.slice(start));
|
|
15737
|
+
if (!match2) {
|
|
15278
15738
|
return false;
|
|
15279
15739
|
}
|
|
15280
|
-
if ((
|
|
15281
|
-
skipWhiteSpace.lastIndex = start +
|
|
15740
|
+
if ((match2[1] || match2[2]) === "use strict") {
|
|
15741
|
+
skipWhiteSpace.lastIndex = start + match2[0].length;
|
|
15282
15742
|
var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
|
|
15283
15743
|
var next = this.input.charAt(end);
|
|
15284
15744
|
return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
|
|
15285
15745
|
}
|
|
15286
|
-
start +=
|
|
15746
|
+
start += match2[0].length;
|
|
15287
15747
|
skipWhiteSpace.lastIndex = start;
|
|
15288
15748
|
start += skipWhiteSpace.exec(this.input)[0].length;
|
|
15289
15749
|
if (this.input[start] === ";") {
|
|
@@ -20523,43 +20983,152 @@ function compatSsrInOptions(options) {
|
|
|
20523
20983
|
return (_a2 = options === null || options === void 0 ? void 0 : options.ssr) !== null && _a2 !== void 0 ? _a2 : false;
|
|
20524
20984
|
}
|
|
20525
20985
|
|
|
20526
|
-
// ../astro-custom-elements-extensions/src/
|
|
20986
|
+
// ../astro-custom-elements-extensions/src/vite/viteWrapCustomElementPlugin.ts
|
|
20527
20987
|
init_esm_shims();
|
|
20528
|
-
import
|
|
20529
|
-
|
|
20530
|
-
|
|
20531
|
-
|
|
20988
|
+
import React from "react";
|
|
20989
|
+
import ReactDOM from "react-dom";
|
|
20990
|
+
import { ok as ok6 } from "assert";
|
|
20991
|
+
import { join as join11, parse as parse4 } from "path";
|
|
20992
|
+
import { send } from "vite";
|
|
20993
|
+
var wrapCustomElementPath = normalizePath(
|
|
20994
|
+
new URL(
|
|
20995
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js",
|
|
20996
|
+
import.meta.url
|
|
20997
|
+
)
|
|
20998
|
+
);
|
|
20999
|
+
var renderSettingsPanelPath = normalizePath(
|
|
21000
|
+
new URL(
|
|
21001
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js",
|
|
21002
|
+
import.meta.url
|
|
21003
|
+
)
|
|
21004
|
+
);
|
|
21005
|
+
var reactHmrPath = normalizePath(
|
|
21006
|
+
new URL(
|
|
21007
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js",
|
|
21008
|
+
import.meta.url
|
|
21009
|
+
)
|
|
21010
|
+
);
|
|
21011
|
+
var customElementHmrPath = normalizePath(
|
|
21012
|
+
new URL(
|
|
21013
|
+
"../dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.js",
|
|
21014
|
+
import.meta.url
|
|
21015
|
+
)
|
|
20532
21016
|
);
|
|
20533
21017
|
function viteWrapCustomElementPlugin({
|
|
20534
21018
|
getExtensions,
|
|
21019
|
+
mode,
|
|
20535
21020
|
srcDir
|
|
20536
21021
|
}) {
|
|
20537
|
-
const getExtensionForModuleId = (
|
|
20538
|
-
const { name: baseId } = parse4(id);
|
|
21022
|
+
const getExtensionForModuleId = (baseId) => {
|
|
20539
21023
|
const result = getExtensions().find(
|
|
20540
21024
|
(extension) => extension.options.id === baseId
|
|
20541
21025
|
);
|
|
20542
21026
|
return result;
|
|
20543
21027
|
};
|
|
21028
|
+
const reactFileSuffix = mode === "build" ? "production.min.js" : "development.js";
|
|
21029
|
+
const reactTemplate = defaultOutdent`
|
|
21030
|
+
<script crossorigin src="https://static.parastorage.com/unpkg/react@${React.version}/umd/react.${reactFileSuffix}"></script>
|
|
21031
|
+
<script crossorigin src="https://static.parastorage.com/unpkg/react-dom@${ReactDOM.version}/umd/react-dom.${reactFileSuffix}"></script>
|
|
21032
|
+
`;
|
|
21033
|
+
const htmlTemplate = (setupCode) => {
|
|
21034
|
+
return defaultOutdent`
|
|
21035
|
+
<!DOCTYPE html>
|
|
21036
|
+
<html>
|
|
21037
|
+
<head>
|
|
21038
|
+
<meta charset="UTF-8" />
|
|
21039
|
+
<title>Settings Panel</title>
|
|
21040
|
+
</head>
|
|
21041
|
+
<body style="margin: 0">
|
|
21042
|
+
<div id="root"></div>
|
|
21043
|
+
${reactTemplate}
|
|
21044
|
+
<script type="module">
|
|
21045
|
+
${setupCode}
|
|
21046
|
+
</script>
|
|
21047
|
+
</body>
|
|
21048
|
+
</html>
|
|
21049
|
+
`;
|
|
21050
|
+
};
|
|
20544
21051
|
return {
|
|
20545
21052
|
name: "vite-wrap-custom-element-plugin",
|
|
20546
|
-
|
|
20547
|
-
|
|
20548
|
-
|
|
20549
|
-
|
|
20550
|
-
|
|
21053
|
+
configureServer: async (server) => {
|
|
21054
|
+
server.middlewares.use(async (req, res, next) => {
|
|
21055
|
+
ok6(req.url != null);
|
|
21056
|
+
const parsedId = parseId(req.url.replace(server.config.base, ""));
|
|
21057
|
+
if (parsedId == null) {
|
|
21058
|
+
return next();
|
|
21059
|
+
}
|
|
21060
|
+
const { baseId, extension } = parsedId;
|
|
21061
|
+
if (extension === ".html") {
|
|
21062
|
+
const customElement2 = getExtensionForModuleId(baseId);
|
|
21063
|
+
if (customElement2?.options.settings != null) {
|
|
21064
|
+
const filePath = join11(srcDir, customElement2.options.settings);
|
|
21065
|
+
const transformedHtml = await server.transformIndexHtml(
|
|
21066
|
+
baseId,
|
|
21067
|
+
htmlTemplate(defaultOutdent`
|
|
21068
|
+
import { createComponentHmrWrapper } from '${reactHmrPath}';
|
|
21069
|
+
import { renderSettingsPanel } from '${renderSettingsPanelPath}';
|
|
21070
|
+
import SettingsPanel from '${normalizePath(filePath)}';
|
|
21071
|
+
|
|
21072
|
+
let WrappedComponent = SettingsPanel;
|
|
21073
|
+
|
|
21074
|
+
if (import.meta.hot) {
|
|
21075
|
+
import.meta.hot.accept('${normalizePath(filePath)}', (newModule) => {
|
|
21076
|
+
if (newModule?.default) {
|
|
21077
|
+
import.meta.hot.data.setComponent?.(newModule?.default);
|
|
21078
|
+
}
|
|
21079
|
+
});
|
|
21080
|
+
|
|
21081
|
+
WrappedComponent = createComponentHmrWrapper(SettingsPanel, import.meta.hot.data);
|
|
21082
|
+
}
|
|
21083
|
+
|
|
21084
|
+
renderSettingsPanel(WrappedComponent);
|
|
21085
|
+
`)
|
|
21086
|
+
);
|
|
21087
|
+
return send(req, res, transformedHtml, "html", {
|
|
21088
|
+
headers: server.config.server.headers
|
|
21089
|
+
});
|
|
21090
|
+
}
|
|
21091
|
+
throw new Error("Unexpected configuration");
|
|
21092
|
+
}
|
|
21093
|
+
return next();
|
|
21094
|
+
});
|
|
21095
|
+
},
|
|
21096
|
+
load: {
|
|
21097
|
+
handler(id) {
|
|
21098
|
+
const parsedId = parseId(id);
|
|
21099
|
+
if (parsedId == null) {
|
|
21100
|
+
return;
|
|
21101
|
+
}
|
|
21102
|
+
const { baseId, extension } = parsedId;
|
|
21103
|
+
if (extension === ".html") {
|
|
21104
|
+
const customElement3 = getExtensionForModuleId(baseId);
|
|
21105
|
+
if (customElement3?.options.settings != null) {
|
|
21106
|
+
const filePath = join11(srcDir, customElement3.options.settings);
|
|
21107
|
+
return htmlTemplate(defaultOutdent`
|
|
21108
|
+
import { renderSettingsPanel } from '${renderSettingsPanelPath}';
|
|
21109
|
+
import SettingsPanel from '${normalizePath(filePath)}';
|
|
21110
|
+
|
|
21111
|
+
renderSettingsPanel(SettingsPanel);
|
|
21112
|
+
`);
|
|
21113
|
+
}
|
|
21114
|
+
throw new Error("Unexpected configuration");
|
|
21115
|
+
}
|
|
21116
|
+
const customElement2 = getExtensionForModuleId(baseId);
|
|
21117
|
+
if (customElement2) {
|
|
21118
|
+
const filePath = join11(srcDir, customElement2.options.element);
|
|
20551
21119
|
return defaultOutdent`
|
|
20552
21120
|
import CustomElement from '${normalizePath(filePath)}';
|
|
20553
|
-
import { wrapCustomElement
|
|
21121
|
+
import { wrapCustomElement } from '${wrapCustomElementPath}';
|
|
21122
|
+
import { customElementHmr } from '${customElementHmrPath}';
|
|
20554
21123
|
|
|
20555
21124
|
if (import.meta.hot) {
|
|
20556
21125
|
import.meta.hot.accept(() => {});
|
|
20557
21126
|
import.meta.hot.accept(
|
|
20558
21127
|
'${normalizePath(filePath)}',
|
|
20559
21128
|
function({ default: NewCustomElement }) {
|
|
20560
|
-
|
|
21129
|
+
customElementHmr({
|
|
20561
21130
|
customElement: NewCustomElement,
|
|
20562
|
-
tagName: '${
|
|
21131
|
+
tagName: '${customElement2.options.tagName}',
|
|
20563
21132
|
});
|
|
20564
21133
|
}
|
|
20565
21134
|
);
|
|
@@ -20567,7 +21136,7 @@ function viteWrapCustomElementPlugin({
|
|
|
20567
21136
|
|
|
20568
21137
|
wrapCustomElement({
|
|
20569
21138
|
customElement: CustomElement,
|
|
20570
|
-
tagName: '${
|
|
21139
|
+
tagName: '${customElement2.options.tagName}',
|
|
20571
21140
|
});
|
|
20572
21141
|
`;
|
|
20573
21142
|
}
|
|
@@ -20576,7 +21145,8 @@ function viteWrapCustomElementPlugin({
|
|
|
20576
21145
|
order: "pre"
|
|
20577
21146
|
},
|
|
20578
21147
|
resolveId(id) {
|
|
20579
|
-
const
|
|
21148
|
+
const { name: baseId } = parse4(id);
|
|
21149
|
+
const extension = getExtensionForModuleId(baseId);
|
|
20580
21150
|
if (extension) {
|
|
20581
21151
|
return id;
|
|
20582
21152
|
}
|
|
@@ -20584,16 +21154,40 @@ function viteWrapCustomElementPlugin({
|
|
|
20584
21154
|
}
|
|
20585
21155
|
};
|
|
20586
21156
|
}
|
|
21157
|
+
function parseId(id) {
|
|
21158
|
+
const [rawId, query] = id.split("?");
|
|
21159
|
+
const params = new URLSearchParams(query);
|
|
21160
|
+
if (params.get("index") != null) {
|
|
21161
|
+
return null;
|
|
21162
|
+
}
|
|
21163
|
+
ok6(rawId != null);
|
|
21164
|
+
const { name: baseId, ext: extension } = parse4(rawId);
|
|
21165
|
+
return {
|
|
21166
|
+
baseId,
|
|
21167
|
+
extension
|
|
21168
|
+
};
|
|
21169
|
+
}
|
|
20587
21170
|
|
|
20588
|
-
// ../astro-custom-elements-extensions/src/
|
|
21171
|
+
// ../astro-custom-elements-extensions/src/vite/getViteConfig.ts
|
|
20589
21172
|
function getViteConfig({
|
|
20590
21173
|
createExtensionViteConfig,
|
|
20591
21174
|
getExtensions,
|
|
21175
|
+
mode,
|
|
21176
|
+
rootDir,
|
|
20592
21177
|
srcDir
|
|
20593
21178
|
}) {
|
|
20594
|
-
const input = getExtensions().
|
|
20595
|
-
|
|
20596
|
-
|
|
21179
|
+
const input = getExtensions().flatMap((extension) => {
|
|
21180
|
+
const entries = [`${extension.options.id}.js`];
|
|
21181
|
+
if (extension.options.settings != null) {
|
|
21182
|
+
entries.push(
|
|
21183
|
+
join12(rootDir, `custom-element-panels/${extension.options.id}.html`)
|
|
21184
|
+
);
|
|
21185
|
+
}
|
|
21186
|
+
return entries;
|
|
21187
|
+
});
|
|
21188
|
+
const extensionsPaths = getExtensions().map((extension) => {
|
|
21189
|
+
return join12(srcDir, extension.options.element);
|
|
21190
|
+
});
|
|
20597
21191
|
return createExtensionViteConfig({
|
|
20598
21192
|
name: "custom-elements",
|
|
20599
21193
|
config: {
|
|
@@ -20602,8 +21196,17 @@ function getViteConfig({
|
|
|
20602
21196
|
input
|
|
20603
21197
|
}
|
|
20604
21198
|
},
|
|
21199
|
+
optimizeDeps: {
|
|
21200
|
+
entries: [
|
|
21201
|
+
customElementHmrPath,
|
|
21202
|
+
wrapCustomElementPath,
|
|
21203
|
+
reactHmrPath,
|
|
21204
|
+
renderSettingsPanelPath,
|
|
21205
|
+
...extensionsPaths
|
|
21206
|
+
]
|
|
21207
|
+
},
|
|
20605
21208
|
plugins: [
|
|
20606
|
-
viteWrapCustomElementPlugin({ getExtensions, srcDir }),
|
|
21209
|
+
viteWrapCustomElementPlugin({ getExtensions, mode, srcDir }),
|
|
20607
21210
|
viteExternalsPlugin({
|
|
20608
21211
|
react: "React",
|
|
20609
21212
|
"react-dom": "ReactDOM"
|
|
@@ -20643,10 +21246,13 @@ var createIntegration4 = () => {
|
|
|
20643
21246
|
}) {
|
|
20644
21247
|
ok7(extensions);
|
|
20645
21248
|
ok7(srcDir != null);
|
|
21249
|
+
ok7(rootDir != null);
|
|
20646
21250
|
customDevServer = await createServer2(
|
|
20647
21251
|
getViteConfig({
|
|
20648
21252
|
createExtensionViteConfig,
|
|
20649
21253
|
getExtensions,
|
|
21254
|
+
mode: "dev",
|
|
21255
|
+
rootDir,
|
|
20650
21256
|
srcDir
|
|
20651
21257
|
})
|
|
20652
21258
|
);
|
|
@@ -20663,16 +21269,16 @@ var createIntegration4 = () => {
|
|
|
20663
21269
|
return;
|
|
20664
21270
|
}
|
|
20665
21271
|
ok7(srcDir != null);
|
|
20666
|
-
|
|
21272
|
+
ok7(rootDir != null);
|
|
21273
|
+
customBuildOutput = await build(
|
|
20667
21274
|
getViteConfig({
|
|
20668
21275
|
createExtensionViteConfig,
|
|
20669
21276
|
getExtensions,
|
|
21277
|
+
mode: "build",
|
|
21278
|
+
rootDir,
|
|
20670
21279
|
srcDir
|
|
20671
21280
|
})
|
|
20672
21281
|
);
|
|
20673
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
20674
|
-
ok7(clientOutput);
|
|
20675
|
-
customBuildOutput = clientOutput;
|
|
20676
21282
|
},
|
|
20677
21283
|
async "wix:app-manifest:setup"({
|
|
20678
21284
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
@@ -20685,7 +21291,7 @@ var createIntegration4 = () => {
|
|
|
20685
21291
|
for (const extension of extensions) {
|
|
20686
21292
|
const scriptUrl = appendToDevServerUrl(
|
|
20687
21293
|
staticsUrlPlaceholder2,
|
|
20688
|
-
|
|
21294
|
+
getChunkUrl({
|
|
20689
21295
|
buildOutput: customBuildOutput,
|
|
20690
21296
|
fileName: `${extension.options.id}.js`,
|
|
20691
21297
|
viteDevServer: customDevServer
|
|
@@ -20697,12 +21303,37 @@ var createIntegration4 = () => {
|
|
|
20697
21303
|
compType: "CUSTOM_ELEMENT_WIDGET",
|
|
20698
21304
|
compData: {
|
|
20699
21305
|
customElementWidget: {
|
|
20700
|
-
base:
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
21306
|
+
base: {
|
|
21307
|
+
name: extension.options.name
|
|
21308
|
+
},
|
|
21309
|
+
behaviors: {
|
|
21310
|
+
...extension.options.behaviors,
|
|
21311
|
+
...extension.options.settings != null ? {
|
|
21312
|
+
settings: {
|
|
21313
|
+
settingsUrl: appendToDevServerUrl(
|
|
21314
|
+
staticsUrlPlaceholder2,
|
|
21315
|
+
getAssetUrl({
|
|
21316
|
+
buildOutput: customBuildOutput,
|
|
21317
|
+
fileName: `custom-element-panels/${extension.options.id}.html`,
|
|
21318
|
+
viteDevServer: customDevServer
|
|
21319
|
+
})
|
|
21320
|
+
)
|
|
21321
|
+
}
|
|
21322
|
+
} : {}
|
|
21323
|
+
},
|
|
21324
|
+
dependencies: [],
|
|
21325
|
+
// TODO: frontend dependencies
|
|
21326
|
+
installation: {
|
|
21327
|
+
base: {
|
|
21328
|
+
autoAdd: extension.options.installation.autoAdd,
|
|
21329
|
+
essential: extension.options.installation.essential
|
|
21330
|
+
}
|
|
21331
|
+
},
|
|
20704
21332
|
presets: extension.options.presets ?? [],
|
|
20705
|
-
size:
|
|
21333
|
+
size: {
|
|
21334
|
+
height: extension.options.height,
|
|
21335
|
+
width: extension.options.width
|
|
21336
|
+
},
|
|
20706
21337
|
widgetData: {
|
|
20707
21338
|
scriptType: "ES_MODULE",
|
|
20708
21339
|
scriptUrl,
|
|
@@ -20738,7 +21369,7 @@ import { ok as ok10 } from "assert";
|
|
|
20738
21369
|
import {
|
|
20739
21370
|
dirname as dirname2,
|
|
20740
21371
|
isAbsolute as isAbsolutePath,
|
|
20741
|
-
join as
|
|
21372
|
+
join as join15,
|
|
20742
21373
|
relative
|
|
20743
21374
|
} from "path";
|
|
20744
21375
|
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
@@ -28607,15 +29238,15 @@ var getCodePoint = (
|
|
|
28607
29238
|
);
|
|
28608
29239
|
function getEscaper(regex, map) {
|
|
28609
29240
|
return function escape(data2) {
|
|
28610
|
-
let
|
|
29241
|
+
let match2;
|
|
28611
29242
|
let lastIndex = 0;
|
|
28612
29243
|
let result = "";
|
|
28613
|
-
while (
|
|
28614
|
-
if (lastIndex !==
|
|
28615
|
-
result += data2.substring(lastIndex,
|
|
29244
|
+
while (match2 = regex.exec(data2)) {
|
|
29245
|
+
if (lastIndex !== match2.index) {
|
|
29246
|
+
result += data2.substring(lastIndex, match2.index);
|
|
28616
29247
|
}
|
|
28617
|
-
result += map.get(
|
|
28618
|
-
lastIndex =
|
|
29248
|
+
result += map.get(match2[0].charCodeAt(0));
|
|
29249
|
+
lastIndex = match2.index + 1;
|
|
28619
29250
|
}
|
|
28620
29251
|
return result + data2.substring(lastIndex);
|
|
28621
29252
|
};
|
|
@@ -28753,7 +29384,7 @@ function parseFragment(fragmentContext, html, options) {
|
|
|
28753
29384
|
}
|
|
28754
29385
|
|
|
28755
29386
|
// ../astro-embedded-scripts-extensions/src/integration.ts
|
|
28756
|
-
import {
|
|
29387
|
+
import { createServer as createServer3 } from "vite";
|
|
28757
29388
|
|
|
28758
29389
|
// ../astro-embedded-scripts-extensions/src/utils/filterSupportedExtensions.ts
|
|
28759
29390
|
init_esm_shims();
|
|
@@ -28790,46 +29421,130 @@ function getAssetContentFromBuildOutput({
|
|
|
28790
29421
|
buildOutput,
|
|
28791
29422
|
fileName
|
|
28792
29423
|
}) {
|
|
28793
|
-
const asset = buildOutput.
|
|
29424
|
+
const asset = buildOutput.filter((x) => x.type === "asset").find((x) => x.fileName === normalizePath(fileName));
|
|
28794
29425
|
ok8(asset);
|
|
28795
29426
|
return asset.source.toString();
|
|
28796
29427
|
}
|
|
28797
29428
|
|
|
28798
29429
|
// ../astro-embedded-scripts-extensions/src/utils/getViteConfig.ts
|
|
28799
29430
|
init_esm_shims();
|
|
28800
|
-
import { join as
|
|
29431
|
+
import { join as join14 } from "path";
|
|
28801
29432
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
28802
29433
|
|
|
28803
29434
|
// ../astro-embedded-scripts-extensions/src/utils/viteSdkSupportPlugin.ts
|
|
28804
29435
|
init_esm_shims();
|
|
28805
29436
|
import { ok as ok9 } from "assert";
|
|
28806
|
-
import { join as
|
|
29437
|
+
import { join as join13 } from "path";
|
|
28807
29438
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
29439
|
+
|
|
29440
|
+
// ../astro-embedded-scripts-extensions/src/utils/htmlUtils.ts
|
|
29441
|
+
init_esm_shims();
|
|
29442
|
+
function traverseModuleElements(node, visitor) {
|
|
29443
|
+
traverseNodes(node, (child) => {
|
|
29444
|
+
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
29445
|
+
child.attrs.some(
|
|
29446
|
+
(attr) => attr.name === "type" && attr.value === "module"
|
|
29447
|
+
) && // no inline scripts
|
|
29448
|
+
child.attrs.some((attr) => attr.name === "src")) {
|
|
29449
|
+
visitor(child);
|
|
29450
|
+
}
|
|
29451
|
+
if (nodeIsElement(child) && child.nodeName === "link" && // only modules
|
|
29452
|
+
child.attrs.some(
|
|
29453
|
+
(attr) => attr.name === "rel" && attr.value === "modulepreload"
|
|
29454
|
+
)) {
|
|
29455
|
+
visitor(child);
|
|
29456
|
+
}
|
|
29457
|
+
});
|
|
29458
|
+
}
|
|
29459
|
+
function traverseModuleScripts(node, visitor) {
|
|
29460
|
+
traverseNodes(node, (child) => {
|
|
29461
|
+
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
29462
|
+
child.attrs.some(
|
|
29463
|
+
(attr) => attr.name === "type" && attr.value === "module"
|
|
29464
|
+
)) {
|
|
29465
|
+
visitor(child);
|
|
29466
|
+
}
|
|
29467
|
+
});
|
|
29468
|
+
}
|
|
29469
|
+
function nodeIsElement(node) {
|
|
29470
|
+
return node.nodeName[0] !== "#";
|
|
29471
|
+
}
|
|
29472
|
+
function traverseNodes(node, visitor) {
|
|
29473
|
+
if (node.nodeName === "template") {
|
|
29474
|
+
node = node.content;
|
|
29475
|
+
}
|
|
29476
|
+
visitor(node);
|
|
29477
|
+
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") {
|
|
29478
|
+
for (const childNode of node.childNodes) {
|
|
29479
|
+
traverseNodes(childNode, visitor);
|
|
29480
|
+
}
|
|
29481
|
+
}
|
|
29482
|
+
}
|
|
29483
|
+
|
|
29484
|
+
// ../astro-embedded-scripts-extensions/src/utils/viteSdkSupportPlugin.ts
|
|
28808
29485
|
var setupContextUrl = new URL(
|
|
28809
29486
|
"../dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.js",
|
|
28810
29487
|
import.meta.url
|
|
28811
29488
|
);
|
|
29489
|
+
var setupContextPath = normalizePath(setupContextUrl);
|
|
28812
29490
|
function viteSdkSupportPlugin() {
|
|
28813
|
-
return
|
|
28814
|
-
|
|
28815
|
-
|
|
28816
|
-
|
|
28817
|
-
const
|
|
28818
|
-
|
|
29491
|
+
return [
|
|
29492
|
+
{
|
|
29493
|
+
name: "vite-sdk-add-context-import",
|
|
29494
|
+
transform(code, id) {
|
|
29495
|
+
const [, query] = id.split("?");
|
|
29496
|
+
const params = new URLSearchParams(query);
|
|
29497
|
+
if (params.get("add-sdk-context-setup") != null) {
|
|
29498
|
+
return defaultOutdent`
|
|
29499
|
+
import '${setupContextPath}';
|
|
29500
|
+
${code}
|
|
29501
|
+
`;
|
|
29502
|
+
}
|
|
29503
|
+
return code;
|
|
29504
|
+
},
|
|
29505
|
+
transformIndexHtml: {
|
|
29506
|
+
handler(html) {
|
|
29507
|
+
const fragment = parseFragment(html);
|
|
29508
|
+
traverseModuleScripts(fragment, (script) => {
|
|
29509
|
+
const src = script.attrs.find((attr) => attr.name === "src");
|
|
29510
|
+
if (src) {
|
|
29511
|
+
src.value = `${src.value}?add-sdk-context-setup`;
|
|
29512
|
+
} else {
|
|
29513
|
+
const textNode = script.childNodes[0];
|
|
29514
|
+
if (textNode && defaultTreeAdapter.isTextNode(textNode)) {
|
|
29515
|
+
textNode.value = defaultOutdent`
|
|
29516
|
+
import '${setupContextPath}';
|
|
29517
|
+
${textNode.value};
|
|
29518
|
+
`;
|
|
29519
|
+
}
|
|
29520
|
+
}
|
|
29521
|
+
});
|
|
29522
|
+
return serialize(fragment);
|
|
29523
|
+
},
|
|
29524
|
+
order: "pre"
|
|
29525
|
+
}
|
|
29526
|
+
},
|
|
29527
|
+
{
|
|
29528
|
+
name: "vite-sdk-add-accesstoken-script",
|
|
29529
|
+
transformIndexHtml: {
|
|
29530
|
+
handler(html, { bundle, server }) {
|
|
29531
|
+
const scriptPath = resolveRuntimeScriptPath({ bundle, server });
|
|
29532
|
+
return defaultOutdent`
|
|
28819
29533
|
<script type="module" accesstoken="true" crossorigin src="${scriptPath}"></script>
|
|
28820
29534
|
${html}
|
|
28821
29535
|
`;
|
|
28822
|
-
|
|
28823
|
-
|
|
29536
|
+
},
|
|
29537
|
+
order: "post"
|
|
29538
|
+
}
|
|
28824
29539
|
}
|
|
28825
|
-
|
|
29540
|
+
];
|
|
28826
29541
|
}
|
|
28827
29542
|
function resolveRuntimeScriptPath({
|
|
28828
29543
|
bundle,
|
|
28829
29544
|
server
|
|
28830
29545
|
}) {
|
|
28831
29546
|
if (server) {
|
|
28832
|
-
return
|
|
29547
|
+
return join13(server.config.base, "/@fs", fileURLToPath9(setupContextUrl));
|
|
28833
29548
|
}
|
|
28834
29549
|
if (bundle) {
|
|
28835
29550
|
const runtimeChunk = Object.values(bundle).find(
|
|
@@ -28858,7 +29573,7 @@ function getViteConfig2({
|
|
|
28858
29573
|
const input = [
|
|
28859
29574
|
setupContextUrl2,
|
|
28860
29575
|
...extensions.map(
|
|
28861
|
-
(embeddedScript2) =>
|
|
29576
|
+
(embeddedScript2) => join14(srcDir, embeddedScript2.options.source)
|
|
28862
29577
|
)
|
|
28863
29578
|
];
|
|
28864
29579
|
return createExtensionViteConfig({
|
|
@@ -28878,40 +29593,6 @@ function getViteConfig2({
|
|
|
28878
29593
|
});
|
|
28879
29594
|
}
|
|
28880
29595
|
|
|
28881
|
-
// ../astro-embedded-scripts-extensions/src/utils/htmlUtils.ts
|
|
28882
|
-
init_esm_shims();
|
|
28883
|
-
function traverseModuleScripts(node, visitor) {
|
|
28884
|
-
traverseNodes(node, (child) => {
|
|
28885
|
-
if (nodeIsElement(child) && child.nodeName === "script" && // only modules
|
|
28886
|
-
child.attrs.some(
|
|
28887
|
-
(attr) => attr.name === "type" && attr.value === "module"
|
|
28888
|
-
) && // no inline scripts
|
|
28889
|
-
child.attrs.some((attr) => attr.name === "src")) {
|
|
28890
|
-
visitor(child);
|
|
28891
|
-
}
|
|
28892
|
-
if (nodeIsElement(child) && child.nodeName === "link" && // only modules
|
|
28893
|
-
child.attrs.some(
|
|
28894
|
-
(attr) => attr.name === "rel" && attr.value === "modulepreload"
|
|
28895
|
-
)) {
|
|
28896
|
-
visitor(child);
|
|
28897
|
-
}
|
|
28898
|
-
});
|
|
28899
|
-
}
|
|
28900
|
-
function nodeIsElement(node) {
|
|
28901
|
-
return node.nodeName[0] !== "#";
|
|
28902
|
-
}
|
|
28903
|
-
function traverseNodes(node, visitor) {
|
|
28904
|
-
if (node.nodeName === "template") {
|
|
28905
|
-
node = node.content;
|
|
28906
|
-
}
|
|
28907
|
-
visitor(node);
|
|
28908
|
-
if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") {
|
|
28909
|
-
for (const childNode of node.childNodes) {
|
|
28910
|
-
traverseNodes(childNode, visitor);
|
|
28911
|
-
}
|
|
28912
|
-
}
|
|
28913
|
-
}
|
|
28914
|
-
|
|
28915
29596
|
// ../astro-embedded-scripts-extensions/src/utils/isAbsoluteUrl.ts
|
|
28916
29597
|
init_esm_shims();
|
|
28917
29598
|
function isAbsoluteUrl(url) {
|
|
@@ -28968,16 +29649,13 @@ var createIntegration5 = () => {
|
|
|
28968
29649
|
return;
|
|
28969
29650
|
}
|
|
28970
29651
|
ok10(srcDir != null);
|
|
28971
|
-
|
|
29652
|
+
customBuildOutput = await build(
|
|
28972
29653
|
getViteConfig2({
|
|
28973
29654
|
createExtensionViteConfig,
|
|
28974
29655
|
extensions,
|
|
28975
29656
|
srcDir
|
|
28976
29657
|
})
|
|
28977
29658
|
);
|
|
28978
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
28979
|
-
ok10(clientOutput);
|
|
28980
|
-
customBuildOutput = clientOutput;
|
|
28981
29659
|
},
|
|
28982
29660
|
async "wix:app-manifest:setup"({
|
|
28983
29661
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
@@ -28990,7 +29668,7 @@ var createIntegration5 = () => {
|
|
|
28990
29668
|
for (const extension of extensions) {
|
|
28991
29669
|
const fileName = relative(
|
|
28992
29670
|
rootDir,
|
|
28993
|
-
|
|
29671
|
+
join15(srcDir, extension.options.source)
|
|
28994
29672
|
);
|
|
28995
29673
|
const html = await getAssetContent({
|
|
28996
29674
|
buildOutput: customBuildOutput,
|
|
@@ -28998,7 +29676,7 @@ var createIntegration5 = () => {
|
|
|
28998
29676
|
viteDevServer: customDevServer
|
|
28999
29677
|
});
|
|
29000
29678
|
const fragment = parseFragment(html);
|
|
29001
|
-
|
|
29679
|
+
traverseModuleElements(fragment, (script) => {
|
|
29002
29680
|
const srcAttr = script.attrs.find(
|
|
29003
29681
|
(x) => x.name === "src" || x.name === "href"
|
|
29004
29682
|
);
|
|
@@ -29006,7 +29684,7 @@ var createIntegration5 = () => {
|
|
|
29006
29684
|
if (srcAttr.value.startsWith("//") || isAbsoluteUrl(srcAttr.value)) {
|
|
29007
29685
|
return;
|
|
29008
29686
|
}
|
|
29009
|
-
const normalizedValue = isAbsolutePath(srcAttr.value) ? srcAttr.value :
|
|
29687
|
+
const normalizedValue = isAbsolutePath(srcAttr.value) ? srcAttr.value : join15(
|
|
29010
29688
|
customDevServer?.config.base ?? "",
|
|
29011
29689
|
dirname2(fileName),
|
|
29012
29690
|
srcAttr.value
|
|
@@ -29016,6 +29694,7 @@ var createIntegration5 = () => {
|
|
|
29016
29694
|
});
|
|
29017
29695
|
components.push({
|
|
29018
29696
|
compId: extension.options.id,
|
|
29697
|
+
compName: extension.options.name,
|
|
29019
29698
|
compType: "EMBEDDED_SCRIPT",
|
|
29020
29699
|
compData: {
|
|
29021
29700
|
embeddedScriptComponentData: {
|
|
@@ -29023,6 +29702,7 @@ var createIntegration5 = () => {
|
|
|
29023
29702
|
allowedForFreeSite: true,
|
|
29024
29703
|
connectArticleUrl: "",
|
|
29025
29704
|
dependencies: [],
|
|
29705
|
+
// TODO: frontend dependencies
|
|
29026
29706
|
embedCategory: extension.options.scriptType,
|
|
29027
29707
|
loadOnce: true,
|
|
29028
29708
|
pages: "NONE_PAGES",
|
|
@@ -29052,48 +29732,69 @@ function embeddedScript(options) {
|
|
|
29052
29732
|
// ../astro-embedded-scripts-extensions/src/index.ts
|
|
29053
29733
|
init_esm_shims();
|
|
29054
29734
|
|
|
29055
|
-
// ../astro-site-
|
|
29735
|
+
// ../astro-site-component-panels-extensions/src/integration.ts
|
|
29056
29736
|
init_esm_shims();
|
|
29057
|
-
import { ok as
|
|
29058
|
-
import {
|
|
29059
|
-
import { fileURLToPath as fileURLToPath12 } from "url";
|
|
29060
|
-
import { build as build3, createServer as createServer4 } from "vite";
|
|
29737
|
+
import { ok as ok12 } from "assert";
|
|
29738
|
+
import { createServer as createServer4 } from "vite";
|
|
29061
29739
|
|
|
29062
|
-
// ../astro-site-
|
|
29740
|
+
// ../astro-site-component-panels-extensions/src/utils/getComponentResources.ts
|
|
29063
29741
|
init_esm_shims();
|
|
29064
|
-
import { ok as ok12 } from "assert";
|
|
29065
29742
|
|
|
29066
|
-
// ../astro-site-
|
|
29743
|
+
// ../astro-site-component-panels-extensions/src/vite/extensionPlugin.ts
|
|
29067
29744
|
init_esm_shims();
|
|
29068
29745
|
import { ok as ok11 } from "assert";
|
|
29069
|
-
|
|
29746
|
+
|
|
29747
|
+
// ../astro-site-component-panels-extensions/src/utils/getSupportedExtensions.ts
|
|
29748
|
+
init_esm_shims();
|
|
29749
|
+
import { join as join16 } from "path";
|
|
29750
|
+
function getSupportedExtensions({
|
|
29751
|
+
extensions,
|
|
29752
|
+
srcDir
|
|
29753
|
+
}) {
|
|
29754
|
+
const siteComponentPanelExtensions = extensions.filter(
|
|
29755
|
+
(extension) => extension.type === "SiteComponentPanel"
|
|
29756
|
+
);
|
|
29757
|
+
return siteComponentPanelExtensions.map((extension) => ({
|
|
29758
|
+
...extension,
|
|
29759
|
+
componentPath: join16(srcDir, extension.options.component)
|
|
29760
|
+
}));
|
|
29761
|
+
}
|
|
29762
|
+
|
|
29763
|
+
// ../astro-site-component-panels-extensions/src/vite/extensionPlugin.ts
|
|
29764
|
+
var componentVirtualModuleIdPrefix = "wix/component/";
|
|
29765
|
+
var hmrRuntimePath = normalizePath(
|
|
29070
29766
|
new URL(
|
|
29071
|
-
"../dependencies/astro-site-
|
|
29767
|
+
"../dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.js",
|
|
29768
|
+
import.meta.url
|
|
29769
|
+
)
|
|
29770
|
+
);
|
|
29771
|
+
var sdkRuntimePath = normalizePath(
|
|
29772
|
+
new URL(
|
|
29773
|
+
"../dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.js",
|
|
29072
29774
|
import.meta.url
|
|
29073
29775
|
)
|
|
29074
29776
|
);
|
|
29075
|
-
var componentVirtualModuleIdPrefix = "wix/component/";
|
|
29076
29777
|
function getVirtualModuleIdForComponent(componentId) {
|
|
29077
29778
|
return `${componentVirtualModuleIdPrefix}${componentId}`;
|
|
29078
29779
|
}
|
|
29079
|
-
function
|
|
29080
|
-
|
|
29780
|
+
function siteComponentPanelPlugin({
|
|
29781
|
+
model
|
|
29081
29782
|
}) {
|
|
29082
29783
|
let config = null;
|
|
29083
29784
|
return {
|
|
29084
|
-
name: "wix:site-component-plugin",
|
|
29785
|
+
name: "wix:site-component-panels-plugin",
|
|
29085
29786
|
configResolved(resolvedConfig) {
|
|
29086
29787
|
config = resolvedConfig;
|
|
29087
29788
|
},
|
|
29088
29789
|
load(id) {
|
|
29089
29790
|
if (id.startsWith(componentVirtualModuleIdPrefix)) {
|
|
29090
29791
|
const extensionId = id.slice(componentVirtualModuleIdPrefix.length);
|
|
29091
|
-
const extension =
|
|
29792
|
+
const extension = getSupportedExtensions(model).find(
|
|
29092
29793
|
(ext) => ext.options.id === extensionId
|
|
29093
29794
|
);
|
|
29094
29795
|
if (extension) {
|
|
29095
29796
|
ok11(config);
|
|
29096
|
-
const componentPath =
|
|
29797
|
+
const componentPath = normalizePath(extension.componentPath);
|
|
29097
29798
|
if (config.command === "build") {
|
|
29098
29799
|
return getBuildTemplate(componentPath);
|
|
29099
29800
|
}
|
|
@@ -29112,12 +29813,20 @@ function siteComponentPlugin({
|
|
|
29112
29813
|
}
|
|
29113
29814
|
function getBuildTemplate(componentPath) {
|
|
29114
29815
|
return defaultOutdent`
|
|
29115
|
-
|
|
29816
|
+
import { createContext } from '${sdkRuntimePath}';
|
|
29817
|
+
import Component from '${componentPath}';
|
|
29818
|
+
|
|
29819
|
+
export default (config = {}) => {
|
|
29820
|
+
createContext(config);
|
|
29821
|
+
|
|
29822
|
+
return Component;
|
|
29823
|
+
}
|
|
29116
29824
|
`;
|
|
29117
29825
|
}
|
|
29118
29826
|
function getServeTemplate(componentPath) {
|
|
29119
29827
|
return defaultOutdent`
|
|
29120
|
-
import { createComponentHmrWrapper } from '${
|
|
29828
|
+
import { createComponentHmrWrapper } from '${hmrRuntimePath}';
|
|
29829
|
+
import { createContext } from '${sdkRuntimePath}';
|
|
29121
29830
|
import OriginalComponent from '${componentPath}';
|
|
29122
29831
|
|
|
29123
29832
|
let WrappedComponent = OriginalComponent;
|
|
@@ -29132,73 +29841,55 @@ function getServeTemplate(componentPath) {
|
|
|
29132
29841
|
WrappedComponent = createComponentHmrWrapper(OriginalComponent, import.meta.hot.data);
|
|
29133
29842
|
}
|
|
29134
29843
|
|
|
29135
|
-
export default
|
|
29844
|
+
export default (config = {}) => {
|
|
29845
|
+
createContext(config);
|
|
29846
|
+
|
|
29847
|
+
return WrappedComponent;
|
|
29848
|
+
}
|
|
29136
29849
|
`;
|
|
29137
29850
|
}
|
|
29138
29851
|
|
|
29139
|
-
// ../astro-site-
|
|
29140
|
-
function
|
|
29852
|
+
// ../astro-site-component-panels-extensions/src/utils/getComponentResources.ts
|
|
29853
|
+
function getResources({
|
|
29141
29854
|
baseUrl,
|
|
29142
29855
|
buildOutput,
|
|
29143
29856
|
devServer,
|
|
29144
29857
|
extension
|
|
29145
29858
|
}) {
|
|
29146
29859
|
if (buildOutput) {
|
|
29147
|
-
return
|
|
29860
|
+
return getResourcesBuild({ baseUrl, buildOutput, extension });
|
|
29148
29861
|
}
|
|
29149
29862
|
if (devServer) {
|
|
29150
|
-
return
|
|
29863
|
+
return getResourcesDev({ baseUrl, devServer, extension });
|
|
29151
29864
|
}
|
|
29152
29865
|
throw new Error("Unknown error: no build output or vite dev server");
|
|
29153
29866
|
}
|
|
29154
|
-
function
|
|
29867
|
+
function getResourcesBuild({
|
|
29155
29868
|
baseUrl,
|
|
29156
29869
|
buildOutput,
|
|
29157
29870
|
extension
|
|
29158
29871
|
}) {
|
|
29159
29872
|
const moduleId = getVirtualModuleIdForComponent(extension.options.id);
|
|
29160
|
-
const chunk =
|
|
29161
|
-
|
|
29162
|
-
const
|
|
29163
|
-
const cssUrl = chunk.viteMetadata?.importedCss.values().next().value;
|
|
29873
|
+
const chunk = getChunkForModuleId({ buildOutput, moduleId });
|
|
29874
|
+
const componentFileName = chunk.fileName;
|
|
29875
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
29164
29876
|
return {
|
|
29165
|
-
|
|
29166
|
-
|
|
29167
|
-
cssUrl: cssUrl != null ? appendToDevServerUrl(baseUrl, cssUrl) : void 0
|
|
29168
|
-
}
|
|
29877
|
+
bundleUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
29878
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
29169
29879
|
};
|
|
29170
29880
|
}
|
|
29171
|
-
function
|
|
29881
|
+
function getResourcesDev({
|
|
29172
29882
|
baseUrl,
|
|
29173
29883
|
devServer,
|
|
29174
29884
|
extension
|
|
29175
29885
|
}) {
|
|
29176
29886
|
const moduleId = getVirtualModuleIdForComponent(extension.options.id);
|
|
29177
29887
|
return {
|
|
29178
|
-
|
|
29179
|
-
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
29180
|
-
}
|
|
29888
|
+
bundleUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
29181
29889
|
};
|
|
29182
29890
|
}
|
|
29183
29891
|
|
|
29184
|
-
// ../astro-site-
|
|
29185
|
-
init_esm_shims();
|
|
29186
|
-
import { join as join14 } from "path";
|
|
29187
|
-
function getSupportedExtensions(extensions, { srcDir }) {
|
|
29188
|
-
const siteComponentExtensions = extensions.filter(filterSiteComponents);
|
|
29189
|
-
return siteComponentExtensions.map((extension) => ({
|
|
29190
|
-
...extension,
|
|
29191
|
-
componentRelativePath: join14(
|
|
29192
|
-
srcDir,
|
|
29193
|
-
extension.options.resources.client.component
|
|
29194
|
-
)
|
|
29195
|
-
}));
|
|
29196
|
-
}
|
|
29197
|
-
function filterSiteComponents(extension) {
|
|
29198
|
-
return extension.type === "SiteComponent";
|
|
29199
|
-
}
|
|
29200
|
-
|
|
29201
|
-
// ../astro-site-components-extensions/src/vite/getConfig.ts
|
|
29892
|
+
// ../astro-site-component-panels-extensions/src/vite/getConfig.ts
|
|
29202
29893
|
init_esm_shims();
|
|
29203
29894
|
|
|
29204
29895
|
// ../../node_modules/vite-plugin-externalize-dependencies/dist/index.js
|
|
@@ -29260,21 +29951,21 @@ var m = (n2) => ({
|
|
|
29260
29951
|
load: (e) => r.has(e) ? { code: "export default {};" } : null
|
|
29261
29952
|
});
|
|
29262
29953
|
|
|
29263
|
-
// ../astro-site-
|
|
29264
|
-
var externalDeps = ["react", "react-dom"
|
|
29954
|
+
// ../astro-site-component-panels-extensions/src/vite/getConfig.ts
|
|
29955
|
+
var externalDeps = ["react", "react-dom"];
|
|
29265
29956
|
function getViteConfig3({
|
|
29266
29957
|
createExtensionViteConfig,
|
|
29267
|
-
|
|
29958
|
+
model
|
|
29268
29959
|
}) {
|
|
29269
|
-
const extensions =
|
|
29960
|
+
const extensions = getSupportedExtensions(model);
|
|
29270
29961
|
const input = extensions.map(
|
|
29271
29962
|
(extension) => [
|
|
29272
|
-
`component-${extension.options.id}`,
|
|
29963
|
+
`component-panel-${extension.options.id}`,
|
|
29273
29964
|
getVirtualModuleIdForComponent(extension.options.id)
|
|
29274
29965
|
]
|
|
29275
29966
|
);
|
|
29276
29967
|
return createExtensionViteConfig({
|
|
29277
|
-
name: "site-
|
|
29968
|
+
name: "site-component-panels",
|
|
29278
29969
|
config: {
|
|
29279
29970
|
build: {
|
|
29280
29971
|
rollupOptions: {
|
|
@@ -29285,94 +29976,87 @@ function getViteConfig3({
|
|
|
29285
29976
|
}
|
|
29286
29977
|
},
|
|
29287
29978
|
optimizeDeps: {
|
|
29288
|
-
entries:
|
|
29979
|
+
entries: [
|
|
29980
|
+
...extensions.map((ext) => ext.componentPath),
|
|
29981
|
+
hmrRuntimePath,
|
|
29982
|
+
sdkRuntimePath
|
|
29983
|
+
]
|
|
29289
29984
|
},
|
|
29290
29985
|
plugins: [
|
|
29291
|
-
|
|
29292
|
-
|
|
29986
|
+
siteComponentPanelPlugin({ model }),
|
|
29987
|
+
m({
|
|
29988
|
+
externals: externalDeps.map(
|
|
29989
|
+
(external) => new RegExp(`^${external}$`)
|
|
29990
|
+
)
|
|
29991
|
+
})
|
|
29293
29992
|
]
|
|
29294
29993
|
}
|
|
29295
29994
|
});
|
|
29296
29995
|
}
|
|
29297
29996
|
|
|
29298
|
-
// ../astro-site-
|
|
29997
|
+
// ../astro-site-component-panels-extensions/src/integration.ts
|
|
29299
29998
|
var createIntegration6 = () => {
|
|
29300
|
-
let
|
|
29301
|
-
let
|
|
29302
|
-
let
|
|
29303
|
-
let customDevServer = null;
|
|
29304
|
-
const getExtensions = () => {
|
|
29305
|
-
ok13(extensions);
|
|
29306
|
-
return extensions;
|
|
29307
|
-
};
|
|
29999
|
+
let model = null;
|
|
30000
|
+
let buildOutput = null;
|
|
30001
|
+
let devServer = null;
|
|
29308
30002
|
return {
|
|
29309
|
-
name: "@wix/astro
|
|
30003
|
+
name: "@wix/astro-site-component-panels-extensions",
|
|
29310
30004
|
hooks: {
|
|
29311
|
-
"
|
|
29312
|
-
|
|
29313
|
-
fileURLToPath12(config.root),
|
|
29314
|
-
fileURLToPath12(config.srcDir)
|
|
29315
|
-
);
|
|
29316
|
-
},
|
|
29317
|
-
"wix:model:setup"({ model }) {
|
|
29318
|
-
ok13(srcDir != null);
|
|
29319
|
-
extensions = getSupportedExtensions(model.extensions, { srcDir });
|
|
29320
|
-
},
|
|
29321
|
-
"wix:model:changed"({ model }) {
|
|
29322
|
-
ok13(srcDir != null);
|
|
29323
|
-
extensions = getSupportedExtensions(model.extensions, { srcDir });
|
|
30005
|
+
"wix:model:setup"({ model: newModel }) {
|
|
30006
|
+
model = newModel;
|
|
29324
30007
|
},
|
|
29325
30008
|
async "wix:server:start"({
|
|
29326
30009
|
createExtensionViteConfig,
|
|
29327
30010
|
setupExtensionProxy
|
|
29328
30011
|
}) {
|
|
29329
|
-
|
|
29330
|
-
|
|
29331
|
-
getViteConfig3({
|
|
30012
|
+
ok12(model);
|
|
30013
|
+
devServer = await createServer4(
|
|
30014
|
+
getViteConfig3({
|
|
30015
|
+
createExtensionViteConfig,
|
|
30016
|
+
model
|
|
30017
|
+
})
|
|
29332
30018
|
);
|
|
29333
|
-
await
|
|
29334
|
-
setupExtensionProxy(
|
|
30019
|
+
await devServer.listen();
|
|
30020
|
+
setupExtensionProxy(devServer);
|
|
29335
30021
|
},
|
|
29336
30022
|
async "astro:server:done"() {
|
|
29337
|
-
|
|
29338
|
-
await
|
|
30023
|
+
ok12(devServer);
|
|
30024
|
+
await devServer.close();
|
|
29339
30025
|
},
|
|
29340
30026
|
async "wix:build:setup"({ createExtensionViteConfig }) {
|
|
29341
|
-
|
|
30027
|
+
ok12(model);
|
|
30028
|
+
const extensions = getSupportedExtensions(model);
|
|
29342
30029
|
if (extensions.length === 0) {
|
|
29343
30030
|
return;
|
|
29344
30031
|
}
|
|
29345
|
-
|
|
29346
|
-
|
|
29347
|
-
getViteConfig3({ createExtensionViteConfig, getExtensions })
|
|
30032
|
+
buildOutput = await build(
|
|
30033
|
+
getViteConfig3({ createExtensionViteConfig, model })
|
|
29348
30034
|
);
|
|
29349
|
-
const [clientOutput] = viteBuildOutputToRollupOutputs(buildOutput);
|
|
29350
|
-
ok13(clientOutput);
|
|
29351
|
-
customBuildOutput = clientOutput;
|
|
29352
30035
|
},
|
|
29353
30036
|
async "wix:app-manifest:setup"({
|
|
29354
30037
|
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
29355
30038
|
updateAppManifest
|
|
29356
30039
|
}) {
|
|
29357
|
-
|
|
29358
|
-
|
|
30040
|
+
ok12(model);
|
|
30041
|
+
const extensions = getSupportedExtensions(model);
|
|
29359
30042
|
const components = [];
|
|
29360
30043
|
for (const extension of extensions) {
|
|
29361
|
-
const resources =
|
|
30044
|
+
const resources = getResources({
|
|
29362
30045
|
baseUrl: staticsUrlPlaceholder2,
|
|
29363
|
-
buildOutput
|
|
29364
|
-
devServer
|
|
30046
|
+
buildOutput,
|
|
30047
|
+
devServer,
|
|
29365
30048
|
extension
|
|
29366
30049
|
});
|
|
29367
30050
|
components.push({
|
|
29368
30051
|
compId: extension.options.id,
|
|
29369
|
-
compType: "
|
|
30052
|
+
compType: "PANEL",
|
|
29370
30053
|
compData: {
|
|
29371
|
-
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
30054
|
+
panel: {
|
|
30055
|
+
code: resources,
|
|
30056
|
+
contentType: "code",
|
|
30057
|
+
displayName: extension.options.displayName,
|
|
30058
|
+
referenceId: extension.options.referenceId,
|
|
30059
|
+
size: extension.options.size
|
|
29376
30060
|
}
|
|
29377
30061
|
}
|
|
29378
30062
|
});
|
|
@@ -29383,61 +30067,798 @@ var createIntegration6 = () => {
|
|
|
29383
30067
|
};
|
|
29384
30068
|
};
|
|
29385
30069
|
|
|
29386
|
-
// ../astro-site-
|
|
30070
|
+
// ../astro-site-component-panels-extensions/src/builders.ts
|
|
29387
30071
|
init_esm_shims();
|
|
29388
|
-
function
|
|
30072
|
+
function siteComponentPanel(options) {
|
|
29389
30073
|
return {
|
|
29390
|
-
type: "
|
|
30074
|
+
type: "SiteComponentPanel",
|
|
29391
30075
|
options
|
|
29392
30076
|
};
|
|
29393
30077
|
}
|
|
29394
30078
|
|
|
29395
|
-
// ../astro-site-
|
|
30079
|
+
// ../astro-site-component-panels-extensions/src/index.ts
|
|
29396
30080
|
init_esm_shims();
|
|
29397
30081
|
|
|
29398
|
-
// ../astro-site-
|
|
30082
|
+
// ../astro-site-components-extensions/src/integration.ts
|
|
29399
30083
|
init_esm_shims();
|
|
30084
|
+
import { ok as ok14 } from "assert";
|
|
30085
|
+
import { createServer as createServer5 } from "vite";
|
|
29400
30086
|
|
|
29401
|
-
// ../astro-site-
|
|
30087
|
+
// ../astro-site-components-extensions/src/utils/getPresets.ts
|
|
29402
30088
|
init_esm_shims();
|
|
29403
|
-
|
|
29404
|
-
return extension.type === "SitePlugin";
|
|
29405
|
-
}
|
|
30089
|
+
import { join as join19 } from "path";
|
|
29406
30090
|
|
|
29407
|
-
// ../astro-site-
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
name: "@wix/astro/site-plugins",
|
|
29411
|
-
hooks: {
|
|
29412
|
-
async "wix:app-manifest:setup"({ model, updateAppManifest }) {
|
|
29413
|
-
const components = model.extensions.filter(filterSupportedExtensions5).map((sitePlugin2) => {
|
|
29414
|
-
return {
|
|
29415
|
-
compId: sitePlugin2.options.id,
|
|
29416
|
-
compName: sitePlugin2.options.name,
|
|
29417
|
-
compType: "WIDGET_PLUGIN",
|
|
29418
|
-
compData: {
|
|
29419
|
-
widgetPlugin: {
|
|
29420
|
-
installation: sitePlugin2.options.installation,
|
|
29421
|
-
marketData: sitePlugin2.options.marketData,
|
|
29422
|
-
placements: sitePlugin2.options.placements,
|
|
29423
|
-
referenceComponentId: sitePlugin2.options.referenceComponentId
|
|
29424
|
-
}
|
|
29425
|
-
}
|
|
29426
|
-
};
|
|
29427
|
-
});
|
|
29428
|
-
updateAppManifest({
|
|
29429
|
-
components
|
|
29430
|
-
});
|
|
29431
|
-
}
|
|
29432
|
-
}
|
|
29433
|
-
};
|
|
29434
|
-
};
|
|
30091
|
+
// ../astro-site-components-extensions/src/vite/client/build-config.ts
|
|
30092
|
+
init_esm_shims();
|
|
30093
|
+
import { join as join18 } from "path";
|
|
29435
30094
|
|
|
29436
|
-
// ../astro-site-
|
|
30095
|
+
// ../astro-site-components-extensions/src/vite/shared.ts
|
|
29437
30096
|
init_esm_shims();
|
|
29438
|
-
|
|
29439
|
-
|
|
29440
|
-
|
|
30097
|
+
var extensionName = "site-components";
|
|
30098
|
+
var externalDeps2 = [
|
|
30099
|
+
"react",
|
|
30100
|
+
"react/jsx-runtime",
|
|
30101
|
+
"react/jsx-dev-runtime",
|
|
30102
|
+
"react-dom",
|
|
30103
|
+
"@wix/services-manager-react"
|
|
30104
|
+
];
|
|
30105
|
+
|
|
30106
|
+
// ../astro-site-components-extensions/src/vite/virtual-modules-plugin.ts
|
|
30107
|
+
init_esm_shims();
|
|
30108
|
+
|
|
30109
|
+
// ../vite-virtual-router-plugin/src/index.ts
|
|
30110
|
+
init_esm_shims();
|
|
30111
|
+
var import_path_to_regexp = __toESM(require_dist(), 1);
|
|
30112
|
+
import { ok as ok13 } from "assert";
|
|
30113
|
+
var RESOLVED_PREFIX = "\0";
|
|
30114
|
+
function createVirtualRouter() {
|
|
30115
|
+
const routes = [];
|
|
30116
|
+
return {
|
|
30117
|
+
route(path5, handler) {
|
|
30118
|
+
const matcher = (0, import_path_to_regexp.match)(path5);
|
|
30119
|
+
routes.push({
|
|
30120
|
+
handler,
|
|
30121
|
+
matcher
|
|
30122
|
+
});
|
|
30123
|
+
return this;
|
|
30124
|
+
},
|
|
30125
|
+
get routes() {
|
|
30126
|
+
return routes;
|
|
30127
|
+
}
|
|
30128
|
+
};
|
|
30129
|
+
}
|
|
30130
|
+
function viteVirtualRouterPlugin({ name, router }) {
|
|
30131
|
+
let config = null;
|
|
30132
|
+
return {
|
|
30133
|
+
name,
|
|
30134
|
+
configResolved(resolvedConfig) {
|
|
30135
|
+
config = resolvedConfig;
|
|
30136
|
+
},
|
|
30137
|
+
load(rawId) {
|
|
30138
|
+
if (rawId.startsWith(RESOLVED_PREFIX)) {
|
|
30139
|
+
const id = rawId.replace(RESOLVED_PREFIX, "");
|
|
30140
|
+
for (const route of router.routes) {
|
|
30141
|
+
const result = route.matcher(id);
|
|
30142
|
+
if (result !== false) {
|
|
30143
|
+
ok13(config);
|
|
30144
|
+
return route.handler(result.params, {
|
|
30145
|
+
command: config.command,
|
|
30146
|
+
resolvedId: id
|
|
30147
|
+
});
|
|
30148
|
+
}
|
|
30149
|
+
}
|
|
30150
|
+
}
|
|
30151
|
+
return null;
|
|
30152
|
+
},
|
|
30153
|
+
resolveId(id) {
|
|
30154
|
+
for (const route of router.routes) {
|
|
30155
|
+
if (route.matcher(id) !== false) {
|
|
30156
|
+
return `${RESOLVED_PREFIX}${id}`;
|
|
30157
|
+
}
|
|
30158
|
+
}
|
|
30159
|
+
return null;
|
|
30160
|
+
}
|
|
30161
|
+
};
|
|
30162
|
+
}
|
|
30163
|
+
|
|
30164
|
+
// ../astro-site-components-extensions/src/vite/client/virtual-module.ts
|
|
30165
|
+
init_esm_shims();
|
|
30166
|
+
|
|
30167
|
+
// ../astro-site-components-extensions/src/runtime/index.ts
|
|
30168
|
+
init_esm_shims();
|
|
30169
|
+
var sdkRuntimePath2 = normalizePath(
|
|
30170
|
+
new URL(
|
|
30171
|
+
"../dependencies/astro-site-components-extensions/browser-runtime/sdk.js",
|
|
30172
|
+
import.meta.url
|
|
30173
|
+
)
|
|
30174
|
+
);
|
|
30175
|
+
var hmrRuntimePath2 = normalizePath(
|
|
30176
|
+
new URL(
|
|
30177
|
+
"../dependencies/astro-site-components-extensions/browser-runtime/hmr.js",
|
|
30178
|
+
import.meta.url
|
|
30179
|
+
)
|
|
30180
|
+
);
|
|
30181
|
+
|
|
30182
|
+
// ../astro-site-components-extensions/src/utils/getSiteComponent.ts
|
|
30183
|
+
init_esm_shims();
|
|
30184
|
+
|
|
30185
|
+
// ../astro-site-components-extensions/src/utils/getSupportedExtensions.ts
|
|
30186
|
+
init_esm_shims();
|
|
30187
|
+
import { join as join17 } from "path";
|
|
30188
|
+
function getSupportedExtensions2({
|
|
30189
|
+
extensions,
|
|
30190
|
+
srcDir
|
|
30191
|
+
}) {
|
|
30192
|
+
const siteComponentExtensions = extensions.filter(filterSiteComponents);
|
|
30193
|
+
return siteComponentExtensions.map((extension) => {
|
|
30194
|
+
const componentPresets = Object.entries(
|
|
30195
|
+
extension.options.editorElement.presets ?? {}
|
|
30196
|
+
).map(([name, { source, ...config }]) => ({
|
|
30197
|
+
name,
|
|
30198
|
+
config,
|
|
30199
|
+
path: join17(srcDir, source),
|
|
30200
|
+
source
|
|
30201
|
+
}));
|
|
30202
|
+
return {
|
|
30203
|
+
...extension,
|
|
30204
|
+
componentPath: join17(srcDir, extension.options.resources.client.component),
|
|
30205
|
+
componentPresets,
|
|
30206
|
+
editorPreviewPath: extension.options.resources.editor?.component != null ? join17(srcDir, extension.options.resources.editor.component) : null,
|
|
30207
|
+
sdkPath: extension.options.resources.sdk != null ? join17(srcDir, extension.options.resources.sdk) : null
|
|
30208
|
+
};
|
|
30209
|
+
});
|
|
30210
|
+
}
|
|
30211
|
+
function filterSiteComponents(extension) {
|
|
30212
|
+
return extension.type === "SiteComponent";
|
|
30213
|
+
}
|
|
30214
|
+
|
|
30215
|
+
// ../astro-site-components-extensions/src/utils/getSiteComponent.ts
|
|
30216
|
+
function getSiteComponent(model, id) {
|
|
30217
|
+
return getSupportedExtensions2(model).find(
|
|
30218
|
+
(ext) => ext.options.id === id
|
|
30219
|
+
);
|
|
30220
|
+
}
|
|
30221
|
+
|
|
30222
|
+
// ../astro-site-components-extensions/src/vite/client/virtual-module.ts
|
|
30223
|
+
function getComponentBuildTemplate(componentPath) {
|
|
30224
|
+
return defaultOutdent`
|
|
30225
|
+
import { createContext } from '${sdkRuntimePath2}';
|
|
30226
|
+
|
|
30227
|
+
export const injectAccessTokenGetter = createContext();
|
|
30228
|
+
|
|
30229
|
+
export { default } from '${componentPath}';
|
|
30230
|
+
`;
|
|
30231
|
+
}
|
|
30232
|
+
function getComponentServeTemplate(componentPath) {
|
|
30233
|
+
return defaultOutdent`
|
|
30234
|
+
import { createContext } from '${sdkRuntimePath2}';
|
|
30235
|
+
import { createComponentHmrWrapper } from '${hmrRuntimePath2}';
|
|
30236
|
+
import OriginalComponent from '${componentPath}';
|
|
30237
|
+
|
|
30238
|
+
let WrappedComponent = OriginalComponent;
|
|
30239
|
+
|
|
30240
|
+
if (import.meta.hot) {
|
|
30241
|
+
import.meta.hot.accept('${componentPath}', (newModule) => {
|
|
30242
|
+
if (newModule?.default) {
|
|
30243
|
+
import.meta.hot.data.setComponent?.(newModule?.default);
|
|
30244
|
+
}
|
|
30245
|
+
});
|
|
30246
|
+
|
|
30247
|
+
WrappedComponent = createComponentHmrWrapper(OriginalComponent, import.meta.hot.data);
|
|
30248
|
+
}
|
|
30249
|
+
|
|
30250
|
+
export const injectAccessTokenGetter = createContext();
|
|
30251
|
+
|
|
30252
|
+
export default WrappedComponent;
|
|
30253
|
+
`;
|
|
30254
|
+
}
|
|
30255
|
+
function getVirtualModuleIdForComponent2(componentId) {
|
|
30256
|
+
return `wix/component/${componentId}`;
|
|
30257
|
+
}
|
|
30258
|
+
function registerComponentVirtualRoute({
|
|
30259
|
+
model,
|
|
30260
|
+
router
|
|
30261
|
+
}) {
|
|
30262
|
+
router.route(
|
|
30263
|
+
getVirtualModuleIdForComponent2(":id"),
|
|
30264
|
+
({ id }, { command }) => {
|
|
30265
|
+
const extension = getSiteComponent(model, id);
|
|
30266
|
+
if (extension) {
|
|
30267
|
+
const componentPath = normalizePath(extension.componentPath);
|
|
30268
|
+
if (command === "build") {
|
|
30269
|
+
return getComponentBuildTemplate(componentPath);
|
|
30270
|
+
}
|
|
30271
|
+
return getComponentServeTemplate(componentPath);
|
|
30272
|
+
}
|
|
30273
|
+
return null;
|
|
30274
|
+
}
|
|
30275
|
+
);
|
|
30276
|
+
}
|
|
30277
|
+
|
|
30278
|
+
// ../astro-site-components-extensions/src/vite/editor/virtual-module.ts
|
|
30279
|
+
init_esm_shims();
|
|
30280
|
+
function getVirtualModuleIdForPreview(componentId) {
|
|
30281
|
+
return `wix/component-preview/${componentId}`;
|
|
30282
|
+
}
|
|
30283
|
+
function registerPreviewVirtualRoute({
|
|
30284
|
+
model,
|
|
30285
|
+
router
|
|
30286
|
+
}) {
|
|
30287
|
+
router.route(
|
|
30288
|
+
getVirtualModuleIdForPreview(":id"),
|
|
30289
|
+
({ id }, { command }) => {
|
|
30290
|
+
const extension = getSiteComponent(model, id);
|
|
30291
|
+
if (extension?.editorPreviewPath != null) {
|
|
30292
|
+
const componentPath = normalizePath(extension.editorPreviewPath);
|
|
30293
|
+
if (command === "build") {
|
|
30294
|
+
return getComponentBuildTemplate(componentPath);
|
|
30295
|
+
}
|
|
30296
|
+
return getComponentServeTemplate(componentPath);
|
|
30297
|
+
}
|
|
30298
|
+
return null;
|
|
30299
|
+
}
|
|
30300
|
+
);
|
|
30301
|
+
}
|
|
30302
|
+
|
|
30303
|
+
// ../astro-site-components-extensions/src/vite/sdk/virtual-module.ts
|
|
30304
|
+
init_esm_shims();
|
|
30305
|
+
function getVirtualModuleIdForSdk(componentId) {
|
|
30306
|
+
return `wix/component-sdk/${componentId}`;
|
|
30307
|
+
}
|
|
30308
|
+
function registerSdkVirtualRoute({
|
|
30309
|
+
model,
|
|
30310
|
+
router
|
|
30311
|
+
}) {
|
|
30312
|
+
router.route(getVirtualModuleIdForSdk(":id"), ({ id }) => {
|
|
30313
|
+
const extension = getSiteComponent(model, id);
|
|
30314
|
+
if (extension?.sdkPath != null) {
|
|
30315
|
+
const sdkPath = normalizePath(extension.sdkPath);
|
|
30316
|
+
return defaultOutdent`
|
|
30317
|
+
if (import.meta.hot) {
|
|
30318
|
+
import.meta.hot.accept((_) => {});
|
|
30319
|
+
}
|
|
30320
|
+
|
|
30321
|
+
export { default } from '${sdkPath}';
|
|
30322
|
+
`;
|
|
30323
|
+
}
|
|
30324
|
+
return null;
|
|
30325
|
+
});
|
|
30326
|
+
}
|
|
30327
|
+
|
|
30328
|
+
// ../astro-site-components-extensions/src/vite/virtual-modules-plugin.ts
|
|
30329
|
+
function virtualModulesPlugin({ model }) {
|
|
30330
|
+
const router = createVirtualRouter();
|
|
30331
|
+
registerComponentVirtualRoute({ model, router });
|
|
30332
|
+
registerPreviewVirtualRoute({ model, router });
|
|
30333
|
+
registerSdkVirtualRoute({ model, router });
|
|
30334
|
+
return viteVirtualRouterPlugin({
|
|
30335
|
+
name: "wix:site-component-virtual-modules-plugin",
|
|
30336
|
+
router
|
|
30337
|
+
});
|
|
30338
|
+
}
|
|
30339
|
+
|
|
30340
|
+
// ../astro-site-components-extensions/src/vite/client/build-config.ts
|
|
30341
|
+
function getEntryNameForComponent(componentId) {
|
|
30342
|
+
return `component-${componentId}`;
|
|
30343
|
+
}
|
|
30344
|
+
function getEntryNameForPreset(componentId, presetName) {
|
|
30345
|
+
return `component-${componentId}-preset-${presetName}.css`;
|
|
30346
|
+
}
|
|
30347
|
+
var getComponentBuildConfig = ({
|
|
30348
|
+
createExtensionViteConfig,
|
|
30349
|
+
extension: {
|
|
30350
|
+
componentPresets,
|
|
30351
|
+
options: { id }
|
|
30352
|
+
},
|
|
30353
|
+
model
|
|
30354
|
+
}) => {
|
|
30355
|
+
const input = {
|
|
30356
|
+
[getEntryNameForComponent(id)]: getVirtualModuleIdForComponent2(id)
|
|
30357
|
+
};
|
|
30358
|
+
for (const { name, path: path5 } of componentPresets) {
|
|
30359
|
+
input[getEntryNameForPreset(id, name)] = path5;
|
|
30360
|
+
}
|
|
30361
|
+
return createExtensionViteConfig({
|
|
30362
|
+
name: join18(extensionName, "client"),
|
|
30363
|
+
config: {
|
|
30364
|
+
build: {
|
|
30365
|
+
rollupOptions: {
|
|
30366
|
+
external: externalDeps2,
|
|
30367
|
+
input,
|
|
30368
|
+
preserveEntrySignatures: "strict"
|
|
30369
|
+
}
|
|
30370
|
+
},
|
|
30371
|
+
plugins: [virtualModulesPlugin({ model })]
|
|
30372
|
+
}
|
|
30373
|
+
});
|
|
30374
|
+
};
|
|
30375
|
+
|
|
30376
|
+
// ../astro-site-components-extensions/src/utils/getPresets.ts
|
|
30377
|
+
function getPresets({
|
|
30378
|
+
baseUrl,
|
|
30379
|
+
buildOutput,
|
|
30380
|
+
devServer,
|
|
30381
|
+
extension
|
|
30382
|
+
}) {
|
|
30383
|
+
if (buildOutput) {
|
|
30384
|
+
return getPresetsBuild({ baseUrl, buildOutput, extension });
|
|
30385
|
+
}
|
|
30386
|
+
if (devServer) {
|
|
30387
|
+
return getPresetsDev({ baseUrl, devServer, extension });
|
|
30388
|
+
}
|
|
30389
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30390
|
+
}
|
|
30391
|
+
function getPresetsBuild({
|
|
30392
|
+
baseUrl,
|
|
30393
|
+
buildOutput,
|
|
30394
|
+
extension
|
|
30395
|
+
}) {
|
|
30396
|
+
return extension.componentPresets.reduce((acc, { name, config }) => {
|
|
30397
|
+
const { fileName } = getAssetForName({
|
|
30398
|
+
name: getEntryNameForPreset(extension.options.id, name),
|
|
30399
|
+
buildOutput
|
|
30400
|
+
});
|
|
30401
|
+
const cssUrl = appendToDevServerUrl(baseUrl, fileName);
|
|
30402
|
+
acc[name] = {
|
|
30403
|
+
...config,
|
|
30404
|
+
cssUrl,
|
|
30405
|
+
presetCssUrl: cssUrl
|
|
30406
|
+
};
|
|
30407
|
+
return acc;
|
|
30408
|
+
}, {});
|
|
30409
|
+
}
|
|
30410
|
+
function getPresetsDev({
|
|
30411
|
+
baseUrl,
|
|
30412
|
+
devServer,
|
|
30413
|
+
extension
|
|
30414
|
+
}) {
|
|
30415
|
+
return extension.componentPresets.reduce((acc, { name, config, path: path5 }) => {
|
|
30416
|
+
const cssUrl = appendToDevServerUrl(
|
|
30417
|
+
baseUrl,
|
|
30418
|
+
join19(devServer.config.base, "@fs", path5)
|
|
30419
|
+
);
|
|
30420
|
+
acc[name] = {
|
|
30421
|
+
...config,
|
|
30422
|
+
cssUrl,
|
|
30423
|
+
presetCssUrl: cssUrl
|
|
30424
|
+
};
|
|
30425
|
+
return acc;
|
|
30426
|
+
}, {});
|
|
30427
|
+
}
|
|
30428
|
+
|
|
30429
|
+
// ../astro-site-components-extensions/src/utils/getResources.ts
|
|
30430
|
+
init_esm_shims();
|
|
30431
|
+
|
|
30432
|
+
// ../astro-site-components-extensions/src/utils/getClientResource.ts
|
|
30433
|
+
init_esm_shims();
|
|
30434
|
+
function getClientResource({
|
|
30435
|
+
baseUrl,
|
|
30436
|
+
buildOutput,
|
|
30437
|
+
devServer,
|
|
30438
|
+
extension
|
|
30439
|
+
}) {
|
|
30440
|
+
if (buildOutput) {
|
|
30441
|
+
return getClientResourceBuild({ baseUrl, buildOutput, extension });
|
|
30442
|
+
}
|
|
30443
|
+
if (devServer) {
|
|
30444
|
+
return getClientResourceDev({ baseUrl, devServer, extension });
|
|
30445
|
+
}
|
|
30446
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30447
|
+
}
|
|
30448
|
+
function getClientResourceBuild({
|
|
30449
|
+
baseUrl,
|
|
30450
|
+
buildOutput,
|
|
30451
|
+
extension
|
|
30452
|
+
}) {
|
|
30453
|
+
const entryName = getEntryNameForComponent(extension.options.id);
|
|
30454
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30455
|
+
const componentFileName = chunk.fileName;
|
|
30456
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
30457
|
+
return {
|
|
30458
|
+
componentUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
30459
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
30460
|
+
};
|
|
30461
|
+
}
|
|
30462
|
+
function getClientResourceDev({
|
|
30463
|
+
baseUrl,
|
|
30464
|
+
devServer,
|
|
30465
|
+
extension
|
|
30466
|
+
}) {
|
|
30467
|
+
const moduleId = getVirtualModuleIdForComponent2(extension.options.id);
|
|
30468
|
+
return {
|
|
30469
|
+
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
30470
|
+
};
|
|
30471
|
+
}
|
|
30472
|
+
|
|
30473
|
+
// ../astro-site-components-extensions/src/utils/getEditorResource.ts
|
|
30474
|
+
init_esm_shims();
|
|
30475
|
+
|
|
30476
|
+
// ../astro-site-components-extensions/src/vite/editor/build-config.ts
|
|
30477
|
+
init_esm_shims();
|
|
30478
|
+
import { join as join20 } from "path";
|
|
30479
|
+
function getEntryNameForPreview(componentId) {
|
|
30480
|
+
return `component-${componentId}-preview`;
|
|
30481
|
+
}
|
|
30482
|
+
var getPreviewBuildConfig = ({
|
|
30483
|
+
createExtensionViteConfig,
|
|
30484
|
+
extensionId,
|
|
30485
|
+
model
|
|
30486
|
+
}) => {
|
|
30487
|
+
return createExtensionViteConfig({
|
|
30488
|
+
name: join20(extensionName, "editor"),
|
|
30489
|
+
config: {
|
|
30490
|
+
build: {
|
|
30491
|
+
rollupOptions: {
|
|
30492
|
+
external: externalDeps2,
|
|
30493
|
+
input: {
|
|
30494
|
+
[getEntryNameForPreview(extensionId)]: getVirtualModuleIdForPreview(extensionId)
|
|
30495
|
+
},
|
|
30496
|
+
preserveEntrySignatures: "strict"
|
|
30497
|
+
}
|
|
30498
|
+
},
|
|
30499
|
+
plugins: [virtualModulesPlugin({ model })]
|
|
30500
|
+
}
|
|
30501
|
+
});
|
|
30502
|
+
};
|
|
30503
|
+
|
|
30504
|
+
// ../astro-site-components-extensions/src/utils/getEditorResource.ts
|
|
30505
|
+
function getEditorResource({
|
|
30506
|
+
baseUrl,
|
|
30507
|
+
buildOutput,
|
|
30508
|
+
devServer,
|
|
30509
|
+
extension
|
|
30510
|
+
}) {
|
|
30511
|
+
if (extension.editorPreviewPath == null) {
|
|
30512
|
+
return;
|
|
30513
|
+
}
|
|
30514
|
+
if (buildOutput) {
|
|
30515
|
+
return getEditorResourceBuild({ baseUrl, buildOutput, extension });
|
|
30516
|
+
}
|
|
30517
|
+
if (devServer) {
|
|
30518
|
+
return getEditorResourceDev({ baseUrl, devServer, extension });
|
|
30519
|
+
}
|
|
30520
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30521
|
+
}
|
|
30522
|
+
function getEditorResourceBuild({
|
|
30523
|
+
baseUrl,
|
|
30524
|
+
buildOutput,
|
|
30525
|
+
extension
|
|
30526
|
+
}) {
|
|
30527
|
+
const entryName = getEntryNameForPreview(extension.options.id);
|
|
30528
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30529
|
+
const componentFileName = chunk.fileName;
|
|
30530
|
+
const cssFileName = getCssFileNameFromChunk(chunk);
|
|
30531
|
+
return {
|
|
30532
|
+
componentUrl: appendToDevServerUrl(baseUrl, componentFileName),
|
|
30533
|
+
cssUrl: cssFileName != null ? appendToDevServerUrl(baseUrl, cssFileName) : void 0
|
|
30534
|
+
};
|
|
30535
|
+
}
|
|
30536
|
+
function getEditorResourceDev({
|
|
30537
|
+
baseUrl,
|
|
30538
|
+
devServer,
|
|
30539
|
+
extension
|
|
30540
|
+
}) {
|
|
30541
|
+
const moduleId = getVirtualModuleIdForPreview(extension.options.id);
|
|
30542
|
+
return {
|
|
30543
|
+
componentUrl: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
30544
|
+
};
|
|
30545
|
+
}
|
|
30546
|
+
|
|
30547
|
+
// ../astro-site-components-extensions/src/utils/getSdkResource.ts
|
|
30548
|
+
init_esm_shims();
|
|
30549
|
+
|
|
30550
|
+
// ../astro-site-components-extensions/src/vite/sdk/build-config.ts
|
|
30551
|
+
init_esm_shims();
|
|
30552
|
+
import { join as join21 } from "path";
|
|
30553
|
+
function getEntryNameForSdk(componentId) {
|
|
30554
|
+
return `component-${componentId}-sdk`;
|
|
30555
|
+
}
|
|
30556
|
+
var getSdkBuildConfig = ({
|
|
30557
|
+
createExtensionViteConfig,
|
|
30558
|
+
extensionId,
|
|
30559
|
+
model
|
|
30560
|
+
}) => {
|
|
30561
|
+
return createExtensionViteConfig({
|
|
30562
|
+
name: join21(extensionName, "sdk"),
|
|
30563
|
+
config: {
|
|
30564
|
+
build: {
|
|
30565
|
+
rollupOptions: {
|
|
30566
|
+
input: {
|
|
30567
|
+
[getEntryNameForSdk(extensionId)]: getVirtualModuleIdForSdk(extensionId)
|
|
30568
|
+
},
|
|
30569
|
+
output: {
|
|
30570
|
+
inlineDynamicImports: true
|
|
30571
|
+
}
|
|
30572
|
+
},
|
|
30573
|
+
ssr: true
|
|
30574
|
+
},
|
|
30575
|
+
plugins: [virtualModulesPlugin({ model })],
|
|
30576
|
+
ssr: {
|
|
30577
|
+
noExternal: true,
|
|
30578
|
+
target: "webworker"
|
|
30579
|
+
}
|
|
30580
|
+
}
|
|
30581
|
+
});
|
|
30582
|
+
};
|
|
30583
|
+
|
|
30584
|
+
// ../astro-site-components-extensions/src/utils/getSdkResource.ts
|
|
30585
|
+
function getSdkResource({
|
|
30586
|
+
baseUrl,
|
|
30587
|
+
buildOutput,
|
|
30588
|
+
devServer,
|
|
30589
|
+
extension
|
|
30590
|
+
}) {
|
|
30591
|
+
if (extension.sdkPath == null) {
|
|
30592
|
+
return;
|
|
30593
|
+
}
|
|
30594
|
+
if (buildOutput) {
|
|
30595
|
+
return getSdkResourceBuild({ baseUrl, buildOutput, extension });
|
|
30596
|
+
}
|
|
30597
|
+
if (devServer) {
|
|
30598
|
+
return getSdkResourceDev({ baseUrl, devServer, extension });
|
|
30599
|
+
}
|
|
30600
|
+
throw new Error("Unknown error: no build output or vite dev server");
|
|
30601
|
+
}
|
|
30602
|
+
function getSdkResourceBuild({
|
|
30603
|
+
baseUrl,
|
|
30604
|
+
buildOutput,
|
|
30605
|
+
extension
|
|
30606
|
+
}) {
|
|
30607
|
+
const entryName = getEntryNameForSdk(extension.options.id);
|
|
30608
|
+
const chunk = getChunkForEntryName({ buildOutput, entryName });
|
|
30609
|
+
const sdkFileName = chunk.fileName;
|
|
30610
|
+
return {
|
|
30611
|
+
url: appendToDevServerUrl(baseUrl, sdkFileName)
|
|
30612
|
+
};
|
|
30613
|
+
}
|
|
30614
|
+
function getSdkResourceDev({
|
|
30615
|
+
baseUrl,
|
|
30616
|
+
devServer,
|
|
30617
|
+
extension
|
|
30618
|
+
}) {
|
|
30619
|
+
const moduleId = getVirtualModuleIdForSdk(extension.options.id);
|
|
30620
|
+
return {
|
|
30621
|
+
url: getAssetUrlForModuleId({ baseUrl, devServer, moduleId })
|
|
30622
|
+
};
|
|
30623
|
+
}
|
|
30624
|
+
|
|
30625
|
+
// ../astro-site-components-extensions/src/utils/getResources.ts
|
|
30626
|
+
function getResources2({
|
|
30627
|
+
buildOutput,
|
|
30628
|
+
extension,
|
|
30629
|
+
...options
|
|
30630
|
+
}) {
|
|
30631
|
+
const clientResource = getClientResource({
|
|
30632
|
+
buildOutput,
|
|
30633
|
+
extension,
|
|
30634
|
+
...options
|
|
30635
|
+
});
|
|
30636
|
+
const sdkResource = getSdkResource({
|
|
30637
|
+
buildOutput,
|
|
30638
|
+
extension,
|
|
30639
|
+
...options
|
|
30640
|
+
});
|
|
30641
|
+
const editorResource = getEditorResource({
|
|
30642
|
+
buildOutput,
|
|
30643
|
+
extension,
|
|
30644
|
+
...options
|
|
30645
|
+
});
|
|
30646
|
+
return {
|
|
30647
|
+
...extension.options.resources,
|
|
30648
|
+
client: clientResource,
|
|
30649
|
+
editor: editorResource,
|
|
30650
|
+
sdk: sdkResource
|
|
30651
|
+
};
|
|
30652
|
+
}
|
|
30653
|
+
|
|
30654
|
+
// ../astro-site-components-extensions/src/vite/configs/build.ts
|
|
30655
|
+
init_esm_shims();
|
|
30656
|
+
function getBuildViteConfigs({
|
|
30657
|
+
createExtensionViteConfig,
|
|
30658
|
+
model
|
|
30659
|
+
}) {
|
|
30660
|
+
const extensions = getSupportedExtensions2(model);
|
|
30661
|
+
return extensions.reduce((acc, extension) => {
|
|
30662
|
+
const {
|
|
30663
|
+
editorPreviewPath,
|
|
30664
|
+
options: { id: extensionId },
|
|
30665
|
+
sdkPath
|
|
30666
|
+
} = extension;
|
|
30667
|
+
acc.push(
|
|
30668
|
+
getComponentBuildConfig({
|
|
30669
|
+
createExtensionViteConfig,
|
|
30670
|
+
extension,
|
|
30671
|
+
model
|
|
30672
|
+
})
|
|
30673
|
+
);
|
|
30674
|
+
if (editorPreviewPath != null) {
|
|
30675
|
+
acc.push(
|
|
30676
|
+
getPreviewBuildConfig({
|
|
30677
|
+
createExtensionViteConfig,
|
|
30678
|
+
extensionId,
|
|
30679
|
+
model
|
|
30680
|
+
})
|
|
30681
|
+
);
|
|
30682
|
+
}
|
|
30683
|
+
if (sdkPath != null) {
|
|
30684
|
+
acc.push(
|
|
30685
|
+
getSdkBuildConfig({
|
|
30686
|
+
createExtensionViteConfig,
|
|
30687
|
+
extensionId,
|
|
30688
|
+
model
|
|
30689
|
+
})
|
|
30690
|
+
);
|
|
30691
|
+
}
|
|
30692
|
+
return acc;
|
|
30693
|
+
}, []);
|
|
30694
|
+
}
|
|
30695
|
+
|
|
30696
|
+
// ../astro-site-components-extensions/src/vite/configs/dev.ts
|
|
30697
|
+
init_esm_shims();
|
|
30698
|
+
function getDevViteConfig({
|
|
30699
|
+
createExtensionViteConfig,
|
|
30700
|
+
model
|
|
30701
|
+
}) {
|
|
30702
|
+
const extensionEntries = getSupportedExtensions2(model).map((ext) => [
|
|
30703
|
+
ext.componentPath,
|
|
30704
|
+
...ext.sdkPath != null ? [ext.sdkPath] : [],
|
|
30705
|
+
...ext.editorPreviewPath != null ? [ext.editorPreviewPath] : []
|
|
30706
|
+
]).flat();
|
|
30707
|
+
return createExtensionViteConfig({
|
|
30708
|
+
name: extensionName,
|
|
30709
|
+
config: {
|
|
30710
|
+
optimizeDeps: {
|
|
30711
|
+
entries: [...extensionEntries, sdkRuntimePath2, hmrRuntimePath2]
|
|
30712
|
+
},
|
|
30713
|
+
plugins: [
|
|
30714
|
+
m({
|
|
30715
|
+
externals: externalDeps2.map(
|
|
30716
|
+
(external) => new RegExp(`^${external}$`)
|
|
30717
|
+
)
|
|
30718
|
+
}),
|
|
30719
|
+
virtualModulesPlugin({ model })
|
|
30720
|
+
]
|
|
30721
|
+
}
|
|
30722
|
+
});
|
|
30723
|
+
}
|
|
30724
|
+
|
|
30725
|
+
// ../astro-site-components-extensions/src/integration.ts
|
|
30726
|
+
var createIntegration7 = () => {
|
|
30727
|
+
let model = null;
|
|
30728
|
+
let customBuildOutput = null;
|
|
30729
|
+
let customDevServer = null;
|
|
30730
|
+
return {
|
|
30731
|
+
name: "@wix/astro/site-components",
|
|
30732
|
+
hooks: {
|
|
30733
|
+
"wix:model:setup"({ model: newModel }) {
|
|
30734
|
+
model = newModel;
|
|
30735
|
+
},
|
|
30736
|
+
async "wix:server:start"({
|
|
30737
|
+
createExtensionViteConfig,
|
|
30738
|
+
setupExtensionProxy
|
|
30739
|
+
}) {
|
|
30740
|
+
ok14(model);
|
|
30741
|
+
customDevServer = await createServer5(
|
|
30742
|
+
getDevViteConfig({ createExtensionViteConfig, model })
|
|
30743
|
+
);
|
|
30744
|
+
await customDevServer.listen();
|
|
30745
|
+
setupExtensionProxy(customDevServer);
|
|
30746
|
+
},
|
|
30747
|
+
async "astro:server:done"() {
|
|
30748
|
+
ok14(customDevServer);
|
|
30749
|
+
await customDevServer.close();
|
|
30750
|
+
},
|
|
30751
|
+
async "wix:build:setup"({ createExtensionViteConfig }) {
|
|
30752
|
+
ok14(model);
|
|
30753
|
+
const extensions = getSupportedExtensions2(model);
|
|
30754
|
+
if (extensions.length === 0) {
|
|
30755
|
+
return;
|
|
30756
|
+
}
|
|
30757
|
+
customBuildOutput = await buildAll(
|
|
30758
|
+
getBuildViteConfigs({ createExtensionViteConfig, model })
|
|
30759
|
+
);
|
|
30760
|
+
},
|
|
30761
|
+
async "wix:app-manifest:setup"({
|
|
30762
|
+
staticsUrlPlaceholder: staticsUrlPlaceholder2,
|
|
30763
|
+
updateAppManifest
|
|
30764
|
+
}) {
|
|
30765
|
+
ok14(model);
|
|
30766
|
+
const extensions = getSupportedExtensions2(model);
|
|
30767
|
+
const components = [];
|
|
30768
|
+
for (const extension of extensions) {
|
|
30769
|
+
const resources = getResources2({
|
|
30770
|
+
baseUrl: staticsUrlPlaceholder2,
|
|
30771
|
+
buildOutput: customBuildOutput,
|
|
30772
|
+
devServer: customDevServer,
|
|
30773
|
+
extension
|
|
30774
|
+
});
|
|
30775
|
+
const presets = getPresets({
|
|
30776
|
+
baseUrl: staticsUrlPlaceholder2,
|
|
30777
|
+
buildOutput: customBuildOutput,
|
|
30778
|
+
devServer: customDevServer,
|
|
30779
|
+
extension
|
|
30780
|
+
});
|
|
30781
|
+
components.push({
|
|
30782
|
+
compId: extension.options.id,
|
|
30783
|
+
compType: "EDITOR_REACT_COMPONENT",
|
|
30784
|
+
compData: {
|
|
30785
|
+
editorReactComponent: {
|
|
30786
|
+
type: extension.options.type,
|
|
30787
|
+
description: extension.options.description,
|
|
30788
|
+
editorElement: {
|
|
30789
|
+
...extension.options.editorElement,
|
|
30790
|
+
presets
|
|
30791
|
+
},
|
|
30792
|
+
resources
|
|
30793
|
+
}
|
|
30794
|
+
}
|
|
30795
|
+
});
|
|
30796
|
+
}
|
|
30797
|
+
updateAppManifest({ components });
|
|
30798
|
+
}
|
|
30799
|
+
}
|
|
30800
|
+
};
|
|
30801
|
+
};
|
|
30802
|
+
|
|
30803
|
+
// ../astro-site-components-extensions/src/builders.ts
|
|
30804
|
+
init_esm_shims();
|
|
30805
|
+
function siteComponent(options) {
|
|
30806
|
+
return {
|
|
30807
|
+
type: "SiteComponent",
|
|
30808
|
+
options
|
|
30809
|
+
};
|
|
30810
|
+
}
|
|
30811
|
+
|
|
30812
|
+
// ../astro-site-components-extensions/src/index.ts
|
|
30813
|
+
init_esm_shims();
|
|
30814
|
+
|
|
30815
|
+
// ../astro-site-plugins-extensions/src/integration.ts
|
|
30816
|
+
init_esm_shims();
|
|
30817
|
+
|
|
30818
|
+
// ../astro-site-plugins-extensions/src/utils/filterSupportedExtensions.ts
|
|
30819
|
+
init_esm_shims();
|
|
30820
|
+
function filterSupportedExtensions5(extension) {
|
|
30821
|
+
return extension.type === "SitePlugin";
|
|
30822
|
+
}
|
|
30823
|
+
|
|
30824
|
+
// ../astro-site-plugins-extensions/src/integration.ts
|
|
30825
|
+
var createIntegration8 = () => {
|
|
30826
|
+
return {
|
|
30827
|
+
name: "@wix/astro/site-plugins",
|
|
30828
|
+
hooks: {
|
|
30829
|
+
async "wix:app-manifest:setup"({ model, updateAppManifest }) {
|
|
30830
|
+
const components = model.extensions.filter(filterSupportedExtensions5).map((sitePlugin2) => {
|
|
30831
|
+
return {
|
|
30832
|
+
compId: sitePlugin2.options.id,
|
|
30833
|
+
compName: sitePlugin2.options.name,
|
|
30834
|
+
compType: "WIDGET_PLUGIN",
|
|
30835
|
+
compData: {
|
|
30836
|
+
widgetPlugin: {
|
|
30837
|
+
installation: {
|
|
30838
|
+
base: {
|
|
30839
|
+
autoAdd: sitePlugin2.options.installation.autoAdd
|
|
30840
|
+
}
|
|
30841
|
+
},
|
|
30842
|
+
marketData: sitePlugin2.options.marketData,
|
|
30843
|
+
placements: sitePlugin2.options.placements,
|
|
30844
|
+
referenceComponentId: sitePlugin2.options.referenceComponentId
|
|
30845
|
+
}
|
|
30846
|
+
}
|
|
30847
|
+
};
|
|
30848
|
+
});
|
|
30849
|
+
updateAppManifest({
|
|
30850
|
+
components
|
|
30851
|
+
});
|
|
30852
|
+
}
|
|
30853
|
+
}
|
|
30854
|
+
};
|
|
30855
|
+
};
|
|
30856
|
+
|
|
30857
|
+
// ../astro-site-plugins-extensions/src/builders.ts
|
|
30858
|
+
init_esm_shims();
|
|
30859
|
+
function sitePlugin(options) {
|
|
30860
|
+
return {
|
|
30861
|
+
type: "SitePlugin",
|
|
29441
30862
|
options
|
|
29442
30863
|
};
|
|
29443
30864
|
}
|
|
@@ -29451,8 +30872,8 @@ export {
|
|
|
29451
30872
|
defaultOutdent,
|
|
29452
30873
|
createIntegration,
|
|
29453
30874
|
ecomAdditionalFees,
|
|
29454
|
-
|
|
29455
|
-
|
|
30875
|
+
ecomDiscountTriggers,
|
|
30876
|
+
ecomGiftCards,
|
|
29456
30877
|
ecomPaymentSettings,
|
|
29457
30878
|
ecomShippingRates,
|
|
29458
30879
|
ecomValidations,
|
|
@@ -29470,8 +30891,10 @@ export {
|
|
|
29470
30891
|
createIntegration5,
|
|
29471
30892
|
embeddedScript,
|
|
29472
30893
|
createIntegration6,
|
|
29473
|
-
|
|
30894
|
+
siteComponentPanel,
|
|
29474
30895
|
createIntegration7,
|
|
30896
|
+
siteComponent,
|
|
30897
|
+
createIntegration8,
|
|
29475
30898
|
sitePlugin
|
|
29476
30899
|
};
|
|
29477
30900
|
/*! Bundled license information:
|
|
@@ -29522,4 +30945,4 @@ queue-microtask/index.js:
|
|
|
29522
30945
|
run-parallel/index.js:
|
|
29523
30946
|
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
29524
30947
|
*/
|
|
29525
|
-
//# sourceMappingURL=chunk-
|
|
30948
|
+
//# sourceMappingURL=chunk-UBCQK5ZU.js.map
|