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.
Files changed (67) hide show
  1. package/.editorconfig +12 -0
  2. package/.github/CLAUDE_MD_AUTOMATION.md +248 -0
  3. package/.github/PROGRESSIVE_QUALITY_IMPLEMENTATION.md +408 -0
  4. package/.github/PROGRESSIVE_QUALITY_PROPOSAL.md +443 -0
  5. package/.github/RELEASE_CHECKLIST.md +100 -0
  6. package/.github/dependabot.yml +50 -0
  7. package/.github/git-sync.sh +48 -0
  8. package/.github/workflows/claude-md-validation.yml +82 -0
  9. package/.github/workflows/nightly-gitleaks-verification.yml +176 -0
  10. package/.github/workflows/pnpm-ci.yml.example +53 -0
  11. package/.github/workflows/python-ci.yml.example +69 -0
  12. package/.github/workflows/quality-legacy.yml.backup +165 -0
  13. package/.github/workflows/quality-progressive.yml.example +291 -0
  14. package/.github/workflows/quality.yml +436 -0
  15. package/.github/workflows/release.yml +53 -0
  16. package/.nvmrc +1 -0
  17. package/.prettierignore +14 -0
  18. package/.prettierrc +9 -0
  19. package/.stylelintrc.json +5 -0
  20. package/README.md +212 -0
  21. package/config/.lighthouserc.js +45 -0
  22. package/config/.pre-commit-config.yaml +66 -0
  23. package/config/constants.js +128 -0
  24. package/config/defaults.js +124 -0
  25. package/config/pyproject.toml +124 -0
  26. package/config/quality-config.schema.json +97 -0
  27. package/config/quality-python.yml +89 -0
  28. package/config/requirements-dev.txt +15 -0
  29. package/create-saas-monetization.js +1465 -0
  30. package/eslint.config.cjs +117 -0
  31. package/eslint.config.ts.cjs +99 -0
  32. package/legal/README.md +106 -0
  33. package/legal/copyright.md +76 -0
  34. package/legal/disclaimer.md +146 -0
  35. package/legal/privacy-policy.html +324 -0
  36. package/legal/privacy-policy.md +196 -0
  37. package/legal/terms-of-service.md +224 -0
  38. package/lib/billing-dashboard.html +645 -0
  39. package/lib/config-validator.js +163 -0
  40. package/lib/dependency-monitoring-basic.js +185 -0
  41. package/lib/dependency-monitoring-premium.js +1490 -0
  42. package/lib/error-reporter.js +444 -0
  43. package/lib/interactive/prompt.js +128 -0
  44. package/lib/interactive/questions.js +146 -0
  45. package/lib/license-validator.js +403 -0
  46. package/lib/licensing.js +989 -0
  47. package/lib/package-utils.js +187 -0
  48. package/lib/project-maturity.js +516 -0
  49. package/lib/security-enhancements.js +340 -0
  50. package/lib/setup-enhancements.js +317 -0
  51. package/lib/smart-strategy-generator.js +344 -0
  52. package/lib/telemetry.js +323 -0
  53. package/lib/template-loader.js +252 -0
  54. package/lib/typescript-config-generator.js +210 -0
  55. package/lib/ui-helpers.js +74 -0
  56. package/lib/validation/base-validator.js +174 -0
  57. package/lib/validation/cache-manager.js +158 -0
  58. package/lib/validation/config-security.js +741 -0
  59. package/lib/validation/documentation.js +326 -0
  60. package/lib/validation/index.js +186 -0
  61. package/lib/validation/validation-factory.js +153 -0
  62. package/lib/validation/workflow-validation.js +172 -0
  63. package/lib/yaml-utils.js +120 -0
  64. package/marketing/beta-user-email-campaign.md +372 -0
  65. package/marketing/landing-page.html +721 -0
  66. package/package.json +165 -0
  67. 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