Skip to content

Commit f4ad616

Browse files
zsh77anthonyshew
andauthored
Bug fix on kitchen-sink example (#7624)
### Description - moved tsup flags from `dev` script and `build` script into `tsup.config.ts` file - ignored `.eslintrc.js` in both `storeFront` and `api` apps - removed unused and duplicated `style.css` in `storeFront` app - changed `rootDir` of `admin` app to "." so that `tsconfig.json` could include `vite.config.ts` - changed `rootDir` of `blog` app to "." so that `tsconfig.json` could include `server.js` and `remix.config.js` - improved imports from react (use `import React from "react"` instead of `import * as React from "react"` ) - included `next.config.js` in `tsconfig.json` in order to fix the parsing error in `next.config.js` - set `api` app to use the default `module:"ESNEXT"` as the `moduleResolution` is set to `Bundler` - fixed the error `@remix-run/vercel was not found` in apps/blog/server.js - replaced `V2MetaFunction` with `MetaFunction` - removed `future` object that was used to enable features of version 2 of remix as the version 2 is being used - ran `pnpm i` and updated versions of dependencies ### Testing Instructions Running `npx create-turbo@latest -e kitchen-sink` and then `pnpm dev` should work fine and there should be no errors. --------- Co-authored-by: Anthony Shew <[email protected]>
1 parent 96baf61 commit f4ad616

File tree

15 files changed

+27
-140
lines changed

15 files changed

+27
-140
lines changed

examples/kitchen-sink/apps/admin/src/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from "react";
1+
import React from "react";
22
import { createRoot } from "react-dom/client";
33
import App from "./app";
44
import "./index.css";

examples/kitchen-sink/apps/admin/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"exclude": ["node_modules"],
33
"extends": "@repo/typescript-config/vite.json",
44
"compilerOptions": {
5-
"rootDir": "src",
5+
"rootDir": ".",
66
"outDir": "dist"
77
},
8-
"include": ["src"]
8+
"include": ["src", "vite.config.ts"]
99
}

examples/kitchen-sink/apps/api/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"extends": "@repo/typescript-config/base.json",
33
"compilerOptions": {
44
"lib": ["ES2015"],
5-
"module": "CommonJS",
6-
"outDir": "./dist",
5+
"outDir": "./dist"
76
},
87
"exclude": ["node_modules"],
98
"include": ["."]

examples/kitchen-sink/apps/blog/app/root.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import type {
2-
V2_MetaFunction as V2MetaFunction,
3-
LinksFunction,
4-
} from "@remix-run/node";
1+
import type { MetaFunction, LinksFunction } from "@remix-run/node";
52
import {
63
Links,
74
LiveReload,
@@ -13,7 +10,7 @@ import {
1310
import { Analytics } from "@vercel/analytics/react";
1411
import styles from "./styles.css";
1512

16-
export const meta: V2MetaFunction = () => [
13+
export const meta: MetaFunction = () => [
1714
{
1815
charset: "utf-8",
1916
title: "Blog | Kitchen Sink",

examples/kitchen-sink/apps/blog/remix.config.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
/** @type {import('@remix-run/dev').AppConfig} */
22
module.exports = {
3-
future: {
4-
v2_dev: true,
5-
v2_errorBoundary: true,
6-
v2_headers: true,
7-
v2_meta: true,
8-
v2_normalizeFormMethod: true,
9-
v2_routeConvention: true,
10-
},
113
ignoredRouteFiles: ["**/.*"],
124
serverModuleFormat: "cjs",
135
// appDirectory: "app",
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createRequestHandler } from "@remix-run/vercel";
1+
import { createRequestHandler } from "@remix-run/server-runtime";
22
import * as build from "@remix-run/dev/server-build";
33

44
export default createRequestHandler({ build, mode: process.env.NODE_ENV });
+10-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
2-
"exclude": ["node_modules", "build"],
32
"extends": "@repo/typescript-config/remix.json",
43
"compilerOptions": {
5-
"rootDir": "app",
4+
"rootDir": ".",
65
"outDir": "dist",
76
"paths": {
87
"~/*": ["./app/*"]
9-
},
8+
}
109
},
11-
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
10+
"include": [
11+
"remix.env.d.ts",
12+
"**/*.ts",
13+
"**/*.tsx",
14+
"server.js",
15+
"remix.config.js"
16+
],
17+
"exclude": ["node_modules", "build"]
1218
}

examples/kitchen-sink/apps/storefront/src/styles.css

-55
This file was deleted.

examples/kitchen-sink/apps/storefront/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
}
1010
]
1111
},
12-
"include": ["src", "next-env.d.ts", ".next/types/**/*.ts"]
12+
"include": ["src", "next.config.js", "next-env.d.ts", ".next/types/**/*.ts"]
1313
}

examples/kitchen-sink/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"engines": {
1818
"node": ">=18"
1919
}
20-
}
20+
}

examples/kitchen-sink/packages/config-eslint/next.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
},
3636
},
3737
},
38-
ignorePatterns: ["node_modules/", "dist/"],
38+
ignorePatterns: [".*.js", "node_modules/", "dist/"],
3939
// add rules configurations here
4040
rules: {
4141
"import/no-default-export": "off",

examples/kitchen-sink/packages/config-eslint/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
},
4040
},
4141
],
42-
ignorePatterns: ["node_modules/", "dist/"],
42+
ignorePatterns: [".*.js", "node_modules/", "dist/"],
4343
// add rules configurations here
4444
rules: {
4545
"import/no-default-export": "off",

examples/kitchen-sink/packages/ui/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"dist/**"
1212
],
1313
"scripts": {
14-
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
14+
"build": "tsup",
1515
"clean": "rm -rf dist",
16-
"dev": "tsup src/index.tsx --format esm,cjs --watch --dts --external react",
16+
"dev": "tsup --watch",
1717
"typecheck": "tsc --noEmit",
1818
"lint": "eslint src/",
1919
"test": "jest"

examples/kitchen-sink/packages/ui/tsup.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { defineConfig, type Options } from "tsup";
22

33
export default defineConfig((options: Options) => ({
4+
entry: ["./src/index.tsx"],
5+
format: ["cjs", "esm"],
6+
dts: true,
7+
external: ["react"],
48
banner: {
59
js: "'use client'",
610
},

0 commit comments

Comments
 (0)