-
Notifications
You must be signed in to change notification settings - Fork 1
chore: use pnpm #141
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
chore: use pnpm #141
Conversation
|
WalkthroughThis pull request removes several legacy configuration files and introduces new GitHub Actions workflows and configuration files. The changes update CI/CD processes, shift package management from npm to pnpm, and adjust linting and type-checking settings. Various scripts, source, and test files have been modified to use updated libraries and simplified approaches, while dependency and version configurations have been revised for improved consistency. Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User/PR"
participant GH as "GitHub Actions"
participant Checkout as "Checkout Repo"
participant Setup as "Local Setup Action"
participant Bump as "Bump Version"
participant Build as "Build"
participant Publish as "Publish Preview Release"
User->>GH: Trigger push/pull request
GH->>Checkout: Checkout repository
Checkout->>Setup: Execute setup action
Setup->>Bump: Bump project version
Bump->>Build: Run build process
Build->>Publish: Publish preview release
sequenceDiagram
participant PR as "Pull Request"
participant GH as "GitHub Actions"
participant Checkout as "Checkout Repo"
participant Setup as "Local Setup Action"
participant Test as "Run Tests"
PR->>GH: Trigger pull request event
GH->>Checkout: Checkout repository
Checkout->>Setup: Run setup action
Setup->>Test: Execute tests using pnpm
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
commit: |
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.
Actionable comments posted: 0
🧹 Nitpick comments (4)
.github/actions/setup/action.yml (1)
7-9: PNPM Setup StepThe step uses
pnpm/action-setupwith a specific commit hash, locking it to v4.1.0. While this guarantees stability, consider whether using a tagged release (if available) might allow for easier future updates.biome.json (1)
41-49: JSON Formatting OverrideA new override for
package.jsonand.all-contributorsrchas been added with a strict formatter setting (lineWidth: 1). Confirm that the formatting outcome meets readability requirements and that enforcing such a narrow line width is intentional..github/workflows/release.yml (1)
36-39: Next Package Version Command ComplexityThe command used to extract the next package version is quite complex with nested commands and quoting. Please verify that the quoting (particularly around the usage of single and double quotes with the
jqquery andnpm pkg get version) is correct. Splitting the command into multiple lines or steps could improve readability and maintainability.package.json (1)
65-67: Transition script commands to use pnpm.
The"format","check:biome", and"check"scripts have been updated to invoke pnpm-driven commands (via the"pnpm:..."prefixes). This change is consistent with the PR objective to use pnpm. Please ensure that the helper commandconcis well documented or defined, especially if it’s an alias or a custom utility.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
package-lock.jsonis excluded by!**/package-lock.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yamltests/__snapshots__/fixtures.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (20)
.codesandbox/ci.json(0 hunks).github/actions/setup/action.yml(1 hunks).github/dependabot.yml(0 hunks).github/workflows/dependabot-auto-merge.yml(0 hunks).github/workflows/preview-release.yml(1 hunks).github/workflows/release.yml(2 hunks).github/workflows/test.yml(1 hunks).lintstagedrc.json(1 hunks).node-version(1 hunks).npmrc(1 hunks).nvmrc(0 hunks).simple-git-hooks.json(1 hunks)biome.json(2 hunks)package.json(2 hunks)renovate.json(1 hunks)scripts/add-glob-import-types.ts(2 hunks)src/types.ts(1 hunks)tests/fixtures.spec.ts(1 hunks)tsconfig.base.json(0 hunks)tsconfig.node.json(1 hunks)
💤 Files with no reviewable changes (5)
- .nvmrc
- tsconfig.base.json
- .codesandbox/ci.json
- .github/workflows/dependabot-auto-merge.yml
- .github/dependabot.yml
✅ Files skipped from review due to trivial changes (5)
- .node-version
- renovate.json
- .simple-git-hooks.json
- .npmrc
- src/types.ts
🔇 Additional comments (35)
tests/fixtures.spec.ts (2)
1-1: LGTM! Import statements are well-organized.The changes improve code clarity by:
- Using specific imports instead of namespace imports
- Adding tinyglobby for modern file globbing
- Using relative imports correctly
Also applies to: 4-4, 6-6
10-14: LGTM! File handling is robust and well-configured.The implementation:
- Uses absolute paths for reliability
- Sets explicit UTF-8 encoding
- Properly handles file paths relative to the module
scripts/add-glob-import-types.ts (2)
3-3: LGTM! Consistent use of tinyglobby across the codebase.The change aligns with the project's standardization on tinyglobby for file globbing.
19-19: LGTM! Glob pattern maintains existing functionality.The glob pattern correctly identifies TypeScript and JavaScript index files.
.lintstagedrc.json (1)
3-3: LGTM! Updated to use preferred Biome flag.The change from
--applyto--writealigns with Biome's preferred flag for fixing issues.tsconfig.node.json (1)
8-8: LGTM! Removed npm-specific file from TypeScript includes.The removal of package-lock.json from includes aligns with the switch to pnpm, which uses pnpm-lock.yaml instead.
.github/workflows/test.yml (5)
1-4: Workflow Name and Trigger DefinitionThe workflow name “Test” and triggering on pull_request are correctly defined. This matches the new CI strategy using pnpm.
5-8: Concurrency ConfigurationThe concurrency settings correctly group workflow runs by
${{ github.workflow }}-${{ github.ref }}and cancel any in-progress runs. This optimization minimizes redundant job executions.
9-15: Checkout Step ConsistencyThe checkout step uses a specific commit (via its hash) in the
actions/checkoutstep. Confirm that the fixed commit (v4.2.2) is intentionally locked to this version to maintain stability.
16-18: Setup Action InvocationThe “Setup” step leverages the new local action (
./.github/actions/setup), ensuring a consistent environment setup with pnpm and Node.js.
19-21: Test Step ExecutionRunning tests using
pnpm -s testfulfills the PR objective of migrating to pnpm. The command is straightforward and consistent with other workflows..github/actions/setup/action.yml (4)
1-3: Composite Action MetadataThe action’s name and description are clear. Providing a self-contained environment setup via a composite action enhances maintainability.
4-6: Composite Action StructureThe configuration under
runs: using: compositeproperly encapsulates multiple steps, ensuring a sequential setup process.
10-15: Node.js Setup ConfigurationThe Node.js setup step correctly pulls the version from
.node-versionand enables pnpm caching. This ensures consistency with the project’s Node version requirements and speeds up dependency resolution.
16-19: Dependency InstallationRunning
pnpm iusing the bash shell fits with the overall migration to pnpm. It keeps the dependency installation step simple and aligned with the new configuration..github/workflows/preview-release.yml (7)
1-4: Workflow Trigger and ContextThe workflow “Preview Release” triggers on both push and pull_request events, ensuring preview releases are generated in multiple scenarios. This inclusive trigger is appropriate for testing preview releases.
5-8: Concurrency DefinitionDefining concurrency with a cancellation policy helps manage resource usage effectively and prevent overlapping runs.
9-15: Checkout ConsistencyThe checkout step again uses a fixed commit hash for reproducibility. Consistency with the other workflows is maintained; just double-check that the commit reference remains the intended version.
16-18: Environment Setup via Local ActionReusing the local “Setup” action facilitates consistency across workflows. This reduces duplication of configuration logic.
19-21: Version Bump CommandThe step running
pnpm -s changeset versionis a good move toward using pnpm for version management with changesets. Ensure that this command’s output is parsed correctly in downstream steps.
22-24: Build Step ExecutionCalling
pnpm -s prepublishOnlycorrectly leverages the prepublish script defined in package.json. This keeps the build process streamlined with the project’s new dependency manager.
25-27: Publishing the Preview ReleaseUsing
pnpx pkg-pr-new publish --compactfor publishing preview releases is an interesting approach. Verify that the use ofpnpx(instead ofpnpm) is intentional and that this tool is installed via your dependency chain.biome.json (1)
4-5: Refined Ignore PatternUpdating the ignore pattern to
["./tests/**/fixtures/**/*"]narrows the scope of ignored files to fixtures, which is useful to keep solution files (if any) available for linting/formatting. Ensure that all fixture paths are correctly covered..github/workflows/release.yml (5)
7-9: Expanded Branch TriggerIncluding the branch pattern
channel/*along withmainin the push trigger broadens the release strategy. This change supports multiple release channels and is a good fit for dynamic release management.
27-29: Checkout Step ConsistencyThe checkout step is updated to use the commit hash for v4.2.2, ensuring reliable version retrieval. As mentioned in other workflows, verify that this versioning approach remains consistent across your CI processes.
30-32: Setup Action IntegrationThe inclusion of the local “Setup” action is consistent with the overall strategy and simplifies the release workflow’s environment configuration.
33-35: Test Step in Release WorkflowAdding a “Test” step that runs
pnpm -s testprior to package versioning integrates testing into the release pipeline. This extra safety check should reduce the risk of releasing faulty code.
40-49: Release Publishing ConfigurationThe changesets action is configured with a fixed commit hash (v1.4.9), now using
pnpm -s changeset publishfor the publish command and switching the token to${{ secrets.CHANGESET_TOKEN }}. These adjustments align with the pnpm migration and the new security token setup. Ensure that these tokens and commands are correctly set up in your repository secrets and scripts.package.json (7)
7-9: Clarify the “files” array formatting.
The multi-line array for the"files"field improves clarity and maintainability by explicitly listing the distribution paths.
68-68: Update prebuild command for pnpm.
The"prebuild"script is now usingpnpm -sfor bothcheckandtype-check, aligning it with our new package management approach.
73-73: Revise postbuild script with pnpm commands.
The"postbuild"script now uses pnpm-based calls (includingpnpm:add-glob-import-types, etc.) after TypeScript compilation, which is consistent with the overall transition.
78-81: Refresh publish and dependency bump scripts.
Scripts such as"prepublishOnly","postpublish", and the bumping commands ("bump-biome:latest"/"bump-biome:nightly") have been updated to use pnpm. This update meets our shift to the new package management system.
84-121: Update devDependencies versions.
The versions for several development dependencies (e.g.,@biomejs/biome,@changesets/cli, commitlint packages, various Prettier plugins, etc.) have been updated. These changes improve consistency and likely include bug fixes and performance improvements. Please verify that these version updates are compatible with the rest of the codebase.
124-130: Update dependencies versions.
The dependency versions for packages like@types/estree,dedent,micro-memoize,tiny-jsonc, andtype-festhave been updated. These adjustments enhance overall consistency and ensure compatibility with the new pnpm configuration.
131-138: Introduce pnpm configuration.
A new"packageManager"field and a tailored"pnpm"configuration section have been added. This change locks the repository to a specific pnpm version and specifies the built dependencies, which is an excellent move towards ensuring reproducible builds.
Summary by CodeRabbit
New Features
Chores
Refactor