@boopkit/cli 0.6.14 → 0.6.16
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/dist/capability-versions.json +5 -5
- package/dist/cli.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/loop.d.ts +10 -1
- package/dist/commands/loop.js +21 -3
- package/dist/commands/update.js +30 -1
- package/dist/lib/execute.js +3 -12
- package/dist/lib/scaffold.d.ts +36 -6
- package/dist/lib/scaffold.js +79 -10
- package/dist/lib/script-merge.d.ts +55 -0
- package/dist/lib/script-merge.js +144 -0
- package/dist/lib/stale-scripts.d.ts +3 -2
- package/dist/lib/stale-scripts.js +3 -2
- package/dist/lib/update.d.ts +7 -0
- package/dist/lib/update.js +67 -47
- package/docs/loop.md +1 -1
- package/package.json +1 -1
- package/dist/commands/loop.js.orig-pre-maxbuffer +0 -1455
- package/dist/commands/status.test.d.ts +0 -1
- package/dist/commands/status.test.js +0 -118
- package/dist/lib/project.test.d.ts +0 -1
- package/dist/lib/project.test.js +0 -118
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const fs = __importStar(require("fs"));
|
|
37
|
-
const path = __importStar(require("path"));
|
|
38
|
-
const os = __importStar(require("os"));
|
|
39
|
-
const status_1 = require("../commands/status");
|
|
40
|
-
describe('formatStatus', () => {
|
|
41
|
-
it('formats manifest fields into a readable status string', () => {
|
|
42
|
-
const manifest = {
|
|
43
|
-
name: 'my-saas',
|
|
44
|
-
profile: 'web-app',
|
|
45
|
-
boopVersion: '0.1.0',
|
|
46
|
-
capabilities: ['database', 'api', 'web'],
|
|
47
|
-
createdAt: '2026-03-19T00:00:00Z',
|
|
48
|
-
};
|
|
49
|
-
const output = (0, status_1.formatStatus)(manifest);
|
|
50
|
-
expect(output).toContain('my-saas');
|
|
51
|
-
expect(output).toContain('web-app');
|
|
52
|
-
expect(output).toContain('0.1.0');
|
|
53
|
-
expect(output).toContain('database');
|
|
54
|
-
expect(output).toContain('api');
|
|
55
|
-
expect(output).toContain('web');
|
|
56
|
-
expect(output).toContain('2026-03-19');
|
|
57
|
-
});
|
|
58
|
-
it('handles empty capabilities list', () => {
|
|
59
|
-
const manifest = {
|
|
60
|
-
name: 'bare-project',
|
|
61
|
-
profile: 'web-app',
|
|
62
|
-
boopVersion: '0.1.0',
|
|
63
|
-
capabilities: [],
|
|
64
|
-
createdAt: '2026-03-20T00:00:00Z',
|
|
65
|
-
};
|
|
66
|
-
const output = (0, status_1.formatStatus)(manifest);
|
|
67
|
-
expect(output).toContain('bare-project');
|
|
68
|
-
expect(output).toContain('none');
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
describe('status command integration', () => {
|
|
72
|
-
let tmpDir;
|
|
73
|
-
let originalCwd;
|
|
74
|
-
beforeEach(() => {
|
|
75
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'boop-status-'));
|
|
76
|
-
originalCwd = process.cwd();
|
|
77
|
-
process.chdir(tmpDir);
|
|
78
|
-
});
|
|
79
|
-
afterEach(() => {
|
|
80
|
-
process.chdir(originalCwd);
|
|
81
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
82
|
-
});
|
|
83
|
-
it('prints status when .boop.json exists', () => {
|
|
84
|
-
const manifest = {
|
|
85
|
-
name: 'test-project',
|
|
86
|
-
profile: 'web-app',
|
|
87
|
-
boopVersion: '0.1.0',
|
|
88
|
-
capabilities: ['api', 'database'],
|
|
89
|
-
createdAt: '2026-03-19T12:00:00Z',
|
|
90
|
-
};
|
|
91
|
-
fs.writeFileSync(path.join(tmpDir, '.boop.json'), JSON.stringify(manifest));
|
|
92
|
-
const consoleSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
93
|
-
const { runStatus } = require('../commands/status');
|
|
94
|
-
runStatus();
|
|
95
|
-
expect(consoleSpy).toHaveBeenCalled();
|
|
96
|
-
const output = consoleSpy.mock.calls.map((c) => c.join(' ')).join('\n');
|
|
97
|
-
expect(output).toContain('test-project');
|
|
98
|
-
expect(output).toContain('web-app');
|
|
99
|
-
consoleSpy.mockRestore();
|
|
100
|
-
});
|
|
101
|
-
it('prints error when not in a boop project', () => {
|
|
102
|
-
const consoleErrorSpy = jest
|
|
103
|
-
.spyOn(console, 'error')
|
|
104
|
-
.mockImplementation();
|
|
105
|
-
const processExitSpy = jest
|
|
106
|
-
.spyOn(process, 'exit')
|
|
107
|
-
.mockImplementation(() => undefined);
|
|
108
|
-
const { runStatus } = require('../commands/status');
|
|
109
|
-
runStatus();
|
|
110
|
-
expect(consoleErrorSpy).toHaveBeenCalled();
|
|
111
|
-
const output = consoleErrorSpy.mock.calls
|
|
112
|
-
.map((c) => c.join(' '))
|
|
113
|
-
.join('\n');
|
|
114
|
-
expect(output).toMatch(/not.*boop project/i);
|
|
115
|
-
consoleErrorSpy.mockRestore();
|
|
116
|
-
processExitSpy.mockRestore();
|
|
117
|
-
});
|
|
118
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib/project.test.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const fs = __importStar(require("fs"));
|
|
37
|
-
const path = __importStar(require("path"));
|
|
38
|
-
const os = __importStar(require("os"));
|
|
39
|
-
const project_1 = require("../lib/project");
|
|
40
|
-
describe('readProjectManifest', () => {
|
|
41
|
-
let tmpDir;
|
|
42
|
-
beforeEach(() => {
|
|
43
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'boop-test-'));
|
|
44
|
-
});
|
|
45
|
-
afterEach(() => {
|
|
46
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
47
|
-
});
|
|
48
|
-
it('reads a valid .boop.json manifest', () => {
|
|
49
|
-
const manifest = {
|
|
50
|
-
name: 'my-saas',
|
|
51
|
-
profile: 'web-app',
|
|
52
|
-
boopVersion: '0.1.0',
|
|
53
|
-
capabilities: ['database', 'api', 'web'],
|
|
54
|
-
createdAt: '2026-03-19T00:00:00Z',
|
|
55
|
-
};
|
|
56
|
-
fs.writeFileSync(path.join(tmpDir, '.boop.json'), JSON.stringify(manifest));
|
|
57
|
-
const result = (0, project_1.readProjectManifest)(tmpDir);
|
|
58
|
-
expect(result).toEqual(manifest);
|
|
59
|
-
});
|
|
60
|
-
it('returns null when .boop.json does not exist', () => {
|
|
61
|
-
const result = (0, project_1.readProjectManifest)(tmpDir);
|
|
62
|
-
expect(result).toBeNull();
|
|
63
|
-
});
|
|
64
|
-
it('throws on invalid JSON', () => {
|
|
65
|
-
fs.writeFileSync(path.join(tmpDir, '.boop.json'), '{ not valid json }');
|
|
66
|
-
expect(() => (0, project_1.readProjectManifest)(tmpDir)).toThrow();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
describe('writeProjectManifest', () => {
|
|
70
|
-
let tmpDir;
|
|
71
|
-
beforeEach(() => {
|
|
72
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'boop-test-'));
|
|
73
|
-
});
|
|
74
|
-
afterEach(() => {
|
|
75
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
76
|
-
});
|
|
77
|
-
it('writes a manifest that can be read back', () => {
|
|
78
|
-
const manifest = {
|
|
79
|
-
name: 'round-trip',
|
|
80
|
-
profile: 'web-app',
|
|
81
|
-
boopVersion: '0.1.0',
|
|
82
|
-
capabilities: ['api', 'database'],
|
|
83
|
-
createdAt: '2026-03-20T00:00:00Z',
|
|
84
|
-
};
|
|
85
|
-
(0, project_1.writeProjectManifest)(tmpDir, manifest);
|
|
86
|
-
const result = (0, project_1.readProjectManifest)(tmpDir);
|
|
87
|
-
expect(result).toEqual(manifest);
|
|
88
|
-
});
|
|
89
|
-
it('writes formatted JSON with trailing newline', () => {
|
|
90
|
-
const manifest = {
|
|
91
|
-
name: 'test',
|
|
92
|
-
profile: 'web-app',
|
|
93
|
-
boopVersion: '0.1.0',
|
|
94
|
-
capabilities: [],
|
|
95
|
-
createdAt: '2026-03-20T00:00:00Z',
|
|
96
|
-
};
|
|
97
|
-
(0, project_1.writeProjectManifest)(tmpDir, manifest);
|
|
98
|
-
const raw = fs.readFileSync(path.join(tmpDir, '.boop.json'), 'utf-8');
|
|
99
|
-
expect(raw).toContain('\n'); // formatted, not single-line
|
|
100
|
-
expect(raw.endsWith('\n')).toBe(true);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe('isBoopProject', () => {
|
|
104
|
-
let tmpDir;
|
|
105
|
-
beforeEach(() => {
|
|
106
|
-
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'boop-test-'));
|
|
107
|
-
});
|
|
108
|
-
afterEach(() => {
|
|
109
|
-
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
110
|
-
});
|
|
111
|
-
it('returns true when .boop.json exists', () => {
|
|
112
|
-
fs.writeFileSync(path.join(tmpDir, '.boop.json'), '{}');
|
|
113
|
-
expect((0, project_1.isBoopProject)(tmpDir)).toBe(true);
|
|
114
|
-
});
|
|
115
|
-
it('returns false when .boop.json does not exist', () => {
|
|
116
|
-
expect((0, project_1.isBoopProject)(tmpDir)).toBe(false);
|
|
117
|
-
});
|
|
118
|
-
});
|