astro 2.0.0 → 2.0.2
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/Code.astro +0 -1
- package/components/Shiki.js +3 -1
- package/dist/content/utils.js +2 -1
- package/dist/core/app/node.js +3 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/logger/core.js +9 -4
- package/dist/core/messages.js +2 -2
- package/dist/core/render/core.js +1 -1
- package/dist/runtime/server/render/component.js +2 -2
- package/package.json +3 -3
- package/src/content/template/types.d.ts +3 -3
package/components/Code.astro
CHANGED
package/components/Shiki.js
CHANGED
|
@@ -19,7 +19,9 @@ function stringify(opts) {
|
|
|
19
19
|
*/
|
|
20
20
|
async function resolveHighlighter(opts) {
|
|
21
21
|
const resolvedThemes = [];
|
|
22
|
-
if (
|
|
22
|
+
if (Object.keys(opts.theme).length) {
|
|
23
|
+
resolvedThemes.push(opts.theme);
|
|
24
|
+
} else if (opts.theme && opts.theme in themes) {
|
|
23
25
|
resolvedThemes.push(await themes[opts.theme]());
|
|
24
26
|
}
|
|
25
27
|
|
package/dist/content/utils.js
CHANGED
|
@@ -159,7 +159,8 @@ async function loadContentConfig({
|
|
|
159
159
|
return void 0;
|
|
160
160
|
}
|
|
161
161
|
try {
|
|
162
|
-
|
|
162
|
+
const configPathname = fileURLToPath(contentPaths.config);
|
|
163
|
+
unparsedConfig = await tempConfigServer.ssrLoadModule(configPathname);
|
|
163
164
|
} catch (e) {
|
|
164
165
|
throw e;
|
|
165
166
|
} finally {
|
package/dist/core/app/node.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
|
+
import { TLSSocket } from "tls";
|
|
2
3
|
import { deserializeManifest } from "./common.js";
|
|
3
4
|
import { App } from "./index.js";
|
|
4
5
|
const clientAddressSymbol = Symbol.for("astro.clientAddress");
|
|
5
6
|
function createRequestFromNodeRequest(req, body) {
|
|
6
7
|
var _a;
|
|
7
|
-
|
|
8
|
+
const protocol = req.socket instanceof TLSSocket || req.headers["x-forwarded-proto"] === "https" ? "https" : "http";
|
|
9
|
+
let url = `${protocol}://${req.headers.host}${req.url}`;
|
|
8
10
|
let rawHeaders = req.headers;
|
|
9
11
|
const entries = Object.entries(rawHeaders);
|
|
10
12
|
const method = req.method || "GET";
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -29,7 +29,7 @@ async function dev(settings, options) {
|
|
|
29
29
|
isRestart: options.isRestart
|
|
30
30
|
})
|
|
31
31
|
);
|
|
32
|
-
const currentVersion = "2.0.
|
|
32
|
+
const currentVersion = "2.0.2";
|
|
33
33
|
if (currentVersion.includes("-")) {
|
|
34
34
|
warn(options.logging, null, msg.prerelease({ currentVersion }));
|
|
35
35
|
}
|
package/dist/core/logger/core.js
CHANGED
|
@@ -55,10 +55,15 @@ function padStr(str, len) {
|
|
|
55
55
|
}
|
|
56
56
|
let defaultLogLevel;
|
|
57
57
|
if (typeof process !== "undefined") {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
let proc = process;
|
|
59
|
+
if ("argv" in proc && Array.isArray(proc.argv)) {
|
|
60
|
+
if (proc.argv.includes("--verbose")) {
|
|
61
|
+
defaultLogLevel = "debug";
|
|
62
|
+
} else if (proc.argv.includes("--silent")) {
|
|
63
|
+
defaultLogLevel = "silent";
|
|
64
|
+
} else {
|
|
65
|
+
defaultLogLevel = "info";
|
|
66
|
+
}
|
|
62
67
|
} else {
|
|
63
68
|
defaultLogLevel = "info";
|
|
64
69
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
base,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "2.0.
|
|
50
|
+
const version = "2.0.2";
|
|
51
51
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
52
52
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
53
53
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -233,7 +233,7 @@ function printHelp({
|
|
|
233
233
|
message.push(
|
|
234
234
|
linebreak(),
|
|
235
235
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
236
|
-
`v${"2.0.
|
|
236
|
+
`v${"2.0.2"}`
|
|
237
237
|
)} ${headline}`
|
|
238
238
|
);
|
|
239
239
|
}
|
package/dist/core/render/core.js
CHANGED
|
@@ -25,7 +25,7 @@ async function getParamsAndProps(opts) {
|
|
|
25
25
|
routeCache.set(route, routeCacheEntry);
|
|
26
26
|
}
|
|
27
27
|
const matchedStaticPath = findPathItemByKey(routeCacheEntry.staticPaths, params, route);
|
|
28
|
-
if (!matchedStaticPath &&
|
|
28
|
+
if (!matchedStaticPath && (ssr ? mod.prerender : true)) {
|
|
29
29
|
return 0 /* NoMatchingStaticPath */;
|
|
30
30
|
}
|
|
31
31
|
pageProps = (matchedStaticPath == null ? void 0 : matchedStaticPath.props) ? { ...matchedStaticPath.props } : {};
|
|
@@ -25,12 +25,12 @@ function guessRenderers(componentUrl) {
|
|
|
25
25
|
return ["@astrojs/vue"];
|
|
26
26
|
case "jsx":
|
|
27
27
|
case "tsx":
|
|
28
|
-
return ["@astrojs/react", "@astrojs/preact", "@astrojs/solid", "@astrojs/vue (jsx)"];
|
|
28
|
+
return ["@astrojs/react", "@astrojs/preact", "@astrojs/solid-js", "@astrojs/vue (jsx)"];
|
|
29
29
|
default:
|
|
30
30
|
return [
|
|
31
31
|
"@astrojs/react",
|
|
32
32
|
"@astrojs/preact",
|
|
33
|
-
"@astrojs/solid",
|
|
33
|
+
"@astrojs/solid-js",
|
|
34
34
|
"@astrojs/vue",
|
|
35
35
|
"@astrojs/svelte"
|
|
36
36
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@astrojs/compiler": "^1.0.1",
|
|
89
89
|
"@astrojs/language-server": "^0.28.3",
|
|
90
|
-
"@astrojs/markdown-remark": "^2.0.
|
|
90
|
+
"@astrojs/markdown-remark": "^2.0.1",
|
|
91
91
|
"@astrojs/telemetry": "^2.0.0",
|
|
92
92
|
"@astrojs/webapi": "^2.0.0",
|
|
93
93
|
"@babel/core": "^7.18.2",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"preferred-pm": "^3.0.3",
|
|
123
123
|
"prompts": "^2.4.2",
|
|
124
124
|
"rehype": "^12.0.1",
|
|
125
|
-
"semver": "^7.3.
|
|
125
|
+
"semver": "^7.3.8",
|
|
126
126
|
"server-destroy": "^1.0.1",
|
|
127
127
|
"shiki": "^0.11.1",
|
|
128
128
|
"slash": "^4.0.0",
|
|
@@ -44,10 +44,10 @@ declare module 'astro:content' {
|
|
|
44
44
|
): E extends ValidEntrySlug<C>
|
|
45
45
|
? Promise<CollectionEntry<C>>
|
|
46
46
|
: Promise<CollectionEntry<C> | undefined>;
|
|
47
|
-
export function getCollection<C extends keyof typeof entryMap
|
|
47
|
+
export function getCollection<C extends keyof typeof entryMap, E extends CollectionEntry<C>>(
|
|
48
48
|
collection: C,
|
|
49
|
-
filter?: (
|
|
50
|
-
): Promise<
|
|
49
|
+
filter?: (entry: CollectionEntry<C>) => entry is E
|
|
50
|
+
): Promise<E[]>;
|
|
51
51
|
|
|
52
52
|
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
|
53
53
|
Required<ContentConfig['collections'][C]>['schema']
|