Skip to content

refactor: centralize env handling and clean up JSDoc - #48

Open
Puppo wants to merge 1 commit into
fastify:mainfrom
Puppo:centralize-env-vars-index
Open

refactor: centralize env handling and clean up JSDoc#48
Puppo wants to merge 1 commit into
fastify:mainfrom
Puppo:centralize-env-vars-index

Conversation

@Puppo

@Puppo Puppo commented Aug 11, 2026

Copy link
Copy Markdown

centralize env handling and clean up JSDoc

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
Puppo force-pushed the centralize-env-vars-index branch from 01a3766 to eb0dc01 Compare August 11, 2026 11:09
@Puppo
Puppo marked this pull request as ready for review August 13, 2026 08:09
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