@thebassclef/lite 1.0.3 → 1.0.4
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/cli.cjs +27 -6
- package/dist/cli.js +27 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -548,8 +548,11 @@ function copySubstrate(targetDir, options = {}) {
|
|
|
548
548
|
for (const [directory, groupFiles] of groups) {
|
|
549
549
|
let completedInGroup = 0;
|
|
550
550
|
for (const relPath of groupFiles) {
|
|
551
|
-
const
|
|
552
|
-
|
|
551
|
+
const decisions = decisionsForFile(relPath, scopeMap, targetDir, options);
|
|
552
|
+
for (const decision of decisions) {
|
|
553
|
+
const outcome = copyOne(relPath, bundleRoot, options, result, decision);
|
|
554
|
+
if (outcome !== "skipped") completedInGroup += 1;
|
|
555
|
+
}
|
|
553
556
|
}
|
|
554
557
|
if (options.onProgress) options.onProgress(directory, completedInGroup);
|
|
555
558
|
}
|
|
@@ -656,12 +659,30 @@ function buildScopeMap(bundleRoot, targetDir, options, bundleHookRelPaths) {
|
|
|
656
659
|
function isHookFile(relPath) {
|
|
657
660
|
return relPath.startsWith(HOOKS_SUBPATH) && relPath.endsWith(".sh");
|
|
658
661
|
}
|
|
659
|
-
function
|
|
662
|
+
function decisionsForFile(relPath, scopeMap, targetDir, options) {
|
|
663
|
+
if (!isHookFile(relPath)) {
|
|
664
|
+
return [{ scope: "project", targetPath: node_path.join(targetDir, mapAdopterPath(relPath)) }];
|
|
665
|
+
}
|
|
666
|
+
const declared = scopeMap.get(relPath);
|
|
667
|
+
if (declared) {
|
|
668
|
+
return [declared];
|
|
669
|
+
}
|
|
670
|
+
const allowRoot = options.allowRoot ?? false;
|
|
671
|
+
const userDecision = classify$1(
|
|
672
|
+
{ command: `$HOME/${relPath}` },
|
|
673
|
+
{ targetDir, allowRoot }
|
|
674
|
+
);
|
|
675
|
+
const projectDecision = classify$1(
|
|
676
|
+
{ command: `$CLAUDE_PROJECT_DIR/${relPath}` },
|
|
677
|
+
{ targetDir, allowRoot }
|
|
678
|
+
);
|
|
679
|
+
return [userDecision, projectDecision];
|
|
680
|
+
}
|
|
681
|
+
function copyOne(relPath, bundleRoot, options, result, scopeDecision) {
|
|
660
682
|
const sourcePath = node_path.join(bundleRoot, relPath);
|
|
661
683
|
const adopterRelPath = mapAdopterPath(relPath);
|
|
662
|
-
const
|
|
663
|
-
const
|
|
664
|
-
const scope = scopeDecision ? scopeDecision.scope : "project";
|
|
684
|
+
const targetPath = scopeDecision.targetPath;
|
|
685
|
+
const scope = scopeDecision.scope;
|
|
665
686
|
let content;
|
|
666
687
|
try {
|
|
667
688
|
content = node_fs.readFileSync(sourcePath, "utf8");
|
package/dist/cli.js
CHANGED
|
@@ -525,8 +525,11 @@ function copySubstrate(targetDir, options = {}) {
|
|
|
525
525
|
for (const [directory, groupFiles] of groups) {
|
|
526
526
|
let completedInGroup = 0;
|
|
527
527
|
for (const relPath of groupFiles) {
|
|
528
|
-
const
|
|
529
|
-
|
|
528
|
+
const decisions = decisionsForFile(relPath, scopeMap, targetDir, options);
|
|
529
|
+
for (const decision of decisions) {
|
|
530
|
+
const outcome = copyOne(relPath, bundleRoot, options, result, decision);
|
|
531
|
+
if (outcome !== "skipped") completedInGroup += 1;
|
|
532
|
+
}
|
|
530
533
|
}
|
|
531
534
|
if (options.onProgress) options.onProgress(directory, completedInGroup);
|
|
532
535
|
}
|
|
@@ -633,12 +636,30 @@ function buildScopeMap(bundleRoot, targetDir, options, bundleHookRelPaths) {
|
|
|
633
636
|
function isHookFile(relPath) {
|
|
634
637
|
return relPath.startsWith(HOOKS_SUBPATH) && relPath.endsWith(".sh");
|
|
635
638
|
}
|
|
636
|
-
function
|
|
639
|
+
function decisionsForFile(relPath, scopeMap, targetDir, options) {
|
|
640
|
+
if (!isHookFile(relPath)) {
|
|
641
|
+
return [{ scope: "project", targetPath: join(targetDir, mapAdopterPath(relPath)) }];
|
|
642
|
+
}
|
|
643
|
+
const declared = scopeMap.get(relPath);
|
|
644
|
+
if (declared) {
|
|
645
|
+
return [declared];
|
|
646
|
+
}
|
|
647
|
+
const allowRoot = options.allowRoot ?? false;
|
|
648
|
+
const userDecision = classify$1(
|
|
649
|
+
{ command: `$HOME/${relPath}` },
|
|
650
|
+
{ targetDir, allowRoot }
|
|
651
|
+
);
|
|
652
|
+
const projectDecision = classify$1(
|
|
653
|
+
{ command: `$CLAUDE_PROJECT_DIR/${relPath}` },
|
|
654
|
+
{ targetDir, allowRoot }
|
|
655
|
+
);
|
|
656
|
+
return [userDecision, projectDecision];
|
|
657
|
+
}
|
|
658
|
+
function copyOne(relPath, bundleRoot, options, result, scopeDecision) {
|
|
637
659
|
const sourcePath = join(bundleRoot, relPath);
|
|
638
660
|
const adopterRelPath = mapAdopterPath(relPath);
|
|
639
|
-
const
|
|
640
|
-
const
|
|
641
|
-
const scope = scopeDecision ? scopeDecision.scope : "project";
|
|
661
|
+
const targetPath = scopeDecision.targetPath;
|
|
662
|
+
const scope = scopeDecision.scope;
|
|
642
663
|
let content;
|
|
643
664
|
try {
|
|
644
665
|
content = readFileSync(sourcePath, "utf8");
|
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version: "1.0.
|
|
1
|
+
export declare const version: "1.0.4";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thebassclef/lite",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Bassclef CLI — install and upgrade bassclef in your project with two commands.",
|
|
5
5
|
"keywords": ["bassclef", "claude-code", "cli", "scaffolding"],
|
|
6
6
|
"homepage": "https://github.com/sunj-labs/bassclef-cli",
|