Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented May 31, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new workspace meta configuration to manage formatting and package metadata.
    • Added a new ESLint configuration file that uses the default Node.js ESLint settings.
  • Chores

    • Updated package scripts for improved metadata management.
    • Added and updated several dependencies to support new metadata workflows.
    • Expanded TypeScript project to include workspace meta files.
    • Allowed ESLint dev dependencies in the .workspace-meta directory.
  • Refactor

    • Removed legacy meta-updater files and related configuration to streamline project setup.
  • Style

    • Updated script imports to use explicit Node.js namespace specifiers.
  • CI

    • Added a metadata check step to the lint job in the GitHub Actions workflow.

@linear
Copy link

linear bot commented May 31, 2025

ENG-682 Replace meta updater

The PNPM package has multiple older/insecure dependencies

@changeset-bot
Copy link

changeset-bot bot commented May 31, 2025

⚠️ No Changeset found

Latest commit: 3a3072f

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 May 31, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update removes the entire .meta-updater directory and its related configuration logic, replacing it with a new .workspace-meta system for managing project metadata and configuration. Supporting scripts, dependencies, and TypeScript configurations are updated to align with the new metadata management approach, and a new ESLint configuration file is introduced.

Changes

Files/Groups Change Summary
.meta-updater/* Deleted all files: removed custom logic for updating/generating project metadata and configs.
.workspace-meta/config.ts Added: defines new workspace meta configuration and plugin for author field in package.json.
eslint.config.js Added: re-exports default ESLint config from @halfdomelabs/tools/eslint-node.
package.json Updated: replaced meta-updater scripts with new metadata scripts; updated dependencies.
packages/tools/eslint-configs/typescript.js Updated: added .workspace-meta/**/* to allowed dev dependencies.
scripts/run-vitest.js Updated: changed Node.js core module imports to use node: prefix.
tsconfig.json Updated: included .workspace-meta/**/* in TypeScript compilation.
.github/workflows/lint.yml Updated: added pnpm metadata:check step to lint job.
knip.config.js Updated: changed root workspace entry from .meta-updater/main.mjs to .workspace-meta/config.ts.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WorkspaceMetaConfig
  participant Plugin (ensurePackageJson)
  participant package.json

  User->>WorkspaceMetaConfig: Runs metadata:check/generate/sync script
  WorkspaceMetaConfig->>Plugin (ensurePackageJson): Calls plugin with packageJson
  Plugin (ensurePackageJson)->>package.json: Modifies "author" field
  Plugin (ensurePackageJson)-->>WorkspaceMetaConfig: Returns updated packageJson
  WorkspaceMetaConfig-->>User: Writes updated package.json
Loading
sequenceDiagram
  participant Node
  participant eslint.config.js
  participant @halfdomelabs/tools/eslint-node

  Node->>eslint.config.js: Loads ESLint config
  eslint.config.js->>@halfdomelabs/tools/eslint-node: Imports default config
  eslint.config.js-->>Node: Exports imported config
Loading

🪧 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 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.

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.

@vercel
Copy link

vercel bot commented May 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baseplate-project-builder-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2025 5:09pm

@socket-security
Copy link

socket-security bot commented May 31, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedworkspace-meta@​0.1.2671009988100

View full report

@socket-security
Copy link

socket-security bot commented May 31, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert (click for details)
Warn Medium
[email protected] is an Unpopular package.

Location: Package overview

From: package.jsonnpm/[email protected]

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

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: 3

🧹 Nitpick comments (2)
scripts/run-vitest.js (2)

113-116: Prefer using process.execPath instead of 'node'
Using process.execPath ensures you spawn the same Node.js binary that's executing this script, improving portability across environments:

- const vitestProcess = spawn(
-   'node',
+ const vitestProcess = spawn(
+   process.execPath,

55-62: Consider extending test filename patterns
The possibleTestFiles array currently covers .test.ts[x], .unit.test.ts[x], and .int.test.ts[x]. If your repository also uses conventions like .spec.ts, .e2e.test.ts, etc., add them here to ensure all test files are discovered.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 66ddfc3 and 492b5e9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .meta-updater/eslint.mjs (0 hunks)
  • .meta-updater/gitignore.mjs (0 hunks)
  • .meta-updater/license.mjs (0 hunks)
  • .meta-updater/main.mjs (0 hunks)
  • .meta-updater/package-json.mjs (0 hunks)
  • .meta-updater/prettier.mjs (0 hunks)
  • .meta-updater/utils.mjs (0 hunks)
  • .workspace-meta/config.ts (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (2 hunks)
  • packages/tools/eslint-configs/typescript.js (1 hunks)
  • scripts/run-vitest.js (1 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (7)
  • .meta-updater/license.mjs
  • .meta-updater/utils.mjs
  • .meta-updater/prettier.mjs
  • .meta-updater/eslint.mjs
  • .meta-updater/gitignore.mjs
  • .meta-updater/package-json.mjs
  • .meta-updater/main.mjs
🔇 Additional comments (6)
scripts/run-vitest.js (1)

7-9: Verify ESM and node: specifier compatibility
This script uses ESM import syntax with the node: prefix (e.g., import fs from 'node:fs'). Please confirm your project’s package.json has "type": "module" and that you target Node.js >=16.8 to avoid runtime import errors.

tsconfig.json (1)

6-6: Include .workspace-meta directory
Adding ".workspace-meta/**/*" to the include array ensures that your new workspace-meta config (e.g., config.ts) is picked up by the TypeScript compiler for type checking.

packages/tools/eslint-configs/typescript.js (1)

36-36: Allow dev dependencies in .workspace-meta
Including '.workspace-meta/**/*' in the devDependencies list ensures ESLint’s import-x/no-extraneous-dependencies rule won’t flag imports within your workspace-meta files.

eslint.config.js (1)

1-1: Re-export ESLint flat configuration
This file proxies the flat config from @halfdomelabs/tools/eslint-node. Verify that your ESLint version is >=8.21 so that eslint.config.js flat configs are supported.

.workspace-meta/config.ts (2)

1-5: Validate imports from workspace-meta
Ensure the installed workspace-meta package exports defineWorkspaceMetaConfig, ensurePackageJson, and prettierFormatter. Otherwise, these imports will fail at build or runtime.


7-16: Define workspace-meta configuration correctly
The defineWorkspaceMetaConfig call sets Prettier as the formatter and adds an ensurePackageJson plugin to inject the author field. This cleanly replaces the old .meta-updater behavior.

Comment on lines 54 to 63
"devDependencies": {
"@changesets/changelog-github": "0.5.1",
"@pnpm/meta-updater": "2.0.5",
"@types/node": "catalog:",
"check-dependency-version-consistency": "5.0.0",
"knip": "5.59.0",
"prettier": "catalog:",
"turbo": "2.5.0",
"typescript": "catalog:",
"vitest": "catalog:"
"vitest": "catalog:",
"workspace-meta": "0.1.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

Re-add CLI dependencies to devDependencies & wire up Vitest
After removing the CLI libs from dependencies, re-add them under devDependencies. Also, since vitest is now installed, update or add a script (e.g., test:unit) to execute Vitest, or remove it if unused.

@@ -58,6 +58,14 @@
     "knip": "5.59.0",
     "prettier": "catalog:",
+    "@inquirer/prompts": "7.2.1",
+    "chalk": "5.3.0",
+    "commander": "^12.1.0",
+    "diff": "^7.0.0",
+    "glob": "^11.0.0",
+    "eslint": "catalog:",
+    "yaml": "2.7.0",
     "vitest": "catalog:",
     "workspace-meta": "0.1.2"

🏁 Script executed:

#!/bin/bash
# Inspect package.json for current dependencies, devDependencies, and scripts
python3 - << 'EOF'
import json
with open('package.json') as f:
    data = json.load(f)
print("Dependencies:\n", json.dumps(data.get("dependencies", {}), indent=2))
print("\nDevDependencies:\n", json.dumps(data.get("devDependencies", {}), indent=2))
print("\nScripts:\n", json.dumps(data.get("scripts", {}), indent=2))
EOF

# Search codebase for references to proposed CLI libs
for pkg in "@inquirer/prompts" chalk commander diff glob eslint yaml; do
  echo
  echo "=== Searching for '$pkg' references ==="
  rg --color never "['\"]$pkg['\"]" -n .
done

Length of output: 8848


Move CLI dependencies to devDependencies & add a Vitest script
The following packages are only used for development/CLI tasks—remove them from dependencies and add them under devDependencies to avoid shipping them in production bundles:

  • @inquirer/prompts
  • chalk
  • commander
  • diff
  • glob
  • eslint
  • yaml

Then wire up Vitest by adding a script to run your unit tests. For example:

@@ package.json
-"dependencies": {
-  "@inquirer/prompts": "7.2.1",
-  "chalk": "5.3.0",
-  "commander": "^12.1.0",
-  "diff": "^7.0.0",
-  "glob": "^11.0.0",
-  "eslint": "catalog:",
-  "yaml": "2.7.0",
-  // …
-},
+"devDependencies": {
+  "@inquirer/prompts": "7.2.1",
+  "chalk": "5.3.0",
+  "commander": "^12.1.0",
+  "diff": "^7.0.0",
+  "glob": "^11.0.0",
+  "eslint": "catalog:",
+  "yaml": "2.7.0",
+  // …
+},
"scripts": {
  //
  "test:unit": "vitest"
}

If you won’t be using Vitest, you can alternatively remove the vitest entry.

🤖 Prompt for AI Agents
In package.json lines 54 to 63, move the CLI-related packages
(@inquirer/prompts, chalk, commander, diff, glob, eslint, yaml) from
dependencies to devDependencies to prevent them from being included in
production builds. Then, add a new script entry "test:unit" with the command
"vitest" under the scripts section to enable running unit tests with Vitest. If
Vitest is not intended to be used, remove it from devDependencies instead.

@kingston kingston merged commit edd0429 into main May 31, 2025
9 checks passed
@kingston kingston deleted the kingston/eng-682-replace-meta-updater branch May 31, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants