astro 5.14.4 → 5.14.5
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/components/Font.astro +1 -1
- package/dist/cli/create-key/core/create-key.d.ts +8 -0
- package/dist/cli/create-key/core/create-key.js +12 -0
- package/dist/cli/create-key/definitions.d.ts +3 -0
- package/dist/cli/create-key/definitions.js +0 -0
- package/dist/cli/create-key/infra/crypto-key-generator.d.ts +2 -0
- package/dist/cli/create-key/infra/crypto-key-generator.js +13 -0
- package/dist/cli/index.js +9 -3
- package/dist/content/content-layer.js +3 -3
- package/dist/core/build/plugins/plugin-manifest.js +1 -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/types/public/config.d.ts +1 -0
- package/package.json +3 -3
- package/types/content.d.ts +1 -1
- package/dist/cli/create-key/index.d.ts +0 -6
- package/dist/cli/create-key/index.js +0 -27
package/components/Font.astro
CHANGED
|
@@ -25,10 +25,10 @@ if (!data) {
|
|
|
25
25
|
}
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
<style set:html={data.css}></style>
|
|
28
29
|
{
|
|
29
30
|
preload &&
|
|
30
31
|
data.preloadData.map(({ url, type }) => (
|
|
31
32
|
<link rel="preload" href={url} as="font" type={`font/${type}`} crossorigin />
|
|
32
33
|
))
|
|
33
34
|
}
|
|
34
|
-
<style set:html={data.css}></style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Logger } from '../../../core/logger/core.js';
|
|
2
|
+
import type { KeyGenerator } from '../definitions.js';
|
|
3
|
+
interface CreateKeyOptions {
|
|
4
|
+
logger: Logger;
|
|
5
|
+
keyGenerator: KeyGenerator;
|
|
6
|
+
}
|
|
7
|
+
export declare function createKey({ logger, keyGenerator }: CreateKeyOptions): Promise<void>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
async function createKey({ logger, keyGenerator }) {
|
|
2
|
+
const key = await keyGenerator.generate();
|
|
3
|
+
logger.info(
|
|
4
|
+
"crypto",
|
|
5
|
+
`Generated a key to encrypt props passed to server islands. To reuse the same key across builds, set this value as ASTRO_KEY in an environment variable on your build server.
|
|
6
|
+
|
|
7
|
+
ASTRO_KEY=${key}`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
createKey
|
|
12
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createKey, encodeKey } from "../../../core/encryption.js";
|
|
2
|
+
function createCryptoKeyGenerator() {
|
|
3
|
+
return {
|
|
4
|
+
async generate() {
|
|
5
|
+
const key = await createKey();
|
|
6
|
+
const encoded = await encodeKey(key);
|
|
7
|
+
return encoded;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
createCryptoKeyGenerator
|
|
13
|
+
};
|
package/dist/cli/index.js
CHANGED
|
@@ -79,9 +79,15 @@ async function runCommand(cmd, flags) {
|
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
case "create-key": {
|
|
82
|
-
const { createKey } = await
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
const [{ createKey }, { createLoggerFromFlags }, { createCryptoKeyGenerator }] = await Promise.all([
|
|
83
|
+
import("./create-key/core/create-key.js"),
|
|
84
|
+
import("./flags.js"),
|
|
85
|
+
import("./create-key/infra/crypto-key-generator.js")
|
|
86
|
+
]);
|
|
87
|
+
const logger = createLoggerFromFlags(flags);
|
|
88
|
+
const keyGenerator = createCryptoKeyGenerator();
|
|
89
|
+
await createKey({ logger, keyGenerator });
|
|
90
|
+
return;
|
|
85
91
|
}
|
|
86
92
|
case "docs": {
|
|
87
93
|
const { docs } = await import("./docs/index.js");
|
|
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
|
|
|
164
164
|
logger.info("Content config changed");
|
|
165
165
|
shouldClear = true;
|
|
166
166
|
}
|
|
167
|
-
if (previousAstroVersion && previousAstroVersion !== "5.14.
|
|
167
|
+
if (previousAstroVersion && previousAstroVersion !== "5.14.5") {
|
|
168
168
|
logger.info("Astro version changed");
|
|
169
169
|
shouldClear = true;
|
|
170
170
|
}
|
|
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
|
|
|
172
172
|
logger.info("Clearing content store");
|
|
173
173
|
this.#store.clearAll();
|
|
174
174
|
}
|
|
175
|
-
if ("5.14.
|
|
176
|
-
await this.#store.metaStore().set("astro-version", "5.14.
|
|
175
|
+
if ("5.14.5") {
|
|
176
|
+
await this.#store.metaStore().set("astro-version", "5.14.5");
|
|
177
177
|
}
|
|
178
178
|
if (currentConfigDigest) {
|
|
179
179
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
|
@@ -193,7 +193,7 @@ async function buildManifest(opts, internals, staticFiles, encodedKey) {
|
|
|
193
193
|
for (const route of opts.routesList.routes) {
|
|
194
194
|
const pageData = internals.pagesByKeys.get(makePageDataKey(route.route, route.component));
|
|
195
195
|
if (!pageData) continue;
|
|
196
|
-
if (route.prerender && !needsStaticHeaders) {
|
|
196
|
+
if (route.prerender && route.type !== "redirect" && !needsStaticHeaders) {
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
199
|
const scripts = [];
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.14.
|
|
25
|
+
const currentVersion = "5.14.5";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.js
CHANGED
|
@@ -37,7 +37,7 @@ function serverStart({
|
|
|
37
37
|
host,
|
|
38
38
|
base
|
|
39
39
|
}) {
|
|
40
|
-
const version = "5.14.
|
|
40
|
+
const version = "5.14.5";
|
|
41
41
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
42
42
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
43
43
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -274,7 +274,7 @@ function printHelp({
|
|
|
274
274
|
message.push(
|
|
275
275
|
linebreak(),
|
|
276
276
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
277
|
-
`v${"5.14.
|
|
277
|
+
`v${"5.14.5"}`
|
|
278
278
|
)} ${headline}`
|
|
279
279
|
);
|
|
280
280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.5",
|
|
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",
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"zod-to-json-schema": "^3.24.6",
|
|
151
151
|
"zod-to-ts": "^1.2.0",
|
|
152
152
|
"@astrojs/internal-helpers": "0.7.4",
|
|
153
|
-
"@astrojs/
|
|
154
|
-
"@astrojs/
|
|
153
|
+
"@astrojs/markdown-remark": "6.3.8",
|
|
154
|
+
"@astrojs/telemetry": "3.3.0"
|
|
155
155
|
},
|
|
156
156
|
"optionalDependencies": {
|
|
157
157
|
"sharp": "^0.34.0"
|
package/types/content.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare module 'astro:content' {
|
|
|
10
10
|
} from 'astro/content/config';
|
|
11
11
|
|
|
12
12
|
export function defineLiveCollection<
|
|
13
|
-
L extends import('astro/
|
|
13
|
+
L extends import('astro/loaders').LiveLoader,
|
|
14
14
|
S extends import('astro/content/config').BaseSchema | undefined = undefined,
|
|
15
15
|
>(
|
|
16
16
|
config: import('astro/content/config').LiveCollectionConfig<L, S>,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { createNodeLogger } from "../../core/config/logging.js";
|
|
2
|
-
import { createKey as createCryptoKey, encodeKey } from "../../core/encryption.js";
|
|
3
|
-
import { flagsToAstroInlineConfig } from "../flags.js";
|
|
4
|
-
async function createKey({ flags }) {
|
|
5
|
-
try {
|
|
6
|
-
const inlineConfig = flagsToAstroInlineConfig(flags);
|
|
7
|
-
const logger = createNodeLogger(inlineConfig);
|
|
8
|
-
const keyPromise = createCryptoKey();
|
|
9
|
-
const key = await keyPromise;
|
|
10
|
-
const encoded = await encodeKey(key);
|
|
11
|
-
logger.info(
|
|
12
|
-
"crypto",
|
|
13
|
-
`Generated a key to encrypt props passed to Server islands. To reuse the same key across builds, set this value as ASTRO_KEY in an environment variable on your build server.
|
|
14
|
-
|
|
15
|
-
ASTRO_KEY=${encoded}`
|
|
16
|
-
);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
if (err != null) {
|
|
19
|
-
console.error(err.toString());
|
|
20
|
-
}
|
|
21
|
-
return 1;
|
|
22
|
-
}
|
|
23
|
-
return 0;
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
createKey
|
|
27
|
-
};
|