astro 4.8.1 → 4.8.3
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
CHANGED
|
@@ -1596,14 +1596,14 @@ export interface AstroUserConfig {
|
|
|
1596
1596
|
* @name experimental.actions
|
|
1597
1597
|
* @type {boolean}
|
|
1598
1598
|
* @default `false`
|
|
1599
|
-
* @version 4.
|
|
1599
|
+
* @version 4.8.0
|
|
1600
1600
|
* @description
|
|
1601
1601
|
*
|
|
1602
1602
|
* Actions help you write type-safe backend functions you can call from anywhere. Enable server rendering [using the `output` property](https://docs.astro.build/en/basics/rendering-modes/#on-demand-rendered) and add the `actions` flag to the `experimental` object:
|
|
1603
1603
|
*
|
|
1604
1604
|
* ```js
|
|
1605
1605
|
* {
|
|
1606
|
-
*
|
|
1606
|
+
* output: 'hybrid', // or 'server'
|
|
1607
1607
|
* experimental: {
|
|
1608
1608
|
* actions: true,
|
|
1609
1609
|
* },
|
|
@@ -1623,20 +1623,20 @@ export interface AstroUserConfig {
|
|
|
1623
1623
|
* export const server = {
|
|
1624
1624
|
* like: defineAction({
|
|
1625
1625
|
* input: z.object({ postId: z.string() }),
|
|
1626
|
-
* handler: async ({ postId }
|
|
1626
|
+
* handler: async ({ postId }) => {
|
|
1627
1627
|
* // update likes in db
|
|
1628
1628
|
*
|
|
1629
1629
|
* return likes;
|
|
1630
1630
|
* },
|
|
1631
1631
|
* }),
|
|
1632
1632
|
* comment: defineAction({
|
|
1633
|
-
*
|
|
1633
|
+
* accept: 'form',
|
|
1634
1634
|
* input: z.object({
|
|
1635
1635
|
* postId: z.string(),
|
|
1636
1636
|
* author: z.string(),
|
|
1637
1637
|
* body: z.string(),
|
|
1638
1638
|
* }),
|
|
1639
|
-
* handler: async ({ postId }
|
|
1639
|
+
* handler: async ({ postId }) => {
|
|
1640
1640
|
* // insert comments in db
|
|
1641
1641
|
*
|
|
1642
1642
|
* return comment;
|
package/dist/actions/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { viteID } from "../core/util.js";
|
|
2
3
|
import { ACTIONS_TYPES_FILE, RESOLVED_VIRTUAL_MODULE_ID, VIRTUAL_MODULE_ID } from "./consts.js";
|
|
3
4
|
function astroActions() {
|
|
4
5
|
return {
|
|
@@ -6,7 +7,7 @@ function astroActions() {
|
|
|
6
7
|
hooks: {
|
|
7
8
|
async "astro:config:setup"(params) {
|
|
8
9
|
const stringifiedActionsImport = JSON.stringify(
|
|
9
|
-
new URL("actions", params.config.srcDir)
|
|
10
|
+
viteID(new URL("./actions", params.config.srcDir))
|
|
10
11
|
);
|
|
11
12
|
params.updateConfig({
|
|
12
13
|
vite: {
|
|
@@ -23,7 +24,7 @@ function astroActions() {
|
|
|
23
24
|
});
|
|
24
25
|
params.addMiddleware({
|
|
25
26
|
entrypoint: "astro/actions/runtime/middleware.js",
|
|
26
|
-
order: "
|
|
27
|
+
order: "post"
|
|
27
28
|
});
|
|
28
29
|
await typegen({
|
|
29
30
|
stringifiedActionsImport,
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -19,7 +19,7 @@ async function dev(inlineConfig) {
|
|
|
19
19
|
await telemetry.record([]);
|
|
20
20
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
21
21
|
const logger = restart.container.logger;
|
|
22
|
-
const currentVersion = "4.8.
|
|
22
|
+
const currentVersion = "4.8.3";
|
|
23
23
|
const isPrerelease = currentVersion.includes("-");
|
|
24
24
|
if (!isPrerelease) {
|
|
25
25
|
try {
|
|
@@ -36,7 +36,7 @@ async function dev(inlineConfig) {
|
|
|
36
36
|
}
|
|
37
37
|
logger.warn(
|
|
38
38
|
"SKIP_FORMAT",
|
|
39
|
-
msg.newVersionAvailable({
|
|
39
|
+
await msg.newVersionAvailable({
|
|
40
40
|
latestVersion: version
|
|
41
41
|
})
|
|
42
42
|
);
|
package/dist/core/messages.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare function serverShortcuts({ key, label }: {
|
|
|
25
25
|
}): string;
|
|
26
26
|
export declare function newVersionAvailable({ latestVersion }: {
|
|
27
27
|
latestVersion: string;
|
|
28
|
-
}): string
|
|
28
|
+
}): Promise<string>;
|
|
29
29
|
export declare function telemetryNotice(): string;
|
|
30
30
|
export declare function telemetryEnabled(): string;
|
|
31
31
|
export declare function preferenceEnabled(name: string): string;
|
package/dist/core/messages.js
CHANGED
|
@@ -37,7 +37,7 @@ function serverStart({
|
|
|
37
37
|
host,
|
|
38
38
|
base
|
|
39
39
|
}) {
|
|
40
|
-
const version = "4.8.
|
|
40
|
+
const version = "4.8.3";
|
|
41
41
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
42
42
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
43
43
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -70,10 +70,10 @@ function serverStart({
|
|
|
70
70
|
function serverShortcuts({ key, label }) {
|
|
71
71
|
return [dim(" Press"), key, dim("to"), label].join(" ");
|
|
72
72
|
}
|
|
73
|
-
function newVersionAvailable({ latestVersion }) {
|
|
73
|
+
async function newVersionAvailable({ latestVersion }) {
|
|
74
74
|
const badge = bgYellow(black(` update `));
|
|
75
75
|
const headline = yellow(`\u25B6 New version of Astro available: ${latestVersion}`);
|
|
76
|
-
const execCommand = getExecCommand();
|
|
76
|
+
const execCommand = await getExecCommand();
|
|
77
77
|
const details = ` Run ${cyan(`${execCommand} @astrojs/upgrade`)} to update`;
|
|
78
78
|
return ["", `${badge} ${headline}`, details, ""].join("\n");
|
|
79
79
|
}
|
|
@@ -269,7 +269,7 @@ function printHelp({
|
|
|
269
269
|
message.push(
|
|
270
270
|
linebreak(),
|
|
271
271
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
272
|
-
`v${"4.8.
|
|
272
|
+
`v${"4.8.3"}`
|
|
273
273
|
)} ${headline}`
|
|
274
274
|
);
|
|
275
275
|
}
|
|
@@ -48,7 +48,7 @@ async function matchRoute(pathname, manifestData, pipeline) {
|
|
|
48
48
|
throw e;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
const altPathname = pathname.replace(/(
|
|
51
|
+
const altPathname = pathname.replace(/\/index\.html$/, "/").replace(/\.html$/, "");
|
|
52
52
|
if (altPathname !== pathname) {
|
|
53
53
|
return await matchRoute(altPathname, manifestData, pipeline);
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"dlv": "^1.1.3",
|
|
132
132
|
"dset": "^3.1.3",
|
|
133
133
|
"es-module-lexer": "^1.5.2",
|
|
134
|
-
"esbuild": "^0.21.
|
|
134
|
+
"esbuild": "^0.21.2",
|
|
135
135
|
"estree-walker": "^3.0.3",
|
|
136
136
|
"execa": "^8.0.1",
|
|
137
137
|
"fast-glob": "^3.3.2",
|
|
@@ -152,8 +152,8 @@
|
|
|
152
152
|
"prompts": "^2.4.2",
|
|
153
153
|
"rehype": "^13.0.1",
|
|
154
154
|
"resolve": "^1.22.8",
|
|
155
|
-
"semver": "^7.6.
|
|
156
|
-
"shiki": "^1.5.
|
|
155
|
+
"semver": "^7.6.2",
|
|
156
|
+
"shiki": "^1.5.1",
|
|
157
157
|
"string-width": "^7.1.0",
|
|
158
158
|
"strip-ansi": "^7.1.0",
|
|
159
159
|
"tsconfck": "^3.0.3",
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"rehype-toc": "^3.0.2",
|
|
209
209
|
"remark-code-titles": "^0.1.2",
|
|
210
210
|
"rollup": "^4.17.2",
|
|
211
|
-
"sass": "^1.77.
|
|
211
|
+
"sass": "^1.77.1",
|
|
212
212
|
"srcset-parse": "^1.1.0",
|
|
213
213
|
"unified": "^11.0.4",
|
|
214
214
|
"astro-scripts": "0.0.14"
|