astro 5.6.2 → 5.7.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/client.d.ts +3 -0
- package/components/Font.astro +32 -0
- package/dist/actions/plugins.js +2 -2
- package/dist/assets/fonts/config.d.ts +378 -0
- package/dist/assets/fonts/config.js +157 -0
- package/dist/assets/fonts/constants.d.ts +15 -0
- package/dist/assets/fonts/constants.js +41 -0
- package/dist/assets/fonts/load.d.ts +20 -0
- package/dist/assets/fonts/load.js +133 -0
- package/dist/assets/fonts/metrics.d.ts +10 -0
- package/dist/assets/fonts/metrics.js +84 -0
- package/dist/assets/fonts/providers/entrypoints/adobe.d.ts +2 -0
- package/dist/assets/fonts/providers/entrypoints/adobe.js +5 -0
- package/dist/assets/fonts/providers/entrypoints/bunny.d.ts +1 -0
- package/dist/assets/fonts/providers/entrypoints/bunny.js +5 -0
- package/dist/assets/fonts/providers/entrypoints/fontshare.d.ts +1 -0
- package/dist/assets/fonts/providers/entrypoints/fontshare.js +5 -0
- package/dist/assets/fonts/providers/entrypoints/fontsource.d.ts +1 -0
- package/dist/assets/fonts/providers/entrypoints/fontsource.js +5 -0
- package/dist/assets/fonts/providers/entrypoints/google.d.ts +2 -0
- package/dist/assets/fonts/providers/entrypoints/google.js +5 -0
- package/dist/assets/fonts/providers/index.d.ts +48 -0
- package/dist/assets/fonts/providers/index.js +40 -0
- package/dist/assets/fonts/providers/local.d.ts +10 -0
- package/dist/assets/fonts/providers/local.js +30 -0
- package/dist/assets/fonts/providers/utils.d.ts +9 -0
- package/dist/assets/fonts/providers/utils.js +37 -0
- package/dist/assets/fonts/sync.d.ts +2 -0
- package/dist/assets/fonts/sync.js +17 -0
- package/dist/assets/fonts/types.d.ts +45 -0
- package/dist/assets/fonts/types.js +0 -0
- package/dist/assets/fonts/utils.d.ts +95 -0
- package/dist/assets/fonts/utils.js +215 -0
- package/dist/assets/fonts/vite-plugin-fonts.d.ts +10 -0
- package/dist/assets/fonts/vite-plugin-fonts.js +217 -0
- package/dist/assets/utils/node/emitAsset.d.ts +4 -2
- package/dist/assets/utils/node/emitAsset.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/index.d.ts +2 -2
- package/dist/assets/vite-plugin-assets.d.ts +8 -3
- package/dist/assets/vite-plugin-assets.js +7 -7
- package/dist/config/entrypoint.d.ts +2 -0
- package/dist/config/entrypoint.js +3 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/content/content-layer.js +5 -4
- package/dist/content/runtime-assets.js +1 -0
- package/dist/content/vite-plugin-content-imports.js +4 -2
- package/dist/core/build/generate.js +2 -2
- package/dist/core/build/pipeline.js +2 -2
- package/dist/core/build/static-build.js +2 -2
- package/dist/core/config/schemas/base.d.ts +436 -39
- package/dist/core/config/schemas/base.js +3 -7
- package/dist/core/config/schemas/refined.js +12 -0
- package/dist/core/config/schemas/relative.d.ts +567 -63
- package/dist/core/config/schemas/relative.js +1 -2
- package/dist/core/constants.js +1 -1
- package/dist/core/create-vite.js +2 -2
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/errors-data.d.ts +82 -26
- package/dist/core/errors/errors-data.js +45 -16
- package/dist/core/logger/core.d.ts +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/vite-plugin.js +2 -2
- package/dist/core/render-context.js +38 -5
- package/dist/core/routing/rewrite.js +14 -5
- package/dist/core/session.d.ts +2 -4
- package/dist/core/session.js +4 -29
- package/dist/core/sync/index.js +2 -0
- package/dist/integrations/hooks.js +2 -3
- package/dist/manifest/virtual-module.d.ts +1 -5
- package/dist/manifest/virtual-module.js +1 -18
- package/dist/prerender/utils.d.ts +5 -1
- package/dist/prerender/utils.js +8 -8
- package/dist/runtime/client/dev-toolbar/apps/audit/annotations.d.ts +6 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/annotations.js +27 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/index.js +10 -4
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.js +2 -2
- package/dist/types/public/config.d.ts +155 -98
- package/dist/vite-plugin-astro-server/plugin.js +1 -1
- package/package.json +6 -2
- package/types/fonts.d.ts +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getServerOutputDirectory } from "../../prerender/utils.js";
|
|
2
2
|
import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from "../../vite-plugin-scripts/index.js";
|
|
3
3
|
import { routeIsFallback, routeIsRedirect } from "../redirects/helpers.js";
|
|
4
4
|
import { RedirectSinglePageBuiltModule } from "../redirects/index.js";
|
|
@@ -81,7 +81,7 @@ class BuildPipeline extends Pipeline {
|
|
|
81
81
|
* @param staticBuildOptions
|
|
82
82
|
*/
|
|
83
83
|
static async retrieveManifest(settings, internals) {
|
|
84
|
-
const baseDirectory =
|
|
84
|
+
const baseDirectory = getServerOutputDirectory(settings);
|
|
85
85
|
const manifestEntryUrl = new URL(
|
|
86
86
|
`${internals.manifestFileName}?time=${Date.now()}`,
|
|
87
87
|
baseDirectory
|
|
@@ -9,7 +9,7 @@ import { createBuildInternals } from "../../core/build/internal.js";
|
|
|
9
9
|
import { emptyDir, removeEmptyDirs } from "../../core/fs/index.js";
|
|
10
10
|
import { appendForwardSlash, prependForwardSlash } from "../../core/path.js";
|
|
11
11
|
import { runHookBuildSetup } from "../../integrations/hooks.js";
|
|
12
|
-
import {
|
|
12
|
+
import { getServerOutputDirectory } from "../../prerender/utils.js";
|
|
13
13
|
import { PAGE_SCRIPT_ID } from "../../vite-plugin-scripts/index.js";
|
|
14
14
|
import { routeIsRedirect } from "../redirects/index.js";
|
|
15
15
|
import { getOutDirWithinCwd } from "./common.js";
|
|
@@ -95,7 +95,7 @@ async function staticBuild(opts, internals, ssrOutputChunkNames) {
|
|
|
95
95
|
async function ssrBuild(opts, internals, input, container) {
|
|
96
96
|
const { allPages, settings, viteConfig } = opts;
|
|
97
97
|
const ssr = settings.buildOutput === "server";
|
|
98
|
-
const out =
|
|
98
|
+
const out = getServerOutputDirectory(settings);
|
|
99
99
|
const routes = Object.values(allPages).flatMap((pageData) => pageData.route);
|
|
100
100
|
const { lastVitePlugins, vitePlugins } = await container.runBeforeHook("server", input);
|
|
101
101
|
const viteBuildConfig = {
|
|
@@ -69,9 +69,6 @@ export declare const ASTRO_CONFIG_DEFAULTS: {
|
|
|
69
69
|
clientPrerender: false;
|
|
70
70
|
contentIntellisense: false;
|
|
71
71
|
responsiveImages: false;
|
|
72
|
-
svg: false;
|
|
73
|
-
serializeConfig: false;
|
|
74
|
-
session: false;
|
|
75
72
|
headingIdCompat: false;
|
|
76
73
|
preserveScriptOrder: false;
|
|
77
74
|
};
|
|
@@ -723,29 +720,325 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
723
720
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
724
721
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
725
722
|
responsiveImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
726
|
-
session: z.ZodOptional<z.ZodBoolean>;
|
|
727
|
-
svg: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
728
|
-
serializeConfig: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
729
723
|
headingIdCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
730
724
|
preserveScriptOrder: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
725
|
+
fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
726
|
+
name: z.ZodString;
|
|
727
|
+
cssVariable: z.ZodString;
|
|
728
|
+
}, {
|
|
729
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
730
|
+
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
731
|
+
}>, {
|
|
732
|
+
provider: z.ZodLiteral<"local">;
|
|
733
|
+
variants: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
|
|
734
|
+
weight: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
735
|
+
style: z.ZodEnum<["normal", "italic", "oblique"]>;
|
|
736
|
+
display: z.ZodOptional<z.ZodEnum<["auto", "block", "swap", "fallback", "optional"]>>;
|
|
737
|
+
unicodeRange: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
738
|
+
stretch: z.ZodOptional<z.ZodString>;
|
|
739
|
+
featureSettings: z.ZodOptional<z.ZodString>;
|
|
740
|
+
variationSettings: z.ZodOptional<z.ZodString>;
|
|
741
|
+
}, {
|
|
742
|
+
src: z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>, z.ZodObject<{
|
|
743
|
+
url: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
744
|
+
tech: z.ZodOptional<z.ZodString>;
|
|
745
|
+
}, "strict", z.ZodTypeAny, {
|
|
746
|
+
url: string | URL;
|
|
747
|
+
tech?: string | undefined;
|
|
748
|
+
}, {
|
|
749
|
+
url: string | URL;
|
|
750
|
+
tech?: string | undefined;
|
|
751
|
+
}>]>, "atleastone">;
|
|
752
|
+
}>, "strict", z.ZodTypeAny, {
|
|
753
|
+
style: "normal" | "italic" | "oblique";
|
|
754
|
+
src: [string | URL | {
|
|
755
|
+
url: string | URL;
|
|
756
|
+
tech?: string | undefined;
|
|
757
|
+
}, ...(string | URL | {
|
|
758
|
+
url: string | URL;
|
|
759
|
+
tech?: string | undefined;
|
|
760
|
+
})[]];
|
|
761
|
+
weight: string | number;
|
|
762
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
763
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
764
|
+
stretch?: string | undefined;
|
|
765
|
+
featureSettings?: string | undefined;
|
|
766
|
+
variationSettings?: string | undefined;
|
|
767
|
+
}, {
|
|
768
|
+
style: "normal" | "italic" | "oblique";
|
|
769
|
+
src: [string | URL | {
|
|
770
|
+
url: string | URL;
|
|
771
|
+
tech?: string | undefined;
|
|
772
|
+
}, ...(string | URL | {
|
|
773
|
+
url: string | URL;
|
|
774
|
+
tech?: string | undefined;
|
|
775
|
+
})[]];
|
|
776
|
+
weight: string | number;
|
|
777
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
778
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
779
|
+
stretch?: string | undefined;
|
|
780
|
+
featureSettings?: string | undefined;
|
|
781
|
+
variationSettings?: string | undefined;
|
|
782
|
+
}>, "atleastone">;
|
|
783
|
+
}>, "strict", z.ZodTypeAny, {
|
|
784
|
+
name: string;
|
|
785
|
+
cssVariable: string;
|
|
786
|
+
provider: "local";
|
|
787
|
+
variants: [{
|
|
788
|
+
style: "normal" | "italic" | "oblique";
|
|
789
|
+
src: [string | URL | {
|
|
790
|
+
url: string | URL;
|
|
791
|
+
tech?: string | undefined;
|
|
792
|
+
}, ...(string | URL | {
|
|
793
|
+
url: string | URL;
|
|
794
|
+
tech?: string | undefined;
|
|
795
|
+
})[]];
|
|
796
|
+
weight: string | number;
|
|
797
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
798
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
799
|
+
stretch?: string | undefined;
|
|
800
|
+
featureSettings?: string | undefined;
|
|
801
|
+
variationSettings?: string | undefined;
|
|
802
|
+
}, ...{
|
|
803
|
+
style: "normal" | "italic" | "oblique";
|
|
804
|
+
src: [string | URL | {
|
|
805
|
+
url: string | URL;
|
|
806
|
+
tech?: string | undefined;
|
|
807
|
+
}, ...(string | URL | {
|
|
808
|
+
url: string | URL;
|
|
809
|
+
tech?: string | undefined;
|
|
810
|
+
})[]];
|
|
811
|
+
weight: string | number;
|
|
812
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
813
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
814
|
+
stretch?: string | undefined;
|
|
815
|
+
featureSettings?: string | undefined;
|
|
816
|
+
variationSettings?: string | undefined;
|
|
817
|
+
}[]];
|
|
818
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
819
|
+
optimizedFallbacks?: boolean | undefined;
|
|
820
|
+
}, {
|
|
821
|
+
name: string;
|
|
822
|
+
cssVariable: string;
|
|
823
|
+
provider: "local";
|
|
824
|
+
variants: [{
|
|
825
|
+
style: "normal" | "italic" | "oblique";
|
|
826
|
+
src: [string | URL | {
|
|
827
|
+
url: string | URL;
|
|
828
|
+
tech?: string | undefined;
|
|
829
|
+
}, ...(string | URL | {
|
|
830
|
+
url: string | URL;
|
|
831
|
+
tech?: string | undefined;
|
|
832
|
+
})[]];
|
|
833
|
+
weight: string | number;
|
|
834
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
835
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
836
|
+
stretch?: string | undefined;
|
|
837
|
+
featureSettings?: string | undefined;
|
|
838
|
+
variationSettings?: string | undefined;
|
|
839
|
+
}, ...{
|
|
840
|
+
style: "normal" | "italic" | "oblique";
|
|
841
|
+
src: [string | URL | {
|
|
842
|
+
url: string | URL;
|
|
843
|
+
tech?: string | undefined;
|
|
844
|
+
}, ...(string | URL | {
|
|
845
|
+
url: string | URL;
|
|
846
|
+
tech?: string | undefined;
|
|
847
|
+
})[]];
|
|
848
|
+
weight: string | number;
|
|
849
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
850
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
851
|
+
stretch?: string | undefined;
|
|
852
|
+
featureSettings?: string | undefined;
|
|
853
|
+
variationSettings?: string | undefined;
|
|
854
|
+
}[]];
|
|
855
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
856
|
+
optimizedFallbacks?: boolean | undefined;
|
|
857
|
+
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
858
|
+
name: z.ZodString;
|
|
859
|
+
cssVariable: z.ZodString;
|
|
860
|
+
}, Omit<{
|
|
861
|
+
weight: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
862
|
+
style: z.ZodEnum<["normal", "italic", "oblique"]>;
|
|
863
|
+
display: z.ZodOptional<z.ZodEnum<["auto", "block", "swap", "fallback", "optional"]>>;
|
|
864
|
+
unicodeRange: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
865
|
+
stretch: z.ZodOptional<z.ZodString>;
|
|
866
|
+
featureSettings: z.ZodOptional<z.ZodString>;
|
|
867
|
+
variationSettings: z.ZodOptional<z.ZodString>;
|
|
868
|
+
}, "style" | "weight">>, {
|
|
869
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
870
|
+
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
871
|
+
}>, {
|
|
872
|
+
provider: z.ZodObject<{
|
|
873
|
+
entrypoint: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
874
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
875
|
+
}, "strict", z.ZodTypeAny, {
|
|
876
|
+
entrypoint: string | URL;
|
|
877
|
+
config?: Record<string, any> | undefined;
|
|
878
|
+
}, {
|
|
879
|
+
entrypoint: string | URL;
|
|
880
|
+
config?: Record<string, any> | undefined;
|
|
881
|
+
}>;
|
|
882
|
+
weights: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "atleastone">>;
|
|
883
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodEnum<["normal", "italic", "oblique"]>, "atleastone">>;
|
|
884
|
+
subsets: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
885
|
+
}>, "strict", z.ZodTypeAny, {
|
|
886
|
+
name: string;
|
|
887
|
+
cssVariable: string;
|
|
888
|
+
provider: {
|
|
889
|
+
entrypoint: string | URL;
|
|
890
|
+
config?: Record<string, any> | undefined;
|
|
891
|
+
};
|
|
892
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
893
|
+
optimizedFallbacks?: boolean | undefined;
|
|
894
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
895
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
896
|
+
stretch?: string | undefined;
|
|
897
|
+
featureSettings?: string | undefined;
|
|
898
|
+
variationSettings?: string | undefined;
|
|
899
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
900
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
901
|
+
subsets?: [string, ...string[]] | undefined;
|
|
902
|
+
}, {
|
|
903
|
+
name: string;
|
|
904
|
+
cssVariable: string;
|
|
905
|
+
provider: {
|
|
906
|
+
entrypoint: string | URL;
|
|
907
|
+
config?: Record<string, any> | undefined;
|
|
908
|
+
};
|
|
909
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
910
|
+
optimizedFallbacks?: boolean | undefined;
|
|
911
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
912
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
913
|
+
stretch?: string | undefined;
|
|
914
|
+
featureSettings?: string | undefined;
|
|
915
|
+
variationSettings?: string | undefined;
|
|
916
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
917
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
918
|
+
subsets?: [string, ...string[]] | undefined;
|
|
919
|
+
}>]>, "many">>;
|
|
731
920
|
}, "strict", z.ZodTypeAny, {
|
|
732
921
|
clientPrerender: boolean;
|
|
733
922
|
contentIntellisense: boolean;
|
|
734
923
|
responsiveImages: boolean;
|
|
735
|
-
svg: boolean;
|
|
736
|
-
serializeConfig: boolean;
|
|
737
924
|
headingIdCompat: boolean;
|
|
738
925
|
preserveScriptOrder: boolean;
|
|
739
|
-
|
|
926
|
+
fonts?: ({
|
|
927
|
+
name: string;
|
|
928
|
+
cssVariable: string;
|
|
929
|
+
provider: "local";
|
|
930
|
+
variants: [{
|
|
931
|
+
style: "normal" | "italic" | "oblique";
|
|
932
|
+
src: [string | URL | {
|
|
933
|
+
url: string | URL;
|
|
934
|
+
tech?: string | undefined;
|
|
935
|
+
}, ...(string | URL | {
|
|
936
|
+
url: string | URL;
|
|
937
|
+
tech?: string | undefined;
|
|
938
|
+
})[]];
|
|
939
|
+
weight: string | number;
|
|
940
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
941
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
942
|
+
stretch?: string | undefined;
|
|
943
|
+
featureSettings?: string | undefined;
|
|
944
|
+
variationSettings?: string | undefined;
|
|
945
|
+
}, ...{
|
|
946
|
+
style: "normal" | "italic" | "oblique";
|
|
947
|
+
src: [string | URL | {
|
|
948
|
+
url: string | URL;
|
|
949
|
+
tech?: string | undefined;
|
|
950
|
+
}, ...(string | URL | {
|
|
951
|
+
url: string | URL;
|
|
952
|
+
tech?: string | undefined;
|
|
953
|
+
})[]];
|
|
954
|
+
weight: string | number;
|
|
955
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
956
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
957
|
+
stretch?: string | undefined;
|
|
958
|
+
featureSettings?: string | undefined;
|
|
959
|
+
variationSettings?: string | undefined;
|
|
960
|
+
}[]];
|
|
961
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
962
|
+
optimizedFallbacks?: boolean | undefined;
|
|
963
|
+
} | {
|
|
964
|
+
name: string;
|
|
965
|
+
cssVariable: string;
|
|
966
|
+
provider: {
|
|
967
|
+
entrypoint: string | URL;
|
|
968
|
+
config?: Record<string, any> | undefined;
|
|
969
|
+
};
|
|
970
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
971
|
+
optimizedFallbacks?: boolean | undefined;
|
|
972
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
973
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
974
|
+
stretch?: string | undefined;
|
|
975
|
+
featureSettings?: string | undefined;
|
|
976
|
+
variationSettings?: string | undefined;
|
|
977
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
978
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
979
|
+
subsets?: [string, ...string[]] | undefined;
|
|
980
|
+
})[] | undefined;
|
|
740
981
|
}, {
|
|
741
982
|
clientPrerender?: boolean | undefined;
|
|
742
983
|
contentIntellisense?: boolean | undefined;
|
|
743
984
|
responsiveImages?: boolean | undefined;
|
|
744
|
-
svg?: boolean | undefined;
|
|
745
|
-
serializeConfig?: boolean | undefined;
|
|
746
|
-
session?: boolean | undefined;
|
|
747
985
|
headingIdCompat?: boolean | undefined;
|
|
748
986
|
preserveScriptOrder?: boolean | undefined;
|
|
987
|
+
fonts?: ({
|
|
988
|
+
name: string;
|
|
989
|
+
cssVariable: string;
|
|
990
|
+
provider: "local";
|
|
991
|
+
variants: [{
|
|
992
|
+
style: "normal" | "italic" | "oblique";
|
|
993
|
+
src: [string | URL | {
|
|
994
|
+
url: string | URL;
|
|
995
|
+
tech?: string | undefined;
|
|
996
|
+
}, ...(string | URL | {
|
|
997
|
+
url: string | URL;
|
|
998
|
+
tech?: string | undefined;
|
|
999
|
+
})[]];
|
|
1000
|
+
weight: string | number;
|
|
1001
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1002
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1003
|
+
stretch?: string | undefined;
|
|
1004
|
+
featureSettings?: string | undefined;
|
|
1005
|
+
variationSettings?: string | undefined;
|
|
1006
|
+
}, ...{
|
|
1007
|
+
style: "normal" | "italic" | "oblique";
|
|
1008
|
+
src: [string | URL | {
|
|
1009
|
+
url: string | URL;
|
|
1010
|
+
tech?: string | undefined;
|
|
1011
|
+
}, ...(string | URL | {
|
|
1012
|
+
url: string | URL;
|
|
1013
|
+
tech?: string | undefined;
|
|
1014
|
+
})[]];
|
|
1015
|
+
weight: string | number;
|
|
1016
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1017
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1018
|
+
stretch?: string | undefined;
|
|
1019
|
+
featureSettings?: string | undefined;
|
|
1020
|
+
variationSettings?: string | undefined;
|
|
1021
|
+
}[]];
|
|
1022
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1023
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1024
|
+
} | {
|
|
1025
|
+
name: string;
|
|
1026
|
+
cssVariable: string;
|
|
1027
|
+
provider: {
|
|
1028
|
+
entrypoint: string | URL;
|
|
1029
|
+
config?: Record<string, any> | undefined;
|
|
1030
|
+
};
|
|
1031
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1032
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1033
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1034
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1035
|
+
stretch?: string | undefined;
|
|
1036
|
+
featureSettings?: string | undefined;
|
|
1037
|
+
variationSettings?: string | undefined;
|
|
1038
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
1039
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
1040
|
+
subsets?: [string, ...string[]] | undefined;
|
|
1041
|
+
})[] | undefined;
|
|
749
1042
|
}>>;
|
|
750
1043
|
legacy: z.ZodDefault<z.ZodObject<{
|
|
751
1044
|
collections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -889,28 +1182,67 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
889
1182
|
clientPrerender: boolean;
|
|
890
1183
|
contentIntellisense: boolean;
|
|
891
1184
|
responsiveImages: boolean;
|
|
892
|
-
svg: boolean;
|
|
893
|
-
serializeConfig: boolean;
|
|
894
1185
|
headingIdCompat: boolean;
|
|
895
1186
|
preserveScriptOrder: boolean;
|
|
896
|
-
|
|
1187
|
+
fonts?: ({
|
|
1188
|
+
name: string;
|
|
1189
|
+
cssVariable: string;
|
|
1190
|
+
provider: "local";
|
|
1191
|
+
variants: [{
|
|
1192
|
+
style: "normal" | "italic" | "oblique";
|
|
1193
|
+
src: [string | URL | {
|
|
1194
|
+
url: string | URL;
|
|
1195
|
+
tech?: string | undefined;
|
|
1196
|
+
}, ...(string | URL | {
|
|
1197
|
+
url: string | URL;
|
|
1198
|
+
tech?: string | undefined;
|
|
1199
|
+
})[]];
|
|
1200
|
+
weight: string | number;
|
|
1201
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1202
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1203
|
+
stretch?: string | undefined;
|
|
1204
|
+
featureSettings?: string | undefined;
|
|
1205
|
+
variationSettings?: string | undefined;
|
|
1206
|
+
}, ...{
|
|
1207
|
+
style: "normal" | "italic" | "oblique";
|
|
1208
|
+
src: [string | URL | {
|
|
1209
|
+
url: string | URL;
|
|
1210
|
+
tech?: string | undefined;
|
|
1211
|
+
}, ...(string | URL | {
|
|
1212
|
+
url: string | URL;
|
|
1213
|
+
tech?: string | undefined;
|
|
1214
|
+
})[]];
|
|
1215
|
+
weight: string | number;
|
|
1216
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1217
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1218
|
+
stretch?: string | undefined;
|
|
1219
|
+
featureSettings?: string | undefined;
|
|
1220
|
+
variationSettings?: string | undefined;
|
|
1221
|
+
}[]];
|
|
1222
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1223
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1224
|
+
} | {
|
|
1225
|
+
name: string;
|
|
1226
|
+
cssVariable: string;
|
|
1227
|
+
provider: {
|
|
1228
|
+
entrypoint: string | URL;
|
|
1229
|
+
config?: Record<string, any> | undefined;
|
|
1230
|
+
};
|
|
1231
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1232
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1233
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1234
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1235
|
+
stretch?: string | undefined;
|
|
1236
|
+
featureSettings?: string | undefined;
|
|
1237
|
+
variationSettings?: string | undefined;
|
|
1238
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
1239
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
1240
|
+
subsets?: [string, ...string[]] | undefined;
|
|
1241
|
+
})[] | undefined;
|
|
897
1242
|
};
|
|
898
1243
|
legacy: {
|
|
899
1244
|
collections: boolean;
|
|
900
1245
|
};
|
|
901
|
-
session?: {
|
|
902
|
-
driver: string;
|
|
903
|
-
cookie?: {
|
|
904
|
-
domain?: string | undefined;
|
|
905
|
-
path?: string | undefined;
|
|
906
|
-
maxAge?: number | undefined;
|
|
907
|
-
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
|
908
|
-
secure?: boolean | undefined;
|
|
909
|
-
name?: string | undefined;
|
|
910
|
-
} | undefined;
|
|
911
|
-
options?: Record<string, any> | undefined;
|
|
912
|
-
ttl?: number | undefined;
|
|
913
|
-
} | undefined;
|
|
914
1246
|
site?: string | undefined;
|
|
915
1247
|
adapter?: {
|
|
916
1248
|
name: string;
|
|
@@ -936,16 +1268,9 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
936
1268
|
fallback?: Record<string, string> | undefined;
|
|
937
1269
|
domains?: Record<string, string> | undefined;
|
|
938
1270
|
} | undefined;
|
|
939
|
-
}, {
|
|
940
|
-
trailingSlash?: "never" | "ignore" | "always" | undefined;
|
|
941
|
-
server?: unknown;
|
|
942
|
-
redirects?: Record<string, string | {
|
|
943
|
-
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
944
|
-
destination: string;
|
|
945
|
-
}> | undefined;
|
|
946
1271
|
session?: {
|
|
947
1272
|
driver: string;
|
|
948
|
-
cookie?:
|
|
1273
|
+
cookie?: {
|
|
949
1274
|
domain?: string | undefined;
|
|
950
1275
|
path?: string | undefined;
|
|
951
1276
|
maxAge?: number | undefined;
|
|
@@ -956,6 +1281,13 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
956
1281
|
options?: Record<string, any> | undefined;
|
|
957
1282
|
ttl?: number | undefined;
|
|
958
1283
|
} | undefined;
|
|
1284
|
+
}, {
|
|
1285
|
+
trailingSlash?: "never" | "ignore" | "always" | undefined;
|
|
1286
|
+
server?: unknown;
|
|
1287
|
+
redirects?: Record<string, string | {
|
|
1288
|
+
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1289
|
+
destination: string;
|
|
1290
|
+
}> | undefined;
|
|
959
1291
|
build?: {
|
|
960
1292
|
client?: string | undefined;
|
|
961
1293
|
format?: "file" | "directory" | "preserve" | undefined;
|
|
@@ -1092,15 +1424,80 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1092
1424
|
optional?: boolean | undefined;
|
|
1093
1425
|
})> | undefined;
|
|
1094
1426
|
} | undefined;
|
|
1427
|
+
session?: {
|
|
1428
|
+
driver: string;
|
|
1429
|
+
cookie?: string | {
|
|
1430
|
+
domain?: string | undefined;
|
|
1431
|
+
path?: string | undefined;
|
|
1432
|
+
maxAge?: number | undefined;
|
|
1433
|
+
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
|
1434
|
+
secure?: boolean | undefined;
|
|
1435
|
+
name?: string | undefined;
|
|
1436
|
+
} | undefined;
|
|
1437
|
+
options?: Record<string, any> | undefined;
|
|
1438
|
+
ttl?: number | undefined;
|
|
1439
|
+
} | undefined;
|
|
1095
1440
|
experimental?: {
|
|
1096
1441
|
clientPrerender?: boolean | undefined;
|
|
1097
1442
|
contentIntellisense?: boolean | undefined;
|
|
1098
1443
|
responsiveImages?: boolean | undefined;
|
|
1099
|
-
svg?: boolean | undefined;
|
|
1100
|
-
serializeConfig?: boolean | undefined;
|
|
1101
|
-
session?: boolean | undefined;
|
|
1102
1444
|
headingIdCompat?: boolean | undefined;
|
|
1103
1445
|
preserveScriptOrder?: boolean | undefined;
|
|
1446
|
+
fonts?: ({
|
|
1447
|
+
name: string;
|
|
1448
|
+
cssVariable: string;
|
|
1449
|
+
provider: "local";
|
|
1450
|
+
variants: [{
|
|
1451
|
+
style: "normal" | "italic" | "oblique";
|
|
1452
|
+
src: [string | URL | {
|
|
1453
|
+
url: string | URL;
|
|
1454
|
+
tech?: string | undefined;
|
|
1455
|
+
}, ...(string | URL | {
|
|
1456
|
+
url: string | URL;
|
|
1457
|
+
tech?: string | undefined;
|
|
1458
|
+
})[]];
|
|
1459
|
+
weight: string | number;
|
|
1460
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1461
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1462
|
+
stretch?: string | undefined;
|
|
1463
|
+
featureSettings?: string | undefined;
|
|
1464
|
+
variationSettings?: string | undefined;
|
|
1465
|
+
}, ...{
|
|
1466
|
+
style: "normal" | "italic" | "oblique";
|
|
1467
|
+
src: [string | URL | {
|
|
1468
|
+
url: string | URL;
|
|
1469
|
+
tech?: string | undefined;
|
|
1470
|
+
}, ...(string | URL | {
|
|
1471
|
+
url: string | URL;
|
|
1472
|
+
tech?: string | undefined;
|
|
1473
|
+
})[]];
|
|
1474
|
+
weight: string | number;
|
|
1475
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1476
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1477
|
+
stretch?: string | undefined;
|
|
1478
|
+
featureSettings?: string | undefined;
|
|
1479
|
+
variationSettings?: string | undefined;
|
|
1480
|
+
}[]];
|
|
1481
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1482
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1483
|
+
} | {
|
|
1484
|
+
name: string;
|
|
1485
|
+
cssVariable: string;
|
|
1486
|
+
provider: {
|
|
1487
|
+
entrypoint: string | URL;
|
|
1488
|
+
config?: Record<string, any> | undefined;
|
|
1489
|
+
};
|
|
1490
|
+
fallbacks?: [string, ...string[]] | undefined;
|
|
1491
|
+
optimizedFallbacks?: boolean | undefined;
|
|
1492
|
+
display?: "fallback" | "auto" | "optional" | "block" | "swap" | undefined;
|
|
1493
|
+
unicodeRange?: [string, ...string[]] | undefined;
|
|
1494
|
+
stretch?: string | undefined;
|
|
1495
|
+
featureSettings?: string | undefined;
|
|
1496
|
+
variationSettings?: string | undefined;
|
|
1497
|
+
weights?: [string | number, ...(string | number)[]] | undefined;
|
|
1498
|
+
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
|
|
1499
|
+
subsets?: [string, ...string[]] | undefined;
|
|
1500
|
+
})[] | undefined;
|
|
1104
1501
|
} | undefined;
|
|
1105
1502
|
legacy?: {
|
|
1106
1503
|
collections?: boolean | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { markdownConfigDefaults, syntaxHighlightDefaults } from "@astrojs/markdown-remark";
|
|
2
2
|
import { bundledThemes } from "shiki";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { localFontFamilySchema, remoteFontFamilySchema } from "../../../assets/fonts/config.js";
|
|
4
5
|
import { EnvSchema } from "../../../env/schema.js";
|
|
5
6
|
const ASTRO_CONFIG_DEFAULTS = {
|
|
6
7
|
root: ".",
|
|
@@ -53,9 +54,6 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|
|
53
54
|
clientPrerender: false,
|
|
54
55
|
contentIntellisense: false,
|
|
55
56
|
responsiveImages: false,
|
|
56
|
-
svg: false,
|
|
57
|
-
serializeConfig: false,
|
|
58
|
-
session: false,
|
|
59
57
|
headingIdCompat: false,
|
|
60
58
|
preserveScriptOrder: false
|
|
61
59
|
}
|
|
@@ -263,11 +261,9 @@ const AstroConfigSchema = z.object({
|
|
|
263
261
|
clientPrerender: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.clientPrerender),
|
|
264
262
|
contentIntellisense: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentIntellisense),
|
|
265
263
|
responsiveImages: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.responsiveImages),
|
|
266
|
-
session: z.boolean().optional(),
|
|
267
|
-
svg: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.svg),
|
|
268
|
-
serializeConfig: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.serializeConfig),
|
|
269
264
|
headingIdCompat: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.headingIdCompat),
|
|
270
|
-
preserveScriptOrder: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder)
|
|
265
|
+
preserveScriptOrder: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder),
|
|
266
|
+
fonts: z.array(z.union([localFontFamilySchema, remoteFontFamilySchema])).optional()
|
|
271
267
|
}).strict(
|
|
272
268
|
`Invalid or outdated experimental feature.
|
|
273
269
|
Check for incorrect spelling or outdated Astro version.
|
|
@@ -135,6 +135,18 @@ const AstroConfigRefinedSchema = z.custom().superRefine((config, ctx) => {
|
|
|
135
135
|
path: ["experimental", "responsiveImages"]
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
+
if (config.experimental.fonts && config.experimental.fonts.length > 0) {
|
|
139
|
+
for (let i = 0; i < config.experimental.fonts.length; i++) {
|
|
140
|
+
const { cssVariable } = config.experimental.fonts[i];
|
|
141
|
+
if (!cssVariable.startsWith("--") || cssVariable.includes(" ") || cssVariable.includes(":")) {
|
|
142
|
+
ctx.addIssue({
|
|
143
|
+
code: z.ZodIssueCode.custom,
|
|
144
|
+
message: `**cssVariable** property "${cssVariable}" contains invalid characters for CSS variable generation. It must start with -- and be a valid indent: https://developer.mozilla.org/en-US/docs/Web/CSS/ident.`,
|
|
145
|
+
path: ["fonts", i, "cssVariable"]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
138
150
|
});
|
|
139
151
|
export {
|
|
140
152
|
AstroConfigRefinedSchema
|