Skip to content

Commit 1fa3314

Browse files
committed
Improve CLI based on best practices repo
1 parent f05d607 commit 1fa3314

File tree

10 files changed

+530
-41
lines changed

10 files changed

+530
-41
lines changed

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.os }} with Node ${{ matrix.node }}
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
node: ['20', '22']
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js ${{ matrix.node }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node }}
27+
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 10
32+
33+
- name: Get pnpm store directory
34+
id: pnpm-cache
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
38+
39+
- name: Setup pnpm cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
46+
47+
- name: Install dependencies
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: Build packages
51+
run: pnpm build
52+
53+
- name: Run linter
54+
run: pnpm lint:check
55+
56+
- name: Run type check
57+
run: pnpm typecheck
58+
59+
- name: Run tests
60+
run: pnpm test
61+
# Skip Python/C++ service tests in CI for now
62+
env:
63+
CI: true
64+
65+
build:
66+
name: Build Check
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Setup Node.js
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: '20'
77+
78+
- name: Install pnpm
79+
uses: pnpm/action-setup@v4
80+
with:
81+
version: 10
82+
83+
- name: Install dependencies
84+
run: pnpm install --frozen-lockfile
85+
86+
- name: Build all packages
87+
run: pnpm build
88+
89+
- name: Check bundle size
90+
run: |
91+
echo "## Bundle Sizes" >> $GITHUB_STEP_SUMMARY
92+
echo "" >> $GITHUB_STEP_SUMMARY
93+
echo "| Package | Size |" >> $GITHUB_STEP_SUMMARY
94+
echo "|---------|------|" >> $GITHUB_STEP_SUMMARY
95+
echo "| CLI | $(du -h packages/cli/dist/index.cjs | cut -f1) |" >> $GITHUB_STEP_SUMMARY
96+
echo "| Core | $(du -sh packages/core/dist | cut -f1) |" >> $GITHUB_STEP_SUMMARY
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
schedule:
9+
# Run weekly on Monday at 9am UTC
10+
- cron: '0 9 * * 1'
11+
12+
jobs:
13+
audit:
14+
name: Security Audit
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 10
30+
31+
- name: Get pnpm store directory
32+
id: pnpm-cache
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
36+
37+
- name: Setup pnpm cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
44+
45+
- name: Install dependencies
46+
run: pnpm install --frozen-lockfile
47+
48+
- name: Run security audit (informational)
49+
run: pnpm audit --audit-level=low || true
50+
continue-on-error: true
51+
52+
- name: Run security audit (fail on high/critical)
53+
run: pnpm audit --audit-level=high
54+
55+
- name: Check for outdated dependencies
56+
run: pnpm outdated || true
57+
continue-on-error: true

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
**/examples/**
2-
31
# macOS
42
.DS_Store
53

@@ -17,6 +15,7 @@ dist-ssr
1715

1816
# AI
1917
CLAUDE.md
18+
.claude
2019

2120
# Testing Resources
2221
.vite-templates

0 commit comments

Comments
 (0)