Skip to content

Commit

Permalink
ci: Fix build not including typescript types (trussworks#2076)
Browse files Browse the repository at this point in the history
* Fix type export warnings by using `export type`

* use tsc to emit types, continue relying on babel loader for transpiling
  • Loading branch information
brandonlenz authored May 12, 2022
1 parent 761ccc8 commit febcd65
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"test:serverside": "yarn build && node src/serverSideTest.js",
"storybook": "start-storybook -p 9009",
"storybook:deploy": "storybook-to-ghpages",
"build": "webpack --progress",
"build:watch": "webpack --watch",
"lint": "tsc --noEmit && eslint --ext js,jsx,ts,tsx src && stylelint \"src/**/*.{css,scss}\"",
"build": "tsc && webpack --progress",
"build:watch": "tsc && webpack --watch",
"lint": "tsc --noEmit --emitDeclarationOnly false && eslint --ext js,jsx,ts,tsx src && stylelint \"src/**/*.{css,scss}\"",
"release": "standard-version -t ''",
"prepare": "yarn build",
"prepublishOnly": "yarn test && yarn lint",
Expand Down Expand Up @@ -127,7 +127,7 @@
},
"husky": {
"hooks": {
"pre-commit": "tsc --noEmit && lint-staged",
"pre-commit": "tsc --noEmit --emitDeclarationOnly false && lint-staged",
"pre-push": "yarn danger local -b main --failOnErrors"
}
},
Expand Down
15 changes: 9 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export { Grid } from './components/grid/Grid/Grid'
/** Form components */
export { CharacterCount } from './components/forms/CharacterCount/CharacterCount'
export { Checkbox } from './components/forms/Checkbox/Checkbox'
export { ComboBox, ComboBoxOption } from './components/forms/ComboBox/ComboBox'
export { ComboBox } from './components/forms/ComboBox/ComboBox'
export type {
ComboBoxRef,
ComboBoxOption,
} from './components/forms/ComboBox/ComboBox'
export { DateInput } from './components/forms/DateInput/DateInput'
export { DateInputGroup } from './components/forms/DateInputGroup/DateInputGroup'
export { DatePicker } from './components/forms/DatePicker/DatePicker'
Expand All @@ -40,6 +44,7 @@ export { Dropdown } from './components/forms/Dropdown/Dropdown'
export { ErrorMessage } from './components/forms/ErrorMessage/ErrorMessage'
export { Fieldset } from './components/forms/Fieldset/Fieldset'
export { FileInput } from './components/forms/FileInput/FileInput'
export type { FileInputRef } from './components/forms/FileInput/FileInput'
export { Form } from './components/forms/Form/Form'
export { FormGroup } from './components/forms/FormGroup/FormGroup'
export { InputPrefix } from './components/forms/InputPrefix/InputPrefix'
Expand All @@ -65,7 +70,7 @@ export { NavDropDownButton } from './components/header/NavDropDownButton/NavDrop
export { PrimaryNav } from './components/header/PrimaryNav/PrimaryNav'
export { Title } from './components/header/Title/Title'

// IconList
/** IconList component */
export { IconList } from './components/IconList/IconList'
export { IconListItem } from './components/IconList/IconListItem/IconListItem'
export { IconListTitle } from './components/IconList/IconListTitle/IconListTitle'
Expand Down Expand Up @@ -93,11 +98,12 @@ export { Logo } from './components/Footer/Logo/Logo'
export { SocialLinks } from './components/Footer/SocialLinks/SocialLinks'

/** Modal components */
export { Modal, ModalProps, ModalRef } from './components/Modal/Modal'
export { Modal } from './components/Modal/Modal'
export { ModalToggleButton } from './components/Modal/ModalToggleButton'
export { ModalOpenLink } from './components/Modal/ModalOpenLink'
export { ModalHeading } from './components/Modal/ModalHeading/ModalHeading'
export { ModalFooter } from './components/Modal/ModalFooter/ModalFooter'
export type { ModalProps, ModalRef } from './components/Modal/Modal'

/** Card components */
export { CardGroup } from './components/card/CardGroup/CardGroup'
Expand Down Expand Up @@ -126,6 +132,3 @@ export { ProcessListItem } from './components/ProcessList/ProcessListItem/Proces
export { ProcessListHeading } from './components/ProcessList/ProcessListHeading/ProcessListHeading'

export { SiteAlert } from './components/SiteAlert/SiteAlert'

export type { FileInputRef } from './components/forms/FileInput/FileInput'
export type { ComboBoxRef } from './components/forms/ComboBox/ComboBox'
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"noEmit": true,
"emitDeclarationOnly": true,
"jsx": "react",
"noImplicitAny": true,
"declaration": true,
"outDir": "./lib"
"outDir": "./lib",
"isolatedModules": true,
},
"include": ["src/**/*", "custom.d.ts"],
"exclude": [
Expand Down

0 comments on commit febcd65

Please sign in to comment.