-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs: describe CLI HLD #1291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: describe CLI HLD #1291
Conversation
antongolub
commented
Jul 29, 2025
- Tests pass
- Appropriate changes to README are included in PR
There was a problem hiding this 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 adds documentation for the CLI component in the zx library's architecture guide, providing a high-level design overview of how the CLI processes and executes scripts.
- Adds a new CLI section to the architecture documentation
- Documents three key CLI helper functions and their responsibilities
- Includes a structured table describing the main components of the CLI workflow
docs/architecture.md
Outdated
| Consolidates error handling functionality across the zx library: errors codes mapping, formatting, stack parsing. | ||
|
|
||
| ## CLI | ||
| zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, injects global vars) and to install the required deps. Then runs the specified script. |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence has a grammatical error. 'injects' should be 'inject' to maintain parallel structure with 'apply'.
| zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, injects global vars) and to install the required deps. Then runs the specified script. | |
| zx provides CLI with embedded script preprocessor to construct an execution context (apply presets, inject global vars) and to install the required deps. Then runs the specified script. |
docs/architecture.md
Outdated
|
|
||
| | Helper | Description | | ||
| |----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `main()` | Inits a preset from flags, env vars and pushes the reader. | |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Inits' is not a proper word. It should be 'Initializes' for better documentation clarity.
| | `main()` | Inits a preset from flags, env vars and pushes the reader. | | |
| | `main()` | Initializes a preset from flags, env vars and pushes the reader. | |
| | Helper | Description | | ||
| |----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `main()` | Inits a preset from flags, env vars and pushes the reader. | | ||
| | `readScript()` | Fetches, parses and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations | |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comma after 'parses' for proper list formatting. It should be 'Fetches, parses, and transforms'.
| | `readScript()` | Fetches, parses and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations | | |
| | `readScript()` | Fetches, parses, and transforms the specified source into a runnable form. `stdin` reader, `https` loader and `md` transformer act right here. Deps analyzer internally relies on [depseek](https://www.npmjs.com/package/depseek) and inherits its limitations | |