mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-22 09:35:10 +02:00
fix: isolate Claude project hooks from ESM hosts (#3184)
* fix: isolate Claude project hooks from ESM hosts * fix: handle user-owned Claude scripts package
This commit is contained in:
@@ -9,6 +9,7 @@ const {
|
||||
} = require('./helpers');
|
||||
|
||||
const CLAUDE_ECC_NAMESPACE = 'ecc';
|
||||
const CLAUDE_PROJECT_COMMONJS_PACKAGE = 'manifests/install-assets/claude-project-scripts-package.json';
|
||||
|
||||
function getClaudeManagedDestinationPath(adapter, sourceRelativePath, input) {
|
||||
const normalizedSourcePath = normalizeRelativePath(sourceRelativePath);
|
||||
@@ -65,7 +66,7 @@ module.exports = createInstallTargetAdapter({
|
||||
|
||||
return modules.flatMap(module => {
|
||||
const paths = Array.isArray(module.paths) ? module.paths : [];
|
||||
return paths
|
||||
const operations = paths
|
||||
.filter(p => !isForeignPlatformPath(p, 'claude'))
|
||||
.flatMap(sourceRelativePath => {
|
||||
if (
|
||||
@@ -93,6 +94,21 @@ module.exports = createInstallTargetAdapter({
|
||||
|
||||
return [adapter.createScaffoldOperation(module.id, sourceRelativePath, planningInput)];
|
||||
});
|
||||
|
||||
if (module.id !== 'hooks-runtime') {
|
||||
return operations;
|
||||
}
|
||||
|
||||
return [
|
||||
...['hooks', 'lib'].map(directory => createRemappedOperation(
|
||||
adapter,
|
||||
module.id,
|
||||
CLAUDE_PROJECT_COMMONJS_PACKAGE,
|
||||
path.join(adapter.resolveRoot(planningInput), 'scripts', directory, 'package.json'),
|
||||
{ strategy: 'preserve-relative-path' }
|
||||
)),
|
||||
...operations,
|
||||
];
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user