Skip to content

Explicitly declare optional peer deps in just-scripts#825

Draft
Copilot wants to merge 3 commits intov3from
copilot/explicitly-declare-optional-peer-deps
Draft

Explicitly declare optional peer deps in just-scripts#825
Copilot wants to merge 3 commits intov3from
copilot/explicitly-declare-optional-peer-deps

Conversation

Copy link

Copilot AI commented Mar 26, 2026

Tasks in just-scripts use tryRequire() to optionally load packages at runtime, but these were never declared as peerDependencies. This makes them invisible to package managers and consumers.

  • packages/just-scripts/package.json — Added all 11 packages found in tryRequire() calls as optional peer dependencies:

    • @microsoft/api-extractor, @webpack-cli/init, autoprefixer, fork-ts-checker-webpack-plugin, html-webpack-plugin, node-sass, postcss, postcss-clean, postcss-rtl, sass, webpack
    "peerDependencies": {
      "sass": ">=1.0.0",
      "webpack": ">=4.0.0"
    },
    "peerDependenciesMeta": {
      "sass": { "optional": true },
      "webpack": { "optional": true }
    }
  • .syncpackrc.json — Configured syncpack to ignore peer deps in version group checks, since peer deps intentionally use broader ranges than devDependencies.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 26, 2026 01:28
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
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
Copilot AI requested a review from ecraig12345 March 26, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants