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: remove all TypeScript references when isTypeScript is passed as false to remix.init #63

Merged
merged 1 commit into from Jul 18, 2022

Conversation

MichaelDeBoey
Copy link
Member

@MichaelDeBoey MichaelDeBoey commented Apr 19, 2022

  • Update prisma seed script to use JS
  • Cleanup include from jsconfig
  • Replace vitest config with JS version
  • Replace vitest-tsconfig-paths with js equivalent
  • Updates cypress' cy.exec calls to use JS
  • Replace mocks index with JS version

remix-run/remix#3150 needs to be merged first

Closes #61

@jan-dh
Copy link

jan-dh commented Apr 20, 2022

Not sure but for me to get this to work I have to:

  1. Update the package.json to this (using .mjs format):
    "seed": "node prisma/seed.mjs"

  2. In the prisma/seed.mjs file:
    change this:
    import { PrismaClient } from "@prisma/client";
    to

import pkg from "@prisma/client";
const prisma = new pkg.PrismaClient();

@MichaelDeBoey MichaelDeBoey force-pushed the add-convert-to-js branch 2 times, most recently from 7ee468b to 92230b3 Compare April 26, 2022 17:41
package.json Outdated Show resolved Hide resolved
remix.init/index.js Outdated Show resolved Hide resolved
@kentcdodds
Copy link
Member

I handled this. We can probably make improvements when that PR is merged though. Let's close this one for now though

@kentcdodds kentcdodds closed this Jul 16, 2022
@MichaelDeBoey
Copy link
Member Author

@kentcdodds I rebased my changes onto latest main.

Re-opening this as this can now be reviewed again.

@MichaelDeBoey MichaelDeBoey reopened this Jul 16, 2022
@MichaelDeBoey
Copy link
Member Author

@kentcdodds Do you know a possible cause of why Cypress is failing again?
My changes shouldn't have an impact on that 🤔

@kentcdodds
Copy link
Member

I think it's possible that Cypress is being a bit flakey 😩

@kentcdodds
Copy link
Member

Yeah, just tried this locally and couldn't figure out what was up 🤷‍♂️

@MichaelDeBoey
Copy link
Member Author

@kentcdodds Seems like Cypress is passing now 🤔

@kentcdodds
Copy link
Member

Yep. That's what I call flake. We're probably doing something wrong/suboptimal, but I don't have time right now to dig into what it is...

@MichaelDeBoey
Copy link
Member Author

Do we first want to fix the flackyness or do we merge this already?

@kentcdodds
Copy link
Member

Oh dang! I didn't realize that the other PR had been merged. Thank you!

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.

Nice! Thanks for working so hard on this!

@kentcdodds kentcdodds merged commit d436d36 into remix-run:main Jul 18, 2022
@MichaelDeBoey MichaelDeBoey deleted the add-convert-to-js branch July 18, 2022 20:52
@MichaelDeBoey
Copy link
Member Author

I'll update the PRs of the other stacks asap 👍

kentcdodds added a commit that referenced this pull request Jul 18, 2022
… passed as `false` to `remix.init` (#63)"

This reverts commit d436d36.
@MichaelDeBoey MichaelDeBoey restored the add-convert-to-js branch July 18, 2022 21:18
@meandillar
Copy link

Not sure but for me to get this to work I have to:

  1. Update the package.json to this (using .mjs format):
    "seed": "node prisma/seed.mjs"
  2. In the prisma/seed.mjs file:
    change this:
    import { PrismaClient } from "@prisma/client";
    to
import pkg from "@prisma/client";
const prisma = new pkg.PrismaClient();

My installation failed for the Indie stack with the latest remix version and the above (changing seed.js to seed.mjs) fixed it.

Here was the error:

Running seed command `node --require tsconfig-paths/register prisma/seed.js` ...
TypeError: Cannot read property 'hash' of undefined
    at seed

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.

Oops, remix.init failed when choosing Javascript instead of Typescript
4 participants