claude-prism 0.8.0 ā 0.8.1
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/bin/cli.mjs +6 -2
- package/lib/installer.mjs +19 -2
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -163,8 +163,12 @@ switch (command) {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
console.log('š claude-prism update\n');
|
|
166
|
-
await update(cwd);
|
|
167
|
-
|
|
166
|
+
const result = await update(cwd);
|
|
167
|
+
if (result?.sourceRepo) {
|
|
168
|
+
console.log('ā
UDEC methodology updated (from local templates)');
|
|
169
|
+
} else {
|
|
170
|
+
console.log('ā
UDEC methodology updated');
|
|
171
|
+
}
|
|
168
172
|
console.log('ā
Commands updated');
|
|
169
173
|
console.log('ā
Commit guard updated');
|
|
170
174
|
console.log('\nš Prism updated to latest.');
|
package/lib/installer.mjs
CHANGED
|
@@ -198,6 +198,23 @@ export function uninstall(projectDir) {
|
|
|
198
198
|
* @param {string} projectDir
|
|
199
199
|
*/
|
|
200
200
|
export async function update(projectDir) {
|
|
201
|
+
// Self-update detection: if running inside the claude-prism source repo,
|
|
202
|
+
// use local templates instead of the npx-downloaded package templates
|
|
203
|
+
const localPkgPath = join(projectDir, 'package.json');
|
|
204
|
+
if (existsSync(localPkgPath)) {
|
|
205
|
+
try {
|
|
206
|
+
const localPkg = JSON.parse(readFileSync(localPkgPath, 'utf8'));
|
|
207
|
+
if (localPkg.name === 'claude-prism') {
|
|
208
|
+
// We're in the source repo ā use local templates directly
|
|
209
|
+
const localRulesPath = join(projectDir, 'templates', 'rules.md');
|
|
210
|
+
if (existsSync(localRulesPath)) {
|
|
211
|
+
injectRules(projectDir, localRulesPath);
|
|
212
|
+
return { sourceRepo: true };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
} catch { /* not our package, proceed normally */ }
|
|
216
|
+
}
|
|
217
|
+
|
|
201
218
|
// Migration: rename .prism.json to .claude-prism.json
|
|
202
219
|
const oldConfigPath = join(projectDir, '.prism.json');
|
|
203
220
|
const newConfigPath = join(projectDir, '.claude-prism.json');
|
|
@@ -526,9 +543,9 @@ export function dryRun(projectDir, options = {}) {
|
|
|
526
543
|
|
|
527
544
|
// āāā internal helpers āāā
|
|
528
545
|
|
|
529
|
-
function injectRules(projectDir) {
|
|
546
|
+
function injectRules(projectDir, overrideRulesPath) {
|
|
530
547
|
const claudeMdPath = join(projectDir, 'CLAUDE.md');
|
|
531
|
-
const rulesPath = join(TEMPLATES_DIR, 'rules.md');
|
|
548
|
+
const rulesPath = overrideRulesPath || join(TEMPLATES_DIR, 'rules.md');
|
|
532
549
|
if (!existsSync(rulesPath)) return;
|
|
533
550
|
|
|
534
551
|
const rules = readFileSync(rulesPath, 'utf8');
|