chore: remove types.gen from tests (#5695)
This commit is contained in:
parent
fc28b7cdc0
commit
f4441e2726
6 changed files with 3 additions and 223 deletions
1
packages/astro/test/fixtures/content-ssr-integration/.gitignore
vendored
Normal file
1
packages/astro/test/fixtures/content-ssr-integration/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
types.generated.d.ts
|
|
@ -1,79 +0,0 @@
|
||||||
declare module 'astro:content' {
|
|
||||||
export { z } from 'astro/zod';
|
|
||||||
export type CollectionEntry<C extends keyof typeof entryMap> =
|
|
||||||
typeof entryMap[C][keyof typeof entryMap[C]] & Render;
|
|
||||||
|
|
||||||
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
|
|
||||||
schema?: S;
|
|
||||||
slug?: (entry: {
|
|
||||||
id: CollectionEntry<keyof typeof entryMap>['id'];
|
|
||||||
defaultSlug: string;
|
|
||||||
collection: string;
|
|
||||||
body: string;
|
|
||||||
data: import('astro/zod').infer<import('astro/zod').ZodObject<S>>;
|
|
||||||
}) => string | Promise<string>;
|
|
||||||
};
|
|
||||||
export function defineCollection<S extends import('astro/zod').ZodRawShape>(
|
|
||||||
input: BaseCollectionConfig<S>
|
|
||||||
): BaseCollectionConfig<S>;
|
|
||||||
|
|
||||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
|
|
||||||
collection: C,
|
|
||||||
entryKey: E
|
|
||||||
): Promise<typeof entryMap[C][E] & Render>;
|
|
||||||
export function getCollection<
|
|
||||||
C extends keyof typeof entryMap,
|
|
||||||
E extends keyof typeof entryMap[C]
|
|
||||||
>(
|
|
||||||
collection: C,
|
|
||||||
filter?: (data: typeof entryMap[C][E]) => boolean
|
|
||||||
): Promise<(typeof entryMap[C][E] & Render)[]>;
|
|
||||||
|
|
||||||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
|
||||||
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
|
|
||||||
>;
|
|
||||||
|
|
||||||
type Render = {
|
|
||||||
render(): Promise<{
|
|
||||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
|
||||||
headings: import('astro').MarkdownHeading[];
|
|
||||||
injectedFrontmatter: Record<string, any>;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const entryMap: {
|
|
||||||
"blog": {
|
|
||||||
"first-post.md": {
|
|
||||||
id: "first-post.md",
|
|
||||||
slug: "first-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"second-post.md": {
|
|
||||||
id: "second-post.md",
|
|
||||||
slug: "second-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"third-post.md": {
|
|
||||||
id: "third-post.md",
|
|
||||||
slug: "third-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"using-mdx.mdx": {
|
|
||||||
id: "using-mdx.mdx",
|
|
||||||
slug: "using-mdx",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
type ContentConfig = typeof import("./config");
|
|
||||||
}
|
|
1
packages/astro/test/fixtures/content-static-paths-integration/.gitignore
vendored
Normal file
1
packages/astro/test/fixtures/content-static-paths-integration/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
types.generated.d.ts
|
|
@ -1,79 +0,0 @@
|
||||||
declare module 'astro:content' {
|
|
||||||
export { z } from 'astro/zod';
|
|
||||||
export type CollectionEntry<C extends keyof typeof entryMap> =
|
|
||||||
typeof entryMap[C][keyof typeof entryMap[C]] & Render;
|
|
||||||
|
|
||||||
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
|
|
||||||
schema?: S;
|
|
||||||
slug?: (entry: {
|
|
||||||
id: CollectionEntry<keyof typeof entryMap>['id'];
|
|
||||||
defaultSlug: string;
|
|
||||||
collection: string;
|
|
||||||
body: string;
|
|
||||||
data: import('astro/zod').infer<import('astro/zod').ZodObject<S>>;
|
|
||||||
}) => string | Promise<string>;
|
|
||||||
};
|
|
||||||
export function defineCollection<S extends import('astro/zod').ZodRawShape>(
|
|
||||||
input: BaseCollectionConfig<S>
|
|
||||||
): BaseCollectionConfig<S>;
|
|
||||||
|
|
||||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
|
|
||||||
collection: C,
|
|
||||||
entryKey: E
|
|
||||||
): Promise<typeof entryMap[C][E] & Render>;
|
|
||||||
export function getCollection<
|
|
||||||
C extends keyof typeof entryMap,
|
|
||||||
E extends keyof typeof entryMap[C]
|
|
||||||
>(
|
|
||||||
collection: C,
|
|
||||||
filter?: (data: typeof entryMap[C][E]) => boolean
|
|
||||||
): Promise<(typeof entryMap[C][E] & Render)[]>;
|
|
||||||
|
|
||||||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
|
||||||
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
|
|
||||||
>;
|
|
||||||
|
|
||||||
type Render = {
|
|
||||||
render(): Promise<{
|
|
||||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
|
||||||
headings: import('astro').MarkdownHeading[];
|
|
||||||
injectedFrontmatter: Record<string, any>;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const entryMap: {
|
|
||||||
"blog": {
|
|
||||||
"first-post.md": {
|
|
||||||
id: "first-post.md",
|
|
||||||
slug: "first-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"second-post.md": {
|
|
||||||
id: "second-post.md",
|
|
||||||
slug: "second-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"third-post.md": {
|
|
||||||
id: "third-post.md",
|
|
||||||
slug: "third-post",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"using-mdx.mdx": {
|
|
||||||
id: "using-mdx.mdx",
|
|
||||||
slug: "using-mdx",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
type ContentConfig = typeof import("./config");
|
|
||||||
}
|
|
1
packages/astro/test/fixtures/content/.gitignore
vendored
Normal file
1
packages/astro/test/fixtures/content/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
types.generated.d.ts
|
|
@ -1,65 +0,0 @@
|
||||||
declare module 'astro:content' {
|
|
||||||
export { z } from 'astro/zod';
|
|
||||||
export type CollectionEntry<C extends keyof typeof entryMap> =
|
|
||||||
typeof entryMap[C][keyof typeof entryMap[C]] & Render;
|
|
||||||
|
|
||||||
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
|
|
||||||
schema?: S;
|
|
||||||
slug?: (entry: {
|
|
||||||
id: CollectionEntry<keyof typeof entryMap>['id'];
|
|
||||||
defaultSlug: string;
|
|
||||||
collection: string;
|
|
||||||
body: string;
|
|
||||||
data: import('astro/zod').infer<import('astro/zod').ZodObject<S>>;
|
|
||||||
}) => string | Promise<string>;
|
|
||||||
};
|
|
||||||
export function defineCollection<S extends import('astro/zod').ZodRawShape>(
|
|
||||||
input: BaseCollectionConfig<S>
|
|
||||||
): BaseCollectionConfig<S>;
|
|
||||||
|
|
||||||
export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
|
|
||||||
collection: C,
|
|
||||||
entryKey: E
|
|
||||||
): Promise<typeof entryMap[C][E] & Render>;
|
|
||||||
export function getCollection<
|
|
||||||
C extends keyof typeof entryMap,
|
|
||||||
E extends keyof typeof entryMap[C]
|
|
||||||
>(
|
|
||||||
collection: C,
|
|
||||||
filter?: (data: typeof entryMap[C][E]) => boolean
|
|
||||||
): Promise<(typeof entryMap[C][E] & Render)[]>;
|
|
||||||
|
|
||||||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
|
|
||||||
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
|
|
||||||
>;
|
|
||||||
|
|
||||||
type Render = {
|
|
||||||
render(): Promise<{
|
|
||||||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
|
||||||
headings: import('astro').MarkdownHeading[];
|
|
||||||
injectedFrontmatter: Record<string, any>;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const entryMap: {
|
|
||||||
"blog": {
|
|
||||||
"one.md": {
|
|
||||||
id: "one.md",
|
|
||||||
slug: "one",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
"promo/launch-week.mdx": {
|
|
||||||
id: "promo/launch-week.mdx",
|
|
||||||
slug: "promo/launch-week",
|
|
||||||
body: string,
|
|
||||||
collection: "blog",
|
|
||||||
data: InferEntrySchema<"blog">
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
type ContentConfig = typeof import("./config");
|
|
||||||
}
|
|
Loading…
Reference in a new issue