astro 4.4.14 → 4.5.0
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 +15 -12
- package/dist/@types/astro.d.ts +95 -18
- package/dist/assets/utils/getAssetsPrefix.d.ts +2 -0
- package/dist/assets/utils/getAssetsPrefix.js +14 -0
- package/dist/assets/vite-plugin-assets.js +10 -3
- package/dist/cli/add/index.js +76 -28
- package/dist/cli/install-package.js +2 -2
- package/dist/content/types-generator.js +56 -7
- package/dist/content/vite-plugin-content-assets.js +11 -3
- package/dist/core/app/common.js +2 -0
- package/dist/core/app/index.js +10 -2
- package/dist/core/app/types.d.ts +7 -2
- package/dist/core/base-pipeline.d.ts +2 -1
- package/dist/core/base-pipeline.js +2 -1
- package/dist/core/build/generate.js +1 -0
- package/dist/core/build/internal.d.ts +6 -0
- package/dist/core/build/internal.js +1 -0
- package/dist/core/build/plugins/index.js +6 -1
- package/dist/core/build/plugins/plugin-analyzer.js +10 -98
- package/dist/core/build/plugins/plugin-css.js +27 -1
- package/dist/core/build/plugins/plugin-manifest.js +5 -2
- package/dist/core/build/plugins/plugin-scripts.d.ts +8 -0
- package/dist/core/build/plugins/plugin-scripts.js +34 -0
- package/dist/core/compile/compile.d.ts +1 -7
- package/dist/core/compile/compile.js +5 -4
- package/dist/core/compile/style.d.ts +4 -3
- package/dist/core/compile/style.js +5 -4
- package/dist/core/compile/types.d.ts +11 -0
- package/dist/core/config/schema.d.ts +177 -113
- package/dist/core/config/schema.js +42 -9
- package/dist/core/config/vite-load.js +1 -0
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -1
- package/dist/core/create-vite.js +5 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/render/params-and-props.js +2 -1
- package/dist/core/render/ssr-element.d.ts +8 -8
- package/dist/core/render/ssr-element.js +4 -2
- package/dist/core/render-context.js +3 -1
- package/dist/core/routing/astro-designed-error-pages.d.ts +2 -0
- package/dist/core/routing/astro-designed-error-pages.js +21 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/index.d.ts +8 -15
- package/dist/runtime/client/dev-toolbar/apps/audit/index.js +130 -249
- package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.js → rules/a11y.js} +4 -2
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.d.ts +35 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.js +40 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/{perf.js → rules/perf.js} +2 -2
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.d.ts +7 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.js +137 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.d.ts +23 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.js +384 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.d.ts +6 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.js +126 -0
- package/dist/runtime/client/dev-toolbar/apps/utils/window.d.ts +1 -1
- package/dist/runtime/client/dev-toolbar/apps/utils/window.js +3 -1
- package/dist/runtime/client/dev-toolbar/entrypoint.js +43 -15
- package/dist/runtime/client/dev-toolbar/settings.d.ts +3 -1
- package/dist/runtime/client/dev-toolbar/settings.js +8 -2
- package/dist/runtime/client/dev-toolbar/toolbar.d.ts +1 -0
- package/dist/runtime/client/dev-toolbar/toolbar.js +10 -8
- package/dist/runtime/client/dev-toolbar/ui-library/badge.d.ts +14 -4
- package/dist/runtime/client/dev-toolbar/ui-library/badge.js +72 -33
- package/dist/runtime/client/dev-toolbar/ui-library/button.d.ts +14 -4
- package/dist/runtime/client/dev-toolbar/ui-library/button.js +100 -47
- package/dist/runtime/client/dev-toolbar/ui-library/card.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/card.js +57 -2
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.js +54 -2
- package/dist/runtime/client/dev-toolbar/ui-library/icons.d.ts +4 -0
- package/dist/runtime/client/dev-toolbar/ui-library/icons.js +5 -1
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.js +64 -5
- package/dist/runtime/compiler/index.d.ts +1 -1
- package/dist/runtime/compiler/index.js +2 -0
- package/dist/runtime/server/hydration.js +3 -2
- package/dist/runtime/server/index.d.ts +1 -1
- package/dist/runtime/server/index.js +2 -0
- package/dist/runtime/server/render/astro/factory.d.ts +1 -1
- package/dist/runtime/server/render/component.js +4 -5
- package/dist/runtime/server/render/index.d.ts +1 -0
- package/dist/runtime/server/render/index.js +2 -0
- package/dist/runtime/server/render/script.d.ts +6 -0
- package/dist/runtime/server/render/script.js +15 -0
- package/dist/transitions/router.js +12 -3
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro/index.js +12 -1
- package/dist/vite-plugin-astro/types.d.ts +21 -1
- package/dist/vite-plugin-astro-server/pipeline.js +6 -2
- package/dist/vite-plugin-astro-server/plugin.js +6 -2
- package/dist/vite-plugin-astro-server/response.d.ts +6 -0
- package/dist/vite-plugin-astro-server/response.js +13 -0
- package/dist/vite-plugin-astro-server/route.js +18 -2
- package/package.json +8 -9
- package/tsconfigs/base.json +3 -1
- /package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.d.ts → rules/a11y.d.ts} +0 -0
- /package/dist/runtime/client/dev-toolbar/apps/audit/{perf.d.ts → rules/perf.d.ts} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { TransformOptions } from '@astrojs/compiler';
|
|
2
2
|
import { type ResolvedConfig } from 'vite';
|
|
3
|
-
import type { CompileCssResult } from './
|
|
4
|
-
export
|
|
3
|
+
import type { CompileCssResult } from './types.js';
|
|
4
|
+
export type PartialCompileCssResult = Pick<CompileCssResult, 'isGlobal' | 'dependencies'>;
|
|
5
|
+
export declare function createStylePreprocessor({ filename, viteConfig, cssPartialCompileResults, cssTransformErrors, }: {
|
|
5
6
|
filename: string;
|
|
6
7
|
viteConfig: ResolvedConfig;
|
|
7
|
-
|
|
8
|
+
cssPartialCompileResults: Partial<CompileCssResult>[];
|
|
8
9
|
cssTransformErrors: Error[];
|
|
9
10
|
}): TransformOptions['preprocessStyle'];
|
|
@@ -4,7 +4,7 @@ import { AstroErrorData, CSSError, positionAt } from "../errors/index.js";
|
|
|
4
4
|
function createStylePreprocessor({
|
|
5
5
|
filename,
|
|
6
6
|
viteConfig,
|
|
7
|
-
|
|
7
|
+
cssPartialCompileResults,
|
|
8
8
|
cssTransformErrors
|
|
9
9
|
}) {
|
|
10
10
|
let processedStylesCount = 0;
|
|
@@ -14,9 +14,10 @@ function createStylePreprocessor({
|
|
|
14
14
|
const id = `${filename}?astro&type=style&index=${index}&lang${lang}`;
|
|
15
15
|
try {
|
|
16
16
|
const result = await preprocessCSS(content, id, viteConfig);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
cssPartialCompileResults[index] = {
|
|
18
|
+
isGlobal: !!attrs["is:global"],
|
|
19
|
+
dependencies: result.deps ? [...result.deps].map((dep) => normalizePath(dep)) : []
|
|
20
|
+
};
|
|
20
21
|
let map;
|
|
21
22
|
if (result.map) {
|
|
22
23
|
if (typeof result.map === "string") {
|
|
@@ -5,3 +5,14 @@ export type TransformStyleResult = null | {
|
|
|
5
5
|
deps: Set<string>;
|
|
6
6
|
};
|
|
7
7
|
export type TransformStyle = (source: string, lang: string) => TransformStyleResult | Promise<TransformStyleResult>;
|
|
8
|
+
export interface CompileCssResult {
|
|
9
|
+
code: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether this is `<style is:global>`
|
|
12
|
+
*/
|
|
13
|
+
isGlobal: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The dependencies of the transformed CSS (Normalized/forward-slash-only absolute paths)
|
|
16
|
+
*/
|
|
17
|
+
dependencies: string[];
|
|
18
|
+
}
|