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: single env file #1092

Merged
merged 23 commits into from
Feb 6, 2023
Merged

feat: single env file #1092

merged 23 commits into from
Feb 6, 2023

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Jan 17, 2023

Closes among others #1083 #1069 #1021

cc @iduuck

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

Change to use a single env file as entry point. No need to import from server/client - we use a proxy to make sure the right errors are thrown if server vars are accessed on the client.


Screenshots

[Screenshots]

For example, if you try accessing env.DATABASE_URL on the client:

image

@vercel
Copy link

vercel bot commented Jan 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
create-t3-app ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2023 at 11:25PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Jan 17, 2023

🦋 Changeset detected

Latest commit: 8bb1294

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-t3-app Minor

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

@github-actions github-actions bot added 📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App 📚 documentation Improvements or additions to documentation labels Jan 17, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2023

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 93
🟠 PWA 54

Lighthouse ran on https://create-t3-app-git-julius-env-t3-oss.vercel.app/

cli/template/extras/src/env/with-auth.mjs Outdated Show resolved Hide resolved
cli/template/extras/src/env/with-prisma.mjs Outdated Show resolved Hide resolved
@iduuck
Copy link
Contributor

iduuck commented Jan 20, 2023

Beside my two minor comments, I am sure that we could additionally use the type overwrite of process.env, if we want to. Though, we don't have the server vs. client type safety this way.

@juliusmarminge
Copy link
Member Author

juliusmarminge commented Jan 20, 2023

Beside my two minor comments, I am sure that we could additionally use the type overwrite of process.env, if we want to. Though, we don't have the server vs. client type safety this way.

I dont like the process.env typing since you miss stuff like default values for stuff your host provides, transforms/preprocess and other powerful primitives Zod provides besides the validation

add prop to error msg
@c-ehrlich
Copy link
Member

Which use cases do we need to test to make sure that this works as desired?

  • dev
  • vercel
  • docker (passing in via docker-compose)
  • edge?
  • other?

@juliusmarminge juliusmarminge added the 🚀 autorelease add this label to a pr to trigger a beta release label Jan 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

Hey t3-oss/translators!

This PR contains changes to your language. Please review the changes ❤️.

@a4addel @Sboonny @Defranos @joachimjusth @estubmo @josephayman @claudiofreitas @minsk-dev @Sn0wye @victoriaquasar @AmadeusTwi @ronanru @JohnBakhmat @fernandoxu @lodisy

@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Jan 20, 2023
Co-authored-by: Muhammed Mustafa <muhammed@freecodecamp.org>
@juliusmarminge juliusmarminge added the 🚀 autorelease add this label to a pr to trigger a beta release label Feb 6, 2023
@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Feb 6, 2023
@juliusmarminge juliusmarminge added the 🚀 autorelease add this label to a pr to trigger a beta release label Feb 6, 2023
@github-actions github-actions bot removed the 🚀 autorelease add this label to a pr to trigger a beta release label Feb 6, 2023
@juliusmarminge
Copy link
Member Author

juliusmarminge commented Feb 6, 2023

Good on my side. Ship? @c-ehrlich

@c-ehrlich
Copy link
Member

Good on my side. Ship? @c-ehrlich

yea good for me also

@c-ehrlich c-ehrlich merged commit aa44574 into next Feb 6, 2023
@c-ehrlich c-ehrlich deleted the julius/env branch February 6, 2023 23:36
Copy link
Contributor

@Sn0wye Sn0wye left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App 📚 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants