Explicitly declare optional peer deps in just-scripts#825
Draft
Explicitly declare optional peer deps in just-scripts#825
Conversation
Copilot
AI
changed the title
[WIP] Fix implicit optional peer dependencies in just-scripts
Explicitly declare optional peer deps in just-scripts
Mar 26, 2026
ecraig12345
reviewed
Mar 26, 2026
packages/just-scripts/package.json
Outdated
Comment on lines
+39
to
+46
| "autoprefixer": "^9.0.0", | ||
| "fork-ts-checker-webpack-plugin": "^4.0.0", | ||
| "html-webpack-plugin": "^4.0.0", | ||
| "node-sass": "^4.0.0", | ||
| "postcss": "^8.0.0", | ||
| "postcss-clean": "^1.0.0", | ||
| "postcss-rtl": "^1.0.0", | ||
| "sass": "^1.0.0", |
Member
There was a problem hiding this comment.
- You should also add any optional peer deps which are referenced with
resolve() - For each optional peer dep, can you figure out what was the current version as of 2020 and update the range to allow that major version and all major versions after? Also reply to this comment with the list of major versions of each package and their release dates or if you're not able to determine this.
Contributor
Author
There was a problem hiding this comment.
Added all resolve() packages and updated ranges in 6ade4f5. Here's the version data for all optional peer deps:
| Package | Latest as of 2020 | Range |
|---|---|---|
@microsoft/api-extractor |
7.12.1 (2020-12-10) | ^7.0.0 |
@microsoft/loader-load-themed-styles |
1.9.21 (2020-12-14) | ^1.0.0 || ^2.0.0 |
autoprefixer |
10.1.0 (2020-12-08) | ^10.0.0 |
css-loader |
5.0.1 (2020-11-04) | ^5.0.0 || ^6.0.0 || ^7.0.0 |
esbuild |
0.8.28 (2020-12-31) | >=0.8.0 (never had v1) |
eslint |
7.16.0 (2020-12-18) | ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 |
fork-ts-checker-webpack-plugin |
6.0.8 (2020-12-20) | ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 |
html-webpack-plugin |
4.5.0 (2020-09-21) | ^4.0.0 || ^5.0.0 |
jest |
26.6.3 (2020-11-04) | ^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0 || ^30.0.0 |
node-sass |
5.0.0 (2020-10-31) | ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 |
postcss |
8.2.2 (2020-12-29) | ^8.0.0 |
postcss-clean |
1.1.0 (2017-09-15) | ^1.0.0 |
postcss-loader |
4.1.0 (2020-11-19) | ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 |
postcss-rtl |
1.7.3 (2020-03-11) | ^1.0.0 || ^2.0.0 |
prettier |
2.2.1 (2020-11-28) | ^2.0.0 || ^3.0.0 |
sass |
1.32.0 (2020-12-30) | ^1.0.0 |
sass-loader |
10.1.0 (2020-11-11) | ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 |
style-loader |
2.0.0 (2020-10-09) | ^2.0.0 || ^3.0.0 || ^4.0.0 |
tar-fs |
2.1.1 (2020-11-06) | ^2.0.0 || ^3.0.0 |
tslint |
6.1.3 (2020-07-31) | ^6.0.0 (deprecated) |
tslint-microsoft-contrib |
6.2.0 (2019-05-24) | ^6.0.0 (deprecated) |
typescript |
4.1.3 (2020-12-11) | ^4.0.0 || ^5.0.0 || ^6.0.0 |
webpack |
5.11.1 (2020-12-28) | ^4.0.0 || ^5.0.0 |
webpack-cli |
4.3.1 (2020-12-31) | ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 |
webpack-dev-server |
3.11.1 (2020-12-29) | ^3.0.0 || ^4.0.0 || ^5.0.0 |
71dd6ec to
245cb49
Compare
Add peerDependencies and peerDependenciesMeta to packages/just-scripts/package.json for all packages that are optionally loaded via tryRequire() calls: - @microsoft/api-extractor - @webpack-cli/init - autoprefixer - fork-ts-checker-webpack-plugin - html-webpack-plugin - node-sass - postcss - postcss-clean - postcss-rtl - sass - webpack Add .syncpackrc.json to ignore peer deps in version group checks. Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/e2e2b5e5-58e7-4bd3-af15-4bcdd013a7f4
Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/e2e2b5e5-58e7-4bd3-af15-4bcdd013a7f4
…nvert syncpackrc to JS - Remove webpackCliInitTask and @webpack-cli/init peer dep - Change peer dep version ranges from >=X.0.0 to ^X.0.0 - Use "^4.0.0 || ^5.0.0" for webpack - Convert .syncpackrc.json to .syncpackrc.js for comments - Update API report Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/96f0d11d-bd59-433f-b2d5-5fa1a5ae7585
… 2020-era ranges - Renamed .syncpackrc.js → syncpack.config.js - Added 15 new optional peer deps from resolve() calls: css-loader, esbuild, eslint, jest, @microsoft/loader-load-themed-styles, postcss-loader, prettier, sass-loader, style-loader, tar-fs, tslint, tslint-microsoft-contrib, typescript, webpack-cli, webpack-dev-server - Updated all version ranges to start from the major version current as of 2020 and include all subsequent major versions Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/f75e797b-01f2-4961-abec-869214f33579
Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/08b9028b-3b5d-440d-a530-351080a2b2d2
…nerics Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/08b9028b-3b5d-440d-a530-351080a2b2d2
…, restore jest.mock for tscTask and nodeExecTask Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/2d508d7e-292b-4b3b-bf6c-c3ea4efab44d
Co-authored-by: ecraig12345 <5864305+ecraig12345@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/just/sessions/2d508d7e-292b-4b3b-bf6c-c3ea4efab44d
245cb49 to
0047285
Compare
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.
tryRequire()packages as optional peer deps^major ranges instead of>=.syncpackrc.jsonto JS.syncpackrc.jstosyncpack.config.jsresolve()packages as optional peer depstryRequireto take a generic type parameter<T>tryRequire<typeof import('...')>(...)esModuleInterop: truein root tsconfig.jsonimport * as X from 'cjs'→import X from 'cjs'where neededimport X = require('cjs')→import X from 'cjs'exec.spec.ts- usejest.mockforchild_processwith mock spy onspawnnodeExecTask.test.tsandtscTask.spec.tsto usejest.mock/jest.spyOn📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.