grimoire-framework 1.0.15 → 1.0.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.
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
# - SHA256 hashes for change detection
|
|
8
8
|
# - File types for categorization
|
|
9
9
|
#
|
|
10
|
-
version: 1.0.
|
|
11
|
-
generated_at: "2026-02-
|
|
10
|
+
version: 1.0.16
|
|
11
|
+
generated_at: "2026-02-22T13:45:24.988Z"
|
|
12
12
|
generator: scripts/generate-install-manifest.js
|
|
13
13
|
file_count: 1011
|
|
14
14
|
files:
|
package/bin/commands/update.js
CHANGED
|
@@ -29,6 +29,7 @@ const FRAMEWORK_SYNC_DIRS = [
|
|
|
29
29
|
// Single files to sync (framework root → project root)
|
|
30
30
|
const FRAMEWORK_SYNC_FILES = [
|
|
31
31
|
{ src: 'GEMINI.md', dest: 'GEMINI.md' },
|
|
32
|
+
{ src: '.grimoire/product/templates/ide-rules/gemini-rules.md', dest: path.join('.gemini', 'rules.md') },
|
|
32
33
|
];
|
|
33
34
|
|
|
34
35
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grimoire-framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "Grimoire: AI-Orchestrated System for Full Stack Development - Core Framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"validate:semantic-lint": "node scripts/semantic-lint.js",
|
|
78
78
|
"manifest:ensure": "node scripts/ensure-manifest.js",
|
|
79
79
|
"sync:ide:cursor": "node .grimoire/infrastructure/scripts/ide-sync/index.js sync --ide cursor",
|
|
80
|
-
"prepublishOnly": "npm run generate:manifest && npm run validate:manifest",
|
|
80
|
+
"prepublishOnly": "node scripts/pre-publish-check.js && npm run generate:manifest && npm run validate:manifest",
|
|
81
81
|
"prepare": "husky"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* pre-publish-check.js
|
|
6
|
+
* Validates that all critical files are included in the npm package before publish.
|
|
7
|
+
* Run: node scripts/pre-publish-check.js
|
|
8
|
+
*
|
|
9
|
+
* Bloqueia o publish se arquivos críticos estiverem faltando.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { execSync } = require('child_process');
|
|
15
|
+
|
|
16
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
17
|
+
const PASS = '✅';
|
|
18
|
+
const FAIL = '❌';
|
|
19
|
+
const WARN = '⚠️ ';
|
|
20
|
+
|
|
21
|
+
let hasErrors = false;
|
|
22
|
+
|
|
23
|
+
function check(label, condition, errorMsg) {
|
|
24
|
+
if (condition) {
|
|
25
|
+
console.log(` ${PASS} ${label}`);
|
|
26
|
+
} else {
|
|
27
|
+
console.log(` ${FAIL} ${label}`);
|
|
28
|
+
console.log(` → ${errorMsg}`);
|
|
29
|
+
hasErrors = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function warn(label, condition, warnMsg) {
|
|
34
|
+
if (condition) {
|
|
35
|
+
console.log(` ${PASS} ${label}`);
|
|
36
|
+
} else {
|
|
37
|
+
console.log(` ${WARN} ${label}`);
|
|
38
|
+
console.log(` → ${warnMsg}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('\n🔍 Grimoire Framework — Pre-Publish Quality Gate\n' + '='.repeat(50));
|
|
43
|
+
|
|
44
|
+
// ── 1. Critical root files ─────────────────────────────────────────────────
|
|
45
|
+
console.log('\n📄 Critical root files:');
|
|
46
|
+
check('GEMINI.md exists', fs.existsSync(path.join(ROOT, 'GEMINI.md')), 'GEMINI.md is required for Gemini CLI integration');
|
|
47
|
+
check('README.md exists', fs.existsSync(path.join(ROOT, 'README.md')), 'README.md missing');
|
|
48
|
+
check('LICENSE exists', fs.existsSync(path.join(ROOT, 'LICENSE')), 'LICENSE file missing');
|
|
49
|
+
|
|
50
|
+
// ── 2. package.json files[] validation ────────────────────────────────────
|
|
51
|
+
console.log('\n📦 package.json files[] field:');
|
|
52
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
53
|
+
const files = pkg.files || [];
|
|
54
|
+
|
|
55
|
+
const requiredInFiles = [
|
|
56
|
+
'GEMINI.md',
|
|
57
|
+
'.codex/',
|
|
58
|
+
'.gemini/',
|
|
59
|
+
'.cursor/',
|
|
60
|
+
'.grimoire/',
|
|
61
|
+
'bin/',
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
for (const required of requiredInFiles) {
|
|
65
|
+
check(
|
|
66
|
+
`files[] includes "${required}"`,
|
|
67
|
+
files.some(f => f === required || f.startsWith(required.replace('/', ''))),
|
|
68
|
+
`Add "${required}" to the "files" array in package.json`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ── 3. Binary entry points ─────────────────────────────────────────────────
|
|
73
|
+
console.log('\n⚙️ Binary entry points (bin/):');
|
|
74
|
+
const binEntries = pkg.bin || {};
|
|
75
|
+
const CORRECT_CLI = 'bin/grimoire-cli.js';
|
|
76
|
+
|
|
77
|
+
for (const [name, script] of Object.entries(binEntries)) {
|
|
78
|
+
if (name === 'grimoire-minimal') continue; // known exception
|
|
79
|
+
check(
|
|
80
|
+
`"${name}" → ${script}`,
|
|
81
|
+
script === CORRECT_CLI,
|
|
82
|
+
`Binary "${name}" points to "${script}" but should point to "${CORRECT_CLI}"`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ── 4. .codex/agents presence ─────────────────────────────────────────────
|
|
87
|
+
console.log('\n🤖 Agents (.codex/agents):');
|
|
88
|
+
const agentsDir = path.join(ROOT, '.codex', 'agents');
|
|
89
|
+
const requiredAgents = [
|
|
90
|
+
'grimoire-master.md', 'dev.md', 'qa.md', 'architect.md',
|
|
91
|
+
'pm.md', 'po.md', 'sm.md', 'devops.md',
|
|
92
|
+
'data-engineer.md', 'analyst.md', 'ux-design-expert.md', 'squad-creator.md',
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
if (fs.existsSync(agentsDir)) {
|
|
96
|
+
const existingAgents = fs.readdirSync(agentsDir);
|
|
97
|
+
check(
|
|
98
|
+
`At least ${requiredAgents.length} core agents exist (found ${existingAgents.length})`,
|
|
99
|
+
existingAgents.length >= requiredAgents.length,
|
|
100
|
+
`Expected ${requiredAgents.length} agents, found ${existingAgents.length}`
|
|
101
|
+
);
|
|
102
|
+
for (const agent of requiredAgents) {
|
|
103
|
+
check(
|
|
104
|
+
`Agent: ${agent}`,
|
|
105
|
+
existingAgents.includes(agent),
|
|
106
|
+
`Missing required agent file: .codex/agents/${agent}`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
check('.codex/agents/ directory exists', false, '.codex/agents/ directory is missing');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ── 5. GEMINI.md content validation ───────────────────────────────────────
|
|
114
|
+
console.log('\n📝 GEMINI.md content:');
|
|
115
|
+
const geminiMd = path.join(ROOT, 'GEMINI.md');
|
|
116
|
+
if (fs.existsSync(geminiMd)) {
|
|
117
|
+
const content = fs.readFileSync(geminiMd, 'utf8');
|
|
118
|
+
check('Contains Michelangelo persona', content.includes('Michelangelo'), 'GEMINI.md must define Michelangelo as default agent');
|
|
119
|
+
check('Contains agent roster', content.includes('@dev'), 'GEMINI.md should include agent roster');
|
|
120
|
+
check('Non-empty (>500 chars)', content.length > 500, 'GEMINI.md seems too short, may be incomplete');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// ── 6. bin/grimoire-cli.js entry point ────────────────────────────────────
|
|
124
|
+
console.log('\n🚀 CLI entry point:');
|
|
125
|
+
const cliPath = path.join(ROOT, 'bin', 'grimoire-cli.js');
|
|
126
|
+
if (fs.existsSync(cliPath)) {
|
|
127
|
+
const cliContent = fs.readFileSync(cliPath, 'utf8');
|
|
128
|
+
check('commands/update.js is used (not grimoireUpdater)',
|
|
129
|
+
cliContent.includes("require('./commands/update')"),
|
|
130
|
+
'grimoire-cli.js should delegate update to commands/update.js'
|
|
131
|
+
);
|
|
132
|
+
check('No direct reference to old updater',
|
|
133
|
+
!cliContent.includes('grimoireUpdater'),
|
|
134
|
+
'grimoire-cli.js still references old grimoireUpdater'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ── 7. npm pack dry-run to count files ────────────────────────────────────
|
|
139
|
+
console.log('\n📦 npm pack dry-run:');
|
|
140
|
+
try {
|
|
141
|
+
const packOutput = execSync('npm pack --dry-run 2>&1', { cwd: ROOT, encoding: 'utf8' });
|
|
142
|
+
const fileCount = (packOutput.match(/npm notice \d+\.\d+[kBMG]B/g) || []).length;
|
|
143
|
+
warn(
|
|
144
|
+
`Package contains files (detected ~${fileCount} size entries)`,
|
|
145
|
+
fileCount > 10,
|
|
146
|
+
'Very few files detected in package — check the files[] field'
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
const hasGeminiMd = packOutput.includes('GEMINI.md');
|
|
150
|
+
check('GEMINI.md is in the published package', hasGeminiMd, 'GEMINI.md not found in npm pack output — add to files[]');
|
|
151
|
+
|
|
152
|
+
const hasCodex = packOutput.includes('.codex/');
|
|
153
|
+
check('.codex/ agents are in the published package', hasCodex, '.codex/ not found in npm pack output — add to files[]');
|
|
154
|
+
} catch (err) {
|
|
155
|
+
warn('npm pack dry-run', false, `Could not run npm pack: ${err.message}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ── Summary ────────────────────────────────────────────────────────────────
|
|
159
|
+
console.log('\n' + '='.repeat(50));
|
|
160
|
+
if (hasErrors) {
|
|
161
|
+
console.log('❌ Pre-publish check FAILED — fix the errors above before publishing.\n');
|
|
162
|
+
process.exit(1);
|
|
163
|
+
} else {
|
|
164
|
+
console.log('✅ All checks passed — safe to publish!\n');
|
|
165
|
+
process.exit(0);
|
|
166
|
+
}
|