-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Content collections] Move generated types to .astro
directory
#5786
Conversation
🦋 Changeset detectedLatest commit: 4984511 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
237db86
to
436c3b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
.changeset/curvy-foxes-reply.md
Outdated
|
||
```diff | ||
/// <reference path="astro/client" /> | ||
+ /// <reference types="../.astro/types.d.ts" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean you don't get types without manually creating a file? Or was this already required? Is there anything we can do about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be automatically generated if a src/env.d.ts
is present! Otherwise, we assume you've deleted or moved this file to manage ambient types yourself. Since this file is home to the astro/client
types, I'd assume most users have this file in their Astro project.
Any reason this couldn't be in With |
2ef697b
to
44df368
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Fair question @fflaten! There's a couple reasons for it:
That second reason definitely pushed us to types in your project root. Luckily, |
Thanks. Just not used to have generated data (cache) in a config-folder, but I agree the second reason alone is a good enough reason. 👍 |
3ce3b4f
to
07ff9c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, small comment about simplifying the .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
Changes
src/content/types.generated.d.ts
->.astro/types.d.ts
src/env.d.ts
if none exists with theastro/client
and.astro
types.astro
reference path tosrc/env.d.ts
if one already existsWhy move
types.generated
?Outputting generated types inside
src/
has some drawbacks:.astro
, we can have future-proof recommendations there!Testing
astro check
on updated@examples/with-content
writeFile
is called on theenv.d.ts
file duringastro sync
Docs
withastro/docs#2313