-
-
Notifications
You must be signed in to change notification settings - Fork 7
Feat treeshaking: Centralize js dependency management #243
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
base: main
Are you sure you want to change the base?
Conversation
| When jinks generates an application: | ||
|
|
||
| 1. `modules/generator.xql` loads `config/package.json` | ||
| 2. CDN URLs are pre-computed using `config:cdn-url()` function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these parameterized? So load jinn-tap from http://localhost:5174, jinks from resources/scripts and pb-components from CDN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but the current integration with examples: for autosuggestion via jinks.json needs addressing
…d apps - Introduced `sync:dependencies` and `validate:dependencies` scripts in package.json. - Added GitHub Actions workflow for syncing shared dependencies from root package.json to config/package.json. - Updated dependabot.yml to monitor dependencies in both root and config directories.
- Added a function to build CDN URLs from the dependencies defined in package.json. - Updated API context to include CDN URLs for swagger-ui and other assets. - Modified HTML templates to conditionally load assets from CDN or fallback to default URLs based on availability.
…ons in package.json - Updated swagger-ui-dist to version 5.31.0. - Updated @jinntec/jinn-codemirror to version 1.18.2.
- Updated annotate.html to use Fore.js version 2.8.0. - Modified base.html and static/base.html to conditionally load Fore.js from CDN if available, with a fallback to the default URL.
- Added new dependencies: theme-toggles and @jinntec/jinntap to package.json. - Updated README.md to clarify CDN URL template usage and overrides. - Improved API and generator modules to dynamically build CDN URLs for all asset types. - Enhanced templates to utilize the new CDN mapping for loading assets conditionally. - Processed styles array to replace hardcoded CDN URLs with templated versions from package.json.
- Added checks for missing base URLs and ensured at least one asset type is defined.
- Validated that all asset type templates contain the {{version}} placeholder, adding appropriate warnings.
- Added `versioning-strategy: increase` to the Dependabot configuration for better version management. - Introduced `package-lock.json` to ensure consistent dependency resolution for automated updates.
- Enhanced the configuration to support profile-specific version overrides in `config/package.json`. - Updated the `effective-version` function to check for overrides based on active profiles. - Modified the CDN URL generation to apply these overrides, ensuring the correct versions are used when building URLs. - Improved documentation in `README.md` to clarify the usage of overrides and their precedence. - Adjusted templates to utilize effective versions for dependencies, enhancing flexibility in version management.
- Updated README.md to emphasize the use of function call syntax. - Modified various HTML templates to implement the new syntax for CDN key access. review comment: jinks#243#discussion_r2689497823
280e01a to
cabc35c
Compare
…and failing links
…ndency management - Added permissions for write access to contents and pull requests. - Updated the checkout step to fetch the full history. - Changed the dependency sync command to use npm script. - Improved change detection logic for config/package.json. - Enhanced commit and push logic to handle branch determination for pull requests.
refactor sync yaml simplify logic
| ], | ||
| "script": { | ||
| "fore": "1.9.0", | ||
| "fore": "2.8.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should come from the central config, right?
| [% if exists($cdn?('jinn-codemirror-bundle')) %] | ||
| <script type="module" src="[[ $cdn?('jinn-codemirror-bundle') ]]"></script> | ||
| [% else %] | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@jinntec/[email protected]/dist/jinn-codemirror-bundle.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we do this defaulting in the config.json? Also, this should be 1.18.2 because of that firefox bug
| <jinn-tap url="[[ $url ]]" name="[[ $context?doc?path ]]" schema="[[ $context?features?jinntap?schema ]]" | ||
| token="[[ jt:jwt-token() ]]" server="[[ $features?collab?server ]]" sidebar="#attributes-panel"> | ||
| [% if exists($features?jinntap?version) and $features?jinntap?version != "dev" %] | ||
| <img slot="aside" class="logo" src="[[ $features?jinntap?cdn ]]@[[ $features?jinntap?version ]]/dist/jinntap-logo-128.png" alt="JinnTap"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not always get this through the configuration?
Establishes a single source of truth for Node.js dependencies across jinks and generated applications.
Key Changes:
config/package.jsonas centralized registry for all generated-app dependencies$cdnmap instead of hardcoded CDN URLsconfig/package.jsonwithversioning-strategy: increaseconfig.jsonfilesconfig/package-lock.jsonrequired for DependabotBenefits:
should be reviewed after #240 is merged