Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 8110f1d

Browse files
committed
feat: move to ESM
1 parent 1a9e9a7 commit 8110f1d

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ module.exports = {
110110
},
111111
settings: {
112112
jest: {
113-
// we're using vitest which has a very similar API to jest
114-
// (so the linting plugins work nicely), but it means we have to explicitly
115-
// set the jest version.
113+
// We're using vitest which has a very similar API to jest
114+
// (so the linting plugins work nicely), but it means we
115+
// have to set the jest version explicitly.
116116
version: 28,
117117
},
118118
},
File renamed without changes.

mocks/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { http, passthrough } = require("msw");
2-
const { setupServer } = require("msw/node");
1+
import { http, passthrough } from "msw";
2+
import { setupServer } from "msw/node";
33

44
// put one-off handlers that don't really need an entire file to themselves here
55
const miscHandlers = [

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
"name": "indie-stack-template",
33
"private": true,
44
"sideEffects": false,
5+
"type": "module",
56
"scripts": {
67
"build": "remix build",
78
"dev": "remix dev -c \"npm run dev:serve\"",
8-
"dev:serve": "binode --require ./mocks -- @remix-run/serve:remix-serve ./build/index.js",
9+
"dev:serve": "NODE_OPTIONS=\"--require ./mocks\" remix-serve ./build/index.js",
910
"format": "prettier --write .",
1011
"format:repo": "npm run format && npm run lint -- --fix",
1112
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
1213
"setup": "prisma generate && prisma migrate deploy && prisma db seed",
1314
"start": "remix-serve ./build/index.js",
14-
"start:mocks": "binode --require ./mocks -- @remix-run/serve:remix-serve ./build/index.js",
15+
"start:mocks": "NODE_OPTIONS=\"--require ./mocks\" remix-serve ./build/index.js",
1516
"test": "vitest",
1617
"test:e2e:dev": "start-server-and-test dev http://localhost:3000 \"npx cypress open\"",
1718
"pretest:e2e:run": "npm run build",
@@ -53,7 +54,6 @@
5354
"@vitejs/plugin-react": "^4.2.1",
5455
"@vitest/coverage-v8": "^1.4.0",
5556
"autoprefixer": "^10.4.19",
56-
"binode": "^1.0.5",
5757
"cookie": "^0.6.0",
5858
"cross-env": "^7.0.3",
5959
"cypress": "^13.7.1",
@@ -89,6 +89,6 @@
8989
"node": ">=18.0.0"
9090
},
9191
"prisma": {
92-
"seed": "ts-node -r tsconfig-paths/register prisma/seed.ts"
92+
"seed": "ts-node --esm -r tsconfig-paths/register prisma/seed.ts"
9393
}
9494
}
File renamed without changes.

remix.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @type {import('@remix-run/dev').AppConfig} */
2-
module.exports = {
2+
export default {
33
cacheDirectory: "./node_modules/.cache/remix",
44
ignoredRouteFiles: ["**/.*", "**/*.test.{ts,tsx}"],
5-
serverModuleFormat: "cjs",
65
};

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"isolatedModules": true,
88
"esModuleInterop": true,
99
"jsx": "react-jsx",
10-
"module": "CommonJS",
10+
"module": "ES2020",
1111
"moduleResolution": "node",
1212
"resolveJsonModule": true,
1313
"target": "ES2020",

0 commit comments

Comments
 (0)