Skip to content

chore: add missing keywords to utils packages and fix @throws in utils/convert-path - #16329

Open
Planeshifter wants to merge 24 commits into
developfrom
claude/cool-johnson-t5khrn
Open

Planeshifter wants to merge 24 commits into
developfrom
claude/cool-johnson-t5khrn

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds the missing stdutil and utility keywords to 19 @stdlib/utils packages and fixes a JSDoc @throws type in utils/convert-path that does not match the error type actually thrown.

Namespace summary

  • Namespace: @stdlib/utils (198 packages; no autogenerated packages; majority threshold 149/198 = 75%).
  • Features analyzed: file tree, package.json key sets and constant values, keywords, README ##/### section set and order, test//benchmark//examples/ file names, error construction, JSDoc @throws/@example shape, require dependencies.
  • Features with clear majority: file tree (79%), package.json keys (100%), keywords leading block (93–96% per keyword), README Usage/Examples (100%), README section order (100% conform to Usage → Notes → Examples → CLI → See Also), @throws tag/throw-type agreement (96%), @example presence (100%), format for interpolated error messages (99%).
  • Features without clear majority (excluded): public signature, return kind, validation prologue (heterogeneous namespace), README ## Notes presence (70%).

utils/real-max, real-min, safe-int-max, safe-int-min, size-of, type-max, type-min

Missing stdutil from the namespace's leading keyword block (190/198, 96%). Inserted after stdutils. No other changes.

utils/compose, copy, curry, curry-right, decorate-after, function-sequence, memoize, merge, papply, papply-right, uncurry, uncurry-right

Missing utility from the leading keyword block (185/198, 93%). Inserted after utilities. No other changes.

utils/convert-path

JSDoc declared @throws {RangeError} for an unrecognized output path convention, but the implementation throws Error. Tag updated to @throws {Error}; @throws tags match thrown types in 133 of 139 throwing packages (96%), and the remainder are builtin wrappers. Documentation only; runtime behavior and tests (which assert Error) are unchanged.

Related Issues

Does this pull request have any related issues?

None.

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • The 185+ @stdlib/utils packages carrying the canonical leading keyword block (stdlib, stdutils, stdutil, utilities, utility, utils, util).

What carried over from the reference(s)?

  • Keyword names and their position within the leading block.

What differed, or what did you have to work out yourself?

  • None.

Questions

Any questions for reviewers of this pull request?

  • utils/library-manifest lacks the entire utils keyword block and uses tooling-style keywords (tools, manifest, compile, ...) instead. Left untouched pending a decision on whether that framing is intentional.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

Structural features were extracted from the file system for all 198 packages. Semantic features were extracted from lib/main.js, lib/index.js, and lib/validate.js. Each candidate then passed three independent reviews: semantic intent, cross-references to tests, examples, and docs, and structural applicability.

Excluded

  • Constant error strings (e.g., compose, zip, unzip, bifurcate, map2): repo convention reserves format for interpolated messages (~593 plain constant-string throws, zero argument-less format calls), so these are conformant.
  • library-manifest concatenated errors: the package deliberately avoids stdlib dependencies to prevent circular dependencies (see the note in lib/validate.js; previously attempted in refactor: use format to construct errors in utils/library-manifest #13650).
  • Missing benchmark/benchmark.js: map*/reduce* split their benchmarks by input type, async/dsv are namespace packages, inherit is already covered by bench: add benchmark to utils/inherit #15245, and the rest (eval, open-url, parallel, library-manifest) would need new benchmarks written, which is not a mechanical fix.
  • Missing README ## Notes/## See Also: Notes needs authored content, and See Also is populated by tooling.
  • Missing lib/main.js in define-propert(y|ies), property-*, find: these packages use the builtin/polyfill layout.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written by Claude Code, running an automated cross-package drift-detection routine. Features were extracted programmatically, three independent agents validated each candidate, and only behavior-preserving metadata and documentation edits were applied.



Generated by Claude Code

claude added 20 commits October 27, 2026 13:07
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `stdutil` keyword after `stdutils` (present in 190 of 198 `@stdlib/utils` packages, 96%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
Added the `utility` keyword after `utilities` (present in 185 of 198 `@stdlib/utils` packages, 93%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
The implementation throws an `Error`, not a `RangeError`, when provided an unrecognized output path convention. Updated the JSDoc tag to match (`@throws` tags match thrown types in 133 of 139 throwing `@stdlib/utils` packages, 96%; the remainder are builtin wrappers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W
@Planeshifter Planeshifter changed the title chore: add missing stdutil and utility keywords to utils/* packages and fix @throws type in utils/convert-path chore: add missing keywords to utils packages and fix @throws in utils/convert-path Oct 27, 2026
Ports the fix from #16328 to resolve the CI dependency installation failure (`binding.gyp not found` when building `@kaciras/deasync`). No-op once the base branch carries the same change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wWD7ArgTRGJD2J6DitJ2W

Copy link
Copy Markdown
Member Author

Run affected tests and Calculate test coverage for PR packages failed during dependency installation (node-gyp rebuild for @kaciras/deasync: binding.gyp not found), before any test ran. This is not caused by this PR's changes; the same failure hits other open PRs today. Ported the pin from #16328 (@kaciras/deasync → 1.0.4) in 3a4c36c; it becomes a no-op once #16328 lands on develop.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

With the @kaciras/deasync pin in place, Run affected tests now installs and runs. Every utils test passes. The one failure is _tools/benchmarks/bundle/test/test.cli.js ("the command-line interface supports providing a custom glob pattern" → should throw an error). It is pulled into the affected set because _tools/benchmarks/bundle depends on utils/copy.

The failure is not caused by this PR's changes. The test builds its command as cmd.join( ' ' ) with an unquoted --pattern *.js and passes it to exec, so the shell expands the glob against the repository root. Since eslint.flat.config.js was added there in #10967 (2026-08-21), the CLI receives --pattern eslint.flat.config.js. That matches nothing in test/fixtures/main, so the bundle never includes the fixture that throws BEEP. The test fails deterministically whenever it runs, on develop as well; a re-run would not change the result.

I found no existing fix. Proposed patch (test only, kept out of this PR's scope):

--- a/lib/node_modules/@stdlib/_tools/benchmarks/bundle/test/test.cli.js
+++ b/lib/node_modules/@stdlib/_tools/benchmarks/bundle/test/test.cli.js
@@ tape( 'the command-line interface supports providing a custom glob pattern', ...
 		join( __dirname, 'fixtures', 'main' ),
 		'--pattern',
-		'*.js'
+		'"*.js"'
 	];

Generated by Claude Code

@Planeshifter Planeshifter mentioned this pull request Oct 27, 2026
4 of 7 tasks
@stdlib-bot stdlib-bot added the Merge Conflicts Pull request which has merge conflicts. label Oct 29, 2026
@kgryte
kgryte marked this pull request as ready for review October 29, 2026 11:32
@kgryte
kgryte requested a review from a team October 29, 2026 11:32
@kgryte kgryte removed the Merge Conflicts Pull request which has merge conflicts. label Oct 29, 2026
@stdlib-bot

stdlib-bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/compose $\\color{green}151/151$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}151/151$
$\\color{green}+100.00\\%$
utils/convert-path $\\color{green}173/173$
$\\color{green}+100.00\\%$
$\\color{green}25/25$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}173/173$
$\\color{green}+100.00\\%$
utils/copy $\\color{green}607/607$
$\\color{green}+100.00\\%$
$\\color{green}100/100$
$\\color{green}+100.00\\%$
$\\color{green}14/14$
$\\color{green}+100.00\\%$
$\\color{green}607/607$
$\\color{green}+100.00\\%$
utils/curry $\\color{green}156/156$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}156/156$
$\\color{green}+100.00\\%$
utils/curry-right $\\color{green}156/156$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}156/156$
$\\color{green}+100.00\\%$
utils/decorate-after $\\color{red}718/722$
$\\color{green}+99.45\\%$
$\\color{red}51/52$
$\\color{green}+98.08\\%$
$\\color{green}14/14$
$\\color{green}+100.00\\%$
$\\color{red}718/722$
$\\color{green}+99.45\\%$
utils/function-sequence $\\color{green}151/151$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}151/151$
$\\color{green}+100.00\\%$
utils/memoize $\\color{green}162/162$
$\\color{green}+100.00\\%$
$\\color{green}13/13$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}162/162$
$\\color{green}+100.00\\%$
utils/merge $\\color{green}550/550$
$\\color{green}+100.00\\%$
$\\color{green}63/63$
$\\color{green}+100.00\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{green}550/550$
$\\color{green}+100.00\\%$
utils/papply $\\color{green}126/126$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}126/126$
$\\color{green}+100.00\\%$
utils/papply-right $\\color{green}140/140$
$\\color{green}+100.00\\%$
$\\color{green}11/11$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}140/140$
$\\color{green}+100.00\\%$
utils/real-max $\\color{green}112/112$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}112/112$
$\\color{green}+100.00\\%$
utils/real-min $\\color{green}112/112$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}112/112$
$\\color{green}+100.00\\%$
utils/safe-int-max $\\color{green}112/112$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}112/112$
$\\color{green}+100.00\\%$
utils/safe-int-min $\\color{green}112/112$
$\\color{green}+100.00\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}112/112$
$\\color{green}+100.00\\%$
utils/size-of $\\color{green}138/138$
$\\color{green}+100.00\\%$
$\\color{green}16/16$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}138/138$
$\\color{green}+100.00\\%$
utils/type-max $\\color{green}134/134$
$\\color{green}+100.00\\%$
$\\color{green}14/14$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}134/134$
$\\color{green}+100.00\\%$
utils/type-min $\\color{green}131/131$
$\\color{green}+100.00\\%$
$\\color{green}14/14$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}131/131$
$\\color{green}+100.00\\%$
utils/uncurry $\\color{green}167/167$
$\\color{green}+100.00\\%$
$\\color{green}26/26$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}167/167$
$\\color{green}+100.00\\%$
utils/uncurry-right $\\color{green}167/167$
$\\color{green}+100.00\\%$
$\\color{green}26/26$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}167/167$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 29, 2026

This branch has not been deployed

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

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants