astro 1.0.5 → 1.0.8

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 +2 -2
  2. package/dist/core/add/index.js +10 -7
  3. package/dist/core/build/generate.js +3 -6
  4. package/dist/core/build/graph.js +7 -6
  5. package/dist/core/build/index.js +5 -4
  6. package/dist/core/build/internal.js +13 -0
  7. package/dist/core/build/page-data.js +2 -2
  8. package/dist/core/build/static-build.js +14 -27
  9. package/dist/core/build/vite-plugin-analyzer.js +2 -2
  10. package/dist/core/build/vite-plugin-css.js +16 -7
  11. package/dist/core/build/vite-plugin-ssr.js +3 -3
  12. package/dist/core/config.js +1 -1
  13. package/dist/core/create-vite.js +1 -1
  14. package/dist/core/dev/index.js +6 -6
  15. package/dist/core/errors.js +1 -1
  16. package/dist/core/messages.js +4 -5
  17. package/dist/core/util.js +1 -1
  18. package/dist/integrations/index.js +99 -35
  19. package/dist/jsx/babel.js +14 -0
  20. package/dist/runtime/client/idle.js +1 -0
  21. package/dist/runtime/client/idle.prebuilt.js +1 -1
  22. package/dist/runtime/client/load.js +1 -0
  23. package/dist/runtime/client/load.prebuilt.js +1 -1
  24. package/dist/runtime/client/media.js +1 -0
  25. package/dist/runtime/client/media.prebuilt.js +1 -1
  26. package/dist/runtime/client/only.js +1 -0
  27. package/dist/runtime/client/only.prebuilt.js +1 -1
  28. package/dist/runtime/client/visible.js +1 -0
  29. package/dist/runtime/client/visible.prebuilt.js +1 -1
  30. package/dist/runtime/server/astro-global.js +1 -1
  31. package/dist/runtime/server/astro-island.js +9 -1
  32. package/dist/runtime/server/astro-island.prebuilt.js +1 -1
  33. package/dist/runtime/server/render/astro.js +4 -0
  34. package/dist/runtime/server/render/component.js +7 -2
  35. package/dist/runtime/server/render/page.js +13 -6
  36. package/dist/types/@types/astro.d.ts +2 -3
  37. package/dist/types/core/build/graph.d.ts +2 -2
  38. package/dist/types/core/build/internal.d.ts +7 -0
  39. package/dist/types/core/build/types.d.ts +3 -1
  40. package/dist/types/integrations/index.d.ts +19 -9
  41. package/dist/types/runtime/client/idle.prebuilt.d.ts +1 -1
  42. package/dist/types/runtime/client/load.prebuilt.d.ts +1 -1
  43. package/dist/types/runtime/client/media.prebuilt.d.ts +1 -1
  44. package/dist/types/runtime/client/only.prebuilt.d.ts +1 -1
  45. package/dist/types/runtime/client/visible.prebuilt.d.ts +1 -1
  46. package/dist/types/runtime/server/astro-island.d.ts +1 -1
  47. package/dist/types/runtime/server/astro-island.prebuilt.d.ts +1 -1
  48. package/dist/types/runtime/server/render/astro.d.ts +1 -0
  49. package/dist/types/runtime/server/render/page.d.ts +7 -1
  50. package/dist/types/vite-plugin-integrations-container/index.d.ts +3 -1
  51. package/dist/vite-plugin-astro-server/index.js +2 -7
  52. package/dist/vite-plugin-integrations-container/index.js +3 -2
  53. package/dist/vite-plugin-jsx/index.js +91 -99
  54. package/dist/vite-plugin-jsx/tag.js +28 -16
  55. package/dist/vite-plugin-markdown/index.js +1 -0
  56. package/package.json +2 -2
package/astro-jsx.d.ts CHANGED
@@ -548,7 +548,7 @@ declare namespace astroHTML.JSX {
548
548
  | 'strict-origin-when-cross-origin'
549
549
  | 'unsafe-url';
550
550
 
551
- type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top';
551
+ type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});
552
552
 
553
553
  interface AnchorHTMLAttributes extends HTMLAttributes {
554
554
  download?: string | boolean | undefined | null;
@@ -756,7 +756,7 @@ declare namespace astroHTML.JSX {
756
756
  size?: number | string | undefined | null;
757
757
  src?: string | undefined | null;
758
758
  step?: number | string | undefined | null;
759
- type?: HTMLInputTypeAttribute | string | undefined | null;
759
+ type?: HTMLInputTypeAttribute | undefined | null;
760
760
  value?: string | string[] | number | undefined | null;
761
761
  width?: number | string | undefined | null;
762
762
  }
@@ -517,7 +517,7 @@ ${message}`
517
517
  }
518
518
  }
519
519
  async function fetchPackageJson(scope, name, tag) {
520
- const packageName = `${scope ? `@${scope}/` : ""}${name}`;
520
+ const packageName = `${scope ? `${scope}/` : ""}${name}`;
521
521
  const res = await fetch(`https://registry.npmjs.org/${packageName}/${tag}`);
522
522
  if (res.status === 404) {
523
523
  return new Error();
@@ -535,10 +535,12 @@ async function validateIntegrations(integrations) {
535
535
  throw new Error(`${bold(integration)} does not appear to be a valid package name!`);
536
536
  }
537
537
  let { scope, name, tag } = parsed;
538
- let pkgJson = null;
539
- let pkgType = "first-party";
540
- if (!scope) {
541
- const firstPartyPkgCheck = await fetchPackageJson("astrojs", name, tag);
538
+ let pkgJson;
539
+ let pkgType;
540
+ if (scope && scope !== "@astrojs") {
541
+ pkgType = "third-party";
542
+ } else {
543
+ const firstPartyPkgCheck = await fetchPackageJson("@astrojs", name, tag);
542
544
  if (firstPartyPkgCheck instanceof Error) {
543
545
  spinner.warn(
544
546
  yellow(`${bold(integration)} is not an official Astro package. Use at your own risk!`)
@@ -559,6 +561,7 @@ async function validateIntegrations(integrations) {
559
561
  spinner.start("Resolving with third party packages...");
560
562
  pkgType = "third-party";
561
563
  } else {
564
+ pkgType = "first-party";
562
565
  pkgJson = firstPartyPkgCheck;
563
566
  }
564
567
  }
@@ -570,8 +573,8 @@ async function validateIntegrations(integrations) {
570
573
  pkgJson = thirdPartyPkgCheck;
571
574
  }
572
575
  }
573
- const resolvedScope = pkgType === "first-party" ? "astrojs" : scope;
574
- const packageName = `${resolvedScope ? `@${resolvedScope}/` : ""}${name}`;
576
+ const resolvedScope = pkgType === "first-party" ? "@astrojs" : scope;
577
+ const packageName = `${resolvedScope ? `${resolvedScope}/` : ""}${name}`;
575
578
  let dependencies = [
576
579
  [pkgJson["name"], `^${pkgJson["version"]}`]
577
580
  ];
@@ -19,7 +19,7 @@ import { createRequest } from "../request.js";
19
19
  import { matchRoute } from "../routing/match.js";
20
20
  import { getOutputFilename } from "../util.js";
21
21
  import { getOutFile, getOutFolder } from "./common.js";
22
- import { eachPageData, getPageDataByComponent } from "./internal.js";
22
+ import { eachPageData, getPageDataByComponent, sortedCSS } from "./internal.js";
23
23
  import { getTimeStat } from "./util.js";
24
24
  const MAX_CONCURRENT_RENDERS = 1;
25
25
  function* throttle(max, inPaths) {
@@ -79,7 +79,7 @@ async function generatePage(opts, internals, pageData, ssrEntry, builtPaths) {
79
79
  let timeStart = performance.now();
80
80
  const renderers = ssrEntry.renderers;
81
81
  const pageInfo = getPageDataByComponent(internals, pageData.route.component);
82
- const linkIds = Array.from((pageInfo == null ? void 0 : pageInfo.css) ?? []);
82
+ const linkIds = sortedCSS(pageData);
83
83
  const scripts = (pageInfo == null ? void 0 : pageInfo.hoistedScript) ?? null;
84
84
  const pageModule = ssrEntry.pageMap.get(pageData.component);
85
85
  if (!pageModule) {
@@ -141,9 +141,6 @@ async function getPathsForRoute(pageData, mod, opts, builtPaths) {
141
141
  });
142
142
  opts.routeCache.set(route, result);
143
143
  paths = result.staticPaths.map((staticPath) => staticPath.params && route.generate(staticPath.params)).filter((staticPath) => {
144
- if (!staticPath) {
145
- return false;
146
- }
147
144
  if (!builtPaths.has(removeTrailingForwardSlash(staticPath))) {
148
145
  return true;
149
146
  }
@@ -168,7 +165,7 @@ async function generatePath(pathname, opts, gopts) {
168
165
  }
169
166
  debug("build", `Generating: ${pathname}`);
170
167
  const site = astroConfig.base !== "/" ? joinPaths(((_a = astroConfig.site) == null ? void 0 : _a.toString()) || "http://localhost/", astroConfig.base) : astroConfig.site;
171
- const links = createLinkStylesheetElementSet(linkIds.reverse(), site);
168
+ const links = createLinkStylesheetElementSet(linkIds, site);
172
169
  const scripts = createModuleScriptsSet(hoistedScripts ? [hoistedScripts] : [], site);
173
170
  if (astroConfig._ctx.scripts.some((script) => script.stage === "page")) {
174
171
  const hashedFilePath = internals.entrySpecifierToBundleMap.get(PAGE_SCRIPT_ID);
@@ -1,22 +1,23 @@
1
1
  import { resolvedPagesVirtualModuleId } from "../app/index.js";
2
- function* walkParentInfos(id, ctx, seen = /* @__PURE__ */ new Set()) {
2
+ function* walkParentInfos(id, ctx, depth = 0, seen = /* @__PURE__ */ new Set()) {
3
3
  seen.add(id);
4
4
  const info = ctx.getModuleInfo(id);
5
5
  if (info) {
6
- yield info;
6
+ yield [info, depth];
7
7
  }
8
8
  const importers = ((info == null ? void 0 : info.importers) || []).concat((info == null ? void 0 : info.dynamicImporters) || []);
9
9
  for (const imp of importers) {
10
10
  if (seen.has(imp)) {
11
11
  continue;
12
12
  }
13
- yield* walkParentInfos(imp, ctx, seen);
13
+ yield* walkParentInfos(imp, ctx, ++depth, seen);
14
14
  }
15
15
  }
16
16
  function* getTopLevelPages(id, ctx) {
17
- for (const info of walkParentInfos(id, ctx)) {
18
- if ((info == null ? void 0 : info.importers[0]) === resolvedPagesVirtualModuleId) {
19
- yield info;
17
+ var _a;
18
+ for (const res of walkParentInfos(id, ctx)) {
19
+ if (((_a = res[0]) == null ? void 0 : _a.importers[0]) === resolvedPagesVirtualModuleId) {
20
+ yield res;
20
21
  }
21
22
  }
22
23
  }
@@ -38,7 +38,7 @@ class AstroBuilder {
38
38
  debug("build", "Initial setup...");
39
39
  const { logging } = this;
40
40
  this.timer.init = performance.now();
41
- this.config = await runHookConfigSetup({ config: this.config, command: "build" });
41
+ this.config = await runHookConfigSetup({ config: this.config, command: "build", logging });
42
42
  this.manifest = createRouteManifest({ config: this.config }, this.logging);
43
43
  const viteConfig = await createVite(
44
44
  {
@@ -51,7 +51,7 @@ class AstroBuilder {
51
51
  },
52
52
  { astroConfig: this.config, logging, mode: "build" }
53
53
  );
54
- await runHookConfigDone({ config: this.config });
54
+ await runHookConfigDone({ config: this.config, logging });
55
55
  return { viteConfig };
56
56
  }
57
57
  async build({ viteConfig }) {
@@ -60,7 +60,7 @@ class AstroBuilder {
60
60
  server: new URL("./server/", this.config.outDir),
61
61
  serverEntry: "entry.mjs"
62
62
  };
63
- await runHookBuildStart({ config: this.config, buildConfig });
63
+ await runHookBuildStart({ config: this.config, buildConfig, logging: this.logging });
64
64
  info(this.logging, "build", `output target: ${colors.green(this.config.output)}`);
65
65
  if (this.config._ctx.adapter) {
66
66
  info(this.logging, "build", `deploy adapter: ${colors.green(this.config._ctx.adapter.name)}`);
@@ -106,7 +106,8 @@ class AstroBuilder {
106
106
  config: this.config,
107
107
  buildConfig,
108
108
  pages: pageNames,
109
- routes: Object.values(allPages).map((pd) => pd.route)
109
+ routes: Object.values(allPages).map((pd) => pd.route),
110
+ logging: this.logging
110
111
  });
111
112
  if (this.logging.level && levels[this.logging.level] <= levels["info"]) {
112
113
  await this.printStats({
@@ -76,6 +76,18 @@ function hasPageDataByViteID(internals, viteid) {
76
76
  function* eachPageData(internals) {
77
77
  yield* internals.pagesByComponent.values();
78
78
  }
79
+ function sortedCSS(pageData) {
80
+ return Array.from(pageData.css).sort((a, b) => {
81
+ let depthA = a[1].depth, depthB = b[1].depth;
82
+ if (depthA === -1) {
83
+ return -1;
84
+ } else if (depthB === -1) {
85
+ return 1;
86
+ } else {
87
+ return depthA > depthB ? -1 : 1;
88
+ }
89
+ }).map(([id]) => id);
90
+ }
79
91
  export {
80
92
  createBuildInternals,
81
93
  eachPageData,
@@ -84,6 +96,7 @@ export {
84
96
  getPageDatasByChunk,
85
97
  getPageDatasByClientOnlyID,
86
98
  hasPageDataByViteID,
99
+ sortedCSS,
87
100
  trackClientOnlyPageDatas,
88
101
  trackPageData
89
102
  };
@@ -27,7 +27,7 @@ async function collectPagesData(opts) {
27
27
  component: route.component,
28
28
  route,
29
29
  moduleSpecifier: "",
30
- css: /* @__PURE__ */ new Set(),
30
+ css: /* @__PURE__ */ new Map(),
31
31
  hoistedScript: void 0
32
32
  };
33
33
  clearInterval(routeCollectionLogTimeout);
@@ -46,7 +46,7 @@ async function collectPagesData(opts) {
46
46
  component: route.component,
47
47
  route,
48
48
  moduleSpecifier: "",
49
- css: /* @__PURE__ */ new Set(),
49
+ css: /* @__PURE__ */ new Map(),
50
50
  hoistedScript: void 0
51
51
  };
52
52
  }
@@ -78,30 +78,27 @@ ${bgMagenta(black(" finalizing server assets "))}
78
78
  }
79
79
  }
80
80
  async function ssrBuild(opts, internals, input) {
81
- var _a, _b, _c, _d;
81
+ var _a, _b, _c;
82
82
  const { astroConfig, viteConfig } = opts;
83
83
  const ssr = astroConfig.output === "server";
84
84
  const out = ssr ? opts.buildConfig.server : astroConfig.outDir;
85
85
  const viteBuildConfig = {
86
+ ...viteConfig,
86
87
  logLevel: opts.viteConfig.logLevel ?? "error",
87
88
  mode: "production",
88
- css: viteConfig.css,
89
- optimizeDeps: {
90
- include: [...((_a = viteConfig.optimizeDeps) == null ? void 0 : _a.include) ?? []],
91
- exclude: [...((_b = viteConfig.optimizeDeps) == null ? void 0 : _b.exclude) ?? []]
92
- },
93
89
  build: {
94
90
  ...viteConfig.build,
95
91
  emptyOutDir: false,
96
92
  manifest: false,
97
93
  outDir: fileURLToPath(out),
98
94
  rollupOptions: {
95
+ ...(_a = viteConfig.build) == null ? void 0 : _a.rollupOptions,
99
96
  input: [],
100
97
  output: {
101
98
  format: "esm",
102
99
  chunkFileNames: "chunks/[name].[hash].mjs",
103
100
  assetFileNames: "assets/[name].[hash][extname]",
104
- ...(_d = (_c = viteConfig.build) == null ? void 0 : _c.rollupOptions) == null ? void 0 : _d.output,
101
+ ...(_c = (_b = viteConfig.build) == null ? void 0 : _b.rollupOptions) == null ? void 0 : _c.output,
105
102
  entryFileNames: opts.buildConfig.serverEntry
106
103
  }
107
104
  },
@@ -125,23 +122,19 @@ async function ssrBuild(opts, internals, input) {
125
122
  vitePluginAnalyzer(internals)
126
123
  ],
127
124
  publicDir: ssr ? false : viteConfig.publicDir,
128
- root: viteConfig.root,
129
- envPrefix: "PUBLIC_",
130
- server: viteConfig.server,
131
- base: astroConfig.base,
132
- ssr: viteConfig.ssr,
133
- resolve: viteConfig.resolve
125
+ envPrefix: "PUBLIC_"
134
126
  };
135
127
  await runHookBuildSetup({
136
128
  config: astroConfig,
137
129
  pages: internals.pagesByComponent,
138
130
  vite: viteBuildConfig,
139
- target: "server"
131
+ target: "server",
132
+ logging: opts.logging
140
133
  });
141
134
  return await vite.build(viteBuildConfig);
142
135
  }
143
136
  async function clientBuild(opts, internals, input) {
144
- var _a, _b, _c, _d;
137
+ var _a, _b, _c;
145
138
  const { astroConfig, viteConfig } = opts;
146
139
  const timer = performance.now();
147
140
  const ssr = astroConfig.output === "server";
@@ -155,26 +148,23 @@ async function clientBuild(opts, internals, input) {
155
148
  info(opts.logging, null, `
156
149
  ${bgGreen(black(" building client "))}`);
157
150
  const viteBuildConfig = {
151
+ ...viteConfig,
158
152
  logLevel: "info",
159
153
  mode: "production",
160
- css: viteConfig.css,
161
- optimizeDeps: {
162
- include: [...((_a = viteConfig.optimizeDeps) == null ? void 0 : _a.include) ?? []],
163
- exclude: [...((_b = viteConfig.optimizeDeps) == null ? void 0 : _b.exclude) ?? []]
164
- },
165
154
  build: {
166
155
  ...viteConfig.build,
167
156
  emptyOutDir: false,
168
157
  minify: "esbuild",
169
158
  outDir: fileURLToPath(out),
170
159
  rollupOptions: {
160
+ ...(_a = viteConfig.build) == null ? void 0 : _a.rollupOptions,
171
161
  input: Array.from(input),
172
162
  output: {
173
163
  format: "esm",
174
164
  entryFileNames: "[name].[hash].js",
175
165
  chunkFileNames: "chunks/[name].[hash].js",
176
166
  assetFileNames: "assets/[name].[hash][extname]",
177
- ...(_d = (_c = viteConfig.build) == null ? void 0 : _c.rollupOptions) == null ? void 0 : _d.output
167
+ ...(_c = (_b = viteConfig.build) == null ? void 0 : _b.rollupOptions) == null ? void 0 : _c.output
178
168
  },
179
169
  preserveEntrySignatures: "exports-only"
180
170
  },
@@ -191,17 +181,14 @@ ${bgGreen(black(" building client "))}`);
191
181
  }),
192
182
  ...viteConfig.plugins || []
193
183
  ],
194
- publicDir: viteConfig.publicDir,
195
- root: viteConfig.root,
196
- envPrefix: "PUBLIC_",
197
- server: viteConfig.server,
198
- base: astroConfig.base
184
+ envPrefix: "PUBLIC_"
199
185
  };
200
186
  await runHookBuildSetup({
201
187
  config: astroConfig,
202
188
  pages: internals.pagesByComponent,
203
189
  vite: viteBuildConfig,
204
- target: "client"
190
+ target: "client",
191
+ logging: opts.logging
205
192
  });
206
193
  const buildResult = await vite.build(viteBuildConfig);
207
194
  info(opts.logging, null, dim(`Completed in ${getTimeStat(timer, performance.now())}.
@@ -15,7 +15,7 @@ function vitePluginAnalyzer(internals) {
15
15
  hoistedScripts.add(hid);
16
16
  }
17
17
  if (hoistedScripts.size) {
18
- for (const pageInfo of getTopLevelPages(from, this)) {
18
+ for (const [pageInfo] of getTopLevelPages(from, this)) {
19
19
  const pageId = pageInfo.id;
20
20
  for (const hid of hoistedScripts) {
21
21
  if (pageScripts.has(pageId)) {
@@ -77,7 +77,7 @@ function vitePluginAnalyzer(internals) {
77
77
  internals.discoveredClientOnlyComponents.add(cid);
78
78
  clientOnlys.push(cid);
79
79
  }
80
- for (const pageInfo of getTopLevelPages(id, this)) {
80
+ for (const [pageInfo] of getTopLevelPages(id, this)) {
81
81
  const pageData = getPageDataByViteID(internals, pageInfo.id);
82
82
  if (!pageData)
83
83
  continue;
@@ -20,19 +20,19 @@ function rollupPluginAstroBuildCSS(options) {
20
20
  return named;
21
21
  }
22
22
  function createNameForParentPages(id, ctx) {
23
- const parents = Array.from(getTopLevelPages(id, ctx)).sort();
24
- const proposedName = parents.map((page) => nameifyPage(page.id)).join("-");
23
+ const parents = Array.from(getTopLevelPages(id, ctx));
24
+ const proposedName = parents.map(([page]) => nameifyPage(page.id)).sort().join("-");
25
25
  if (proposedName.length <= MAX_NAME_LENGTH) {
26
26
  return proposedName;
27
27
  }
28
28
  const hash = crypto.createHash("sha256");
29
- for (const page of parents) {
29
+ for (const [page] of parents) {
30
30
  hash.update(page.id, "utf-8");
31
31
  }
32
32
  return hash.digest("hex").slice(0, 8);
33
33
  }
34
34
  function* getParentClientOnlys(id, ctx) {
35
- for (const info of walkParentInfos(id, ctx)) {
35
+ for (const [info] of walkParentInfos(id, ctx)) {
36
36
  yield* getPageDatasByClientOnlyID(internals, info.id);
37
37
  }
38
38
  }
@@ -64,21 +64,30 @@ function rollupPluginAstroBuildCSS(options) {
64
64
  if ("viteMetadata" in chunk) {
65
65
  const meta = chunk["viteMetadata"];
66
66
  if (meta.importedCss.size) {
67
+ debugger;
67
68
  if (options.target === "client") {
68
69
  for (const [id] of Object.entries(c.modules)) {
69
70
  for (const pageData of getParentClientOnlys(id, this)) {
70
71
  for (const importedCssImport of meta.importedCss) {
71
- pageData.css.add(importedCssImport);
72
+ pageData.css.set(importedCssImport, { depth: -1 });
72
73
  }
73
74
  }
74
75
  }
75
76
  }
76
77
  for (const [id] of Object.entries(c.modules)) {
77
- for (const pageInfo of getTopLevelPages(id, this)) {
78
+ debugger;
79
+ for (const [pageInfo, depth] of getTopLevelPages(id, this)) {
78
80
  const pageViteID = pageInfo.id;
79
81
  const pageData = getPageDataByViteID(internals, pageViteID);
80
82
  for (const importedCssImport of meta.importedCss) {
81
- pageData == null ? void 0 : pageData.css.add(importedCssImport);
83
+ if (pageData == null ? void 0 : pageData.css.has(importedCssImport)) {
84
+ const cssInfo = pageData == null ? void 0 : pageData.css.get(importedCssImport);
85
+ if (depth < cssInfo.depth) {
86
+ cssInfo.depth = depth;
87
+ }
88
+ } else {
89
+ pageData == null ? void 0 : pageData.css.set(importedCssImport, { depth });
90
+ }
82
91
  }
83
92
  }
84
93
  }
@@ -6,7 +6,7 @@ import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from "../../vite-plugin-sc
6
6
  import { pagesVirtualModuleId } from "../app/index.js";
7
7
  import { serializeRouteData } from "../routing/index.js";
8
8
  import { addRollupInput } from "./add-rollup-input.js";
9
- import { eachPageData } from "./internal.js";
9
+ import { eachPageData, sortedCSS } from "./internal.js";
10
10
  const virtualModuleId = "@astrojs-ssr-virtual-entry";
11
11
  const resolvedVirtualModuleId = "\0" + virtualModuleId;
12
12
  const manifestReplace = "@@ASTRO_MANIFEST_REPLACE@@";
@@ -83,7 +83,7 @@ async function injectManifest(buildOpts, internals) {
83
83
  }
84
84
  const staticFiles = internals.staticFiles;
85
85
  const manifest = buildManifest(buildOpts, internals, Array.from(staticFiles));
86
- await runHookBuildSsr({ config: buildOpts.astroConfig, manifest });
86
+ await runHookBuildSsr({ config: buildOpts.astroConfig, manifest, logging: buildOpts.logging });
87
87
  const chunk = internals.ssrEntryChunk;
88
88
  const code = chunk.code;
89
89
  chunk.code = code.replace(replaceExp, () => {
@@ -110,7 +110,7 @@ function buildManifest(opts, internals, staticFiles) {
110
110
  }
111
111
  routes.push({
112
112
  file: "",
113
- links: Array.from(pageData.css).reverse(),
113
+ links: sortedCSS(pageData),
114
114
  scripts: [
115
115
  ...scripts,
116
116
  ...astroConfig._ctx.scripts.filter((script) => script.stage === "head-inline").map(({ stage, content }) => ({ stage, children: content }))
@@ -218,7 +218,7 @@ function resolveFlags(flags) {
218
218
  port: typeof flags.port === "number" ? flags.port : void 0,
219
219
  config: typeof flags.config === "string" ? flags.config : void 0,
220
220
  host: typeof flags.host === "string" || typeof flags.host === "boolean" ? flags.host : void 0,
221
- drafts: typeof flags.drafts === "boolean" ? flags.drafts : false
221
+ drafts: typeof flags.drafts === "boolean" ? flags.drafts : void 0
222
222
  };
223
223
  }
224
224
  function mergeCLIFlags(astroConfig, flags, cmd) {
@@ -52,7 +52,7 @@ async function createVite(commandConfig, { astroConfig, logging, mode }) {
52
52
  htmlVitePlugin(),
53
53
  jsxVitePlugin({ config: astroConfig, logging }),
54
54
  astroPostprocessVitePlugin({ config: astroConfig }),
55
- astroIntegrationsContainerPlugin({ config: astroConfig }),
55
+ astroIntegrationsContainerPlugin({ config: astroConfig, logging }),
56
56
  astroScriptsPageSSRPlugin({ config: astroConfig })
57
57
  ],
58
58
  publicDir: fileURLToPath(astroConfig.publicDir),
@@ -16,7 +16,7 @@ async function dev(config, options) {
16
16
  const devStart = performance.now();
17
17
  applyPolyfill();
18
18
  await options.telemetry.record([]);
19
- config = await runHookConfigSetup({ config, command: "dev" });
19
+ config = await runHookConfigSetup({ config, command: "dev", logging: options.logging });
20
20
  const { host, port } = config.server;
21
21
  const rendererClientEntries = config._ctx.renderers.map((r) => r.clientEntrypoint).filter(Boolean);
22
22
  const viteConfig = await createVite(
@@ -29,9 +29,9 @@ async function dev(config, options) {
29
29
  },
30
30
  { astroConfig: config, logging: options.logging, mode: "dev" }
31
31
  );
32
- await runHookConfigDone({ config });
32
+ await runHookConfigDone({ config, logging: options.logging });
33
33
  const viteServer = await vite.createServer(viteConfig);
34
- runHookServerSetup({ config, server: viteServer });
34
+ runHookServerSetup({ config, server: viteServer, logging: options.logging });
35
35
  await viteServer.listen(port);
36
36
  const devServerAddressInfo = viteServer.httpServer.address();
37
37
  const site = config.site ? new URL(config.base, config.site) : void 0;
@@ -46,14 +46,14 @@ async function dev(config, options) {
46
46
  https: !!((_a = viteConfig.server) == null ? void 0 : _a.https)
47
47
  })
48
48
  );
49
- const currentVersion = "1.0.5";
49
+ const currentVersion = "1.0.8";
50
50
  if (currentVersion.includes("-")) {
51
51
  warn(options.logging, null, msg.prerelease({ currentVersion }));
52
52
  }
53
53
  if (((_c = (_b = viteConfig.server) == null ? void 0 : _b.fs) == null ? void 0 : _c.strict) === false) {
54
54
  warn(options.logging, null, msg.fsStrictWarning());
55
55
  }
56
- await runHookServerStart({ config, address: devServerAddressInfo });
56
+ await runHookServerStart({ config, address: devServerAddressInfo, logging: options.logging });
57
57
  return {
58
58
  address: devServerAddressInfo,
59
59
  get watcher() {
@@ -61,7 +61,7 @@ async function dev(config, options) {
61
61
  },
62
62
  stop: async () => {
63
63
  await viteServer.close();
64
- await runHookServerDone({ config });
64
+ await runHookServerDone({ config, logging: options.logging });
65
65
  }
66
66
  };
67
67
  }
@@ -12,7 +12,7 @@ var AstroErrorCodes = /* @__PURE__ */ ((AstroErrorCodes2) => {
12
12
  return AstroErrorCodes2;
13
13
  })(AstroErrorCodes || {});
14
14
  function cleanErrorStack(stack) {
15
- return stack.split(/\n/g).filter((l) => /^\s*at/.test(l)).map((l) => l.replace(/\/@fs\//g, "/")).join("\n");
15
+ return stack.split(/\n/g).map((l) => l.replace(/\/@fs\//g, "/")).join("\n");
16
16
  }
17
17
  function fixViteErrorMessage(_err, server, filePath) {
18
18
  var _a, _b;
@@ -15,7 +15,6 @@ import {
15
15
  yellow
16
16
  } from "kleur/colors";
17
17
  import os from "os";
18
- import { cleanErrorStack } from "./errors.js";
19
18
  import { emoji, getLocalAddress, padMultilineString } from "./util.js";
20
19
  const PREFIX_PADDING = 6;
21
20
  function req({
@@ -47,7 +46,7 @@ function devStart({
47
46
  https,
48
47
  site
49
48
  }) {
50
- const version = "1.0.5";
49
+ const version = "1.0.8";
51
50
  const rootPath = site ? site.pathname : "/";
52
51
  const localPrefix = `${dim("\u2503")} Local `;
53
52
  const networkPrefix = `${dim("\u2503")} Network `;
@@ -190,10 +189,10 @@ function formatErrorMessage(err, args = []) {
190
189
  args.push(red(padMultilineString(err.frame, 4)));
191
190
  }
192
191
  if (args.length === 1 && err.stack) {
193
- args.push(dim(cleanErrorStack(err.stack)));
192
+ args.push(dim(err.stack));
194
193
  } else if (err.stack) {
195
194
  args.push(` ${bold("Stacktrace:")}`);
196
- args.push(dim(cleanErrorStack(err.stack)));
195
+ args.push(dim(err.stack));
197
196
  args.push(``);
198
197
  }
199
198
  return args.join("\n");
@@ -226,7 +225,7 @@ function printHelp({
226
225
  message.push(
227
226
  linebreak(),
228
227
  ` ${bgGreen(black(` ${commandName} `))} ${green(
229
- `v${"1.0.5"}`
228
+ `v${"1.0.8"}`
230
229
  )} ${headline}`
231
230
  );
232
231
  }
package/dist/core/util.js CHANGED
@@ -5,7 +5,7 @@ import resolve from "resolve";
5
5
  import slash from "slash";
6
6
  import { fileURLToPath, pathToFileURL } from "url";
7
7
  import { prependForwardSlash, removeTrailingForwardSlash } from "./path.js";
8
- const ASTRO_VERSION = "1.0.5";
8
+ const ASTRO_VERSION = "1.0.8";
9
9
  function isObject(value) {
10
10
  return typeof value === "object" && value != null;
11
11
  }