Description
Stencil version:
@stencil/[email protected]
Current behavior:
The behaviour is best documented in the closed ticket (by bot due to inactivity) the Issue remains un-solved - please have a look at #2769
Copycat:
If there is no src/components.d.ts file present, and one component (A) references another's type (B)...
On first build, the types are not generated for (A) in the output directory dist/types/components. If (A) exports any types, this can also result in broken imports in dist/types/components.d.ts. No error is reported during build.
On second build (where there is now a src/components.d.ts present as a result of the first build), the types are generated for (A) in the output directory dist/types/components.
I do not like committing auto-generated files to source control, as they result in needless churn, hence why i do not have src/components.d.ts (this was a fresh clone of my repo).
Expected behavior:
All Types are present in the first compile of components.d.ts, when no components.d.ts is present in the first place.
Copycat:
Ideally it should Just Work(tm), and not rely on committing auto-generated files to source control. On both the first (broken) build and the second (successful) build, the src/components.d.ts file is exactly the same, so it may be a timing/ordering issue?
An alternative would simply be to raise an error in this case.
Steps to reproduce:
- create new stencil project with npm init stencil
- rm src/components.d.ts
- add the components from the Related code section below
- npm run build
- open dist/types/components.d.ts and see a broken import
- ls dist/types/components/ and notice there are no types for my-other-component
Related code:
please have a look at #2769