Skip to content

Pnpm#4

Open
EECOLOR wants to merge 4 commits intomainfrom
pnpm
Open

Pnpm#4
EECOLOR wants to merge 4 commits intomainfrom
pnpm

Conversation

@EECOLOR
Copy link
Member

@EECOLOR EECOLOR commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added a new CLI command (kaliber-config) for accessing configuration utilities.
  • Chores

    • Bumped version from 0.0.8 to 0.9.9.
    • Updated package configuration for public distribution.
    • Added ESLint and TypeScript type-checking setup for improved code quality.

✏️ Tip: You can customize this high-level summary in your review settings.

- Switch to pnpm
- Enable eslint
- Add typescript
- Explicit publish config
- Node internal package prefix
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

This PR introduces TypeScript type-checking support via tsconfig.json, adds JSDoc type annotations across test files, refactors the export style in load.js to use named function declarations, fixes logic bugs in test files (incorrect negation operators), and updates package.json with version bump, publishConfig, bin entry, and devDependencies. Configuration files for ESLint and pnpm workspace are also added.

Changes

Cohort / File(s) Summary
Configuration & Tooling Setup
.eslintrc, tsconfig.json, pnpm-workspace.yaml
New ESLint config extending Kaliber settings with specific rule disabling. TypeScript configuration added for strict type checking with checkJs enabled. pnpm workspace configured with peer dependency and hoisting rules.
Package Metadata
package.json
Version bumped from 0.0.8 to 0.9.9. Added module type, publishConfig with public access, files list, bin entry for kaliber-config CLI command, and devDependencies (@kaliber/eslint-plugin, @types/node).
Core Library Files
index.js, load.js, bin/get-config.js
Added internal exit() helper in index.js. Refactored load.js export from inline function to named function declaration with helper utilities and updated require paths. Type cast and JSDoc annotation added to bin/get-config.js.
Test Files - Type Casting
test/{mergeArray,mergeNested,mergeNonObject,mergeSimple,specificEnvironment,specificEnvironmentNested}/index.js, test/index.js
Runtime type casts via /** @type {any} */ added around require statements across multiple test files. No functional behavior changes.
Test Files - Logic Corrections
test/mergePriorityDefault/index.js, test/mergePriorityLocal/index.js, test/simple/index.js
Fixed incorrect negation operators (!c.key === X becomes c.key !== X) and tightened equality operators (loose != to strict !==). Control flow corrected to properly compare values.
Test Files - Minor Updates
test/simple/expect.js
Trailing newline added.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~23 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Pnpm' is overly vague and generic, failing to convey the scope of significant changes including TypeScript setup, ESLint configuration, CommonJS conversion, and publish configuration. Consider a more descriptive title that captures the main objectives, such as 'Add pnpm workspace config, TypeScript support, and ESLint integration' or 'Configure pnpm, TypeScript, ESLint, and publish settings'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@socket-security
Copy link

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​kaliber/​eslint-plugin@​1.0.3691007893100
Added@​types/​node@​22.19.31001008196100

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

2-36: Remove or update unnecessary devDependencies.

@types/node ^22.0.0 is outdated (latest is 25.0.10) and unnecessary—this is a CommonJS project using JSDoc, not TypeScript. Additionally, @kaliber/eslint-plugin appears unused; no eslint configuration exists in the repository. Either remove these dependencies or add the configuration they're meant to support.

🤖 Fix all issues with AI agents
In `@load.js`:
- Around line 84-87: The local variable named "constructor" in function isObject
shadows the global constructor and violates noShadowRestrictedNames; rename it
(e.g., to "ctor" or "cons") by changing const constructor = getConstructor(x) to
const ctor = getConstructor(x) and update the subsequent check (replace uses of
"constructor" with "ctor") so the function isObject and the call to
getConstructor(x) use the new name consistently.

Comment on lines 84 to 87
function isObject(x) {
const constructor = getConstructor(x)
return constructor && constructor instanceof constructor
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid shadowing the global constructor name.
This trips lint (noShadowRestrictedNames) and is easy to fix by renaming the local variable.

🔧 Proposed fix
 function isObject(x) {
-  const constructor = getConstructor(x)
-  return constructor && constructor instanceof constructor
+  const ctor = getConstructor(x)
+  return ctor && ctor instanceof ctor
 }
📝 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.

Suggested change
function isObject(x) {
const constructor = getConstructor(x)
return constructor && constructor instanceof constructor
}
function isObject(x) {
const ctor = getConstructor(x)
return ctor && ctor instanceof ctor
}
🧰 Tools
🪛 Biome (2.1.2)

[error] 85-85: Do not shadow the global "constructor" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🤖 Prompt for AI Agents
In `@load.js` around lines 84 - 87, The local variable named "constructor" in
function isObject shadows the global constructor and violates
noShadowRestrictedNames; rename it (e.g., to "ctor" or "cons") by changing const
constructor = getConstructor(x) to const ctor = getConstructor(x) and update the
subsequent check (replace uses of "constructor" with "ctor") so the function
isObject and the call to getConstructor(x) use the new name consistently.

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.

1 participant