astro 5.0.0-alpha.6 → 5.0.0-alpha.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.
- package/client.d.ts +6 -2
- package/config.d.ts +1 -0
- package/dist/actions/runtime/virtual/server.js +10 -2
- package/dist/assets/build/generate.js +8 -5
- package/dist/assets/endpoint/config.js +21 -5
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +1 -1
- package/dist/assets/vite-plugin-assets.js +1 -1
- package/dist/cli/add/index.d.ts +1 -1
- package/dist/cli/add/index.js +3 -3
- package/dist/cli/create-key/index.d.ts +6 -0
- package/dist/cli/create-key/index.js +27 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/info/index.js +18 -9
- package/dist/core/app/index.d.ts +1 -6
- package/dist/core/app/index.js +5 -29
- package/dist/core/build/generate.js +5 -2
- package/dist/core/build/index.js +9 -5
- package/dist/core/build/internal.d.ts +0 -10
- package/dist/core/build/internal.js +0 -20
- package/dist/core/build/plugins/plugin-manifest.js +2 -1
- package/dist/core/build/plugins/plugin-ssr.js +1 -2
- package/dist/core/build/static-build.js +3 -6
- package/dist/core/config/schema.d.ts +82 -35
- package/dist/core/config/schema.js +6 -11
- package/dist/core/constants.js +1 -1
- package/dist/core/create-vite.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/encryption.d.ts +12 -0
- package/dist/core/encryption.js +19 -0
- package/dist/core/errors/errors-data.d.ts +27 -3
- package/dist/core/errors/errors-data.js +14 -0
- package/dist/core/logger/core.d.ts +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/index.js +2 -7
- package/dist/core/render-context.js +2 -9
- package/dist/core/request.d.ts +0 -1
- package/dist/core/routing/manifest/create.js +6 -3
- package/dist/core/sync/index.js +9 -1
- package/dist/integrations/features-validation.d.ts +11 -2
- package/dist/integrations/features-validation.js +72 -54
- package/dist/integrations/hooks.js +24 -13
- package/dist/runtime/client/dev-toolbar/entrypoint.js +0 -13
- package/dist/runtime/client/dev-toolbar/settings.js +0 -5
- package/dist/runtime/client/dev-toolbar/toolbar.js +9 -23
- package/dist/runtime/client/dev-toolbar/ui-library/button.js +0 -2
- package/dist/transitions/vite-plugin-transitions.js +5 -2
- package/dist/types/public/config.d.ts +14 -74
- package/dist/types/public/integrations.d.ts +28 -26
- package/dist/types/public/internal.d.ts +85 -1
- package/dist/types/public/toolbar.d.ts +1 -25
- package/dist/vite-plugin-astro-server/css.js +9 -6
- package/dist/vite-plugin-astro-server/route.js +0 -1
- package/package.json +9 -9
- package/templates/content/types.d.ts +1 -1
- package/tsconfigs/base.json +3 -1
- /package/components/{ViewTransitions.astro → ClientRouter.astro} +0 -0
|
@@ -30,6 +30,10 @@ export declare const ASTRO_CONFIG_DEFAULTS: {
|
|
|
30
30
|
inlineStylesheets: "auto";
|
|
31
31
|
};
|
|
32
32
|
image: {
|
|
33
|
+
endpoint: {
|
|
34
|
+
entrypoint: undefined;
|
|
35
|
+
route: "/_image";
|
|
36
|
+
};
|
|
33
37
|
service: {
|
|
34
38
|
entrypoint: "astro/assets/services/sharp";
|
|
35
39
|
config: {};
|
|
@@ -59,7 +63,6 @@ export declare const ASTRO_CONFIG_DEFAULTS: {
|
|
|
59
63
|
experimental: {
|
|
60
64
|
contentCollectionCache: false;
|
|
61
65
|
clientPrerender: false;
|
|
62
|
-
serverIslands: false;
|
|
63
66
|
contentIntellisense: false;
|
|
64
67
|
};
|
|
65
68
|
};
|
|
@@ -188,7 +191,16 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
188
191
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
189
192
|
}>]>>;
|
|
190
193
|
image: z.ZodDefault<z.ZodObject<{
|
|
191
|
-
endpoint: z.
|
|
194
|
+
endpoint: z.ZodDefault<z.ZodObject<{
|
|
195
|
+
route: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"/_image">, z.ZodString]>>;
|
|
196
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
route: string;
|
|
199
|
+
entrypoint?: string | undefined;
|
|
200
|
+
}, {
|
|
201
|
+
route?: string | undefined;
|
|
202
|
+
entrypoint?: string | undefined;
|
|
203
|
+
}>>;
|
|
192
204
|
service: z.ZodDefault<z.ZodObject<{
|
|
193
205
|
entrypoint: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"astro/assets/services/sharp">, z.ZodString]>>;
|
|
194
206
|
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -217,6 +229,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
217
229
|
pathname?: string | undefined;
|
|
218
230
|
}>, "many">>;
|
|
219
231
|
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
endpoint: {
|
|
233
|
+
route: string;
|
|
234
|
+
entrypoint?: string | undefined;
|
|
235
|
+
};
|
|
220
236
|
service: {
|
|
221
237
|
entrypoint: string;
|
|
222
238
|
config: Record<string, any>;
|
|
@@ -228,9 +244,11 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
228
244
|
hostname?: string | undefined;
|
|
229
245
|
pathname?: string | undefined;
|
|
230
246
|
}[];
|
|
231
|
-
endpoint?: string | undefined;
|
|
232
247
|
}, {
|
|
233
|
-
endpoint?:
|
|
248
|
+
endpoint?: {
|
|
249
|
+
route?: string | undefined;
|
|
250
|
+
entrypoint?: string | undefined;
|
|
251
|
+
} | undefined;
|
|
234
252
|
service?: {
|
|
235
253
|
entrypoint?: string | undefined;
|
|
236
254
|
config?: Record<string, any> | undefined;
|
|
@@ -258,7 +276,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
258
276
|
themes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<[import("shiki").BundledTheme, ...import("shiki").BundledTheme[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>>;
|
|
259
277
|
defaultColor: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"light">, z.ZodLiteral<"dark">, z.ZodString, z.ZodLiteral<false>]>>;
|
|
260
278
|
wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
261
|
-
transformers: z.ZodDefault<z.
|
|
279
|
+
transformers: z.ZodDefault<z.ZodArray<z.ZodType<ShikiTransformer, z.ZodTypeDef, ShikiTransformer>, "many">>;
|
|
262
280
|
}, "strip", z.ZodTypeAny, {
|
|
263
281
|
langs: ShikiLang[];
|
|
264
282
|
theme: import("shiki").BundledTheme | ShikiTheme;
|
|
@@ -619,17 +637,14 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
619
637
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
620
638
|
contentCollectionCache: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
621
639
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
622
|
-
serverIslands: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
623
640
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
624
641
|
}, "strict", z.ZodTypeAny, {
|
|
625
642
|
contentCollectionCache: boolean;
|
|
626
643
|
clientPrerender: boolean;
|
|
627
|
-
serverIslands: boolean;
|
|
628
644
|
contentIntellisense: boolean;
|
|
629
645
|
}, {
|
|
630
646
|
contentCollectionCache?: boolean | undefined;
|
|
631
647
|
clientPrerender?: boolean | undefined;
|
|
632
|
-
serverIslands?: boolean | undefined;
|
|
633
648
|
contentIntellisense?: boolean | undefined;
|
|
634
649
|
}>>;
|
|
635
650
|
legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
@@ -673,6 +688,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
673
688
|
} & Record<string, string>) | undefined;
|
|
674
689
|
};
|
|
675
690
|
image: {
|
|
691
|
+
endpoint: {
|
|
692
|
+
route: string;
|
|
693
|
+
entrypoint?: string | undefined;
|
|
694
|
+
};
|
|
676
695
|
service: {
|
|
677
696
|
entrypoint: string;
|
|
678
697
|
config: Record<string, any>;
|
|
@@ -684,7 +703,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
684
703
|
hostname?: string | undefined;
|
|
685
704
|
pathname?: string | undefined;
|
|
686
705
|
}[];
|
|
687
|
-
endpoint?: string | undefined;
|
|
688
706
|
};
|
|
689
707
|
devToolbar: {
|
|
690
708
|
enabled: boolean;
|
|
@@ -754,7 +772,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
754
772
|
experimental: {
|
|
755
773
|
contentCollectionCache: boolean;
|
|
756
774
|
clientPrerender: boolean;
|
|
757
|
-
serverIslands: boolean;
|
|
758
775
|
contentIntellisense: boolean;
|
|
759
776
|
};
|
|
760
777
|
legacy: {};
|
|
@@ -822,7 +839,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
822
839
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
823
840
|
} | undefined;
|
|
824
841
|
image?: {
|
|
825
|
-
endpoint?:
|
|
842
|
+
endpoint?: {
|
|
843
|
+
route?: string | undefined;
|
|
844
|
+
entrypoint?: string | undefined;
|
|
845
|
+
} | undefined;
|
|
826
846
|
service?: {
|
|
827
847
|
entrypoint?: string | undefined;
|
|
828
848
|
config?: Record<string, any> | undefined;
|
|
@@ -917,7 +937,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
917
937
|
experimental?: {
|
|
918
938
|
contentCollectionCache?: boolean | undefined;
|
|
919
939
|
clientPrerender?: boolean | undefined;
|
|
920
|
-
serverIslands?: boolean | undefined;
|
|
921
940
|
contentIntellisense?: boolean | undefined;
|
|
922
941
|
} | undefined;
|
|
923
942
|
legacy?: {} | undefined;
|
|
@@ -1048,7 +1067,16 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1048
1067
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
1049
1068
|
}>]>>;
|
|
1050
1069
|
image: z.ZodDefault<z.ZodObject<{
|
|
1051
|
-
endpoint: z.
|
|
1070
|
+
endpoint: z.ZodDefault<z.ZodObject<{
|
|
1071
|
+
route: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"/_image">, z.ZodString]>>;
|
|
1072
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
1073
|
+
}, "strip", z.ZodTypeAny, {
|
|
1074
|
+
route: string;
|
|
1075
|
+
entrypoint?: string | undefined;
|
|
1076
|
+
}, {
|
|
1077
|
+
route?: string | undefined;
|
|
1078
|
+
entrypoint?: string | undefined;
|
|
1079
|
+
}>>;
|
|
1052
1080
|
service: z.ZodDefault<z.ZodObject<{
|
|
1053
1081
|
entrypoint: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"astro/assets/services/sharp">, z.ZodString]>>;
|
|
1054
1082
|
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1077,6 +1105,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1077
1105
|
pathname?: string | undefined;
|
|
1078
1106
|
}>, "many">>;
|
|
1079
1107
|
}, "strip", z.ZodTypeAny, {
|
|
1108
|
+
endpoint: {
|
|
1109
|
+
route: string;
|
|
1110
|
+
entrypoint?: string | undefined;
|
|
1111
|
+
};
|
|
1080
1112
|
service: {
|
|
1081
1113
|
entrypoint: string;
|
|
1082
1114
|
config: Record<string, any>;
|
|
@@ -1088,9 +1120,11 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1088
1120
|
hostname?: string | undefined;
|
|
1089
1121
|
pathname?: string | undefined;
|
|
1090
1122
|
}[];
|
|
1091
|
-
endpoint?: string | undefined;
|
|
1092
1123
|
}, {
|
|
1093
|
-
endpoint?:
|
|
1124
|
+
endpoint?: {
|
|
1125
|
+
route?: string | undefined;
|
|
1126
|
+
entrypoint?: string | undefined;
|
|
1127
|
+
} | undefined;
|
|
1094
1128
|
service?: {
|
|
1095
1129
|
entrypoint?: string | undefined;
|
|
1096
1130
|
config?: Record<string, any> | undefined;
|
|
@@ -1118,7 +1152,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1118
1152
|
themes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<[import("shiki").BundledTheme, ...import("shiki").BundledTheme[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>>;
|
|
1119
1153
|
defaultColor: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"light">, z.ZodLiteral<"dark">, z.ZodString, z.ZodLiteral<false>]>>;
|
|
1120
1154
|
wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
1121
|
-
transformers: z.ZodDefault<z.
|
|
1155
|
+
transformers: z.ZodDefault<z.ZodArray<z.ZodType<ShikiTransformer, z.ZodTypeDef, ShikiTransformer>, "many">>;
|
|
1122
1156
|
}, "strip", z.ZodTypeAny, {
|
|
1123
1157
|
langs: ShikiLang[];
|
|
1124
1158
|
theme: import("shiki").BundledTheme | ShikiTheme;
|
|
@@ -1479,17 +1513,14 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1479
1513
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
1480
1514
|
contentCollectionCache: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1481
1515
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1482
|
-
serverIslands: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1483
1516
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1484
1517
|
}, "strict", z.ZodTypeAny, {
|
|
1485
1518
|
contentCollectionCache: boolean;
|
|
1486
1519
|
clientPrerender: boolean;
|
|
1487
|
-
serverIslands: boolean;
|
|
1488
1520
|
contentIntellisense: boolean;
|
|
1489
1521
|
}, {
|
|
1490
1522
|
contentCollectionCache?: boolean | undefined;
|
|
1491
1523
|
clientPrerender?: boolean | undefined;
|
|
1492
|
-
serverIslands?: boolean | undefined;
|
|
1493
1524
|
contentIntellisense?: boolean | undefined;
|
|
1494
1525
|
}>>;
|
|
1495
1526
|
legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
@@ -1608,6 +1639,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1608
1639
|
} & Record<string, string>) | undefined;
|
|
1609
1640
|
};
|
|
1610
1641
|
image: {
|
|
1642
|
+
endpoint: {
|
|
1643
|
+
route: string;
|
|
1644
|
+
entrypoint?: string | undefined;
|
|
1645
|
+
};
|
|
1611
1646
|
service: {
|
|
1612
1647
|
entrypoint: string;
|
|
1613
1648
|
config: Record<string, any>;
|
|
@@ -1619,7 +1654,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1619
1654
|
hostname?: string | undefined;
|
|
1620
1655
|
pathname?: string | undefined;
|
|
1621
1656
|
}[];
|
|
1622
|
-
endpoint?: string | undefined;
|
|
1623
1657
|
};
|
|
1624
1658
|
devToolbar: {
|
|
1625
1659
|
enabled: boolean;
|
|
@@ -1689,7 +1723,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1689
1723
|
experimental: {
|
|
1690
1724
|
contentCollectionCache: boolean;
|
|
1691
1725
|
clientPrerender: boolean;
|
|
1692
|
-
serverIslands: boolean;
|
|
1693
1726
|
contentIntellisense: boolean;
|
|
1694
1727
|
};
|
|
1695
1728
|
legacy: {};
|
|
@@ -1757,7 +1790,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1757
1790
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
1758
1791
|
} | undefined;
|
|
1759
1792
|
image?: {
|
|
1760
|
-
endpoint?:
|
|
1793
|
+
endpoint?: {
|
|
1794
|
+
route?: string | undefined;
|
|
1795
|
+
entrypoint?: string | undefined;
|
|
1796
|
+
} | undefined;
|
|
1761
1797
|
service?: {
|
|
1762
1798
|
entrypoint?: string | undefined;
|
|
1763
1799
|
config?: Record<string, any> | undefined;
|
|
@@ -1852,7 +1888,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1852
1888
|
experimental?: {
|
|
1853
1889
|
contentCollectionCache?: boolean | undefined;
|
|
1854
1890
|
clientPrerender?: boolean | undefined;
|
|
1855
|
-
serverIslands?: boolean | undefined;
|
|
1856
1891
|
contentIntellisense?: boolean | undefined;
|
|
1857
1892
|
} | undefined;
|
|
1858
1893
|
legacy?: {} | undefined;
|
|
@@ -1897,6 +1932,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1897
1932
|
} & Record<string, string>) | undefined;
|
|
1898
1933
|
};
|
|
1899
1934
|
image: {
|
|
1935
|
+
endpoint: {
|
|
1936
|
+
route: string;
|
|
1937
|
+
entrypoint?: string | undefined;
|
|
1938
|
+
};
|
|
1900
1939
|
service: {
|
|
1901
1940
|
entrypoint: string;
|
|
1902
1941
|
config: Record<string, any>;
|
|
@@ -1908,7 +1947,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1908
1947
|
hostname?: string | undefined;
|
|
1909
1948
|
pathname?: string | undefined;
|
|
1910
1949
|
}[];
|
|
1911
|
-
endpoint?: string | undefined;
|
|
1912
1950
|
};
|
|
1913
1951
|
devToolbar: {
|
|
1914
1952
|
enabled: boolean;
|
|
@@ -1978,7 +2016,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1978
2016
|
experimental: {
|
|
1979
2017
|
contentCollectionCache: boolean;
|
|
1980
2018
|
clientPrerender: boolean;
|
|
1981
|
-
serverIslands: boolean;
|
|
1982
2019
|
contentIntellisense: boolean;
|
|
1983
2020
|
};
|
|
1984
2021
|
legacy: {};
|
|
@@ -2046,7 +2083,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2046
2083
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
2047
2084
|
} | undefined;
|
|
2048
2085
|
image?: {
|
|
2049
|
-
endpoint?:
|
|
2086
|
+
endpoint?: {
|
|
2087
|
+
route?: string | undefined;
|
|
2088
|
+
entrypoint?: string | undefined;
|
|
2089
|
+
} | undefined;
|
|
2050
2090
|
service?: {
|
|
2051
2091
|
entrypoint?: string | undefined;
|
|
2052
2092
|
config?: Record<string, any> | undefined;
|
|
@@ -2141,7 +2181,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2141
2181
|
experimental?: {
|
|
2142
2182
|
contentCollectionCache?: boolean | undefined;
|
|
2143
2183
|
clientPrerender?: boolean | undefined;
|
|
2144
|
-
serverIslands?: boolean | undefined;
|
|
2145
2184
|
contentIntellisense?: boolean | undefined;
|
|
2146
2185
|
} | undefined;
|
|
2147
2186
|
legacy?: {} | undefined;
|
|
@@ -2186,6 +2225,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2186
2225
|
} & Record<string, string>) | undefined;
|
|
2187
2226
|
};
|
|
2188
2227
|
image: {
|
|
2228
|
+
endpoint: {
|
|
2229
|
+
route: string;
|
|
2230
|
+
entrypoint?: string | undefined;
|
|
2231
|
+
};
|
|
2189
2232
|
service: {
|
|
2190
2233
|
entrypoint: string;
|
|
2191
2234
|
config: Record<string, any>;
|
|
@@ -2197,7 +2240,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2197
2240
|
hostname?: string | undefined;
|
|
2198
2241
|
pathname?: string | undefined;
|
|
2199
2242
|
}[];
|
|
2200
|
-
endpoint?: string | undefined;
|
|
2201
2243
|
};
|
|
2202
2244
|
devToolbar: {
|
|
2203
2245
|
enabled: boolean;
|
|
@@ -2267,7 +2309,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2267
2309
|
experimental: {
|
|
2268
2310
|
contentCollectionCache: boolean;
|
|
2269
2311
|
clientPrerender: boolean;
|
|
2270
|
-
serverIslands: boolean;
|
|
2271
2312
|
contentIntellisense: boolean;
|
|
2272
2313
|
};
|
|
2273
2314
|
legacy: {};
|
|
@@ -2335,7 +2376,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2335
2376
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
2336
2377
|
} | undefined;
|
|
2337
2378
|
image?: {
|
|
2338
|
-
endpoint?:
|
|
2379
|
+
endpoint?: {
|
|
2380
|
+
route?: string | undefined;
|
|
2381
|
+
entrypoint?: string | undefined;
|
|
2382
|
+
} | undefined;
|
|
2339
2383
|
service?: {
|
|
2340
2384
|
entrypoint?: string | undefined;
|
|
2341
2385
|
config?: Record<string, any> | undefined;
|
|
@@ -2430,7 +2474,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2430
2474
|
experimental?: {
|
|
2431
2475
|
contentCollectionCache?: boolean | undefined;
|
|
2432
2476
|
clientPrerender?: boolean | undefined;
|
|
2433
|
-
serverIslands?: boolean | undefined;
|
|
2434
2477
|
contentIntellisense?: boolean | undefined;
|
|
2435
2478
|
} | undefined;
|
|
2436
2479
|
legacy?: {} | undefined;
|
|
@@ -2475,6 +2518,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2475
2518
|
} & Record<string, string>) | undefined;
|
|
2476
2519
|
};
|
|
2477
2520
|
image: {
|
|
2521
|
+
endpoint: {
|
|
2522
|
+
route: string;
|
|
2523
|
+
entrypoint?: string | undefined;
|
|
2524
|
+
};
|
|
2478
2525
|
service: {
|
|
2479
2526
|
entrypoint: string;
|
|
2480
2527
|
config: Record<string, any>;
|
|
@@ -2486,7 +2533,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2486
2533
|
hostname?: string | undefined;
|
|
2487
2534
|
pathname?: string | undefined;
|
|
2488
2535
|
}[];
|
|
2489
|
-
endpoint?: string | undefined;
|
|
2490
2536
|
};
|
|
2491
2537
|
devToolbar: {
|
|
2492
2538
|
enabled: boolean;
|
|
@@ -2556,7 +2602,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2556
2602
|
experimental: {
|
|
2557
2603
|
contentCollectionCache: boolean;
|
|
2558
2604
|
clientPrerender: boolean;
|
|
2559
|
-
serverIslands: boolean;
|
|
2560
2605
|
contentIntellisense: boolean;
|
|
2561
2606
|
};
|
|
2562
2607
|
legacy: {};
|
|
@@ -2624,7 +2669,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2624
2669
|
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
|
|
2625
2670
|
} | undefined;
|
|
2626
2671
|
image?: {
|
|
2627
|
-
endpoint?:
|
|
2672
|
+
endpoint?: {
|
|
2673
|
+
route?: string | undefined;
|
|
2674
|
+
entrypoint?: string | undefined;
|
|
2675
|
+
} | undefined;
|
|
2628
2676
|
service?: {
|
|
2629
2677
|
entrypoint?: string | undefined;
|
|
2630
2678
|
config?: Record<string, any> | undefined;
|
|
@@ -2719,7 +2767,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2719
2767
|
experimental?: {
|
|
2720
2768
|
contentCollectionCache?: boolean | undefined;
|
|
2721
2769
|
clientPrerender?: boolean | undefined;
|
|
2722
|
-
serverIslands?: boolean | undefined;
|
|
2723
2770
|
contentIntellisense?: boolean | undefined;
|
|
2724
2771
|
} | undefined;
|
|
2725
2772
|
legacy?: {} | undefined;
|
|
@@ -23,6 +23,7 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|
|
23
23
|
inlineStylesheets: "auto"
|
|
24
24
|
},
|
|
25
25
|
image: {
|
|
26
|
+
endpoint: { entrypoint: void 0, route: "/_image" },
|
|
26
27
|
service: { entrypoint: "astro/assets/services/sharp", config: {} }
|
|
27
28
|
},
|
|
28
29
|
devToolbar: {
|
|
@@ -49,7 +50,6 @@ const ASTRO_CONFIG_DEFAULTS = {
|
|
|
49
50
|
experimental: {
|
|
50
51
|
contentCollectionCache: false,
|
|
51
52
|
clientPrerender: false,
|
|
52
|
-
serverIslands: false,
|
|
53
53
|
contentIntellisense: false
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -133,7 +133,10 @@ const AstroConfigSchema = z.object({
|
|
|
133
133
|
})
|
|
134
134
|
]).optional(),
|
|
135
135
|
image: z.object({
|
|
136
|
-
endpoint: z.
|
|
136
|
+
endpoint: z.object({
|
|
137
|
+
route: z.literal("/_image").or(z.string()).default(ASTRO_CONFIG_DEFAULTS.image.endpoint.route),
|
|
138
|
+
entrypoint: z.string().optional()
|
|
139
|
+
}).default(ASTRO_CONFIG_DEFAULTS.image.endpoint),
|
|
137
140
|
service: z.object({
|
|
138
141
|
entrypoint: z.union([z.literal("astro/assets/services/sharp"), z.string()]).default(ASTRO_CONFIG_DEFAULTS.image.service.entrypoint),
|
|
139
142
|
config: z.record(z.any()).default({})
|
|
@@ -180,14 +183,7 @@ const AstroConfigSchema = z.object({
|
|
|
180
183
|
).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.themes),
|
|
181
184
|
defaultColor: z.union([z.literal("light"), z.literal("dark"), z.string(), z.literal(false)]).optional(),
|
|
182
185
|
wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap),
|
|
183
|
-
transformers: z.custom().array().
|
|
184
|
-
for (const transformer of transformers) {
|
|
185
|
-
if (transformer.token && !("span" in transformer)) {
|
|
186
|
-
transformer.span = transformer.token;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return transformers;
|
|
190
|
-
}).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.transformers)
|
|
186
|
+
transformers: z.custom().array().default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.transformers)
|
|
191
187
|
}).default({}),
|
|
192
188
|
remarkPlugins: z.union([
|
|
193
189
|
z.string(),
|
|
@@ -327,7 +323,6 @@ const AstroConfigSchema = z.object({
|
|
|
327
323
|
experimental: z.object({
|
|
328
324
|
contentCollectionCache: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentCollectionCache),
|
|
329
325
|
clientPrerender: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.clientPrerender),
|
|
330
|
-
serverIslands: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.serverIslands),
|
|
331
326
|
contentIntellisense: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentIntellisense)
|
|
332
327
|
}).strict(
|
|
333
328
|
`Invalid or outdated experimental feature.
|
package/dist/core/constants.js
CHANGED
package/dist/core/create-vite.js
CHANGED
|
@@ -125,7 +125,7 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
|
|
|
125
125
|
astroInternationalization({ settings }),
|
|
126
126
|
vitePluginActions({ fs, settings }),
|
|
127
127
|
vitePluginUserActions({ settings }),
|
|
128
|
-
|
|
128
|
+
vitePluginServerIslands({ settings }),
|
|
129
129
|
astroContainer()
|
|
130
130
|
],
|
|
131
131
|
publicDir: fileURLToPath(settings.config.publicDir),
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.0.0-alpha.
|
|
25
|
+
const currentVersion = "5.0.0-alpha.8";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
* Creates a CryptoKey object that can be used to encrypt any string.
|
|
3
3
|
*/
|
|
4
4
|
export declare function createKey(): Promise<CryptoKey>;
|
|
5
|
+
/**
|
|
6
|
+
* Get the encoded value of the ASTRO_KEY env var.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEncodedEnvironmentKey(): string;
|
|
9
|
+
/**
|
|
10
|
+
* See if the environment variable key ASTRO_KEY is set.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasEnvironmentKey(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get the environment variable key and decode it into a CryptoKey.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getEnvironmentKey(): Promise<CryptoKey>;
|
|
5
17
|
/**
|
|
6
18
|
* Takes a key that has been serialized to an array of bytes and returns a CryptoKey
|
|
7
19
|
*/
|
package/dist/core/encryption.js
CHANGED
|
@@ -11,6 +11,22 @@ async function createKey() {
|
|
|
11
11
|
);
|
|
12
12
|
return key;
|
|
13
13
|
}
|
|
14
|
+
const ENVIRONMENT_KEY_NAME = "ASTRO_KEY";
|
|
15
|
+
function getEncodedEnvironmentKey() {
|
|
16
|
+
return process.env[ENVIRONMENT_KEY_NAME] || "";
|
|
17
|
+
}
|
|
18
|
+
function hasEnvironmentKey() {
|
|
19
|
+
return getEncodedEnvironmentKey() !== "";
|
|
20
|
+
}
|
|
21
|
+
async function getEnvironmentKey() {
|
|
22
|
+
if (!hasEnvironmentKey()) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`There is no environment key defined. If you see this error there is a bug in Astro.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const encodedKey = getEncodedEnvironmentKey();
|
|
28
|
+
return decodeKey(encodedKey);
|
|
29
|
+
}
|
|
14
30
|
async function importKey(bytes) {
|
|
15
31
|
const key = await crypto.subtle.importKey("raw", bytes, ALGORITHM, true, ["encrypt", "decrypt"]);
|
|
16
32
|
return key;
|
|
@@ -60,5 +76,8 @@ export {
|
|
|
60
76
|
decryptString,
|
|
61
77
|
encodeKey,
|
|
62
78
|
encryptString,
|
|
79
|
+
getEncodedEnvironmentKey,
|
|
80
|
+
getEnvironmentKey,
|
|
81
|
+
hasEnvironmentKey,
|
|
63
82
|
importKey
|
|
64
83
|
};
|
|
@@ -364,6 +364,19 @@ export declare const AdapterSupportOutputMismatch: {
|
|
|
364
364
|
title: string;
|
|
365
365
|
message: (adapterName: string) => string;
|
|
366
366
|
};
|
|
367
|
+
/**
|
|
368
|
+
* @docs
|
|
369
|
+
* @see
|
|
370
|
+
* - [On-demand Rendering](https://5-0-0-beta.docs.astro.build/en/guides/on-demand-rendering/)
|
|
371
|
+
* @description
|
|
372
|
+
* To use server islands, the same constraints exist as for sever-side rendering, so an adapter is needed.
|
|
373
|
+
*/
|
|
374
|
+
export declare const NoAdapterInstalledServerIslands: {
|
|
375
|
+
name: string;
|
|
376
|
+
title: string;
|
|
377
|
+
message: string;
|
|
378
|
+
hint: string;
|
|
379
|
+
};
|
|
367
380
|
/**
|
|
368
381
|
* @docs
|
|
369
382
|
* @description
|
|
@@ -739,6 +752,17 @@ export declare const LocalsNotAnObject: {
|
|
|
739
752
|
message: string;
|
|
740
753
|
hint: string;
|
|
741
754
|
};
|
|
755
|
+
/**
|
|
756
|
+
* @docs
|
|
757
|
+
* @description
|
|
758
|
+
* Thrown when a value is being set as the `locals` field on the Astro global or context.
|
|
759
|
+
*/
|
|
760
|
+
export declare const LocalsReassigned: {
|
|
761
|
+
name: string;
|
|
762
|
+
title: string;
|
|
763
|
+
message: string;
|
|
764
|
+
hint: string;
|
|
765
|
+
};
|
|
742
766
|
/**
|
|
743
767
|
* @docs
|
|
744
768
|
* @description
|
|
@@ -1332,7 +1356,7 @@ export declare const InvalidContentEntrySlugError: {
|
|
|
1332
1356
|
/**
|
|
1333
1357
|
* @docs
|
|
1334
1358
|
* @see
|
|
1335
|
-
* - [Legacy content collections](https://docs.astro.build/en/guides/
|
|
1359
|
+
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
|
|
1336
1360
|
* @description
|
|
1337
1361
|
* A legacy content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove `slug` from your schema. You can still use custom slugs in your frontmatter.
|
|
1338
1362
|
*/
|
|
@@ -1345,7 +1369,7 @@ export declare const ContentSchemaContainsSlugError: {
|
|
|
1345
1369
|
/**
|
|
1346
1370
|
* @docs
|
|
1347
1371
|
* @see
|
|
1348
|
-
* - [Legacy content collections](https://docs.astro.build/en/guides/
|
|
1372
|
+
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
|
|
1349
1373
|
* @description
|
|
1350
1374
|
* A legacy content collection cannot contain a mix of content and data entries. You must store entries in separate collections by type.
|
|
1351
1375
|
*/
|
|
@@ -1358,7 +1382,7 @@ export declare const MixedContentDataCollectionError: {
|
|
|
1358
1382
|
/**
|
|
1359
1383
|
* @docs
|
|
1360
1384
|
* @see
|
|
1361
|
-
* - [Legacy content collections](https://docs.astro.build/en/guides/
|
|
1385
|
+
* - [Legacy content collections](https://docs.astro.build/en/guides/upgrade-to/v5/#updating-existing-collections)
|
|
1362
1386
|
* @description
|
|
1363
1387
|
* Legacy content collections must contain entries of the type configured. Collections are `type: 'content'` by default. Try adding `type: 'data'` to your collection config for data collections.
|
|
1364
1388
|
*/
|
|
@@ -113,6 +113,12 @@ const AdapterSupportOutputMismatch = {
|
|
|
113
113
|
title: "Adapter does not support server output.",
|
|
114
114
|
message: (adapterName) => `The \`${adapterName}\` adapter is configured to output a static website, but the project contains server-rendered pages. Please install and configure the appropriate server adapter for your final deployment.`
|
|
115
115
|
};
|
|
116
|
+
const NoAdapterInstalledServerIslands = {
|
|
117
|
+
name: "NoAdapterInstalledServerIslands",
|
|
118
|
+
title: "Cannot use Server Islands without an adapter.",
|
|
119
|
+
message: `Cannot use server islands without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,
|
|
120
|
+
hint: "See https://5-0-0-beta.docs.astro.build/en/guides/on-demand-rendering/ for more information."
|
|
121
|
+
};
|
|
116
122
|
const NoMatchingImport = {
|
|
117
123
|
name: "NoMatchingImport",
|
|
118
124
|
title: "No import found for component.",
|
|
@@ -257,6 +263,12 @@ const LocalsNotAnObject = {
|
|
|
257
263
|
message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.",
|
|
258
264
|
hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`."
|
|
259
265
|
};
|
|
266
|
+
const LocalsReassigned = {
|
|
267
|
+
name: "LocalsReassigned",
|
|
268
|
+
title: "`locals` must not be reassigned.",
|
|
269
|
+
message: "`locals` can not be assigned directly.",
|
|
270
|
+
hint: "Set a `locals` property instead."
|
|
271
|
+
};
|
|
260
272
|
const AstroResponseHeadersReassigned = {
|
|
261
273
|
name: "AstroResponseHeadersReassigned",
|
|
262
274
|
title: "`Astro.response.headers` must not be reassigned.",
|
|
@@ -609,6 +621,7 @@ export {
|
|
|
609
621
|
InvalidPrerenderExport,
|
|
610
622
|
LocalImageUsedWrongly,
|
|
611
623
|
LocalsNotAnObject,
|
|
624
|
+
LocalsReassigned,
|
|
612
625
|
MarkdownFrontmatterParseError,
|
|
613
626
|
MdxIntegrationMissingError,
|
|
614
627
|
MiddlewareCantBeLoaded,
|
|
@@ -622,6 +635,7 @@ export {
|
|
|
622
635
|
MissingSharp,
|
|
623
636
|
MixedContentDataCollectionError,
|
|
624
637
|
NoAdapterInstalled,
|
|
638
|
+
NoAdapterInstalledServerIslands,
|
|
625
639
|
NoClientEntrypoint,
|
|
626
640
|
NoClientOnlyHint,
|
|
627
641
|
NoImageMetadata,
|
|
@@ -7,7 +7,7 @@ export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
|
7
7
|
* rather than specific to a single command, function, use, etc. The label will be
|
|
8
8
|
* shown in the log message to the user, so it should be relevant.
|
|
9
9
|
*/
|
|
10
|
-
export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'toolbar' | 'assets' | 'env' | 'update' | 'SKIP_FORMAT';
|
|
10
|
+
export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'toolbar' | 'assets' | 'env' | 'update' | 'adapter' | 'SKIP_FORMAT';
|
|
11
11
|
export interface LogOptions {
|
|
12
12
|
dest: LogWritable<LogMessage>;
|
|
13
13
|
level: LoggerLevel;
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.0.0-alpha.
|
|
41
|
+
const version = "5.0.0-alpha.8";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -270,7 +270,7 @@ function printHelp({
|
|
|
270
270
|
message.push(
|
|
271
271
|
linebreak(),
|
|
272
272
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
273
|
-
`v${"5.0.0-alpha.
|
|
273
|
+
`v${"5.0.0-alpha.8"}`
|
|
274
274
|
)} ${headline}`
|
|
275
275
|
);
|
|
276
276
|
}
|
|
@@ -69,13 +69,8 @@ function createContext({
|
|
|
69
69
|
}
|
|
70
70
|
return locals;
|
|
71
71
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (typeof val !== "object") {
|
|
75
|
-
throw new AstroError(AstroErrorData.LocalsNotAnObject);
|
|
76
|
-
} else {
|
|
77
|
-
Reflect.set(request, clientLocalsSymbol, val);
|
|
78
|
-
}
|
|
72
|
+
set locals(_) {
|
|
73
|
+
throw new AstroError(AstroErrorData.LocalsReassigned);
|
|
79
74
|
}
|
|
80
75
|
};
|
|
81
76
|
return Object.assign(context, {
|