Commit graph

5 commits

Author SHA1 Message Date
567e333f9e [WIP] Run cra-to-next codemod to be on Nextjs
I'm interested in ejecting from Vercel, so I'm trying to get off their proprietary-ish create-react-app + Vercel API thing, and onto Nextjs, which is very similar in shape, but more portable.

I had to disable `craCompat` in `next.config.js` to stop us from crashing on their webpack config, see https://github.com/vercel/next.js/discussions/25858#discussioncomment-1573822

The frontend seems to work at a basic level, but network requests fail, and images don't seem to be working. I'll work on those next!

Note that this commit was forced through despite failing lint checks. We'll need to fix that up too!

Also, after the codemod, I moved `src/pages` to the more canonical location `pages`. Lint tooling seemed surprised to not find a `pages` directory, and I didn't see a config that was making it work correctly in the other location, so I figured it's that Next is willing to check `pages` or `src/pages`? But this is more canonical so yeah!
2021-11-01 21:49:23 -07:00
957f345620 Fix tsconfig.json error
Oops, we had a trailing comma, I feel like this might be why some tools seemed to respect these settings and other tools didn't!

This change seems to enable us to remove our weird hacks that made `vercel dev` run…
2021-02-06 22:45:28 -08:00
1dda0d4edb Fix dev command for TS support
Gosh, I'm really down this rabbit hole, huh? :p Anyway, turns out the `vercel dev` command contains a _fork_ of ts-node that doesn't respect the `ts-node` override key in `tsconfig.json`. But it does respect the env var!

So I've now set up `yarn start` to invoke `vercel dev` with the new env, which in turn invokes `yarn dev` to start the create-react-app dev server. Whew! (Probably a better dev experience tbh.)
2021-02-02 22:25:54 -08:00
b58db4a629 Finally finish TS setup, build works!
`yarn build` was crashing on my `build-cached-data` script, because we were trying to run the Typescript file uncompiled!

Now, we run it with `ts-node`, which transparently compiles Typescript files before execution. Phew!

`react-scripts build` made some automated changes to `tsconfig.json` for compatibility with `create-react-app`, and I also added a `ts-node` section to override one of them so we can compile to CommonJS for `ts-node` script execution!
2021-02-02 21:38:57 -08:00
d7028bc2cc One more TS fix, adding a tsconfig.json 2021-02-02 19:29:58 -08:00