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

fix: fix remix.init #138

Merged
merged 1 commit into from
Aug 15, 2022
Merged

Conversation

MichaelDeBoey
Copy link
Member

@MichaelDeBoey MichaelDeBoey commented Aug 12, 2022

Part of the solution is also a change in the transform, which is implemented in remix-run/remix#3987


This will partially resolve #134
Closes #136
Closes #139
Closes #140

Comment on lines +11 to +13
env: {
"cypress/globals": true,
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Without this we would either get ESLint errors about Cypress, cy, ... being undefined or we would need to declare these values ourselves in globals

Comment on lines -97 to -100
/*
eslint
@typescript-eslint/no-namespace: "off",
*/
Copy link
Member Author

Choose a reason for hiding this comment

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

This one's unused, so no need to set it to "off" here

Comment on lines +13 to +15
.replace(new RegExp("npx ts-node", "g"), "node")
.replace(new RegExp("create-user.ts", "g"), "create-user.js")
.replace(new RegExp("delete-user.ts", "g"), "delete-user.js");
Copy link
Member Author

Choose a reason for hiding this comment

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

We have these values both in code & in comments

Comment on lines +49 to +51
isTypeScript
? Promise.resolve()
: fs.readFile(filePath, "utf-8").then(parseFunction);
Copy link
Member Author

@MichaelDeBoey MichaelDeBoey Aug 12, 2022

Choose a reason for hiding this comment

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

We don't need to parse the value when we're not reading a file (when using TS)

@@ -68,12 +68,9 @@ const updatePackageJson = ({ APP_NAME, isTypeScript, packageJson }) => {
name: APP_NAME,
devDependencies: isTypeScript
? devDependencies
: removeUnusedDependencies(devDependencies, [
"ts-node",
"vite-tsconfig-paths",
Copy link
Member Author

Choose a reason for hiding this comment

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

vite-tsconfig-paths is still used now that it supports jsconfig.json files

prisma: isTypeScript
? prisma
? { ...prisma, seed: prismaSeed }
Copy link
Member Author

@MichaelDeBoey MichaelDeBoey Aug 12, 2022

Choose a reason for hiding this comment

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

prisma is a rest value (without prismaSeed), so we need to add the seed script again when using TS

@MichaelDeBoey MichaelDeBoey changed the title fix: fix JS version fix: fix JS+TS version Aug 12, 2022
@MichaelDeBoey MichaelDeBoey changed the title fix: fix JS+TS version fix: fix remix.init Aug 12, 2022
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Good going 👍 Thanks!

@kentcdodds kentcdodds merged commit cc0afce into remix-run:main Aug 15, 2022
@MichaelDeBoey MichaelDeBoey deleted the fix-convert-to-js branch August 15, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants