astro 5.7.3 → 5.7.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.
Files changed (132) hide show
  1. package/dist/actions/runtime/virtual/server.js +9 -7
  2. package/dist/assets/fonts/config.d.ts +0 -16
  3. package/dist/assets/fonts/config.js +1 -2
  4. package/dist/assets/fonts/load.js +53 -26
  5. package/dist/assets/fonts/metrics.d.ts +1 -1
  6. package/dist/assets/fonts/metrics.js +1 -1
  7. package/dist/assets/fonts/providers/index.d.ts +1 -1
  8. package/dist/assets/fonts/providers/index.js +3 -2
  9. package/dist/assets/fonts/providers/local.d.ts +4 -1
  10. package/dist/assets/fonts/providers/local.js +7 -1
  11. package/dist/assets/fonts/utils.d.ts +3 -2
  12. package/dist/assets/fonts/utils.js +28 -19
  13. package/dist/assets/fonts/vite-plugin-fonts.js +11 -8
  14. package/dist/assets/services/service.d.ts +1 -1
  15. package/dist/assets/utils/etag.d.ts +0 -11
  16. package/dist/assets/utils/etag.js +1 -2
  17. package/dist/assets/utils/vendor/image-size/lookup.d.ts +0 -2
  18. package/dist/assets/utils/vendor/image-size/lookup.js +0 -10
  19. package/dist/cli/add/index.d.ts +0 -9
  20. package/dist/cli/add/index.js +1 -2
  21. package/dist/cli/info/index.d.ts +0 -1
  22. package/dist/cli/info/index.js +0 -1
  23. package/dist/cli/preferences/index.d.ts +0 -2
  24. package/dist/container/index.js +1 -6
  25. package/dist/content/content-layer.d.ts +2 -7
  26. package/dist/content/content-layer.js +4 -6
  27. package/dist/content/index.d.ts +1 -2
  28. package/dist/content/index.js +1 -5
  29. package/dist/content/loaders/file.d.ts +2 -1
  30. package/dist/content/loaders/glob.d.ts +3 -2
  31. package/dist/content/utils.d.ts +1 -12
  32. package/dist/content/utils.js +0 -13
  33. package/dist/content/vite-plugin-content-virtual-mod.d.ts +0 -16
  34. package/dist/content/vite-plugin-content-virtual-mod.js +1 -3
  35. package/dist/core/app/index.js +3 -4
  36. package/dist/core/app/pipeline.d.ts +2 -3
  37. package/dist/core/app/pipeline.js +1 -3
  38. package/dist/core/app/types.d.ts +3 -2
  39. package/dist/core/build/consts.d.ts +0 -1
  40. package/dist/core/build/consts.js +1 -3
  41. package/dist/core/build/index.d.ts +2 -1
  42. package/dist/core/build/page-data.d.ts +3 -2
  43. package/dist/core/build/plugin.d.ts +1 -1
  44. package/dist/core/build/plugins/plugin-analyzer.d.ts +0 -2
  45. package/dist/core/build/plugins/plugin-analyzer.js +1 -2
  46. package/dist/core/build/plugins/plugin-chunks.d.ts +0 -2
  47. package/dist/core/build/plugins/plugin-chunks.js +1 -2
  48. package/dist/core/build/plugins/plugin-component-entry.d.ts +0 -8
  49. package/dist/core/build/plugins/plugin-component-entry.js +1 -3
  50. package/dist/core/build/plugins/plugin-internals.d.ts +0 -2
  51. package/dist/core/build/plugins/plugin-internals.js +1 -2
  52. package/dist/core/build/plugins/plugin-renderers.d.ts +0 -2
  53. package/dist/core/build/plugins/plugin-renderers.js +1 -2
  54. package/dist/core/build/plugins/plugin-scripts.d.ts +0 -5
  55. package/dist/core/build/plugins/plugin-scripts.js +1 -2
  56. package/dist/core/build/plugins/plugin-ssr.d.ts +0 -1
  57. package/dist/core/build/plugins/plugin-ssr.js +0 -1
  58. package/dist/core/build/plugins/util.d.ts +0 -9
  59. package/dist/core/build/plugins/util.js +0 -2
  60. package/dist/core/build/types.d.ts +1 -1
  61. package/dist/core/config/config.d.ts +0 -1
  62. package/dist/core/config/config.js +0 -1
  63. package/dist/core/config/index.d.ts +1 -2
  64. package/dist/core/config/index.js +0 -2
  65. package/dist/core/config/schemas/base.d.ts +6 -4
  66. package/dist/core/config/schemas/relative.d.ts +6 -6
  67. package/dist/core/config/timer.d.ts +0 -5
  68. package/dist/core/config/tsconfig.d.ts +1 -1
  69. package/dist/core/constants.d.ts +0 -4
  70. package/dist/core/constants.js +1 -3
  71. package/dist/core/cookies/index.d.ts +1 -1
  72. package/dist/core/cookies/index.js +2 -4
  73. package/dist/core/cookies/response.d.ts +0 -1
  74. package/dist/core/cookies/response.js +1 -5
  75. package/dist/core/dev/container.d.ts +2 -1
  76. package/dist/core/dev/dev.js +1 -1
  77. package/dist/core/dev/index.d.ts +1 -1
  78. package/dist/core/dev/index.js +1 -2
  79. package/dist/core/dev/restart.d.ts +1 -1
  80. package/dist/core/encryption.d.ts +0 -8
  81. package/dist/core/encryption.js +1 -7
  82. package/dist/core/errors/index.d.ts +1 -2
  83. package/dist/core/errors/index.js +0 -2
  84. package/dist/core/logger/core.d.ts +3 -9
  85. package/dist/core/logger/core.js +1 -5
  86. package/dist/core/messages.d.ts +0 -1
  87. package/dist/core/messages.js +2 -11
  88. package/dist/core/middleware/sequence.js +3 -0
  89. package/dist/core/preview/static-preview-server.d.ts +2 -1
  90. package/dist/core/redirects/index.d.ts +0 -1
  91. package/dist/core/redirects/index.js +0 -2
  92. package/dist/core/render/index.d.ts +0 -17
  93. package/dist/core/render/ssr-element.d.ts +0 -2
  94. package/dist/core/render/ssr-element.js +0 -2
  95. package/dist/core/render-context.js +4 -0
  96. package/dist/core/request.d.ts +1 -1
  97. package/dist/core/routing/3xx.d.ts +2 -1
  98. package/dist/core/routing/astro-designed-error-pages.d.ts +0 -1
  99. package/dist/core/routing/astro-designed-error-pages.js +1 -16
  100. package/dist/core/routing/index.d.ts +2 -3
  101. package/dist/core/routing/index.js +3 -8
  102. package/dist/core/routing/manifest/create.d.ts +2 -3
  103. package/dist/core/routing/manifest/create.js +0 -1
  104. package/dist/core/routing/request.d.ts +0 -1
  105. package/dist/core/routing/request.js +1 -2
  106. package/dist/core/routing/rewrite.d.ts +3 -2
  107. package/dist/core/server-islands/vite-plugin-server-islands.d.ts +0 -1
  108. package/dist/core/server-islands/vite-plugin-server-islands.js +0 -1
  109. package/dist/core/sync/index.d.ts +2 -1
  110. package/dist/core/util.d.ts +0 -1
  111. package/dist/core/util.js +0 -1
  112. package/dist/events/session.d.ts +1 -1
  113. package/dist/integrations/features-validation.d.ts +1 -3
  114. package/dist/integrations/features-validation.js +0 -2
  115. package/dist/preferences/index.d.ts +4 -4
  116. package/dist/type-utils.d.ts +0 -4
  117. package/dist/types/public/config.d.ts +19 -0
  118. package/dist/types/typed-emitter.d.ts +2 -1
  119. package/dist/vite-plugin-astro/hmr.d.ts +2 -1
  120. package/dist/vite-plugin-astro/query.d.ts +3 -2
  121. package/dist/vite-plugin-astro/types.d.ts +2 -1
  122. package/dist/vite-plugin-astro-server/controller.d.ts +2 -2
  123. package/dist/vite-plugin-astro-server/plugin.d.ts +2 -1
  124. package/dist/vite-plugin-astro-server/response.d.ts +0 -1
  125. package/dist/vite-plugin-astro-server/response.js +0 -12
  126. package/dist/vite-plugin-astro-server/route.d.ts +1 -1
  127. package/dist/vite-plugin-astro-server/server-state.d.ts +3 -3
  128. package/dist/vite-plugin-astro-server/server-state.js +0 -4
  129. package/dist/vite-plugin-load-fallback/index.d.ts +1 -1
  130. package/dist/vite-plugin-scanner/index.d.ts +2 -1
  131. package/package.json +4 -10
  132. package/templates/env.mjs +1 -0
@@ -160,13 +160,15 @@ function getActionContext(context) {
160
160
  }
161
161
  throw e;
162
162
  }
163
- const {
164
- props: _props,
165
- getActionResult: _getActionResult,
166
- callAction: _callAction,
167
- redirect: _redirect,
168
- ...actionAPIContext
169
- } = context;
163
+ const omitKeys = ["props", "getActionResult", "callAction", "redirect"];
164
+ const actionAPIContext = Object.create(
165
+ Object.getPrototypeOf(context),
166
+ Object.fromEntries(
167
+ Object.entries(Object.getOwnPropertyDescriptors(context)).filter(
168
+ ([key]) => !omitKeys.includes(key)
169
+ )
170
+ )
171
+ );
170
172
  Reflect.set(actionAPIContext, ACTION_API_CONTEXT_SYMBOL, true);
171
173
  const handler = baseAction.bind(actionAPIContext);
172
174
  return handler(input);
@@ -1,20 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const requiredFamilyAttributesSchema: z.ZodObject<{
3
- /**
4
- * The font family name, as identified by your font provider.
5
- */
6
- name: z.ZodString;
7
- /**
8
- * A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable (i.e. starting with `--`).
9
- */
10
- cssVariable: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- name: string;
13
- cssVariable: string;
14
- }, {
15
- name: string;
16
- cssVariable: string;
17
- }>;
18
2
  export declare const fontProviderSchema: z.ZodObject<{
19
3
  /**
20
4
  * URL, path relative to the root or package import.
@@ -152,6 +152,5 @@ const remoteFontFamilySchema = requiredFamilyAttributesSchema.merge(
152
152
  export {
153
153
  fontProviderSchema,
154
154
  localFontFamilySchema,
155
- remoteFontFamilySchema,
156
- requiredFamilyAttributesSchema
155
+ remoteFontFamilySchema
157
156
  };
@@ -28,18 +28,24 @@ async function loadFonts({
28
28
  for (const family of families) {
29
29
  const preloadData = [];
30
30
  let css = "";
31
- let fallbackFontData = null;
32
- const collect = ({ hash, type, value }) => {
31
+ const fallbacks = family.fallbacks ?? DEFAULTS.fallbacks;
32
+ const fallbackFontData = [];
33
+ const collect = ({ hash, type, value, data }, collectPreload) => {
33
34
  const url = base + hash;
34
35
  if (!hashToUrlMap.has(hash)) {
35
36
  hashToUrlMap.set(hash, value);
36
- preloadData.push({ url, type });
37
+ if (collectPreload) {
38
+ preloadData.push({ url, type });
39
+ }
37
40
  }
38
- if (family.fallbacks && family.fallbacks.length > 0) {
39
- fallbackFontData ??= {
41
+ if (fallbacks && fallbacks.length > 0 && // If the same data has already been sent for this family, we don't want to have duplicate fallbacks
42
+ // Such scenario can occur with unicode ranges
43
+ !fallbackFontData.some((f) => JSON.stringify(f.data) === JSON.stringify(data))) {
44
+ fallbackFontData.push({
40
45
  hash,
41
- url: value
42
- };
46
+ url: value,
47
+ data
48
+ });
43
49
  }
44
50
  return url;
45
51
  };
@@ -47,7 +53,7 @@ async function loadFonts({
47
53
  if (family.provider === LOCAL_PROVIDER_NAME) {
48
54
  const result = resolveLocalFont({
49
55
  family,
50
- proxyURL: (value) => {
56
+ proxyURL: ({ value, data }) => {
51
57
  return proxyURL({
52
58
  value,
53
59
  // We hash based on the filepath and the contents, since the user could replace
@@ -61,7 +67,7 @@ async function loadFonts({
61
67
  }
62
68
  return hashString(v + content);
63
69
  },
64
- collect
70
+ collect: (input) => collect({ ...input, data }, true)
65
71
  });
66
72
  }
67
73
  });
@@ -83,21 +89,40 @@ async function loadFonts({
83
89
  );
84
90
  fonts = result.fonts.filter(
85
91
  (font) => typeof font.meta?.priority === "number" ? font.meta.priority === 0 : true
86
- ).map((font) => ({
87
- ...font,
88
- src: font.src.slice(0, 1).map(
89
- (source) => "name" in source ? source : {
90
- ...source,
91
- originalURL: source.url,
92
- url: proxyURL({
93
- value: source.url,
94
- // We only use the url for hashing since the service returns urls with a hash already
95
- hashString,
96
- collect
97
- })
98
- }
99
- )
100
- }));
92
+ ).map((font) => {
93
+ let index = 0;
94
+ return {
95
+ ...font,
96
+ src: font.src.map((source) => {
97
+ if ("name" in source) {
98
+ return source;
99
+ }
100
+ const proxied = {
101
+ ...source,
102
+ originalURL: source.url,
103
+ url: proxyURL({
104
+ value: source.url,
105
+ // We only use the url for hashing since the service returns urls with a hash already
106
+ hashString,
107
+ // We only collect the first URL to avoid preloading fallback sources (eg. we only
108
+ // preload woff2 if woff is available)
109
+ collect: (data) => collect(
110
+ {
111
+ ...data,
112
+ data: {
113
+ weight: font.weight,
114
+ style: font.style
115
+ }
116
+ },
117
+ index === 0
118
+ )
119
+ })
120
+ };
121
+ index++;
122
+ return proxied;
123
+ })
124
+ };
125
+ });
101
126
  }
102
127
  for (const data of fonts) {
103
128
  css += generateFontFace(family.nameWithHash, {
@@ -114,7 +139,7 @@ async function loadFonts({
114
139
  const fallbackData = await generateFallbacksCSS({
115
140
  family,
116
141
  font: fallbackFontData,
117
- fallbacks: family.fallbacks ?? DEFAULTS.fallbacks,
142
+ fallbacks,
118
143
  metrics: family.optimizedFallbacks ?? DEFAULTS.optimizedFallbacks ? {
119
144
  getMetricsForFamily,
120
145
  generateFontFace: generateFallbackFontFace
@@ -122,7 +147,9 @@ async function loadFonts({
122
147
  });
123
148
  const cssVarValues = [family.nameWithHash];
124
149
  if (fallbackData) {
125
- css += fallbackData.css;
150
+ if (fallbackData.css) {
151
+ css += fallbackData.css;
152
+ }
126
153
  cssVarValues.push(...fallbackData.fallbacks);
127
154
  }
128
155
  css += `:root { ${family.cssVariable}: ${cssVarValues.join(", ")}; }`;
@@ -6,5 +6,5 @@ export declare function generateFallbackFontFace({ metrics, fallbackMetrics, nam
6
6
  fallbackMetrics: FontFaceMetrics;
7
7
  name: string;
8
8
  font: string;
9
- properties?: Record<string, string | undefined>;
9
+ properties: Record<string, string | undefined>;
10
10
  }): string;
@@ -30,7 +30,7 @@ function generateFallbackFontFace({
30
30
  fallbackMetrics,
31
31
  name: fallbackName,
32
32
  font: fallbackFontName,
33
- properties = {}
33
+ properties
34
34
  }) {
35
35
  const preferredFontXAvgRatio = metrics.xWidthAvg / metrics.unitsPerEm;
36
36
  const fallbackFontXAvgRatio = fallbackMetrics.xWidthAvg / fallbackMetrics.unitsPerEm;
@@ -21,7 +21,7 @@ declare function fontsource(): {
21
21
  config?: Record<string, any> | undefined;
22
22
  };
23
23
  /** [Google](https://fonts.google.com/) */
24
- declare function google(): {
24
+ declare function google(config?: Parameters<typeof providers.google>[0]): {
25
25
  entrypoint: string | URL;
26
26
  config?: Record<string, any> | undefined;
27
27
  };
@@ -19,9 +19,10 @@ function fontsource() {
19
19
  entrypoint: "astro/assets/fonts/providers/fontsource"
20
20
  });
21
21
  }
22
- function google() {
22
+ function google(config) {
23
23
  return defineAstroFontProvider({
24
- entrypoint: "astro/assets/fonts/providers/google"
24
+ entrypoint: "astro/assets/fonts/providers/google",
25
+ config
25
26
  });
26
27
  }
27
28
  const fontProviders = {
@@ -4,7 +4,10 @@ type InitializedProvider = NonNullable<Awaited<ReturnType<unifont.Provider>>>;
4
4
  type ResolveFontResult = NonNullable<Awaited<ReturnType<InitializedProvider['resolveFont']>>>;
5
5
  interface Options {
6
6
  family: ResolvedLocalFontFamily;
7
- proxyURL: (value: string) => string;
7
+ proxyURL: (params: {
8
+ value: string;
9
+ data: Partial<unifont.FontFaceData>;
10
+ }) => string;
8
11
  }
9
12
  export declare function resolveLocalFont({ family, proxyURL }: Options): ResolveFontResult;
10
13
  export {};
@@ -9,7 +9,13 @@ function resolveLocalFont({ family, proxyURL }) {
9
9
  src: variant.src.map(({ url: originalURL, tech }) => {
10
10
  return {
11
11
  originalURL,
12
- url: proxyURL(originalURL),
12
+ url: proxyURL({
13
+ value: originalURL,
14
+ data: {
15
+ weight: variant.weight,
16
+ style: variant.style
17
+ }
18
+ }),
13
19
  format: FONT_FORMAT_MAP[extractFontType(originalURL)],
14
20
  tech
15
21
  };
@@ -46,6 +46,7 @@ export declare function isGenericFontFamily(str: string): str is keyof typeof DE
46
46
  export type GetMetricsForFamilyFont = {
47
47
  hash: string;
48
48
  url: string;
49
+ data: Partial<unifont.FontFaceData>;
49
50
  };
50
51
  export type GetMetricsForFamily = (name: string,
51
52
  /** A remote url or local filepath to a font file. Used if metrics can't be resolved purely from the family name */
@@ -61,13 +62,13 @@ export declare function generateFallbacksCSS({ family, fallbacks: _fallbacks, fo
61
62
  family: Pick<ResolvedFontFamily, 'name' | 'nameWithHash'>;
62
63
  /** The family fallbacks */
63
64
  fallbacks: Array<string>;
64
- font: GetMetricsForFamilyFont | null;
65
+ font: Array<GetMetricsForFamilyFont>;
65
66
  metrics: {
66
67
  getMetricsForFamily: GetMetricsForFamily;
67
68
  generateFontFace: typeof generateFallbackFontFace;
68
69
  } | null;
69
70
  }): Promise<null | {
70
- css: string;
71
+ css?: string;
71
72
  fallbacks: Array<string>;
72
73
  }>;
73
74
  /**
@@ -13,10 +13,9 @@ function renderFontFace(properties) {
13
13
  }
14
14
  `;
15
15
  }
16
- function generateFontFace(family, font) {
17
- return renderFontFace({
18
- "font-family": family,
19
- src: renderFontSrc(font.src),
16
+ function unifontFontFaceDataToProperties(font) {
17
+ return {
18
+ src: font.src ? renderFontSrc(font.src) : void 0,
20
19
  "font-display": font.display ?? "swap",
21
20
  "unicode-range": font.unicodeRange?.join(","),
22
21
  "font-weight": Array.isArray(font.weight) ? font.weight.join(" ") : font.weight?.toString(),
@@ -24,6 +23,12 @@ function generateFontFace(family, font) {
24
23
  "font-stretch": font.stretch,
25
24
  "font-feature-settings": font.featureSettings,
26
25
  "font-variation-settings": font.variationSettings
26
+ };
27
+ }
28
+ function generateFontFace(family, font) {
29
+ return renderFontFace({
30
+ "font-family": family,
31
+ ...unifontFontFaceDataToProperties(font)
27
32
  });
28
33
  }
29
34
  function renderFontSrc(sources) {
@@ -91,35 +96,39 @@ async function generateFallbacksCSS({
91
96
  if (fallbacks.length === 0) {
92
97
  return null;
93
98
  }
94
- let css = "";
95
- if (!fontData || !metrics) {
96
- return { css, fallbacks };
99
+ if (fontData.length === 0 || !metrics) {
100
+ return { fallbacks };
97
101
  }
98
102
  const lastFallback = fallbacks[fallbacks.length - 1];
99
103
  if (!isGenericFontFamily(lastFallback)) {
100
- return { css, fallbacks };
104
+ return { fallbacks };
101
105
  }
102
106
  const localFonts = DEFAULT_FALLBACKS[lastFallback];
103
107
  if (localFonts.length === 0) {
104
- return { css, fallbacks };
108
+ return { fallbacks };
105
109
  }
106
- const foundMetrics = await metrics.getMetricsForFamily(family.name, fontData);
107
- if (!foundMetrics) {
108
- return { css, fallbacks };
110
+ if (localFonts.includes(
111
+ // @ts-expect-error TS is not smart enough
112
+ family.name
113
+ )) {
114
+ return { fallbacks };
109
115
  }
110
116
  const localFontsMappings = localFonts.map((font) => ({
111
117
  font,
112
118
  name: `"${family.nameWithHash} fallback: ${font}"`
113
119
  }));
114
120
  fallbacks = [.../* @__PURE__ */ new Set([...localFontsMappings.map((m) => m.name), ...fallbacks])];
121
+ let css = "";
115
122
  for (const { font, name } of localFontsMappings) {
116
- css += metrics.generateFontFace({
117
- metrics: foundMetrics,
118
- fallbackMetrics: SYSTEM_METRICS[font],
119
- font,
120
- name
121
- // TODO: forward some properties once we generate one fallback per font face data
122
- });
123
+ for (const { hash, url, data } of fontData) {
124
+ css += metrics.generateFontFace({
125
+ metrics: await metrics.getMetricsForFamily(family.name, { hash, url, data }),
126
+ fallbackMetrics: SYSTEM_METRICS[font],
127
+ font,
128
+ name,
129
+ properties: unifontFontFaceDataToProperties(data)
130
+ });
131
+ }
123
132
  }
124
133
  return { css, fallbacks };
125
134
  }
@@ -49,14 +49,17 @@ function fontsPlugin({ settings, sync, logger }) {
49
49
  if (!settings.config.experimental.fonts) {
50
50
  return {
51
51
  name: "astro:fonts:fallback",
52
- config() {
53
- return {
54
- build: {
55
- rollupOptions: {
56
- external: [VIRTUAL_MODULE_ID]
57
- }
58
- }
59
- };
52
+ resolveId(id) {
53
+ if (id === VIRTUAL_MODULE_ID) {
54
+ return RESOLVED_VIRTUAL_MODULE_ID;
55
+ }
56
+ },
57
+ load(id) {
58
+ if (id === RESOLVED_VIRTUAL_MODULE_ID) {
59
+ return {
60
+ code: ""
61
+ };
62
+ }
60
63
  }
61
64
  };
62
65
  }
@@ -44,7 +44,7 @@ interface SharedServiceProps<T extends Record<string, any> = Record<string, any>
44
44
  validateOptions?: (options: ImageTransform, imageConfig: ImageConfig<T>) => ImageTransform | Promise<ImageTransform>;
45
45
  }
46
46
  export type ExternalImageService<T extends Record<string, any> = Record<string, any>> = SharedServiceProps<T>;
47
- export type LocalImageTransform = {
47
+ type LocalImageTransform = {
48
48
  src: string;
49
49
  [key: string]: any;
50
50
  };
@@ -1,12 +1 @@
1
- /**
2
- * FNV-1a Hash implementation
3
- * @author Travis Webb (tjwebb) <me@traviswebb.com>
4
- *
5
- * Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js
6
- * License https://github.com/tjwebb/fnv-plus#license
7
- *
8
- * Simplified, optimized and add modified for 52 bit, which provides a larger hash space
9
- * and still making use of Javascript's 53-bit integer space.
10
- */
11
- export declare const fnv1a52: (str: string) => number;
12
1
  export declare const etag: (payload: string, weak?: boolean) => string;
@@ -23,6 +23,5 @@ const etag = (payload, weak = false) => {
23
23
  return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '"';
24
24
  };
25
25
  export {
26
- etag,
27
- fnv1a52
26
+ etag
28
27
  };
@@ -1,4 +1,3 @@
1
- import type { imageType } from './types/index.js';
2
1
  import type { ISizeCalculationResult } from './types/interface.ts';
3
2
  /**
4
3
  * Return size information based on an Uint8Array
@@ -7,4 +6,3 @@ import type { ISizeCalculationResult } from './types/interface.ts';
7
6
  * @returns {ISizeCalculationResult}
8
7
  */
9
8
  export declare function lookup(input: Uint8Array): ISizeCalculationResult;
10
- export declare const disableTypes: (types: imageType[]) => void;
@@ -1,14 +1,8 @@
1
1
  import { typeHandlers } from "./types/index.js";
2
2
  import { detector } from "./detector.js";
3
- const globalOptions = {
4
- disabledTypes: []
5
- };
6
3
  function lookup(input) {
7
4
  const type = detector(input);
8
5
  if (typeof type !== "undefined") {
9
- if (globalOptions.disabledTypes.includes(type)) {
10
- throw new TypeError("disabled file type: " + type);
11
- }
12
6
  const size = typeHandlers.get(type).calculate(input);
13
7
  if (size !== void 0) {
14
8
  size.type = size.type ?? type;
@@ -17,10 +11,6 @@ function lookup(input) {
17
11
  }
18
12
  throw new TypeError("unsupported file type: " + type);
19
13
  }
20
- const disableTypes = (types) => {
21
- globalOptions.disabledTypes = types;
22
- };
23
14
  export {
24
- disableTypes,
25
15
  lookup
26
16
  };
@@ -1,15 +1,6 @@
1
- import { type ProxifiedModule } from 'magicast';
2
1
  import { type Flags } from '../flags.js';
3
2
  interface AddOptions {
4
3
  flags: Flags;
5
4
  }
6
- interface IntegrationInfo {
7
- id: string;
8
- packageName: string;
9
- integrationName: string;
10
- dependencies: [name: string, version: string][];
11
- type: 'integration' | 'adapter';
12
- }
13
5
  export declare function add(names: string[], { flags }: AddOptions): Promise<void>;
14
- export declare function setAdapter(mod: ProxifiedModule<any>, adapter: IntegrationInfo, exportName: string): void;
15
6
  export {};
@@ -844,6 +844,5 @@ async function setupIntegrationConfig(opts) {
844
844
  }
845
845
  }
846
846
  export {
847
- add,
848
- setAdapter
847
+ add
849
848
  };
@@ -8,6 +8,5 @@ export declare function getInfoOutput({ userConfig, print, }: {
8
8
  print: boolean;
9
9
  }): Promise<string>;
10
10
  export declare function printInfo({ flags }: InfoOptions): Promise<void>;
11
- export declare function copyToClipboard(text: string, force?: boolean): Promise<void>;
12
11
  export declare function readFromClipboard(): string;
13
12
  export {};
@@ -163,7 +163,6 @@ ${" ".repeat(MAX_PADDING)}${colors.green(entry)}`;
163
163
  return plaintext;
164
164
  }
165
165
  export {
166
- copyToClipboard,
167
166
  getInfoOutput,
168
167
  printInfo,
169
168
  readFromClipboard
@@ -2,7 +2,5 @@ import { type Flags } from '../flags.js';
2
2
  interface PreferencesOptions {
3
3
  flags: Flags;
4
4
  }
5
- declare const PREFERENCES_SUBCOMMANDS: readonly ["get", "set", "enable", "disable", "delete", "reset", "list"];
6
- export type Subcommand = (typeof PREFERENCES_SUBCOMMANDS)[number];
7
5
  export declare function preferences(subcommand: string, key: string, value: string | undefined, { flags }: PreferencesOptions): Promise<number>;
8
6
  export {};
@@ -55,11 +55,6 @@ class experimental_AstroContainer {
55
55
  * @private
56
56
  */
57
57
  #withManifest = false;
58
- /**
59
- * Internal function responsible for importing a renderer
60
- * @private
61
- */
62
- #getRenderer;
63
58
  constructor({
64
59
  streaming = false,
65
60
  manifest,
@@ -187,7 +182,7 @@ class experimental_AstroContainer {
187
182
  this.#pipeline.manifest.renderers[rendererIndex] = renderer;
188
183
  }
189
184
  // NOTE: we keep this private via TS instead via `#` so it's still available on the surface, so we can play with it.
190
- // @ematipico: I plan to use it for a possible integration that could help people
185
+ // @ts-expect-error @ematipico: I plan to use it for a possible integration that could help people
191
186
  static async createFromManifest(manifest) {
192
187
  const astroConfig = await validateConfig(ASTRO_CONFIG_DEFAULTS, process.cwd(), "container");
193
188
  const container = new experimental_AstroContainer({
@@ -2,16 +2,14 @@ import type { FSWatcher } from 'vite';
2
2
  import type { Logger } from '../core/logger/core.js';
3
3
  import type { AstroSettings } from '../types/astro.js';
4
4
  import type { RefreshContentOptions } from '../types/public/content.js';
5
- import type { LoaderContext } from './loaders/types.js';
6
5
  import type { MutableDataStore } from './mutable-data-store.js';
7
- export interface ContentLayerOptions {
6
+ interface ContentLayerOptions {
8
7
  store: MutableDataStore;
9
8
  settings: AstroSettings;
10
9
  logger: Logger;
11
10
  watcher?: FSWatcher;
12
11
  }
13
- type CollectionLoader<TData> = () => Array<TData> | Promise<Array<TData>> | Record<string, Record<string, unknown>> | Promise<Record<string, Record<string, unknown>>>;
14
- export declare class ContentLayer {
12
+ declare class ContentLayer {
15
13
  #private;
16
14
  constructor({ settings, logger, store, watcher }: ContentLayerOptions);
17
15
  /**
@@ -33,9 +31,6 @@ export declare class ContentLayer {
33
31
  sync(options?: RefreshContentOptions): Promise<void>;
34
32
  regenerateCollectionFileManifest(): Promise<void>;
35
33
  }
36
- export declare function simpleLoader<TData extends {
37
- id: string;
38
- }>(handler: CollectionLoader<TData>, context: LoaderContext): Promise<void>;
39
34
  /**
40
35
  * Get the path to the data store file.
41
36
  * During development, this is in the `.astro` directory so that the Vite watcher can see it.
@@ -153,7 +153,7 @@ ${contentConfig.error.message}`);
153
153
  logger.info("Content config changed");
154
154
  shouldClear = true;
155
155
  }
156
- if (previousAstroVersion && previousAstroVersion !== "5.7.3") {
156
+ if (previousAstroVersion && previousAstroVersion !== "5.7.5") {
157
157
  logger.info("Astro version changed");
158
158
  shouldClear = true;
159
159
  }
@@ -161,8 +161,8 @@ ${contentConfig.error.message}`);
161
161
  logger.info("Clearing content store");
162
162
  this.#store.clearAll();
163
163
  }
164
- if ("5.7.3") {
165
- await this.#store.metaStore().set("astro-version", "5.7.3");
164
+ if ("5.7.5") {
165
+ await this.#store.metaStore().set("astro-version", "5.7.5");
166
166
  }
167
167
  if (currentConfigDigest) {
168
168
  await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -343,8 +343,6 @@ function contentLayerSingleton() {
343
343
  }
344
344
  const globalContentLayer = contentLayerSingleton();
345
345
  export {
346
- ContentLayer,
347
346
  getDataStoreFile,
348
- globalContentLayer,
349
- simpleLoader
347
+ globalContentLayer
350
348
  };
@@ -1,7 +1,6 @@
1
- export { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from './consts.js';
2
1
  export { attachContentServerListeners } from './server-listeners.js';
3
2
  export { createContentTypesGenerator } from './types-generator.js';
4
- export { contentObservable, getContentPaths, hasAssetPropagationFlag } from './utils.js';
3
+ export { getContentPaths, hasAssetPropagationFlag } from './utils.js';
5
4
  export { astroContentAssetPropagationPlugin } from './vite-plugin-content-assets.js';
6
5
  export { astroContentImportPlugin } from './vite-plugin-content-imports.js';
7
6
  export { astroContentVirtualModPlugin } from './vite-plugin-content-virtual-mod.js';
@@ -1,18 +1,14 @@
1
- import { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from "./consts.js";
2
1
  import { attachContentServerListeners } from "./server-listeners.js";
3
2
  import { createContentTypesGenerator } from "./types-generator.js";
4
- import { contentObservable, getContentPaths, hasAssetPropagationFlag } from "./utils.js";
3
+ import { getContentPaths, hasAssetPropagationFlag } from "./utils.js";
5
4
  import { astroContentAssetPropagationPlugin } from "./vite-plugin-content-assets.js";
6
5
  import { astroContentImportPlugin } from "./vite-plugin-content-imports.js";
7
6
  import { astroContentVirtualModPlugin } from "./vite-plugin-content-virtual-mod.js";
8
7
  export {
9
- CONTENT_FLAG,
10
- PROPAGATED_ASSET_FLAG,
11
8
  astroContentAssetPropagationPlugin,
12
9
  astroContentImportPlugin,
13
10
  astroContentVirtualModPlugin,
14
11
  attachContentServerListeners,
15
- contentObservable,
16
12
  createContentTypesGenerator,
17
13
  getContentPaths,
18
14
  hasAssetPropagationFlag
@@ -1,5 +1,5 @@
1
1
  import type { Loader } from './types.js';
2
- export interface FileOptions {
2
+ interface FileOptions {
3
3
  /**
4
4
  * the parsing function to use for this data
5
5
  * @default JSON.parse or yaml.load, depending on the extension of the file
@@ -12,3 +12,4 @@ export interface FileOptions {
12
12
  * @param options Additional options for the file loader
13
13
  */
14
14
  export declare function file(fileName: string, options?: FileOptions): Loader;
15
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { Loader } from './types.js';
2
- export interface GenerateIdOptions {
2
+ interface GenerateIdOptions {
3
3
  /** The path to the entry file, relative to the base directory. */
4
4
  entry: string;
5
5
  /** The base directory URL. */
@@ -7,7 +7,7 @@ export interface GenerateIdOptions {
7
7
  /** The parsed, unvalidated data of the entry. */
8
8
  data: Record<string, unknown>;
9
9
  }
10
- export interface GlobOptions {
10
+ interface GlobOptions {
11
11
  /** The glob pattern to match files, relative to the base directory */
12
12
  pattern: string | Array<string>;
13
13
  /** The base directory to resolve the glob pattern from. Relative to the root directory, or an absolute file URL. Defaults to `.` */
@@ -28,3 +28,4 @@ export declare function glob(globOptions: GlobOptions & {
28
28
  /** @deprecated */
29
29
  _legacy?: true;
30
30
  }): Loader;
31
+ export {};