Repository navigation
chore(config): add ai commit msg config and related files - #69
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR comprehensively migrates the monorepo's build infrastructure and tooling. It establishes a centralized dependency catalog via pnpm workspaces, restructures TypeScript configuration with project references, replaces Husky with Lefthook for git hooks, migrates ESLint to async configuration, consolidates code style settings, converts packages to ES modules, standardizes Node version configuration across CI workflows, and refactors code in multiple packages with improved test coverage and variable naming. ChangesMonorepo Tooling & Infrastructure Overhaul
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request refactors the repository into a monorepo structure, implementing pnpm catalogs for centralized dependency management and transitioning packages to ES modules. It also replaces Husky with Lefthook, adopts a shared ESLint configuration, and reorganizes TypeScript settings using project references. Several issues were identified, including runtime ReferenceErrors in ESM entry points due to legacy require/module checks, a logic bug in the capitalize utility, and multiple versioning typos in the workspace catalog and AI configuration.
| "$schema": "../node_modules/@stephansama/ai-commit-msg/config/schema.json", | ||
| "provider": "ollama", | ||
| "prompt": "Generate a Conventional Commit message based on the diff below. Rules: Follow the Conventional Commits specification (type(scope): subject). Allowed types: feat, fix, chore, docs, refactor, perf, test, build, ci. Subject must be all lowercase. The entire commit message must not exceed 100 characters. Do not include a body. Do not include a footer. Do not include explanations. Output only the commit message. Diff: {{diff}}", | ||
| "model": "qwen3:8b" |
|
|
||
| const readmes = await updateLocalActionReadmes(inputs); | ||
| export function capitalize(word: string) { | ||
| return word.length > 1 ? word.at(0)?.toUpperCase() + word.slice(1) : word; |
| max, | ||
| ); | ||
| const headingLevel = Array.from({ length }, () => "#").join(""); | ||
| const headingLevel = Array.from({ length: length }).fill("#").join(""); |
| export async function getActionsPaths(gitRoot: string) { | ||
| const { stdout } = await sh` | ||
| cd ${gitRoot} | ||
| find . -type f -name 'action.y*ml' |
| "@stephansama/types-github-action-env": 1.0.3 | ||
| "@tsconfig/recommended": 1.0.10 | ||
| "@turbo/gen": 2.5.5 | ||
| "@types/node": 24.1.0 |
| "@types/node": 24.1.0 | ||
| "@vitest/coverage-v8": 3.2.4 | ||
| "@vitest/ui": 3.2.4 | ||
| eslint: 10.3.0 |
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.config/www/.vitepress/theme/index.ts (1)
1-8: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider refactoring instead of disabling linting rules.
The ESLint disable comment suppresses
perfectionist/sort-importsandunicorn/prefer-export-from. Rather than disabling these rules, consider refactoring to comply:♻️ Refactor to comply with linting rules
-/* eslint-disable perfectionist/sort-imports, unicorn/prefer-export-from */ - -import DefaultTheme from "vitepress/theme"; - -import "@catppuccin/vitepress/theme/mocha/red.css"; - -import "./extend.css"; - -export default DefaultTheme; +import "@catppuccin/vitepress/theme/mocha/red.css"; +import "./extend.css"; + +export { default } from "vitepress/theme";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.config/www/.vitepress/theme/index.ts around lines 1 - 8, Remove the top ESLint disable, reorder and refactor imports to satisfy perfectionist/sort-imports and unicorn/prefer-export-from: keep the side-effect CSS imports (import "@catppuccin/vitepress/theme/mocha/red.css"; import "./extend.css";) and replace the DefaultTheme default import + export (the import DefaultTheme from "vitepress/theme"; and export default DefaultTheme;) with a single re-export using export { default } from "vitepress/theme"; so you only have side-effect imports plus the export-from form..config/www/.vitepress/config.ts (1)
3-3:⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy liftAdd TypeDoc output configuration to match the expected import path.
The TypeDoc configuration in
.config/www/typedoc.jsonis missing the"out"directory setting. TypeDoc defaults to generating files in anout/directory, butconfig.ts(line 3) imports from../api/typedoc-sidebar.json. This path mismatch causes VitePress to fail with "Could not resolve" error during build.Add
"out": "api"to.config/www/typedoc.jsonto ensure TypeDoc generates the sidebar file in the location where it's imported. The setup task runs TypeDoc correctly during prebuild, but without this configuration, the output goes to the wrong directory.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.config/www/.vitepress/config.ts at line 3, The TypeDoc output directory is incorrect for the import used in config.ts (the import of typedocSidebar in the VitePress config); open the TypeDoc config file (typedoc.json) and add the output setting "out": "api" so TypeDoc writes its files into the api/ folder that config.ts expects (ensure the config key is a top-level "out": "api" entry so the generated typedoc-sidebar.json lands at ../api/typedoc-sidebar.json).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.config/.aicommitmsgrc.json:
- Line 4: The long string assigned to the JSON key "prompt" should be moved out
of the config and into a dedicated plaintext prompt file (e.g.,
commit_prompt.txt) to improve maintainability; replace the inline value for
"prompt" with a short reference token (e.g., "file:commit_prompt.txt") or update
the config loader to read the external prompt file when the "prompt" key points
to a filename, and ensure the loader falls back to the inline value if a file is
not found.
In @.config/.nanostagedrc.mjs:
- Line 4: Update the JSDoc comment URL that currently points to the lint-staged
docs so it references the nano-staged documentation instead; locate the JSDoc
block (the comment containing "@see
https://www.npmjs.com/package/lint-staged#configuration") and change the URL to
the nano-staged docs URL (replace the lint-staged link with the equivalent
nano-staged documentation link) so the type annotation and referenced docs
match.
- Line 5: The JSDoc line using `@type` {import('nano-staged').Configuration}
references a non-existent export from nano-staged; either remove that `@type`
annotation entirely or define a local typedef named Configuration and then
change the `@type` to {Configuration} so IDEs get correct types; look for the
existing `@type` annotation line and the use of Configuration in .nanostagedrc.mjs
and implement one of these two fixes.
In @.config/lefthook.yaml:
- Around line 1-13: The Lefthook config uses external tools (ai-commit-msg in
prepare-commit-msg, pnpm dlx commitlint in commit-msg, and auto-readme and
nano-staged in pre-commit) but the repo lacks documentation on installing these;
update the README or a new CONTRIBUTING.md to list each required tool
(ai-commit-msg, commitlint, auto-readme, nano-staged), the expected installation
method/command (e.g., npm/pnpm install or pnpm dlx usage), required global vs
dev dependency guidance, any minimum versions, and how to enable/run Lefthook
hooks (referencing prepare-commit-msg, commit-msg, pre-commit and the job names
"Update README" and "Lint staged") so new contributors can set up the
environment reproducibly.
- Line 12: Update the nano-staged invocation in the lefthook run command: locate
the line containing "nano-staged -c ./.nanostagedrc.mjs -v" and change the -c
argument to point to the actual config file location by replacing
"./.nanostagedrc.mjs" with ".config/.nanostagedrc.mjs" so the command becomes
"nano-staged -c .config/.nanostagedrc.mjs -v".
In `@do-not-track-polyfill/tsconfig.json`:
- Line 6: Remove the relative path "./src/environment.d.ts" from the
tsconfig.json compilerOptions.types array and leave only package-style type
names (e.g., "@stephansama/types-github-action-env" or "node"); TypeScript will
pick up src/environment.d.ts via the existing "include": ["src"], so update the
"types" entry in tsconfig.json to exclude environment.d.ts and keep only proper
type package identifiers.
In `@eslint.config.ts`:
- Line 3: The import of package.json in eslint.config.ts is not using the
Node.js 24 JSON import attribute; update the import statement for pkg (the
variable imported from "./package.json") to include the import attribute by
using the "with { type: \"json\" }" form so the JSON module is loaded compatibly
with Node.js 24.
In `@generate-md-action-inputs/package.json`:
- Line 4: The package.json "main" field currently points to the TypeScript
source ("./src/index.ts") which will break at runtime; update the "main" to
point to the compiled output produced by your tsup build (e.g., "dist/index.js"
or the actual file emitted by the tsup config), and optionally add an "exports"
map for Node ESM/CJS resolution; verify the build script in package.json (the
tsup invocation) to confirm the exact output filename/format and use that path
in "main" (and "types" if needed) so consumers load the compiled JS.
In `@multi-deployments/package.json`:
- Line 3: The runtime check using require.main === module is incompatible with
"type":"module"; replace it by either removing the check and calling run()
unconditionally in multi-deployments/src/index.ts or use an ES-module-safe entry
detection like comparing import.meta.url to process.argv[1] (e.g., if
(import.meta.url === `file://${process.argv[1]}`) await run(); — update the line
containing the require.main === module check and the run() invocation
accordingly. Also update the test import in index.test.ts to use the explicit
.js extension for the module import (change the existing import path to include
".js") so it is valid under ES modules.
In `@multi-deployments/src/index.test.ts`:
- Around line 68-70: The test is passing a function to expect() when using the
.resolves matcher; replace the function wrapper with the Promise returned by
module.run() so Vitest receives a Promise — e.g. change expect(async () => await
module.run()).resolves... to await
expect(module.run()).resolves.not.toThrowError(); ensuring you call module.run()
(the Promise) directly and await the outer expect.
In `@multi-deployments/src/index.ts`:
- Line 35: The variable name environments_ is unclear; rename it to a
descriptive identifier such as environmentNames or envNames. Locate the
declaration of environments_ and replace it with the chosen name (e.g.,
environmentNames), update all usages in this module (and any exported references
or downstream imports) to the new name, and run a quick project-wide
search/replace to ensure no lingering references to environments_ remain;
preserve the original value assignment from environments when renaming.
In `@pnpm-workspace.yaml`:
- Around line 5-43: The catalog entries use mixed version ranges causing
inconsistent dependency resolution; standardize versions by pinning critical
packages to exact versions and using carets for non-critical ones: update the
catalog map entries for `@dotenvx/dotenvx`, `@eslint/config-inspector`, lefthook,
typedoc, and vitepress to exact versions (remove the leading ^) while leaving
less-critical entries as caret ranges as desired, and ensure the pattern is
documented in the pnpm-workspace.yaml top-level comment for future contributors.
In `@tsconfig.base.json`:
- Line 8: The tsconfig base's "types" array currently restricts automatic
inclusion of `@types/`* which breaks packages using Node APIs; update the "types"
property in tsconfig.base.json to include "@types/node" (or alternatively set
"skipLibCheck": true) so child packages like generate-md-action-inputs no longer
miss node type defs, and ensure other packages (e.g., do-not-track-polyfill) can
drop their local override once the base config includes "@types/node".
---
Outside diff comments:
In @.config/www/.vitepress/config.ts:
- Line 3: The TypeDoc output directory is incorrect for the import used in
config.ts (the import of typedocSidebar in the VitePress config); open the
TypeDoc config file (typedoc.json) and add the output setting "out": "api" so
TypeDoc writes its files into the api/ folder that config.ts expects (ensure the
config key is a top-level "out": "api" entry so the generated
typedoc-sidebar.json lands at ../api/typedoc-sidebar.json).
In @.config/www/.vitepress/theme/index.ts:
- Around line 1-8: Remove the top ESLint disable, reorder and refactor imports
to satisfy perfectionist/sort-imports and unicorn/prefer-export-from: keep the
side-effect CSS imports (import "@catppuccin/vitepress/theme/mocha/red.css";
import "./extend.css";) and replace the DefaultTheme default import + export
(the import DefaultTheme from "vitepress/theme"; and export default
DefaultTheme;) with a single re-export using export { default } from
"vitepress/theme"; so you only have side-effect imports plus the export-from
form.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6653e702-46b6-4852-8ba5-8055a4ecbe05
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (41)
.config/.aicommitmsgrc.json.config/.nanostagedrc.mjs.config/lefthook.yaml.config/www/.vitepress/config.ts.config/www/.vitepress/theme/index.ts.config/www/package.json.config/www/setup.sh.config/www/tsconfig.json.github/scripts/verify-do-not-track.js.github/workflows/coverage.yml.github/workflows/examples/example-multi-deployments.yml.github/workflows/release.yml.github/workflows/test-do-not-track-polyfill-false.yml.github/workflows/test-do-not-track-polyfill-true.yml.github/workflows/test-multi-deployments.yml.husky/commit-msg.husky/pre-commit.node-version.prettierrcdo-not-track-polyfill/package.jsondo-not-track-polyfill/src/environment.d.tsdo-not-track-polyfill/src/index.test.tsdo-not-track-polyfill/src/index.tsdo-not-track-polyfill/tsconfig.jsoneslint.config.tsgenerate-md-action-inputs/package.jsongenerate-md-action-inputs/src/index.test.tsgenerate-md-action-inputs/src/index.tsgenerate-md-action-inputs/tsconfig.jsonmulti-deployments/package.jsonmulti-deployments/src/index.test.tsmulti-deployments/src/index.tsmulti-deployments/tsconfig.jsonpackage.jsonpnpm-workspace.yamltsconfig.base.jsontsconfig.jsontsconfig.root.jsonturbo/generators/config.tsturbo/generators/template/workflow-test.yml.hbsvitest.config.ts
💤 Files with no reviewable changes (5)
- do-not-track-polyfill/src/environment.d.ts
- .husky/commit-msg
- .config/www/setup.sh
- .husky/pre-commit
- .prettierrc
| { | ||
| "$schema": "../node_modules/@stephansama/ai-commit-msg/config/schema.json", | ||
| "provider": "ollama", | ||
| "prompt": "Generate a Conventional Commit message based on the diff below. Rules: Follow the Conventional Commits specification (type(scope): subject). Allowed types: feat, fix, chore, docs, refactor, perf, test, build, ci. Subject must be all lowercase. The entire commit message must not exceed 100 characters. Do not include a body. Do not include a footer. Do not include explanations. Output only the commit message. Diff: {{diff}}", |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Consider externalizing the prompt to a separate file for maintainability.
The prompt is quite long (>300 characters) and embedded directly in the JSON configuration. Externalizing it to a .prompt or .txt file would improve readability and make it easier to maintain and version control the prompt separately.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.config/.aicommitmsgrc.json at line 4, The long string assigned to the JSON
key "prompt" should be moved out of the config and into a dedicated plaintext
prompt file (e.g., commit_prompt.txt) to improve maintainability; replace the
inline value for "prompt" with a short reference token (e.g.,
"file:commit_prompt.txt") or update the config loader to read the external
prompt file when the "prompt" key points to a filename, and ensure the loader
falls back to the inline value if a file is not found.
| @@ -2,7 +2,7 @@ const jsLike = "{js,cjs,mjs,jsx,ts,mts,cts,tsx,astro,svelte,vue}"; | |||
|
|
|||
| /** | |||
| * @see https://www.npmjs.com/package/lint-staged#configuration | |||
There was a problem hiding this comment.
Update the documentation URL to match the corrected type.
The JSDoc comment references lint-staged documentation, but the type annotation now correctly references nano-staged. Update the URL to point to nano-staged documentation for consistency.
📝 Proposed fix
/**
- * `@see` https://www.npmjs.com/package/lint-staged#configuration
+ * `@see` https://www.npmjs.com/package/nano-staged#configuration
* `@type` {import('nano-staged').Configuration}
*/📝 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.
| * @see https://www.npmjs.com/package/lint-staged#configuration | |
| /** | |
| * `@see` https://www.npmjs.com/package/nano-staged#configuration | |
| * `@type` {import('nano-staged').Configuration} | |
| */ |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.config/.nanostagedrc.mjs at line 4, Update the JSDoc comment URL that
currently points to the lint-staged docs so it references the nano-staged
documentation instead; locate the JSDoc block (the comment containing "@see
https://www.npmjs.com/package/lint-staged#configuration") and change the URL to
the nano-staged docs URL (replace the lint-staged link with the equivalent
nano-staged documentation link) so the type annotation and referenced docs
match.
| /** | ||
| * @see https://www.npmjs.com/package/lint-staged#configuration | ||
| * @type {import('lint-staged').Configuration} | ||
| * @type {import('nano-staged').Configuration} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify that nano-staged exports a Configuration type
# Check if nano-staged has TypeScript definitions
fd --type f "index.d.ts" node_modules/nano-staged --exec cat {} \; | head -50
# Also check package.json for types field
fd --type f "package.json" node_modules/nano-staged --max-depth 1 --exec cat {} \; | jq '.types, .typings, .exports'Repository: stephansama/actions
Length of output: 287
🏁 Script executed:
cat -n .config/.nanostagedrc.mjsRepository: stephansama/actions
Length of output: 571
🏁 Script executed:
# Check if package.json exists and look for nano-staged dependency
if [ -f package.json ]; then
jq '.dependencies, .devDependencies' package.json | grep -A 5 -B 5 "nano-staged"
fiRepository: stephansama/actions
Length of output: 418
🌐 Web query:
nano-staged Configuration type TypeScript exports
💡 Result:
nano-staged supports configuration in multiple formats, including JSON, JavaScript (CommonJS with module.exports, ESM with export default), and detects the module type based on package.json "type" field for.js files. For TypeScript projects, use.nano-staged.js (ESM if "type": "module") or.nano-staged.mjs for ESM exports, or.nano-staged.cjs for CommonJS. Examples: For ESM (.nano-staged.mjs or.nano-staged.js with "type": "module"): export default { '.{js,ts}': 'eslint --fix', '': 'prettier --write' } For CommonJS (.nano-staged.cjs or.nano-staged.js without "type": "module"): module.exports = { '.{js,ts}': 'eslint --fix', '': 'prettier --write' } Config can also be a function: export default (api) => [...commands], where api provides filenames and type (staged/unstaged/diff).[1][2] No official TypeScript type definitions (.d.ts) found in sources or package; config is plain JS/JSON objects.[3][1][2][4]
Citations:
- 1: https://registry.npmjs.org/nano-staged
- 2: https://github.com/usmanyunusov/nano-staged
- 3: Typescript support usmanyunusov/nano-staged#45
- 4: https://github.com/usmanyunusov/nano-staged/blob/master/package.json
Remove the unsupported @type annotation or define a local Configuration type.
The nano-staged package does not export a Configuration type. No TypeScript type definitions exist in the package, so the JSDoc @type {import('nano-staged').Configuration} annotation references a non-existent type. Either remove the type annotation or define a local type that matches your configuration structure for proper IDE type support.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.config/.nanostagedrc.mjs at line 5, The JSDoc line using `@type`
{import('nano-staged').Configuration} references a non-existent export from
nano-staged; either remove that `@type` annotation entirely or define a local
typedef named Configuration and then change the `@type` to {Configuration} so IDEs
get correct types; look for the existing `@type` annotation line and the use of
Configuration in .nanostagedrc.mjs and implement one of these two fixes.
| prepare-commit-msg: | ||
| jobs: | ||
| - run: ai-commit-msg -o {1} | ||
| commit-msg: | ||
| jobs: | ||
| - run: pnpm dlx commitlint --config .config/.commitlintrc.ts --edit {1} | ||
| pre-commit: | ||
| parallel: false | ||
| jobs: | ||
| - run: auto-readme -vg | ||
| name: Update README | ||
| - run: nano-staged -c ./.nanostagedrc.mjs -v | ||
| name: Lint staged |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Document the required tool dependencies for this Lefthook configuration.
The configuration relies on several external tools (ai-commit-msg, auto-readme, nano-staged, commitlint) that must be installed. Consider documenting these dependencies in the project's README or a setup guide to help new contributors set up their environment.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.config/lefthook.yaml around lines 1 - 13, The Lefthook config uses external
tools (ai-commit-msg in prepare-commit-msg, pnpm dlx commitlint in commit-msg,
and auto-readme and nano-staged in pre-commit) but the repo lacks documentation
on installing these; update the README or a new CONTRIBUTING.md to list each
required tool (ai-commit-msg, commitlint, auto-readme, nano-staged), the
expected installation method/command (e.g., npm/pnpm install or pnpm dlx usage),
required global vs dev dependency guidance, any minimum versions, and how to
enable/run Lefthook hooks (referencing prepare-commit-msg, commit-msg,
pre-commit and the job names "Update README" and "Lint staged") so new
contributors can set up the environment reproducibly.
| jobs: | ||
| - run: auto-readme -vg | ||
| name: Update README | ||
| - run: nano-staged -c ./.nanostagedrc.mjs -v |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Locate the .nanostagedrc.mjs file
# Search for .nanostagedrc.mjs in the repository
fd -t f ".nanostagedrc.mjs" --no-ignore
# List files in .config directory
fd -t f . .config --max-depth 1 | grep -i nanoRepository: stephansama/actions
Length of output: 45
🏁 Script executed:
#!/bin/bash
# List all files in .config directory
echo "=== Files in .config directory ==="
fd -t f . .config 2>/dev/null || echo "No .config directory"
echo ""
echo "=== Search for nanostagedrc references ==="
rg "nanostagedrc|nano-staged" --type-list | head -5
rg "nanostagedrc|nano-staged" -i 2>/dev/null | head -20
echo ""
echo "=== Check if .config directory exists ==="
ls -la .config 2>/dev/null || echo ".config directory not found"Repository: stephansama/actions
Length of output: 1527
Fix the path to .nanostagedrc.mjs in the nano-staged command.
The configuration references ./.nanostagedrc.mjs, but the actual file is at .config/.nanostagedrc.mjs. Update line 12 to use the correct path .config/.nanostagedrc.mjs.
Current command
- run: nano-staged -c ./.nanostagedrc.mjs -v🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.config/lefthook.yaml at line 12, Update the nano-staged invocation in the
lefthook run command: locate the line containing "nano-staged -c
./.nanostagedrc.mjs -v" and change the -c argument to point to the actual config
file location by replacing "./.nanostagedrc.mjs" with
".config/.nanostagedrc.mjs" so the command becomes "nano-staged -c
.config/.nanostagedrc.mjs -v".
| } | ||
|
|
||
| export function parseEnvironments(environments: [string, string][]) { | ||
| const environments_ = environments |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Consider renaming environments_ to improve clarity.
The trailing underscore (environments_) is unconventional and typically used to avoid shadowing or reserved keywords. Since there's no naming conflict here, consider a more descriptive name like environmentNames or envNames.
♻️ Suggested refactor
- const environments_ = environments
+ const environmentNames = environments
.map(([environment]) => environment)
.filter(Boolean);
const urls = environments.map(([, url]) => url).filter(Boolean);
- if (environments_.length !== urls.length) {
+ if (environmentNames.length !== urls.length) {
throw new Error("the length of environments do not match the urls");
}
- return { envs: environments_, urls };
+ return { envs: environmentNames, urls };📝 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.
| const environments_ = environments | |
| const environmentNames = environments | |
| .map(([environment]) => environment) | |
| .filter(Boolean); | |
| const urls = environments.map(([, url]) => url).filter(Boolean); | |
| if (environmentNames.length !== urls.length) { | |
| throw new Error("the length of environments do not match the urls"); | |
| } | |
| return { envs: environmentNames, urls }; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@multi-deployments/src/index.ts` at line 35, The variable name environments_
is unclear; rename it to a descriptive identifier such as environmentNames or
envNames. Locate the declaration of environments_ and replace it with the chosen
name (e.g., environmentNames), update all usages in this module (and any
exported references or downstream imports) to the new name, and run a quick
project-wide search/replace to ensure no lingering references to environments_
remain; preserve the original value assignment from environments when renaming.
| catalog: | ||
| "@actions/core": 1.11.1 | ||
| "@actions/github": 6.0.1 | ||
| "@catppuccin/vitepress": ^0.1.2 | ||
| "@commitlint/cli": 19.8.1 | ||
| "@commitlint/config-conventional": 19.8.1 | ||
| "@commitlint/types": 19.8.1 | ||
| "@dotenvx/dotenvx": ^1.48.4 | ||
| "@eslint/config-inspector": ^1.3.0 | ||
| "@eslint/markdown": 7.1.0 | ||
| "@stephansama/ai-commit-msg": ^1.0.6 | ||
| "@stephansama/auto-readme": 0.1.0 | ||
| "@stephansama/eslint-config": 0.2.0 | ||
| "@stephansama/types-github-action-env": 1.0.3 | ||
| "@tsconfig/recommended": 1.0.10 | ||
| "@turbo/gen": 2.5.5 | ||
| "@types/node": 24.1.0 | ||
| "@vitest/coverage-v8": 3.2.4 | ||
| "@vitest/ui": 3.2.4 | ||
| eslint: 10.3.0 | ||
| lefthook: ^2.1.6 | ||
| markdown-table: ^3.0.4 | ||
| nano-staged: 1.0.2 | ||
| node-modules-inspector: ^1.2.0 | ||
| prettier: 3.6.2 | ||
| prettier-plugin-jsdoc: 1.3.3 | ||
| prettier-plugin-organize-imports: 4.2.0 | ||
| prettier-plugin-packagejson: 3.0.0 | ||
| tsup: 8.5.0 | ||
| turbo: 2.5.5 | ||
| typedoc: ^0.28.10 | ||
| typedoc-plugin-markdown: ^4.8.1 | ||
| typedoc-vitepress-theme: ^1.1.2 | ||
| typescript: 5.8.3 | ||
| vitepress: ^1.6.4 | ||
| vitest: 3.2.4 | ||
| wrangler: 4.27.0 | ||
| yaml: ^2.8.0 | ||
| zx: ^8.7.2 |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Inconsistent version pinning strategy in catalog.
The catalog uses a mix of exact versions (e.g., 1.11.1), caret ranges (e.g., ^1.48.4), and tilde ranges (e.g., ~1.0.2). This inconsistency can lead to unpredictable updates and potential breaking changes. Consider standardizing on one approach:
- Exact versions for critical dependencies (TypeScript, ESLint, build tools) to ensure consistency across the monorepo
- Caret ranges for less critical or frequently updated dependencies where minor updates are desired
Current critical dependencies with caret ranges that should be considered for exact pinning:
@dotenvx/dotenvx: ^1.48.4@eslint/config-inspector: ^1.3.0lefthook: ^2.1.6typedoc: ^0.28.10vitepress: ^1.6.4
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pnpm-workspace.yaml` around lines 5 - 43, The catalog entries use mixed
version ranges causing inconsistent dependency resolution; standardize versions
by pinning critical packages to exact versions and using carets for non-critical
ones: update the catalog map entries for `@dotenvx/dotenvx`,
`@eslint/config-inspector`, lefthook, typedoc, and vitepress to exact versions
(remove the leading ^) while leaving less-critical entries as caret ranges as
desired, and ensure the pattern is documented in the pnpm-workspace.yaml
top-level comment for future contributors.
| "module": "preserve", | ||
| "target": "esnext", | ||
| "moduleResolution": "bundler", | ||
| "types": ["@stephansama/types-github-action-env"], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if packages use `@types/`* dependencies that might not be auto-included
echo "=== `@types/`* packages in devDependencies ==="
fd -t f "package.json" -x sh -c 'if [ -f {} ]; then echo "--- {} ---"; jq -r ".devDependencies | keys[]? | select(startswith(\"@types/\"))" {} 2>/dev/null; fi'
echo -e "\n=== Packages extending tsconfig.base.json with custom types ==="
fd -t f "tsconfig.json" -x sh -c 'if rg -q "tsconfig.base.json" {}; then echo "--- {} ---"; jq -r ".compilerOptions.types // empty" {} 2>/dev/null; fi'Repository: stephansama/actions
Length of output: 647
🏁 Script executed:
cat -n tsconfig.base.jsonRepository: stephansama/actions
Length of output: 401
🏁 Script executed:
# Check if packages extending tsconfig.base.json have `@types` in their own package.json
fd -t f "package.json" -x sh -c 'if grep -q "tsconfig.base" "$(dirname {})/tsconfig.json" 2>/dev/null; then echo "--- {} ---"; jq -r ".devDependencies | keys[]? | select(startswith(\"@types/\"))" {} 2>/dev/null; fi' | head -50Repository: stephansama/actions
Length of output: 198
🏁 Script executed:
# Check if any packages have types array in their tsconfig that extends base
fd -t f "tsconfig.json" -x sh -c 'if rg -q "tsconfig.base.json" {}; then echo "File: {}"; jq -r ".compilerOptions" {} 2>/dev/null | head -20; fi'Repository: stephansama/actions
Length of output: 358
🏁 Script executed:
# Check what packages that inherit base config actually import
echo "=== generate-md-action-inputs source ==="
find ./generate-md-action-inputs/src -type f \( -name "*.ts" -o -name "*.js" \) -exec head -30 {} \; 2>/dev/null | grep -E "^import|^require" | head -20
echo -e "\n=== multi-deployments source ==="
find ./multi-deployments/src -type f \( -name "*.ts" -o -name "*.js" \) -exec head -30 {} \; 2>/dev/null | grep -E "^import|^require" | head -20Repository: stephansama/actions
Length of output: 717
🏁 Script executed:
# Check if there are any actual files in these packages
ls -la ./generate-md-action-inputs/src 2>/dev/null || echo "No src dir"
ls -la ./multi-deployments/src 2>/dev/null || echo "No src dir"Repository: stephansama/actions
Length of output: 532
Add @types/node to the types array or use skipLibCheck to prevent missing type definitions.
The restrictive "types": ["@stephansama/types-github-action-env"] configuration prevents automatic inclusion of @types/* packages. Packages like generate-md-action-inputs use Node.js APIs (node:path, node:fs) that require type definitions from @types/node. Without explicitly adding it to the types array, child packages inheriting this config will lack these types. The do-not-track-polyfill package already works around this by overriding with an explicit types array—apply the same pattern to other packages or add @types/node to the base config's types array.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tsconfig.base.json` at line 8, The tsconfig base's "types" array currently
restricts automatic inclusion of `@types/`* which breaks packages using Node APIs;
update the "types" property in tsconfig.base.json to include "@types/node" (or
alternatively set "skipLibCheck": true) so child packages like
generate-md-action-inputs no longer miss node type defs, and ensure other
packages (e.g., do-not-track-polyfill) can drop their local override once the
base config includes "@types/node".
Checklist
mainhave been mergedmain