Skip to content

Conversation

@Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Nov 24, 2025

This PR improves static analysis by explicitly importing node:process rather than relying on the global process. Helps provide better type inference for TypeScript and autocomplete and error detection for IntelliSense in VS Code.

Checklist

@Fdawgs Fdawgs requested a review from Copilot November 24, 2025 15:13
Copilot finished reviewing on behalf of Fdawgs November 24, 2025 15:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the codebase to explicitly import from node:process instead of relying on the global process object, improving static analysis, type inference, and IDE autocomplete support.

  • Explicitly imports specific node:process exports (env, stdin, stdout, exit)
  • Replaces all global process usages with the imported named exports
  • Affects authentication, I/O operations, and process control logic

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
github-api.js Imports env and uses it for GitHub token authentication
commands/utils/remove-from-npm.js Imports env for npm spawn environment configuration
commands/utils/input.js Imports stdin and stdout for readline interface
commands/onboard.js Imports exit for process termination
commands/offboard.js Imports exit for process termination

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

function runSpawn (cmd, args) {
return new Promise((resolve, reject) => {
const cli = spawn(cmd, args, { env: process.env })
const cli = spawn(cmd, args, { env })
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The spawn call now passes only the imported env object (which contains environment variables like GITHUB_TOKEN) instead of the full process.env. This changes the behavior - spawn expects the env option to be a complete environment object with all necessary variables (like PATH, HOME, etc.), not just a subset. The spawned npm process will lack critical system environment variables and will likely fail. Change to { env: env } to maintain the original behavior, or import the entire process.env if the intent was to pass all environment variables.

Copilot uses AI. Check for mistakes.
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