diff options
author | 2023-01-10 18:01:52 -0500 | |
---|---|---|
committer | 2023-01-10 18:01:52 -0500 | |
commit | c2180746b4f6d9ef1b6f86924f21f52cc6ab4e63 (patch) | |
tree | 35772ea437174af2afdaf6ab4b3669963c675983 /examples/with-content/src | |
parent | 813073addd669538d67032a48ef6b649216dafc5 (diff) | |
download | astro-c2180746b4f6d9ef1b6f86924f21f52cc6ab4e63.tar.gz astro-c2180746b4f6d9ef1b6f86924f21f52cc6ab4e63.tar.zst astro-c2180746b4f6d9ef1b6f86924f21f52cc6ab4e63.zip |
[Content collections] Move generated types to `.astro` directory (#5786)
* feat: change cacheDir to `.astro`
* feat: write reference in env.d.ts if none exists
* chore: update with-content types
* test: env.d.ts transform
* nit: setUp -> add
* refactor: content.d.ts -> types.d.ts
* chore: update confirmation log
* chore: changeset
* feat: inject env.d.ts if none exists
* feat: set up env.d.ts on `astro sync`
* chore: duplicate envTsPathRelative
* docs: update changeset
* fix: make srcDir if none exists
* fix: types.generated -> .astro in gitignore
* feat: add env.d.ts to test gitignore
* chore: remove env.d.ts from content-collections
* test: move sync tests to `astro sync`, add file write test
* refactor: simplify test gitignore to base
* fix: add / to `.astro` bc that scares me
Diffstat (limited to '')
-rw-r--r-- | examples/with-content/.astro/types.d.ts (renamed from examples/with-content/src/content/types.generated.d.ts) | 77 | ||||
-rw-r--r-- | examples/with-content/src/env.d.ts | 1 |
2 files changed, 40 insertions, 38 deletions
diff --git a/examples/with-content/src/content/types.generated.d.ts b/examples/with-content/.astro/types.d.ts index d9d0b5667..37355d003 100644 --- a/examples/with-content/src/content/types.generated.d.ts +++ b/examples/with-content/.astro/types.d.ts @@ -55,44 +55,45 @@ declare module 'astro:content' { }; const entryMap: { - blog: { - 'first-post.md': { - id: 'first-post.md'; - slug: 'first-post'; - body: string; - collection: 'blog'; - data: InferEntrySchema<'blog'>; - }; - 'markdown-style-guide.md': { - id: 'markdown-style-guide.md'; - slug: 'markdown-style-guide'; - 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'>; - }; - }; + "blog": { +"first-post.md": { + id: "first-post.md", + slug: "first-post", + body: string, + collection: "blog", + data: InferEntrySchema<"blog"> +}, +"markdown-style-guide.md": { + id: "markdown-style-guide.md", + slug: "markdown-style-guide", + 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'); + type ContentConfig = typeof import("../src/content/config"); } diff --git a/examples/with-content/src/env.d.ts b/examples/with-content/src/env.d.ts index f964fe0cf..acef35f17 100644 --- a/examples/with-content/src/env.d.ts +++ b/examples/with-content/src/env.d.ts @@ -1 +1,2 @@ +/// <reference path="../.astro/types.d.ts" /> /// <reference types="astro/client" /> |