astro 4.6.2 → 4.6.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.
Files changed (56) hide show
  1. package/astro-jsx.d.ts +0 -2
  2. package/components/Image.astro +1 -1
  3. package/components/Picture.astro +1 -1
  4. package/components/ViewTransitions.astro +9 -2
  5. package/dist/@types/astro.d.ts +38 -37
  6. package/dist/assets/endpoint/generic.js +3 -3
  7. package/dist/assets/endpoint/node.js +3 -3
  8. package/dist/assets/utils/emitAsset.d.ts +6 -1
  9. package/dist/assets/utils/emitAsset.js +15 -9
  10. package/dist/assets/vite-plugin-assets.js +9 -2
  11. package/dist/cli/add/index.js +3 -3
  12. package/dist/cli/install-package.js +3 -1
  13. package/dist/config/index.js +2 -2
  14. package/dist/content/runtime-assets.d.ts +1 -1
  15. package/dist/content/runtime-assets.js +2 -2
  16. package/dist/content/runtime.d.ts +1 -1
  17. package/dist/content/utils.d.ts +1 -1
  18. package/dist/content/utils.js +2 -2
  19. package/dist/content/vite-plugin-content-imports.js +10 -2
  20. package/dist/core/app/createOutgoingHttpHeaders.d.ts +1 -0
  21. package/dist/core/build/consts.d.ts +1 -0
  22. package/dist/core/build/consts.js +4 -0
  23. package/dist/core/build/index.js +2 -1
  24. package/dist/core/build/internal.d.ts +1 -0
  25. package/dist/core/build/internal.js +2 -1
  26. package/dist/core/build/plugin.d.ts +1 -1
  27. package/dist/core/build/plugins/plugin-content.js +135 -30
  28. package/dist/core/build/plugins/util.d.ts +1 -1
  29. package/dist/core/build/static-build.d.ts +1 -1
  30. package/dist/core/build/static-build.js +3 -2
  31. package/dist/core/config/config.d.ts +1 -0
  32. package/dist/core/config/config.js +10 -8
  33. package/dist/core/config/index.d.ts +1 -1
  34. package/dist/core/config/index.js +8 -1
  35. package/dist/core/config/schema.d.ts +333 -290
  36. package/dist/core/constants.js +1 -1
  37. package/dist/core/dev/dev.js +1 -1
  38. package/dist/core/messages.js +2 -2
  39. package/dist/core/render-context.d.ts +10 -1
  40. package/dist/core/render-context.js +38 -8
  41. package/dist/integrations/index.d.ts +2 -1
  42. package/dist/integrations/index.js +9 -2
  43. package/dist/runtime/client/dev-toolbar/apps/settings.js +3 -1
  44. package/dist/runtime/client/dev-toolbar/entrypoint.js +1 -1
  45. package/dist/runtime/client/dev-toolbar/toolbar.js +3 -1
  46. package/dist/runtime/server/astro-island.js +132 -137
  47. package/dist/runtime/server/astro-island.prebuilt-dev.d.ts +1 -1
  48. package/dist/runtime/server/astro-island.prebuilt-dev.js +1 -1
  49. package/dist/runtime/server/astro-island.prebuilt.d.ts +1 -1
  50. package/dist/runtime/server/astro-island.prebuilt.js +1 -1
  51. package/dist/transitions/router.js +4 -3
  52. package/dist/vite-plugin-astro/index.js +11 -4
  53. package/dist/vite-plugin-markdown/images.d.ts +0 -1
  54. package/dist/vite-plugin-markdown/images.js +1 -4
  55. package/dist/vite-plugin-markdown/index.js +8 -2
  56. package/package.json +46 -49
@@ -1,6 +1,5 @@
1
1
  export type MarkdownImagePath = {
2
2
  raw: string;
3
- resolved: string;
4
3
  safeName: string;
5
4
  };
6
5
  export declare function getMarkdownCodeForImages(imagePaths: MarkdownImagePath[], html: string): string;
@@ -1,10 +1,7 @@
1
1
  function getMarkdownCodeForImages(imagePaths, html) {
2
2
  return `
3
3
  import { getImage } from "astro:assets";
4
- ${imagePaths.map((entry) => {
5
- const prefix = entry.raw.includes("/") ? "" : "./";
6
- return `import Astro__${entry.safeName} from ${JSON.stringify(prefix + entry.raw)};`;
7
- }).join("\n")}
4
+ ${imagePaths.map((entry) => `import Astro__${entry.safeName} from ${JSON.stringify(entry.raw)};`).join("\n")}
8
5
 
9
6
  const images = async function(html) {
10
7
  const imageSources = {};
@@ -1,5 +1,4 @@
1
1
  import fs from "node:fs";
2
- import path from "node:path";
3
2
  import { fileURLToPath, pathToFileURL } from "node:url";
4
3
  import {
5
4
  InvalidAstroDataError,
@@ -29,6 +28,14 @@ function markdown({ settings, logger }) {
29
28
  buildEnd() {
30
29
  processor = void 0;
31
30
  },
31
+ async resolveId(source, importer, options) {
32
+ if (importer?.endsWith(".md") && source[0] !== "/") {
33
+ let resolved = await this.resolve(source, importer, options);
34
+ if (!resolved)
35
+ resolved = await this.resolve("./" + source, importer, options);
36
+ return resolved;
37
+ }
38
+ },
32
39
  // Why not the "transform" hook instead of "load" + readFile?
33
40
  // A: Vite transforms all "import.meta.env" references to their values before
34
41
  // passing to the transform hook. This lets us get the truly raw value
@@ -60,7 +67,6 @@ function markdown({ settings, logger }) {
60
67
  for (const imagePath of rawImagePaths.values()) {
61
68
  imagePaths.push({
62
69
  raw: imagePath,
63
- resolved: (await this.resolve(imagePath, id))?.id ?? path.join(path.dirname(id), imagePath),
64
70
  safeName: shorthash(imagePath)
65
71
  });
66
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.6.2",
3
+ "version": "4.6.4",
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",
@@ -103,65 +103,65 @@
103
103
  ],
104
104
  "dependencies": {
105
105
  "@astrojs/compiler": "^2.7.1",
106
- "@babel/core": "^7.24.3",
107
- "@babel/generator": "^7.23.3",
108
- "@babel/parser": "^7.23.3",
109
- "@babel/plugin-transform-react-jsx": "^7.22.5",
110
- "@babel/traverse": "^7.23.3",
111
- "@babel/types": "^7.23.3",
112
- "@types/babel__core": "^7.20.4",
113
- "@types/cookie": "^0.5.4",
114
- "acorn": "^8.11.2",
106
+ "@babel/core": "^7.24.4",
107
+ "@babel/generator": "^7.24.4",
108
+ "@babel/parser": "^7.24.4",
109
+ "@babel/plugin-transform-react-jsx": "^7.23.4",
110
+ "@babel/traverse": "^7.24.1",
111
+ "@babel/types": "^7.24.0",
112
+ "@types/babel__core": "^7.20.5",
113
+ "@types/cookie": "^0.6.0",
114
+ "acorn": "^8.11.3",
115
115
  "aria-query": "^5.3.0",
116
116
  "axobject-query": "^4.0.0",
117
117
  "boxen": "^7.1.1",
118
- "chokidar": "^3.5.3",
118
+ "chokidar": "^3.6.0",
119
119
  "ci-info": "^4.0.0",
120
- "clsx": "^2.0.0",
120
+ "clsx": "^2.1.0",
121
121
  "common-ancestor-path": "^1.0.1",
122
122
  "cookie": "^0.6.0",
123
123
  "cssesc": "^3.0.0",
124
124
  "debug": "^4.3.4",
125
- "deterministic-object-hash": "^2.0.1",
126
- "devalue": "^4.3.2",
127
- "diff": "^5.1.0",
125
+ "deterministic-object-hash": "^2.0.2",
126
+ "devalue": "^5.0.0",
127
+ "diff": "^5.2.0",
128
128
  "dlv": "^1.1.3",
129
129
  "dset": "^3.1.3",
130
- "es-module-lexer": "^1.4.1",
131
- "esbuild": "^0.19.6",
130
+ "es-module-lexer": "^1.5.0",
131
+ "esbuild": "^0.20.2",
132
132
  "estree-walker": "^3.0.3",
133
133
  "execa": "^8.0.1",
134
134
  "fast-glob": "^3.3.2",
135
- "flattie": "^1.1.0",
135
+ "flattie": "^1.1.1",
136
136
  "github-slugger": "^2.0.0",
137
137
  "gray-matter": "^4.0.3",
138
138
  "html-escaper": "^3.0.3",
139
139
  "http-cache-semantics": "^4.1.1",
140
140
  "js-yaml": "^4.1.0",
141
- "kleur": "^4.1.4",
142
- "magic-string": "^0.30.3",
143
- "mime": "^3.0.0",
144
- "ora": "^7.0.1",
141
+ "kleur": "^4.1.5",
142
+ "magic-string": "^0.30.10",
143
+ "mrmime": "^2.0.0",
144
+ "ora": "^8.0.1",
145
145
  "p-limit": "^5.0.0",
146
146
  "p-queue": "^8.0.1",
147
- "path-to-regexp": "^6.2.1",
148
- "preferred-pm": "^3.1.2",
147
+ "path-to-regexp": "^6.2.2",
148
+ "preferred-pm": "^3.1.3",
149
149
  "prompts": "^2.4.2",
150
150
  "rehype": "^13.0.1",
151
- "resolve": "^1.22.4",
152
- "semver": "^7.5.4",
153
- "shiki": "^1.1.2",
154
- "string-width": "^7.0.0",
151
+ "resolve": "^1.22.8",
152
+ "semver": "^7.6.0",
153
+ "shiki": "^1.3.0",
154
+ "string-width": "^7.1.0",
155
155
  "strip-ansi": "^7.1.0",
156
- "tsconfck": "^3.0.0",
156
+ "tsconfck": "^3.0.3",
157
157
  "unist-util-visit": "^5.0.0",
158
158
  "vfile": "^6.0.1",
159
- "vite": "^5.1.4",
159
+ "vite": "^5.2.10",
160
160
  "vitefu": "^0.2.5",
161
161
  "which-pm": "^2.1.1",
162
162
  "yargs-parser": "^21.1.1",
163
- "zod": "^3.22.4",
164
- "zod-to-json-schema": "^3.22.4",
163
+ "zod": "^3.23.0",
164
+ "zod-to-json-schema": "^3.22.5",
165
165
  "@astrojs/internal-helpers": "0.4.0",
166
166
  "@astrojs/markdown-remark": "5.1.0",
167
167
  "@astrojs/telemetry": "3.1.0"
@@ -170,43 +170,40 @@
170
170
  "sharp": "^0.32.6"
171
171
  },
172
172
  "devDependencies": {
173
- "@astrojs/check": "^0.5.8",
174
- "@playwright/test": "1.40.0",
173
+ "@astrojs/check": "^0.5.10",
174
+ "@playwright/test": "^1.43.1",
175
175
  "@types/aria-query": "^5.0.4",
176
- "@types/babel__generator": "^7.6.7",
177
- "@types/babel__traverse": "^7.20.4",
178
- "@types/chai": "^4.3.10",
176
+ "@types/babel__generator": "^7.6.8",
177
+ "@types/babel__traverse": "^7.20.5",
179
178
  "@types/common-ancestor-path": "^1.0.2",
180
179
  "@types/connect": "^3.4.38",
181
180
  "@types/cssesc": "^3.0.2",
182
181
  "@types/debug": "^4.1.12",
183
- "@types/diff": "^5.0.8",
182
+ "@types/diff": "^5.2.0",
184
183
  "@types/dlv": "^1.1.4",
185
184
  "@types/dom-view-transitions": "^1.0.4",
186
- "@types/hast": "^3.0.3",
185
+ "@types/hast": "^3.0.4",
187
186
  "@types/html-escaper": "^3.0.2",
188
187
  "@types/http-cache-semantics": "^4.0.4",
189
188
  "@types/js-yaml": "^4.0.9",
190
- "@types/mime": "^3.0.4",
191
- "@types/mocha": "^10.0.4",
192
- "@types/probe-image-size": "^7.2.3",
193
- "@types/prompts": "^2.4.8",
194
- "@types/resolve": "^1.20.5",
195
- "@types/semver": "^7.5.2",
189
+ "@types/probe-image-size": "^7.2.4",
190
+ "@types/prompts": "^2.4.9",
191
+ "@types/resolve": "^1.20.6",
192
+ "@types/semver": "^7.5.8",
196
193
  "@types/send": "^0.17.4",
197
194
  "@types/unist": "^3.0.2",
198
195
  "@types/yargs-parser": "^21.0.3",
199
196
  "cheerio": "1.0.0-rc.12",
200
197
  "eol": "^0.9.1",
201
- "memfs": "^4.6.0",
202
- "node-mocks-http": "^1.13.0",
198
+ "memfs": "^4.8.2",
199
+ "node-mocks-http": "^1.14.1",
203
200
  "parse-srcset": "^1.0.2",
204
201
  "rehype-autolink-headings": "^7.1.0",
205
202
  "rehype-slug": "^6.0.0",
206
203
  "rehype-toc": "^3.0.2",
207
204
  "remark-code-titles": "^0.1.2",
208
- "rollup": "^4.5.0",
209
- "sass": "^1.69.5",
205
+ "rollup": "^4.16.1",
206
+ "sass": "^1.75.0",
210
207
  "srcset-parse": "^1.1.0",
211
208
  "unified": "^11.0.4",
212
209
  "astro-scripts": "0.0.14"