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: Centralize configuration in one place. #312

Merged
merged 15 commits into from
Apr 12, 2023

Conversation

cullylarson
Copy link
Contributor

@cullylarson cullylarson commented Apr 7, 2023

Changes

  • Move all (most) process.env references into config.ts.
  • Add zod checks for config.
  • Remove ts-node-dev. Doesn't seem to be needed, creates some weird situations where processes don't exist (e.g. buildProd).
  • Refine the buildProd script.
  • fix: Prettier config in bisonapp is different from prettier config in packages/create-bison-app/template. So if you save a file while editing bisonapp and then create a bison app from it, it may have lint errors. Resolved this by copying the prettier config from packages/create-bison-app/template into the root folder.

Checklist

  • Requires dependency update?
  • Generating a new app works

Copy link
Contributor

@kgajera kgajera left a comment

Choose a reason for hiding this comment

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

It looks like this removes the APP_ENV and BASE_URL variables, we should also remove them from all the env files in the template.

packages/create-bison-app/template/config.ts Show resolved Hide resolved
packages/create-bison-app/template/config.ts Outdated Show resolved Hide resolved
@kgajera kgajera mentioned this pull request Apr 10, 2023
2 tasks
@cullylarson
Copy link
Contributor Author

It looks like this removes the APP_ENV and BASE_URL variables, we should also remove them from all the env files in the template.

@kgajera I removed them in #313. Was going to resolve that once it's merged.

Copy link
Contributor

@kgajera kgajera 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! One more non-blocking comment.

}),
database: z.object({
url: z.string(),
shouldMigrate: coerceBoolean,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to default shouldMigrate to true or process.env.NODE_ENV === 'production'? I think this might trip people up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's set explicitly by the SHOULD_MIGRATE environment variable. Which, I realized I forgot to add to the .env files.

@cullylarson
Copy link
Contributor Author

CI is failing because of some issues with how PORT is set in the .env files. Will resolve in #313.

@cullylarson cullylarson merged commit 5f810b4 into canary Apr 12, 2023
@cullylarson cullylarson deleted the cully/centralize-config branch April 12, 2023 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants