@wix/astro 1.0.9 → 1.0.11
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 +18 -12
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +12 -9
- package/src/utils/resolveBuildMetadata.ts +14 -7
package/build/index.js
CHANGED
|
@@ -12286,6 +12286,7 @@ var require_lib = __commonJS({
|
|
|
12286
12286
|
init_esm_shims();
|
|
12287
12287
|
var import_chokidar = __toESM(require_chokidar(), 1);
|
|
12288
12288
|
import { join as join6 } from "node:path";
|
|
12289
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
12289
12290
|
import { envField, passthroughImageService } from "astro/config";
|
|
12290
12291
|
|
|
12291
12292
|
// ../../node_modules/outdent/lib-module/index.js
|
|
@@ -18045,13 +18046,17 @@ function isValidWebhookComponent(component) {
|
|
|
18045
18046
|
|
|
18046
18047
|
// src/utils/resolveBuildMetadata.ts
|
|
18047
18048
|
init_esm_shims();
|
|
18049
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
18048
18050
|
async function resolveBuildMetadata(appManifestPath, config) {
|
|
18049
|
-
const
|
|
18050
|
-
const
|
|
18051
|
+
const outDir = fileURLToPath2(config.outDir);
|
|
18052
|
+
const buildClientDir = fileURLToPath2(config.build.client);
|
|
18053
|
+
const buildServerDir = fileURLToPath2(config.build.server);
|
|
18054
|
+
const clientDir = await pathExists(buildClientDir) ? buildClientDir : outDir;
|
|
18055
|
+
const serverDir = await pathExists(buildServerDir) ? buildServerDir : void 0;
|
|
18051
18056
|
return {
|
|
18052
18057
|
appManifestPath,
|
|
18053
18058
|
clientDir,
|
|
18054
|
-
outDir
|
|
18059
|
+
outDir,
|
|
18055
18060
|
serverDir
|
|
18056
18061
|
};
|
|
18057
18062
|
}
|
|
@@ -18238,13 +18243,12 @@ var createIntegration = () => {
|
|
|
18238
18243
|
async "astro:build:done"({ logger }) {
|
|
18239
18244
|
model ??= await createProjectModel(logger);
|
|
18240
18245
|
const appManifest = generateAppManifest(model);
|
|
18241
|
-
const
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
);
|
|
18246
|
+
const outDir = fileURLToPath3(_config.outDir);
|
|
18247
|
+
const rootDir = fileURLToPath3(_config.root);
|
|
18248
|
+
const appManifestPath = join6(outDir, "_wix/app-manifest.json");
|
|
18245
18249
|
await writeJson(appManifestPath, appManifest, { spaces: 2 });
|
|
18246
18250
|
await writeJson(
|
|
18247
|
-
join6(
|
|
18251
|
+
join6(rootDir, GIT_IGNORED_DIR, "build-metadata.json"),
|
|
18248
18252
|
await resolveBuildMetadata(appManifestPath, _config),
|
|
18249
18253
|
{ spaces: 2 }
|
|
18250
18254
|
);
|
|
@@ -18262,7 +18266,9 @@ var createIntegration = () => {
|
|
|
18262
18266
|
logger,
|
|
18263
18267
|
updateConfig
|
|
18264
18268
|
}) {
|
|
18265
|
-
const
|
|
18269
|
+
const codegenDirURL = createCodegenDir();
|
|
18270
|
+
const codegenDir = fileURLToPath3(codegenDirURL);
|
|
18271
|
+
const rootDir = fileURLToPath3(config.outDir);
|
|
18266
18272
|
model ??= await createProjectModel(logger);
|
|
18267
18273
|
injectScript(
|
|
18268
18274
|
"before-hydration",
|
|
@@ -18367,7 +18373,7 @@ var createIntegration = () => {
|
|
|
18367
18373
|
prerender: false
|
|
18368
18374
|
});
|
|
18369
18375
|
import_chokidar.default.watch([EXTENSIONS_DIR], {
|
|
18370
|
-
cwd:
|
|
18376
|
+
cwd: rootDir,
|
|
18371
18377
|
ignoreInitial: true,
|
|
18372
18378
|
useFsEvents: false
|
|
18373
18379
|
}).on("all", async () => {
|
|
@@ -18405,7 +18411,7 @@ var createIntegration = () => {
|
|
|
18405
18411
|
prerender: false
|
|
18406
18412
|
});
|
|
18407
18413
|
import_chokidar.default.watch([EXTENSIONS_DIR], {
|
|
18408
|
-
cwd:
|
|
18414
|
+
cwd: rootDir,
|
|
18409
18415
|
ignoreInitial: true,
|
|
18410
18416
|
useFsEvents: false
|
|
18411
18417
|
}).on("all", async () => {
|
|
@@ -18443,7 +18449,7 @@ var createIntegration = () => {
|
|
|
18443
18449
|
prerender: false
|
|
18444
18450
|
});
|
|
18445
18451
|
import_chokidar.default.watch([EXTENSIONS_DIR], {
|
|
18446
|
-
cwd:
|
|
18452
|
+
cwd: rootDir,
|
|
18447
18453
|
ignoreInitial: true,
|
|
18448
18454
|
useFsEvents: false
|
|
18449
18455
|
}).on("all", async () => {
|