Skip to content

refactor: migrate to clibu#16

Merged
kazviz merged 12 commits into
mainfrom
refactor/clibu
Nov 24, 2025
Merged

refactor: migrate to clibu#16
kazviz merged 12 commits into
mainfrom
refactor/clibu

Conversation

@kazviz
Copy link
Copy Markdown
Member

@kazviz kazviz commented Nov 24, 2025

Below is a corrected and concise PR description that reflects the actual changes involving the CLI migration to Clibu and related functionality. Tone remains formal, technical, and aligned with typical PR documentation.


This pull request migrates the Packlet CLI implementation to Clibu, resulting in a lighter, more efficient, and better-structured command-line tool. The refactor simplifies internal logic, reduces overhead, and improves maintainability.

CLI Architecture and Performance

  • Replaces the previous CLI implementation with a Clibu-based architecture, significantly reducing complexity and improving execution efficiency.
  • Streamlines command parsing, option handling, and runtime behavior.

Configuration Enhancements

  • Adds support for resolving configuration from package.json.packlet in addition to standard CLI flags, enabling more flexible and declarative project setup.
  • Introduces a unified configuration resolution flow that merges package.json settings with command-line arguments in a predictable manner.

Collectively, these changes modernize the CLI, improve performance, and provide a more ergonomic configuration experience for Packlet users.

Copilot AI review requested due to automatic review settings November 24, 2025 10:35
Copy link
Copy Markdown
Contributor

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 pull request migrates the Packlet CLI from Commander to Clibu, introduces unified configuration resolution from package.json.packlet, and adds comprehensive environment variable support. The refactor modernizes the CLI architecture, reduces dependencies, and provides a more consistent configuration experience.

Key changes:

  • Replaced Commander with Clibu across all CLI entry points (@packlet/cli, @packlet/gpr)
  • Introduced centralized configuration system in @packlet/core with precedence-based resolution (CLI > env > config > defaults)
  • Added comprehensive test coverage for configuration resolution and argv utilities

Reviewed changes

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

Show a summary per file
File Description
packages/cli/src/index.ts Migrated from Commander to Clibu; integrated new config resolution system
packages/gpr/src/index.ts Migrated from Commander to Clibu; updated command definitions
packages/gpr/src/gpr-cli.ts Adapted to use resolveGprOptions from core config module
packages/gpr/src/prepare-gpr.ts Integrated config resolution for GPR preparation
packages/core/src/config.ts New centralized configuration module with resolution functions
packages/core/src/cli-argv.ts New argv normalization and adaptation utilities for Clibu
packages/core/src/index.ts Exports new config and argv utilities
packages/core/test/config.test.ts Test coverage for configuration resolution precedence
packages/core/test/argv-utils.test.ts Test coverage for argv utilities
packages/cli/package.json Replaced commander with clibu dependency
packages/gpr/package.json Replaced commander with clibu dependency
packages/packlet/package.json Added workspace dev dependencies
package.json Removed commander from root devDependencies; minor script update
packages/packlet/README.md Updated documentation for new configuration model and CLI usage
packages/gpr/README.md Updated to reflect Clibu migration and configuration support
packages/core/README.md Documented new configuration API and precedence rules
packages/cli/README.md Updated CLI documentation
packages/build/README.md Minor documentation improvements
README.md Updated root README with configuration overview

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

Comment thread packages/cli/src/index.ts
Comment on lines +207 to +210
require("node:fs").writeFileSync(
manifestPath,
JSON.stringify(manifest, null, 2)
)
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 code uses require("node:fs") but fs is not imported at the top of the file. Since this is an ES module (indicated by the .mjs extension and ES import syntax), you should import fs at the top:

import fs from "node:fs"

Then use:

fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))

Alternatively, since the file already imports path, you could dynamically import it, but a static import is cleaner and more consistent with the rest of the codebase.

Copilot uses AI. Check for mistakes.
Comment thread packages/core/src/config.ts Outdated
Comment thread packages/cli/README.md Outdated
kazviz and others added 2 commits November 24, 2025 17:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kazviz kazviz enabled auto-merge November 24, 2025 10:47
@kazviz kazviz disabled auto-merge November 24, 2025 10:47
@kazviz kazviz added the enhancement New feature or request label Nov 24, 2025
@kazviz kazviz merged commit c23aa25 into main Nov 24, 2025
6 checks passed
@kazviz kazviz deleted the refactor/clibu branch November 24, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants