Skip to content

new cli for project scaffolding#291

Draft
maxnorm wants to merge 14 commits intoPerfect-Abstractions:mainfrom
maxnorm:feat/add-cli
Draft

new cli for project scaffolding#291
maxnorm wants to merge 14 commits intoPerfect-Abstractions:mainfrom
maxnorm:feat/add-cli

Conversation

@maxnorm
Copy link
Collaborator

@maxnorm maxnorm commented Mar 17, 2026

Summary

Introduce the initial @perfect-abstractions/compose-cli package to scaffold diamond-based projects using the Compose library.

Changes Made

  • New CLI package: Added @perfect-abstractions/compose-cli with compose binary entrypoint and npm metadata. (ex: compose init )
  • Core commands: Implemented init, templates, version, and update commands with argument parsing, validation, and helpful console output.
  • Scaffolding engine: Added framework-aware scaffold layer for Foundry and Hardhat, including token replacement, directory checks, and next-step hints.
  • Template system: Introduced config-driven template registry (template.json → generated templates.json) plus default Foundry and multiple Hardhat TS variants.
  • Tooling & DX: Added ESLint config, npm scripts (lint, test, check, build:templates, prepare:lib), .npmignore, .gitignore, and submodule configuration for forge-std and Compose.
  • Tests & docs: Added unit and integration tests for CLI behavior and scaffolding, plus README.md and CHANGELOG.md describing usage, development, and release notes.

Checklist

Before submitting this PR, please ensure:

  • Code follows the Solidity feature ban - No inheritance, constructors, modifiers, public/private variables, external library functions, using for directives, or selfdestruct

  • Code follows Design Principles - Readable, uses diamond storage, favors composition over inheritance

  • Code matches the codebase style - Consistent formatting, documentation, and patterns (e.g. ERC20Facet.sol)

  • Code is formatted with forge fmt

  • Existing tests pass - Run tests to be sure existing tests pass.

  • New tests are optional - If you don't provide tests for new functionality or changes then please create a new issue so this can be assigned to someone.

  • All tests pass - Run forge test and ensure everything works

  • Documentation updated - If applicable, update relevant documentation

Make sure to follow the contributing guidelines.

Additional Notes

  • This PR is scoped to the JavaScript CLI and project templates; Solidity changes are confined to scaffolded example contracts within templates.
  • Template registry (src/config/templates.json) is generated from per-template manifests via npm run build:templates.

@netlify
Copy link

netlify bot commented Mar 17, 2026

👷 Deploy request for compose-diamonds pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 42b3607

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Coverage Report

Coverage

Metric Coverage Details
Lines 78% 1465/1872 lines
Functions 92% 416/454 functions
Branches 73% 156/213 branches

Last updated: Tue, 17 Mar 2026 19:09:06 GMT for commit 42b3607

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

Gas Report

No gas usage changes detected between main and feat/add-cli.

All functions maintain the same gas costs. ✅

Last updated: Tue, 17 Mar 2026 19:09:36 GMT for commit 42b3607

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.

1 participant