Skip to content

Commit

Permalink
fix: added TypeScript project references for VSCode (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGhadyani-Okta authored Mar 13, 2023
1 parent 75e25d7 commit 44e2783
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 39 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@
"node": ">=16 <17"
},
"scripts": {
"start": "yarn build && npm-run-all --parallel start:mui start:labs start:storybook",
"start:labs": "yarn workspace @okta/odyssey-react-labs dev",
"start:mui": "yarn workspace @okta/odyssey-react-mui dev",
"start:storybook": "yarn workspace @okta/odyssey-storybook start",
"lerna-version": "lerna version --no-git-tag-version --include-merged-tags --conventional-commits --no-push --force-publish",
"build": "lerna run build --ignore @okta/odyssey-storybook",
"dev:source": "lerna run dev:source",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lerna-publish": "lerna publish from-package --no-push --force-publish --no-verify-registry",
"lerna-version": "lerna version --no-git-tag-version --include-merged-tags --conventional-commits --no-push --force-publish",
"lint": "yarn eslint && yarn stylelint && yarn prettier-check",
"postinstall": "yarn build && [ -z ${CI:-} ] && husky install || exit 0",
"prettier-check": "prettier --ignore-unknown --loglevel warn --check .",
"prettier-write": "prettier --ignore-unknown --loglevel warn --write .",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"start:labs": "yarn workspace @okta/odyssey-react-labs dev",
"start:mui": "yarn workspace @okta/odyssey-react-mui dev",
"start:storybook": "yarn workspace @okta/odyssey-storybook start",
"start": "npm-run-all --sequential build --parallel dev:source start:storybook",
"stylelint": "stylelint **/*.scss",
"test": "lerna run test",
"typecheck": "lerna run typecheck",
"build": "lerna run build --ignore @okta/odyssey-storybook",
"postinstall": "yarn build && [ -z ${CI:-} ] && husky install || exit 0"
"typecheck": "lerna run typecheck"
},
"devDependencies": {
"@commitlint/cli": "^14.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/odyssey-react-labs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"types": "dist/src/index.d.ts",
"exports": {
".": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/src/index.d.ts"
}
},
"repository": {
Expand Down
12 changes: 9 additions & 3 deletions packages/odyssey-react-labs/tsconfig.production.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"extends": "@okta/odyssey-typescript/tsconfig.react.types.json",
"compilerOptions": {
"outDir": "dist",
"jsx": "react-jsx"
"composite": true,
"jsx": "react-jsx",
"outDir": "dist"
},
"exclude": ["./test", "**/*.test.**", "**/dist/**/*"]
"exclude": ["./test", "**/*.test.**", "**/dist/**/*"],
"references": [
{
"path": "../odyssey-react-mui/tsconfig.production.json"
}
]
}
4 changes: 2 additions & 2 deletions packages/odyssey-react-mui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"types": "dist/src/index.d.ts",
"exports": {
".": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/src/index.d.ts"
}
},
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions packages/odyssey-react-mui/tsconfig.production.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "@okta/odyssey-typescript/tsconfig.react.types.json",
"compilerOptions": {
"outDir": "dist",
"jsx": "react-jsx"
"composite": true,
"jsx": "react-jsx",
"outDir": "dist"
},
"exclude": ["./test", "**/*.test.**", "**/dist/**/*"]
}
9 changes: 6 additions & 3 deletions packages/odyssey-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@
"@types/react": "^17.0.30",
"babel-loader": "^8",
"markdown-to-jsx": "^7.1.7",
"npm-run-all": "^4.1.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.4",
"webpack": "4.46.0"
},
"scripts": {
"start": "start-storybook --quiet --port 6006",
"build": "build-storybook --quiet --output-dir dist",
"typecheck": "tsc",
"prepack": "yarn build && yarn exec prepack"
"prepack": "yarn build && yarn exec prepack",
"start:storybook": "start-storybook --quiet --port 6006",
"start:types": "tsc --build --watch",
"start": "npm-run-all --parallel start:types start:storybook",
"typecheck": "tsc"
}
}
10 changes: 9 additions & 1 deletion packages/odyssey-storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
"extends": "@okta/odyssey-typescript/tsconfig.react.json",
"compilerOptions": {
"jsx": "react-jsx"
}
},
"references": [
{
"path": "../odyssey-react-mui/tsconfig.production.json"
},
{
"path": "../odyssey-react-labs/tsconfig.production.json"
}
]
}
13 changes: 0 additions & 13 deletions packages/odyssey-storybook/types.d.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/odyssey-typescript/tsconfig.react.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"extends": "./tsconfig.strict.json",

"compilerOptions": {
"isolatedModules": true,
"jsx": "react",
"lib": ["dom", "es2020"],
"noEmit": true,
"module": "es2020",
"target": "es2020",
"isolatedModules": true,
"jsx": "react"
"noEmit": true,
"target": "es2020"
}
}
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6553,6 +6553,7 @@ __metadata:
"@types/react": ^17.0.30
babel-loader: ^8
markdown-to-jsx: ^7.1.7
npm-run-all: ^4.1.5
react: ^17.0.2
react-dom: ^17.0.2
typescript: ^4.9.4
Expand Down

0 comments on commit 44e2783

Please sign in to comment.