astro 5.9.3 → 5.10.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 +1 -3
- package/components/Image.astro +5 -6
- package/components/Picture.astro +5 -5
- package/components/ResponsivePicture.astro +1 -0
- package/dist/actions/integration.d.ts +2 -1
- package/dist/actions/integration.js +3 -2
- package/dist/actions/utils.d.ts +1 -1
- package/dist/actions/utils.js +9 -8
- package/dist/assets/internal.d.ts +1 -5
- package/dist/assets/internal.js +21 -23
- package/dist/assets/types.d.ts +4 -4
- package/dist/assets/vite-plugin-assets.js +2 -2
- package/dist/content/config.d.ts +74 -0
- package/dist/content/config.js +78 -0
- package/dist/content/consts.d.ts +1 -0
- package/dist/content/consts.js +2 -0
- package/dist/content/content-layer.js +3 -3
- package/dist/content/loaders/errors.d.ts +20 -0
- package/dist/content/loaders/errors.js +64 -0
- package/dist/content/loaders/types.d.ts +21 -0
- package/dist/content/runtime.d.ts +23 -7
- package/dist/content/runtime.js +218 -28
- package/dist/content/types-generator.js +11 -4
- package/dist/content/utils.d.ts +37 -1
- package/dist/content/utils.js +29 -8
- package/dist/content/vite-plugin-content-virtual-mod.d.ts +1 -1
- package/dist/content/vite-plugin-content-virtual-mod.js +20 -6
- package/dist/core/config/schemas/base.d.ts +44 -44
- package/dist/core/config/schemas/base.js +9 -9
- package/dist/core/config/schemas/refined.js +0 -7
- package/dist/core/config/schemas/relative.d.ts +58 -58
- package/dist/core/constants.js +1 -1
- package/dist/core/csp/config.d.ts +3 -3
- package/dist/core/csp/config.js +1 -0
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/errors-data.d.ts +16 -0
- package/dist/core/errors/errors-data.js +15 -4
- package/dist/core/errors/errors.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/session.d.ts +1 -1
- package/dist/core/session.js +10 -9
- package/dist/integrations/hooks.js +5 -2
- package/dist/runtime/client/dev-toolbar/apps/astro.js +4 -6
- package/dist/runtime/server/render/csp.js +1 -1
- package/dist/types/public/config.d.ts +40 -131
- package/dist/types/public/content.d.ts +30 -0
- package/package.json +4 -3
- package/templates/content/module.mjs +14 -0
- package/templates/content/types.d.ts +43 -0
- package/types/content.d.ts +23 -80
|
@@ -165,13 +165,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
165
165
|
hostname?: string | undefined;
|
|
166
166
|
pathname?: string | undefined;
|
|
167
167
|
}>, "many">>;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
layout: z.ZodOptional<z.ZodEnum<["constrained", "fixed", "full-width", "none"]>>;
|
|
169
|
+
objectFit: z.ZodOptional<z.ZodString>;
|
|
170
|
+
objectPosition: z.ZodOptional<z.ZodString>;
|
|
171
|
+
breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
172
|
+
responsiveStyles: z.ZodDefault<z.ZodBoolean>;
|
|
173
173
|
}, "strip", z.ZodTypeAny, {
|
|
174
|
-
|
|
174
|
+
responsiveStyles: boolean;
|
|
175
175
|
endpoint: {
|
|
176
176
|
route: string;
|
|
177
177
|
entrypoint?: string | undefined;
|
|
@@ -187,12 +187,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
187
187
|
hostname?: string | undefined;
|
|
188
188
|
pathname?: string | undefined;
|
|
189
189
|
}[];
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
191
|
+
objectFit?: string | undefined;
|
|
192
|
+
objectPosition?: string | undefined;
|
|
193
|
+
breakpoints?: number[] | undefined;
|
|
194
194
|
}, {
|
|
195
|
-
|
|
195
|
+
responsiveStyles?: boolean | undefined;
|
|
196
196
|
endpoint?: {
|
|
197
197
|
entrypoint?: string | undefined;
|
|
198
198
|
route?: string | undefined;
|
|
@@ -208,10 +208,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
208
208
|
hostname?: string | undefined;
|
|
209
209
|
pathname?: string | undefined;
|
|
210
210
|
}[] | undefined;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
212
|
+
objectFit?: string | undefined;
|
|
213
|
+
objectPosition?: string | undefined;
|
|
214
|
+
breakpoints?: number[] | undefined;
|
|
215
215
|
}>>;
|
|
216
216
|
devToolbar: z.ZodDefault<z.ZodObject<{
|
|
217
217
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -582,7 +582,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
582
582
|
})> | undefined;
|
|
583
583
|
}>>>;
|
|
584
584
|
session: z.ZodOptional<z.ZodObject<{
|
|
585
|
-
driver: z.ZodString
|
|
585
|
+
driver: z.ZodOptional<z.ZodString>;
|
|
586
586
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
587
587
|
cookie: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
588
588
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -622,8 +622,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
622
622
|
}>>;
|
|
623
623
|
ttl: z.ZodOptional<z.ZodNumber>;
|
|
624
624
|
}, "strip", z.ZodTypeAny, {
|
|
625
|
-
driver: string;
|
|
626
625
|
options?: Record<string, any> | undefined;
|
|
626
|
+
driver?: string | undefined;
|
|
627
627
|
cookie?: {
|
|
628
628
|
name?: string | undefined;
|
|
629
629
|
path?: string | undefined;
|
|
@@ -634,8 +634,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
634
634
|
} | undefined;
|
|
635
635
|
ttl?: number | undefined;
|
|
636
636
|
}, {
|
|
637
|
-
driver: string;
|
|
638
637
|
options?: Record<string, any> | undefined;
|
|
638
|
+
driver?: string | undefined;
|
|
639
639
|
cookie?: string | {
|
|
640
640
|
name?: string | undefined;
|
|
641
641
|
path?: string | undefined;
|
|
@@ -649,7 +649,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
649
649
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
650
650
|
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
651
651
|
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
652
|
-
responsiveImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
653
652
|
headingIdCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
654
653
|
preserveScriptOrder: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
655
654
|
fonts: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
@@ -847,9 +846,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
847
846
|
variationSettings?: string | undefined;
|
|
848
847
|
unicodeRange?: [string, ...string[]] | undefined;
|
|
849
848
|
}>]>, "many">>;
|
|
849
|
+
liveContentCollections: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
850
850
|
csp: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodBoolean>>, z.ZodObject<{
|
|
851
851
|
algorithm: z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "SHA-384", "SHA-512"]>>>;
|
|
852
|
-
directives: z.ZodOptional<z.ZodArray<z.ZodType<`base-uri
|
|
852
|
+
directives: z.ZodOptional<z.ZodArray<z.ZodType<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, z.ZodTypeDef, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>, "many">>;
|
|
853
853
|
styleDirective: z.ZodOptional<z.ZodObject<{
|
|
854
854
|
resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
855
855
|
hashes: z.ZodOptional<z.ZodArray<z.ZodType<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, z.ZodTypeDef, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>, "many">>;
|
|
@@ -875,7 +875,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
875
875
|
}>>;
|
|
876
876
|
}, "strip", z.ZodTypeAny, {
|
|
877
877
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
878
|
-
directives?: (`base-uri
|
|
878
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
879
879
|
styleDirective?: {
|
|
880
880
|
resources?: string[] | undefined;
|
|
881
881
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -887,7 +887,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
887
887
|
} | undefined;
|
|
888
888
|
}, {
|
|
889
889
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
890
|
-
directives?: (`base-uri
|
|
890
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
891
891
|
styleDirective?: {
|
|
892
892
|
resources?: string[] | undefined;
|
|
893
893
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -901,12 +901,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
901
901
|
}, "strict", z.ZodTypeAny, {
|
|
902
902
|
clientPrerender: boolean;
|
|
903
903
|
contentIntellisense: boolean;
|
|
904
|
-
responsiveImages: boolean;
|
|
905
904
|
headingIdCompat: boolean;
|
|
906
905
|
preserveScriptOrder: boolean;
|
|
906
|
+
liveContentCollections: boolean;
|
|
907
907
|
csp: boolean | {
|
|
908
908
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
909
|
-
directives?: (`base-uri
|
|
909
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
910
910
|
styleDirective?: {
|
|
911
911
|
resources?: string[] | undefined;
|
|
912
912
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -1030,12 +1030,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1030
1030
|
})[] | undefined;
|
|
1031
1031
|
clientPrerender?: boolean | undefined;
|
|
1032
1032
|
contentIntellisense?: boolean | undefined;
|
|
1033
|
-
responsiveImages?: boolean | undefined;
|
|
1034
1033
|
headingIdCompat?: boolean | undefined;
|
|
1035
1034
|
preserveScriptOrder?: boolean | undefined;
|
|
1035
|
+
liveContentCollections?: boolean | undefined;
|
|
1036
1036
|
csp?: boolean | {
|
|
1037
1037
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
1038
|
-
directives?: (`base-uri
|
|
1038
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
1039
1039
|
styleDirective?: {
|
|
1040
1040
|
resources?: string[] | undefined;
|
|
1041
1041
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -1215,7 +1215,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1215
1215
|
})>;
|
|
1216
1216
|
};
|
|
1217
1217
|
image: {
|
|
1218
|
-
|
|
1218
|
+
responsiveStyles: boolean;
|
|
1219
1219
|
endpoint: {
|
|
1220
1220
|
route: string;
|
|
1221
1221
|
entrypoint?: string | undefined;
|
|
@@ -1231,10 +1231,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1231
1231
|
hostname?: string | undefined;
|
|
1232
1232
|
pathname?: string | undefined;
|
|
1233
1233
|
}[];
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1234
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
1235
|
+
objectFit?: string | undefined;
|
|
1236
|
+
objectPosition?: string | undefined;
|
|
1237
|
+
breakpoints?: number[] | undefined;
|
|
1238
1238
|
};
|
|
1239
1239
|
server: {
|
|
1240
1240
|
host: string | boolean;
|
|
@@ -1267,12 +1267,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1267
1267
|
experimental: {
|
|
1268
1268
|
clientPrerender: boolean;
|
|
1269
1269
|
contentIntellisense: boolean;
|
|
1270
|
-
responsiveImages: boolean;
|
|
1271
1270
|
headingIdCompat: boolean;
|
|
1272
1271
|
preserveScriptOrder: boolean;
|
|
1272
|
+
liveContentCollections: boolean;
|
|
1273
1273
|
csp: boolean | {
|
|
1274
1274
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1275
|
-
directives?: (`base-uri
|
|
1275
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
1276
1276
|
styleDirective?: {
|
|
1277
1277
|
resources?: string[] | undefined;
|
|
1278
1278
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -1343,8 +1343,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1343
1343
|
collections: boolean;
|
|
1344
1344
|
};
|
|
1345
1345
|
session?: {
|
|
1346
|
-
driver: string;
|
|
1347
1346
|
options?: Record<string, any> | undefined;
|
|
1347
|
+
driver?: string | undefined;
|
|
1348
1348
|
cookie?: {
|
|
1349
1349
|
name?: string | undefined;
|
|
1350
1350
|
path?: string | undefined;
|
|
@@ -1422,8 +1422,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1422
1422
|
destination: string;
|
|
1423
1423
|
}> | undefined;
|
|
1424
1424
|
session?: {
|
|
1425
|
-
driver: string;
|
|
1426
1425
|
options?: Record<string, any> | undefined;
|
|
1426
|
+
driver?: string | undefined;
|
|
1427
1427
|
cookie?: string | {
|
|
1428
1428
|
name?: string | undefined;
|
|
1429
1429
|
path?: string | undefined;
|
|
@@ -1481,7 +1481,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1481
1481
|
hooks?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1482
1482
|
} | undefined;
|
|
1483
1483
|
image?: {
|
|
1484
|
-
|
|
1484
|
+
responsiveStyles?: boolean | undefined;
|
|
1485
1485
|
endpoint?: {
|
|
1486
1486
|
entrypoint?: string | undefined;
|
|
1487
1487
|
route?: string | undefined;
|
|
@@ -1497,10 +1497,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1497
1497
|
hostname?: string | undefined;
|
|
1498
1498
|
pathname?: string | undefined;
|
|
1499
1499
|
}[] | undefined;
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1500
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
1501
|
+
objectFit?: string | undefined;
|
|
1502
|
+
objectPosition?: string | undefined;
|
|
1503
|
+
breakpoints?: number[] | undefined;
|
|
1504
1504
|
} | undefined;
|
|
1505
1505
|
server?: unknown;
|
|
1506
1506
|
srcDir?: string | undefined;
|
|
@@ -1595,12 +1595,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1595
1595
|
})[] | undefined;
|
|
1596
1596
|
clientPrerender?: boolean | undefined;
|
|
1597
1597
|
contentIntellisense?: boolean | undefined;
|
|
1598
|
-
responsiveImages?: boolean | undefined;
|
|
1599
1598
|
headingIdCompat?: boolean | undefined;
|
|
1600
1599
|
preserveScriptOrder?: boolean | undefined;
|
|
1600
|
+
liveContentCollections?: boolean | undefined;
|
|
1601
1601
|
csp?: boolean | {
|
|
1602
1602
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
1603
|
-
directives?: (`base-uri
|
|
1603
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
1604
1604
|
styleDirective?: {
|
|
1605
1605
|
resources?: string[] | undefined;
|
|
1606
1606
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -1699,7 +1699,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1699
1699
|
})>;
|
|
1700
1700
|
};
|
|
1701
1701
|
image: {
|
|
1702
|
-
|
|
1702
|
+
responsiveStyles: boolean;
|
|
1703
1703
|
endpoint: {
|
|
1704
1704
|
route: string;
|
|
1705
1705
|
entrypoint?: string | undefined;
|
|
@@ -1715,10 +1715,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1715
1715
|
hostname?: string | undefined;
|
|
1716
1716
|
pathname?: string | undefined;
|
|
1717
1717
|
}[];
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1718
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
1719
|
+
objectFit?: string | undefined;
|
|
1720
|
+
objectPosition?: string | undefined;
|
|
1721
|
+
breakpoints?: number[] | undefined;
|
|
1722
1722
|
};
|
|
1723
1723
|
server: {
|
|
1724
1724
|
host: string | boolean;
|
|
@@ -1751,12 +1751,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1751
1751
|
experimental: {
|
|
1752
1752
|
clientPrerender: boolean;
|
|
1753
1753
|
contentIntellisense: boolean;
|
|
1754
|
-
responsiveImages: boolean;
|
|
1755
1754
|
headingIdCompat: boolean;
|
|
1756
1755
|
preserveScriptOrder: boolean;
|
|
1756
|
+
liveContentCollections: boolean;
|
|
1757
1757
|
csp: boolean | {
|
|
1758
1758
|
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
|
|
1759
|
-
directives?: (`base-uri
|
|
1759
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
1760
1760
|
styleDirective?: {
|
|
1761
1761
|
resources?: string[] | undefined;
|
|
1762
1762
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
|
@@ -1827,8 +1827,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1827
1827
|
collections: boolean;
|
|
1828
1828
|
};
|
|
1829
1829
|
session?: {
|
|
1830
|
-
driver: string;
|
|
1831
1830
|
options?: Record<string, any> | undefined;
|
|
1831
|
+
driver?: string | undefined;
|
|
1832
1832
|
cookie?: {
|
|
1833
1833
|
name?: string | undefined;
|
|
1834
1834
|
path?: string | undefined;
|
|
@@ -1906,8 +1906,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1906
1906
|
destination: string;
|
|
1907
1907
|
}> | undefined;
|
|
1908
1908
|
session?: {
|
|
1909
|
-
driver: string;
|
|
1910
1909
|
options?: Record<string, any> | undefined;
|
|
1910
|
+
driver?: string | undefined;
|
|
1911
1911
|
cookie?: string | {
|
|
1912
1912
|
name?: string | undefined;
|
|
1913
1913
|
path?: string | undefined;
|
|
@@ -1965,7 +1965,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1965
1965
|
hooks?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1966
1966
|
} | undefined;
|
|
1967
1967
|
image?: {
|
|
1968
|
-
|
|
1968
|
+
responsiveStyles?: boolean | undefined;
|
|
1969
1969
|
endpoint?: {
|
|
1970
1970
|
entrypoint?: string | undefined;
|
|
1971
1971
|
route?: string | undefined;
|
|
@@ -1981,10 +1981,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1981
1981
|
hostname?: string | undefined;
|
|
1982
1982
|
pathname?: string | undefined;
|
|
1983
1983
|
}[] | undefined;
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1984
|
+
layout?: "fixed" | "constrained" | "full-width" | "none" | undefined;
|
|
1985
|
+
objectFit?: string | undefined;
|
|
1986
|
+
objectPosition?: string | undefined;
|
|
1987
|
+
breakpoints?: number[] | undefined;
|
|
1988
1988
|
} | undefined;
|
|
1989
1989
|
server?: unknown;
|
|
1990
1990
|
srcDir?: string | undefined;
|
|
@@ -2079,12 +2079,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2079
2079
|
})[] | undefined;
|
|
2080
2080
|
clientPrerender?: boolean | undefined;
|
|
2081
2081
|
contentIntellisense?: boolean | undefined;
|
|
2082
|
-
responsiveImages?: boolean | undefined;
|
|
2083
2082
|
headingIdCompat?: boolean | undefined;
|
|
2084
2083
|
preserveScriptOrder?: boolean | undefined;
|
|
2084
|
+
liveContentCollections?: boolean | undefined;
|
|
2085
2085
|
csp?: boolean | {
|
|
2086
2086
|
algorithm?: "SHA-256" | "SHA-384" | "SHA-512" | undefined;
|
|
2087
|
-
directives?: (`base-uri
|
|
2087
|
+
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
|
|
2088
2088
|
styleDirective?: {
|
|
2089
2089
|
resources?: string[] | undefined;
|
|
2090
2090
|
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
|
package/dist/core/constants.js
CHANGED
|
@@ -9,8 +9,8 @@ export type CspAlgorithm = keyof Algorithms;
|
|
|
9
9
|
export declare const cspAlgorithmSchema: z.ZodDefault<z.ZodOptional<z.ZodEnum<["SHA-256", "SHA-384", "SHA-512"]>>>;
|
|
10
10
|
export declare const cspHashSchema: z.ZodType<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, z.ZodTypeDef, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>;
|
|
11
11
|
export type CspHash = z.infer<typeof cspHashSchema>;
|
|
12
|
-
declare const ALLOWED_DIRECTIVES: readonly ["base-uri", "child-src", "connect-src", "default-src", "fenced-frame-src", "font-src", "form-action", "frame-ancestors", "frame-src", "img-src", "manifest-src", "media-src", "object-src", "referrer", "report-to", "require-trusted-types-for", "sandbox", "trusted-types", "upgrade-insecure-requests", "worker-src"];
|
|
12
|
+
declare const ALLOWED_DIRECTIVES: readonly ["base-uri", "child-src", "connect-src", "default-src", "fenced-frame-src", "font-src", "form-action", "frame-ancestors", "frame-src", "img-src", "manifest-src", "media-src", "object-src", "referrer", "report-to", "report-uri", "require-trusted-types-for", "sandbox", "trusted-types", "upgrade-insecure-requests", "worker-src"];
|
|
13
13
|
type AllowedDirectives = (typeof ALLOWED_DIRECTIVES)[number];
|
|
14
|
-
export type CspDirective = `${AllowedDirectives}
|
|
15
|
-
export declare const allowedDirectivesSchema: z.ZodType<`base-uri
|
|
14
|
+
export type CspDirective = `${AllowedDirectives}${string | undefined}`;
|
|
15
|
+
export declare const allowedDirectivesSchema: z.ZodType<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, z.ZodTypeDef, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>;
|
|
16
16
|
export {};
|
package/dist/core/csp/config.js
CHANGED
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.
|
|
25
|
+
const currentVersion = "5.10.0";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
|
@@ -1509,6 +1509,22 @@ export declare const ContentEntryDataError: {
|
|
|
1509
1509
|
message(collection: string, entryId: string, error: ZodError): string;
|
|
1510
1510
|
hint: string;
|
|
1511
1511
|
};
|
|
1512
|
+
/**
|
|
1513
|
+
* @docs
|
|
1514
|
+
* @message
|
|
1515
|
+
* **Example error message:**<br/>
|
|
1516
|
+
* The schema cannot be a function for live collections. Please use a schema object instead. Check your collection definitions in your live content config file.
|
|
1517
|
+
* @description
|
|
1518
|
+
* Error in live content config.
|
|
1519
|
+
* @see
|
|
1520
|
+
* - [Experimental live content](https://astro.build/en/reference/experimental-flags/live-content-collections/)
|
|
1521
|
+
*/
|
|
1522
|
+
export declare const LiveContentConfigError: {
|
|
1523
|
+
name: string;
|
|
1524
|
+
title: string;
|
|
1525
|
+
message: (error: string, filename?: string) => string;
|
|
1526
|
+
hint: string;
|
|
1527
|
+
};
|
|
1512
1528
|
/**
|
|
1513
1529
|
* @docs
|
|
1514
1530
|
* @message
|
|
@@ -555,8 +555,10 @@ const InvalidContentEntryDataError = {
|
|
|
555
555
|
title: "Content entry data does not match schema.",
|
|
556
556
|
message(collection, entryId, error) {
|
|
557
557
|
return [
|
|
558
|
-
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema
|
|
559
|
-
|
|
558
|
+
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema.
|
|
559
|
+
`,
|
|
560
|
+
...error.errors.map((zodError) => ` **${zodError.path.join(".")}**: ${zodError.message}`),
|
|
561
|
+
""
|
|
560
562
|
].join("\n");
|
|
561
563
|
},
|
|
562
564
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
@@ -577,12 +579,20 @@ const ContentEntryDataError = {
|
|
|
577
579
|
title: "Content entry data does not match schema.",
|
|
578
580
|
message(collection, entryId, error) {
|
|
579
581
|
return [
|
|
580
|
-
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema
|
|
581
|
-
|
|
582
|
+
`**${String(collection)} \u2192 ${String(entryId)}** data does not match collection schema.
|
|
583
|
+
`,
|
|
584
|
+
...error.errors.map((zodError) => ` **${zodError.path.join(".")}**: ${zodError.message}`),
|
|
585
|
+
""
|
|
582
586
|
].join("\n");
|
|
583
587
|
},
|
|
584
588
|
hint: "See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas."
|
|
585
589
|
};
|
|
590
|
+
const LiveContentConfigError = {
|
|
591
|
+
name: "LiveContentConfigError",
|
|
592
|
+
title: "Error in live content config.",
|
|
593
|
+
message: (error, filename) => `${error} Check your collection definitions in ${filename ?? "your live content config file"}.`,
|
|
594
|
+
hint: "See https://docs.astro.build/en/reference/experimental-flags/live-content-collections/ for more information on live content collections."
|
|
595
|
+
};
|
|
586
596
|
const ContentLoaderInvalidDataError = {
|
|
587
597
|
name: "ContentLoaderInvalidDataError",
|
|
588
598
|
title: "Content entry is missing an ID",
|
|
@@ -778,6 +788,7 @@ export {
|
|
|
778
788
|
InvalidGlob,
|
|
779
789
|
InvalidImageService,
|
|
780
790
|
InvalidPrerenderExport,
|
|
791
|
+
LiveContentConfigError,
|
|
781
792
|
LocalImageUsedWrongly,
|
|
782
793
|
LocalsNotAnObject,
|
|
783
794
|
LocalsReassigned,
|
package/dist/core/messages.js
CHANGED
|
@@ -37,7 +37,7 @@ function serverStart({
|
|
|
37
37
|
host,
|
|
38
38
|
base
|
|
39
39
|
}) {
|
|
40
|
-
const version = "5.
|
|
40
|
+
const version = "5.10.0";
|
|
41
41
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
42
42
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
43
43
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -274,7 +274,7 @@ function printHelp({
|
|
|
274
274
|
message.push(
|
|
275
275
|
linebreak(),
|
|
276
276
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
277
|
-
`v${"5.
|
|
277
|
+
`v${"5.10.0"}`
|
|
278
278
|
)} ${headline}`
|
|
279
279
|
);
|
|
280
280
|
}
|
package/dist/core/session.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { AstroCookies } from './cookies/cookies.js';
|
|
|
3
3
|
export declare const PERSIST_SYMBOL: unique symbol;
|
|
4
4
|
export declare class AstroSession<TDriver extends SessionDriverName = any> {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(cookies: AstroCookies, { cookie: cookieConfig, ...config }:
|
|
6
|
+
constructor(cookies: AstroCookies, { cookie: cookieConfig, ...config }: NonNullable<ResolvedSessionConfig<TDriver>>, runtimeMode?: RuntimeMode);
|
|
7
7
|
/**
|
|
8
8
|
* Gets a session value. Returns `undefined` if the session or value does not exist.
|
|
9
9
|
*/
|
package/dist/core/session.js
CHANGED
|
@@ -52,6 +52,15 @@ class AstroSession {
|
|
|
52
52
|
cookie: cookieConfig = DEFAULT_COOKIE_NAME,
|
|
53
53
|
...config
|
|
54
54
|
}, runtimeMode) {
|
|
55
|
+
const { driver } = config;
|
|
56
|
+
if (!driver) {
|
|
57
|
+
throw new AstroError({
|
|
58
|
+
...SessionStorageInitError,
|
|
59
|
+
message: SessionStorageInitError.message(
|
|
60
|
+
"No driver was defined in the session configuration and the adapter did not provide a default driver."
|
|
61
|
+
)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
55
64
|
this.#cookies = cookies;
|
|
56
65
|
let cookieConfigObject;
|
|
57
66
|
if (typeof cookieConfig === "object") {
|
|
@@ -68,7 +77,7 @@ class AstroSession {
|
|
|
68
77
|
...cookieConfigObject,
|
|
69
78
|
httpOnly: true
|
|
70
79
|
};
|
|
71
|
-
this.#config = config;
|
|
80
|
+
this.#config = { ...config, driver };
|
|
72
81
|
}
|
|
73
82
|
/**
|
|
74
83
|
* Gets a session value. Returns `undefined` if the session or value does not exist.
|
|
@@ -335,14 +344,6 @@ class AstroSession {
|
|
|
335
344
|
this.#config.driver = "fs-lite";
|
|
336
345
|
this.#config.options.base ??= ".astro/session";
|
|
337
346
|
}
|
|
338
|
-
if (!this.#config?.driver) {
|
|
339
|
-
throw new AstroError({
|
|
340
|
-
...SessionStorageInitError,
|
|
341
|
-
message: SessionStorageInitError.message(
|
|
342
|
-
"No driver was defined in the session configuration and the adapter did not provide a default driver."
|
|
343
|
-
)
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
347
|
let driver = null;
|
|
347
348
|
try {
|
|
348
349
|
if (this.#config.driverModule) {
|
|
@@ -126,8 +126,11 @@ async function runHookConfigSetup({
|
|
|
126
126
|
if (settings.config.adapter) {
|
|
127
127
|
settings.config.integrations.unshift(settings.config.adapter);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
const actionsFilename = await isActionsFilePresent(fs, settings.config.srcDir);
|
|
130
|
+
if (actionsFilename) {
|
|
131
|
+
settings.config.integrations.push(
|
|
132
|
+
astroIntegrationActionsRouteHandler({ settings, filename: actionsFilename })
|
|
133
|
+
);
|
|
131
134
|
}
|
|
132
135
|
let updatedConfig = { ...settings.config };
|
|
133
136
|
let updatedSettings = { ...settings, config: updatedConfig };
|
|
@@ -57,7 +57,7 @@ var astro_default = {
|
|
|
57
57
|
link: "https://astro.build/chat"
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
|
-
const
|
|
60
|
+
const { latestAstroVersion, version, debugInfo } = window.__astro_dev_toolbar__ ?? {};
|
|
61
61
|
const windowComponent = createWindowElement(
|
|
62
62
|
`<style>
|
|
63
63
|
#buttons-container {
|
|
@@ -299,8 +299,8 @@ var astro_default = {
|
|
|
299
299
|
<header>
|
|
300
300
|
<section>
|
|
301
301
|
${astroLogo}
|
|
302
|
-
<astro-dev-toolbar-badge badge-style="gray" size="large">${
|
|
303
|
-
${
|
|
302
|
+
<astro-dev-toolbar-badge badge-style="gray" size="large">${version}</astro-dev-toolbar-badge>
|
|
303
|
+
${latestAstroVersion ? `<astro-dev-toolbar-badge badge-style="green" size="large">${latestAstroVersion} available!</astro-dev-toolbar-badge>
|
|
304
304
|
` : ""}
|
|
305
305
|
</section>
|
|
306
306
|
<astro-dev-toolbar-button id="copy-debug-button">Copy debug info <astro-dev-toolbar-icon icon="copy" /></astro-dev-toolbar-button>
|
|
@@ -330,9 +330,7 @@ var astro_default = {
|
|
|
330
330
|
);
|
|
331
331
|
const copyDebugButton = windowComponent.querySelector("#copy-debug-button");
|
|
332
332
|
copyDebugButton?.addEventListener("click", () => {
|
|
333
|
-
navigator.clipboard.writeText(
|
|
334
|
-
"```\n" + window.__astro_dev_toolbar__.debugInfo + "\n```"
|
|
335
|
-
);
|
|
333
|
+
navigator.clipboard.writeText("```\n" + debugInfo + "\n```");
|
|
336
334
|
copyDebugButton.textContent = "Copied to clipboard!";
|
|
337
335
|
setTimeout(() => {
|
|
338
336
|
resetDebugButton();
|
|
@@ -25,7 +25,7 @@ function renderCspContent(result) {
|
|
|
25
25
|
if (result.styleResources.length > 0) {
|
|
26
26
|
styleResources = result.styleResources.map((r) => `${r}`).join(" ");
|
|
27
27
|
}
|
|
28
|
-
const strictDynamic = result.isStrictDynamic ? ` strict-dynamic` : "";
|
|
28
|
+
const strictDynamic = result.isStrictDynamic ? ` 'strict-dynamic'` : "";
|
|
29
29
|
const scriptSrc = `script-src ${scriptResources} ${Array.from(finalScriptHashes).join(" ")}${strictDynamic};`;
|
|
30
30
|
const styleSrc = `style-src ${styleResources} ${Array.from(finalStyleHashes).join(" ")};`;
|
|
31
31
|
return `${directives} ${scriptSrc} ${styleSrc}`;
|