-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: re-open of issue #2769 / components.d.ts missing types #3239
Comments
We face this during a gitlab-ci pipeline.
|
Oh I have been facing this issue for ages. I never understood why, so I am always just rebuilding until I can see my types. |
Although not ideal, adding a "prebuild": "if [ ! -f ./src/components.d.ts ]; then touch ./src/components.d.ts; npm run build; fi", |
This solution doesn't seem to work anymore with StencilJS Version 4.6 (I didn't check earlier versions) |
Another solution: "two-build-steps": "echo 'Stencil Build Pass #1' && (npm run build || true) && echo 'Stencil Build Pass #2' && npm run build" The first step generates the components.d.ts AFTER compiling the sources. The second step uses the generated components.d.ts from the first one. |
**Related Issue:** #7860 ## Summary Add a package of angular components that wrap the web component library following [Stencil's documentation](https://stenciljs.com/docs/v2/angular). There were a lot of type related build errors and I ended up adding three patches: 1. Rebuild the web component library if the CC types aren't generated correctly as a workaround for stenciljs/core#3239 2. Fix a couple type import paths for event details that were generated by `@stencil/angular-output-target`. Not sure if this one is an issue on our end or theirs. 3. A JSDOM types error that [other people also experienced when using stencil's angular output target](DefinitelyTyped/DefinitelyTyped#57467 (reply in thread)). All of the build/CI stuff is working correctly. It was a bit wonky at first because we need an angular workspace just to build a single component library. --------- Co-authored-by: Anveshreddy mekala <anv11827@esri.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This reverts commit 680e1c4.
**Related Issue:** #9008 ## Summary Commit changes to `components.d.ts` after building for release to prevent lerna/npm publishing errors due to an unclean working tree. The commit will be discarded once the workflow run's container is destroyed. ### Background The `components.d.ts` file is tracked as a temporary workaround for stenciljs/core#3239 To keep the types updated, `components.d.ts` is added to the index in a pre-commit hook. https://github.com/Esri/calcite-design-system/blob/2bb1ee24bb317c95e2bef8165c75583fe98ad714/.husky/pre-commit#L7-L13 However, the file can still be outdated if people make changes and don't rebuild before creating another commit. This is mostly an issue with small doc updates, like the PR linked above. If that happens, the release will fail due to an unclean working tree.
Stencil version:
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:
Related code:
please have a look at #2769
The text was updated successfully, but these errors were encountered: