Skip to content

Commit 3243f28

Browse files
feat: v1.0.1 — CI, tests, --min-score, --fail-on, clean publish config
- Add 54 unit tests (vitest) across scorer, rules, audit - Fix scoring weights: critical=-20, warning=-8, info=-2 - Add --min-score <n> flag for CI/CD threshold gates - Add --fail-on warnings strict mode for CI - Fix hardcoded version in cli.ts (reads from package.json at runtime) - Add .github/workflows/ci.yml with build + smoke test - Add .npmignore and files[] in package.json for clean publish - Add types field to package.json for TypeScript consumers - Add test script + vitest to devDependencies - Improve reporter: title display, sorted findings within categories, pass suggestions suppressed, cleaner summary line - Update README with new flags, updated grade table, programmatic API 54 tests passing. Ready for npm publish.
1 parent 935148d commit 3243f28

14 files changed

Lines changed: 2693 additions & 664 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '20'
17+
cache: 'npm'
18+
- run: npm ci
19+
- run: npm run build
20+
- name: Smoke test — admachine.ai
21+
run: node dist/cli.js https://admachine.ai --json | jq '.score'

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/
2+
.github/
3+
tsconfig.json
4+
*.log

README.md

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 🔥 landing-roast
22

3+
[![CI](https://github.com/SlashImagine/landing-roast/actions/workflows/ci.yml/badge.svg)](https://github.com/SlashImagine/landing-roast/actions/workflows/ci.yml)
4+
[![npm version](https://img.shields.io/npm/v/landing-roast.svg)](https://www.npmjs.com/package/landing-roast)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6+
37
**Roast any landing page for conversion issues. Get actionable fixes in seconds.**
48

59
Stop guessing why your landing page isn't converting. `landing-roast` runs 20+ conversion heuristics against any URL and tells you exactly what's broken — with specific fixes.
@@ -73,13 +77,19 @@ landing-roast https://example.com --json
7377
landing-roast https://example.com --json | jq '.findings[] | select(.severity == "critical")'
7478
```
7579

76-
## Use Cases
80+
## CI/CD Integration
7781

78-
- **Pre-launch checklist** — Catch conversion killers before going live
79-
- **Competitor analysis** — Roast competitor landing pages to find their gaps
80-
- **Client audits** — Quick deliverable for marketing consultants
81-
- **CI/CD integration** — Fail deploys that introduce conversion regressions (exits with code 1 on criticals)
82-
- **Content marketing** — "We roasted 100 SaaS landing pages. Here's what we found."
82+
`landing-roast` exits with code 1 when critical issues are found — perfect for deploy gates:
83+
84+
```yaml
85+
# GitHub Actions example
86+
- name: Audit landing page
87+
run: npx landing-roast https://your-site.com --json > audit.json
88+
89+
# Block deploy on critical issues
90+
- name: Check for critical issues
91+
run: npx landing-roast https://your-site.com
92+
```
8393
8494
## Programmatic API
8595
@@ -88,38 +98,59 @@ import { fetchPage, auditPage, formatReport } from 'landing-roast';
8898

8999
const page = await fetchPage('https://example.com');
90100
const result = auditPage(page);
91-
92-
console.log(result.score); // 72
93-
console.log(result.findings); // Finding[]
94-
console.log(formatReport(result)); // Formatted terminal output
101+
console.log(result.score); // 0-100
102+
console.log(result.findings); // Finding[]
103+
console.log(formatReport(result)); // Formatted terminal output
95104
```
96105

106+
## Use Cases
107+
108+
- **Pre-launch checklist** — Catch conversion killers before going live
109+
- **Competitor analysis** — Roast competitor landing pages to find their gaps
110+
- **Client audits** — Quick deliverable for marketing consultants
111+
- **CI/CD gates** — Prevent shipping pages with critical conversion issues
112+
- **A/B test validation** — Verify new variants meet conversion baselines
113+
97114
## Scoring
98115

99-
- **A (90-100)** 🔥 — This page converts. Respect.
100-
- **B (80-89)** 👍 — Solid page with room to improve.
101-
- **C (65-79)** 😬 — Leaving money on the table.
102-
- **D (50-64)** 💀 — Your landing page needs serious help.
103-
- **F (0-49)** 🪦 — This page is a conversion graveyard.
116+
| Grade | Score | Meaning |
117+
|-------|-------|---------|
118+
| A | 90-100 | This page converts. Respect. |
119+
| B | 80-89 | Solid page with room to improve. |
120+
| C | 65-79 | Leaving money on the table. |
121+
| D | 50-64 | Your landing page needs serious help. |
122+
| F | 0-49 | This page is a conversion graveyard. |
104123

105-
Each finding has a severity:
106-
- 🔴 **Critical** (-15pts) — Directly kills conversion
107-
- 🟡 **Warning** (-7pts) — Significantly impacts conversion
108-
- 🔵 **Info** (-2pts) — Nice to fix, minor impact
109-
-**Pass** (0pts) — You're doing this right
124+
Severity weights: Critical (-15), Warning (-7), Info (-2), Pass (0).
110125

111-
## Why This Exists
126+
## Contributing
112127

113-
Every marketer has shipped a landing page and wondered "why isn't this converting?" The answer is usually a handful of basic mistakes — no clear CTA, missing social proof, slow load time, broken mobile experience.
128+
Contributions welcome! Here's how:
114129

115-
Tools like Google Lighthouse cover performance. `landing-roast` covers **conversion** — the stuff that actually makes people buy.
130+
1. Fork the repo
131+
2. Create a feature branch (`git checkout -b feat/my-rule`)
132+
3. Add your rule to `src/rules.ts` and register it in `allRules`
133+
4. Add tests in `test/rules.test.ts`
134+
5. Run `npm test` to verify
135+
6. Open a PR
116136

117-
Built by [Ad Machine](https://admachine.ai) — the AI ad creative platform.
137+
### Adding a new rule
118138

119-
## Contributing
139+
Rules are simple functions that take a `PageData` and Cheerio instance, and return `Finding[]`:
120140

121-
PRs welcome. The rule system is modular — add a new rule in `src/rules.ts` and it automatically runs.
141+
```typescript
142+
const myRule: Rule = (page, $) => {
143+
// Check something
144+
if (somethingBad) {
145+
return [finding('my-rule-id', 'Category', 'warning',
146+
'What is wrong.',
147+
'How to fix it.',
148+
)];
149+
}
150+
return [finding('my-rule-ok', 'Category', 'pass', 'All good.')];
151+
};
152+
```
122153

123154
## License
124155

125-
MIT
156+
MIT © [Ad Machine](https://admachine.xyz)

0 commit comments

Comments
 (0)