astro 4.4.3 → 4.4.4
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/dist/@types/astro.d.ts +2 -1
- package/dist/cli/index.js +11 -2
- package/dist/cli/install-package.js +15 -4
- package/dist/core/build/static-build.js +1 -0
- package/dist/core/config/merge.js +6 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/preview/index.js +2 -1
- package/dist/runtime/server/transition.js +3 -0
- package/package.json +1 -1
package/dist/@types/astro.d.ts
CHANGED
|
@@ -212,7 +212,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
|
|
|
212
212
|
* <Fragment set:html={html} />
|
|
213
213
|
* ```
|
|
214
214
|
*
|
|
215
|
-
* A second
|
|
215
|
+
* A second parameter can be used to pass arguments to a slotted callback
|
|
216
216
|
*
|
|
217
217
|
* Example usage:
|
|
218
218
|
* ```astro
|
|
@@ -2459,6 +2459,7 @@ export interface PreviewServerParams {
|
|
|
2459
2459
|
port: number;
|
|
2460
2460
|
base: string;
|
|
2461
2461
|
logger: AstroIntegrationLogger;
|
|
2462
|
+
headers?: OutgoingHttpHeaders;
|
|
2462
2463
|
}
|
|
2463
2464
|
export type CreatePreviewServer = (params: PreviewServerParams) => PreviewServer | Promise<PreviewServer>;
|
|
2464
2465
|
export interface PreviewModule {
|
package/dist/cli/index.js
CHANGED
|
@@ -12,6 +12,7 @@ async function printAstroHelp() {
|
|
|
12
12
|
["add", "Add an integration."],
|
|
13
13
|
["build", "Build your project and write it to disk."],
|
|
14
14
|
["check", "Check your project for errors."],
|
|
15
|
+
["db", "Manage your Astro database."],
|
|
15
16
|
["dev", "Start the development server."],
|
|
16
17
|
["docs", "Open documentation in your web browser."],
|
|
17
18
|
["info", "List info about your current Astro setup."],
|
|
@@ -52,7 +53,11 @@ function resolveCommand(flags) {
|
|
|
52
53
|
"check",
|
|
53
54
|
"docs",
|
|
54
55
|
"db",
|
|
55
|
-
"info"
|
|
56
|
+
"info",
|
|
57
|
+
"login",
|
|
58
|
+
"loutout",
|
|
59
|
+
"link",
|
|
60
|
+
"init"
|
|
56
61
|
]);
|
|
57
62
|
if (supportedCommands.has(cmd)) {
|
|
58
63
|
return cmd;
|
|
@@ -108,7 +113,11 @@ async function runCommand(cmd, flags) {
|
|
|
108
113
|
await add(packages, { flags });
|
|
109
114
|
return;
|
|
110
115
|
}
|
|
111
|
-
case "db":
|
|
116
|
+
case "db":
|
|
117
|
+
case "login":
|
|
118
|
+
case "logout":
|
|
119
|
+
case "link":
|
|
120
|
+
case "init": {
|
|
112
121
|
const { db } = await import("./db/index.js");
|
|
113
122
|
await db({ flags });
|
|
114
123
|
return;
|
|
@@ -6,11 +6,22 @@ import prompts from "prompts";
|
|
|
6
6
|
import resolvePackage from "resolve";
|
|
7
7
|
import whichPm from "which-pm";
|
|
8
8
|
import {} from "../core/logger/core.js";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { sep } from "node:path";
|
|
11
|
+
const require2 = createRequire(import.meta.url);
|
|
9
12
|
async function getPackage(packageName, logger, options, otherDeps = []) {
|
|
10
|
-
let packageImport;
|
|
11
13
|
try {
|
|
14
|
+
if (packageName === "@astrojs/db") {
|
|
15
|
+
const packageJsonLoc = require2.resolve(packageName + "/package.json", {
|
|
16
|
+
paths: [options.cwd ?? process.cwd()]
|
|
17
|
+
});
|
|
18
|
+
const packageLoc = packageJsonLoc.replace(`package.json`, "dist/index.js");
|
|
19
|
+
const packageImport2 = await import(packageLoc);
|
|
20
|
+
return packageImport2;
|
|
21
|
+
}
|
|
12
22
|
await tryResolve(packageName, options.cwd ?? process.cwd());
|
|
13
|
-
packageImport = await import(packageName);
|
|
23
|
+
const packageImport = await import(packageName);
|
|
24
|
+
return packageImport;
|
|
14
25
|
} catch (e) {
|
|
15
26
|
logger.info(
|
|
16
27
|
null,
|
|
@@ -18,12 +29,12 @@ async function getPackage(packageName, logger, options, otherDeps = []) {
|
|
|
18
29
|
);
|
|
19
30
|
const result = await installPackage([packageName, ...otherDeps], options, logger);
|
|
20
31
|
if (result) {
|
|
21
|
-
packageImport = await import(packageName);
|
|
32
|
+
const packageImport = await import(packageName);
|
|
33
|
+
return packageImport;
|
|
22
34
|
} else {
|
|
23
35
|
return void 0;
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
|
-
return packageImport;
|
|
27
38
|
}
|
|
28
39
|
function tryResolve(packageName, cwd) {
|
|
29
40
|
return new Promise((resolve, reject) => {
|
|
@@ -7,7 +7,7 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
|
7
7
|
if (value == null) {
|
|
8
8
|
continue;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
let existing = merged[key];
|
|
11
11
|
if (existing == null) {
|
|
12
12
|
merged[key] = value;
|
|
13
13
|
continue;
|
|
@@ -26,6 +26,11 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
|
26
26
|
continue;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
if (key === "data" && rootPath === "db") {
|
|
30
|
+
if (!Array.isArray(existing) && !Array.isArray(value)) {
|
|
31
|
+
existing = [existing];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
29
34
|
if (Array.isArray(existing) || Array.isArray(value)) {
|
|
30
35
|
merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])];
|
|
31
36
|
continue;
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -23,7 +23,7 @@ async function dev(inlineConfig) {
|
|
|
23
23
|
base: restart.container.settings.config.base
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
-
const currentVersion = "4.4.
|
|
26
|
+
const currentVersion = "4.4.4";
|
|
27
27
|
if (currentVersion.includes("-")) {
|
|
28
28
|
logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
|
|
29
29
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -36,7 +36,7 @@ function serverStart({
|
|
|
36
36
|
host,
|
|
37
37
|
base
|
|
38
38
|
}) {
|
|
39
|
-
const version = "4.4.
|
|
39
|
+
const version = "4.4.4";
|
|
40
40
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
41
41
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
42
42
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -261,7 +261,7 @@ function printHelp({
|
|
|
261
261
|
message.push(
|
|
262
262
|
linebreak(),
|
|
263
263
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
264
|
-
`v${"4.4.
|
|
264
|
+
`v${"4.4.4"}`
|
|
265
265
|
)} ${headline}`
|
|
266
266
|
);
|
|
267
267
|
}
|
|
@@ -58,7 +58,8 @@ async function preview(inlineConfig) {
|
|
|
58
58
|
host: getResolvedHostForHttpServer(settings.config.server.host),
|
|
59
59
|
port: settings.config.server.port,
|
|
60
60
|
base: settings.config.base,
|
|
61
|
-
logger: new AstroIntegrationLogger(logger.options, settings.adapter.name)
|
|
61
|
+
logger: new AstroIntegrationLogger(logger.options, settings.adapter.name),
|
|
62
|
+
headers: settings.config.server.headers
|
|
62
63
|
});
|
|
63
64
|
return server;
|
|
64
65
|
}
|
|
@@ -43,6 +43,9 @@ function reEncode(s) {
|
|
|
43
43
|
return reEncodeInValidStart[result.codePointAt(0) ?? 0] ? "_" + result : result;
|
|
44
44
|
}
|
|
45
45
|
function renderTransition(result, hash, animationName, transitionName) {
|
|
46
|
+
if (typeof (transitionName ?? "") !== "string") {
|
|
47
|
+
throw new Error(`Invalid transition name {${transitionName}}`);
|
|
48
|
+
}
|
|
46
49
|
if (!animationName)
|
|
47
50
|
animationName = "fade";
|
|
48
51
|
const scope = createTransitionScope(result, hash);
|