chore: rename internal variable to main#12033
Merged
Conversation
…111` Renames the internal `lib/index.js` binding from `afinn111` to `main`, matching the canonical stdlib `lib/index.js` shape (~92% conformance across 5028 lib/index.js files; 53/57 conformance within `@stdlib/datasets`). The variable is local to the file and has no observable effect on the public API.
Renames the internal `lib/index.js` binding from `afinn96` to `main`, matching the canonical stdlib `lib/index.js` shape (~92% conformance across 5028 lib/index.js files; 53/57 conformance within `@stdlib/datasets`). The variable is local to the file and has no observable effect on the public API.
…-napoleons-march` Renames the internal `lib/index.js` binding from `minard` to `main`, matching the canonical stdlib `lib/index.js` shape (~92% conformance across 5028 lib/index.js files; 53/57 conformance within `@stdlib/datasets`). The variable is local to the file and has no observable effect on the public API.
…names-en` Renames the internal `lib/index.js` binding from `months` to `main`, matching the canonical stdlib `lib/index.js` shape (~92% conformance across 5028 lib/index.js files; 53/57 conformance within `@stdlib/datasets`). The variable is local to the file and has no observable effect on the public API.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 10, 2026
main in four datasets packagesmain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
lib/index.jsbinding from a per-package name tomainin four@stdlib/datasetspackages, normalizing them to the canonical stdliblib/index.jsshape.Namespace summary
@stdlib/datasets(57 packages, none autogenerated)package.jsonshape (top-level keys, scripts, stdlib),datapackage.jsonshape,README.md##/###heading set and ordering, presence of canonical files (bin/cli,etc/cli_opts.json,test/test.js,test/test.cli.js,test/test.main.js,test/test.browser.js,benchmark/benchmark.js,benchmark/benchmark.browser.js,examples/index.js,docs/types/index.d.ts,docs/types/test.ts,docs/repl.txt,lib/index.js,lib/main.js,lib/browser.js,LICENSE),lib/index.jsredacted code shape.@returnsJSDoc type,@throwsJSDoc type/count,@examplepresence,lib/main.jsrequire(...)set, error-construction style (formatvs concatenation vs template-literal vs plain), validation prologue,lib/index.jsredacted code shape and binding name.package.jsonkey set (57/57), fulldatapackage.jsonkey set (57/57), canonical file presence (57/57 exceptlib/browser.js/benchmark/benchmark.browser.js/test/test.browser.js/test/test.main.jsat 56/57),lib/index.jsredacted code shape with bindingmain(53/57),lib/main.jsredacted code shape (52/57 static-loader form), arity-0 public signature (54/57), single@throws {Error}(55/57),@examplepresence (57/57).@returnstype (content-driven;StringArray,ObjectArray,Buffer,Object,ArrayArray,NumberArray, etc.),lib/main.jsexported function name (content-driven;dataset,stopwords,words,table,names,data, etc.),README.md##ordering (content-driven onReferences/See Also/Notespresence), keyword set beyond the universal four (stdlib,datasets,dataset,data).lib/index.jsbinding name. 53/57 (93%) within@stdlib/datasetsand 4625/5028 (92%) stdlib-wide usevar main = require( './main.js' ); module.exports = main;. Four packages use a per-package binding instead.@stdlib/datasets/afinn-111Renames the internal variable in
lib/index.jsfromafinn111tomain. The change aligns with the convention used in 4625/5028 (92%) oflib/index.jsfiles across the stdlib codebase, including 53/57 (93%) of@stdlib/datasets/*/lib/index.jsfiles. The exported value and public API are unchanged.@stdlib/datasets/afinn-96Renames the internal variable binding in
lib/index.jsfromafinn96tomain. The change aligns with the convention used in 53/57 (93%) of@stdlib/datasets/*/lib/index.jsfiles and 4625/5028 (92%) of stdliblib/index.jsfiles more broadly. The exported value and public API are unchanged.@stdlib/datasets/minard-napoleons-marchRenames the internal variable in
lib/index.jsfromminardtomainto align with the convention used in 93% of@stdlib/datasets/*/lib/index.jsfiles and 92% of stdliblib/index.jsfiles more broadly. The exported value and public API are unchanged.@stdlib/datasets/month-names-enRenames the internal variable in
lib/index.jsfrommonthstomainto match the convention used in 4625/5028 (92%) of stdliblib/index.jsfiles, including 53/57 (93%) of@stdlib/datasets/*/lib/index.jsfiles. The exported value and public API are unchanged.Related Issues
No.
Questions
No.
Other
Validation
@stdlib/datasetsmembers covered the full file tree,package.jsonanddatapackage.jsonkey shapes,README.md##/###heading set and ordering, canonical file presence, andlib/index.js/lib/main.jsredacted code shapes (string and JSDoc redaction; whitespace-collapsed).@param,@returns,@throws,@example),require()set, and error-construction style.bin/clioutsidelib/index.jsreaches into the file's local variable name; a sonnet structural-review agent confirmedvar main = require( './main.js' );is the canonical stdliblib/index.jsshape (sampledmath/base/special/sin,math/base/special/cos,string/replace,array/float64,utils/copy).lib/index.jsfiles use thevar main = require( './main.js' )form, comfortably above the 90% threshold for treating absence as drift.datasets/afinn-111,datasets/afinn-96,datasets/minard-napoleons-march, ordatasets/month-names-enreturned zero hits; recent merged PRs touching@stdlib/datasets(chore: propagate fixes to sibling packages #11892, fix: add missing suffix wrappers #11904) reference vendored data files only.b72a90bca(chore: rename internal variable tomainin twostringpackages).Deliberately excluded
@stdlib/datasets/sotu— the only structural outlier onlib/browser.js,benchmark/benchmark.browser.js,test/test.browser.js, andtest/test.main.js(56/57 each). The deviation is intentional:sotuis a query library (browser_db.js,browser_file_list.js,browser_get_file.js,db.js,file_list.js,get_file.js,index_year.js,index_name.js,index_party.js,union.js,validate.js) with a richer browser surface and per-component tests, not a static data export.@stdlib/datasets/cmudict,@stdlib/datasets/minard-napoleons-march,@stdlib/datasets/sotuoptions-bearing public signatures (arity 1 vs. namespace-majority arity 0). The arity, validation prologue, andformat-based error construction in these three packages reflect documented optionaldata/query semantics, not drift.README.mdheading order,@returnstype,lib/main.jsexported function name, and per-dataset keywords — content-driven. No clear majority above the 75% threshold; excluded from drift analysis.## See Also,repl.txt,<package>.d.ts, generator-owned files) — out of scope per the routine.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running an automated cross-package drift-detection routine: extracting structural and semantic features from every
@stdlib/datasetsmember, computing the per-feature majority pattern at the 75% threshold, validating each surfaced outlier through three independent agents (opus semantic-review, opus cross-reference, sonnet structural-review), and applying only the corrections that survived all three verdicts plus the open-PR collision and ecosystem-presence gates. The fourlib/index.jsrenames are mechanical (2 lines per file, local variable only, no public-API change). A maintainer should audit each site before promoting from draft.Generated by Claude Code