create-qa-architect 5.13.3 → 5.13.4
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/.github/workflows/release.yml +6 -2
- package/LICENSE +0 -12
- package/config/defaults.js +18 -2
- package/docs/STRIPE-LIVE-MODE-DEPLOYMENT.md +208 -0
- package/docs/TURBOREPO-SUPPORT.md +1 -2
- package/docs/dev_guide/CONVENTIONS.md +1 -1
- package/lib/billing-dashboard.html +3 -9
- package/lib/commands/analyze-ci.js +20 -19
- package/lib/commands/deps.js +3 -3
- package/lib/dependency-monitoring-premium.js +1 -1
- package/lib/licensing.js +2 -2
- package/lib/project-module-type.js +66 -0
- package/lib/quality-tools-generator.js +9 -2
- package/package.json +10 -4
- package/setup.js +4 -3
- package/templates/scripts/smart-test-strategy.sh +1 -1
|
@@ -22,8 +22,12 @@ jobs:
|
|
|
22
22
|
node-version: '22'
|
|
23
23
|
registry-url: 'https://registry.npmjs.org'
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
# OIDC trusted publishing requires npm >= 11.5. We pin to 11.5.2 (the
|
|
26
|
+
# first OIDC-stable release) instead of `npm@latest` to avoid the
|
|
27
|
+
# MODULE_NOT_FOUND (promise-retry) regression hit when self-upgrading
|
|
28
|
+
# over the setup-node-provided npm on top of the newest 11.x.
|
|
29
|
+
- name: Pin npm for OIDC trusted publishing
|
|
30
|
+
run: npm install -g npm@11.5.2
|
|
27
31
|
|
|
28
32
|
- name: Install dependencies
|
|
29
33
|
run: npm ci --no-audit
|
package/LICENSE
CHANGED
|
@@ -22,21 +22,9 @@ TERMS OF USE:
|
|
|
22
22
|
- Smart Test Strategy
|
|
23
23
|
- Multi-language support
|
|
24
24
|
- Unlimited repos
|
|
25
|
-
- Team: Contact us (coming soon)
|
|
26
|
-
- All Pro features
|
|
27
|
-
- RBAC and team policies
|
|
28
|
-
- Slack alerts
|
|
29
|
-
- Multi-repo dashboard
|
|
30
|
-
- Enterprise: Contact us (coming soon)
|
|
31
|
-
- All Team features
|
|
32
|
-
- SSO/SAML integration
|
|
33
|
-
- Custom policies
|
|
34
|
-
- Compliance pack
|
|
35
|
-
- Dedicated TAM
|
|
36
25
|
|
|
37
26
|
3. VIBE LAB PRO BUNDLE
|
|
38
27
|
Pro tier is included in the Vibe Lab Pro subscription.
|
|
39
|
-
Team and Enterprise tiers are standalone purchases.
|
|
40
28
|
|
|
41
29
|
4. PERMITTED USES
|
|
42
30
|
- Use the free tier without restriction
|
package/config/defaults.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { detectDepMajor } = require('../lib/project-module-type')
|
|
4
|
+
|
|
3
5
|
const STYLELINT_EXTENSIONS = ['css', 'scss', 'sass', 'less', 'pcss']
|
|
4
6
|
const DEFAULT_STYLELINT_TARGET = `**/*.{${STYLELINT_EXTENSIONS.join(',')}}`
|
|
5
7
|
|
|
@@ -123,13 +125,27 @@ function getDefaultScripts({ stylelintTargets } = {}) {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
126
|
-
* @param {DefaultsOptions} [options]
|
|
128
|
+
* @param {DefaultsOptions & {projectPath?: string}} [options]
|
|
127
129
|
*/
|
|
128
|
-
function getDefaultDevDependencies({ typescript } = {}) {
|
|
130
|
+
function getDefaultDevDependencies({ typescript, projectPath } = {}) {
|
|
129
131
|
const devDeps = { ...clone(baseDevDependencies) }
|
|
130
132
|
if (typescript) {
|
|
131
133
|
Object.assign(devDeps, typeScriptDevDependencies)
|
|
132
134
|
}
|
|
135
|
+
|
|
136
|
+
// Align @vitest/coverage-v8 with the target project's installed vitest
|
|
137
|
+
// major. vitest and its coverage adapter must share a major or npm install
|
|
138
|
+
// fails with ERESOLVE. Without this, a project already on vitest@4 gets
|
|
139
|
+
// our @vitest/coverage-v8@^2.x injected and breaks.
|
|
140
|
+
if (projectPath) {
|
|
141
|
+
const vitestMajor = detectDepMajor(projectPath, 'vitest')
|
|
142
|
+
if (vitestMajor && vitestMajor >= 3) {
|
|
143
|
+
devDeps['@vitest/coverage-v8'] = `^${vitestMajor}.0.0`
|
|
144
|
+
// Also drop our pinned vitest so we don't downgrade the project
|
|
145
|
+
delete devDeps.vitest
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
133
149
|
return devDeps
|
|
134
150
|
}
|
|
135
151
|
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Stripe Live Mode Deployment Guide
|
|
2
|
+
|
|
3
|
+
Deploy the `webhook-handler.js` server to process real Stripe payments and issue signed Pro licenses automatically.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The payment flow:
|
|
8
|
+
1. Customer purchases Pro at `buildproven.ai/qa-architect`
|
|
9
|
+
2. Stripe fires a `checkout.session.completed` webhook to your server
|
|
10
|
+
3. `webhook-handler.js` validates the event, generates a signed license key, and saves it to Vercel Blob
|
|
11
|
+
4. Customer runs `npx create-qa-architect@latest --activate-license` and enters their key
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- A [Stripe](https://stripe.com) account with live mode enabled
|
|
18
|
+
- A [Vercel](https://vercel.com) account (for Blob storage and hosting)
|
|
19
|
+
- Node.js >=20
|
|
20
|
+
- The ED25519 private key used to sign licenses (in `public-key.pem` + your private key)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1: Create Stripe Products and Prices
|
|
25
|
+
|
|
26
|
+
In the [Stripe Dashboard](https://dashboard.stripe.com/products) → Products → Add product:
|
|
27
|
+
|
|
28
|
+
| Product | Price | Billing | Price ID (example) |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| QA Architect Pro | $49.00 | Monthly | `price_1St9K2Gv7Su9XNJbdYoH3K32` |
|
|
31
|
+
| QA Architect Pro | $490.00 | Yearly | `price_1St9KGGv7Su9XNJbrwKMsh1R` |
|
|
32
|
+
|
|
33
|
+
The price IDs above are already mapped in `webhook-handler.js:315-318`. If your actual Stripe price IDs differ, update `mapPriceToTier()` in `webhook-handler.js`.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Step 2: Set Up Vercel Blob Storage
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Install Vercel CLI
|
|
41
|
+
npm install -g vercel
|
|
42
|
+
|
|
43
|
+
# Link your project
|
|
44
|
+
vercel link
|
|
45
|
+
|
|
46
|
+
# Create a Blob store in the Vercel dashboard
|
|
47
|
+
# Dashboard → Storage → Create → Blob → name it "qa-architect-licenses"
|
|
48
|
+
# Copy the BLOB_READ_WRITE_TOKEN
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 3: Deploy to Vercel
|
|
54
|
+
|
|
55
|
+
`webhook-handler.js` exports an Express app compatible with Vercel serverless.
|
|
56
|
+
|
|
57
|
+
Create `vercel.json` in the project root (do not commit secrets):
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"version": 2,
|
|
62
|
+
"builds": [{ "src": "webhook-handler.js", "use": "@vercel/node" }],
|
|
63
|
+
"routes": [{ "src": "/(.*)", "dest": "/webhook-handler.js" }]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Deploy:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
vercel --prod
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Your webhook URL will be: `https://your-project.vercel.app/webhook`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Step 4: Set Environment Variables
|
|
78
|
+
|
|
79
|
+
In the Vercel dashboard → Project → Settings → Environment Variables, add:
|
|
80
|
+
|
|
81
|
+
| Variable | Value | Notes |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `STRIPE_SECRET_KEY` | `sk_live_...` | From Stripe Dashboard → Developers → API keys |
|
|
84
|
+
| `STRIPE_WEBHOOK_SECRET` | `whsec_...` | Generated in Step 5 below |
|
|
85
|
+
| `LICENSE_REGISTRY_PRIVATE_KEY` | Base64-encoded ED25519 private key | See note below |
|
|
86
|
+
| `LICENSE_REGISTRY_KEY_ID` | `default` | Or a versioned ID like `v1` |
|
|
87
|
+
| `BLOB_READ_WRITE_TOKEN` | `vercel_blob_...` | From Vercel Blob store settings |
|
|
88
|
+
| `STATUS_API_TOKEN` | A strong random string | Protects the `/status` endpoint |
|
|
89
|
+
| `NODE_ENV` | `production` | Enables HSTS and production error handling |
|
|
90
|
+
|
|
91
|
+
**Private key format:** The key must be a PEM-encoded ED25519 private key, base64-encoded as a single line (no newlines):
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Encode your private key for the env var
|
|
95
|
+
base64 -w 0 < your-private-key.pem
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The `loadKeyFromEnv()` function in `lib/license-signing.js` decodes it automatically.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Step 5: Register the Stripe Webhook
|
|
103
|
+
|
|
104
|
+
In the [Stripe Dashboard](https://dashboard.stripe.com/webhooks) → Webhooks → Add endpoint:
|
|
105
|
+
|
|
106
|
+
- **URL:** `https://your-project.vercel.app/webhook`
|
|
107
|
+
- **Events to listen for:**
|
|
108
|
+
- `checkout.session.completed`
|
|
109
|
+
- `invoice.payment_succeeded`
|
|
110
|
+
- `customer.subscription.deleted`
|
|
111
|
+
|
|
112
|
+
Copy the **Signing secret** (`whsec_...`) and add it as `STRIPE_WEBHOOK_SECRET` in Vercel.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Step 6: Verify the Deployment
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Health check
|
|
120
|
+
curl https://your-project.vercel.app/health
|
|
121
|
+
|
|
122
|
+
# Expected response:
|
|
123
|
+
# {"status":"ok","timestamp":"...","database":"missing"}
|
|
124
|
+
# (missing is fine before any licenses are issued)
|
|
125
|
+
|
|
126
|
+
# Test license database endpoint (used by CLI)
|
|
127
|
+
curl https://your-project.vercel.app/legitimate-licenses.json
|
|
128
|
+
|
|
129
|
+
# Test status endpoint (replace TOKEN with your STATUS_API_TOKEN)
|
|
130
|
+
curl -H "Authorization: Bearer TOKEN" https://your-project.vercel.app/status
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Step 7: Test with Stripe Test Mode First
|
|
136
|
+
|
|
137
|
+
Before going live, test the full flow:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Install Stripe CLI
|
|
141
|
+
brew install stripe/stripe-cli/stripe
|
|
142
|
+
|
|
143
|
+
# Forward webhooks to your local server
|
|
144
|
+
stripe listen --forward-to localhost:3000/webhook
|
|
145
|
+
|
|
146
|
+
# Trigger a test checkout event
|
|
147
|
+
stripe trigger checkout.session.completed
|
|
148
|
+
|
|
149
|
+
# Verify a license was created
|
|
150
|
+
curl http://localhost:3000/legitimate-licenses.json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Switch to live mode keys once the test flow works end-to-end.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Step 8: Connect Your Checkout Page
|
|
158
|
+
|
|
159
|
+
Your Stripe Checkout session must:
|
|
160
|
+
- Use one of the two price IDs mapped in `mapPriceToTier()`
|
|
161
|
+
- Be a **subscription** mode checkout (not one-time payment)
|
|
162
|
+
- Collect a customer email
|
|
163
|
+
|
|
164
|
+
Example Stripe Checkout session creation (server-side):
|
|
165
|
+
|
|
166
|
+
```javascript
|
|
167
|
+
const session = await stripe.checkout.sessions.create({
|
|
168
|
+
mode: 'subscription',
|
|
169
|
+
payment_method_types: ['card'],
|
|
170
|
+
line_items: [{ price: 'price_1St9K2Gv7Su9XNJbdYoH3K32', quantity: 1 }],
|
|
171
|
+
success_url: 'https://buildproven.ai/qa-architect/success?session_id={CHECKOUT_SESSION_ID}',
|
|
172
|
+
cancel_url: 'https://buildproven.ai/qa-architect',
|
|
173
|
+
})
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## License Key Delivery
|
|
179
|
+
|
|
180
|
+
After a successful checkout, the license key is stored in Vercel Blob. The customer retrieves it by running:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npx create-qa-architect@latest --activate-license
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
They enter their email and the license key format `QAA-XXXX-XXXX-XXXX-XXXX`.
|
|
187
|
+
|
|
188
|
+
The key is deterministic from the Stripe customer ID — you can regenerate it at any time using `admin-license.js` or `scripts/generate-license-keys.js`.
|
|
189
|
+
|
|
190
|
+
> **Note:** The current flow requires customers to manually enter their key. Consider adding an email delivery step in `handleCheckoutCompleted()` in `webhook-handler.js` (the comment at line 511 marks where to add this).
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Cancellation Handling
|
|
195
|
+
|
|
196
|
+
When a subscription is canceled in Stripe, the `customer.subscription.deleted` event fires and `handleSubscriptionCanceled()` marks the license as `status: "canceled"` in the database. The CLI checks this status during `getLicenseInfo()` and downgrades the user to FREE tier automatically.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Troubleshooting
|
|
201
|
+
|
|
202
|
+
| Symptom | Likely cause | Fix |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| Webhook returns 400 | Wrong `STRIPE_WEBHOOK_SECRET` | Re-copy the signing secret from Stripe Dashboard |
|
|
205
|
+
| License not created after payment | Unknown price ID | Update `mapPriceToTier()` with your actual Stripe price IDs |
|
|
206
|
+
| CLI can't find license | Wrong blob URL | Check `BLOB_PATHS` in `lib/blob-storage.js` matches your Vercel Blob store |
|
|
207
|
+
| `sk_test_` warning in logs | Test key in production | Replace with `sk_live_...` key |
|
|
208
|
+
| `/status` returns 503 | `STATUS_API_TOKEN` not set | Add the env var in Vercel settings |
|
|
@@ -149,7 +149,7 @@ Turborepo caches and parallelizes tasks based on `turbo.json`:
|
|
|
149
149
|
|
|
150
150
|
### Issue: "package.json not found" in subdirectory
|
|
151
151
|
|
|
152
|
-
This is expected in monorepos. qa-architect gracefully handles missing package.json in workspace subdirectories
|
|
152
|
+
This is expected in monorepos. qa-architect gracefully handles missing package.json in workspace subdirectories.
|
|
153
153
|
|
|
154
154
|
## Testing
|
|
155
155
|
|
|
@@ -165,7 +165,6 @@ npx create-qa-architect@latest --dry-run
|
|
|
165
165
|
|
|
166
166
|
## Related Documentation
|
|
167
167
|
|
|
168
|
-
- [Monorepo Compatibility Fix](./MONOREPO-COMPATIBILITY-FIX.md) - Handling workspaces
|
|
169
168
|
- [CI Cost Analysis](./CI-COST-ANALYSIS.md) - Workflow tier pricing
|
|
170
169
|
- [pnpm CI Example](../.github/workflows/pnpm-ci.yml.example) - Complete example
|
|
171
170
|
|
|
@@ -11,7 +11,7 @@ QA Architect (`create-qa-architect`) is a CLI tool that bootstraps quality autom
|
|
|
11
11
|
|
|
12
12
|
**Entry point:** `setup.js` — CLI argument parsing and orchestration. Run as `npx create-qa-architect` or `node setup.js`.
|
|
13
13
|
|
|
14
|
-
**npm package:** `create-qa-architect` v5.13.
|
|
14
|
+
**npm package:** `create-qa-architect` v5.13.4 (published via GitHub trusted publishing)
|
|
15
15
|
|
|
16
16
|
## Directory Structure
|
|
17
17
|
|
|
@@ -442,15 +442,9 @@
|
|
|
442
442
|
)
|
|
443
443
|
} finally {
|
|
444
444
|
checkoutBtn.disabled = false
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
: 'Start Pro Subscription - $49/month'
|
|
449
|
-
} else {
|
|
450
|
-
checkoutBtn.textContent = isFounder
|
|
451
|
-
? 'Start Enterprise Subscription - $74.50/month (Founder Price)'
|
|
452
|
-
: 'Start Enterprise Subscription - $149/month'
|
|
453
|
-
}
|
|
445
|
+
checkoutBtn.textContent = isFounder
|
|
446
|
+
? 'Start Pro Subscription - $24.50/month (Founder Price)'
|
|
447
|
+
: 'Start Pro Subscription - $49/month'
|
|
454
448
|
}
|
|
455
449
|
}
|
|
456
450
|
|
|
@@ -12,6 +12,7 @@ const path = require('path')
|
|
|
12
12
|
const { execSync } = require('child_process')
|
|
13
13
|
const yaml = require('js-yaml')
|
|
14
14
|
const { showProgress } = require('../ui-helpers')
|
|
15
|
+
const { hasFeature, showUpgradeMessage } = require('../licensing')
|
|
15
16
|
|
|
16
17
|
const DAYS_PER_MONTH = 30
|
|
17
18
|
const DEFAULT_PULL_REQUEST_FACTOR = 0.8
|
|
@@ -383,17 +384,20 @@ function calculateMonthlyCosts(workflows, commitsPerDay, options = {}) {
|
|
|
383
384
|
const workflowRunsPerDay = totalWorkflowRunsPerMonth / DAYS_PER_MONTH
|
|
384
385
|
|
|
385
386
|
// GitHub Actions pricing (as of 2024)
|
|
386
|
-
const FREE_TIER_MINUTES = 2000 // Free
|
|
387
|
-
const
|
|
387
|
+
const FREE_TIER_MINUTES = 2000 // GitHub Free plan monthly limit
|
|
388
|
+
const GITHUB_TEAM_PLAN_MINUTES = 3000 // GitHub Team plan monthly limit ($4/user/month)
|
|
388
389
|
const COST_PER_MINUTE = 0.008 // $0.008/min for private repos
|
|
389
390
|
const TARGET_BUDGET_MINUTES = 1000
|
|
390
391
|
const STRETCH_BUDGET_MINUTES = 1500
|
|
391
392
|
|
|
392
393
|
const freeOverage = Math.max(0, minutesPerMonth - FREE_TIER_MINUTES)
|
|
393
|
-
const
|
|
394
|
+
const githubTeamOverage = Math.max(
|
|
395
|
+
0,
|
|
396
|
+
minutesPerMonth - GITHUB_TEAM_PLAN_MINUTES
|
|
397
|
+
)
|
|
394
398
|
|
|
395
399
|
const freeOverageCost = freeOverage * COST_PER_MINUTE
|
|
396
|
-
const
|
|
400
|
+
const githubTeamOverageCost = githubTeamOverage * COST_PER_MINUTE
|
|
397
401
|
|
|
398
402
|
return {
|
|
399
403
|
minutesPerMonth,
|
|
@@ -419,11 +423,11 @@ function calculateMonthlyCosts(workflows, commitsPerDay, options = {}) {
|
|
|
419
423
|
withinLimit: minutesPerMonth <= FREE_TIER_MINUTES,
|
|
420
424
|
},
|
|
421
425
|
team: {
|
|
422
|
-
limit:
|
|
423
|
-
overage:
|
|
424
|
-
cost:
|
|
425
|
-
withinLimit: minutesPerMonth <=
|
|
426
|
-
monthlyCost: 4, // $4/user/month
|
|
426
|
+
limit: GITHUB_TEAM_PLAN_MINUTES,
|
|
427
|
+
overage: githubTeamOverage,
|
|
428
|
+
cost: githubTeamOverageCost,
|
|
429
|
+
withinLimit: minutesPerMonth <= GITHUB_TEAM_PLAN_MINUTES,
|
|
430
|
+
monthlyCost: 4, // $4/user/month (GitHub Team plan price)
|
|
427
431
|
},
|
|
428
432
|
},
|
|
429
433
|
}
|
|
@@ -672,10 +676,10 @@ function generateReport(analysis) {
|
|
|
672
676
|
console.log('')
|
|
673
677
|
console.log('Alternative options:')
|
|
674
678
|
|
|
675
|
-
// Team tier
|
|
679
|
+
// GitHub Team plan comparison (GitHub's billing tier, not QA Architect tier)
|
|
676
680
|
if (costs.tiers.team.withinLimit) {
|
|
677
681
|
console.log(
|
|
678
|
-
` Team plan ($${costs.tiers.team.monthlyCost}/user/month): ✅ Stays within ${costs.tiers.team.limit.toLocaleString()} min limit`
|
|
682
|
+
` GitHub Team plan ($${costs.tiers.team.monthlyCost}/user/month): ✅ Stays within ${costs.tiers.team.limit.toLocaleString()} min limit`
|
|
679
683
|
)
|
|
680
684
|
const savings = costs.tiers.free.cost - costs.tiers.team.monthlyCost
|
|
681
685
|
if (savings > 0) {
|
|
@@ -683,7 +687,7 @@ function generateReport(analysis) {
|
|
|
683
687
|
}
|
|
684
688
|
} else {
|
|
685
689
|
console.log(
|
|
686
|
-
` Team plan ($${costs.tiers.team.monthlyCost}/user/month): Still exceeds (${costs.tiers.team.overage.toLocaleString()} min overage)`
|
|
690
|
+
` GitHub Team plan ($${costs.tiers.team.monthlyCost}/user/month): Still exceeds (${costs.tiers.team.overage.toLocaleString()} min overage)`
|
|
687
691
|
)
|
|
688
692
|
console.log(
|
|
689
693
|
` Total cost: $${(costs.tiers.team.monthlyCost + costs.tiers.team.cost).toFixed(2)}/month`
|
|
@@ -772,13 +776,10 @@ function generateReport(analysis) {
|
|
|
772
776
|
async function handleAnalyzeCi() {
|
|
773
777
|
const projectPath = process.cwd()
|
|
774
778
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
// showUpgradeMessage('GitHub Actions cost analysis')
|
|
780
|
-
// process.exit(1)
|
|
781
|
-
// }
|
|
779
|
+
if (!hasFeature('ciCostAnalysis')) {
|
|
780
|
+
showUpgradeMessage('GitHub Actions cost analysis')
|
|
781
|
+
process.exit(1)
|
|
782
|
+
}
|
|
782
783
|
|
|
783
784
|
const spinner = showProgress('Analyzing GitHub Actions workflows...')
|
|
784
785
|
|
package/lib/commands/deps.js
CHANGED
|
@@ -60,7 +60,7 @@ function detectRubyProject(projectPath) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Handle dependency monitoring command (Free/Pro
|
|
63
|
+
* Handle dependency monitoring command (Free/Pro)
|
|
64
64
|
*/
|
|
65
65
|
async function handleDependencyMonitoring() {
|
|
66
66
|
const projectPath = process.cwd()
|
|
@@ -95,7 +95,7 @@ async function handleDependencyMonitoring() {
|
|
|
95
95
|
if (!capCheck.allowed) {
|
|
96
96
|
console.error(`❌ ${capCheck.reason}`)
|
|
97
97
|
console.error(
|
|
98
|
-
' Upgrade to Pro
|
|
98
|
+
' Upgrade to Pro for unlimited runs: https://buildproven.ai/qa-architect'
|
|
99
99
|
)
|
|
100
100
|
process.exit(1)
|
|
101
101
|
}
|
|
@@ -108,7 +108,7 @@ async function handleDependencyMonitoring() {
|
|
|
108
108
|
// Free tier only supports npm projects. Fail fast with a clear message.
|
|
109
109
|
if (!shouldUsePremium && !hasNpm && (hasPython || hasRust || hasRuby)) {
|
|
110
110
|
console.error(
|
|
111
|
-
'❌ Dependency monitoring for this project requires a Pro
|
|
111
|
+
'❌ Dependency monitoring for this project requires a Pro license.'
|
|
112
112
|
)
|
|
113
113
|
console.error(
|
|
114
114
|
' Free tier supports npm projects only. Detected non-npm ecosystems.'
|
package/lib/licensing.js
CHANGED
|
@@ -947,9 +947,9 @@ function saveUsage(usage) {
|
|
|
947
947
|
|
|
948
948
|
throw error // Don't allow FREE tier to continue without tracking
|
|
949
949
|
} else {
|
|
950
|
-
// Pro
|
|
950
|
+
// Pro - warn but don't fail
|
|
951
951
|
console.warn(`⚠️ Failed to save usage data: ${error.message}`)
|
|
952
|
-
console.warn(` This won't affect Pro
|
|
952
|
+
console.warn(` This won't affect Pro functionality`)
|
|
953
953
|
return false
|
|
954
954
|
}
|
|
955
955
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Detect the target project's module system.
|
|
8
|
+
*
|
|
9
|
+
* Returns 'esm' if package.json has `"type": "module"`, otherwise 'cjs'.
|
|
10
|
+
* Missing or unreadable package.json falls back to 'cjs' (Node's default).
|
|
11
|
+
*
|
|
12
|
+
* @param {string} projectPath - Path to project root
|
|
13
|
+
* @returns {'esm'|'cjs'}
|
|
14
|
+
*/
|
|
15
|
+
function detectModuleType(projectPath) {
|
|
16
|
+
const packageJsonPath = path.join(projectPath, 'package.json')
|
|
17
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
18
|
+
return 'cjs'
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
22
|
+
return pkg.type === 'module' ? 'esm' : 'cjs'
|
|
23
|
+
} catch {
|
|
24
|
+
return 'cjs'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Convenience: true when the target project is ESM.
|
|
30
|
+
* @param {string} projectPath
|
|
31
|
+
* @returns {boolean}
|
|
32
|
+
*/
|
|
33
|
+
function isESMProject(projectPath) {
|
|
34
|
+
return detectModuleType(projectPath) === 'esm'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Detect the major version of an installed dep in the target project's
|
|
39
|
+
* package.json (checks dependencies + devDependencies). Returns null if
|
|
40
|
+
* not present or unparseable.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} projectPath
|
|
43
|
+
* @param {string} depName
|
|
44
|
+
* @returns {number|null}
|
|
45
|
+
*/
|
|
46
|
+
function detectDepMajor(projectPath, depName) {
|
|
47
|
+
const packageJsonPath = path.join(projectPath, 'package.json')
|
|
48
|
+
if (!fs.existsSync(packageJsonPath)) return null
|
|
49
|
+
try {
|
|
50
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
51
|
+
const range =
|
|
52
|
+
(pkg.dependencies && pkg.dependencies[depName]) ||
|
|
53
|
+
(pkg.devDependencies && pkg.devDependencies[depName])
|
|
54
|
+
if (!range) return null
|
|
55
|
+
const match = String(range).match(/(\d+)\./)
|
|
56
|
+
return match ? parseInt(match[1], 10) : null
|
|
57
|
+
} catch {
|
|
58
|
+
return null
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
detectModuleType,
|
|
64
|
+
isESMProject,
|
|
65
|
+
detectDepMajor,
|
|
66
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const fs = require('fs')
|
|
12
12
|
const path = require('path')
|
|
13
|
+
const { isESMProject } = require('./project-module-type')
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Generate Lighthouse CI configuration
|
|
@@ -435,11 +436,17 @@ function writeSizeLimitConfig(projectPath, options = {}) {
|
|
|
435
436
|
}
|
|
436
437
|
|
|
437
438
|
/**
|
|
438
|
-
* Write commitlint config to project
|
|
439
|
+
* Write commitlint config to project.
|
|
440
|
+
* ESM projects ("type": "module" in package.json) need `.cjs` so Node
|
|
441
|
+
* loads our CommonJS `module.exports` template without throwing
|
|
442
|
+
* "module is not defined in ES module scope".
|
|
439
443
|
* @param {string} projectPath - Path to project
|
|
440
444
|
*/
|
|
441
445
|
function writeCommitlintConfig(projectPath) {
|
|
442
|
-
const
|
|
446
|
+
const filename = isESMProject(projectPath)
|
|
447
|
+
? 'commitlint.config.cjs'
|
|
448
|
+
: 'commitlint.config.js'
|
|
449
|
+
const configPath = path.join(projectPath, filename)
|
|
443
450
|
const config = generateCommitlintConfig()
|
|
444
451
|
|
|
445
452
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-qa-architect",
|
|
3
|
-
"version": "5.13.
|
|
3
|
+
"version": "5.13.4",
|
|
4
4
|
"description": "QA Architect - Bootstrap quality automation for JavaScript/TypeScript and Python projects with GitHub Actions, pre-commit hooks, linting, formatting, and smart test strategy",
|
|
5
5
|
"main": "setup.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"validate:comprehensive": "node setup.js --comprehensive --no-markdownlint",
|
|
21
21
|
"validate:all": "npm run validate:comprehensive && npm run security:audit",
|
|
22
22
|
"validate:pre-push": "npm run test:patterns --if-present && npm run lint && npm run format:check && npm run test:commands --if-present && npm test --if-present",
|
|
23
|
-
"test": "export QAA_DEVELOPER=true && node tests/result-types.test.js && node tests/setup.test.js && node tests/integration.test.js && node tests/error-paths.test.js && node tests/error-messages.test.js && node tests/cache-manager.test.js && node tests/parallel-validation.test.js && node tests/python-integration.test.js && node tests/interactive.test.js && node tests/monorepo.test.js && node tests/template-loader.test.js && node tests/critical-fixes.test.js && node tests/interactive-routing-fix.test.js && node tests/telemetry.test.js && node tests/error-reporter.test.js && node tests/premium-dependency-monitoring.test.js && node tests/multi-language-dependency-monitoring.test.js && node tests/cli-deps-integration.test.js && node tests/deps-edge-cases.test.js && node tests/real-world-packages.test.js && node tests/validation-factory.test.js && node tests/setup-error-coverage.test.js && node tests/python-detection-sensitivity.test.js && node tests/python-parser-fixes.test.js && node tests/licensing.test.js && node tests/security-licensing.test.js && node tests/real-purchase-flow.test.js && node tests/base-validator.test.js && node tests/dependency-monitoring-basic.test.js && node tests/workflow-validation.test.js && node tests/workflow-tiers.test.js && node tests/analyze-ci.test.js && node tests/analyze-ci-integration.test.js && node tests/setup-critical-paths.test.js && node tests/project-maturity.test.js && node tests/project-maturity-cli.test.js && node tests/package-manager-detection.test.js && node tests/check-docs.test.js && node tests/validate-command-patterns.test.js && node tests/gitleaks-binary-resolution.test.js && node tests/gitleaks-production-checksums.test.js && node tests/gitleaks-checksum-verification.test.js && node tests/gitleaks-real-binary-test.js && node tests/tier-enforcement.test.js && node tests/lazy-loader.test.js && node tests/template-content-validation.test.js && node tests/ci-environment.test.js && node tests/turborepo-detection.test.js && node tests/consumer-workflow-integration.test.js",
|
|
24
|
-
"test:unit": "export QAA_DEVELOPER=true && node tests/result-types.test.js && node tests/setup.test.js && node tests/error-paths.test.js && node tests/error-messages.test.js && node tests/cache-manager.test.js && node tests/template-loader.test.js && node tests/telemetry.test.js && node tests/error-reporter.test.js && node tests/validation-factory.test.js && node tests/setup-error-coverage.test.js && node tests/licensing.test.js && node tests/security-licensing.test.js && node tests/base-validator.test.js && node tests/dependency-monitoring-basic.test.js && node tests/workflow-validation.test.js && node tests/workflow-tiers.test.js && node tests/analyze-ci.test.js && node tests/setup-critical-paths.test.js && node tests/project-maturity.test.js && node tests/package-manager-detection.test.js && node tests/check-docs.test.js && node tests/validate-command-patterns.test.js && node tests/gitleaks-binary-resolution.test.js && node tests/gitleaks-production-checksums.test.js && node tests/gitleaks-checksum-verification.test.js && node tests/lazy-loader.test.js && node tests/template-content-validation.test.js && node tests/ci-environment.test.js && node tests/turborepo-detection.test.js",
|
|
23
|
+
"test": "export QAA_DEVELOPER=true && node tests/result-types.test.js && node tests/setup.test.js && node tests/integration.test.js && node tests/error-paths.test.js && node tests/error-messages.test.js && node tests/cache-manager.test.js && node tests/parallel-validation.test.js && node tests/python-integration.test.js && node tests/interactive.test.js && node tests/monorepo.test.js && node tests/template-loader.test.js && node tests/critical-fixes.test.js && node tests/interactive-routing-fix.test.js && node tests/telemetry.test.js && node tests/error-reporter.test.js && node tests/premium-dependency-monitoring.test.js && node tests/multi-language-dependency-monitoring.test.js && node tests/cli-deps-integration.test.js && node tests/deps-edge-cases.test.js && node tests/real-world-packages.test.js && node tests/validation-factory.test.js && node tests/setup-error-coverage.test.js && node tests/python-detection-sensitivity.test.js && node tests/python-parser-fixes.test.js && node tests/licensing.test.js && node tests/security-licensing.test.js && node tests/real-purchase-flow.test.js && node tests/base-validator.test.js && node tests/dependency-monitoring-basic.test.js && node tests/workflow-validation.test.js && node tests/workflow-tiers.test.js && node tests/analyze-ci.test.js && node tests/analyze-ci-integration.test.js && node tests/setup-critical-paths.test.js && node tests/project-maturity.test.js && node tests/project-maturity-cli.test.js && node tests/package-manager-detection.test.js && node tests/check-docs.test.js && node tests/validate-command-patterns.test.js && node tests/gitleaks-binary-resolution.test.js && node tests/gitleaks-production-checksums.test.js && node tests/gitleaks-checksum-verification.test.js && node tests/gitleaks-real-binary-test.js && node tests/tier-enforcement.test.js && node tests/lazy-loader.test.js && node tests/template-content-validation.test.js && node tests/ci-environment.test.js && node tests/turborepo-detection.test.js && node tests/consumer-workflow-integration.test.js && node tests/esm-project-support.test.js",
|
|
24
|
+
"test:unit": "export QAA_DEVELOPER=true && node tests/result-types.test.js && node tests/setup.test.js && node tests/error-paths.test.js && node tests/error-messages.test.js && node tests/cache-manager.test.js && node tests/template-loader.test.js && node tests/telemetry.test.js && node tests/error-reporter.test.js && node tests/validation-factory.test.js && node tests/setup-error-coverage.test.js && node tests/licensing.test.js && node tests/security-licensing.test.js && node tests/base-validator.test.js && node tests/dependency-monitoring-basic.test.js && node tests/workflow-validation.test.js && node tests/workflow-tiers.test.js && node tests/analyze-ci.test.js && node tests/setup-critical-paths.test.js && node tests/project-maturity.test.js && node tests/package-manager-detection.test.js && node tests/check-docs.test.js && node tests/validate-command-patterns.test.js && node tests/gitleaks-binary-resolution.test.js && node tests/gitleaks-production-checksums.test.js && node tests/gitleaks-checksum-verification.test.js && node tests/lazy-loader.test.js && node tests/template-content-validation.test.js && node tests/ci-environment.test.js && node tests/turborepo-detection.test.js && node tests/esm-project-support.test.js",
|
|
25
25
|
"test:fast": "npm run test:unit",
|
|
26
26
|
"test:medium": "npm run test:fast && npm run test:patterns && npm run test:commands",
|
|
27
27
|
"test:slow": "export QAA_DEVELOPER=true && node tests/python-integration.test.js && node tests/interactive.test.js && node tests/monorepo.test.js && node tests/critical-fixes.test.js && node tests/interactive-routing-fix.test.js && node tests/premium-dependency-monitoring.test.js && node tests/multi-language-dependency-monitoring.test.js && node tests/cli-deps-integration.test.js && node tests/real-world-packages.test.js && node tests/python-detection-sensitivity.test.js && node tests/python-parser-fixes.test.js && node tests/real-purchase-flow.test.js && node tests/project-maturity-cli.test.js && node tests/gitleaks-real-binary-test.js && npm run test:e2e",
|
|
@@ -121,7 +121,13 @@
|
|
|
121
121
|
"table": {
|
|
122
122
|
"ajv": "$ajv"
|
|
123
123
|
}
|
|
124
|
-
}
|
|
124
|
+
},
|
|
125
|
+
"picomatch": "^2.3.2",
|
|
126
|
+
"basic-ftp": "^5.3.0",
|
|
127
|
+
"tmp": "^0.2.5",
|
|
128
|
+
"external-editor": "^3.1.0",
|
|
129
|
+
"inquirer": "^13.4.1",
|
|
130
|
+
"esbuild": "^0.25.0"
|
|
125
131
|
},
|
|
126
132
|
"devDependencies": {
|
|
127
133
|
"@commitlint/cli": "^19.0.0",
|
package/setup.js
CHANGED
|
@@ -723,7 +723,7 @@ VALIDATION OPTIONS:
|
|
|
723
723
|
|
|
724
724
|
LICENSE, TELEMETRY & ERROR REPORTING:
|
|
725
725
|
--license-status Show current license tier and available features
|
|
726
|
-
--activate-license Activate Pro
|
|
726
|
+
--activate-license Activate Pro license key from Stripe purchase
|
|
727
727
|
--telemetry-status Show telemetry status and opt-in instructions
|
|
728
728
|
--error-reporting-status Show error reporting status and privacy information
|
|
729
729
|
|
|
@@ -750,7 +750,7 @@ EXAMPLES:
|
|
|
750
750
|
→ Show current license tier and upgrade options
|
|
751
751
|
|
|
752
752
|
npx create-qa-architect@latest --activate-license
|
|
753
|
-
→ Activate Pro
|
|
753
|
+
→ Activate Pro license after Stripe purchase
|
|
754
754
|
|
|
755
755
|
npx create-qa-architect@latest --telemetry-status
|
|
756
756
|
→ Show telemetry status and privacy information
|
|
@@ -1398,6 +1398,7 @@ HELP:
|
|
|
1398
1398
|
console.log('📦 Adding devDependencies...')
|
|
1399
1399
|
const defaultDevDependencies = getDefaultDevDependencies({
|
|
1400
1400
|
typescript: usesTypeScript,
|
|
1401
|
+
projectPath: process.cwd(),
|
|
1401
1402
|
})
|
|
1402
1403
|
packageJson.devDependencies = mergeDevDependencies(
|
|
1403
1404
|
packageJson.devDependencies || {},
|
|
@@ -1974,7 +1975,7 @@ try {
|
|
|
1974
1975
|
const CAP = 50
|
|
1975
1976
|
if (usage.prePushRuns >= CAP) {
|
|
1976
1977
|
console.error('❌ Free tier limit reached: ' + usage.prePushRuns + '/' + CAP + ' pre-push runs this month')
|
|
1977
|
-
console.error(' Upgrade to Pro
|
|
1978
|
+
console.error(' Upgrade to Pro: https://buildproven.ai/qa-architect')
|
|
1978
1979
|
process.exit(1)
|
|
1979
1980
|
}
|
|
1980
1981
|
|