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
package/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Create Quality Automation
|
|
2
|
+
|
|
3
|
+
Bootstrap quality automation in JavaScript/TypeScript and Python projects with comprehensive tooling. One command adds ESLint, Prettier, Husky, lint-staged, security scanning, and GitHub Actions to any project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Maintainer & Ownership**
|
|
8
|
+
> This project is maintained by **Vibe Build Lab LLC**, a studio focused on AI-assisted product development, micro-SaaS, and "vibe coding" workflows for solo founders and small teams.
|
|
9
|
+
> Learn more at **https://www.vibebuildlab.com**.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Prettier Code Formatting** - Consistent code style across your project
|
|
16
|
+
- **Husky Git Hooks** - Pre-commit (lint-staged) and pre-push (validation)
|
|
17
|
+
- **lint-staged Processing** - Only process changed files for speed
|
|
18
|
+
- **Pre-push Validation** - Prevents broken code from reaching CI
|
|
19
|
+
- **GitHub Actions** - Automated quality checks in CI/CD
|
|
20
|
+
- **TypeScript Smart** - Auto-detects and configures TypeScript projects
|
|
21
|
+
- **Python Support** - Complete Python toolchain with Black, Ruff, isort, mypy, pytest
|
|
22
|
+
- **Security Automation** - npm audit and hardcoded secrets scanning
|
|
23
|
+
- **Progressive Quality** - Adaptive checks based on project maturity
|
|
24
|
+
- **Smart Test Strategy** - Risk-based pre-push validation (Pro feature)
|
|
25
|
+
|
|
26
|
+
## Target Users
|
|
27
|
+
|
|
28
|
+
- **Developers** who want quality automation without manual setup
|
|
29
|
+
- **Teams** standardizing code quality across multiple projects
|
|
30
|
+
- **Open source maintainers** enforcing contribution standards
|
|
31
|
+
- **Agencies** shipping consistent quality across client projects
|
|
32
|
+
|
|
33
|
+
## Demo / Live Links
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Try it on any project
|
|
37
|
+
npx create-qa-architect@latest
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Pricing & Licensing
|
|
41
|
+
|
|
42
|
+
### Freemium Model
|
|
43
|
+
|
|
44
|
+
| Tier | Price | Features |
|
|
45
|
+
| -------------- | ----------- | ------------------------------------------------------- |
|
|
46
|
+
| **Free** | $0 | Basic quality automation, 1 private repo, 2k LOC |
|
|
47
|
+
| **Pro** | $59/mo | Unlimited repos, Smart Test Strategy, security scanning |
|
|
48
|
+
| **Team** | $15/user/mo | All Pro features + shared quota, team policies |
|
|
49
|
+
| **Enterprise** | $249/mo | SSO/SAML, custom patterns, compliance pack |
|
|
50
|
+
|
|
51
|
+
### License
|
|
52
|
+
|
|
53
|
+
**Open Source (MIT)** - Free for personal and commercial use.
|
|
54
|
+
|
|
55
|
+
[Get Started with Pro](https://vibebuildlab.com/cqa)
|
|
56
|
+
|
|
57
|
+
## Tech Stack
|
|
58
|
+
|
|
59
|
+
| Component | Technology |
|
|
60
|
+
| --------------- | ------------------------- |
|
|
61
|
+
| **Runtime** | Node.js 20+ |
|
|
62
|
+
| **Linting** | ESLint 9 (flat config) |
|
|
63
|
+
| **Formatting** | Prettier 3 |
|
|
64
|
+
| **CSS Linting** | Stylelint 16 |
|
|
65
|
+
| **Git Hooks** | Husky 9 + lint-staged 15 |
|
|
66
|
+
| **Python** | Black, Ruff, mypy, pytest |
|
|
67
|
+
| **Performance** | Lighthouse CI |
|
|
68
|
+
| **Security** | Gitleaks, npm audit |
|
|
69
|
+
|
|
70
|
+
## Getting Started
|
|
71
|
+
|
|
72
|
+
### Prerequisites
|
|
73
|
+
|
|
74
|
+
- Node.js 20 or higher
|
|
75
|
+
- npm 10+ (installed automatically with Node 20)
|
|
76
|
+
- Git repository (required for hooks)
|
|
77
|
+
|
|
78
|
+
### Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Navigate to your project
|
|
82
|
+
cd your-project/
|
|
83
|
+
|
|
84
|
+
# Bootstrap quality automation
|
|
85
|
+
npx create-qa-architect@latest
|
|
86
|
+
|
|
87
|
+
# Install new dependencies
|
|
88
|
+
npm install
|
|
89
|
+
|
|
90
|
+
# Set up pre-commit hooks
|
|
91
|
+
npm run prepare
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Update Existing Setup
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx create-qa-architect@latest --update
|
|
98
|
+
npm install
|
|
99
|
+
npm run lint
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Dependency Monitoring (Free)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx create-qa-architect@latest --deps
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Usage Examples
|
|
109
|
+
|
|
110
|
+
### Check Project Maturity
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npx create-qa-architect@latest --check-maturity
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Output:**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Project Maturity Report
|
|
120
|
+
|
|
121
|
+
Maturity Level: Development
|
|
122
|
+
Description: Active development - has source files and tests
|
|
123
|
+
|
|
124
|
+
Quality Checks:
|
|
125
|
+
Required: prettier, eslint, stylelint, tests
|
|
126
|
+
Optional: security-audit
|
|
127
|
+
Disabled: coverage, documentation
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Security Validation
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Check configuration security
|
|
134
|
+
npx create-qa-architect@latest --security-config
|
|
135
|
+
|
|
136
|
+
# Validate documentation
|
|
137
|
+
npx create-qa-architect@latest --validate-docs
|
|
138
|
+
|
|
139
|
+
# Comprehensive validation
|
|
140
|
+
npx create-qa-architect@latest --comprehensive
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Custom Templates
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Use organization-specific standards
|
|
147
|
+
npx create-qa-architect@latest --template ./my-org-templates
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## What Gets Added
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
your-project/
|
|
154
|
+
├── .github/
|
|
155
|
+
│ └── workflows/
|
|
156
|
+
│ └── quality.yml # GitHub Actions workflow
|
|
157
|
+
├── .husky/ # Pre-commit hooks
|
|
158
|
+
├── .editorconfig # Editor defaults
|
|
159
|
+
├── .eslintignore # ESLint ignore patterns
|
|
160
|
+
├── .nvmrc # Node version pinning
|
|
161
|
+
├── .prettierrc # Prettier configuration
|
|
162
|
+
├── .stylelintrc.json # Stylelint rules
|
|
163
|
+
├── eslint.config.cjs # ESLint flat config
|
|
164
|
+
└── package.json # Updated scripts
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Available Scripts (After Setup)
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm run format # Format all files
|
|
171
|
+
npm run format:check # Check formatting (CI)
|
|
172
|
+
npm run lint # ESLint + Stylelint
|
|
173
|
+
npm run lint:fix # Auto-fix linting
|
|
174
|
+
npm run security:audit # Vulnerability check
|
|
175
|
+
npm run security:secrets # Scan for secrets
|
|
176
|
+
npm run validate:pre-push # Pre-push validation
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Roadmap
|
|
180
|
+
|
|
181
|
+
- [x] ESLint 9 flat config support
|
|
182
|
+
- [x] Progressive quality (maturity detection)
|
|
183
|
+
- [x] Python toolchain support
|
|
184
|
+
- [x] Smart test strategy (Pro)
|
|
185
|
+
- [ ] Rust and Go support
|
|
186
|
+
- [ ] VS Code extension
|
|
187
|
+
- [ ] Monorepo support
|
|
188
|
+
|
|
189
|
+
## Contributing
|
|
190
|
+
|
|
191
|
+
Want to improve this tool?
|
|
192
|
+
|
|
193
|
+
1. Fork the repository
|
|
194
|
+
2. Make your changes
|
|
195
|
+
3. Test with a sample project
|
|
196
|
+
4. Submit a pull request
|
|
197
|
+
|
|
198
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
199
|
+
|
|
200
|
+
## Support
|
|
201
|
+
|
|
202
|
+
1. Check the [Troubleshooting Guide](./TROUBLESHOOTING.md)
|
|
203
|
+
2. Review GitHub Actions logs
|
|
204
|
+
3. Open an issue in this repository
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT License - free to use in any project. See [LICENSE](LICENSE) for details.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
> Discover more tools at **https://www.vibebuildlab.com**.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
ci: {
|
|
3
|
+
collect: {
|
|
4
|
+
// Collect URLs - default to localhost for most projects
|
|
5
|
+
url: ['http://localhost:3000'],
|
|
6
|
+
// For static sites, you might want to build first
|
|
7
|
+
staticDistDir: './dist',
|
|
8
|
+
// Number of runs for more accurate results
|
|
9
|
+
numberOfRuns: 3,
|
|
10
|
+
// Wait for page to be ready
|
|
11
|
+
settings: {
|
|
12
|
+
chromeFlags: '--no-sandbox --headless --disable-gpu',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
assert: {
|
|
16
|
+
// Performance budgets - configurable thresholds
|
|
17
|
+
assertions: {
|
|
18
|
+
'categories:performance': ['warn', { minScore: 0.8 }],
|
|
19
|
+
'categories:accessibility': ['error', { minScore: 0.9 }],
|
|
20
|
+
'categories:best-practices': ['warn', { minScore: 0.85 }],
|
|
21
|
+
'categories:seo': ['error', { minScore: 0.9 }],
|
|
22
|
+
// Specific metrics
|
|
23
|
+
'first-contentful-paint': ['warn', { maxNumericValue: 2000 }],
|
|
24
|
+
'largest-contentful-paint': ['warn', { maxNumericValue: 4000 }],
|
|
25
|
+
'cumulative-layout-shift': ['warn', { maxNumericValue: 0.1 }],
|
|
26
|
+
// Accessibility checks
|
|
27
|
+
'color-contrast': 'error',
|
|
28
|
+
'meta-description': 'error',
|
|
29
|
+
'document-title': 'error',
|
|
30
|
+
'html-has-lang': 'error',
|
|
31
|
+
'image-alt': 'error',
|
|
32
|
+
// SEO essentials
|
|
33
|
+
canonical: 'warn',
|
|
34
|
+
'meta-viewport': 'error',
|
|
35
|
+
'structured-data': 'warn',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
upload: {
|
|
39
|
+
// Store results - can be configured per project
|
|
40
|
+
target: 'temporary-public-storage',
|
|
41
|
+
// For teams: configure GitHub status checks
|
|
42
|
+
// githubAppToken: process.env.LHCI_GITHUB_APP_TOKEN,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Pre-commit hooks for Python + JavaScript/TypeScript projects
|
|
2
|
+
# Install: pip install pre-commit && pre-commit install
|
|
3
|
+
# Run manually: pre-commit run --all-files
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
# Python hooks
|
|
7
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
8
|
+
rev: v0.6.9
|
|
9
|
+
hooks:
|
|
10
|
+
# Linter
|
|
11
|
+
- id: ruff
|
|
12
|
+
args: [--fix]
|
|
13
|
+
# Formatter
|
|
14
|
+
- id: ruff-format
|
|
15
|
+
|
|
16
|
+
- repo: https://github.com/PyCQA/isort
|
|
17
|
+
rev: 5.13.2
|
|
18
|
+
hooks:
|
|
19
|
+
- id: isort
|
|
20
|
+
args: ['--profile', 'black']
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
23
|
+
rev: v1.11.2
|
|
24
|
+
hooks:
|
|
25
|
+
- id: mypy
|
|
26
|
+
additional_dependencies: [types-all]
|
|
27
|
+
args: [--ignore-missing-imports, --no-strict-optional]
|
|
28
|
+
|
|
29
|
+
# JavaScript/TypeScript hooks
|
|
30
|
+
- repo: https://github.com/pre-commit/mirrors-eslint
|
|
31
|
+
rev: v9.12.0
|
|
32
|
+
hooks:
|
|
33
|
+
- id: eslint
|
|
34
|
+
args: [--fix, --max-warnings=0]
|
|
35
|
+
files: \.(js|jsx|ts|tsx|mjs|cjs)$
|
|
36
|
+
types: [file]
|
|
37
|
+
additional_dependencies:
|
|
38
|
+
- eslint@^9.12.0
|
|
39
|
+
- eslint-plugin-security@^3.0.1
|
|
40
|
+
- globals@^15.9.0
|
|
41
|
+
|
|
42
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
43
|
+
rev: v3.3.3
|
|
44
|
+
hooks:
|
|
45
|
+
- id: prettier
|
|
46
|
+
args: [--write]
|
|
47
|
+
files: \.(js|jsx|ts|tsx|json|yml|yaml|md|css|scss|html)$
|
|
48
|
+
|
|
49
|
+
# General hooks
|
|
50
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
51
|
+
rev: v4.6.0
|
|
52
|
+
hooks:
|
|
53
|
+
- id: trailing-whitespace
|
|
54
|
+
- id: end-of-file-fixer
|
|
55
|
+
- id: check-yaml
|
|
56
|
+
- id: check-json
|
|
57
|
+
- id: check-added-large-files
|
|
58
|
+
args: ['--maxkb=1000']
|
|
59
|
+
- id: check-merge-conflict
|
|
60
|
+
- id: detect-private-key
|
|
61
|
+
|
|
62
|
+
# Security scanning
|
|
63
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
64
|
+
rev: v8.19.3
|
|
65
|
+
hooks:
|
|
66
|
+
- id: gitleaks
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Constants Configuration
|
|
3
|
+
*
|
|
4
|
+
* Centralized configuration values used throughout the quality automation system.
|
|
5
|
+
* Extracting these magic numbers improves maintainability and provides a single
|
|
6
|
+
* source of truth for all configuration thresholds and limits.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Node.js version requirements
|
|
11
|
+
*/
|
|
12
|
+
const NODE_VERSION = {
|
|
13
|
+
/** Minimum supported Node.js major version */
|
|
14
|
+
MIN_MAJOR: 20,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* File scanning and directory traversal limits
|
|
19
|
+
*/
|
|
20
|
+
const SCAN_LIMITS = {
|
|
21
|
+
/** Maximum depth for Stylelint directory scanning */
|
|
22
|
+
STYLELINT_MAX_DEPTH: 4,
|
|
23
|
+
|
|
24
|
+
/** Maximum depth for project maturity file counting */
|
|
25
|
+
FILE_COUNT_MAX_DEPTH: 5,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Error reporting and telemetry limits
|
|
30
|
+
*/
|
|
31
|
+
const REPORTING_LIMITS = {
|
|
32
|
+
/** Maximum number of error reports to store */
|
|
33
|
+
MAX_ERROR_REPORTS: 50,
|
|
34
|
+
|
|
35
|
+
/** Maximum number of telemetry events to buffer */
|
|
36
|
+
MAX_TELEMETRY_EVENTS: 100,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Project maturity assessment thresholds
|
|
41
|
+
*/
|
|
42
|
+
const MATURITY_THRESHOLDS = {
|
|
43
|
+
/** Minimum README line count for "documented" status */
|
|
44
|
+
README_MIN_LINES_FOR_DOCS: 100,
|
|
45
|
+
|
|
46
|
+
/** Minimum files for "bootstrap" maturity level */
|
|
47
|
+
MIN_BOOTSTRAP_FILES: 3,
|
|
48
|
+
|
|
49
|
+
/** Minimum files for "production" maturity level */
|
|
50
|
+
MIN_PRODUCTION_FILES: 10,
|
|
51
|
+
|
|
52
|
+
/** Minimum test files for "production" status */
|
|
53
|
+
MIN_PRODUCTION_TESTS: 3,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Dependency monitoring configuration
|
|
58
|
+
*/
|
|
59
|
+
const DEPENDENCY_MONITORING = {
|
|
60
|
+
/** Maximum size of regex pattern cache */
|
|
61
|
+
MAX_PATTERN_CACHE_SIZE: 1000,
|
|
62
|
+
|
|
63
|
+
/** Maximum file size for requirements.txt parsing (10MB) */
|
|
64
|
+
MAX_REQUIREMENTS_FILE_SIZE: 10 * 1024 * 1024,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Directory exclusion lists for scanning operations
|
|
69
|
+
*
|
|
70
|
+
* Centralized lists of directories to skip during various scanning operations
|
|
71
|
+
* (Stylelint, template loading, project maturity analysis).
|
|
72
|
+
*/
|
|
73
|
+
const EXCLUDE_DIRECTORIES = {
|
|
74
|
+
/** Directories to exclude during Stylelint scanning */
|
|
75
|
+
STYLELINT: [
|
|
76
|
+
'.git',
|
|
77
|
+
'.github',
|
|
78
|
+
'.husky',
|
|
79
|
+
'.next',
|
|
80
|
+
'.nuxt',
|
|
81
|
+
'.output',
|
|
82
|
+
'.turbo',
|
|
83
|
+
'.vercel',
|
|
84
|
+
'.cache',
|
|
85
|
+
'.pnpm-store',
|
|
86
|
+
'coverage',
|
|
87
|
+
'node_modules',
|
|
88
|
+
],
|
|
89
|
+
|
|
90
|
+
/** Directories to skip during template loading */
|
|
91
|
+
TEMPLATE_LOADING: [
|
|
92
|
+
'node_modules',
|
|
93
|
+
'.git',
|
|
94
|
+
'.next',
|
|
95
|
+
'.nuxt',
|
|
96
|
+
'.turbo',
|
|
97
|
+
'.vercel',
|
|
98
|
+
'.cache',
|
|
99
|
+
'dist',
|
|
100
|
+
'build',
|
|
101
|
+
'coverage',
|
|
102
|
+
'.pnpm-store',
|
|
103
|
+
'.yarn',
|
|
104
|
+
],
|
|
105
|
+
|
|
106
|
+
/** Directories to exclude during project maturity file counting */
|
|
107
|
+
PROJECT_MATURITY: [
|
|
108
|
+
'node_modules',
|
|
109
|
+
'.git',
|
|
110
|
+
'dist',
|
|
111
|
+
'build',
|
|
112
|
+
'coverage',
|
|
113
|
+
'.next',
|
|
114
|
+
'.nuxt',
|
|
115
|
+
],
|
|
116
|
+
|
|
117
|
+
/** Directories allowed for template scanning from package directory */
|
|
118
|
+
TEMPLATE_WHITELIST: ['.github', 'config', 'dotfiles'],
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = {
|
|
122
|
+
NODE_VERSION,
|
|
123
|
+
SCAN_LIMITS,
|
|
124
|
+
REPORTING_LIMITS,
|
|
125
|
+
MATURITY_THRESHOLDS,
|
|
126
|
+
DEPENDENCY_MONITORING,
|
|
127
|
+
EXCLUDE_DIRECTORIES,
|
|
128
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
/* eslint-disable security/detect-object-injection */
|
|
3
|
+
|
|
4
|
+
const STYLELINT_EXTENSIONS = ['css', 'scss', 'sass', 'less', 'pcss']
|
|
5
|
+
const DEFAULT_STYLELINT_TARGET = `**/*.{${STYLELINT_EXTENSIONS.join(',')}}`
|
|
6
|
+
|
|
7
|
+
const baseScripts = {
|
|
8
|
+
format: 'prettier --write .',
|
|
9
|
+
'format:check': 'prettier --check .',
|
|
10
|
+
test: 'vitest run --passWithNoTests',
|
|
11
|
+
'test:watch': 'vitest',
|
|
12
|
+
'test:coverage': 'vitest run --coverage',
|
|
13
|
+
'security:audit': 'npm audit --audit-level high',
|
|
14
|
+
'security:secrets':
|
|
15
|
+
"node -e \"const fs=require('fs');const content=fs.readFileSync('package.json','utf8');if(/[\\\"\\'][a-zA-Z0-9+/]{20,}[\\\"\\']/.test(content)){console.error('❌ Potential hardcoded secrets in package.json');process.exit(1)}else{console.log('✅ No secrets detected in package.json')}\"",
|
|
16
|
+
'security:config': 'npx create-qa-architect@latest --security-config',
|
|
17
|
+
'lighthouse:ci': 'lhci autorun',
|
|
18
|
+
'lighthouse:upload': 'lhci upload',
|
|
19
|
+
'validate:docs': 'npx create-qa-architect@latest --validate-docs',
|
|
20
|
+
'validate:comprehensive': 'npx create-qa-architect@latest --comprehensive',
|
|
21
|
+
'validate:all': 'npm run validate:comprehensive && npm run security:audit',
|
|
22
|
+
'validate:pre-push':
|
|
23
|
+
'npm run test:patterns --if-present && npm run lint && npm run format:check && npm run test:commands --if-present && npm test --if-present',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const normalizeStylelintTargets = stylelintTargets => {
|
|
27
|
+
const targets = Array.isArray(stylelintTargets)
|
|
28
|
+
? stylelintTargets.filter(Boolean)
|
|
29
|
+
: []
|
|
30
|
+
if (!targets.length) {
|
|
31
|
+
return [DEFAULT_STYLELINT_TARGET]
|
|
32
|
+
}
|
|
33
|
+
return [...new Set(targets)]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const stylelintBraceGroup = stylelintTargets => {
|
|
37
|
+
const targets = normalizeStylelintTargets(stylelintTargets)
|
|
38
|
+
if (targets.length === 1) {
|
|
39
|
+
return targets[0]
|
|
40
|
+
}
|
|
41
|
+
return `{${targets.join(',')}}`
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const baseLintScripts = ({ stylelintTargets }) => {
|
|
45
|
+
const stylelintTarget = stylelintBraceGroup(stylelintTargets)
|
|
46
|
+
return {
|
|
47
|
+
lint: `eslint . && stylelint "${stylelintTarget}" --allow-empty-input`,
|
|
48
|
+
'lint:fix': `eslint . --fix && stylelint "${stylelintTarget}" --fix --allow-empty-input`,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const baseDevDependencies = {
|
|
53
|
+
husky: '^9.1.4',
|
|
54
|
+
'lint-staged': '^15.2.10',
|
|
55
|
+
prettier: '^3.3.3',
|
|
56
|
+
eslint: '^9.12.0',
|
|
57
|
+
'eslint-plugin-security': '^3.0.1',
|
|
58
|
+
globals: '^15.9.0',
|
|
59
|
+
stylelint: '^16.8.0',
|
|
60
|
+
'stylelint-config-standard': '^37.0.0',
|
|
61
|
+
'@lhci/cli': '^0.14.0',
|
|
62
|
+
vitest: '^2.1.8',
|
|
63
|
+
'@vitest/coverage-v8': '^2.1.8',
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const typeScriptDevDependencies = {
|
|
67
|
+
'@typescript-eslint/eslint-plugin': '^8.9.0',
|
|
68
|
+
'@typescript-eslint/parser': '^8.9.0',
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const baseLintStaged = (patterns, stylelintTargets, usesPython = false) => {
|
|
72
|
+
const lintStaged = {
|
|
73
|
+
'package.json': ['prettier --write'],
|
|
74
|
+
[patterns]: ['eslint --fix', 'prettier --write'],
|
|
75
|
+
'**/*.{json,md,yml,yaml}': ['prettier --write'],
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
normalizeStylelintTargets(stylelintTargets).forEach(target => {
|
|
79
|
+
lintStaged[target] = ['stylelint --fix', 'prettier --write']
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
// Add Python lint-staged support if Python is detected
|
|
83
|
+
if (usesPython) {
|
|
84
|
+
lintStaged['**/*.py'] = [
|
|
85
|
+
'black --check --diff',
|
|
86
|
+
'ruff check --fix',
|
|
87
|
+
'isort --check-only --diff',
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return lintStaged
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const JS_LINT_STAGED_PATTERN = '**/*.{js,jsx,mjs,cjs,html}'
|
|
95
|
+
const TS_LINT_STAGED_PATTERN = '**/*.{js,jsx,ts,tsx,mjs,cjs,html}'
|
|
96
|
+
|
|
97
|
+
const clone = value => JSON.parse(JSON.stringify(value))
|
|
98
|
+
|
|
99
|
+
function getDefaultScripts({ stylelintTargets } = {}) {
|
|
100
|
+
return {
|
|
101
|
+
...clone(baseScripts),
|
|
102
|
+
...baseLintScripts({ stylelintTargets }),
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getDefaultDevDependencies({ typescript } = {}) {
|
|
107
|
+
const devDeps = { ...clone(baseDevDependencies) }
|
|
108
|
+
if (typescript) {
|
|
109
|
+
Object.assign(devDeps, typeScriptDevDependencies)
|
|
110
|
+
}
|
|
111
|
+
return devDeps
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function getDefaultLintStaged({ typescript, stylelintTargets, python } = {}) {
|
|
115
|
+
const pattern = typescript ? TS_LINT_STAGED_PATTERN : JS_LINT_STAGED_PATTERN
|
|
116
|
+
return clone(baseLintStaged(pattern, stylelintTargets, python))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
getDefaultDevDependencies,
|
|
121
|
+
getDefaultLintStaged,
|
|
122
|
+
getDefaultScripts,
|
|
123
|
+
STYLELINT_EXTENSIONS,
|
|
124
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[tool.black]
|
|
6
|
+
line-length = 88
|
|
7
|
+
target-version = ['py38']
|
|
8
|
+
include = '\.pyi?$'
|
|
9
|
+
extend-exclude = '''
|
|
10
|
+
/(
|
|
11
|
+
# directories
|
|
12
|
+
\.eggs
|
|
13
|
+
| \.git
|
|
14
|
+
| \.hg
|
|
15
|
+
| \.mypy_cache
|
|
16
|
+
| \.tox
|
|
17
|
+
| \.venv
|
|
18
|
+
| venv
|
|
19
|
+
| \.pytest_cache
|
|
20
|
+
| _build
|
|
21
|
+
| buck-out
|
|
22
|
+
| build
|
|
23
|
+
| dist
|
|
24
|
+
)/
|
|
25
|
+
'''
|
|
26
|
+
|
|
27
|
+
[tool.ruff]
|
|
28
|
+
target-version = "py38"
|
|
29
|
+
line-length = 88
|
|
30
|
+
fix = true
|
|
31
|
+
|
|
32
|
+
[tool.ruff.lint]
|
|
33
|
+
select = [
|
|
34
|
+
# pycodestyle
|
|
35
|
+
"E",
|
|
36
|
+
"W",
|
|
37
|
+
# Pyflakes
|
|
38
|
+
"F",
|
|
39
|
+
# pyupgrade
|
|
40
|
+
"UP",
|
|
41
|
+
# flake8-bugbear
|
|
42
|
+
"B",
|
|
43
|
+
# flake8-simplify
|
|
44
|
+
"SIM",
|
|
45
|
+
# isort
|
|
46
|
+
"I",
|
|
47
|
+
# flake8-bandit (security)
|
|
48
|
+
"S",
|
|
49
|
+
# flake8-comprehensions
|
|
50
|
+
"C4",
|
|
51
|
+
# flake8-errmsg
|
|
52
|
+
"EM",
|
|
53
|
+
# flake8-quotes
|
|
54
|
+
"Q",
|
|
55
|
+
# flake8-return
|
|
56
|
+
"RET",
|
|
57
|
+
# flake8-unused-arguments
|
|
58
|
+
"ARG",
|
|
59
|
+
# flake8-use-pathlib
|
|
60
|
+
"PTH",
|
|
61
|
+
# flake8-pie
|
|
62
|
+
"PIE",
|
|
63
|
+
# flake8-type-checking
|
|
64
|
+
"TCH",
|
|
65
|
+
]
|
|
66
|
+
ignore = [
|
|
67
|
+
# Allow non-abstract empty methods in abstract base classes
|
|
68
|
+
"B027",
|
|
69
|
+
# Allow boolean positional values in function calls, like `dict.get(... True)`
|
|
70
|
+
"FBT003",
|
|
71
|
+
# Ignore checks for possible passwords
|
|
72
|
+
"S105", "S106", "S107",
|
|
73
|
+
# Ignore complexity
|
|
74
|
+
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint.per-file-ignores]
|
|
78
|
+
# Tests can use magic values, assertions, and relative imports
|
|
79
|
+
"tests/**/*" = ["PLR2004", "S101", "TID252"]
|
|
80
|
+
|
|
81
|
+
[tool.ruff.lint.isort]
|
|
82
|
+
known-first-party = ["src"]
|
|
83
|
+
|
|
84
|
+
[tool.mypy]
|
|
85
|
+
python_version = "3.8"
|
|
86
|
+
warn_return_any = true
|
|
87
|
+
warn_unused_configs = true
|
|
88
|
+
disallow_untyped_defs = true
|
|
89
|
+
disallow_incomplete_defs = true
|
|
90
|
+
check_untyped_defs = true
|
|
91
|
+
disallow_untyped_decorators = true
|
|
92
|
+
no_implicit_optional = true
|
|
93
|
+
warn_redundant_casts = true
|
|
94
|
+
warn_unused_ignores = true
|
|
95
|
+
warn_no_return = true
|
|
96
|
+
warn_unreachable = true
|
|
97
|
+
strict_equality = true
|
|
98
|
+
|
|
99
|
+
[[tool.mypy.overrides]]
|
|
100
|
+
module = "tests.*"
|
|
101
|
+
disallow_untyped_defs = false
|
|
102
|
+
|
|
103
|
+
[tool.pytest.ini_options]
|
|
104
|
+
testpaths = ["tests"]
|
|
105
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
106
|
+
python_classes = ["Test*"]
|
|
107
|
+
python_functions = ["test_*"]
|
|
108
|
+
addopts = "-v --tb=short"
|
|
109
|
+
|
|
110
|
+
[tool.coverage.run]
|
|
111
|
+
source = ["src"]
|
|
112
|
+
omit = ["tests/*", "*/tests/*"]
|
|
113
|
+
|
|
114
|
+
[tool.coverage.report]
|
|
115
|
+
exclude_lines = [
|
|
116
|
+
"pragma: no cover",
|
|
117
|
+
"def __repr__",
|
|
118
|
+
"if self.debug:",
|
|
119
|
+
"if settings.DEBUG",
|
|
120
|
+
"raise AssertionError",
|
|
121
|
+
"raise NotImplementedError",
|
|
122
|
+
"if 0:",
|
|
123
|
+
"if __name__ == .__main__.:",
|
|
124
|
+
]
|