astro 3.0.0 → 3.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/index.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
// The `ts-expect-error` comments here are necessary because we're importing this file inside the `astro:components`
|
|
2
|
+
// virtual module's types, which means that `tsc` will try to resolve these imports. Don't mind the editor errors.
|
|
3
|
+
// @ts-expect-error
|
|
1
4
|
export { default as Code } from './Code.astro';
|
|
5
|
+
// @ts-expect-error
|
|
2
6
|
export { default as Debug } from './Debug.astro';
|
package/dist/@types/astro.d.ts
CHANGED
|
@@ -890,7 +890,7 @@ export interface AstroUserConfig {
|
|
|
890
890
|
image?: {
|
|
891
891
|
/**
|
|
892
892
|
* @docs
|
|
893
|
-
* @name image.service
|
|
893
|
+
* @name image.service
|
|
894
894
|
* @type {{entrypoint: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | string, config: Record<string, any>}}
|
|
895
895
|
* @default `{entrypoint: 'astro/assets/services/sharp', config?: {}}`
|
|
896
896
|
* @version 2.1.0
|
|
@@ -913,14 +913,14 @@ export interface AstroUserConfig {
|
|
|
913
913
|
service: ImageServiceConfig;
|
|
914
914
|
/**
|
|
915
915
|
* @docs
|
|
916
|
-
* @name image.domains
|
|
916
|
+
* @name image.domains
|
|
917
917
|
* @type {string[]}
|
|
918
918
|
* @default `{domains: []}`
|
|
919
919
|
* @version 2.10.10
|
|
920
920
|
* @description
|
|
921
921
|
* Defines a list of permitted image source domains for local image optimization. No other remote images will be optimized by Astro.
|
|
922
922
|
*
|
|
923
|
-
* This option requires an array of individual domain names as strings. Wildcards are not permitted. Instead, use [`image.remotePatterns`](#imageremotepatterns
|
|
923
|
+
* This option requires an array of individual domain names as strings. Wildcards are not permitted. Instead, use [`image.remotePatterns`](#imageremotepatterns) to define a list of allowed source URL patterns.
|
|
924
924
|
*
|
|
925
925
|
* ```js
|
|
926
926
|
* // astro.config.mjs
|
|
@@ -935,7 +935,7 @@ export interface AstroUserConfig {
|
|
|
935
935
|
domains?: string[];
|
|
936
936
|
/**
|
|
937
937
|
* @docs
|
|
938
|
-
* @name image.remotePatterns
|
|
938
|
+
* @name image.remotePatterns
|
|
939
939
|
* @type {RemotePattern[]}
|
|
940
940
|
* @default `{remotePatterns: []}`
|
|
941
941
|
* @version 2.10.10
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import boxen from "boxen";
|
|
2
2
|
import { execa } from "execa";
|
|
3
3
|
import { bold, cyan, dim, magenta } from "kleur/colors";
|
|
4
|
-
import { createRequire } from "node:module";
|
|
5
4
|
import ora from "ora";
|
|
6
5
|
import prompts from "prompts";
|
|
6
|
+
import resolvePackage from "resolve";
|
|
7
7
|
import whichPm from "which-pm";
|
|
8
8
|
import {} from "../core/logger/core.js";
|
|
9
9
|
async function getPackage(packageName, logger, options, otherDeps = []) {
|
|
10
|
-
const require2 = createRequire(options.cwd ?? process.cwd());
|
|
11
10
|
let packageImport;
|
|
12
11
|
try {
|
|
13
|
-
|
|
12
|
+
await tryResolve(packageName, options.cwd ?? process.cwd());
|
|
14
13
|
packageImport = await import(packageName);
|
|
15
14
|
} catch (e) {
|
|
16
15
|
logger.info(
|
|
@@ -26,6 +25,23 @@ async function getPackage(packageName, logger, options, otherDeps = []) {
|
|
|
26
25
|
}
|
|
27
26
|
return packageImport;
|
|
28
27
|
}
|
|
28
|
+
function tryResolve(packageName, cwd) {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
resolvePackage(
|
|
31
|
+
packageName,
|
|
32
|
+
{
|
|
33
|
+
basedir: cwd
|
|
34
|
+
},
|
|
35
|
+
(err) => {
|
|
36
|
+
if (err) {
|
|
37
|
+
reject(err);
|
|
38
|
+
} else {
|
|
39
|
+
resolve(0);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
29
45
|
function getInstallCommand(packages, packageManager) {
|
|
30
46
|
switch (packageManager) {
|
|
31
47
|
case "npm":
|
package/dist/core/build/index.js
CHANGED
|
@@ -174,6 +174,10 @@ class AstroBuilder {
|
|
|
174
174
|
'The option `build.split` won\'t take effect, because `output` is not `"server"` or `"hybrid"`.'
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
+
this.logger.warn(
|
|
178
|
+
"configuration",
|
|
179
|
+
"The option `build.split` is deprecated. Use the adapter options."
|
|
180
|
+
);
|
|
177
181
|
}
|
|
178
182
|
if (config.build.excludeMiddleware === true) {
|
|
179
183
|
if (config.output === "static") {
|
|
@@ -182,13 +186,10 @@ class AstroBuilder {
|
|
|
182
186
|
'The option `build.excludeMiddleware` won\'t take effect, because `output` is not `"server"` or `"hybrid"`.'
|
|
183
187
|
);
|
|
184
188
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
'The option `build.split` can only be used when `output` is set to `"server"`.'
|
|
190
|
-
);
|
|
191
|
-
}
|
|
189
|
+
this.logger.warn(
|
|
190
|
+
"configuration",
|
|
191
|
+
"The option `build.excludeMiddleware` is deprecated. Use the adapter options."
|
|
192
|
+
);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
/** Stats */
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
|
|
|
20
20
|
base: restart.container.settings.config.base
|
|
21
21
|
})
|
|
22
22
|
);
|
|
23
|
-
const currentVersion = "3.0.
|
|
23
|
+
const currentVersion = "3.0.2";
|
|
24
24
|
if (currentVersion.includes("-")) {
|
|
25
25
|
logger.warn(null, msg.prerelease({ currentVersion }));
|
|
26
26
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -50,7 +50,7 @@ function serverStart({
|
|
|
50
50
|
base,
|
|
51
51
|
isRestart = false
|
|
52
52
|
}) {
|
|
53
|
-
const version = "3.0.
|
|
53
|
+
const version = "3.0.2";
|
|
54
54
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
55
55
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
56
56
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -235,7 +235,7 @@ function printHelp({
|
|
|
235
235
|
message.push(
|
|
236
236
|
linebreak(),
|
|
237
237
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
238
|
-
`v${"3.0.
|
|
238
|
+
`v${"3.0.2"}`
|
|
239
239
|
)} ${headline}`
|
|
240
240
|
);
|
|
241
241
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.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",
|
|
@@ -143,6 +143,7 @@
|
|
|
143
143
|
"preferred-pm": "^3.0.3",
|
|
144
144
|
"prompts": "^2.4.2",
|
|
145
145
|
"rehype": "^12.0.1",
|
|
146
|
+
"resolve": "^1.22.4",
|
|
146
147
|
"semver": "^7.5.4",
|
|
147
148
|
"server-destroy": "^1.0.1",
|
|
148
149
|
"sharp": "^0.32.5",
|
|
@@ -182,6 +183,7 @@
|
|
|
182
183
|
"@types/mime": "^3.0.1",
|
|
183
184
|
"@types/mocha": "^10.0.1",
|
|
184
185
|
"@types/prompts": "^2.4.4",
|
|
186
|
+
"@types/resolve": "^1.20.2",
|
|
185
187
|
"@types/send": "^0.17.1",
|
|
186
188
|
"@types/server-destroy": "^1.0.1",
|
|
187
189
|
"@types/unist": "^2.0.7",
|