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
[V2] Fix Circular Dependency Warnings #514
Conversation
@@ -53,7 +53,6 @@ | |||
"internal-lib-build": "^2.0.0-dev.4", | |||
"nock": "^13.1.1", | |||
"node-fetch": "2.6.1", | |||
"pwa-kit-cli": "^2.0.0-dev.4", |
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.
We need this package though. We are using pwa-kit-cli
for local dev. See here
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.
The linked file (express.js
) is the only place that pwa-kit-runtime
uses pwa-kit-cli
. The imported file (build-dev-server.js
) is only used by express.js
. To resolve the circular dependency, I think it makes sense to just move build-dev-server.js
into pwa-kit-runtime
, as it's not used by any other packages, not even by pwa-kit-cli
.
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.
@alexvuong It actually isn't being used there. The usage on the line that you called out is covered by the peer dependency here
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.
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.
@alexvuong We do not need it – if we did, it wouldn't even have been in devDependencies
before. That's why the code does the dynamic eval('require')
import.
@bendvc Your suggestion looks good to me if you would like to silence the warnings. And the test strategy looks fine to me, too.
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.
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.
@alexvuong @wjhsf I reckon that @olibrook 's intentions where to separate the dev server factory from the runtime package is it doesn't really have anything to do with the runtime per-say. You can imaging that the runtime isn't concerned with how your application is developed, only that can run projects that follow its API.
For example, you can create a project that doesn't use webpack at all, and therefore doesn't use webpack-dever-server, so it doesn't make sense that we have that code in the runtime. Previously the cli package was called pwa-kit-build, and it sounded more like a package that might have a dev server in it, but now that it's called pwa-kit-cli it seems a little less likely to be a package that contains a dev sever factory. I think that might be the source of the code smell.
That being said, this is outside of the scope of this ticket I think. The circular dep only existed via a dev dependency, which we have removed. So I think we are good to go.
Co-authored-by: Oliver Brook <olibrook@gmail.com>
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.
LGTM
* Bump V2 (aka V2 develop) to 2.0.0-dev.3 (#486) * Bump version * Fix lint errors * [BFH] Make hello-world public in the generator, give it a presentable README (#393) * Rename hello-world -> express-minimal, make public in generator * Format * Format * [v2] Rename template-1c -> template-typescript-minimal (#494) * Rename template-1c -> template-typescript-minimal * Format * [V2] Fix rejected 3PP (#488) * Remove `lodash.debounce` & Bump `njwt` to latest * Bump `sinon` to latest * Solve merge conflicts * Update lighthouse score thresholds (#491) * [V2]add eslintrc.js to project templates (#495) * add eslintrc.js to project templates * [V2] Hide webpack perf warnings for `pwa` and use `bundlesize` instead (#471) * [V2] allow custom webpack config in projects (#462) * Allow projects to build or start dev server with a custom webpack config * Add webpack config placeholders in app templates * Cleanup optional webpack config in PWA * Update packages/pwa-kit-build/bin/mrt.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * bump 2.0.0-dev.4 (#502) * bump * fix version * Optimize visibility-off.svg (#512) * [V2] Rename 'pwa' directory into 'template-retail-react-app' (#485) * Rename pwa directory to template-retail-react-app * Update readme and circleci config * Update pwa references in generator to template-retail-react-app * Clean up comments * Update report-bundle-size.js * Rename pwa directory to template-retail-react-app * Update readme and circleci config * Update pwa references in generator to template-retail-react-app * Clean up comments * Update report-bundle-size.js * Rename pwa-kit-build package and mrt CLI to pwa-kit-cli (package + CLI) (#481) * Rename pwa-kit-build/mrt to sf-mrt. * Rename sf-mrt to pwa-kit-cli * Rename mrt file to cli * Rename sf-mrt directory to pwa-kit-cli * Use pwa-kit-cli instead of pwa-kit-build. * Move loading screen from pwa-kit-build to pwa-kit-cli * Update CLI human-readable name. * [V2] Reinstate `pwa-kit-build` Test(s) (#492) * Reinstate build test * Add regenerator-runtime to internal-lib-build Co-authored-by: vcua-mobify <vcua@salesforce.com> * [V2]Generate different reports for different bundles (#508) * generate different reports for different bundles * fix report bundle size script * Remove old config implementation from bad merge (#513) * [V2] Re-Enable Windows Node 14 CI Workflow (#487) * Re-enable windows node 14 workflow * Fix glob string cross environment * Testing removing restore_cache * Testing forceExit flag * Testing not running lint * Debugging using double quotes * Force crlf line ending for mrt.js file * Revert "Force crlf line ending for mrt.js file" This reverts commit b249e0f. * Test not running tests on templates * Re-enable lint * Testing adding eslint at root * Revert "Testing adding eslint at root" This reverts commit 531fe6a. * clean up * Try again crlf on mrt.js * Revert "Try again crlf on mrt.js" This reverts commit 301826c. * Lint fix template-typescript-minimal * Enable eslint debug flag * Remove silent flag * Enable eslint debug flag for internal-lib-build * Fix glob string cross env on internal-lib-build script * Remove lerna parallel flag on lint script * Remove eslint debug flags * Exclude tsx files from lint * Debug mrt eslint * Re-enable eslint debug flags * Testing Windows xlarge * Fix mrt pkgRoot * Print more logs * Testing npm ci on Windows * Clean up * Testing lerna link * Add lerna link to setup_windows circle ci step * Add docs to Circle CI config * typo Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Bump Verdaccio to latest (#518) * [V2] Fix Circular Dependency Warnings (#514) * Remove CLI dev dependency causing circular dependency warnings Co-authored-by: Oliver Brook <olibrook@gmail.com> * Update copyrights and template. (#516) * v2 fix old naming (#521) * v2 replace old name mobify-platform-sdk references to pwa-kit * fix typo in readme and jsdoc (#530) * [V2] Fix source maps cannot be found when debugging the server (#526) * fix source map not working for server-side debugging * [V2] Loading page: avoid seeing infinite reloads (#532) * [V2] Fix invalid refresh token (#528) * fix tests * fix merge issue * fix test * [V2] Allow pass thru cli options for test command (#537) * Allow jest option to pass thru * remove useless test env * Remove lodash and bluebird. (#534) * Don't count untestable line towards code coverage. * Remove lodash and bluebird. * Oops, a semi! * Revert to util.promisify so tests pass. * Refactor to fix tests. * Fix l10n scripts to use and output to the correct file (#539) This hardcoding of the default locale was done in V1, but it was not done in V2 yet.. until now. * Merge branch `release 2.0.x` into `v2` (#542) * Fix lint errors * Review release 2.0.0-dev.3 (#499) * Bump V2 (aka V2 develop) to 2.0.0-dev.3 (#486) * Bump version * Fix lint errors * [BFH] Make hello-world public in the generator, give it a presentable README (#393) * Rename hello-world -> express-minimal, make public in generator * Format * Format * [v2] Rename template-1c -> template-typescript-minimal (#494) * Rename template-1c -> template-typescript-minimal * Format * [V2] Fix rejected 3PP (#488) * Remove `lodash.debounce` & Bump `njwt` to latest * Bump `sinon` to latest * Solve merge conflicts * Update lighthouse score thresholds (#491) * [V2]add eslintrc.js to project templates (#495) * add eslintrc.js to project templates * [V2] Hide webpack perf warnings for `pwa` and use `bundlesize` instead (#471) * [V2] allow custom webpack config in projects (#462) * Allow projects to build or start dev server with a custom webpack config * Add webpack config placeholders in app templates * Cleanup optional webpack config in PWA * Update packages/pwa-kit-build/bin/mrt.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * Solve merge conflicts Co-authored-by: Ben Chypak <bchypak@salesforce.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * Solve merge conflicts Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: Oliver Brook <olibrook@gmail.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com>
…ev.5` (#547) * Fix lint errors * Review release 2.0.0-dev.3 (#499) * Bump V2 (aka V2 develop) to 2.0.0-dev.3 (#486) * Bump version * Fix lint errors * [BFH] Make hello-world public in the generator, give it a presentable README (#393) * Rename hello-world -> express-minimal, make public in generator * Format * Format * [v2] Rename template-1c -> template-typescript-minimal (#494) * Rename template-1c -> template-typescript-minimal * Format * [V2] Fix rejected 3PP (#488) * Remove `lodash.debounce` & Bump `njwt` to latest * Bump `sinon` to latest * Solve merge conflicts * Update lighthouse score thresholds (#491) * [V2]add eslintrc.js to project templates (#495) * add eslintrc.js to project templates * [V2] Hide webpack perf warnings for `pwa` and use `bundlesize` instead (#471) * [V2] allow custom webpack config in projects (#462) * Allow projects to build or start dev server with a custom webpack config * Add webpack config placeholders in app templates * Cleanup optional webpack config in PWA * Update packages/pwa-kit-build/bin/mrt.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * Preview release `2.0.0-dev.4` (#544) * Bump V2 (aka V2 develop) to 2.0.0-dev.3 (#486) * Bump version * Fix lint errors * [BFH] Make hello-world public in the generator, give it a presentable README (#393) * Rename hello-world -> express-minimal, make public in generator * Format * Format * [v2] Rename template-1c -> template-typescript-minimal (#494) * Rename template-1c -> template-typescript-minimal * Format * [V2] Fix rejected 3PP (#488) * Remove `lodash.debounce` & Bump `njwt` to latest * Bump `sinon` to latest * Solve merge conflicts * Update lighthouse score thresholds (#491) * [V2]add eslintrc.js to project templates (#495) * add eslintrc.js to project templates * [V2] Hide webpack perf warnings for `pwa` and use `bundlesize` instead (#471) * [V2] allow custom webpack config in projects (#462) * Allow projects to build or start dev server with a custom webpack config * Add webpack config placeholders in app templates * Cleanup optional webpack config in PWA * Update packages/pwa-kit-build/bin/mrt.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * bump 2.0.0-dev.4 (#502) * bump * fix version * Optimize visibility-off.svg (#512) * [V2] Rename 'pwa' directory into 'template-retail-react-app' (#485) * Rename pwa directory to template-retail-react-app * Update readme and circleci config * Update pwa references in generator to template-retail-react-app * Clean up comments * Update report-bundle-size.js * Rename pwa directory to template-retail-react-app * Update readme and circleci config * Update pwa references in generator to template-retail-react-app * Clean up comments * Update report-bundle-size.js * Rename pwa-kit-build package and mrt CLI to pwa-kit-cli (package + CLI) (#481) * Rename pwa-kit-build/mrt to sf-mrt. * Rename sf-mrt to pwa-kit-cli * Rename mrt file to cli * Rename sf-mrt directory to pwa-kit-cli * Use pwa-kit-cli instead of pwa-kit-build. * Move loading screen from pwa-kit-build to pwa-kit-cli * Update CLI human-readable name. * [V2] Reinstate `pwa-kit-build` Test(s) (#492) * Reinstate build test * Add regenerator-runtime to internal-lib-build Co-authored-by: vcua-mobify <vcua@salesforce.com> * [V2]Generate different reports for different bundles (#508) * generate different reports for different bundles * fix report bundle size script * Remove old config implementation from bad merge (#513) * [V2] Re-Enable Windows Node 14 CI Workflow (#487) * Re-enable windows node 14 workflow * Fix glob string cross environment * Testing removing restore_cache * Testing forceExit flag * Testing not running lint * Debugging using double quotes * Force crlf line ending for mrt.js file * Revert "Force crlf line ending for mrt.js file" This reverts commit b249e0f. * Test not running tests on templates * Re-enable lint * Testing adding eslint at root * Revert "Testing adding eslint at root" This reverts commit 531fe6a. * clean up * Try again crlf on mrt.js * Revert "Try again crlf on mrt.js" This reverts commit 301826c. * Lint fix template-typescript-minimal * Enable eslint debug flag * Remove silent flag * Enable eslint debug flag for internal-lib-build * Fix glob string cross env on internal-lib-build script * Remove lerna parallel flag on lint script * Remove eslint debug flags * Exclude tsx files from lint * Debug mrt eslint * Re-enable eslint debug flags * Testing Windows xlarge * Fix mrt pkgRoot * Print more logs * Testing npm ci on Windows * Clean up * Testing lerna link * Add lerna link to setup_windows circle ci step * Add docs to Circle CI config * typo Co-authored-by: Adam Raya Navarro <arayanavarro@salesforce.com> * Bump Verdaccio to latest (#518) * [V2] Fix Circular Dependency Warnings (#514) * Remove CLI dev dependency causing circular dependency warnings Co-authored-by: Oliver Brook <olibrook@gmail.com> * Update copyrights and template. (#516) * v2 fix old naming (#521) * v2 replace old name mobify-platform-sdk references to pwa-kit * fix typo in readme and jsdoc (#530) * [V2] Fix source maps cannot be found when debugging the server (#526) * fix source map not working for server-side debugging * [V2] Loading page: avoid seeing infinite reloads (#532) * [V2] Fix invalid refresh token (#528) * fix tests * fix merge issue * fix test * [V2] Allow pass thru cli options for test command (#537) * Allow jest option to pass thru * remove useless test env * Remove lodash and bluebird. (#534) * Don't count untestable line towards code coverage. * Remove lodash and bluebird. * Oops, a semi! * Revert to util.promisify so tests pass. * Refactor to fix tests. * Fix l10n scripts to use and output to the correct file (#539) This hardcoding of the default locale was done in V1, but it was not done in V2 yet.. until now. * Merge branch `release 2.0.x` into `v2` (#542) * Fix lint errors * Review release 2.0.0-dev.3 (#499) * Bump V2 (aka V2 develop) to 2.0.0-dev.3 (#486) * Bump version * Fix lint errors * [BFH] Make hello-world public in the generator, give it a presentable README (#393) * Rename hello-world -> express-minimal, make public in generator * Format * Format * [v2] Rename template-1c -> template-typescript-minimal (#494) * Rename template-1c -> template-typescript-minimal * Format * [V2] Fix rejected 3PP (#488) * Remove `lodash.debounce` & Bump `njwt` to latest * Bump `sinon` to latest * Solve merge conflicts * Update lighthouse score thresholds (#491) * [V2]add eslintrc.js to project templates (#495) * add eslintrc.js to project templates * [V2] Hide webpack perf warnings for `pwa` and use `bundlesize` instead (#471) * [V2] allow custom webpack config in projects (#462) * Allow projects to build or start dev server with a custom webpack config * Add webpack config placeholders in app templates * Cleanup optional webpack config in PWA * Update packages/pwa-kit-build/bin/mrt.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Adam Raya <adamraya@users.noreply.github.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * Solve merge conflicts Co-authored-by: Ben Chypak <bchypak@salesforce.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> * Solve merge conflicts Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: Oliver Brook <olibrook@gmail.com> Co-authored-by: Ben Chypak <bchypak@salesforce.com> * Bump version `2.0.0-dev.5` * Bump root package-lock.json file version to 2.0.0-dev.5 Co-authored-by: Ben Chypak <bchypak@salesforce.com> Co-authored-by: Kevin He <kevin.he@salesforce.com> Co-authored-by: Ben Chypak <bchypak@mobify.com> Co-authored-by: Oliver Brook <o.brook@salesforce.com> Co-authored-by: Alex Vuong <52219283+alexvuong@users.noreply.github.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com> Co-authored-by: vcua-mobify <vcua@salesforce.com> Co-authored-by: Oliver Brook <olibrook@gmail.com>
Description
Lerna was spitting out circular dependency warning for almost every package (see image attached). This was because the
runtime
was including thecli
in its devDependencies for use in a single test.This PR removes that dependency and updates the test. The test is less concrete than before, but I think it's good enough for this case.
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization