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

Commit ff58ce4

Browse files
committed
feat: move to ESM
1 parent 6453ae0 commit ff58ce4

File tree

9 files changed

+14
-15
lines changed

9 files changed

+14
-15
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ module.exports = {
1111
"cypress/globals": true,
1212
},
1313
plugins: ["cypress"],
14-
// we're using vitest which has a very similar API to jest
15-
// (so the linting plugins work nicely), but it means we have to explicitly
16-
// set the jest version.
14+
// We're using vitest which has a very similar API to jest
15+
// (so the linting plugins work nicely), but it means we
16+
// have to set the jest version explicitly.
1717
settings: {
1818
jest: {
1919
version: 28,

.eslintrc.repo.js renamed to .eslintrc.repo.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const WARN = 1;
66
/** @type {import('eslint').Linter.Config} */
77
module.exports = {
88
extends: [
9-
"./.eslintrc.js",
9+
"./.eslintrc.cjs",
1010
"@remix-run/eslint-config/internal",
1111
"plugin:markdown/recommended",
1212
],
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 { rest } = require("msw");
2-
const { setupServer } = require("msw/node");
1+
import { rest } 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
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:repo -- --fix",
1112
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
12-
"lint:repo": "npm run lint -- --config .eslintrc.repo.js",
13+
"lint:repo": "npm run lint -- --config .eslintrc.repo.cjs",
1314
"setup": "prisma generate && prisma migrate deploy && prisma db seed",
1415
"start": "remix-serve ./build/index.js",
15-
"start:mocks": "binode --require ./mocks -- @remix-run/serve:remix-serve ./build/index.js",
16+
"start:mocks": "NODE_OPTIONS=\"--require ./mocks\" remix-serve ./build/index.js",
1617
"test": "vitest",
1718
"test:e2e:dev": "start-server-and-test dev http://localhost:3000 \"npx cypress open\"",
1819
"pretest:e2e:run": "npm run build",
@@ -52,7 +53,6 @@
5253
"@vitejs/plugin-react": "^4.0.4",
5354
"@vitest/coverage-v8": "^0.34.2",
5455
"autoprefixer": "^10.4.15",
55-
"binode": "^1.0.5",
5656
"cookie": "^0.5.0",
5757
"cross-env": "^7.0.3",
5858
"cypress": "12.17.3",
@@ -81,6 +81,6 @@
8181
"node": ">=18.0.0"
8282
},
8383
"prisma": {
84-
"seed": "ts-node --require tsconfig-paths/register prisma/seed.ts"
84+
"seed": "ts-node --esm --require tsconfig-paths/register prisma/seed.ts"
8585
}
8686
}
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
};

remix.init/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const main = async ({ packageManager, rootDirectory }) => {
190190
fs.rm(path.join(rootDirectory, ".github", "workflows", "no-response.yml")),
191191
fs.rm(path.join(rootDirectory, ".github", "dependabot.yml")),
192192
fs.rm(path.join(rootDirectory, ".github", "PULL_REQUEST_TEMPLATE.md")),
193-
fs.rm(path.join(rootDirectory, ".eslintrc.repo.js")),
193+
fs.rm(path.join(rootDirectory, ".eslintrc.repo.cjs")),
194194
fs.rm(path.join(rootDirectory, "LICENSE.md")),
195195
]);
196196

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)