Skip to content

More fast CI and strict package check#207

Merged
github-actions[bot] merged 4 commits intomainfrom
build-system
Jun 6, 2025
Merged

More fast CI and strict package check#207
github-actions[bot] merged 4 commits intomainfrom
build-system

Conversation

@black7375
Copy link
Contributor

@black7375 black7375 commented Jun 6, 2025

Description

  1. Bump packages
  2. Project reference check
  3. Strict peer deps check
  4. Replace vite-plugin-dts
  5. Caching build:type CI

Related Issue

Summary by CodeRabbit

  • New Features
    • Added new scripts for peer dependency checks and enhanced project reference syncing.
    • Enhanced caching and project reference checks in the CI workflow.
  • Bug Fixes
    • Improved spell checker dictionary to recognize additional terms.
  • Chores
    • Upgraded multiple dependencies and devDependencies across packages and examples.
    • Updated Yarn to version 4.9.2 and improved package manager configuration.
    • Improved TypeScript and ESLint configurations for better compatibility and type checking.
    • Enhanced build and lint scripts for improved reliability and performance.

Additional context

Checklist

@changeset-bot
Copy link

changeset-bot bot commented Jun 6, 2025

⚠️ No Changeset found

Latest commit: 2398d97

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 6, 2025

Walkthrough

This update primarily upgrades dependency versions across multiple packages, enhances lint and check scripts, and refines CI workflows. It introduces stricter package consistency checks, improves TypeScript and Vite configuration logic, and updates caching and project reference validation in the CI pipeline. Minor spelling and configuration adjustments are also included.

Changes

Files/Paths Change Summary
.github/actions/node-setup/action.yml Replaces yarn constraints with yarn check:pkgs for strict installs.
.github/workflows/ci.yml Adds extra cache step, project reference check, and simplifies lint step in CI workflow.
.vscode/settings.json Adds "pkgs" to custom spell checker dictionary.
.yarnrc.yml Adds package extension for prettier-eslint requiring typescript; updates Yarn to 4.9.2.
configs/eslint-config-custom/package.json Updates ESLint-related dependencies, adds eslint, prettier, and typescript, removes peerDependencies.
configs/tsconfig-custom/tsconfig.node.json Enables allowJs and checkJs for TypeScript to process and check JS files.
configs/vite-config-custom/index.js Refactors env detection, updates dts plugin logic, simplifies build formats, introduces new cache dirs, and updates internal functions.
configs/vite-config-custom/package.json Switches to vite-plugin-dts-build, adds direct dependencies on typescript and vite, removes peerDependencies.
examples/react-babel/package.json Updates various dependencies and enhances lint script with caching and stricter checks.
examples/react-swc/package.json Updates devDependencies and adds ESLint caching to lint script.
package.json Upgrades Yarn version, enhances lint and sync scripts, adds peer/package check scripts, updates various devDependencies.
packages/babel/package.json Updates Babel-related dependencies to latest patch versions.
packages/css/package.json Updates @vanilla-extract/css devDependency.
packages/esbuild/package.json Updates @vanilla-extract/esbuild-plugin, @vanilla-extract/integration, and esbuild dependencies.
packages/integration/package.json Updates @babel/plugin-syntax-jsx, @vanilla-extract/integration, and esbuild dependencies.
packages/react/package.json Updates React type definitions and adds @vanilla-extract/css as a devDependency.
packages/transform-to-vanilla/package.json Updates @vanilla-extract/css devDependency.
packages/vite/package.json Updates @vanilla-extract/integration, @types/node, and @vanilla-extract/css dependencies.
yarn.config.cjs Enables external peer dependency consistency and simplifies peer dependency presence enforcement.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CI
    participant NodeSetupAction
    participant Yarn

    Developer->>CI: Push code / PR
    CI->>NodeSetupAction: Run setup with strict input
    alt strict == "true"
        NodeSetupAction->>Yarn: yarn check:pkgs
    else
        NodeSetupAction->>Yarn: yarn install
    end
    CI->>Yarn: yarn sync:check
    CI->>Yarn: yarn lint
Loading

Possibly related PRs

Suggested labels

dependencies, config/build

Poem

In the warren where the code does grow,
We check our peers and let the linting flow.
With Yarn now newer, and scripts more spry,
Our carrots (dependencies) reach for the sky!
CI hops along, with caches in tow—
This bunny’s code garden continues to glow.
🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:21874) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
error Couldn't find any versions for "eslint-config-custom" that matches "workspace:^"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Triggered from #207 by @​black7375.

Checking if we can fast forward main (ab45cb1) to build-system (2398d97).

Target branch (main):

commit ab45cb1c3f2ab9f4c31fb8836e9c8c2f2fa036b8 (HEAD -> main, tag: @mincho-js/transform-to-vanilla@0.2.2, tag: @mincho-js/react@0.1.2, tag: @mincho-js/css@0.2.2, origin/main)
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Thu Apr 24 17:10:15 2025 +0000

    Chore: Version Packages

Pull request (build-system):

commit 2398d9702fe0c502923753da5fce7c985890b036 (pull_request/build-system)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Thu May 8 00:00:00 2025 +0900

    Chore: Replace vite-plugin-dts-build

It is possible to fast forward main (ab45cb1) to build-system (2398d97). If you have write access to the target repository, you can add a comment with /fast-forward to fast forward main to build-system.

@black7375
Copy link
Contributor Author

/fast-forward

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Triggered from #207 (comment) by @​black7375.

Trying to fast forward main (ab45cb1) to build-system (2398d97).

Target branch (main):

commit ab45cb1c3f2ab9f4c31fb8836e9c8c2f2fa036b8 (HEAD -> main, tag: @mincho-js/transform-to-vanilla@0.2.2, tag: @mincho-js/react@0.1.2, tag: @mincho-js/css@0.2.2, origin/main)
Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Date:   Thu Apr 24 17:10:15 2025 +0000

    Chore: Version Packages

Pull request (build-system):

commit 2398d9702fe0c502923753da5fce7c985890b036 (pull_request/build-system)
Author: alstjr7375 <alstjr7375@daum.net>
Date:   Thu May 8 00:00:00 2025 +0900

    Chore: Replace vite-plugin-dts-build

Fast forwarding main (ab45cb1) to build-system (2398d97).

$ git push origin 2398d9702fe0c502923753da5fce7c985890b036:main
To https://github.com/mincho-js/mincho.git
   ab45cb1..2398d97  2398d9702fe0c502923753da5fce7c985890b036 -> main

@github-actions github-actions bot merged commit 2398d97 into main Jun 6, 2025
10 checks passed
@github-actions github-actions bot deleted the build-system branch June 6, 2025 12:48
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
packages/css/package.json (1)

85-87: 🛠️ Refactor suggestion

Tighten peerDependency version

With strict peer dependency enforcement in place, it’s recommended to pin the peerDependency @vanilla-extract/css to ^1.17.2 instead of using "*".

🧹 Nitpick comments (3)
.yarnrc.yml (1)

15-19: Enforce implicit typescript dependency for prettier-eslint.
This packageExtensions entry ensures that prettier-eslint always gets typescript installed. Consider tightening the version range (for example >=5.0.0 <6.0.0 instead of *) to guard against potential breaking changes in future TS major releases.

examples/react-swc/package.json (1)

10-10: Enable eslint caching.
Adding --cache --cache-location .cache/eslint will speed up subsequent lint runs. Ensure .cache/eslint is listed in .gitignore (or otherwise excluded) so it doesn’t get checked into the repo.

configs/vite-config-custom/package.json (1)

17-19: Question: Are these runtime dependencies?
Moving typescript, vite, and @supercharge/promise-pool into dependencies will bloat installs for consumers of this config. If they’re only needed at build time or should remain external, consider relocating them to devDependencies or peerDependencies.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab45cb1 and 2398d97.

⛔ Files ignored due to path filters (2)
  • .yarn/releases/yarn-4.9.2.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (19)
  • .github/actions/node-setup/action.yml (1 hunks)
  • .github/workflows/ci.yml (1 hunks)
  • .vscode/settings.json (1 hunks)
  • .yarnrc.yml (1 hunks)
  • configs/eslint-config-custom/package.json (1 hunks)
  • configs/tsconfig-custom/tsconfig.node.json (1 hunks)
  • configs/vite-config-custom/index.js (4 hunks)
  • configs/vite-config-custom/package.json (1 hunks)
  • examples/react-babel/package.json (2 hunks)
  • examples/react-swc/package.json (1 hunks)
  • package.json (3 hunks)
  • packages/babel/package.json (1 hunks)
  • packages/css/package.json (1 hunks)
  • packages/esbuild/package.json (1 hunks)
  • packages/integration/package.json (1 hunks)
  • packages/react/package.json (1 hunks)
  • packages/transform-to-vanilla/package.json (1 hunks)
  • packages/vite/package.json (1 hunks)
  • yarn.config.cjs (1 hunks)
