This changes the main output to also preserve modules, allowing tree shaking when users build their projects.
This also replaces rollup-plugin-dts with the more traditional @rollup/plugin-typescript, which exports type declarations for individual files fixing issues with themes imports.
This restores importing React and the ESLint rule react/react-in-jsx-scope to preserve React 16 compatibility.
This also moves some types around so themes can be exported as a standalone with its own TypeScript config.
This commit:
- Adds .editorconfig file
- Installs TypeScript and necessary dependencies
- Configures TypeScript tsconfig.json
- Configures Rollup to use esbuild and export .d.ts
- Converts entry files to TypeScript
- Configures Storybook to generate docs based on types
- Configures TypeScript on ESLint
- Configures Jest and ts-jest for TypeScript
- Fixes no-use-before-define problems on stories
- Ignores @typescript-eslint/no-unused-vars on mapFromWindowsTheme
- Fixes test failure on CSS check
- class-methods-use-this required DatePicker update convertDateToState to be static
- no-console was disabled on tests and stories
- jsx-a11y/label-has-associated-control removed duplicate rule
- prettier/prettier auto-fixed many components due to Prettier upgrade
- react/function-component-definition auto-fixed many components
- react/jsx-fragments auto-fixed Select.spec with <>
- react/jsx-no-useless-fragment auto-fixed Select to remove useless Fragment
- react/jsx-props-no-spreading was turned off
- react/no-unused-prop-types was ignored on Tree and useForkRef
- react/static-property-placement was set up to our use case
- jest-environment-jsdom must be installed and configured separately
- Timers changed so setTimeout can only be observed on the legacy fake timers
- waitForDomChange doesn't exist anymore
- toBeEmpty is deprecated, should be replaced with toBeEmptyDOMElement
includes ESM build and fonts in the package. Themes are now now moved from main bundle to
'react95/dist/themes'
BREAKING CHANGE: themes moved from the main bundle to 'react95/dist/themes'
* Move each mdx file to respective component folder (colocation ftw)
* Fix some style prop-types in order to fix docz build
* Move docz to the root folder instead of having a separated project folder