-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Replace meta updater with workspace-meta #555
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
Conversation
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThis update removes the entire Changes
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
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
🪧 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
Documentation and Community
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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.
|
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: 3
🧹 Nitpick comments (2)
scripts/run-vitest.js (2)
113-116: Prefer usingprocess.execPathinstead of'node'
Usingprocess.execPathensures 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
ThepossibleTestFilesarray 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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 andnode:specifier compatibility
This script uses ESMimportsyntax with thenode:prefix (e.g.,import fs from 'node:fs'). Please confirm your project’spackage.jsonhas"type": "module"and that you target Node.js >=16.8 to avoid runtime import errors.tsconfig.json (1)
6-6: Include.workspace-metadirectory
Adding".workspace-meta/**/*"to theincludearray 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 thedevDependencieslist ensures ESLint’simport-x/no-extraneous-dependenciesrule 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 thateslint.config.jsflat configs are supported..workspace-meta/config.ts (2)
1-5: Validate imports fromworkspace-meta
Ensure the installedworkspace-metapackage exportsdefineWorkspaceMetaConfig,ensurePackageJson, andprettierFormatter. Otherwise, these imports will fail at build or runtime.
7-16: Define workspace-meta configuration correctly
ThedefineWorkspaceMetaConfigcall sets Prettier as the formatter and adds anensurePackageJsonplugin to inject theauthorfield. This cleanly replaces the old.meta-updaterbehavior.
| "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" |
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.
💡 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 .
doneLength 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.
Summary by CodeRabbit
New Features
Chores
.workspace-metadirectory.Refactor
Style
CI