@wix/astro 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +91 -75
- package/build/index.js.map +1 -1
- package/build-browser-runtime/setup.js +4082 -11
- package/build-runtime/middleware/auth.js +3 -3
- package/build-runtime/routes/auth/callback.d.ts +2 -2
- package/build-runtime/routes/auth/callback.js +6 -4
- package/build-runtime/routes/auth/login.d.ts +2 -2
- package/build-runtime/routes/auth/login.js +3 -3
- package/build-runtime/routes/auth/logout-callback.js +4 -2
- package/build-runtime/routes/auth/logout.d.ts +3 -3
- package/build-runtime/routes/auth/logout.js +13 -5
- package/package.json +2 -2
- package/src/context/non-elevated.ts +1 -1
- package/src/context/setup.ts +1 -1
- package/src/context/utils.ts +24 -13
- package/src/directories.ts +1 -1
- package/src/index.ts +3 -3
- package/src/plugins/setupSsrContext.ts +33 -17
- package/src/routes/auth/callback.ts +6 -4
- package/src/routes/auth/login.ts +4 -4
- package/src/routes/auth/logout-callback.ts +3 -1
- package/src/routes/auth/logout.ts +12 -5
- package/src/routes/service-plugins.ts +2 -2
- package/src/routes/webhooks.ts +2 -2
- package/src/schemas.ts +2 -2
- package/src/utils/createProjectModel.ts +23 -21
- package/src/utils/fs-utils.ts +20 -20
- package/src/utils/generateAppManifest.ts +12 -12
- package/src/utils/generateVisitorTokens.ts +2 -1
- package/src/utils/getSessionTokensFromCookie.ts +3 -3
- package/src/utils/isValidBackofficeComponent.ts +4 -3
- package/src/utils/isValidServicePluginComponent.ts +6 -6
- package/src/utils/isValidWebhookComponent.ts +1 -1
- package/src/utils/loadEnvVars.ts +5 -2
- package/src/utils/saveSessionTokensToCookie.ts +10 -7
- package/src/utils/writeVirtualBackofficeExtensionFiles.ts +1 -1
- package/src/utils/writeVirtualServicePluginExtensionFiles.ts +1 -1
- package/src/utils/writeVirtualWebhookExtensionFiles.ts +1 -1
- package/tsup.config.mjs +17 -17
- package/build-runtime/{chunk-HVACFX6T.js → chunk-VMS3NKCF.js} +6 -6
package/build/index.js
CHANGED
|
@@ -10972,7 +10972,7 @@ var require_ignore = __commonJS({
|
|
|
10972
10972
|
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
|
10973
10973
|
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
|
10974
10974
|
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
|
10975
|
-
var REGEX_TEST_INVALID_PATH =
|
|
10975
|
+
var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
|
|
10976
10976
|
var REGEX_TEST_TRAILING_SLASH = /\/$/;
|
|
10977
10977
|
var SLASH = "/";
|
|
10978
10978
|
var TMP_KEY_IGNORE = "node-ignore";
|
|
@@ -11395,18 +11395,22 @@ var require_ignore = __commonJS({
|
|
|
11395
11395
|
};
|
|
11396
11396
|
var factory = (options) => new Ignore(options);
|
|
11397
11397
|
var isPathValid = (path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE);
|
|
11398
|
-
|
|
11399
|
-
// Detect `process` so that it can run in browsers.
|
|
11400
|
-
typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
|
|
11401
|
-
) {
|
|
11398
|
+
var setupWindows = () => {
|
|
11402
11399
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
11403
11400
|
checkPath.convert = makePosix;
|
|
11404
11401
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
11405
11402
|
checkPath.isNotRelative = (path2) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2);
|
|
11403
|
+
};
|
|
11404
|
+
if (
|
|
11405
|
+
// Detect `process` so that it can run in browsers.
|
|
11406
|
+
typeof process !== "undefined" && process.platform === "win32"
|
|
11407
|
+
) {
|
|
11408
|
+
setupWindows();
|
|
11406
11409
|
}
|
|
11407
11410
|
module2.exports = factory;
|
|
11408
11411
|
factory.default = factory;
|
|
11409
11412
|
module2.exports.isPathValid = isPathValid;
|
|
11413
|
+
define2(module2.exports, Symbol.for("setupWindows"), setupWindows);
|
|
11410
11414
|
}
|
|
11411
11415
|
});
|
|
11412
11416
|
|
|
@@ -12286,7 +12290,7 @@ var require_lib = __commonJS({
|
|
|
12286
12290
|
init_esm_shims();
|
|
12287
12291
|
var import_chokidar = __toESM(require_chokidar(), 1);
|
|
12288
12292
|
import { join as join7 } from "node:path";
|
|
12289
|
-
import { fileURLToPath as
|
|
12293
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
12290
12294
|
import { envField, passthroughImageService } from "astro/config";
|
|
12291
12295
|
|
|
12292
12296
|
// ../../node_modules/outdent/lib-module/index.js
|
|
@@ -12471,29 +12475,41 @@ function patchGlobal() {
|
|
|
12471
12475
|
// src/plugins/setupSsrContext.ts
|
|
12472
12476
|
init_esm_shims();
|
|
12473
12477
|
import { extname, join as join2 } from "node:path";
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12478
|
+
import { fileURLToPath } from "node:url";
|
|
12479
|
+
var nonElevatedSetupUrl = new URL(
|
|
12480
|
+
"../build-runtime/context/non-elevated.js",
|
|
12481
|
+
import.meta.url
|
|
12482
|
+
);
|
|
12483
|
+
var elevatedSetupUrl = new URL(
|
|
12484
|
+
"../build-runtime/context/elevated.js",
|
|
12485
|
+
import.meta.url
|
|
12486
|
+
);
|
|
12487
|
+
var whitelistedFilePaths = [
|
|
12488
|
+
fileURLToPath(
|
|
12489
|
+
new URL("../build-runtime/routes/auth/login.js", import.meta.url)
|
|
12490
|
+
),
|
|
12491
|
+
fileURLToPath(
|
|
12492
|
+
new URL("../build-runtime/routes/auth/callback.js", import.meta.url)
|
|
12493
|
+
),
|
|
12494
|
+
fileURLToPath(
|
|
12495
|
+
new URL("../build-runtime/routes/auth/logout.js", import.meta.url)
|
|
12496
|
+
),
|
|
12497
|
+
fileURLToPath(
|
|
12498
|
+
new URL("../build-runtime/routes/auth/logout-callback.js", import.meta.url)
|
|
12499
|
+
)
|
|
12500
|
+
];
|
|
12501
|
+
function setupSsrContext(rootDir) {
|
|
12502
|
+
const srcDir = join2(rootDir, SRC_DIR);
|
|
12483
12503
|
return {
|
|
12484
12504
|
applyToEnvironment(environment) {
|
|
12485
12505
|
return environment.name === "ssr";
|
|
12486
12506
|
},
|
|
12487
12507
|
name: "setup-ssr-context",
|
|
12488
12508
|
transform(code, id) {
|
|
12489
|
-
|
|
12490
|
-
if (
|
|
12491
|
-
// ignore node_modules
|
|
12492
|
-
id.includes("node_modules") && // but allow injected runtime
|
|
12493
|
-
!id.includes(join2("node_modules", "@wix", "astro"))
|
|
12494
|
-
) {
|
|
12509
|
+
if (!id.startsWith(srcDir) && !whitelistedFilePaths.includes(id)) {
|
|
12495
12510
|
return null;
|
|
12496
12511
|
}
|
|
12512
|
+
const extension = extname(id);
|
|
12497
12513
|
if (extension !== ".js" && extension !== ".astro" && extension !== ".ts" && extension !== ".tsx") {
|
|
12498
12514
|
return null;
|
|
12499
12515
|
}
|
|
@@ -12741,10 +12757,10 @@ var isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
|
12741
12757
|
init_esm_shims();
|
|
12742
12758
|
import { promisify } from "node:util";
|
|
12743
12759
|
import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
|
|
12744
|
-
import { fileURLToPath } from "node:url";
|
|
12760
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
12745
12761
|
var execFileOriginal = promisify(execFileCallback);
|
|
12746
12762
|
function toPath(urlOrPath) {
|
|
12747
|
-
return urlOrPath instanceof URL ?
|
|
12763
|
+
return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
|
12748
12764
|
}
|
|
12749
12765
|
var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
12750
12766
|
|
|
@@ -17259,27 +17275,27 @@ import {
|
|
|
17259
17275
|
} from "node:fs/promises";
|
|
17260
17276
|
import { EOL } from "node:os";
|
|
17261
17277
|
import { dirname, relative } from "node:path";
|
|
17262
|
-
function
|
|
17263
|
-
|
|
17264
|
-
}
|
|
17265
|
-
async function writeJson(filePath, object, opts) {
|
|
17266
|
-
const str = toJsonString(object, opts);
|
|
17267
|
-
await outputDir(dirname(filePath));
|
|
17268
|
-
await writeFile(filePath, str, "utf-8");
|
|
17269
|
-
}
|
|
17270
|
-
async function readJson(file) {
|
|
17271
|
-
return JSON.parse(await fsReadFile(file, "utf-8"));
|
|
17278
|
+
async function outputDir(dir) {
|
|
17279
|
+
await mkdir(dir, { recursive: true });
|
|
17272
17280
|
}
|
|
17273
17281
|
function pathExists(path2) {
|
|
17274
17282
|
return access(path2).then(() => true).catch(() => false);
|
|
17275
17283
|
}
|
|
17276
|
-
async function
|
|
17277
|
-
await
|
|
17284
|
+
async function readJson(file) {
|
|
17285
|
+
return JSON.parse(await fsReadFile(file, "utf-8"));
|
|
17278
17286
|
}
|
|
17279
17287
|
function toRelativePath2(from, to) {
|
|
17280
17288
|
const rel = relative(dirname(from), to).replaceAll("\\", "/");
|
|
17281
17289
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
17282
17290
|
}
|
|
17291
|
+
async function writeJson(filePath, object, opts) {
|
|
17292
|
+
const str = toJsonString(object, opts);
|
|
17293
|
+
await outputDir(dirname(filePath));
|
|
17294
|
+
await writeFile(filePath, str, "utf-8");
|
|
17295
|
+
}
|
|
17296
|
+
function toJsonString(object, opts) {
|
|
17297
|
+
return `${JSON.stringify(object, null, opts?.spaces)}${EOL}`;
|
|
17298
|
+
}
|
|
17283
17299
|
|
|
17284
17300
|
// src/utils/loadEnvVars.ts
|
|
17285
17301
|
init_esm_shims();
|
|
@@ -17782,10 +17798,10 @@ var source_default = chalk;
|
|
|
17782
17798
|
// src/utils/loadEnvVars.ts
|
|
17783
17799
|
import { loadEnv } from "vite";
|
|
17784
17800
|
var wixClientIdEnvVar = "WIX_CLIENT_ID";
|
|
17785
|
-
function loadEnvVars(
|
|
17801
|
+
function loadEnvVars(logger) {
|
|
17786
17802
|
const env2 = loadEnv("production", process.cwd(), "");
|
|
17787
17803
|
const appId = env2[wixClientIdEnvVar];
|
|
17788
|
-
if (
|
|
17804
|
+
if (appId == null) {
|
|
17789
17805
|
logger.error(
|
|
17790
17806
|
defaultOutdent`
|
|
17791
17807
|
Missing environment variable ${source_default.blueBright(wixClientIdEnvVar)}
|
|
@@ -17814,7 +17830,7 @@ function loadEnvVars(rootDir, logger) {
|
|
|
17814
17830
|
// src/utils/createProjectModel.ts
|
|
17815
17831
|
async function createProjectModel(logger) {
|
|
17816
17832
|
const rootDir = cwd();
|
|
17817
|
-
const { appId, env: env2 } = loadEnvVars(
|
|
17833
|
+
const { appId, env: env2 } = loadEnvVars(logger);
|
|
17818
17834
|
const componentsPaths = await globby(
|
|
17819
17835
|
pathToGlobby(join3(EXTENSIONS_DIR, "*")),
|
|
17820
17836
|
{
|
|
@@ -17826,12 +17842,12 @@ async function createProjectModel(logger) {
|
|
|
17826
17842
|
const unknownComponents = [];
|
|
17827
17843
|
for (const componentPath of componentsPaths) {
|
|
17828
17844
|
const extensionManifest = await readExtensionManifest(componentPath);
|
|
17829
|
-
const knownManifest =
|
|
17845
|
+
const knownManifest = parseKnownExtensionManifest(extensionManifest);
|
|
17830
17846
|
if (knownManifest != null) {
|
|
17831
17847
|
components.push(createComponent(knownManifest, componentPath));
|
|
17832
17848
|
continue;
|
|
17833
17849
|
}
|
|
17834
|
-
const unknownManifest =
|
|
17850
|
+
const unknownManifest = parseBaseExtensionManifest(extensionManifest);
|
|
17835
17851
|
unknownComponents.push(
|
|
17836
17852
|
UnknownComponent.Unknown({
|
|
17837
17853
|
directory: componentPath,
|
|
@@ -17847,9 +17863,6 @@ async function createProjectModel(logger) {
|
|
|
17847
17863
|
unknownComponents
|
|
17848
17864
|
};
|
|
17849
17865
|
}
|
|
17850
|
-
function pathToGlobby(path2) {
|
|
17851
|
-
return path2.replaceAll("\\", "/");
|
|
17852
|
-
}
|
|
17853
17866
|
function createComponent(manifest, directory) {
|
|
17854
17867
|
switch (manifest.compType) {
|
|
17855
17868
|
case "BACK_OFFICE_EXTENSION_MENU_ITEM":
|
|
@@ -17919,14 +17932,7 @@ function createComponent(manifest, directory) {
|
|
|
17919
17932
|
}
|
|
17920
17933
|
}
|
|
17921
17934
|
}
|
|
17922
|
-
|
|
17923
|
-
const appManifestResult = devCenterComponentSchema.safeParse(extensionManifest);
|
|
17924
|
-
if (appManifestResult.error) {
|
|
17925
|
-
return null;
|
|
17926
|
-
}
|
|
17927
|
-
return appManifestResult.data;
|
|
17928
|
-
}
|
|
17929
|
-
async function parseBaseExtensionManifest(extensionManifest) {
|
|
17935
|
+
function parseBaseExtensionManifest(extensionManifest) {
|
|
17930
17936
|
const appManifestResult = baseDevCenterComponentSchema.safeParse(extensionManifest);
|
|
17931
17937
|
if (!appManifestResult.success) {
|
|
17932
17938
|
throw new Error(defaultOutdent`
|
|
@@ -17937,6 +17943,16 @@ async function parseBaseExtensionManifest(extensionManifest) {
|
|
|
17937
17943
|
}
|
|
17938
17944
|
return appManifestResult.data;
|
|
17939
17945
|
}
|
|
17946
|
+
function parseKnownExtensionManifest(extensionManifest) {
|
|
17947
|
+
const appManifestResult = devCenterComponentSchema.safeParse(extensionManifest);
|
|
17948
|
+
if (appManifestResult.error) {
|
|
17949
|
+
return null;
|
|
17950
|
+
}
|
|
17951
|
+
return appManifestResult.data;
|
|
17952
|
+
}
|
|
17953
|
+
function pathToGlobby(path2) {
|
|
17954
|
+
return path2.replaceAll("\\", "/");
|
|
17955
|
+
}
|
|
17940
17956
|
async function readExtensionManifest(directoryPath) {
|
|
17941
17957
|
const manifestFilePath = join3(directoryPath, "extension.json");
|
|
17942
17958
|
if (!await pathExists(manifestFilePath)) {
|
|
@@ -17953,7 +17969,7 @@ function generateAppManifest(model) {
|
|
|
17953
17969
|
case "BACK_OFFICE_EXTENSION_MENU_ITEM":
|
|
17954
17970
|
return manifest;
|
|
17955
17971
|
case "BACK_OFFICE_EXTENSION_WIDGET":
|
|
17956
|
-
if (manifest.compData.backOfficeExtensionWidget.iframeUrl) {
|
|
17972
|
+
if (manifest.compData.backOfficeExtensionWidget.iframeUrl != null) {
|
|
17957
17973
|
return manifest;
|
|
17958
17974
|
}
|
|
17959
17975
|
return {
|
|
@@ -17966,7 +17982,7 @@ function generateAppManifest(model) {
|
|
|
17966
17982
|
}
|
|
17967
17983
|
};
|
|
17968
17984
|
case "BACK_OFFICE_MODAL":
|
|
17969
|
-
if (manifest.compData.backOfficeModal.iframeUrl) {
|
|
17985
|
+
if (manifest.compData.backOfficeModal.iframeUrl != null) {
|
|
17970
17986
|
return manifest;
|
|
17971
17987
|
}
|
|
17972
17988
|
return {
|
|
@@ -17979,7 +17995,7 @@ function generateAppManifest(model) {
|
|
|
17979
17995
|
}
|
|
17980
17996
|
};
|
|
17981
17997
|
case "BACK_OFFICE_PAGE":
|
|
17982
|
-
if (manifest.compData.backOfficePage.iframeUrl) {
|
|
17998
|
+
if (manifest.compData.backOfficePage.iframeUrl != null) {
|
|
17983
17999
|
return manifest;
|
|
17984
18000
|
}
|
|
17985
18001
|
return {
|
|
@@ -17992,7 +18008,7 @@ function generateAppManifest(model) {
|
|
|
17992
18008
|
}
|
|
17993
18009
|
};
|
|
17994
18010
|
case "ECOM_ADDITIONAL_FEES":
|
|
17995
|
-
if (manifest.compData.ecomAdditionalFees.deploymentUri) {
|
|
18011
|
+
if (manifest.compData.ecomAdditionalFees.deploymentUri != null) {
|
|
17996
18012
|
return manifest;
|
|
17997
18013
|
}
|
|
17998
18014
|
return {
|
|
@@ -18005,7 +18021,7 @@ function generateAppManifest(model) {
|
|
|
18005
18021
|
}
|
|
18006
18022
|
};
|
|
18007
18023
|
case "ECOM_DISCOUNTS_TRIGGER":
|
|
18008
|
-
if (manifest.compData.ecomDiscountsTrigger.deploymentUri) {
|
|
18024
|
+
if (manifest.compData.ecomDiscountsTrigger.deploymentUri != null) {
|
|
18009
18025
|
return manifest;
|
|
18010
18026
|
}
|
|
18011
18027
|
return {
|
|
@@ -18018,7 +18034,7 @@ function generateAppManifest(model) {
|
|
|
18018
18034
|
}
|
|
18019
18035
|
};
|
|
18020
18036
|
case "ECOM_PAYMENT_SETTINGS":
|
|
18021
|
-
if (manifest.compData.ecomPaymentSettings.deploymentUri) {
|
|
18037
|
+
if (manifest.compData.ecomPaymentSettings.deploymentUri != null) {
|
|
18022
18038
|
return manifest;
|
|
18023
18039
|
}
|
|
18024
18040
|
return {
|
|
@@ -18031,7 +18047,7 @@ function generateAppManifest(model) {
|
|
|
18031
18047
|
}
|
|
18032
18048
|
};
|
|
18033
18049
|
case "ECOM_SHIPPING_RATES":
|
|
18034
|
-
if (manifest.compData.ecomShippingRates.deploymentUri) {
|
|
18050
|
+
if (manifest.compData.ecomShippingRates.deploymentUri != null) {
|
|
18035
18051
|
return manifest;
|
|
18036
18052
|
}
|
|
18037
18053
|
return {
|
|
@@ -18044,7 +18060,7 @@ function generateAppManifest(model) {
|
|
|
18044
18060
|
}
|
|
18045
18061
|
};
|
|
18046
18062
|
case "ECOM_VALIDATIONS":
|
|
18047
|
-
if (manifest.compData.ecomValidations.deploymentUri) {
|
|
18063
|
+
if (manifest.compData.ecomValidations.deploymentUri != null) {
|
|
18048
18064
|
return manifest;
|
|
18049
18065
|
}
|
|
18050
18066
|
return {
|
|
@@ -18057,7 +18073,7 @@ function generateAppManifest(model) {
|
|
|
18057
18073
|
}
|
|
18058
18074
|
};
|
|
18059
18075
|
case "GIFT_CARDS_PROVIDER":
|
|
18060
|
-
if (manifest.compData.giftCardsProvider.deploymentUri) {
|
|
18076
|
+
if (manifest.compData.giftCardsProvider.deploymentUri != null) {
|
|
18061
18077
|
return manifest;
|
|
18062
18078
|
}
|
|
18063
18079
|
return {
|
|
@@ -18070,7 +18086,7 @@ function generateAppManifest(model) {
|
|
|
18070
18086
|
}
|
|
18071
18087
|
};
|
|
18072
18088
|
case "WEBHOOK":
|
|
18073
|
-
if (manifest.compData.webhook.callbackUrl) {
|
|
18089
|
+
if (manifest.compData.webhook.callbackUrl != null) {
|
|
18074
18090
|
return manifest;
|
|
18075
18091
|
}
|
|
18076
18092
|
return {
|
|
@@ -18098,28 +18114,28 @@ function generateAppManifest(model) {
|
|
|
18098
18114
|
// src/utils/isValidBackofficeComponent.ts
|
|
18099
18115
|
init_esm_shims();
|
|
18100
18116
|
function isValidBackofficeComponent(component) {
|
|
18101
|
-
return component.type === "BackofficePage" &&
|
|
18117
|
+
return component.type === "BackofficePage" && component.manifest.compData.backOfficePage.iframeUrl == null || component.type === "BackofficeExtensionWidget" && component.manifest.compData.backOfficeExtensionWidget.iframeUrl == null || component.type === "BackofficeModal" && component.manifest.compData.backOfficeModal.iframeUrl == null;
|
|
18102
18118
|
}
|
|
18103
18119
|
|
|
18104
18120
|
// src/utils/isValidServicePluginComponent.ts
|
|
18105
18121
|
init_esm_shims();
|
|
18106
18122
|
function isValidServicePluginComponent(component) {
|
|
18107
|
-
return component.type === "EcomShippingRates" &&
|
|
18123
|
+
return component.type === "EcomShippingRates" && component.manifest.compData.ecomShippingRates.deploymentUri == null || component.type === "EcomAdditionalFees" && component.manifest.compData.ecomAdditionalFees.deploymentUri == null || component.type === "EcomDiscountsTrigger" && component.manifest.compData.ecomDiscountsTrigger.deploymentUri == null || component.type === "EcomValidations" && component.manifest.compData.ecomValidations.deploymentUri == null || component.type === "EcomPaymentSettings" && component.manifest.compData.ecomPaymentSettings.deploymentUri == null || component.type === "EcomGiftCardsProvider" && component.manifest.compData.giftCardsProvider.deploymentUri == null;
|
|
18108
18124
|
}
|
|
18109
18125
|
|
|
18110
18126
|
// src/utils/isValidWebhookComponent.ts
|
|
18111
18127
|
init_esm_shims();
|
|
18112
18128
|
function isValidWebhookComponent(component) {
|
|
18113
|
-
return component.type === "Webhook" &&
|
|
18129
|
+
return component.type === "Webhook" && component.manifest.compData.webhook.callbackUrl == null;
|
|
18114
18130
|
}
|
|
18115
18131
|
|
|
18116
18132
|
// src/utils/resolveBuildMetadata.ts
|
|
18117
18133
|
init_esm_shims();
|
|
18118
|
-
import { fileURLToPath as
|
|
18134
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
18119
18135
|
async function resolveBuildMetadata(appManifestPath, config) {
|
|
18120
|
-
const outDir =
|
|
18121
|
-
const buildClientDir =
|
|
18122
|
-
const buildServerDir =
|
|
18136
|
+
const outDir = fileURLToPath3(config.outDir);
|
|
18137
|
+
const buildClientDir = fileURLToPath3(config.build.client);
|
|
18138
|
+
const buildServerDir = fileURLToPath3(config.build.server);
|
|
18123
18139
|
const clientDir = await pathExists(buildClientDir) ? buildClientDir : outDir;
|
|
18124
18140
|
const serverDir = await pathExists(buildServerDir) ? buildServerDir : void 0;
|
|
18125
18141
|
return {
|
|
@@ -18327,8 +18343,8 @@ var createIntegration = (options = {
|
|
|
18327
18343
|
async "astro:build:done"({ logger }) {
|
|
18328
18344
|
model ??= await createProjectModel(logger);
|
|
18329
18345
|
const appManifest = generateAppManifest(model);
|
|
18330
|
-
const outDir =
|
|
18331
|
-
const rootDir =
|
|
18346
|
+
const outDir = fileURLToPath4(_config.outDir);
|
|
18347
|
+
const rootDir = fileURLToPath4(_config.root);
|
|
18332
18348
|
const appManifestPath = join7(outDir, "_wix/app-manifest.json");
|
|
18333
18349
|
await writeJson(appManifestPath, appManifest, { spaces: 2 });
|
|
18334
18350
|
await writeJson(
|
|
@@ -18337,7 +18353,7 @@ var createIntegration = (options = {
|
|
|
18337
18353
|
{ spaces: 2 }
|
|
18338
18354
|
);
|
|
18339
18355
|
},
|
|
18340
|
-
"astro:config:done":
|
|
18356
|
+
"astro:config:done": ({ config }) => {
|
|
18341
18357
|
_config = config;
|
|
18342
18358
|
},
|
|
18343
18359
|
async "astro:config:setup"({
|
|
@@ -18351,8 +18367,8 @@ var createIntegration = (options = {
|
|
|
18351
18367
|
updateConfig
|
|
18352
18368
|
}) {
|
|
18353
18369
|
const codegenDirURL = createCodegenDir();
|
|
18354
|
-
const codegenDir =
|
|
18355
|
-
const rootDir =
|
|
18370
|
+
const codegenDir = fileURLToPath4(codegenDirURL);
|
|
18371
|
+
const rootDir = fileURLToPath4(config.root);
|
|
18356
18372
|
model ??= await createProjectModel(logger);
|
|
18357
18373
|
injectScript(
|
|
18358
18374
|
"before-hydration",
|
|
@@ -18408,7 +18424,7 @@ var createIntegration = (options = {
|
|
|
18408
18424
|
plugins: [
|
|
18409
18425
|
patchGlobal(),
|
|
18410
18426
|
patchAstroInlineScripts(),
|
|
18411
|
-
setupSsrContext()
|
|
18427
|
+
setupSsrContext(rootDir)
|
|
18412
18428
|
]
|
|
18413
18429
|
}
|
|
18414
18430
|
});
|
|
@@ -18561,7 +18577,7 @@ var createIntegration = (options = {
|
|
|
18561
18577
|
}
|
|
18562
18578
|
await writeVirtualBackofficeExtensionFiles(model, backofficeCodegenDir);
|
|
18563
18579
|
},
|
|
18564
|
-
"astro:server:setup":
|
|
18580
|
+
"astro:server:setup": ({ logger, server }) => {
|
|
18565
18581
|
server.middlewares.use(async (req, res, next) => {
|
|
18566
18582
|
if (req.url === "/_wix/app-manifest.json") {
|
|
18567
18583
|
const model2 = await createProjectModel(logger);
|