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,158 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const crypto = require('crypto')
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Cache Manager for Validation Results
|
|
9
|
+
* Caches validation results to avoid re-running validations on unchanged files
|
|
10
|
+
*/
|
|
11
|
+
class CacheManager {
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.cacheDir =
|
|
14
|
+
options.cacheDir || path.join(process.cwd(), '.create-qa-architect-cache')
|
|
15
|
+
this.ttl = options.ttl || 24 * 60 * 60 * 1000 // Default: 24 hours in milliseconds
|
|
16
|
+
this.enabled = options.enabled !== false // Enable by default
|
|
17
|
+
|
|
18
|
+
// Ensure cache directory exists
|
|
19
|
+
if (this.enabled) {
|
|
20
|
+
this.ensureCacheDir()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Ensure cache directory exists
|
|
26
|
+
*/
|
|
27
|
+
ensureCacheDir() {
|
|
28
|
+
if (!fs.existsSync(this.cacheDir)) {
|
|
29
|
+
fs.mkdirSync(this.cacheDir, { recursive: true })
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Generate cache key from file content
|
|
35
|
+
* @param {string} filePath - Path to file
|
|
36
|
+
* @returns {string} Hash of file content
|
|
37
|
+
*/
|
|
38
|
+
generateKey(filePath) {
|
|
39
|
+
try {
|
|
40
|
+
const content = fs.readFileSync(filePath, 'utf8')
|
|
41
|
+
return crypto.createHash('sha256').update(content).digest('hex')
|
|
42
|
+
} catch {
|
|
43
|
+
// If file doesn't exist or can't be read, return timestamp-based key
|
|
44
|
+
return crypto
|
|
45
|
+
.createHash('sha256')
|
|
46
|
+
.update(`${filePath}-${Date.now()}`)
|
|
47
|
+
.digest('hex')
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Generate cache key from multiple files
|
|
53
|
+
* @param {string[]} filePaths - Array of file paths
|
|
54
|
+
* @returns {string} Combined hash of all files
|
|
55
|
+
*/
|
|
56
|
+
generateKeyFromFiles(filePaths) {
|
|
57
|
+
const hashes = filePaths.map(filePath => this.generateKey(filePath))
|
|
58
|
+
const combined = hashes.join('-')
|
|
59
|
+
return crypto.createHash('sha256').update(combined).digest('hex')
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Get cached validation result
|
|
64
|
+
* @param {string} key - Cache key
|
|
65
|
+
* @returns {Object|null} Cached result or null if not found/expired
|
|
66
|
+
*/
|
|
67
|
+
get(key) {
|
|
68
|
+
if (!this.enabled) {
|
|
69
|
+
return null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const cacheFile = path.join(this.cacheDir, `${key}.json`)
|
|
74
|
+
|
|
75
|
+
if (!fs.existsSync(cacheFile)) {
|
|
76
|
+
return null // Cache miss
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const cached = JSON.parse(fs.readFileSync(cacheFile, 'utf8'))
|
|
80
|
+
const now = Date.now()
|
|
81
|
+
|
|
82
|
+
// Check if cache is expired
|
|
83
|
+
if (now - cached.timestamp > this.ttl) {
|
|
84
|
+
// Remove expired cache file
|
|
85
|
+
|
|
86
|
+
fs.unlinkSync(cacheFile)
|
|
87
|
+
return null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return cached.result
|
|
91
|
+
} catch {
|
|
92
|
+
// If cache file is corrupted or unreadable, treat as cache miss
|
|
93
|
+
return null
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Store validation result in cache
|
|
99
|
+
* @param {string} key - Cache key
|
|
100
|
+
* @param {Object} result - Validation result to cache
|
|
101
|
+
*/
|
|
102
|
+
set(key, result) {
|
|
103
|
+
if (!this.enabled) {
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const cacheFile = path.join(this.cacheDir, `${key}.json`)
|
|
109
|
+
const cached = {
|
|
110
|
+
timestamp: Date.now(),
|
|
111
|
+
result,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
fs.writeFileSync(cacheFile, JSON.stringify(cached, null, 2), 'utf8')
|
|
115
|
+
} catch (error) {
|
|
116
|
+
// Silently fail if cache write fails (don't break validation)
|
|
117
|
+
// Log error if verbose mode is enabled
|
|
118
|
+
if (this.verbose) {
|
|
119
|
+
console.warn(`Cache write failed: ${error.message}`)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Clear all cached results
|
|
126
|
+
*/
|
|
127
|
+
clear() {
|
|
128
|
+
if (!this.enabled) {
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
if (fs.existsSync(this.cacheDir)) {
|
|
134
|
+
const files = fs.readdirSync(this.cacheDir)
|
|
135
|
+
files.forEach(file => {
|
|
136
|
+
if (file.endsWith('.json')) {
|
|
137
|
+
fs.unlinkSync(path.join(this.cacheDir, file))
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
} catch (error) {
|
|
142
|
+
// Silently fail if cache clear fails
|
|
143
|
+
if (this.verbose) {
|
|
144
|
+
console.warn(`Cache clear failed: ${error.message}`)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Check if cache is enabled
|
|
151
|
+
* @returns {boolean} True if cache is enabled
|
|
152
|
+
*/
|
|
153
|
+
isEnabled() {
|
|
154
|
+
return this.enabled
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
module.exports = CacheManager
|