🔇 Additional comments (34)
packages/babel/package.json (2)

57-59: Approve minor Babel dependency bumps

The updates to @babel/helper-module-imports, @babel/preset-typescript, and @babel/traverse are in line with patch-level maintenance and look correct.


57-59: Verify compatibility of updated Babel packages

Please double-check the changelogs for these modules to confirm that no breaking changes were introduced in the bumped versions.

packages/integration/package.json (2)

55-58: Approve integration dependency bumps

The version bumps for @babel/plugin-syntax-jsx to ^7.27.1, @vanilla-extract/integration to ^8.0.2, and esbuild to ^0.25.5 align with the project's maintenance guidelines.


55-58:

Details

✅ Verification successful

Ensure consistent @vanilla-extract/integration versioning

Run a repo-wide search to confirm every occurrence of @vanilla-extract/integration is updated to ^8.0.2:


🏁 Script executed:

#!/bin/bash
rg '"@vanilla-extract/integration":' -n

Length of output: 662


All @vanilla-extract/integration versions are consistent
No further action required—every occurrence in package.json files and yarn.lock is already set to ^8.0.2.

packages/esbuild/package.json (2)

55-57: Approve esbuild plugin and integration bumps

The upgrades of @vanilla-extract/esbuild-plugin to ^2.3.16, @vanilla-extract/integration to ^8.0.2, and esbuild to ^0.25.5 are consistent with related packages.


55-57:

Details

✅ Verification successful

Verify uniform esbuild and plugin versions

Check that both esbuild and @vanilla-extract/esbuild-plugin are the same across all packages:


🏁 Script executed:

#!/bin/bash
rg '"esbuild":' -n
rg '"@vanilla-extract/esbuild-plugin":' -n

Length of output: 489


Esbuild and @vanilla-extract/esbuild-plugin versions are consistent

Verified that:

  • esbuild is pinned to ^0.25.5 in both packages/esbuild/package.json and packages/integration/package.json.
  • @vanilla-extract/esbuild-plugin is pinned to ^2.3.16 in both packages/esbuild/package.json and examples/react-swc/package.json.

No further action required.

packages/css/package.json (1)

79-79: Approve @vanilla-extract/css devDependency bump

DevDependency @vanilla-extract/css has been correctly updated to ^1.17.2.

packages/transform-to-vanilla/package.json (1)

64-64: Approve @vanilla-extract/css devDependency bump

DevDependency @vanilla-extract/css has been correctly updated to ^1.17.2.

.vscode/settings.json (1)

37-37: LGTM! Spell checker dictionary update aligns with new package scripts.

Adding "pkgs" to the spell checker dictionary is appropriate given the introduction of new package-related scripts like check:pkgs mentioned in the PR objectives.

.github/actions/node-setup/action.yml (1)

39-39:

Details

✅ Verification successful

Verify the new check:pkgs script is properly defined.

The change from yarn constraints to yarn check:pkgs aligns with the PR's goal of implementing stricter package checks. Ensure the check:pkgs script is properly defined in the root package.json.


🏁 Script executed:

#!/bin/bash
# Verify that the check:pkgs script exists in the root package.json
cat package.json | jq '.scripts["check:pkgs"]'

Length of output: 86


Confirmed: check:pkgs script exists

The check:pkgs script is defined in your root package.json as:

"check:pkgs": "yarn check:peers & yarn constraints"

No further action is required here.

yarn.config.cjs (1)

21-21: Enhanced peer dependency consistency check.

Enabling peerDependencies: true for external dependencies strengthens package validation, aligning with the PR's stricter package checking goals.

configs/tsconfig-custom/tsconfig.node.json (1)

8-9: Enable JS compilation and type-checking.
Adding "allowJs": true and "checkJs": true is a good step toward integrating JavaScript files into the TypeScript build. Ensure that your tsconfig.base.json or project references include the appropriate include/exclude patterns so you don’t inadvertently pull in untyped JS files that could generate noise.

.yarnrc.yml (1)

24-24: Update Yarn path to v4.9.2.
Make sure .yarn/releases/yarn-4.9.2.cjs is committed and accessible in CI; otherwise workflows relying on yarnPath may fail to resolve the correct binary.

packages/vite/package.json (3)

60-60: Align @vanilla-extract/integration bump.
Updating to ^8.0.2 keeps consistency with related workspaces. Confirm CI caches have been invalidated so the new version is picked up.


64-64: Bump @types/node.
Moving from ^22.14.1 to ^22.15.29 brings in updated Node definitions. Double-check there are no inadvertent type errors introduced by new Node APIs.


65-65: Upgrade @vanilla-extract/css.
Version ^1.17.2 aligns with the integration plugin update. Run your style generation and snapshots to ensure nothing regressed.

examples/react-swc/package.json (1)

18-34: Upgrade ESLint & build tool dependencies.
A broad set of devDependencies (ESLint core, TS plugins, React types, Vanilla Extract, SWC plugin, Vite) has been bumped. Please validate compatibility between @typescript-eslint@8.x, eslint@^9.28.0, and typescript@^5.8.3, and run the example’s build + lint tasks to catch any integration issues early.

configs/vite-config-custom/package.json (1)

12-12: Replace vite-plugin-dts with vite-plugin-dts-build.
The new devDependency matches the import change in your index.js. Verify that the plugin’s configuration options haven’t changed and that declaration outputs (formats, folder structure) remain correct.

.github/workflows/ci.yml (3)

35-43: LGTM! Cache optimization for CI performance.

The addition of caching for .cache and dist directories should significantly improve CI build times by reusing previously built artifacts.


45-46: LGTM! Project reference validation added.

This step aligns with the enhanced sync script in package.json and ensures workspace project references remain consistent.


52-55: LGTM! Simplified lint workflow.

Removing yarn lint:action from the CI workflow makes sense since it's now run concurrently with the main lint command in the root package.json.

examples/react-babel/package.json (2)

10-10: LGTM! Enhanced linting with performance and quality improvements.

The lint script now includes caching, enforces zero warnings, and reports unused disable directives - excellent for maintaining code quality and CI performance.


15-15: LGTM! Coordinated dependency version updates.

The dependency version bumps are consistent with the broader monorepo upgrade effort and include patch/minor versions that should be safe to adopt.

Also applies to: 21-21, 23-23, 26-26, 38-38, 41-42, 44-45, 47-48, 51-51

configs/eslint-config-custom/package.json (1)

20-31: LGTM! Dependency strategy update with version bumps.

The changes shift from peer dependencies to direct dependencies for core tools like ESLint, which should improve installation reliability. The version updates are coordinated with the broader monorepo upgrade.

package.json (5)

5-5: LGTM! Yarn version update.

Upgrading to Yarn 4.9.2 should bring bug fixes and improvements.


16-16: LGTM! Concurrent lint execution for better performance.

Running lint:action concurrently with the main lint task should improve overall build performance.


24-24: LGTM! Enhanced package validation.

The check:pkgs script combines peer dependency checks with constraints validation for comprehensive package validation.


24-24: LGTM! Enhanced sync script with local references.

Adding --includesLocal to the sync script ensures local project references are properly maintained alongside root references.


49-49: LGTM! Coordinated dependency version updates.

The dependency version bumps are part of the broader monorepo upgrade effort and include safe patch/minor version updates.

Also applies to: 51-51, 53-53, 55-56, 59-59, 63-63, 65-65, 67-67, 69-71

configs/vite-config-custom/index.js (5)

11-11: LGTM! Enhanced imports for better typing and updated plugin.

Adding TypeScript imports provides proper typing support, and the switch to vite-plugin-dts-build aligns with the package.json dependency changes.

Also applies to: 14-14


36-37: LGTM! Separate cache directories for ESM and CJS builds.

Creating distinct cache directories for ESM and CJS builds prevents cache conflicts and improves build reliability.


41-80: LGTM! Enhanced environment-aware DTS plugin configuration.

The refactored environment detection and conditional plugin setup provides better control over build behavior across different environments (local, publish, CI). The separate ESM and CJS DTS configurations with appropriate compiler options ensure correct module output.


120-120: LGTM! Simplified and consistent dual format output.

Always including both "es" and "cjs" formats ensures consistent library output regardless of environment.


237-246: LGTM! Improved environment detection with granular control.

The refactored getRuntimeEnv() function provides more granular environment detection (LOCAL, PUBLISH, ACTIONS) compared to the previous boolean approach, enabling better build customization.

"prettier": "prettier-config-custom",
"devDependencies": {
"@vanilla-extract/css": "^1.17.1",
"@vanilla-extract/css": "^1.17.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify uniform @vanilla-extract/css versioning

Ensure all references to @vanilla-extract/css in the monorepo use ^1.17.2:


🏁 Script executed:

#!/bin/bash
rg '"@vanilla-extract/css":' -n

Length of output: 1198


🏁 Script executed:

#!/bin/bash
# List all package.json files referencing @vanilla-extract/css
rg '"@vanilla-extract/css":' -n --glob '*package.json'

Length of output: 621


Update wildcard @vanilla-extract/css versions to ^1.17.2

We still have two package.json entries pinning @vanilla-extract/css to "*" instead of ^1.17.2:

  • packages/vite/package.json (line 74)
  • packages/css/package.json (line 86)

Please replace those "*" entries with:

"@vanilla-extract/css": "^1.17.2"

and then regenerate your lockfile (e.g. run yarn install) to ensure consistency across the monorepo.

🤖 Prompt for AI Agents
In packages/transform-to-vanilla/package.json at line 64, ensure the version of
"@vanilla-extract/css" is set to "^1.17.2" to maintain uniform versioning across
the monorepo. Additionally, check packages/vite/package.json at line 74 and
packages/css/package.json at line 86 for any occurrences of
"@vanilla-extract/css" set to "*" and replace those with "^1.17.2". After
updating these versions, regenerate the lockfile by running "yarn install" to
keep dependencies consistent.

Comment on lines +68 to +70
"@types/react": "^19.1.6",
"@types/react-dom": "^19.1.6",
"@vanilla-extract/css": "^1.17.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify dependency version compatibility and consistency.

The dependency updates look appropriate - minor version bumps for React types and addition of vanilla-extract CSS. Please verify:

  1. Compatibility with the declared React peer dependencies (>=16.8.0)
  2. Consistency with similar updates across other packages in the monorepo

🏁 Script executed:

#!/bin/bash
# Check for consistency of @vanilla-extract/css versions across packages
echo "Checking @vanilla-extract/css versions across packages:"
find packages examples -name "package.json" -exec grep -l "@vanilla-extract/css" {} \; | xargs grep -H "@vanilla-extract/css"

echo -e "\nChecking @types/react versions across packages:"
find packages examples -name "package.json" -exec grep -l "@types/react" {} \; | xargs grep -H "@types/react"

Length of output: 1470


🏁 Script executed:

#!/bin/bash
echo "Checking peerDependencies for react and react-dom across package.json files:"
for file in $(find packages examples -name package.json); do
  echo "File: $file"
  awk '/"peerDependencies"/,/\}/' "$file" | grep -E '"react(-dom)?":' || true
done

Length of output: 2963


Align wildcard @vanilla-extract/css versions to ^1.17.2

Verified that:

  • React peerDependencies remain >=16.8.0 (packages/react/package.json)
  • @types/react and @types/react-dom are consistently updated to ^19.1.6 in react and example packages

Action required:

  • In packages/css/package.json and packages/vite/package.json, replace
    "@vanilla-extract/css": "*"
    with
    "@vanilla-extract/css": "^1.17.2"
🤖 Prompt for AI Agents
In packages/css/package.json and packages/vite/package.json, locate the
dependency entry for "@vanilla-extract/css" currently set to "*". Replace the
version string "*" with the specific version "^1.17.2" to align with the version
used in packages/react/package.json. This ensures version consistency across the
monorepo for the @vanilla-extract/css package.

"eslint",
"prettier"
]);
enforcePeerDependencyPresence(ctx);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Simplified peer dependency enforcement.

Removing the explicit peer dependency list allows Yarn to automatically detect and enforce all peer dependencies. Verify this change maintains the same level of dependency validation.


🏁 Script executed:

#!/bin/bash
# Test the yarn constraints to ensure they still work correctly
echo "Testing yarn constraints..."
yarn constraints

echo -e "\nChecking if check:pkgs script works with new configuration..."
yarn check:pkgs || echo "check:pkgs script may need to be implemented"

Length of output: 1503


🏁 Script executed:

#!/bin/bash
echo "=== Import/Require statements in yarn.config.cjs ==="
rg "require|import" -n yarn.config.cjs || true

echo -e "\n=== Lines 1–30 of yarn.config.cjs ==="
sed -n '1,30p' yarn.config.cjs

echo -e "\n=== Lines 20–60 of yarn.config.cjs ==="
sed -n '20,60p' yarn.config.cjs

Length of output: 1342


🏁 Script executed:

#!/bin/bash
echo "=== Checking for @yarnpkg/types in package.json ==="
rg '"@yarnpkg/types"' -n package.json || echo "Not found"

echo -e "\n=== dependencies ==="
jq '.dependencies' package.json || echo "Failed to parse dependencies"

echo -e "\n=== devDependencies ==="
jq '.devDependencies' package.json || echo "Failed to parse devDependencies"

Length of output: 1218


Ensure @yarnpkg/types is available at runtime and implement check:pkgs

Yarn fails to load your yarn.config.cjs because it can’t resolve the @yarnpkg/types import—even though it’s in devDependencies, the config runs under the CLI before dev-deps are installed. To fix:

• In package.json, move "@yarnpkg/types": "^4.0.1" from devDependencies into dependencies so the CLI can load it.
• Verify yarn-constraints-rules (and any other plugins) remain resolvable at runtime.
• Implement the check:pkgs script (or update your CI checks) if you intend to keep that step.

After these changes, rerun:

yarn constraints
yarn check:pkgs

and confirm that automatic peer-dependency enforcement still behaves as before.

🤖 Prompt for AI Agents
In yarn.config.cjs at line 25, the issue is that the @yarnpkg/types package is
only in devDependencies, causing runtime resolution failures when loading the
config. To fix this, move "@yarnpkg/types" from devDependencies to dependencies
in package.json so it is available at runtime. Also, ensure that
yarn-constraints-rules and any other plugins used remain resolvable during
runtime. Additionally, implement the check:pkgs script or update CI checks
accordingly to maintain validation steps. After these changes, rerun yarn
constraints and yarn check:pkgs to verify peer dependency enforcement works as
expected.

Comment on lines +22 to +23
"check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the reliability of the peer dependency check.

The check:peers script uses grep with exit codes to validate peer dependencies. Ensure this approach reliably detects all peer dependency issues across different environments.


🏁 Script executed:

#!/bin/bash
# Description: Test the check:peers script behavior to ensure it works reliably
# Expected: The script should exit with code 1 when peer dependency issues exist, 0 otherwise

# Check if the yarn explain peer-requirements command exists and what output format it produces
yarn explain peer-requirements --help || echo "Command not available"

# Test the actual command to see its output format
yarn explain peer-requirements | head -20

Length of output: 4315


Improve the peer-dependency check for reliability

The current script in package.json (lines 22–23):

- "check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
+ "check:peers": "yarn explain peer-requirements 2>/dev/null | grep -q '✘' && exit 1 || exit 0",

Issues uncovered:

  • Grep’s early exit can trigger EPIPE errors in Yarn.
  • Unicode “✘” may be replaced by a fallback “X” or localized symbol.
  • Colored/ANSI-wrapped output may prevent a literal match.

Recommendations:

  • Redirect stderr to suppress broken-pipe noise (2>/dev/null).

  • Lock the script to a consistent Yarn version + locale in CI.

  • If your Yarn version supports JSON, consider parsing its output instead:

    - "check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
    + "check:peers": "yarn explain peer-requirements --json \
        | jq -r '.[] | select(.satisfied == false)' \
        && exit 1 || exit 0"

Please update the script in package.json (lines 22–23) to one of these variants and verify that CI fails when any peer is unsatisfied.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
// package.json (scripts section)
"check:peers": "yarn explain peer-requirements 2>/dev/null | grep -q '✘' && exit 1 || exit 0",
"check:pkgs": "yarn check:peers & yarn constraints",
🤖 Prompt for AI Agents
In package.json around lines 22 to 23, the current "check:peers" script uses
grep with a Unicode character to detect peer dependency issues, which can cause
unreliable detection due to EPIPE errors, locale differences, and colored
output. To fix this, modify the script to redirect stderr to /dev/null to
suppress broken-pipe errors, ensure the environment uses a consistent Yarn
version and locale, and if possible, switch to parsing JSON output from "yarn
explain peer-requirements" for more reliable detection. Update the script
accordingly and verify that the CI fails when peer dependencies are unsatisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant