Skip to content

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

Merged
Eomm merged 1 commit into
fastify:mainfrom
Puppo:centralize-env-vars-index
Aug 22, 2026
Merged

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

Conversation

@Puppo

@Puppo Puppo commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

centralize env handling and clean up JSDoc

@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

@Eomm Eomm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally

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 eb0dc01 to 4dc7615 Compare August 22, 2026 09:38
@Eomm
Eomm merged commit 1223f8f into fastify:main Aug 22, 2026
@Puppo
Puppo deleted the centralize-env-vars-index branch August 22, 2026 10:15
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.

2 participants