Skip to content

Commit 746f9c0

Browse files
dferguson992frgud
andauthored
feat!: Remove Yeoman, standalone CLI via commander + @inquirer/prompts (#148)
* feat!: remove Yeoman, standalone CLI via commander + @inquirer/prompts * 0.2.2 * Updating to resolve test errors: * fix(ci): update eslint SARIF workflow to use src/ instead of generators/ * fix(cli): remove passThroughOptions that broke --skip-prompts parsing --------- Co-authored-by: Dan Ferguson <frgud@amazon.com>
1 parent b70afed commit 746f9c0

344 files changed

Lines changed: 110497 additions & 57718 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
rules: {
1515
// Code Quality
1616
'no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
17-
'no-console': 'off', // Yeoman generators use console
17+
'no-console': 'off', // CLI tools use console
1818
'prefer-const': 'error',
1919
'no-var': 'error',
2020

@@ -39,7 +39,7 @@ module.exports = {
3939
},
4040
ignorePatterns: [
4141
'node_modules/',
42-
'generators/app/templates/**',
42+
'templates/**',
4343
'test/fixtures/**',
4444
'site/**',
4545
'drafts/**',

.github/workflows/ci.yml

Lines changed: 48 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -8,221 +8,94 @@ name: CI
88

99
jobs:
1010
test:
11-
name: Test Suite
11+
name: Test
1212
runs-on: ubuntu-latest
1313

1414
strategy:
1515
matrix:
1616
node-version: [24.x, 22.x]
1717

1818
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@v4
19+
- uses: actions/checkout@v4
2120

22-
- name: Setup Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v4
21+
- uses: actions/setup-node@v4
2422
with:
2523
node-version: ${{ matrix.node-version }}
26-
# Remove cache since package-lock.json is gitignored
2724

28-
- name: Install dependencies
29-
run: npm install
25+
- run: npm install
3026

31-
- name: Run ESLint
27+
- name: Lint
3228
run: npm run lint
3329

34-
- name: Run security audit
35-
run: npm audit --audit-level=critical || echo "⚠️ Non-critical vulnerabilities found (not blocking)"
30+
- name: Security audit
31+
run: npm audit --audit-level=critical || echo "⚠️ Non-critical vulnerabilities found"
3632

37-
- name: Run test suite
33+
- name: Tests
3834
run: npm run test:ci
3935

40-
- name: Generate test coverage
41-
run: npm run test:coverage
36+
- name: Coverage
4237
if: matrix.node-version == '24.x'
38+
run: npm run test:coverage
4339

44-
- name: Upload coverage to Codecov
45-
uses: codecov/codecov-action@v4
40+
- name: Upload coverage
4641
if: matrix.node-version == '24.x'
42+
uses: codecov/codecov-action@v4
4743
with:
4844
fail_ci_if_error: false
49-
verbose: true
5045

51-
validate:
52-
name: Full Validation
46+
- name: Validate MCP servers
47+
if: matrix.node-version == '24.x'
48+
run: node scripts/validate-servers.js
49+
50+
- name: Validate namespaces
51+
if: matrix.node-version == '24.x'
52+
run: node scripts/validate-namespaces.js
53+
54+
integration:
55+
name: Integration
5356
runs-on: ubuntu-latest
5457
needs: test
5558

5659
steps:
57-
- name: Checkout code
58-
uses: actions/checkout@v4
60+
- uses: actions/checkout@v4
5961

60-
- name: Setup Node.js
61-
uses: actions/setup-node@v4
62+
- uses: actions/setup-node@v4
6263
with:
6364
node-version: '24.x'
64-
# Remove cache since package-lock.json is gitignored
6565

66-
- name: Install dependencies
67-
run: npm install
66+
- run: npm install
6867

69-
- name: Run full validation suite
70-
run: |
71-
npm run lint
72-
npm run test:ci
68+
- name: Install CLI
69+
run: npm link
7370

74-
- name: Test generator installation
75-
run: |
76-
# Install Yeoman with current Node version
77-
npm install -g yo@latest
78-
npm link
79-
echo "Testing generator help command..."
80-
yo @aws/ml-container-creator help
71+
- name: Verify help output
72+
run: ml-container-creator help
8173

82-
- name: Test generator with CLI options (new format)
74+
- name: Generate project
8375
run: |
84-
mkdir -p test-output-legacy
85-
cd test-output-legacy
86-
yo @aws/ml-container-creator test-project-legacy \
76+
ml-container-creator test-project \
8777
--deployment-config=http-flask \
88-
--engine=sklearn \
8978
--model-format=pkl \
9079
--skip-prompts
91-
92-
# Verify expected files were created
93-
test -f test-project-legacy/Dockerfile
94-
test -f test-project-legacy/requirements.txt
95-
test -f test-project-legacy/code/model_handler.py
96-
test -f test-project-legacy/code/serve.py
97-
98-
# Verify do-framework scripts were created
99-
test -f test-project-legacy/do/config
100-
test -f test-project-legacy/do/build
101-
test -f test-project-legacy/do/push
102-
test -f test-project-legacy/do/deploy
103-
test -f test-project-legacy/do/README.md
104-
105-
# Verify legacy wrapper scripts exist with deprecation warnings
106-
test -f test-project-legacy/deploy/build_and_push.sh
107-
test -f test-project-legacy/deploy/deploy.sh
108-
grep -q "DEPRECATED" test-project-legacy/deploy/build_and_push.sh
109-
110-
echo "✅ Generator CLI test (new format) passed"
111-
112-
- name: Test generator with deployment config option
113-
run: |
114-
mkdir -p test-output-new
115-
cd test-output-new
116-
yo @aws/ml-container-creator test-project-new \
117-
--deployment-config=http-flask \
118-
--engine=sklearn \
119-
--model-format=pkl \
120-
--skip-prompts
121-
122-
# Verify expected files were created
123-
test -f test-project-new/Dockerfile
124-
test -f test-project-new/requirements.txt
125-
test -f test-project-new/code/model_handler.py
126-
test -f test-project-new/code/serve.py
127-
128-
# Verify do-framework scripts were created
129-
test -f test-project-new/do/config
130-
test -f test-project-new/do/build
131-
test -f test-project-new/do/push
132-
test -f test-project-new/do/deploy
133-
test -f test-project-new/do/README.md
134-
135-
# Verify do/config contains correct deployment config
136-
grep -q "DEPLOYMENT_CONFIG=\"http-flask\"" test-project-new/do/config
137-
grep -q "FRAMEWORK=\"http\"" test-project-new/do/config
138-
grep -q "MODEL_SERVER=\"flask\"" test-project-new/do/config
139-
140-
echo "✅ Generator CLI test (deployment config) passed"
141-
142-
- name: Validate package namespaces
143-
run: node scripts/validate-namespaces.js
144-
145-
security:
146-
name: Security Scan
147-
runs-on: ubuntu-latest
148-
149-
steps:
150-
- name: Checkout code
151-
uses: actions/checkout@v4
152-
153-
- name: Setup Node.js
154-
uses: actions/setup-node@v4
155-
with:
156-
node-version: '24.x'
157-
# Remove cache since package-lock.json is gitignored
158-
159-
- name: Install dependencies
160-
run: npm install
16180
162-
- name: Run security audit (informational)
81+
- name: Verify generated files
16382
run: |
164-
echo "🔍 Running security audit (all vulnerabilities)..."
165-
npm audit --audit-level=low || true
166-
echo "ℹ️ Above audit is informational only"
167-
168-
- name: Check for critical vulnerabilities
169-
run: |
170-
echo "🔒 Checking for critical vulnerabilities..."
171-
# Run audit and capture both output and exit code
172-
set +e # Don't exit on error
173-
audit_output=$(npm audit --audit-level=critical 2>&1)
174-
audit_exit_code=$?
175-
set -e # Re-enable exit on error
83+
# Core files
84+
test -f test-project/Dockerfile
85+
test -f test-project/requirements.txt
86+
test -f test-project/code/model_handler.py
87+
test -f test-project/code/serve.py
17688
177-
echo "$audit_output"
89+
# do-framework
90+
test -f test-project/do/config
91+
test -f test-project/do/build
92+
test -f test-project/do/push
93+
test -f test-project/do/deploy
17894
179-
# Check if output contains critical vulnerabilities
180-
if echo "$audit_output" | grep -qi "Severity:.*critical\|critical severity"; then
181-
echo "❌ Critical vulnerabilities found"
182-
exit 1
183-
elif echo "$audit_output" | grep -qi "0 vulnerabilities" || echo "$audit_output" | grep -qi "found 0 vulnerabilities"; then
184-
echo "✅ No vulnerabilities found"
185-
elif echo "$audit_output" | grep -qi "moderate\|low\|high"; then
186-
echo "✅ No critical vulnerabilities found (only lower severity issues detected)"
187-
else
188-
echo "✅ No critical vulnerabilities found"
189-
fi
190-
191-
- name: Check for high vulnerabilities (warning only)
192-
run: |
193-
echo "⚠️ Checking for high vulnerabilities (warning only)..."
194-
# Run high-level audit and capture output
195-
set +e # Don't exit on error
196-
high_audit_output=$(npm audit --audit-level=high 2>&1)
197-
high_exit_code=$?
198-
set -e # Re-enable exit on error
95+
# do/config values
96+
grep -q 'DEPLOYMENT_CONFIG="http-flask"' test-project/do/config
97+
grep -q 'FRAMEWORK="http"' test-project/do/config
98+
grep -q 'MODEL_SERVER="flask"' test-project/do/config
19999
200-
# Check if output contains high vulnerabilities
201-
if echo "$high_audit_output" | grep -qi "Severity:.*high\|high severity"; then
202-
echo "⚠️ High vulnerabilities found (not blocking):"
203-
echo "$high_audit_output"
204-
echo "ℹ️ Consider addressing these vulnerabilities when possible"
205-
elif echo "$high_audit_output" | grep -qi "0 vulnerabilities" || echo "$high_audit_output" | grep -qi "found 0 vulnerabilities"; then
206-
echo "✅ No high vulnerabilities found"
207-
else
208-
echo "✅ No high vulnerabilities found"
209-
fi
210-
211-
mcp-servers:
212-
name: MCP Server Validation
213-
runs-on: ubuntu-latest
214-
215-
steps:
216-
- name: Checkout code
217-
uses: actions/checkout@v4
218-
219-
- name: Setup Node.js
220-
uses: actions/setup-node@v4
221-
with:
222-
node-version: '24.x'
223-
224-
- name: Install dependencies
225-
run: npm install
226-
227-
- name: Validate schemas, manifests, catalogs, and tool uniqueness
228-
run: node scripts/validate-servers.js
100+
# Legacy deploy/ should NOT exist
101+
test ! -d test-project/deploy

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
env:
4343
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
4444
run: |
45-
npx eslint generators/**/*.js test/**/*.js \
45+
npx eslint src/**/*.js bin/**/*.js test/**/*.js \
4646
--config .eslintrc.cjs \
4747
--format @microsoft/eslint-formatter-sarif \
4848
--output-file eslint-results.sarif

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ config/mcp.json
1717

1818
# MkDocs build output
1919
site/
20+
21+
# npm pack artifacts
22+
*.tgz

.npmignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ site/
2424
.github/
2525
.gitignore
2626
.eslintrc.cjs
27-
.yo-rc.json
2827

2928
# --- Tests ---
3029
test/
@@ -34,8 +33,9 @@ docs/
3433
mkdocs.yml
3534
logo.png
3635

37-
# --- MCP servers (separate packages, not part of the generator) ---
38-
servers/
36+
# --- MCP servers (node_modules not published, only catalog/index files via "files" whitelist) ---
37+
servers/*/node_modules/
38+
servers/*/test/
3939

4040
# --- Scripts (dev tooling) ---
4141
scripts/
@@ -47,3 +47,7 @@ THIRD_PARTY.csv
4747

4848
# --- Build artifacts ---
4949
test-output-full.log
50+
51+
# --- Generator legacy (removed) ---
52+
generators/
53+
.yo-rc.json

.yo-rc.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)