-
Notifications
You must be signed in to change notification settings - Fork 86
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
Draft: custom-elements.json removed from .gitignore #2347
Conversation
✅ Deploy Preview for marvelous-moxie-a6e2fe ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Some comments from ChatGPT: The custom-elements.json file is updated automatically each time you build or rebuild your project. This file is created and updated during the compilation process when Stencil analyzes your components and generates metadata necessary to describe the custom elements. Key moments when custom-elements.json is updated:
This file is important for integration with other tools and frameworks, such as Storybook or documentation, and contains information about all registered components, their properties, events, and methods. |
The custom-elements.json file should typically be included in the final build of a Stencil component library that is distributed via npm and ends up in the node_modules directory when installed. custom-elements.json should be at the same level as package.json, not buried deep within the dist/ folder or other directories. This placement ensures that tools and developers can easily access the file when needed. Including custom-elements.json in the final package helps:
|
The custom-elements.json file might be added to .gitignore for several reasons: Automatically Generated: Since custom-elements.json is automatically generated during the build process, it doesn’t need to be stored in version control. It can be regenerated on any machine during the build, so including it in the repository might be considered redundant. Changes with Each Build: This file can change every time the project is built. Including it in the repository could lead to frequent and unnecessary changes in commit history, cluttering logs and making it harder to track real code changes. Different Environments: If developers or CI/CD environments use different versions of tools or configurations, the contents of custom-elements.json might differ slightly. This could lead to merge conflicts even if the code changes are minimal. File Size: In projects with a large number of components, custom-elements.json can become quite large. If the file is not essential for development, it can be excluded from the repository to keep the storage size down. Documentation in External Systems: If the project is integrated with systems that generate documentation or use component metadata (e.g., Storybook), they might generate or utilize this file themselves, and including it in the repository could lead to data duplication or version mismatches. In these cases, developers might prefer to generate custom-elements.json locally during each build rather than track it in the repository. |
If custom-elements.json is in .gitignore and is generated during the build in the CI/CD pipeline but does not make it into the final build of the library, several issues could be causing this: 1. File Not Included in the Publishing Process: How to Address the Issue: These steps will help ensure that custom-elements.json is included in the final build and available to users of your library. |
this is closed in favor of 2357 |
Fixes #2302