refactor: centralize env handling and clean up JSDoc - #48
Open
Puppo wants to merge 1 commit into
Open
Conversation
Two phases bundled into one branch:
1. Centralize env handling in index.js
- index.js now reads GITHUB_TOKEN and OC_PERSONAL_TOKEN once, validates
GITHUB_TOKEN, and constructs AdminClient with the resolved values.
- AdminClient holds githubToken + ocPersonalToken on the instance and
reuses them across every REST/GraphQL call; methods no longer take a
token argument.
- removeFromNpm no longer threads process.env to the npm subprocess.
The subprocess inherits the parent's env naturally, so any user-set
auth (NPM_TOKEN, PATH, etc.) flows through unchanged.
- No file below index.js reads process.env.
2. JSDoc cleanup and sharpening
- Collapsed verbose @PARAM deps.x / @PARAM options.x style across all
four commands to a single @PARAM {{ ... }} line each.
- Documented every process.exit(...) call in the command JSDocs so
future module-level callers see the termination behavior.
- Fixed return-type JSDoc on github-api.js: replaced Promise<any> /
bare Promise<object> with named typedefs (Organization, UserInfo,
TeamMembership) and an honest Promise<void> on removeUserFromTeam,
whose REST endpoint returns 204 No Content.
- Added missing @throws where commands propagate client errors.
- Added JSDoc on the private #openCollectiveRequest helper.
Puppo
force-pushed
the
centralize-env-vars-index
branch
from
August 11, 2026 11:09
01a3766 to
eb0dc01
Compare
Puppo
marked this pull request as ready for review
August 13, 2026 08:09
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.
centralize env handling and clean up JSDoc