More fast CI and strict package check#207
Conversation
|
WalkthroughThis 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
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
Possibly related PRs
Suggested labels
Poem
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
yarn install v1.22.22 ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Triggered from #207 by @black7375. Checking if we can fast forward Target branch ( 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 PackagesPull request ( 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-buildIt is possible to fast forward |
|
/fast-forward |
|
Triggered from #207 (comment) by @black7375. Trying to fast forward Target branch ( 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 PackagesPull request ( 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-buildFast forwarding $ git push origin 2398d9702fe0c502923753da5fce7c985890b036:main
To https://github.com/mincho-js/mincho.git
ab45cb1..2398d97 2398d9702fe0c502923753da5fce7c985890b036 -> main |
There was a problem hiding this comment.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
packages/css/package.json (1)
85-87: 🛠️ Refactor suggestionTighten peerDependency version
With strict peer dependency enforcement in place, it’s recommended to pin the peerDependency
@vanilla-extract/cssto^1.17.2instead of using"*".
🧹 Nitpick comments (3)
.yarnrc.yml (1)
15-19: Enforce implicittypescriptdependency forprettier-eslint.
ThispackageExtensionsentry ensures thatprettier-eslintalways getstypescriptinstalled. Consider tightening the version range (for example>=5.0.0 <6.0.0instead 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/eslintwill speed up subsequent lint runs. Ensure.cache/eslintis 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?
Movingtypescript,vite, and@supercharge/promise-poolintodependencieswill bloat installs for consumers of this config. If they’re only needed at build time or should remain external, consider relocating them todevDependenciesorpeerDependencies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
.yarn/releases/yarn-4.9.2.cjsis excluded by!**/.yarn/**yarn.lockis 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 bumpsThe updates to
@babel/helper-module-imports,@babel/preset-typescript, and@babel/traverseare in line with patch-level maintenance and look correct.
57-59: Verify compatibility of updated Babel packagesPlease 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 bumpsThe version bumps for
@babel/plugin-syntax-jsxto^7.27.1,@vanilla-extract/integrationto^8.0.2, andesbuildto^0.25.5align with the project's maintenance guidelines.
55-58:Details
✅ Verification successful
Ensure consistent
@vanilla-extract/integrationversioningRun a repo-wide search to confirm every occurrence of
@vanilla-extract/integrationis updated to^8.0.2:
🏁 Script executed:
#!/bin/bash rg '"@vanilla-extract/integration":' -nLength of output: 662
All
@vanilla-extract/integrationversions are consistent
No further action required—every occurrence inpackage.jsonfiles andyarn.lockis already set to^8.0.2.packages/esbuild/package.json (2)
55-57: Approve esbuild plugin and integration bumpsThe upgrades of
@vanilla-extract/esbuild-pluginto^2.3.16,@vanilla-extract/integrationto^8.0.2, andesbuildto^0.25.5are consistent with related packages.
55-57:Details
✅ Verification successful
Verify uniform
esbuildand plugin versionsCheck that both
esbuildand@vanilla-extract/esbuild-pluginare the same across all packages:
🏁 Script executed:
#!/bin/bash rg '"esbuild":' -n rg '"@vanilla-extract/esbuild-plugin":' -nLength of output: 489
Esbuild and
@vanilla-extract/esbuild-pluginversions are consistentVerified that:
esbuildis pinned to^0.25.5in bothpackages/esbuild/package.jsonandpackages/integration/package.json.@vanilla-extract/esbuild-pluginis pinned to^2.3.16in bothpackages/esbuild/package.jsonandexamples/react-swc/package.json.No further action required.
packages/css/package.json (1)
79-79: Approve@vanilla-extract/cssdevDependency bumpDevDependency
@vanilla-extract/csshas been correctly updated to^1.17.2.packages/transform-to-vanilla/package.json (1)
64-64: Approve@vanilla-extract/cssdevDependency bumpDevDependency
@vanilla-extract/csshas 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:pkgsmentioned in the PR objectives..github/actions/node-setup/action.yml (1)
39-39:Details
✅ Verification successful
Verify the new
check:pkgsscript is properly defined.The change from
yarn constraintstoyarn check:pkgsaligns with the PR's goal of implementing stricter package checks. Ensure thecheck:pkgsscript 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:pkgsscript existsThe
check:pkgsscript 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: truefor 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": trueand"checkJs": trueis a good step toward integrating JavaScript files into the TypeScript build. Ensure that yourtsconfig.base.jsonor project references include the appropriateinclude/excludepatterns 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.cjsis committed and accessible in CI; otherwise workflows relying onyarnPathmay fail to resolve the correct binary.packages/vite/package.json (3)
60-60: Align@vanilla-extract/integrationbump.
Updating to^8.0.2keeps 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.1to^22.15.29brings 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.2aligns 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, andtypescript@^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: Replacevite-plugin-dtswithvite-plugin-dts-build.
The new devDependency matches the import change in yourindex.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
.cacheanddistdirectories should significantly improve CI build times by reusing previously built artifacts.
45-46: LGTM! Project reference validation added.This step aligns with the enhanced
syncscript in package.json and ensures workspace project references remain consistent.
52-55: LGTM! Simplified lint workflow.Removing
yarn lint:actionfrom 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:actionconcurrently with the main lint task should improve overall build performance.
24-24: LGTM! Enhanced package validation.The
check:pkgsscript combines peer dependency checks with constraints validation for comprehensive package validation.
24-24: LGTM! Enhanced sync script with local references.Adding
--includesLocalto 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-buildaligns 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", |
There was a problem hiding this comment.
💡 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":' -nLength 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.
| "@types/react": "^19.1.6", | ||
| "@types/react-dom": "^19.1.6", | ||
| "@vanilla-extract/css": "^1.17.2", |
There was a problem hiding this comment.
💡 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:
- Compatibility with the declared React peer dependencies (>=16.8.0)
- 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
doneLength 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/reactand@types/react-domare consistently updated to^19.1.6in react and example packages
Action required:
- In packages/css/package.json and packages/vite/package.json, replace
with
"@vanilla-extract/css": "*"
"@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); |
There was a problem hiding this comment.
💡 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.cjsLength 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:pkgsand 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.
| "check:peers": "yarn explain peer-requirements | grep -q '✘' && exit 1 || exit 0", | ||
| "check:pkgs": "yarn check:peers & yarn constraints", |
There was a problem hiding this comment.
💡 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 -20Length 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.
| "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.
Description
Related Issue
Summary by CodeRabbit
Additional context
Checklist