Skip to content

chore: automate library updates - #129

Merged
keito4 merged 2 commits into
mainfrom
chore/library-auto-update
Nov 10, 2025
Merged

chore: automate library updates#129
keito4 merged 2 commits into
mainfrom
chore/library-auto-update

Conversation

@keito4

@keito4 keito4 commented Nov 10, 2025

Copy link
Copy Markdown
Owner

Summary

  • upgrade devDependencies (Jest 30, ESLint 9, Commitlint 20) and refresh Codex/Claude global CLI manifests
  • add reusable script + npm target to run npm-check-updates, rebuild, and sync npm/global.json
  • schedule weekly GitHub Action to run the updater and open a PR when tools change

Testing

  • npm test
  • npm run build

Summary by CodeRabbit

  • New Features

    • Automated weekly library-update workflow that opens PRs with refreshed dependencies.
    • New script to update npm dependencies and refresh global CLI tooling.
  • Documentation

    • Expanded README with library update procedures, tooling integration, setup and CI/CD notes.
  • Chores

    • Upgraded multiple devDependencies and global tooling versions.
    • Migrated ESLint to the newer flat-style configuration and removed the legacy config.

@coderabbitai

coderabbitai Bot commented Nov 10, 2025

Copy link
Copy Markdown

Walkthrough

Removed legacy .eslintrc.js and replaced it with eslint.config.mjs (flat config). Added a weekly GitHub Actions workflow plus script/update-libraries.sh and npm run update:libs. Bumped multiple devDependencies and global CLI tool versions. Expanded README/CLAUDE docs and updated the devcontainer Dockerfile.

Changes

Cohort / File(s) Summary
ESLint Configuration Migration
\.eslintrc.js`, `eslint.config.mjs``
Deleted legacy CommonJS ESLint config (.eslintrc.js); added new flat config (eslint.config.mjs) exporting equivalent settings (ignores, extends, parserOptions, env/globals, and rules) for ESLint 9+.
Automated Library Update Infrastructure
\.github/workflows/update-libraries.yml`, `script/update-libraries.sh`, `package.json``
Added GitHub Actions workflow (weekly + manual) to run npm run update:libs; added shell script to run npm-check-updates, install updates, optionally refresh npm/global.json, and rebuild; added update:libs npm script.
Dependency & Global CLI Updates
\npm/global.json`, `package.json`, .devcontainer/Dockerfile`
Bumped multiple devDependencies (eslint, jest, commitlint, semantic-release, etc.), added globals package, added @openai/codex to global installs and bumped @anthropic-ai/claude-code, corepack, mcp-remote, npm.
Documentation & Agent Setup
\README.md`, `CLAUDE.md``
Expanded README and CLAUDE.md with "Updating Codex & Claude Tooling", update-libraries usage, weekly workflow notes, Claude agent setup, MCP integration, initial setup and validation steps.

Sequence Diagram

sequenceDiagram
    autonumber
    participant Scheduler as GitHub Scheduler
    participant Workflow as Actions Workflow
    participant Runner as Job Runner (Node 20)
    participant Script as update-libraries.sh
    participant npm as npm / npx
    participant GlobalJSON as npm/global.json

    Scheduler->>Workflow: Trigger (weekly or manual)
    Workflow->>Runner: Checkout + setup Node 20 + cache
    Runner->>Script: Run npm run update:libs
    Script->>npm: npm-check-updates (apply, with rejects)
    npm-->>Script: package.json updated
    Script->>npm: npm install
    npm-->>Script: deps installed
    Script->>npm: npm view (latest) for global deps (if npm/global.json)
    npm-->>Script: version info
    Script->>GlobalJSON: Update manifest (if jq + file present)
    Script->>Runner: npm run build
    Runner-->>Workflow: Build complete
    Workflow->>Workflow: create-pull-request (chore/auto-library-update)
    Workflow-->>Scheduler: PR created + labeled, branch auto-delete after merge
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • script/update-libraries.sh: error handling, UPDATE_LIBS_REJECT filtering, npm view parsing, jq fallback behavior
    • eslint.config.mjs: ensure parity with removed .eslintrc.js (env/globals, rules, ignore patterns)
    • .github/workflows/update-libraries.yml: permissions, branch/PR creation settings, caching correctness
    • package/devcontainer changes: verify CLI global versions and compatibility with build/devcontainer expectations

Possibly related PRs

Poem

🐰 I nibble configs late at night,

