Skip to content
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

feat(env): add schema, types and envField #10805

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Apr 17, 2024

Changes

  • Updates AstroConfigSchema
  • Updates AstroUserConfig
  • Adds envField

Related RFC section: https://github.com/withastro/roadmap/blob/feat/astro-env-rfc/proposals/0046-astro-env.md#astro-config

Testing

Updates a unit test to test custom zod errors

Docs

N/A

Copy link

changeset-bot bot commented Apr 17, 2024

⚠️ No Changeset found

Latest commit: 8896fa7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review labels Apr 17, 2024
@florian-lefebvre florian-lefebvre changed the title feat: add schema, types and envField rfc(env): add schema, types and envField Apr 17, 2024
@florian-lefebvre florian-lefebvre changed the title rfc(env): add schema, types and envField feat(env): add schema, types and envField Apr 17, 2024
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be under experimental.

@ematipico
Copy link
Member

@matthewp FYI this PR isn't against main.

We're using stacked PRs to progressively work on the feature.

@florian-lefebvre
Copy link
Member Author

Moreover, I checked and everything is under experimental in both types and schema. I'm going to convert to draft for now since it looks like we must make a change to this part of the rfc

@florian-lefebvre florian-lefebvre marked this pull request as draft April 18, 2024 04:59
packages/astro/src/core/config/schema.ts Outdated Show resolved Hide resolved
@ematipico ematipico dismissed matthewp’s stale review April 18, 2024 07:45

The configuration is already under the experimental flag

@florian-lefebvre florian-lefebvre marked this pull request as ready for review April 20, 2024 11:01
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can merge it :)

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@florian-lefebvre florian-lefebvre merged commit d84d19e into feat/astro-env Apr 22, 2024
14 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/astro-env-config branch April 22, 2024 08:49
ematipico added a commit that referenced this pull request Jun 5, 2024
* feat(env): add schema, types and envField (#10805)

* feat(env): add validators (#10827)

* feat(env): add vite plugin (#10829)

* feat(env): client/public variables (#10848)

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* feat(env): server/public variables (#10881)

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* feat(env): server/secret variables (#10954)

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* fix: import

* fix: test

* feat: work on jsdoc

* feat: more jsdoc

* chore: remove todo

* feat: fix test error and write changeset

* feat: update config reference

* feat: apply recommendations from review

* feat: rework getEnv/setGetEnv

* chore: move tests

* fix: rename

* fix: dev mode

* chore: improve error

* feat: add overrideProcessEnv helper

* fix: make eslint happy

* Update .changeset/poor-berries-occur.md

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update .changeset/poor-berries-occur.md

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update .changeset/poor-berries-occur.md

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update .changeset/poor-berries-occur.md

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* feat: fix build and address reviews

* fix: container api

* fix: tests

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update packages/astro/src/@types/astro.ts

* chore: update changeset

* feat: address reviews

* feat: address Ema's reviews

* Update .changeset/poor-berries-occur.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants