fraim-framework 2.0.34 โ†’ 2.0.36

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 (49) hide show
  1. package/bin/fraim.js +52 -5
  2. package/dist/registry/scripts/cleanup-branch.js +62 -33
  3. package/dist/registry/scripts/generate-engagement-emails.js +119 -44
  4. package/dist/registry/scripts/newsletter-helpers.js +208 -268
  5. package/dist/registry/scripts/profile-server.js +387 -0
  6. package/dist/tests/test-chalk-regression.js +18 -2
  7. package/dist/tests/test-client-scripts-validation.js +133 -0
  8. package/dist/tests/test-markdown-to-pdf.js +454 -0
  9. package/dist/tests/test-script-location-independence.js +76 -28
  10. package/package.json +5 -2
  11. package/registry/agent-guardrails.md +62 -62
  12. package/registry/rules/communication.md +121 -121
  13. package/registry/rules/continuous-learning.md +54 -54
  14. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  15. package/registry/rules/software-development-lifecycle.md +104 -104
  16. package/registry/scripts/cleanup-branch.ts +341 -0
  17. package/registry/scripts/code-quality-check.sh +559 -559
  18. package/registry/scripts/detect-tautological-tests.sh +38 -38
  19. package/registry/scripts/generate-engagement-emails.ts +830 -0
  20. package/registry/scripts/markdown-to-pdf.js +395 -0
  21. package/registry/scripts/newsletter-helpers.ts +777 -0
  22. package/registry/scripts/profile-server.ts +424 -0
  23. package/registry/scripts/run-thank-you-workflow.ts +122 -0
  24. package/registry/scripts/send-newsletter-simple.ts +102 -0
  25. package/registry/scripts/send-thank-you-emails.ts +57 -0
  26. package/registry/scripts/validate-openapi-limits.ts +366 -366
  27. package/registry/scripts/validate-test-coverage.ts +280 -280
  28. package/registry/scripts/verify-pr-comments.sh +70 -70
  29. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  30. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  31. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  32. package/registry/workflows/convert-to-pdf.md +235 -0
  33. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  34. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  35. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  36. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  37. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  38. package/dist/registry/scripts/build-scripts-generator.js +0 -205
  39. package/dist/registry/scripts/fraim-config.js +0 -61
  40. package/dist/registry/scripts/generic-issues-api.js +0 -100
  41. package/dist/registry/scripts/openapi-generator.js +0 -664
  42. package/dist/registry/scripts/performance/profile-server.js +0 -390
  43. package/dist/test-utils.js +0 -96
  44. package/dist/tests/esm-compat.js +0 -11
  45. package/dist/tests/test-chalk-esm-issue.js +0 -159
  46. package/dist/tests/test-chalk-real-world.js +0 -265
  47. package/dist/tests/test-chalk-resolution-issue.js +0 -304
  48. package/dist/tests/test-fraim-install-chalk-issue.js +0 -254
  49. package/dist/tests/test-npm-resolution-diagnostic.js +0 -140
@@ -1,254 +0,0 @@
1
- "use strict";
2
- /**
3
- * Integration test to verify fraim-framework installs correctly
4
- * and doesn't have the chalk ESM issue
5
- *
6
- * This test:
7
- * 1. Packs the current fraim-framework into a tarball
8
- * 2. Installs it fresh in a temp directory
9
- * 3. Runs fraim init to verify it works
10
- * 4. Tests with both pinned (4.1.2) and unpinned (^4.1.2) chalk versions
11
- */
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- const node_child_process_1 = require("node:child_process");
17
- const test_utils_1 = require("./test-utils");
18
- const fs_1 = __importDefault(require("fs"));
19
- const path_1 = __importDefault(require("path"));
20
- const os_1 = __importDefault(require("os"));
21
- async function runCommand(command, args, cwd) {
22
- return new Promise((resolve) => {
23
- const proc = (0, node_child_process_1.spawn)(command, args, {
24
- cwd,
25
- stdio: 'pipe',
26
- shell: true
27
- });
28
- let stdout = '';
29
- let stderr = '';
30
- proc.stdout?.on('data', (data) => {
31
- stdout += data.toString();
32
- });
33
- proc.stderr?.on('data', (data) => {
34
- stderr += data.toString();
35
- });
36
- proc.on('close', (code) => {
37
- resolve({ code, stdout, stderr });
38
- });
39
- });
40
- }
41
- async function testFraimInstallWithPinnedChalk() {
42
- console.log(' ๐Ÿงช Testing FRAIM install with PINNED chalk (4.1.2)...');
43
- const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-install-pinned-'));
44
- console.log(` ๐Ÿ“‚ Created temp dir: ${tempDir}`);
45
- try {
46
- // 1. Pack the current fraim-framework
47
- console.log(' ๐Ÿ“ฆ Packing fraim-framework...');
48
- const projectRoot = process.cwd();
49
- // Run npm pack in the project root
50
- const packResult = (0, node_child_process_1.execSync)('npm pack', {
51
- cwd: projectRoot,
52
- encoding: 'utf-8'
53
- });
54
- const tarballName = packResult.trim().split('\n').pop()?.trim();
55
- if (!tarballName) {
56
- console.log(' โŒ Failed to get tarball name');
57
- return false;
58
- }
59
- const tarballPath = path_1.default.join(projectRoot, tarballName);
60
- console.log(` โœ… Created tarball: ${tarballName}`);
61
- // 2. Create a test project
62
- const testPackageJson = {
63
- name: 'fraim-install-test',
64
- version: '1.0.0',
65
- private: true
66
- };
67
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'package.json'), JSON.stringify(testPackageJson, null, 2));
68
- // 3. Install fraim-framework from the tarball
69
- console.log(' ๐Ÿ“ฅ Installing fraim-framework from tarball...');
70
- const installResult = await runCommand('npm', ['install', tarballPath, '--silent'], tempDir);
71
- if (installResult.code !== 0) {
72
- console.log(' โŒ npm install failed');
73
- console.log(` stderr: ${installResult.stderr.substring(0, 500)}`);
74
- return false;
75
- }
76
- console.log(' โœ… fraim-framework installed successfully');
77
- // 4. Check which version of chalk was installed
78
- const chalkPackageJsonPath = path_1.default.join(tempDir, 'node_modules', 'chalk', 'package.json');
79
- if (!fs_1.default.existsSync(chalkPackageJsonPath)) {
80
- console.log(' โŒ chalk not found in node_modules');
81
- return false;
82
- }
83
- const chalkPackageJson = JSON.parse(fs_1.default.readFileSync(chalkPackageJsonPath, 'utf-8'));
84
- console.log(` ๐Ÿ“‹ Installed chalk version: ${chalkPackageJson.version}`);
85
- // Verify it's v4.x
86
- if (!chalkPackageJson.version.startsWith('4.')) {
87
- console.log(` โŒ Expected chalk v4.x, got ${chalkPackageJson.version}`);
88
- return false;
89
- }
90
- console.log(' โœ… Chalk v4 installed correctly');
91
- // 5. Try to run fraim init (should work)
92
- console.log(' ๐Ÿš€ Running fraim init...');
93
- const fraimBin = path_1.default.join(tempDir, 'node_modules', '.bin', 'fraim');
94
- // Create a simple test by requiring the CLI directly
95
- const testScript = `
96
- const fraimCli = require('./node_modules/fraim-framework/dist/src/cli/fraim.js');
97
- console.log('โœ… fraim CLI loaded successfully');
98
- `;
99
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'test.js'), testScript);
100
- const testResult = await runCommand('node', ['test.js'], tempDir);
101
- if (testResult.code !== 0) {
102
- console.log(' โŒ Failed to load fraim CLI');
103
- console.log(` stderr: ${testResult.stderr.substring(0, 500)}`);
104
- return false;
105
- }
106
- if (!testResult.stdout.includes('fraim CLI loaded successfully')) {
107
- console.log(' โŒ fraim CLI did not load correctly');
108
- return false;
109
- }
110
- console.log(' โœ… fraim CLI works with pinned chalk!');
111
- // Cleanup tarball
112
- fs_1.default.unlinkSync(tarballPath);
113
- return true;
114
- }
115
- catch (error) {
116
- console.error(' โŒ Test failed with error:', error);
117
- return false;
118
- }
119
- finally {
120
- // Cleanup
121
- try {
122
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
123
- console.log(' ๐Ÿงน Cleaned up temp directory');
124
- }
125
- catch (e) {
126
- console.log(' โš ๏ธ Could not clean up temp directory');
127
- }
128
- }
129
- }
130
- async function testFraimInstallWithUnpinnedChalk() {
131
- console.log(' ๐Ÿงช Testing FRAIM install with UNPINNED chalk (^4.1.2)...');
132
- console.log(' โš ๏ธ This simulates the original issue...');
133
- const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'fraim-install-unpinned-'));
134
- console.log(` ๐Ÿ“‚ Created temp dir: ${tempDir}`);
135
- try {
136
- // 1. Temporarily modify package.json to use ^4.1.2
137
- const projectRoot = process.cwd();
138
- const packageJsonPath = path_1.default.join(projectRoot, 'package.json');
139
- const originalPackageJson = fs_1.default.readFileSync(packageJsonPath, 'utf-8');
140
- const packageJson = JSON.parse(originalPackageJson);
141
- // Save original chalk version
142
- const originalChalkVersion = packageJson.dependencies.chalk;
143
- console.log(` ๐Ÿ“‹ Original chalk version: ${originalChalkVersion}`);
144
- // Temporarily change to ^4.1.2
145
- packageJson.dependencies.chalk = '^4.1.2';
146
- fs_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
147
- console.log(' ๐Ÿ”„ Temporarily changed chalk to ^4.1.2');
148
- // 2. Pack with unpinned version
149
- console.log(' ๐Ÿ“ฆ Packing fraim-framework with unpinned chalk...');
150
- const packResult = (0, node_child_process_1.execSync)('npm pack', {
151
- cwd: projectRoot,
152
- encoding: 'utf-8'
153
- });
154
- const tarballName = packResult.trim().split('\n').pop()?.trim();
155
- if (!tarballName) {
156
- console.log(' โŒ Failed to get tarball name');
157
- // Restore original package.json
158
- fs_1.default.writeFileSync(packageJsonPath, originalPackageJson);
159
- return false;
160
- }
161
- const tarballPath = path_1.default.join(projectRoot, tarballName);
162
- console.log(` โœ… Created tarball: ${tarballName}`);
163
- // 3. Restore original package.json
164
- fs_1.default.writeFileSync(packageJsonPath, originalPackageJson);
165
- console.log(' โœ… Restored original package.json');
166
- // 4. Create a test project
167
- const testPackageJson = {
168
- name: 'fraim-install-test-unpinned',
169
- version: '1.0.0',
170
- private: true
171
- };
172
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'package.json'), JSON.stringify(testPackageJson, null, 2));
173
- // 5. Install fraim-framework from the tarball
174
- console.log(' ๐Ÿ“ฅ Installing fraim-framework with unpinned chalk...');
175
- const installResult = await runCommand('npm', ['install', tarballPath, '--silent'], tempDir);
176
- if (installResult.code !== 0) {
177
- console.log(' โŒ npm install failed');
178
- console.log(` stderr: ${installResult.stderr.substring(0, 500)}`);
179
- fs_1.default.unlinkSync(tarballPath);
180
- return false;
181
- }
182
- console.log(' โœ… fraim-framework installed');
183
- // 6. Check which version of chalk was installed
184
- const chalkPackageJsonPath = path_1.default.join(tempDir, 'node_modules', 'chalk', 'package.json');
185
- if (!fs_1.default.existsSync(chalkPackageJsonPath)) {
186
- console.log(' โŒ chalk not found in node_modules');
187
- fs_1.default.unlinkSync(tarballPath);
188
- return false;
189
- }
190
- const chalkPackageJson = JSON.parse(fs_1.default.readFileSync(chalkPackageJsonPath, 'utf-8'));
191
- console.log(` ๐Ÿ“‹ Installed chalk version: ${chalkPackageJson.version}`);
192
- // 7. Try to load fraim CLI
193
- const testScript = `
194
- const fraimCli = require('./node_modules/fraim-framework/dist/src/cli/fraim.js');
195
- console.log('โœ… fraim CLI loaded successfully');
196
- `;
197
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'test.js'), testScript);
198
- const testResult = await runCommand('node', ['test.js'], tempDir);
199
- // With ^4.1.2, it MIGHT install v5 in some scenarios, causing ERR_REQUIRE_ESM
200
- if (testResult.code !== 0) {
201
- if (testResult.stderr.includes('ERR_REQUIRE_ESM')) {
202
- console.log(' โš ๏ธ Got ERR_REQUIRE_ESM error (this is the bug we fixed!)');
203
- console.log(` ๐Ÿ“‹ Chalk version that caused issue: ${chalkPackageJson.version}`);
204
- console.log(' โœ… Test successfully reproduced the original issue');
205
- fs_1.default.unlinkSync(tarballPath);
206
- return true; // This is expected - we reproduced the bug
207
- }
208
- else {
209
- console.log(' โŒ Failed with unexpected error');
210
- console.log(` stderr: ${testResult.stderr.substring(0, 500)}`);
211
- fs_1.default.unlinkSync(tarballPath);
212
- return false;
213
- }
214
- }
215
- // If it worked, that's also fine - means npm resolved to v4
216
- console.log(' โœ… fraim CLI works (npm resolved to v4)');
217
- console.log(' โ„น๏ธ Note: ^4.1.2 worked this time, but could fail in other environments');
218
- // Cleanup tarball
219
- fs_1.default.unlinkSync(tarballPath);
220
- return true;
221
- }
222
- catch (error) {
223
- console.error(' โŒ Test failed with error:', error);
224
- return false;
225
- }
226
- finally {
227
- // Cleanup
228
- try {
229
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
230
- console.log(' ๐Ÿงน Cleaned up temp directory');
231
- }
232
- catch (e) {
233
- console.log(' โš ๏ธ Could not clean up temp directory');
234
- }
235
- }
236
- }
237
- async function runFraimInstallTest(testCase) {
238
- return await testCase.testFunction();
239
- }
240
- const testCases = [
241
- {
242
- name: 'FRAIM Install with Pinned Chalk',
243
- description: 'Verifies fraim-framework installs correctly with chalk pinned to 4.1.2',
244
- testFunction: testFraimInstallWithPinnedChalk,
245
- tags: ['integration', 'install', 'chalk']
246
- },
247
- {
248
- name: 'FRAIM Install with Unpinned Chalk',
249
- description: 'Tests fraim-framework with ^4.1.2 to see if it can reproduce the issue',
250
- testFunction: testFraimInstallWithUnpinnedChalk,
251
- tags: ['integration', 'install', 'chalk', 'reproduction']
252
- }
253
- ];
254
- (0, test_utils_1.runTests)(testCases, runFraimInstallTest, 'FRAIM Install Chalk Issue Test');
@@ -1,140 +0,0 @@
1
- "use strict";
2
- /**
3
- * Diagnostic test to understand npm's chalk resolution behavior
4
- *
5
- * This test will show us exactly what npm does when there's a version conflict
6
- */
7
- var __importDefault = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const node_child_process_1 = require("node:child_process");
12
- const fs_1 = __importDefault(require("fs"));
13
- const path_1 = __importDefault(require("path"));
14
- const os_1 = __importDefault(require("os"));
15
- async function main() {
16
- console.log('๐Ÿ” NPM Chalk Resolution Diagnostic\n');
17
- const tempDir = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'npm-diagnostic-'));
18
- console.log(`๐Ÿ“‚ Temp dir: ${tempDir}\n`);
19
- try {
20
- // 1. Pack fraim-framework
21
- console.log('๐Ÿ“ฆ Packing fraim-framework...');
22
- const projectRoot = process.cwd();
23
- const packResult = (0, node_child_process_1.execSync)('npm pack', {
24
- cwd: projectRoot,
25
- encoding: 'utf-8'
26
- });
27
- const tarballName = packResult.trim().split('\n').pop()?.trim();
28
- if (!tarballName) {
29
- console.log('โŒ Failed to pack');
30
- return;
31
- }
32
- const tarballPath = path_1.default.join(projectRoot, tarballName);
33
- console.log(`โœ… Created: ${tarballName}\n`);
34
- // 2. Create test project with chalk v5
35
- console.log('๐Ÿ“ Creating test project with chalk v5 dependency...');
36
- const packageJson = {
37
- name: 'diagnostic-test',
38
- version: '1.0.0',
39
- dependencies: {
40
- 'chalk': '^5.0.0',
41
- 'fraim-framework': `file:${tarballPath}`
42
- }
43
- };
44
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'package.json'), JSON.stringify(packageJson, null, 2));
45
- // 3. Install
46
- console.log('๐Ÿ“ฅ Running npm install...\n');
47
- try {
48
- const installOutput = (0, node_child_process_1.execSync)('npm install', {
49
- cwd: tempDir,
50
- encoding: 'utf-8',
51
- stdio: 'pipe'
52
- });
53
- console.log('โœ… Install completed\n');
54
- }
55
- catch (error) {
56
- console.log('โš ๏ธ Install had issues:\n', error.stdout || error.message);
57
- }
58
- // 4. Check what was installed
59
- console.log('๐Ÿ“‹ Checking installed chalk versions...\n');
60
- // Root chalk
61
- const rootChalkPath = path_1.default.join(tempDir, 'node_modules', 'chalk', 'package.json');
62
- if (fs_1.default.existsSync(rootChalkPath)) {
63
- const pkg = JSON.parse(fs_1.default.readFileSync(rootChalkPath, 'utf-8'));
64
- console.log(` Root chalk: ${pkg.version}`);
65
- console.log(` Type: ${pkg.type || 'commonjs'}`);
66
- console.log(` Main: ${pkg.main || 'N/A'}`);
67
- console.log(` Exports: ${pkg.exports ? 'Yes' : 'No'}\n`);
68
- }
69
- else {
70
- console.log(' โŒ No root chalk found\n');
71
- }
72
- // Fraim's chalk
73
- const fraimChalkPath = path_1.default.join(tempDir, 'node_modules', 'fraim-framework', 'node_modules', 'chalk', 'package.json');
74
- if (fs_1.default.existsSync(fraimChalkPath)) {
75
- const pkg = JSON.parse(fs_1.default.readFileSync(fraimChalkPath, 'utf-8'));
76
- console.log(` fraim-framework's chalk: ${pkg.version}`);
77
- console.log(` Type: ${pkg.type || 'commonjs'}`);
78
- console.log(` Main: ${pkg.main || 'N/A'}\n`);
79
- }
80
- else {
81
- console.log(' โ„น๏ธ fraim-framework has no separate chalk (using root)\n');
82
- }
83
- // 5. Run npm ls to see the dependency tree
84
- console.log('๐ŸŒณ Dependency tree (npm ls chalk):\n');
85
- try {
86
- const lsOutput = (0, node_child_process_1.execSync)('npm ls chalk', {
87
- cwd: tempDir,
88
- encoding: 'utf-8'
89
- });
90
- console.log(lsOutput);
91
- }
92
- catch (error) {
93
- console.log(error.stdout || error.message);
94
- }
95
- // 6. Check fraim-framework's package.json in node_modules
96
- console.log('\n๐Ÿ“‹ fraim-framework\'s chalk dependency in node_modules:\n');
97
- const fraimPkgPath = path_1.default.join(tempDir, 'node_modules', 'fraim-framework', 'package.json');
98
- if (fs_1.default.existsSync(fraimPkgPath)) {
99
- const fraimPkg = JSON.parse(fs_1.default.readFileSync(fraimPkgPath, 'utf-8'));
100
- console.log(` Chalk version in package.json: ${fraimPkg.dependencies?.chalk || 'N/A'}\n`);
101
- }
102
- // 7. Try to load fraim CLI
103
- console.log('๐Ÿš€ Testing fraim CLI load...\n');
104
- const testScript = `
105
- try {
106
- const fraimCli = require('./node_modules/fraim-framework/dist/src/cli/fraim.js');
107
- console.log('โœ… SUCCESS: fraim CLI loaded');
108
- } catch (error) {
109
- console.log('โŒ ERROR:', error.code || 'Unknown');
110
- console.log('Message:', error.message.substring(0, 200));
111
- }
112
- `;
113
- fs_1.default.writeFileSync(path_1.default.join(tempDir, 'test.js'), testScript);
114
- try {
115
- const testOutput = (0, node_child_process_1.execSync)('node test.js', {
116
- cwd: tempDir,
117
- encoding: 'utf-8'
118
- });
119
- console.log(testOutput);
120
- }
121
- catch (error) {
122
- console.log(error.stdout || error.message);
123
- }
124
- // Cleanup
125
- fs_1.default.unlinkSync(tarballPath);
126
- console.log('\nโœ… Diagnostic complete');
127
- }
128
- catch (error) {
129
- console.error('\nโŒ Diagnostic failed:', error);
130
- }
131
- finally {
132
- try {
133
- fs_1.default.rmSync(tempDir, { recursive: true, force: true });
134
- }
135
- catch (e) {
136
- console.log('\nโš ๏ธ Could not clean up temp directory');
137
- }
138
- }
139
- }
140
- main();