Skip to content

refactor: rename internal variable#13167

Merged
kgryte merged 1 commit into
developfrom
philipp/fix-propagation-2026-06-27
Jun 28, 2026
Merged

refactor: rename internal variable#13167
kgryte merged 1 commit into
developfrom
philipp/fix-propagation-2026-06-27

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Propagating fixes merged to develop between 7dc98086 (2026-06-26 13:30 -0500) and 8433af0a (2026-06-27 05:54 -0500) to sibling packages with the same underlying defect.

Pattern: rename ./main.js-bound variable to main in stats/base/dists/* index files

Source commit 4a927afa renamed the local variable bound to require( './main.js' ) from the stat-function name (mean, median, mode) to the conventional main across three stats/base/dists/bernoulli/* lib/index.js files, with the corresponding module.exports update. The identical drift exists in 92 sibling lib/index.js files across stats/base/dists/*. Each is a pure straight-through index module (single require of ./main.js, single export, no conditional builtin/polyfill/native fallback), so the rename is a two-line mechanical edit per file with no semantic impact.

  • 4a927afa (refactor: rename internal variable)
    • @stdlib/stats/base/dists/anglit (mean, median)
    • @stdlib/stats/base/dists/arcsine (mean, median, mode)
    • @stdlib/stats/base/dists/beta (mean, median, mode)
    • @stdlib/stats/base/dists/betaprime (mean, mode)
    • @stdlib/stats/base/dists/binomial (mean, median, mode)
    • @stdlib/stats/base/dists/bradford (entropy, mean, median, mode, stdev, variance)
    • @stdlib/stats/base/dists/cauchy (median, mode)
    • @stdlib/stats/base/dists/chi (mean, mode)
    • @stdlib/stats/base/dists/cosine (mean, median, mode)
    • @stdlib/stats/base/dists/degenerate (mean, median, mode)
    • @stdlib/stats/base/dists/discrete-uniform (mean, median)
    • @stdlib/stats/base/dists/erlang (mean, mode)
    • @stdlib/stats/base/dists/exponential (mean, median, mode)
    • @stdlib/stats/base/dists/f (mean, mode)
    • @stdlib/stats/base/dists/gamma (mean, mode)
    • @stdlib/stats/base/dists/geometric (mean, median, mode)
    • @stdlib/stats/base/dists/gumbel (mean, median, mode)
    • @stdlib/stats/base/dists/halfnormal (mean, mode)
    • @stdlib/stats/base/dists/hypergeometric (mean, mode)
    • @stdlib/stats/base/dists/invgamma (mean, mode)
    • @stdlib/stats/base/dists/kumaraswamy (mean, median, mode)
    • @stdlib/stats/base/dists/laplace (mean, median, mode)
    • @stdlib/stats/base/dists/levy (mean, median, mode)
    • @stdlib/stats/base/dists/logistic (mean, median, mode)
    • @stdlib/stats/base/dists/negative-binomial (mean, mode)
    • @stdlib/stats/base/dists/normal (mean, median, mode)
    • @stdlib/stats/base/dists/pareto-type1 (median)
    • @stdlib/stats/base/dists/planck (mean, median, mode)
    • @stdlib/stats/base/dists/poisson (mean, median, mode)
    • @stdlib/stats/base/dists/rayleigh (mean, median, mode)
    • @stdlib/stats/base/dists/triangular (mean, median, mode)
    • @stdlib/stats/base/dists/uniform (mean, median)
    • @stdlib/stats/base/dists/wald (kurtosis, mean, mode, skewness, variance)
    • @stdlib/stats/base/dists/weibull (mean, median, mode)

Related Issues

None.

Questions

No.

Other

Validation

  • Search scope: scoped to lib/node_modules/@stdlib/stats/base/dists/**/lib/index.js, matching the source commit's namespace. Sibling lib/index.js files outside stats/base/dists were not searched — the variable-name convention is package-local and the source commit's intent is the dists-specific consistency cleanup.
  • Two independent opus validation passes confirmed at every candidate site that (a) the file has exactly one var <varname> = require( './main.js' ); and one matching module.exports = <varname>;, (b) the variable is never referenced elsewhere in the file (no property attachment, no setReadOnly, no third reference), and (c) the file does not also conditionally require ./builtin.js, ./polyfill.js, or ./native.js. All 92 sites returned confirmed from both passes.
  • A sonnet style-consistency pass verified the existing whitespace and parenthesisation in the require and export lines match the source commit's canonical form across a stratified sample of 12 distributions, so the rename will not look out of place.

Deliberately excluded:

  • The f9377d11 @example-block consolidation pattern from string/base/stickycase: searched the sibling string/base/* namespace and found no other lib/index.js with two or more @example blocks sharing the same require line — the source fix was a one-off within scope.
  • The 7dc98086 array- like line-wrap typo, wrong TypeScript example signature, and @returns description fixes: zero remaining occurrences after the source commit (typo fully swept), or single-file scope with no sibling structure.
  • The 8433af0a / 8e0d6442 Makefile guards in tools/make/lib/examples/c.mk and tools/make/lib/benchmark/c.mk: one-off build-script fixes, no sibling Makefile rule with the same skip-when-no-C-files defect.
  • Autogenerated namespace-TOC and related-packages docs from the stdlib-bot commits: generator-owned files.
  • feat: commits adding new APIs: out of scope for this routine.

Checklist

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

This PR was authored by Claude Code on behalf of @Planeshifter as an automated propagation of fixes merged to develop over the prior 24 hours. Candidate source commits were filtered for generalizable patterns, sibling sites located via grep-able pattern signatures, and each proposed patch independently validated by parallel reviewer agents (two opus validation passes plus a sonnet style-consistency pass) before commits were applied in the primary worktree. A human will audit and promote the PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

Propagates rename from 4a927af ("refactor: rename internal variable")
to 92 sibling lib/index.js files under stats/base/dists, aligning the
local variable bound to require('./main.js') with the conventional
'main' naming and updating the corresponding module.exports.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jun 27, 2026
@kgryte kgryte marked this pull request as ready for review June 28, 2026 08:22
@kgryte kgryte requested a review from a team June 28, 2026 08:22
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 28, 2026
@kgryte

kgryte commented Jun 28, 2026

Copy link
Copy Markdown
Member

As the CI failure is not due to changes introduced in this PR, I'll go ahead and merge.

@kgryte kgryte changed the title refactor: rename internal variable across stats/base/dists/* index files refactor: rename internal variable Jun 28, 2026
@kgryte kgryte merged commit ca49ceb into develop Jun 28, 2026
49 of 52 checks passed
@kgryte kgryte deleted the philipp/fix-propagation-2026-06-27 branch June 28, 2026 08:23
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants