Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: CLI

on:
push:
branches: [main]
paths:
- 'cli/**'
- '.github/workflows/cli.yml'
tags:
- 'v*'
pull_request:
paths:
- 'cli/**'
- '.github/workflows/cli.yml'
workflow_dispatch:

jobs:
lint-and-unit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm
cache-dependency-path: cli/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build templates registry
run: npm run build:templates

- name: Lint
run: npm run lint

- name: Run unit tests
run: npm run test:unit

integration:
runs-on: ubuntu-latest
needs: lint-and-unit
defaults:
run:
working-directory: cli

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm
cache-dependency-path: cli/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build templates registry
run: npm run build:templates

- name: Run integration tests
run: npm run test:integration

template-smoke-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x, 24.x]
needs: lint-and-unit
env:
FOUNDRY_PROFILE: ci
defaults:
run:
working-directory: cli

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: cli/package-lock.json

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: npm ci

- name: Prepare libraries
run: npm run prepare:lib

- name: Build templates registry
run: npm run build:templates

- name: Smoke test Foundry default template
run: |
set -euo pipefail
rm -rf ci-foundry
node index.js init \
--name ci-foundry \
--template default \
--framework foundry \
--yes
cd ci-foundry
forge build

# TODO: Remove once @perfect-abstractions/compose is published to npm
# Currently, this make the Ci fail when trying to install the dependency.
# - name: Smoke test Hardhat default TypeScript template
# run: |
# set -euo pipefail
# rm -rf ci-hardhat
# node index.js init \
# --name ci-hardhat \
# --template default \
# --framework hardhat \
# --language typescript \
# --no-install-deps \
# --yes
# cd ci-hardhat
# npm install
# npm test

pack-verify:
runs-on: ubuntu-latest
needs:
- lint-and-unit
- integration
- template-smoke-tests
defaults:
run:
working-directory: cli

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24.x
cache: npm
cache-dependency-path: cli/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build templates registry
run: npm run build:templates

- name: Verify npm pack output
run: npm run pack:check

1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
workflow_dispatch:

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gas-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
workflow_dispatch:

env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ on:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
pull_request:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
workflow_dispatch:

env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
pull_request:
paths-ignore:
- '**.md'
- 'website/**'
- 'cli/**'
workflow_dispatch:

env:
Expand Down
8 changes: 8 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
coverage/
dist/
tmp/
.env
.env.local

docs/
6 changes: 6 additions & 0 deletions cli/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "src/templates/default/foundry/lib/forge-std"]
path = src/templates/default/foundry/lib/forge-std
url = https://github.com/foundry-rs/forge-std.git
[submodule "src/templates/default/foundry/lib/Compose"]
path = src/templates/default/foundry/lib/Compose
url = https://github.com/Perfect-Abstractions/Compose.git
7 changes: 7 additions & 0 deletions cli/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
test/
.github/
.cursor/
.tmp/
lib/
src/templates/**/foundry/lib/
8 changes: 8 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## 0.1.0

- Initial Compose CLI foundation.
- Added config-driven template registry with Foundry/Hardhat variants.
- Added scaffold engine, local facet source, and registry-mode stub.
- Added unit/integration tests, lint config, CI workflow, and release documentation.
Loading
Loading