create-qa-architect 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +12 -0
- package/.github/CLAUDE_MD_AUTOMATION.md +248 -0
- package/.github/PROGRESSIVE_QUALITY_IMPLEMENTATION.md +408 -0
- package/.github/PROGRESSIVE_QUALITY_PROPOSAL.md +443 -0
- package/.github/RELEASE_CHECKLIST.md +100 -0
- package/.github/dependabot.yml +50 -0
- package/.github/git-sync.sh +48 -0
- package/.github/workflows/claude-md-validation.yml +82 -0
- package/.github/workflows/nightly-gitleaks-verification.yml +176 -0
- package/.github/workflows/pnpm-ci.yml.example +53 -0
- package/.github/workflows/python-ci.yml.example +69 -0
- package/.github/workflows/quality-legacy.yml.backup +165 -0
- package/.github/workflows/quality-progressive.yml.example +291 -0
- package/.github/workflows/quality.yml +436 -0
- package/.github/workflows/release.yml +53 -0
- package/.nvmrc +1 -0
- package/.prettierignore +14 -0
- package/.prettierrc +9 -0
- package/.stylelintrc.json +5 -0
- package/README.md +212 -0
- package/config/.lighthouserc.js +45 -0
- package/config/.pre-commit-config.yaml +66 -0
- package/config/constants.js +128 -0
- package/config/defaults.js +124 -0
- package/config/pyproject.toml +124 -0
- package/config/quality-config.schema.json +97 -0
- package/config/quality-python.yml +89 -0
- package/config/requirements-dev.txt +15 -0
- package/create-saas-monetization.js +1465 -0
- package/eslint.config.cjs +117 -0
- package/eslint.config.ts.cjs +99 -0
- package/legal/README.md +106 -0
- package/legal/copyright.md +76 -0
- package/legal/disclaimer.md +146 -0
- package/legal/privacy-policy.html +324 -0
- package/legal/privacy-policy.md +196 -0
- package/legal/terms-of-service.md +224 -0
- package/lib/billing-dashboard.html +645 -0
- package/lib/config-validator.js +163 -0
- package/lib/dependency-monitoring-basic.js +185 -0
- package/lib/dependency-monitoring-premium.js +1490 -0
- package/lib/error-reporter.js +444 -0
- package/lib/interactive/prompt.js +128 -0
- package/lib/interactive/questions.js +146 -0
- package/lib/license-validator.js +403 -0
- package/lib/licensing.js +989 -0
- package/lib/package-utils.js +187 -0
- package/lib/project-maturity.js +516 -0
- package/lib/security-enhancements.js +340 -0
- package/lib/setup-enhancements.js +317 -0
- package/lib/smart-strategy-generator.js +344 -0
- package/lib/telemetry.js +323 -0
- package/lib/template-loader.js +252 -0
- package/lib/typescript-config-generator.js +210 -0
- package/lib/ui-helpers.js +74 -0
- package/lib/validation/base-validator.js +174 -0
- package/lib/validation/cache-manager.js +158 -0
- package/lib/validation/config-security.js +741 -0
- package/lib/validation/documentation.js +326 -0
- package/lib/validation/index.js +186 -0
- package/lib/validation/validation-factory.js +153 -0
- package/lib/validation/workflow-validation.js +172 -0
- package/lib/yaml-utils.js +120 -0
- package/marketing/beta-user-email-campaign.md +372 -0
- package/marketing/landing-page.html +721 -0
- package/package.json +165 -0
- package/setup.js +2076 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
name: Quality Checks
|
|
2
|
+
|
|
3
|
+
# Progressive quality automation - adapts checks based on project maturity
|
|
4
|
+
# Minimal projects: Only Prettier
|
|
5
|
+
# Bootstrap projects: + ESLint
|
|
6
|
+
# Development projects: + Tests + Security
|
|
7
|
+
# Production-ready: All checks enabled
|
|
8
|
+
#
|
|
9
|
+
# Note: Core checks and tests run on Node.js 20 and 22 matrix to catch runtime differences
|
|
10
|
+
# and ensure compatibility across Node.js versions
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
push:
|
|
14
|
+
branches: [main, master, develop]
|
|
15
|
+
pull_request:
|
|
16
|
+
branches: [main, master, develop]
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
# Step 1: Detect project maturity level and package manager
|
|
20
|
+
detect-maturity:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
outputs:
|
|
23
|
+
maturity: ${{ steps.detect.outputs.maturity }}
|
|
24
|
+
source-count: ${{ steps.detect.outputs.source-count }}
|
|
25
|
+
test-count: ${{ steps.detect.outputs.test-count }}
|
|
26
|
+
has-deps: ${{ steps.detect.outputs.has-deps }}
|
|
27
|
+
has-docs: ${{ steps.detect.outputs.has-docs }}
|
|
28
|
+
has-css: ${{ steps.detect.outputs.has-css }}
|
|
29
|
+
package-manager: ${{ steps.detect-pm.outputs.manager }}
|
|
30
|
+
install-cmd: ${{ steps.detect-pm.outputs.install-cmd }}
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout code
|
|
34
|
+
uses: actions/checkout@v5
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@v6
|
|
38
|
+
with:
|
|
39
|
+
node-version: '20'
|
|
40
|
+
|
|
41
|
+
- name: Detect Package Manager
|
|
42
|
+
id: detect-pm
|
|
43
|
+
run: |
|
|
44
|
+
# Detect package manager from lockfiles
|
|
45
|
+
if [ -f pnpm-lock.yaml ]; then
|
|
46
|
+
echo "manager=pnpm" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "install-cmd=pnpm install --frozen-lockfile" >> $GITHUB_OUTPUT
|
|
48
|
+
elif [ -f yarn.lock ]; then
|
|
49
|
+
echo "manager=yarn" >> $GITHUB_OUTPUT
|
|
50
|
+
echo "install-cmd=yarn install --frozen-lockfile" >> $GITHUB_OUTPUT
|
|
51
|
+
elif [ -f bun.lockb ]; then
|
|
52
|
+
echo "manager=bun" >> $GITHUB_OUTPUT
|
|
53
|
+
echo "install-cmd=bun install --frozen-lockfile" >> $GITHUB_OUTPUT
|
|
54
|
+
elif [ -f package-lock.json ]; then
|
|
55
|
+
echo "manager=npm" >> $GITHUB_OUTPUT
|
|
56
|
+
echo "install-cmd=npm ci" >> $GITHUB_OUTPUT
|
|
57
|
+
else
|
|
58
|
+
echo "manager=npm" >> $GITHUB_OUTPUT
|
|
59
|
+
echo "install-cmd=npm install" >> $GITHUB_OUTPUT
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Detect Project Maturity
|
|
63
|
+
id: detect
|
|
64
|
+
run: |
|
|
65
|
+
# Use the project maturity detector
|
|
66
|
+
node lib/project-maturity.js --github-actions >> $GITHUB_OUTPUT
|
|
67
|
+
|
|
68
|
+
- name: Display Detection Report
|
|
69
|
+
run: |
|
|
70
|
+
echo "đ Project Detection Results"
|
|
71
|
+
echo "Package Manager: ${{ steps.detect-pm.outputs.manager }}"
|
|
72
|
+
echo "Install Command: ${{ steps.detect-pm.outputs.install-cmd }}"
|
|
73
|
+
echo "Maturity: ${{ steps.detect.outputs.maturity }}"
|
|
74
|
+
echo "Source files: ${{ steps.detect.outputs.source-count }}"
|
|
75
|
+
echo "Test files: ${{ steps.detect.outputs.test-count }}"
|
|
76
|
+
echo "Has dependencies: ${{ steps.detect.outputs.has-deps }}"
|
|
77
|
+
echo "Has documentation: ${{ steps.detect.outputs.has-docs }}"
|
|
78
|
+
echo "Has CSS files: ${{ steps.detect.outputs.has-css }}"
|
|
79
|
+
|
|
80
|
+
# Step 2: Core checks - ALWAYS run (all maturity levels)
|
|
81
|
+
core-checks:
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
needs: detect-maturity
|
|
84
|
+
strategy:
|
|
85
|
+
matrix:
|
|
86
|
+
node-version: [20, 22]
|
|
87
|
+
fail-fast: false
|
|
88
|
+
|
|
89
|
+
steps:
|
|
90
|
+
- name: Checkout code
|
|
91
|
+
uses: actions/checkout@v5
|
|
92
|
+
|
|
93
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
94
|
+
uses: actions/setup-node@v6
|
|
95
|
+
with:
|
|
96
|
+
node-version: ${{ matrix.node-version }}
|
|
97
|
+
cache: ${{ needs.detect-maturity.outputs.package-manager }}
|
|
98
|
+
|
|
99
|
+
- name: Install dependencies
|
|
100
|
+
run: ${{ needs.detect-maturity.outputs.install-cmd }}
|
|
101
|
+
|
|
102
|
+
- name: Prettier check
|
|
103
|
+
run: |
|
|
104
|
+
echo "⨠Running Prettier formatting check (required for all projects)"
|
|
105
|
+
npm run format:check
|
|
106
|
+
|
|
107
|
+
# Step 3: Linting - run if source files exist (bootstrap+)
|
|
108
|
+
# Note: Runs on Node 20 only - linting tools are less sensitive to Node version differences
|
|
109
|
+
# Core runtime compatibility is tested via matrix in core-checks and tests jobs
|
|
110
|
+
linting:
|
|
111
|
+
runs-on: ubuntu-latest
|
|
112
|
+
needs: detect-maturity
|
|
113
|
+
if: fromJSON(needs.detect-maturity.outputs.source-count) > 0
|
|
114
|
+
|
|
115
|
+
steps:
|
|
116
|
+
- name: Checkout code
|
|
117
|
+
uses: actions/checkout@v5
|
|
118
|
+
|
|
119
|
+
- name: Setup Node.js
|
|
120
|
+
uses: actions/setup-node@v6
|
|
121
|
+
with:
|
|
122
|
+
node-version: '20'
|
|
123
|
+
cache: ${{ needs.detect-maturity.outputs.package-manager }}
|
|
124
|
+
|
|
125
|
+
- name: Install dependencies
|
|
126
|
+
run: ${{ needs.detect-maturity.outputs.install-cmd }}
|
|
127
|
+
|
|
128
|
+
- name: ESLint
|
|
129
|
+
run: |
|
|
130
|
+
echo "đ Linting ${{ needs.detect-maturity.outputs.source-count }} source files..."
|
|
131
|
+
npx eslint .
|
|
132
|
+
|
|
133
|
+
- name: Stylelint
|
|
134
|
+
if: needs.detect-maturity.outputs.has-css == 'true'
|
|
135
|
+
run: |
|
|
136
|
+
echo "đ¨ Linting CSS files..."
|
|
137
|
+
npx stylelint "**/*.{css,scss,sass,less,pcss}" --allow-empty-input
|
|
138
|
+
|
|
139
|
+
# Step 4: Security checks - run if dependencies exist
|
|
140
|
+
#
|
|
141
|
+
# Optional Enhanced Token Configuration:
|
|
142
|
+
# - GITLEAKS_TOKEN: Enhanced GitHub token for gitleaks (fallback: GITHUB_TOKEN)
|
|
143
|
+
# - GITLEAKS_LICENSE: Commercial gitleaks license key for advanced features
|
|
144
|
+
# - SEMGREP_APP_TOKEN: Semgrep app token for enhanced scanning and rate limits
|
|
145
|
+
#
|
|
146
|
+
# These are optional - workflow functions with defaults but enhanced tokens
|
|
147
|
+
# provide better reliability on GHES/self-hosted and unlock premium features
|
|
148
|
+
security:
|
|
149
|
+
runs-on: ubuntu-latest
|
|
150
|
+
needs: detect-maturity
|
|
151
|
+
if: needs.detect-maturity.outputs.has-deps == 'true'
|
|
152
|
+
|
|
153
|
+
steps:
|
|
154
|
+
- name: Checkout code
|
|
155
|
+
uses: actions/checkout@v5
|
|
156
|
+
|
|
157
|
+
- name: Setup Node.js
|
|
158
|
+
uses: actions/setup-node@v6
|
|
159
|
+
with:
|
|
160
|
+
node-version: '20'
|
|
161
|
+
cache: ${{ needs.detect-maturity.outputs.package-manager }}
|
|
162
|
+
|
|
163
|
+
- name: Install dependencies
|
|
164
|
+
run: ${{ needs.detect-maturity.outputs.install-cmd }}
|
|
165
|
+
|
|
166
|
+
- name: Verify dependency integrity
|
|
167
|
+
run: |
|
|
168
|
+
echo "đ Verifying dependency integrity..."
|
|
169
|
+
PACKAGE_MANAGER="${{ needs.detect-maturity.outputs.package-manager }}"
|
|
170
|
+
|
|
171
|
+
case "$PACKAGE_MANAGER" in
|
|
172
|
+
"pnpm")
|
|
173
|
+
if [ -f pnpm-lock.yaml ]; then
|
|
174
|
+
pnpm install --frozen-lockfile --dry-run
|
|
175
|
+
echo "â
Dependency integrity verified (pnpm)"
|
|
176
|
+
else
|
|
177
|
+
echo "â ī¸ No pnpm-lock.yaml found - skipping integrity verification"
|
|
178
|
+
fi
|
|
179
|
+
;;
|
|
180
|
+
"yarn")
|
|
181
|
+
if [ -f yarn.lock ]; then
|
|
182
|
+
yarn install --frozen-lockfile --dry-run
|
|
183
|
+
echo "â
Dependency integrity verified (yarn)"
|
|
184
|
+
else
|
|
185
|
+
echo "â ī¸ No yarn.lock found - skipping integrity verification"
|
|
186
|
+
fi
|
|
187
|
+
;;
|
|
188
|
+
"bun")
|
|
189
|
+
if [ -f bun.lockb ]; then
|
|
190
|
+
bun install --frozen-lockfile --dry-run
|
|
191
|
+
echo "â
Dependency integrity verified (bun)"
|
|
192
|
+
else
|
|
193
|
+
echo "â ī¸ No bun.lockb found - skipping integrity verification"
|
|
194
|
+
fi
|
|
195
|
+
;;
|
|
196
|
+
"npm"|*)
|
|
197
|
+
if [ -f package-lock.json ]; then
|
|
198
|
+
npm ci --dry-run --prefer-offline
|
|
199
|
+
echo "â
Dependency integrity verified (npm)"
|
|
200
|
+
else
|
|
201
|
+
echo "â ī¸ No package-lock.json found - skipping integrity verification"
|
|
202
|
+
fi
|
|
203
|
+
;;
|
|
204
|
+
esac
|
|
205
|
+
|
|
206
|
+
echo "đ Checking for vulnerable dependencies..."
|
|
207
|
+
case "$PACKAGE_MANAGER" in
|
|
208
|
+
"pnpm") pnpm audit --audit-level=moderate ;;
|
|
209
|
+
"yarn") yarn audit --level=moderate ;;
|
|
210
|
+
"bun") bun audit --audit-level=moderate ;;
|
|
211
|
+
"npm"|*) npm audit --audit-level=moderate ;;
|
|
212
|
+
esac
|
|
213
|
+
|
|
214
|
+
- name: Security audit
|
|
215
|
+
run: |
|
|
216
|
+
PACKAGE_MANAGER="${{ needs.detect-maturity.outputs.package-manager }}"
|
|
217
|
+
echo "đ Running security audit with $PACKAGE_MANAGER..."
|
|
218
|
+
|
|
219
|
+
case "$PACKAGE_MANAGER" in
|
|
220
|
+
"pnpm") pnpm audit --audit-level high ;;
|
|
221
|
+
"yarn") yarn audit --level high ;;
|
|
222
|
+
"bun") bun audit --audit-level high ;;
|
|
223
|
+
"npm"|*) npm audit --audit-level high ;;
|
|
224
|
+
esac
|
|
225
|
+
|
|
226
|
+
- name: Production dependencies security audit
|
|
227
|
+
run: |
|
|
228
|
+
PACKAGE_MANAGER="${{ needs.detect-maturity.outputs.package-manager }}"
|
|
229
|
+
echo "đ Running production-only dependency audit with $PACKAGE_MANAGER..."
|
|
230
|
+
|
|
231
|
+
case "$PACKAGE_MANAGER" in
|
|
232
|
+
"pnpm") pnpm audit --audit-level high --prod ;;
|
|
233
|
+
"yarn") yarn audit --level high --groups dependencies ;;
|
|
234
|
+
"bun") bun audit --audit-level high --production ;;
|
|
235
|
+
"npm"|*) npm audit --audit-level high --production ;;
|
|
236
|
+
esac
|
|
237
|
+
|
|
238
|
+
- name: Check for hardcoded secrets
|
|
239
|
+
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
|
|
240
|
+
env:
|
|
241
|
+
# Use enhanced token if available, fallback to default GitHub token
|
|
242
|
+
# GITLEAKS_LICENSE can be set for commercial features
|
|
243
|
+
GITHUB_TOKEN: ${{ secrets.GITLEAKS_TOKEN || secrets.GITHUB_TOKEN }}
|
|
244
|
+
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
|
|
245
|
+
with:
|
|
246
|
+
args: --redact --verbose
|
|
247
|
+
|
|
248
|
+
- name: Security pattern detection
|
|
249
|
+
uses: semgrep/semgrep-action@713efdd345f3035192eaa63f56867b88e63e4e5d # v1
|
|
250
|
+
with:
|
|
251
|
+
config: >
|
|
252
|
+
p/security-audit@1.85.0
|
|
253
|
+
p/javascript@1.85.0
|
|
254
|
+
cache: true
|
|
255
|
+
cache-key: semgrep-security-audit-1.85.0-javascript-1.85.0-${{ env.SEMGREP_VERSION }}
|
|
256
|
+
env:
|
|
257
|
+
# Use Semgrep app token if available for enhanced features and rate limits
|
|
258
|
+
# Falls back to GitHub token for basic functionality
|
|
259
|
+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN || secrets.GITHUB_TOKEN }}
|
|
260
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
261
|
+
SEMGREP_VERSION: '1.85.0'
|
|
262
|
+
SEMGREP_ENABLE_VERSION_CHECK: 'false'
|
|
263
|
+
|
|
264
|
+
# Step 5: Tests - run if test files exist (development+)
|
|
265
|
+
tests:
|
|
266
|
+
runs-on: ubuntu-latest
|
|
267
|
+
needs: detect-maturity
|
|
268
|
+
if: fromJSON(needs.detect-maturity.outputs.test-count) > 0
|
|
269
|
+
strategy:
|
|
270
|
+
matrix:
|
|
271
|
+
node-version: [20, 22]
|
|
272
|
+
fail-fast: false
|
|
273
|
+
|
|
274
|
+
steps:
|
|
275
|
+
- name: Checkout code
|
|
276
|
+
uses: actions/checkout@v5
|
|
277
|
+
|
|
278
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
279
|
+
uses: actions/setup-node@v6
|
|
280
|
+
with:
|
|
281
|
+
node-version: ${{ matrix.node-version }}
|
|
282
|
+
cache: ${{ needs.detect-maturity.outputs.package-manager }}
|
|
283
|
+
|
|
284
|
+
- name: Install dependencies
|
|
285
|
+
run: |
|
|
286
|
+
echo "âąī¸ Performance Budget: Dependency installation must complete within 2 minutes"
|
|
287
|
+
timeout 120 ${{ needs.detect-maturity.outputs.install-cmd }} || {
|
|
288
|
+
echo "::error::Dependency installation exceeded 2-minute performance budget!"
|
|
289
|
+
exit 1
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
- name: Run tests
|
|
293
|
+
run: |
|
|
294
|
+
echo "đ§Ē Running ${{ needs.detect-maturity.outputs.test-count }} test files on Node.js ${{ matrix.node-version }}..."
|
|
295
|
+
|
|
296
|
+
# Warn if test count is suspiciously low
|
|
297
|
+
TEST_COUNT=${{ needs.detect-maturity.outputs.test-count }}
|
|
298
|
+
if [ "$TEST_COUNT" -lt 5 ]; then
|
|
299
|
+
echo "::warning::Only $TEST_COUNT test file(s) found - consider adding more tests for better coverage"
|
|
300
|
+
fi
|
|
301
|
+
|
|
302
|
+
# Performance budget: Test suite timeout (5 minutes max)
|
|
303
|
+
echo "âąī¸ Performance Budget: Test suite must complete within 5 minutes"
|
|
304
|
+
timeout 300 npm test || {
|
|
305
|
+
echo "::error::Test suite exceeded 5-minute performance budget!"
|
|
306
|
+
exit 1
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
- name: Cache gitleaks binary for real download test
|
|
310
|
+
if: runner.os == 'Linux'
|
|
311
|
+
uses: actions/cache@v5
|
|
312
|
+
with:
|
|
313
|
+
path: ~/.cache/create-qa-architect/gitleaks
|
|
314
|
+
key: gitleaks-8.28.0-linux-x64-a65b5253-${{ hashFiles('lib/validation/config-security.js') }}
|
|
315
|
+
restore-keys: |
|
|
316
|
+
gitleaks-8.28.0-linux-x64-a65b5253-
|
|
317
|
+
gitleaks-8.28.0-linux-x64-
|
|
318
|
+
|
|
319
|
+
- name: Run real gitleaks binary verification test
|
|
320
|
+
if: runner.os == 'Linux'
|
|
321
|
+
run: |
|
|
322
|
+
echo "đ Running real gitleaks binary verification test..."
|
|
323
|
+
RUN_REAL_BINARY_TEST=1 node tests/gitleaks-real-binary-test.js
|
|
324
|
+
|
|
325
|
+
# Step 6: Documentation - run for production-ready projects
|
|
326
|
+
documentation:
|
|
327
|
+
runs-on: ubuntu-latest
|
|
328
|
+
needs: detect-maturity
|
|
329
|
+
if: needs.detect-maturity.outputs.maturity == 'production-ready'
|
|
330
|
+
|
|
331
|
+
steps:
|
|
332
|
+
- name: Checkout code
|
|
333
|
+
uses: actions/checkout@v5
|
|
334
|
+
|
|
335
|
+
- name: Setup Node.js
|
|
336
|
+
uses: actions/setup-node@v6
|
|
337
|
+
with:
|
|
338
|
+
node-version: '20'
|
|
339
|
+
cache: ${{ needs.detect-maturity.outputs.package-manager }}
|
|
340
|
+
|
|
341
|
+
- name: Install dependencies
|
|
342
|
+
run: ${{ needs.detect-maturity.outputs.install-cmd }}
|
|
343
|
+
|
|
344
|
+
- name: Configuration security check
|
|
345
|
+
run: |
|
|
346
|
+
echo "đ Running configuration security validation..."
|
|
347
|
+
node setup.js --security-config
|
|
348
|
+
|
|
349
|
+
- name: Documentation validation
|
|
350
|
+
run: |
|
|
351
|
+
echo "đ Running documentation validation..."
|
|
352
|
+
node setup.js --validate-docs
|
|
353
|
+
|
|
354
|
+
- name: Documentation consistency and security audit freshness
|
|
355
|
+
run: |
|
|
356
|
+
echo "đ Running comprehensive documentation validation..."
|
|
357
|
+
# This includes security audit freshness check with proper git-based validation
|
|
358
|
+
bash scripts/check-docs.sh
|
|
359
|
+
|
|
360
|
+
- name: Package size and contents validation
|
|
361
|
+
if: hashFiles('package.json') != ''
|
|
362
|
+
run: |
|
|
363
|
+
echo "đĻ Validating package size and contents..."
|
|
364
|
+
|
|
365
|
+
# Check if this is an npm package
|
|
366
|
+
if [ -f package.json ] && grep -q '"name"' package.json; then
|
|
367
|
+
# Dry-run pack to check what would be included
|
|
368
|
+
echo "đ Checking package contents (dry run):"
|
|
369
|
+
npm pack --dry-run 2>/dev/null | grep -E '^[a-zA-Z]' || echo "No files listed"
|
|
370
|
+
|
|
371
|
+
# Calculate estimated pack size
|
|
372
|
+
PACK_SIZE=$(npm pack --dry-run 2>&1 | grep -E 'package size.*[0-9]+' | grep -oE '[0-9.]+\s?(B|kB|MB)' | head -1 || echo "unknown")
|
|
373
|
+
echo "đ Estimated package size: $PACK_SIZE"
|
|
374
|
+
|
|
375
|
+
# Warn if package seems too large (>10MB)
|
|
376
|
+
if echo "$PACK_SIZE" | grep -qE '[0-9]+\s?MB'; then
|
|
377
|
+
SIZE_NUM=$(echo "$PACK_SIZE" | grep -oE '[0-9]+')
|
|
378
|
+
if [ "$SIZE_NUM" -gt 10 ]; then
|
|
379
|
+
echo "::warning::Package size ($PACK_SIZE) is quite large. Consider excluding unnecessary files via .npmignore or package.json 'files' field."
|
|
380
|
+
fi
|
|
381
|
+
fi
|
|
382
|
+
|
|
383
|
+
# Check for common files that shouldn't be in packages
|
|
384
|
+
echo "đ Checking for potentially unwanted files..."
|
|
385
|
+
npm pack --dry-run 2>/dev/null | grep -E '\.(log|tmp|cache|DS_Store)$|node_modules/|\.git/' && {
|
|
386
|
+
echo "::warning::Package contains files that might not belong in the published package"
|
|
387
|
+
} || echo "â
No obviously unwanted files detected"
|
|
388
|
+
|
|
389
|
+
# Validate package.json files field if present
|
|
390
|
+
if grep -q '"files"' package.json; then
|
|
391
|
+
echo "â
Package.json 'files' field configured"
|
|
392
|
+
else
|
|
393
|
+
echo "::notice::No 'files' field in package.json - all files except those in .npmignore will be included"
|
|
394
|
+
fi
|
|
395
|
+
else
|
|
396
|
+
echo "âšī¸ Not an npm package or no package.json found - skipping package validation"
|
|
397
|
+
fi
|
|
398
|
+
|
|
399
|
+
- name: Lighthouse CI
|
|
400
|
+
if: hashFiles('.lighthouserc.js', '.lighthouserc.json', 'lighthouserc.js') != ''
|
|
401
|
+
run: |
|
|
402
|
+
echo "đĸ Running Lighthouse CI..."
|
|
403
|
+
npx lhci autorun
|
|
404
|
+
continue-on-error: true
|
|
405
|
+
|
|
406
|
+
# Step 7: Summary - report what checks ran
|
|
407
|
+
summary:
|
|
408
|
+
runs-on: ubuntu-latest
|
|
409
|
+
needs:
|
|
410
|
+
- detect-maturity
|
|
411
|
+
- core-checks
|
|
412
|
+
- linting
|
|
413
|
+
- security
|
|
414
|
+
- tests
|
|
415
|
+
- documentation
|
|
416
|
+
if: always()
|
|
417
|
+
|
|
418
|
+
steps:
|
|
419
|
+
- name: Generate Check Summary
|
|
420
|
+
run: |
|
|
421
|
+
echo "## Quality Checks Summary đ" >> $GITHUB_STEP_SUMMARY
|
|
422
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
423
|
+
echo "**Maturity Level:** ${{ needs.detect-maturity.outputs.maturity }}" >> $GITHUB_STEP_SUMMARY
|
|
424
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
425
|
+
echo "### Project Statistics" >> $GITHUB_STEP_SUMMARY
|
|
426
|
+
echo "- Source files: ${{ needs.detect-maturity.outputs.source-count }}" >> $GITHUB_STEP_SUMMARY
|
|
427
|
+
echo "- Test files: ${{ needs.detect-maturity.outputs.test-count }}" >> $GITHUB_STEP_SUMMARY
|
|
428
|
+
echo "- Has dependencies: ${{ needs.detect-maturity.outputs.has-deps }}" >> $GITHUB_STEP_SUMMARY
|
|
429
|
+
echo "- Has documentation: ${{ needs.detect-maturity.outputs.has-docs }}" >> $GITHUB_STEP_SUMMARY
|
|
430
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
431
|
+
echo "### Checks Executed" >> $GITHUB_STEP_SUMMARY
|
|
432
|
+
echo "- â
Core checks: Always run" >> $GITHUB_STEP_SUMMARY
|
|
433
|
+
echo "- ${{ needs.detect-maturity.outputs.source-count > 0 && 'â
' || 'âī¸' }} Linting: ${{ needs.detect-maturity.outputs.source-count > 0 && 'Enabled' || 'Skipped (no source files)' }}" >> $GITHUB_STEP_SUMMARY
|
|
434
|
+
echo "- ${{ needs.detect-maturity.outputs.has-deps == 'true' && 'â
' || 'âī¸' }} Security: ${{ needs.detect-maturity.outputs.has-deps == 'true' && 'Enabled' || 'Skipped (no dependencies)' }}" >> $GITHUB_STEP_SUMMARY
|
|
435
|
+
echo "- ${{ needs.detect-maturity.outputs.test-count > 0 && 'â
' || 'âī¸' }} Tests: ${{ needs.detect-maturity.outputs.test-count > 0 && 'Enabled' || 'Skipped (no test files)' }}" >> $GITHUB_STEP_SUMMARY
|
|
436
|
+
echo "- ${{ needs.detect-maturity.outputs.maturity == 'production-ready' && 'â
' || 'âī¸' }} Documentation: ${{ needs.detect-maturity.outputs.maturity == 'production-ready' && 'Enabled' || 'Skipped (not production-ready)' }}" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
release:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout code
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Setup Node.js
|
|
15
|
+
uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: '20'
|
|
18
|
+
registry-url: 'https://registry.npmjs.org'
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm ci
|
|
22
|
+
|
|
23
|
+
- name: Run pre-release checks
|
|
24
|
+
run: npm run prerelease
|
|
25
|
+
|
|
26
|
+
- name: Publish to npm
|
|
27
|
+
run: npm publish
|
|
28
|
+
env:
|
|
29
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Create GitHub Release
|
|
32
|
+
uses: actions/create-release@v1
|
|
33
|
+
env:
|
|
34
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
+
with:
|
|
36
|
+
tag_name: ${{ github.ref_name }}
|
|
37
|
+
release_name: Release ${{ github.ref_name }}
|
|
38
|
+
body: |
|
|
39
|
+
## Changes in ${{ github.ref_name }}
|
|
40
|
+
|
|
41
|
+
See [CHANGELOG.md](CHANGELOG.md) for detailed changes.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
```bash
|
|
45
|
+
npx create-qa-architect@latest
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Update existing projects
|
|
49
|
+
```bash
|
|
50
|
+
npx create-qa-architect@latest --update
|
|
51
|
+
```
|
|
52
|
+
draft: false
|
|
53
|
+
prerelease: false
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED