Skip to content

Commit bb8a4b3

Browse files
chore(Sky): Upgrade Astro to v6 and synchronize TypeScript definitions
This commit updates the `Sky` UI component layer to the latest stable versions of its core dependencies, specifically `astro` (5.17.2 → 6.1.0) and `solid-js` (1.9.11 → 1.9.12), alongside a comprehensive bump of the Playform build tools and Tailwind ecosystem. Key modifications include: - **Dependency Upgrade**: Updated `package.json` to align with the latest releases, including `@octokit` v7, `typescript` v6.0.2, and `firebase` v12.11.0, ensuring compatibility with modern static site generation features. - **Type Definition Refactoring**: The `.astro/content.d.ts` file has been automatically regenerated to reflect the breaking changes introduced in Astro 6. This involves the removal of deprecated `ContentEntryMap` and `ReferenceContentEntry` types, consolidating the schema definitions to rely exclusively on `DataEntryMap` and `LiveContentConfig`. - **Schema Simplification**: The `reference` function now utilizes `ZodPipe` and `ZodTransform` for stricter type safety during content collection resolution, removing legacy overloads that caused ambiguity in the type system. These changes ensure the `Sky` website build pipeline is optimized with the latest performance improvements in the Astro runtime and maintains type safety for the project's content collections.
1 parent 9d6a4a4 commit bb8a4b3

2 files changed

Lines changed: 53 additions & 98 deletions

File tree

.astro/content.d.ts

Lines changed: 34 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,13 @@ declare module 'astro:content' {
1515
[key: string]: unknown;
1616
};
1717
}
18-
}
1918

20-
declare module 'astro:content' {
2119
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
2220

23-
export type CollectionKey = keyof AnyEntryMap;
24-
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
25-
26-
export type ContentCollectionKey = keyof ContentEntryMap;
27-
export type DataCollectionKey = keyof DataEntryMap;
21+
export type CollectionKey = keyof DataEntryMap;
22+
export type CollectionEntry<C extends CollectionKey> = Flatten<DataEntryMap[C]>;
2823

2924
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
30-
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
31-
ContentEntryMap[C]
32-
>['slug'];
3325

3426
export type ReferenceDataEntry<
3527
C extends CollectionKey,
@@ -38,41 +30,17 @@ declare module 'astro:content' {
3830
collection: C;
3931
id: E;
4032
};
41-
export type ReferenceContentEntry<
42-
C extends keyof ContentEntryMap,
43-
E extends ValidContentEntrySlug<C> | (string & {}) = string,
44-
> = {
45-
collection: C;
46-
slug: E;
47-
};
33+
4834
export type ReferenceLiveEntry<C extends keyof LiveContentConfig['collections']> = {
4935
collection: C;
5036
id: string;
5137
};
5238

53-
/** @deprecated Use `getEntry` instead. */
54-
export function getEntryBySlug<
55-
C extends keyof ContentEntryMap,
56-
E extends ValidContentEntrySlug<C> | (string & {}),
57-
>(
58-
collection: C,
59-
// Note that this has to accept a regular string too, for SSR
60-
entrySlug: E,
61-
): E extends ValidContentEntrySlug<C>
62-
? Promise<CollectionEntry<C>>
63-
: Promise<CollectionEntry<C> | undefined>;
64-
65-
/** @deprecated Use `getEntry` instead. */
66-
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
67-
collection: C,
68-
entryId: E,
69-
): Promise<CollectionEntry<C>>;
70-
71-
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
39+
export function getCollection<C extends keyof DataEntryMap, E extends CollectionEntry<C>>(
7240
collection: C,
7341
filter?: (entry: CollectionEntry<C>) => entry is E,
7442
): Promise<E[]>;
75-
export function getCollection<C extends keyof AnyEntryMap>(
43+
export function getCollection<C extends keyof DataEntryMap>(
7644
collection: C,
7745
filter?: (entry: CollectionEntry<C>) => unknown,
7846
): Promise<CollectionEntry<C>[]>;
@@ -84,14 +52,6 @@ declare module 'astro:content' {
8452
import('astro').LiveDataCollectionResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>
8553
>;
8654

87-
export function getEntry<
88-
C extends keyof ContentEntryMap,
89-
E extends ValidContentEntrySlug<C> | (string & {}),
90-
>(
91-
entry: ReferenceContentEntry<C, E>,
92-
): E extends ValidContentEntrySlug<C>
93-
? Promise<CollectionEntry<C>>
94-
: Promise<CollectionEntry<C> | undefined>;
9555
export function getEntry<
9656
C extends keyof DataEntryMap,
9757
E extends keyof DataEntryMap[C] | (string & {}),
@@ -100,15 +60,6 @@ declare module 'astro:content' {
10060
): E extends keyof DataEntryMap[C]
10161
? Promise<DataEntryMap[C][E]>
10262
: Promise<CollectionEntry<C> | undefined>;
103-
export function getEntry<
104-
C extends keyof ContentEntryMap,
105-
E extends ValidContentEntrySlug<C> | (string & {}),
106-
>(
107-
collection: C,
108-
slug: E,
109-
): E extends ValidContentEntrySlug<C>
110-
? Promise<CollectionEntry<C>>
111-
: Promise<CollectionEntry<C> | undefined>;
11263
export function getEntry<
11364
C extends keyof DataEntryMap,
11465
E extends keyof DataEntryMap[C] | (string & {}),
@@ -126,47 +77,52 @@ declare module 'astro:content' {
12677
): Promise<import('astro').LiveDataEntryResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>>;
12778

12879
/** Resolve an array of entry references from the same collection */
129-
export function getEntries<C extends keyof ContentEntryMap>(
130-
entries: ReferenceContentEntry<C, ValidContentEntrySlug<C>>[],
131-
): Promise<CollectionEntry<C>[]>;
13280
export function getEntries<C extends keyof DataEntryMap>(
13381
entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
13482
): Promise<CollectionEntry<C>[]>;
13583

136-
export function render<C extends keyof AnyEntryMap>(
137-
entry: AnyEntryMap[C][string],
84+
export function render<C extends keyof DataEntryMap>(
85+
entry: DataEntryMap[C][string],
13886
): Promise<RenderResult>;
13987

140-
export function reference<C extends keyof AnyEntryMap>(
88+
export function reference<
89+
C extends
90+
| keyof DataEntryMap
91+
// Allow generic `string` to avoid excessive type errors in the config
92+
// if `dev` is not running to update as you edit.
93+
// Invalid collection names will be caught at build time.
94+
| (string & {}),
95+
>(
14196
collection: C,
142-
): import('astro/zod').ZodEffects<
97+
): import('astro/zod').ZodPipe<
14398
import('astro/zod').ZodString,
144-
C extends keyof ContentEntryMap
145-
? ReferenceContentEntry<C, ValidContentEntrySlug<C>>
146-
: ReferenceDataEntry<C, keyof DataEntryMap[C]>
99+
import('astro/zod').ZodTransform<
100+
C extends keyof DataEntryMap
101+
? {
102+
collection: C;
103+
id: string;
104+
}
105+
: never,
106+
string
107+
>
147108
>;
148-
// Allow generic `string` to avoid excessive type errors in the config
149-
// if `dev` is not running to update as you edit.
150-
// Invalid collection names will be caught at build time.
151-
export function reference<C extends string>(
152-
collection: C,
153-
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
154109

155110
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
156-
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
111+
type InferEntrySchema<C extends keyof DataEntryMap> = import('astro/zod').infer<
157112
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
158113
>;
159-
160-
type ContentEntryMap = {
161-
162-
};
114+
type ExtractLoaderConfig<T> = T extends { loader: infer L } ? L : never;
115+
type InferLoaderSchema<
116+
C extends keyof DataEntryMap,
117+
L = ExtractLoaderConfig<ContentConfig['collections'][C]>,
118+
> = L extends { schema: import('astro/zod').ZodSchema }
119+
? import('astro/zod').infer<L['schema']>
120+
: any;
163121

164122
type DataEntryMap = {
165123

166124
};
167125

168-
type AnyEntryMap = ContentEntryMap & DataEntryMap;
169-
170126
type ExtractLoaderTypes<T> = T extends import('astro/loaders').LiveLoader<
171127
infer TData,
172128
infer TEntryFilter,
@@ -175,7 +131,6 @@ declare module 'astro:content' {
175131
>
176132
? { data: TData; entryFilter: TEntryFilter; collectionFilter: TCollectionFilter; error: TError }
177133
: { data: never; entryFilter: never; collectionFilter: never; error: never };
178-
type ExtractDataType<T> = ExtractLoaderTypes<T>['data'];
179134
type ExtractEntryFilterType<T> = ExtractLoaderTypes<T>['entryFilter'];
180135
type ExtractCollectionFilterType<T> = ExtractLoaderTypes<T>['collectionFilter'];
181136
type ExtractErrorType<T> = ExtractLoaderTypes<T>['error'];
@@ -194,6 +149,6 @@ declare module 'astro:content' {
194149
LiveContentConfig['collections'][C]['loader']
195150
>;
196151

197-
export type ContentConfig = typeof import("../Source/content.config.mjs");
152+
export type ContentConfig = never;
198153
export type LiveContentConfig = never;
199154
}

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@
2121
"prepublishOnly": "astro build"
2222
},
2323
"dependencies": {
24-
"@astrojs/sitemap": "3.7.0",
25-
"@astrojs/solid-js": "5.1.3",
24+
"@astrojs/sitemap": "3.7.2",
25+
"@astrojs/solid-js": "6.0.1",
2626
"@octokit/core": "7.0.6",
2727
"@octokit/rest": "22.0.1",
2828
"@playform/build": "0.3.0",
29-
"@playform/compress": "0.2.1",
30-
"@playform/inline": "0.1.2",
29+
"@playform/compress": "0.2.2",
30+
"@playform/inline": "0.1.4",
3131
"@rollup/plugin-inject": "5.0.5",
3232
"@tailwindcss/aspect-ratio": "0.4.2",
3333
"@tailwindcss/forms": "0.5.11",
34-
"@tailwindcss/postcss": "4.1.18",
34+
"@tailwindcss/postcss": "4.2.2",
3535
"@tailwindcss/typography": "0.5.19",
36-
"astro": "5.17.2",
36+
"astro": "6.1.0",
3737
"astro-capo": "0.0.1",
3838
"astrojs-service-worker": "2.0.0",
39-
"autoprefixer": "10.4.24",
40-
"cssnano": "7.1.2",
41-
"cssnano-preset-advanced": "7.0.10",
39+
"autoprefixer": "10.4.27",
40+
"cssnano": "7.1.3",
41+
"cssnano-preset-advanced": "7.0.11",
4242
"datatables.net": "2.3.7",
4343
"datatables.net-buttons-dt": "3.2.6",
4444
"datatables.net-colreorder-dt": "2.1.2",
4545
"datatables.net-dt": "2.3.7",
4646
"datatables.net-fixedcolumns-dt": "5.0.5",
47-
"datatables.net-fixedheader-dt": "4.0.5",
47+
"datatables.net-fixedheader-dt": "4.0.6",
4848
"datatables.net-keytable-dt": "2.12.2",
4949
"datatables.net-responsive-dt": "3.0.8",
5050
"datatables.net-rowgroup-dt": "1.6.0",
@@ -56,29 +56,29 @@
5656
"datatables.net-staterestore-dt": "1.4.3",
5757
"dotenv": "17.3.1",
5858
"fast-glob": "3.3.3",
59-
"firebase": "12.9.0",
59+
"firebase": "12.11.0",
6060
"jquery": "4.0.0",
6161
"jszip": "3.10.1",
62-
"pdfmake": "0.3.3",
63-
"postcss": "8.5.6",
62+
"pdfmake": "0.3.7",
63+
"postcss": "8.5.8",
6464
"postcss-combine-duplicated-selectors": "10.0.3",
6565
"postcss-combine-media-query": "2.1.0",
6666
"postcss-import": "16.1.1",
6767
"postcss-reporter": "7.1.0",
6868
"postcss-url": "10.1.3",
69-
"sass": "1.97.3",
70-
"sass-embedded": "1.97.3",
69+
"sass": "1.98.0",
70+
"sass-embedded": "1.98.0",
7171
"simplex-noise": "4.0.3",
7272
"solid-devtools": "0.34.5",
73-
"solid-js": "1.9.11",
73+
"solid-js": "1.9.12",
7474
"tailwindcss": "3.4.19",
75-
"typescript": "5.9.3",
75+
"typescript": "6.0.2",
7676
"zod": "4.3.6"
7777
},
7878
"devDependencies": {
79-
"@astrojs/ts-plugin": "1.10.6",
79+
"@astrojs/ts-plugin": "1.10.7",
8080
"@octokit/types": "16.0.0",
81-
"@types/jquery": "3.5.33"
81+
"@types/jquery": "4.0.0"
8282
},
8383
"publishConfig": {
8484
"access": "restricted",

0 commit comments

Comments
 (0)