diff --git a/.eslintignore b/.eslintignore index 7adbbcf6c52b4..c5497e8ee59a4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,7 +7,4 @@ dist *.svg *.lock *.npmignore -apps/docs/nextra-theme-turbo/ -app/node_modules/ -data -examples \ No newline at end of file +examples/** \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index a75895a0d938d..ec999b2de7fce 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,8 +1,9 @@ module.exports = { + root: true, extends: ["next", "prettier"], settings: { next: { - rootDir: ["docs/"], + rootDir: ["docs/", "create-turbo/"], }, }, }; diff --git a/.vscode/settings.json b/.vscode/settings.json index c255be19144d1..710b7f395c438 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,7 @@ { "language": "typescript", "autoFix": true }, { "language": "typescriptreact", "autoFix": true } ], + "eslint.packageManager": "yarn", "debug.javascript.unmapMissingSources": true, "gopls": { "experimentalWorkspaceModule": true diff --git a/create-turbo/.eslintrc.js b/create-turbo/.eslintrc.js deleted file mode 100644 index db68b19170ca1..0000000000000 --- a/create-turbo/.eslintrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - rules: { - // we have an example where we need this - "no-undef": "off", - }, -}; diff --git a/create-turbo/package.json b/create-turbo/package.json index cbd5c35dda313..7274df62ed7fe 100644 --- a/create-turbo/package.json +++ b/create-turbo/package.json @@ -17,7 +17,8 @@ }, "scripts": { "build": "tsup src/index.ts --format cjs", - "test": "jest" + "test": "jest", + "lint": "eslint src/**/*.ts" }, "dependencies": { "chalk": "2.4.2", diff --git a/create-turbo/templates/_shared_ts/apps/docs/package.json b/create-turbo/templates/_shared_ts/apps/docs/package.json index 72e8824225b8e..5bfd532061c42 100644 --- a/create-turbo/templates/_shared_ts/apps/docs/package.json +++ b/create-turbo/templates/_shared_ts/apps/docs/package.json @@ -20,6 +20,6 @@ "next-transpile-modules": "9.0.0", "tsconfig": "*", "@types/react": "17.0.37", - "typescript": "4.5.2" + "typescript": "^4.5.3" } } diff --git a/create-turbo/templates/_shared_ts/apps/web/package.json b/create-turbo/templates/_shared_ts/apps/web/package.json index cc9e2bd19ab65..ac83fdf74aeec 100644 --- a/create-turbo/templates/_shared_ts/apps/web/package.json +++ b/create-turbo/templates/_shared_ts/apps/web/package.json @@ -20,6 +20,6 @@ "next-transpile-modules": "9.0.0", "tsconfig": "*", "@types/react": "17.0.37", - "typescript": "4.5.2" + "typescript": "^4.5.3" } } diff --git a/create-turbo/templates/_shared_ts/packages/config/eslint-preset.js b/create-turbo/templates/_shared_ts/packages/config/eslint-preset.js index 4ade18abe11be..9989002c6150f 100644 --- a/create-turbo/templates/_shared_ts/packages/config/eslint-preset.js +++ b/create-turbo/templates/_shared_ts/packages/config/eslint-preset.js @@ -2,13 +2,7 @@ module.exports = { extends: ["next", "prettier"], settings: { next: { - rootDir: [ - "apps/docs/", - "apps/web/", - "packages/ui/", - "packages/config/", - "packages/tsconfig/", - ], + rootDir: ["apps/*/", "packages/*/"], }, }, }; diff --git a/create-turbo/templates/_shared_ts/packages/tsconfig/react-library.json b/create-turbo/templates/_shared_ts/packages/tsconfig/react-library.json index 7c2ece9d1625c..6d6a7fea97f10 100644 --- a/create-turbo/templates/_shared_ts/packages/tsconfig/react-library.json +++ b/create-turbo/templates/_shared_ts/packages/tsconfig/react-library.json @@ -2,13 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "React Library", "extends": "./base.json", - "include": ["src"], - "exclude": ["node_modules"], "compilerOptions": { "lib": ["ES2015"], "module": "ESNext", - "rootDir": "src", - "outDir": "dist", - "jsx": "react" + "target": "ES6", + "jsx": "react-jsx" } } diff --git a/create-turbo/templates/_shared_ts/packages/ui/package.json b/create-turbo/templates/_shared_ts/packages/ui/package.json index 2e0f8a61bd83c..28e9e6cf6c220 100644 --- a/create-turbo/templates/_shared_ts/packages/ui/package.json +++ b/create-turbo/templates/_shared_ts/packages/ui/package.json @@ -8,6 +8,6 @@ "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "tsconfig": "*", - "typescript": "^4.5.2" + "typescript": "^4.5.3" } } diff --git a/create-turbo/templates/_shared_ts/packages/ui/tsconfig.json b/create-turbo/templates/_shared_ts/packages/ui/tsconfig.json index 20c649b975498..cd6c94d6e8b0c 100644 --- a/create-turbo/templates/_shared_ts/packages/ui/tsconfig.json +++ b/create-turbo/templates/_shared_ts/packages/ui/tsconfig.json @@ -1,7 +1,5 @@ { "extends": "tsconfig/react-library.json", - "compilerOptions": { - "jsx": "react-jsx" - }, - "exclude": ["node_modules"] + "include": ["."], + "exclude": ["dist", "build", "node_modules"] } diff --git a/examples/basic/.eslintrc.js b/examples/basic/.eslintrc.js deleted file mode 100644 index dc369e9a8482f..0000000000000 --- a/examples/basic/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("config/eslint-preset"); diff --git a/examples/basic/apps/docs/package.json b/examples/basic/apps/docs/package.json index b8a56ab5cb334..12ccc1c0f2081 100644 --- a/examples/basic/apps/docs/package.json +++ b/examples/basic/apps/docs/package.json @@ -9,18 +9,17 @@ "lint": "next lint" }, "dependencies": { - "next": "12.0.3", - "react": "17.0.2", - "react-dom": "17.0.2", + "next": "latest", + "react": "^17.0.2", + "react-dom": "^17.0.2", "ui": "*" }, "devDependencies": { "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "config": "*", - "eslint": "7.32.0", "next-transpile-modules": "^9.0.0", "tsconfig": "*", - "typescript": "^4.5.2" + "typescript": "^4.5.3" } } diff --git a/examples/basic/apps/web/package.json b/examples/basic/apps/web/package.json index 8ed14748ef504..59659b38ae5fa 100644 --- a/examples/basic/apps/web/package.json +++ b/examples/basic/apps/web/package.json @@ -9,18 +9,17 @@ "lint": "next lint" }, "dependencies": { - "next": "^12.0.7", - "react": "17.0.2", - "react-dom": "17.0.2", + "next": "latest", + "react": "^17.0.2", + "react-dom": "^17.0.2", "ui": "*" }, "devDependencies": { "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "config": "*", - "eslint": "7.32.0", "next-transpile-modules": "^9.0.0", "tsconfig": "*", - "typescript": "^4.5.2" + "typescript": "^4.5.3" } } diff --git a/examples/basic/packages/config/package.json b/examples/basic/packages/config/package.json index 24761419fa38f..32aaf0e58e64b 100644 --- a/examples/basic/packages/config/package.json +++ b/examples/basic/packages/config/package.json @@ -9,5 +9,8 @@ "dependencies": { "eslint-config-next": "^12.0.3", "eslint-config-prettier": "^8.3.0" + }, + "devDependencies": { + "typescript": "^4.5.3" } } diff --git a/examples/basic/packages/tsconfig/react-library.json b/examples/basic/packages/tsconfig/react-library.json index 7c2ece9d1625c..6d6a7fea97f10 100644 --- a/examples/basic/packages/tsconfig/react-library.json +++ b/examples/basic/packages/tsconfig/react-library.json @@ -2,13 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "React Library", "extends": "./base.json", - "include": ["src"], - "exclude": ["node_modules"], "compilerOptions": { "lib": ["ES2015"], "module": "ESNext", - "rootDir": "src", - "outDir": "dist", - "jsx": "react" + "target": "ES6", + "jsx": "react-jsx" } } diff --git a/examples/basic/packages/ui/tsconfig.json b/examples/basic/packages/ui/tsconfig.json index 20c649b975498..cd6c94d6e8b0c 100644 --- a/examples/basic/packages/ui/tsconfig.json +++ b/examples/basic/packages/ui/tsconfig.json @@ -1,7 +1,5 @@ { "extends": "tsconfig/react-library.json", - "compilerOptions": { - "jsx": "react-jsx" - }, - "exclude": ["node_modules"] + "include": ["."], + "exclude": ["dist", "build", "node_modules"] } diff --git a/examples/design-system/.prettierignore b/examples/design-system/.prettierignore deleted file mode 100644 index e428cb710ed5f..0000000000000 --- a/examples/design-system/.prettierignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -.next -build -dist -*.tsbuildinfo -*.gitignore -*.svg -*.lock -*.npmignore \ No newline at end of file diff --git a/examples/design-system/.prettierrc b/examples/design-system/.prettierrc deleted file mode 100644 index dc6958febb993..0000000000000 --- a/examples/design-system/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": false, - "semi": true -} diff --git a/examples/design-system/package.json b/examples/design-system/package.json index ebeb188ebe34a..2ea14ea4b2e4c 100755 --- a/examples/design-system/package.json +++ b/examples/design-system/package.json @@ -11,7 +11,8 @@ "dev": "turbo run dev --no-cache --parallel --continue", "lint": "turbo run lint", "test": "turbo run test", - "clean": "turbo run clean && rm -rf node_modules" + "clean": "turbo run clean && rm -rf node_modules", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "devDependencies": { "eslint": "^8.4.1", diff --git a/examples/design-system/packages/acme-core/package.json b/examples/design-system/packages/acme-core/package.json index c9ff1224a3f12..ab4b9a19e737a 100644 --- a/examples/design-system/packages/acme-core/package.json +++ b/examples/design-system/packages/acme-core/package.json @@ -22,7 +22,7 @@ "@types/react-dom": "^17.0.8", "react": "^17.0.2", "tsup": "^5.10.1", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "publishConfig": { "access": "public" diff --git a/examples/design-system/packages/acme-core/tsconfig.json b/examples/design-system/packages/acme-core/tsconfig.json index cb84daf94c4c3..9be70c06b4493 100644 --- a/examples/design-system/packages/acme-core/tsconfig.json +++ b/examples/design-system/packages/acme-core/tsconfig.json @@ -1,13 +1,5 @@ { - "compilerOptions": { - "jsx": "react-jsx", - "lib": ["ES2015", "DOM"], - "target": "ES6", - "module": "ESNext", - "outDir": "./dist", - "rootDir": "./src" - }, - "exclude": ["node_modules", "src/__test__/**/*"], "extends": "@acme/tsconfig/react-library.json", - "include": ["src"] + "include": ["."], + "exclude": ["dist", "build", "node_modules"] } diff --git a/examples/design-system/packages/acme-tsconfig/react-library.json b/examples/design-system/packages/acme-tsconfig/react-library.json index 7c2ece9d1625c..6d6a7fea97f10 100644 --- a/examples/design-system/packages/acme-tsconfig/react-library.json +++ b/examples/design-system/packages/acme-tsconfig/react-library.json @@ -2,13 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "React Library", "extends": "./base.json", - "include": ["src"], - "exclude": ["node_modules"], "compilerOptions": { "lib": ["ES2015"], "module": "ESNext", - "rootDir": "src", - "outDir": "dist", - "jsx": "react" + "target": "ES6", + "jsx": "react-jsx" } } diff --git a/examples/design-system/packages/acme-utils/package.json b/examples/design-system/packages/acme-utils/package.json index 1e75f92e3f7f2..4be59235d2d33 100644 --- a/examples/design-system/packages/acme-utils/package.json +++ b/examples/design-system/packages/acme-utils/package.json @@ -22,7 +22,7 @@ "eslint-preset-acme": "*", "react": "^17.0.2", "tsup": "^5.10.1", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "publishConfig": { "access": "public" diff --git a/examples/design-system/packages/acme-utils/tsconfig.json b/examples/design-system/packages/acme-utils/tsconfig.json index b8d54d59364c6..9be70c06b4493 100644 --- a/examples/design-system/packages/acme-utils/tsconfig.json +++ b/examples/design-system/packages/acme-utils/tsconfig.json @@ -1,13 +1,5 @@ { - "compilerOptions": { - "jsx": "react-jsx", - "lib": ["ES2015", "DOM"], - "target": "ES6", - "module": "ESNext", - "outDir": "./dist", - "rootDir": "./src" - }, - "exclude": ["node_modules", "src/__test__/**/*"], - "extends": "@acme/tsconfig/base.json", - "include": ["src"] + "extends": "@acme/tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] } diff --git a/examples/design-system/packages/eslint-preset-acme/README.md b/examples/design-system/packages/eslint-preset-acme/README.md deleted file mode 100644 index 14ac5c0fbd05c..0000000000000 --- a/examples/design-system/packages/eslint-preset-acme/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `scripts` - -These are internal repo scripts for Turborepo until we can fully self-compile. diff --git a/examples/kitchen-sink/.prettierignore b/examples/kitchen-sink/.prettierignore deleted file mode 100644 index e428cb710ed5f..0000000000000 --- a/examples/kitchen-sink/.prettierignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -.next -build -dist -*.tsbuildinfo -*.gitignore -*.svg -*.lock -*.npmignore \ No newline at end of file diff --git a/examples/kitchen-sink/.prettierrc b/examples/kitchen-sink/.prettierrc deleted file mode 100644 index dc6958febb993..0000000000000 --- a/examples/kitchen-sink/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": false, - "semi": true -} diff --git a/examples/kitchen-sink/apps/admin/package.json b/examples/kitchen-sink/apps/admin/package.json index 25ec88f6c6e69..f7e153fe1cf57 100644 --- a/examples/kitchen-sink/apps/admin/package.json +++ b/examples/kitchen-sink/apps/admin/package.json @@ -20,7 +20,7 @@ "@vitejs/plugin-react-refresh": "^1.3.6", "scripts": "*", "tsconfig": "*", - "typescript": "^4.2.4", + "typescript": "^4.5.3", "vite": "^2.6.14" } } diff --git a/examples/kitchen-sink/apps/api/package.json b/examples/kitchen-sink/apps/api/package.json index d06c196768b73..bb42fbd22fc21 100644 --- a/examples/kitchen-sink/apps/api/package.json +++ b/examples/kitchen-sink/apps/api/package.json @@ -22,7 +22,7 @@ "scripts": "*", "supertest": "^6.1.3", "tsconfig": "*", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "jest": { "preset": "scripts/jest/node" diff --git a/examples/kitchen-sink/apps/blog/package.json b/examples/kitchen-sink/apps/blog/package.json index 0c2391ac9c01d..2981d4d8d1adb 100644 --- a/examples/kitchen-sink/apps/blog/package.json +++ b/examples/kitchen-sink/apps/blog/package.json @@ -10,18 +10,18 @@ }, "dependencies": { "@remix-run/react": "^1.0.6", + "@remix-run/serve": "^1.0.6", "react": "^17.0.2", "react-dom": "^17.0.2", "remix": "^1.0.6", - "ui": "*", - "@remix-run/serve": "^1.0.6" + "ui": "*" }, "devDependencies": { "@remix-run/dev": "^1.0.6", "@types/react": "^17.0.24", "@types/react-dom": "^17.0.9", "tsconfig": "*", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "engines": { "node": ">=14" diff --git a/examples/kitchen-sink/apps/storefront/next-env.d.ts b/examples/kitchen-sink/apps/storefront/next-env.d.ts index c6643fda12ff6..4f11a03dc6cc3 100644 --- a/examples/kitchen-sink/apps/storefront/next-env.d.ts +++ b/examples/kitchen-sink/apps/storefront/next-env.d.ts @@ -1,3 +1,5 @@ /// -/// /// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/kitchen-sink/apps/storefront/package.json b/examples/kitchen-sink/apps/storefront/package.json index 7f524aa306e2e..5b0a517dca4de 100644 --- a/examples/kitchen-sink/apps/storefront/package.json +++ b/examples/kitchen-sink/apps/storefront/package.json @@ -11,18 +11,17 @@ }, "dependencies": { "logger": "*", - "next": "^11.0.1", - "next-transpile-modules": "^8.0.0", + "next": "latest", + "next-transpile-modules": "^9.0.0", "react": "^17.0.2", "react-dom": "^17.0.2", "ui": "*" }, "devDependencies": { - "eslint-config-next": "^11.0.1", "@types/react": "^17.0.13", "@types/react-dom": "^17.0.8", "scripts": "*", "tsconfig": "*", - "typescript": "^4.2.4" + "typescript": "^4.5.3" } } diff --git a/examples/kitchen-sink/package.json b/examples/kitchen-sink/package.json index 2257f3165df7f..0fdc4a4afa24e 100755 --- a/examples/kitchen-sink/package.json +++ b/examples/kitchen-sink/package.json @@ -11,9 +11,11 @@ "dev": "turbo run dev --no-cache --parallel --continue", "lint": "turbo run lint", "test": "turbo run test", - "clean": "turbo run clean && rm -rf node_modules" + "clean": "turbo run clean && rm -rf node_modules", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "devDependencies": { + "prettier": "^2.5.1", "turbo": "latest" }, "turbo": { @@ -39,6 +41,9 @@ }, "dev": { "cache": false + }, + "clean": { + "cache": false } } } diff --git a/examples/kitchen-sink/packages/logger/package.json b/examples/kitchen-sink/packages/logger/package.json index ff694ed6e1ceb..b399454502b10 100644 --- a/examples/kitchen-sink/packages/logger/package.json +++ b/examples/kitchen-sink/packages/logger/package.json @@ -18,7 +18,7 @@ "devDependencies": { "scripts": "*", "tsconfig": "*", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "jest": { "preset": "scripts/jest/node" diff --git a/examples/kitchen-sink/packages/scripts/package.json b/examples/kitchen-sink/packages/scripts/package.json index 9501180b9cd73..2aa88276d9040 100644 --- a/examples/kitchen-sink/packages/scripts/package.json +++ b/examples/kitchen-sink/packages/scripts/package.json @@ -29,7 +29,7 @@ "eslint-plugin-react-hooks": "^4.0.8", "jest": "^26.6.3", "ts-jest": "^26.5.0", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "devDependencies": { "@types/jest": "^26.0.22" diff --git a/examples/kitchen-sink/packages/tsconfig/README.md b/examples/kitchen-sink/packages/tsconfig/README.md deleted file mode 100644 index 286cb74261d0a..0000000000000 --- a/examples/kitchen-sink/packages/tsconfig/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `tsconfig` - -This is the Turborepo shared `tsconfig.json` from which all other `tsconfig.json`'s inherit from. Making changes to this may have unintended consequences. diff --git a/examples/kitchen-sink/packages/tsconfig/nextjs.json b/examples/kitchen-sink/packages/tsconfig/nextjs.json index 29fa727408dbe..43b9002a63472 100644 --- a/examples/kitchen-sink/packages/tsconfig/nextjs.json +++ b/examples/kitchen-sink/packages/tsconfig/nextjs.json @@ -12,9 +12,7 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", - "rootDir": "src" - }, - "include": ["src", "next-env.d.ts"], - "exclude": ["node_modules"] + "incremental": true, + "jsx": "preserve" + } } diff --git a/examples/kitchen-sink/packages/tsconfig/node12.json b/examples/kitchen-sink/packages/tsconfig/node12.json deleted file mode 100644 index e538e9f3e53a1..0000000000000 --- a/examples/kitchen-sink/packages/tsconfig/node12.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 12", - "extends": "./base.json", - "compilerOptions": { - "lib": ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], - "module": "commonjs", - "target": "es2019", - "strict": true - } -} diff --git a/examples/kitchen-sink/packages/tsconfig/node14.json b/examples/kitchen-sink/packages/tsconfig/node14.json deleted file mode 100644 index 3f5f130f25094..0000000000000 --- a/examples/kitchen-sink/packages/tsconfig/node14.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "Node 14", - "extends": "./base.json", - "compilerOptions": { - "lib": ["es2020"], - "module": "commonjs", - "target": "es2020", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - } -} diff --git a/examples/kitchen-sink/packages/tsconfig/react-library.json b/examples/kitchen-sink/packages/tsconfig/react-library.json index 7c2ece9d1625c..6d6a7fea97f10 100644 --- a/examples/kitchen-sink/packages/tsconfig/react-library.json +++ b/examples/kitchen-sink/packages/tsconfig/react-library.json @@ -2,13 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "React Library", "extends": "./base.json", - "include": ["src"], - "exclude": ["node_modules"], "compilerOptions": { "lib": ["ES2015"], "module": "ESNext", - "rootDir": "src", - "outDir": "dist", - "jsx": "react" + "target": "ES6", + "jsx": "react-jsx" } } diff --git a/examples/kitchen-sink/packages/ui/package.json b/examples/kitchen-sink/packages/ui/package.json index 1910e3caf3d4f..ec36acd0a3dc3 100644 --- a/examples/kitchen-sink/packages/ui/package.json +++ b/examples/kitchen-sink/packages/ui/package.json @@ -21,8 +21,9 @@ "@types/react": "^17.0.13", "@types/react-dom": "^17.0.8", "react": "^17.0.2", + "tsconfig": "*", "tsup": "^5.10.1", - "typescript": "^4.2.4" + "typescript": "^4.5.3" }, "jest": { "preset": "scripts/jest/node" diff --git a/examples/kitchen-sink/packages/ui/tsconfig.json b/examples/kitchen-sink/packages/ui/tsconfig.json index f81264a1bdf26..cd6c94d6e8b0c 100644 --- a/examples/kitchen-sink/packages/ui/tsconfig.json +++ b/examples/kitchen-sink/packages/ui/tsconfig.json @@ -1,13 +1,5 @@ { - "compilerOptions": { - "jsx": "react-jsx", - "lib": ["ES2015", "DOM"], - "target": "ES6", - "module": "ESNext", - "outDir": "./dist", - "rootDir": "./src" - }, - "exclude": ["node_modules", "src/__test__/**/*"], - "extends": "tsconfig/base.json", - "include": ["src"] + "extends": "tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] } diff --git a/examples/with-pnpm/.eslintrc.js b/examples/with-pnpm/.eslintrc.js index dc369e9a8482f..5f7efa45760fb 100644 --- a/examples/with-pnpm/.eslintrc.js +++ b/examples/with-pnpm/.eslintrc.js @@ -1 +1 @@ -module.exports = require("config/eslint-preset"); +module.exports = require("./packages/config/eslint-preset.js"); diff --git a/examples/with-pnpm/apps/docs/README.md b/examples/with-pnpm/apps/docs/README.md index c2b3ce0b7c2b0..1d67ece731bd0 100644 --- a/examples/with-pnpm/apps/docs/README.md +++ b/examples/with-pnpm/apps/docs/README.md @@ -3,7 +3,7 @@ First, run the development server: ```bash -pnpm run dev +yarn dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. diff --git a/examples/with-pnpm/apps/docs/package.json b/examples/with-pnpm/apps/docs/package.json index 21938631a7c74..2964adb300275 100644 --- a/examples/with-pnpm/apps/docs/package.json +++ b/examples/with-pnpm/apps/docs/package.json @@ -9,15 +9,17 @@ "lint": "next lint" }, "dependencies": { - "next": "12.0.3", - "react": "17.0.2", - "react-dom": "17.0.2", - "ui": "*" + "next": "latest", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "ui": "workspace:*" }, "devDependencies": { - "eslint": "7.32.0", + "@types/react": "^17.0.37", + "@types/react-dom": "^17.0.11", "config": "workspace:*", "next-transpile-modules": "^9.0.0", - "typescript": "^4.4.4" + "tsconfig": "workspace:*", + "typescript": "^4.5.3" } } diff --git a/examples/with-pnpm/apps/docs/tsconfig.json b/examples/with-pnpm/apps/docs/tsconfig.json index 6db37c02f43fb..a355365ba6525 100644 --- a/examples/with-pnpm/apps/docs/tsconfig.json +++ b/examples/with-pnpm/apps/docs/tsconfig.json @@ -1,30 +1,5 @@ { - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "incremental": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve" - }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] } diff --git a/examples/with-pnpm/apps/web/README.md b/examples/with-pnpm/apps/web/README.md index c2b3ce0b7c2b0..1d67ece731bd0 100644 --- a/examples/with-pnpm/apps/web/README.md +++ b/examples/with-pnpm/apps/web/README.md @@ -3,7 +3,7 @@ First, run the development server: ```bash -pnpm run dev +yarn dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. diff --git a/examples/with-pnpm/apps/web/package.json b/examples/with-pnpm/apps/web/package.json index bb7fcc183af24..fe904494f469b 100644 --- a/examples/with-pnpm/apps/web/package.json +++ b/examples/with-pnpm/apps/web/package.json @@ -9,18 +9,17 @@ "lint": "next lint" }, "dependencies": { - "next": "12.0.3", - "react": "17.0.2", - "react-dom": "17.0.2", - "ui": "*" + "next": "latest", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "ui": "workspace:*" }, "devDependencies": { - "eslint": "7.32.0", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "ui": "workspace:*", "config": "workspace:*", "next-transpile-modules": "^9.0.0", - "typescript": "^4.4.4" + "tsconfig": "workspace:*", + "typescript": "^4.5.3" } } diff --git a/examples/with-pnpm/apps/web/tsconfig.json b/examples/with-pnpm/apps/web/tsconfig.json index 6db37c02f43fb..a355365ba6525 100644 --- a/examples/with-pnpm/apps/web/tsconfig.json +++ b/examples/with-pnpm/apps/web/tsconfig.json @@ -1,30 +1,5 @@ { - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "incremental": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve" - }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] } diff --git a/examples/with-pnpm/package.json b/examples/with-pnpm/package.json index fda247104b2d6..c39cc140c5880 100644 --- a/examples/with-pnpm/package.json +++ b/examples/with-pnpm/package.json @@ -8,6 +8,8 @@ "lint": "turbo run lint" }, "devDependencies": { + "eslint": "7.32.0", + "prettier": "^2.5.1", "turbo": "latest" }, "turbo": { diff --git a/examples/with-pnpm/packages/config/eslint-preset.js b/examples/with-pnpm/packages/config/eslint-preset.js index 348d5af78e561..182b86897a9c9 100644 --- a/examples/with-pnpm/packages/config/eslint-preset.js +++ b/examples/with-pnpm/packages/config/eslint-preset.js @@ -1,8 +1,9 @@ module.exports = { + root: true, extends: ["next", "prettier"], settings: { next: { - rootDir: ["docs/", "ui/", "web/"], + rootDir: ["apps/*/", "packages/*/"], }, }, }; diff --git a/examples/with-pnpm/packages/config/package.json b/examples/with-pnpm/packages/config/package.json index 24761419fa38f..32aaf0e58e64b 100644 --- a/examples/with-pnpm/packages/config/package.json +++ b/examples/with-pnpm/packages/config/package.json @@ -9,5 +9,8 @@ "dependencies": { "eslint-config-next": "^12.0.3", "eslint-config-prettier": "^8.3.0" + }, + "devDependencies": { + "typescript": "^4.5.3" } } diff --git a/examples/with-pnpm/packages/tsconfig/nextjs.json b/examples/with-pnpm/packages/tsconfig/nextjs.json index 29fa727408dbe..6b8d0bb07a0a6 100644 --- a/examples/with-pnpm/packages/tsconfig/nextjs.json +++ b/examples/with-pnpm/packages/tsconfig/nextjs.json @@ -7,13 +7,16 @@ "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, "noEmit": true, + "incremental": true, + "esModuleInterop": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", - "rootDir": "src" + "jsx": "preserve" }, "include": ["src", "next-env.d.ts"], "exclude": ["node_modules"] diff --git a/examples/with-pnpm/packages/tsconfig/package.json b/examples/with-pnpm/packages/tsconfig/package.json index 3acb8fa4c939e..d49a4c6ee807e 100644 --- a/examples/with-pnpm/packages/tsconfig/package.json +++ b/examples/with-pnpm/packages/tsconfig/package.json @@ -1,16 +1,11 @@ { "name": "tsconfig", "version": "0.0.0", - "license": "MIT", + "private": true, "main": "index.js", - "publishConfig": { - "access": "public" - }, "files": [ "base.json", - "vite.json", - "node12.json", - "node14.json", - "nextjs.json" + "nextjs.json", + "react-library.json" ] } diff --git a/examples/with-pnpm/packages/tsconfig/react-library.json b/examples/with-pnpm/packages/tsconfig/react-library.json index 7c2ece9d1625c..6d6a7fea97f10 100644 --- a/examples/with-pnpm/packages/tsconfig/react-library.json +++ b/examples/with-pnpm/packages/tsconfig/react-library.json @@ -2,13 +2,10 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "React Library", "extends": "./base.json", - "include": ["src"], - "exclude": ["node_modules"], "compilerOptions": { "lib": ["ES2015"], "module": "ESNext", - "rootDir": "src", - "outDir": "dist", - "jsx": "react" + "target": "ES6", + "jsx": "react-jsx" } } diff --git a/examples/with-pnpm/packages/ui/Button.tsx b/examples/with-pnpm/packages/ui/Button.tsx index 9533d6c241981..23758ab1a8b3a 100644 --- a/examples/with-pnpm/packages/ui/Button.tsx +++ b/examples/with-pnpm/packages/ui/Button.tsx @@ -1,3 +1,7 @@ export const Button = () => { return ; }; + +export function MyImage() { + return ; +} diff --git a/examples/with-pnpm/packages/ui/package.json b/examples/with-pnpm/packages/ui/package.json index 90158b40eb294..90ac297a9c754 100644 --- a/examples/with-pnpm/packages/ui/package.json +++ b/examples/with-pnpm/packages/ui/package.json @@ -4,6 +4,9 @@ "main": "./index.tsx", "types": "./index.tsx", "license": "MIT", + "scripts": { + "lint": "eslint *.tsx" + }, "devDependencies": { "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", diff --git a/examples/with-pnpm/packages/ui/tsconfig.json b/examples/with-pnpm/packages/ui/tsconfig.json index 20c649b975498..cd6c94d6e8b0c 100644 --- a/examples/with-pnpm/packages/ui/tsconfig.json +++ b/examples/with-pnpm/packages/ui/tsconfig.json @@ -1,7 +1,5 @@ { "extends": "tsconfig/react-library.json", - "compilerOptions": { - "jsx": "react-jsx" - }, - "exclude": ["node_modules"] + "include": ["."], + "exclude": ["dist", "build", "node_modules"] }