Skip to content

Commit

Permalink
Merge pull request #324 from vercel:fix/examples-ui-ts
Browse files Browse the repository at this point in the history
Fix create-turbo ui typescript to support dynamic imports
  • Loading branch information
jaredpalmer authored Dec 16, 2021
2 parents 8c443a3 + 8f1fc38 commit e0f1e9c
Show file tree
Hide file tree
Showing 59 changed files with 118 additions and 264 deletions.
5 changes: 1 addition & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ dist
*.svg
*.lock
*.npmignore
apps/docs/nextra-theme-turbo/
app/node_modules/
data
examples
examples/**
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module.exports = {
root: true,
extends: ["next", "prettier"],
settings: {
next: {
rootDir: ["docs/"],
rootDir: ["docs/", "create-turbo/"],
},
},
};
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"eslint.packageManager": "yarn",
"debug.javascript.unmapMissingSources": true,
"gopls": {
"experimentalWorkspaceModule": true
Expand Down
6 changes: 0 additions & 6 deletions create-turbo/.eslintrc.js

This file was deleted.

3 changes: 2 additions & 1 deletion create-turbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion create-turbo/templates/_shared_ts/apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"next-transpile-modules": "9.0.0",
"tsconfig": "*",
"@types/react": "17.0.37",
"typescript": "4.5.2"
"typescript": "^4.5.3"
}
}
2 changes: 1 addition & 1 deletion create-turbo/templates/_shared_ts/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"next-transpile-modules": "9.0.0",
"tsconfig": "*",
"@types/react": "17.0.37",
"typescript": "4.5.2"
"typescript": "^4.5.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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/*/"],
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion create-turbo/templates/_shared_ts/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"tsconfig": "*",
"typescript": "^4.5.2"
"typescript": "^4.5.3"
}
}
6 changes: 2 additions & 4 deletions create-turbo/templates/_shared_ts/packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": "tsconfig/react-library.json",
"compilerOptions": {
"jsx": "react-jsx"
},
"exclude": ["node_modules"]
"include": ["."],
"exclude": ["dist", "build", "node_modules"]
}
1 change: 0 additions & 1 deletion examples/basic/.eslintrc.js

This file was deleted.

9 changes: 4 additions & 5 deletions examples/basic/apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
9 changes: 4 additions & 5 deletions examples/basic/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 3 additions & 0 deletions examples/basic/packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
"dependencies": {
"eslint-config-next": "^12.0.3",
"eslint-config-prettier": "^8.3.0"
},
"devDependencies": {
"typescript": "^4.5.3"
}
}
7 changes: 2 additions & 5 deletions examples/basic/packages/tsconfig/react-library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 2 additions & 4 deletions examples/basic/packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": "tsconfig/react-library.json",
"compilerOptions": {
"jsx": "react-jsx"
},
"exclude": ["node_modules"]
"include": ["."],
"exclude": ["dist", "build", "node_modules"]
}
9 changes: 0 additions & 9 deletions examples/design-system/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/design-system/.prettierrc

This file was deleted.

3 changes: 2 additions & 1 deletion examples/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/design-system/packages/acme-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 2 additions & 10 deletions examples/design-system/packages/acme-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/design-system/packages/acme-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 3 additions & 11 deletions examples/design-system/packages/acme-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
3 changes: 0 additions & 3 deletions examples/design-system/packages/eslint-preset-acme/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions examples/kitchen-sink/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/kitchen-sink/.prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion examples/kitchen-sink/apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/kitchen-sink/apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": "*",
"supertest": "^6.1.3",
"tsconfig": "*",
"typescript": "^4.2.4"
"typescript": "^4.5.3"
},
"jest": {
"preset": "scripts/jest/node"
Expand Down
6 changes: 3 additions & 3 deletions examples/kitchen-sink/apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion examples/kitchen-sink/apps/storefront/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
7 changes: 3 additions & 4 deletions examples/kitchen-sink/apps/storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
7 changes: 6 additions & 1 deletion examples/kitchen-sink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -39,6 +41,9 @@
},
"dev": {
"cache": false
},
"clean": {
"cache": false
}
}
}
Expand Down
Loading

1 comment on commit e0f1e9c

@vercel
Copy link

@vercel vercel bot commented on e0f1e9c Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.