This document exists to capture specific types of work related to maintaining this project. Relative to the contributing guide, which provides general instruction on contributing to the repository, this document captures specific narrow usecase instructions.
Projects that use this library, but are built with declarations ("declaration": true in the project tsconfig.json) which build *.d.ts files for the library may run into the following error:
The inferred type of applicationFeatureName cannot be named without a reference to '../node_modules/@aws-amplify/data-schema/dist/esm/FileName'. This is likely not portable. A type annotation is necessary.
This error tells you which file has a missing export, but not which specific export is needed. To resolve this:
- Review the
applicationFeatureNamelibrary usage and add it to an example in the exports-test and runyarn testto confirm that you change breaks the test build as you expect. - Add
export * from './FileName'to the library index and runyarn build && yarn testto confirm that this fixes the error. - Now review the
exportsfrom./FileName, replacing the*with a list of all of the exported typesexport type { ... } from './FileName'; - With all exports re-exported,
yarn build && yarn testshould fix the test application. Experiment removing imports and rerunning this test command until you have the minimum set of required exports to resolve the build issue under test. - For each type exported by your change, add the following comments/docs.