refactor: migrate manual lib dependencies to npm and gulp bundle#6720
Open
Jetshree wants to merge 8 commits intosugarlabs:masterfrom
Open
refactor: migrate manual lib dependencies to npm and gulp bundle#6720Jetshree wants to merge 8 commits intosugarlabs:masterfrom
Jetshree wants to merge 8 commits intosugarlabs:masterfrom
Conversation
Contributor
|
✅ All Jest tests passed! This PR is ready to merge. Coverage: Coverage summary unavailable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fundamentally modernizes how dependencies are managed in Music Blocks. It replaces the legacy system of manually dropping third-party libraries into the
lib/folder with a standard, automatednpmandgulp-based pipeline. Third-party dependencies are now explicitly versioned inpackage.jsonand concatenated into adist/vendor.min.jsbundle to significantly clean upindex.htmlandjs/loader.js.This PR introduces structural changes to the build pipeline. The goal is to remove manual management of dependencies through the
libfolder and rely entirely onpackage.jsonandGulp. It needs close review and opinions from the core maintainers before merging.This PR is first part, if the idea feels good then other libraries in /lib folder will also be moved to package.json in separate PRs.
PR Category
Changes Made
jquery,jquery-ui-dist,materialize-css,abcjs,howler, andtoneinto NPM dependencies.package.jsonNPM versions to exactly match the legacy versions previously found in thelib/directory to maximize backward compatibility.gulpfile.jsto include a newvendorTaskthat concatenates these specific NPM packages into a singledist/vendor.min.jsfile.<script>tag requests fromindex.html.js/loader.js'sPRELOADED_SCRIPTSarray to correctly map global module exports coming from the new unified vendor bundle.--no-warn-ignoredtolint-stagedinpackage.jsonto prevent Husky pre-commit hooks from failing when auto-checking output files likedist/vendor.min.js.Testing Performed
npm installgracefully resolves and installs the legacy-pinned package versions.npx gulp vendorTaskto ensuredist/vendor.min.jsis generated with correct paths.index.htmlcorrectly defaults to loading the new unified bundle.Before:

After:

Checklist
npm run lintandnpx prettier --check .with no errors.Additional Notes for Reviewers
Please pay close attention to
jquery-ui-dist. The legacylib/folder containedv1.11.4, but that version was never officially published to NPM under thejquery-ui-distpackage. It has been pinned tov1.12.1inpackage.jsonas the closest, safest alternative.