Skip to content

Conversation

@antongolub
Copy link
Collaborator

  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub requested a review from Copilot July 23, 2025 12:45
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 core internals by reorganizing imports, reordering variable declarations, and making minor optimizations to the code structure without changing core functionality.

  • Reorganizes import statements in alphabetical order and groups related imports
  • Restructures internal variable declarations and moves functions to improve code organization
  • Makes minor code simplifications in conditional expressions and variable extraction

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/core.ts Reorganizes imports, reorders internal storage declarations, and simplifies conditional logic
build/core.cjs Reflects the same reorganization changes from the TypeScript source in the compiled output
.size-limit.json Updates size limits to reflect minor reductions from the refactoring

const self = this
const $ = self._snapshot
const id = self.id
const cwd = $.cwd ?? $[CWD]
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Extracting cwd into a variable is unnecessary since it's only used once on line 303. This adds an extra variable assignment without providing any performance or readability benefit.

Copilot uses AI. Check for mistakes.
return storage.run({ ...getStore() }, callback)
}

// The zx
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

The comment '// The zx' is incomplete and unclear. It should be expanded to properly describe what the following code section does, such as '// The zx shell interface and proxy implementation'.

Suggested change
// The zx
// The zx shell interface and proxy implementation.
// This proxy handles template strings, manages snapshots of the shell state,
// and interacts with a ProcessPromise to execute shell commands.

Copilot uses AI. Check for mistakes.
@antongolub antongolub added the refactoring Internal code improvements label Jul 23, 2025
@antongolub antongolub merged commit a994e01 into google:main Jul 23, 2025
28 checks passed
@antongolub antongolub deleted the refactor-core-imports branch July 23, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant