Skip to content

Commit

Permalink
chore(tsc): exclude test/stories/mock files only from build (#451)
Browse files Browse the repository at this point in the history
* chore(tsc): exclude test/stories/mock files only from build

Signed-off-by: Nastya Rusina <nastya@union.ai>
  • Loading branch information
anrusina committed May 5, 2022
1 parent f183757 commit 954e573
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/plugins/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"scripts": {
"build": "yarn build:esm && yarn build:cjs",
"build:esm": "tsc --module esnext --outDir lib/esm",
"build:cjs": "tsc",
"build:esm": "tsc --module esnext --outDir lib/esm --project ./tsconfig.build.json",
"build:cjs": "tsc --project ./tsconfig.build.json",
"test": "NODE_ENV=test jest"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/components/src/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DefaultNavBarContent } from './defaultContent';

export const navBarContentId = 'nav-bar-content';

interface NavBarProps {
export interface NavBarProps {
useCustomContent?: boolean; // rename to show that it is a backNavigation
className?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/components/src/NavBar/navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
component: NavBar,
} as ComponentMeta<typeof NavBar>;

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles((_theme: Theme) => ({
updatedOne: {
backgroundColor: 'lightblue',
color: 'black',
Expand Down
15 changes: 15 additions & 0 deletions packages/plugins/components/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"exclude": [
// files excluded from the build, we can not put it inro default tsconfig
// as it will screw VSCode IntelliSence
"**/test",
"**/mocks",
"**/__mocks__",
"**/__stories__",
"src/**/*.spec.*",
"src/**/*.test.*",
"src/**/*.mock.*",
"src/**/*.stories.*"
]
}
15 changes: 15 additions & 0 deletions packages/zapp/console/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"exclude": [
// files excluded from the build, we can not put it inro default tsconfig
// as it will screw VSCode IntelliSence
"**/test",
"**/mocks",
"**/__mocks__",
"**/__stories__",
"src/**/*.spec.*",
"src/**/*.test.*",
"src/**/*.mock.*",
"src/**/*.stories.*"
]
}
6 changes: 5 additions & 1 deletion packages/zapp/console/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"noImplicitOverride": false
},
"references": [{ "path": "../../plugins/components" }],
"include": ["src/**/*"]
"include": [
"src/**/*",
// TODO: *.json could be removed when tsconfig.build.json would be properly consumed by webpack
"src/**/*.json"
]
}
13 changes: 1 addition & 12 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,5 @@
"@flyteconsole/*": ["./packages/plugins/*/src", "./packages/zapp/*/src"]
}
},
"exclude": [
"**/node_modules",
"**/dist",
"**/lib",
"**/src/**/*.spec.*",
"**/src/**/*.test.*",
"**/src/**/*.stories.*",
// old code patterns
"**/__mocks__",
"**/test",
"**/mocks"
]
"exclude": ["**/node_modules", "**/dist", "**/lib"]
}

0 comments on commit 954e573

Please sign in to comment.