I swap old rules for shiny light.
I hop, I patch, the libs I tend,
A weekly PR — my gift to send.
Happy tooling, builds take flight!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: automate library updates' accurately and clearly summarizes the main objective of the changeset, which introduces automation for library dependency updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/library-auto-update

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (2)
.github/workflows/update-libraries.yml (1)

1-39: LGTM! Consider adding a changes check.

The workflow is well-structured with appropriate permissions and scheduling. The peter-evans/create-pull-request action handles the no-changes case gracefully (won't create a PR if nothing changed), so the workflow is safe as-is.

Optional enhancement: You could add a step to check for changes and skip PR creation explicitly:

      - name: Check for changes
        id: changes
        run: |
          if git diff --quiet; then
            echo "has_changes=false" >> $GITHUB_OUTPUT
          else
            echo "has_changes=true" >> $GITHUB_OUTPUT
          fi

      - name: Create pull request
        if: steps.changes.outputs.has_changes == 'true'
        uses: peter-evans/create-pull-request@v6

However, this is optional since create-pull-request already handles this scenario.

script/update-libraries.sh (1)

29-45: Consider adding error handling for npm view failures.

The global CLI manifest refresh logic is well-structured, but npm view could fail for network issues or missing packages.

Apply this diff to add error handling:

   while IFS= read -r pkg; do
-    latest_version=$(npm view "$pkg" version)
+    if ! latest_version=$(npm view "$pkg" version 2>&1); then
+      log "Warning: Failed to fetch version for $pkg, skipping"
+      continue
+    fi
     jq --arg pkg "$pkg" --arg version "$latest_version" \
       '.dependencies[$pkg].version = $version' "$tmp_file" >"${tmp_file}.next"
     mv "${tmp_file}.next" "$tmp_file"

This prevents the entire script from failing if a single package lookup fails while preserving the set -e behavior for other critical operations.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 308fa3a and 80561cc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .eslintrc.js (0 hunks)
  • .github/workflows/update-libraries.yml (1 hunks)
  • CLAUDE.md (1 hunks)
  • README.md (3 hunks)
  • eslint.config.mjs (1 hunks)
  • npm/global.json (1 hunks)
  • package.json (1 hunks)
  • script/update-libraries.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • .eslintrc.js
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/claude.yml : Provide Claude Code integration workflow at .github/workflows/claude.yml triggered by claude mentions

Applied to files:

  • CLAUDE.md
  • README.md
  • .github/workflows/update-libraries.yml
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/ci.yml : Maintain CI pipeline at .github/workflows/ci.yml to run linting, formatting, testing, and building

Applied to files:

  • CLAUDE.md
  • README.md
  • .github/workflows/update-libraries.yml
  • script/update-libraries.sh
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/docker-image.yml : Maintain DevContainer image build workflow at .github/workflows/docker-image.yml with semantic versioning and multi-platform support

Applied to files:

  • CLAUDE.md
  • README.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/README.md : Maintain workflow documentation at .github/workflows/README.md

Applied to files:

  • CLAUDE.md
  • README.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/docker-image.yml : Publish DevContainer images to ghcr.io/keito4/config-base via the Docker image workflow

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Enforce static quality gates: automated linting, formatting, security analysis, and license checking

Applied to files:

  • CLAUDE.md
  • README.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .claude/commands/README.md : Document available commands in .claude/commands/README.md

Applied to files:

  • README.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .claude/agents/README.md : Document agents and their usage in .claude/agents/README.md

Applied to files:

  • README.md
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Use semantic releases with automatic GitHub releases and generated release notes

Applied to files:

  • package.json
🪛 LanguageTool
CLAUDE.md

[uncategorized] ~106-~106: The official name of this software platform is spelled with a capital “H”.
Context: ...form support - Library Auto-Update (.github/workflows/update-libraries.yml): Sched...

(GITHUB)

README.md

[uncategorized] ~88-~88: The official name of this software platform is spelled with a capital “H”.
Context: ...r Node.js releases (semantic-release, @semantic-release/github) are excluded by default. Override the...

(GITHUB)


[uncategorized] ~233-~233: The official name of this software platform is spelled with a capital “H”.
Context: ...ent pipeline - Library Auto-Update (.github/workflows/update-libraries.yml): Sched...

(GITHUB)

🔇 Additional comments (11)
CLAUDE.md (1)

106-106: LGTM!

The documentation accurately describes the new Library Auto-Update workflow and its integration.

eslint.config.mjs (1)

1-26: LGTM! Clean migration to ESLint 9 flat config.

The configuration correctly migrates from the legacy .eslintrc.js format to the new flat config format. The structure is clean with:

  • Appropriate global ignores
  • ESLint recommended rules
  • Prettier integration to disable conflicting rules
  • Sensible overrides for JS/JSX files with Node and Jest globals

The globals package import at Line 2 is properly declared as a dependency in package.json (Line 33).

script/update-libraries.sh (3)

1-15: LGTM! Solid initialization and validation.

The script setup is excellent with:

  • Strict error handling (set -euo pipefail)
  • Flexible repository path detection
  • Clear validation of required tools

17-24: LGTM! Smart rejection mechanism.

The configurable rejection list with sensible defaults (excluding packages that require newer Node.js) allows flexibility while maintaining safety.


47-50: LGTM! Ensures changes are validated.

Running the build pipeline (which includes linting and tests) after updates ensures that breaking changes are caught before creating a PR.

package.json (2)

20-20: LGTM! Script addition is clean.

The new update:libs script properly wraps the bash script for convenient execution.


24-37: All major version upgrades are compatible with the current configuration.

Jest 30 has breaking changes including Node support changes, jsdom upgrades, TypeScript 5.4 minimum, and removed alias matchers, but the test file (test/config-validation.test.js) uses only standard matchers (toHaveProperty, toBe, toMatch) with no removed aliases. The CI runs on Node 20 (supported by Jest 30; earlier versions 14, 16, 19, 21 were dropped). No Jest-specific breaking changes impact this codebase.

Commitlint v20's only breaking change is that body-max-line-length now ignores lines containing URLs. The commitlint.config.js extends the conventional config and uses custom rules for subject-case, subject-empty, type-empty, and scope-empty—it does not override body-max-line-length, so no migration needed.

The @semantic-release/github v11 plugin changed internal shape for commit.associatedPRs and relatedIssues label properties and bumped peer dependency for semantic-release. The .releaserc.json uses only public plugin configurations without consuming these internal properties. The top-level semantic-release version (24.2.9) should satisfy v11's peer requirements.

The CI workflow successfully runs linting, formatting, tests, build, and validation on Node 20, confirming all configurations are working as expected.

README.md (3)

25-25: LGTM! Comprehensive script documentation.

The script list accurately reflects all utility scripts including the new update-libraries.sh for automated library updates.


84-90: LGTM! Clear and comprehensive documentation.

The new section excellently documents the library update workflow, including:

  • Command usage (npm run update:libs)
  • What the script does (npm-check-updates, install, build, manifest sync)
  • Default exclusions with override mechanism
  • Weekly automation via GitHub Actions

233-233: LGTM! Workflow properly documented.

The Library Auto-Update workflow is correctly added to the CI/CD pipeline list with an accurate description.

npm/global.json (1)

5-5: All updated package versions are valid and stable.

Verification confirms all four packages exist on npm and are stable releases with proper cryptographic signatures and distribution metadata. No pre-release indicators found.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80561cc and 2d891bd.

📒 Files selected for processing (2)
  • .devcontainer/Dockerfile (1 hunks)
  • npm/global.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • npm/global.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/claude.yml : Provide Claude Code integration workflow at .github/workflows/claude.yml triggered by claude mentions
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/docker-image.yml : Maintain DevContainer image build workflow at .github/workflows/docker-image.yml with semantic versioning and multi-platform support
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/ci.yml : Maintain CI pipeline at .github/workflows/ci.yml to run linting, formatting, testing, and building
📚 Learning: 2025-08-29T14:37:56.575Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-29T14:37:56.575Z
Learning: Applies to .github/workflows/docker-image.yml : Maintain DevContainer image build workflow at .github/workflows/docker-image.yml with semantic versioning and multi-platform support

Applied to files:

  • .devcontainer/Dockerfile

Comment thread .devcontainer/Dockerfile
USER root

RUN npm install -g typescript eslint @anthropic-ai/claude-code@2.0.35 @openai/codex@0.55.0 vercel
RUN npm install -g typescript eslint @anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Pin versions of typescript, eslint, and vercel for reproducible DevContainer builds.

Global npm CLI tools are installed without version constraints for typescript, eslint, and vercel, which means the image will have different tool versions depending on when it's rebuilt. This breaks reproducibility and contradicts the PR's intent to automate and standardize library updates. The PR explicitly upgrades to ESLint 9, but the Dockerfile doesn't pin it.

Pin all three tools to specific versions to ensure consistent image builds. Based on the PR description, at minimum use eslint@9. Verify target versions for typescript and vercel from npm/global.json:

Then update line 46 to match:

-RUN npm install -g typescript eslint @anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel
+RUN npm install -g typescript@<VERSION> eslint@9 @anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel@<VERSION>

🏁 Script executed:

#!/bin/bash
# Description: Verify global CLI tool versions in npm/global.json

# Check if npm/global.json exists and display its content
if [ -f npm/global.json ]; then
  echo "=== npm/global.json ===" 
  cat npm/global.json
else
  echo "npm/global.json not found"
fi

# Also search for any version constraints in package.json or other config files
echo -e "\n=== package.json devDependencies (eslint, typescript) ===" 
rg -A 5 '"devDependencies"' package.json | head -20

Length of output: 870


🏁 Script executed:

#!/bin/bash
# Description: Verify typescript, eslint, and vercel versions in package.json and Dockerfile context

# Get full devDependencies section to find typescript and eslint versions
echo "=== Full package.json devDependencies ===" 
rg -A 100 '"devDependencies"' package.json | grep -E '(typescript|eslint|vercel)' | head -10

# Search for vercel configuration
echo -e "\n=== Vercel configuration ===" 
if [ -f vercel.json ]; then
  echo "vercel.json found:"
  cat vercel.json
else
  echo "vercel.json not found"
fi

# Check .devcontainer/Dockerfile for context/comments around line 46
echo -e "\n=== .devcontainer/Dockerfile context (lines 40-50) ===" 
sed -n '40,50p' .devcontainer/Dockerfile

# Search for any .npmrc or npm configuration that might set default versions
echo -e "\n=== .npmrc or npm configuration ===" 
if [ -f .npmrc ]; then
  cat .npmrc
else
  echo ".npmrc not found"
fi

Length of output: 324


🏁 Script executed:

#!/bin/bash
# Description: Verify typescript, eslint, and vercel versions in package.json and Dockerfile context

# Get full devDependencies section to find typescript and eslint versions
echo "=== Full package.json devDependencies ===" 
rg -A 100 '"devDependencies"' package.json | grep -E '(typescript|eslint|vercel)' | head -10

# Search for vercel configuration
echo -e "\n=== Vercel configuration ===" 
if [ -f vercel.json ]; then
  echo "vercel.json found:"
  cat vercel.json
else
  echo "vercel.json not found"
fi

# Check .devcontainer/Dockerfile for context/comments around line 46
echo -e "\n=== .devcontainer/Dockerfile context (lines 40-50) ===" 
sed -n '40,50p' .devcontainer/Dockerfile

# Search for any .npmrc or npm configuration that might set default versions
echo -e "\n=== .npmrc or npm configuration ===" 
if [ -f .npmrc ]; then
  cat .npmrc
else
  echo ".npmrc not found"
fi

Length of output: 695


🏁 Script executed:

#!/bin/bash
# Description: Find typescript version in package.json

echo "=== Searching for typescript version ===" 
rg -i 'typescript' package.json | head -5

echo -e "\n=== Full devDependencies section ===" 
rg -A 50 '"devDependencies"' package.json | head -60

Length of output: 630


Pin eslint@9.39.1 to match project configuration; verify and pin typescript and vercel versions.

The Dockerfile installs global npm tools without version constraints. The project's package.json pins eslint@9.39.1, but line 46 installs global eslint without a version, creating reproducibility issues and a mismatch with the project's dev environment.

Update line 46 to:

-RUN npm install -g typescript eslint @anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel
+RUN npm install -g typescript@<VERSION> eslint@9.39.1 @anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel@<VERSION>

Replace <VERSION> placeholders for typescript and vercel based on your intended versions (neither is documented in package.json or npm/global.json).

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.devcontainer/Dockerfile around line 46: the Dockerfile installs global npm
packages without versions, causing reproducibility and a mismatch with
package.json; update the RUN to pin eslint to 9.39.1 and also pin specific
versions for typescript and vercel (replace <VERSION> placeholders with the
chosen versions), e.g. install typescript@<VERSION> eslint@9.39.1
@anthropic-ai/claude-code@2.0.36 @openai/codex@0.57.0 vercel@<VERSION>, then
rebuild the image to verify the pinned versions are used.

@keito4
keito4 merged commit 1190dff into main Nov 10, 2025
5 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.1.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant