First step at having the documentation website properly recognize types in the library.
(Trivially) update the basic accordion example in the documentation website
Fix typing issue with PolymorphicForwardRefComponent
Refactoring/reorganizing
Co-locate type definitions
Use relative imports
Reorganize files by folder (e.g. components go in ./components)
Root index.ts now simply exports what's in src/Accordion/index.ts as well as shared types and utilities
Begin generating type declarations and expose them in package.json
Build CJS and ESM versions of react-aria-widgets and expose them in package.json (including sub-modules)
Add a new yarn script build:test that checks for TS errors without emitting files
We have to exclude stories when building with webpack so we don't generate type definitions for them, but I still wanted to check them for errors
Resolves #127
Resolves #125
Note:
Importing a sub-module (e.g. import { ... } from 'react-aria-widgets/accordion';) in a TypeScript app only works properly if moduleResolution is set to node16 or nodenext. Apparently I can add a "typeVersions" property in the library's package.json for older versions of TypeScript who can't use that moduleResolution value, but honestly I should probably just use scoped packages anyway.
First step at having the documentation website properly recognize types in the library.
PolymorphicForwardRefComponent
./components
)index.ts
now simply exports what's insrc/Accordion/index.ts
as well as shared types and utilitiespackage.json
react-aria-widgets
and expose them inpackage.json
(including sub-modules)build:test
that checks for TS errors without emitting filesResolves #127 Resolves #125
Note:
import { ... } from 'react-aria-widgets/accordion';
) in a TypeScript app only works properly ifmoduleResolution
is set tonode16
ornodenext
. Apparently I can add a"typeVersions"
property in the library'spackage.json
for older versions of TypeScript who can't use thatmoduleResolution
value, but honestly I should probably just use scoped packages anyway.