claude-flow-novice 2.3.3 ā 2.3.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/scripts/postinstall.js +9 -90
- package/package.json +1 -1
- package/scripts/postinstall.js +9 -90
|
@@ -13,16 +13,10 @@ import { fileURLToPath } from 'url';
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
15
15
|
|
|
16
|
-
const stats = {
|
|
17
|
-
copied: [],
|
|
18
|
-
skipped: [],
|
|
19
|
-
updated: []
|
|
20
|
-
};
|
|
21
|
-
|
|
22
16
|
/**
|
|
23
|
-
*
|
|
17
|
+
* Simple recursive copy - overwrites existing files
|
|
24
18
|
*/
|
|
25
|
-
function
|
|
19
|
+
function simpleCopy(source, target) {
|
|
26
20
|
if (!existsSync(source)) return;
|
|
27
21
|
|
|
28
22
|
const stat = statSync(source);
|
|
@@ -36,34 +30,11 @@ function smartCopy(source, target, forceUpdate = false, verbose = false) {
|
|
|
36
30
|
// Copy contents
|
|
37
31
|
const entries = readdirSync(source);
|
|
38
32
|
for (const entry of entries) {
|
|
39
|
-
|
|
33
|
+
simpleCopy(join(source, entry), join(target, entry));
|
|
40
34
|
}
|
|
41
35
|
} else {
|
|
42
|
-
// File -
|
|
43
|
-
|
|
44
|
-
const relativePath = relative(process.cwd(), target);
|
|
45
|
-
|
|
46
|
-
if (!targetExists) {
|
|
47
|
-
// New file - always copy
|
|
48
|
-
copyFileSync(source, target);
|
|
49
|
-
stats.copied.push(relativePath);
|
|
50
|
-
if (verbose) {
|
|
51
|
-
console.log(` ā
${relativePath}`);
|
|
52
|
-
}
|
|
53
|
-
} else if (forceUpdate) {
|
|
54
|
-
// Existing file + force update - overwrite
|
|
55
|
-
copyFileSync(source, target);
|
|
56
|
-
stats.updated.push(relativePath);
|
|
57
|
-
if (verbose) {
|
|
58
|
-
console.log(` š ${relativePath}`);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
// Existing file - skip to preserve custom changes
|
|
62
|
-
stats.skipped.push(relativePath);
|
|
63
|
-
if (verbose) {
|
|
64
|
-
console.log(` āļø ${relativePath}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
36
|
+
// File - always overwrite
|
|
37
|
+
copyFileSync(source, target);
|
|
67
38
|
}
|
|
68
39
|
}
|
|
69
40
|
|
|
@@ -83,19 +54,9 @@ function copyClaudeDirectory() {
|
|
|
83
54
|
|
|
84
55
|
const sourceDir = possibleSources.find(dir => existsSync(dir));
|
|
85
56
|
const targetDir = join(projectRoot, '.claude');
|
|
86
|
-
const forceUpdate = process.env.CLAUDE_FORCE_UPDATE === 'true';
|
|
87
|
-
const verbose = process.env.CLAUDE_VERBOSE === 'true' || process.env.npm_config_loglevel === 'verbose';
|
|
88
57
|
|
|
89
58
|
console.log('š claude-flow-novice post-install: Setting up .claude directory...');
|
|
90
59
|
|
|
91
|
-
if (forceUpdate) {
|
|
92
|
-
console.log('ā ļø CLAUDE_FORCE_UPDATE=true - will overwrite existing files');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (verbose) {
|
|
96
|
-
console.log('š¢ Verbose mode enabled - showing all file operations\n');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
60
|
// Check if source directory was found
|
|
100
61
|
if (!sourceDir) {
|
|
101
62
|
console.error('ā Source .claude directory not found. Tried:');
|
|
@@ -104,55 +65,13 @@ function copyClaudeDirectory() {
|
|
|
104
65
|
process.exit(1);
|
|
105
66
|
}
|
|
106
67
|
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
if (isNewInstall) {
|
|
110
|
-
mkdirSync(targetDir, { recursive: true });
|
|
111
|
-
console.log('ā
Created .claude directory in project root');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Smart copy - preserve existing files
|
|
115
|
-
smartCopy(sourceDir, targetDir, forceUpdate, verbose);
|
|
68
|
+
// Simple copy - always overwrite
|
|
69
|
+
simpleCopy(sourceDir, targetDir);
|
|
116
70
|
|
|
117
|
-
console.log('ā
Successfully
|
|
71
|
+
console.log('ā
Successfully installed .claude directory');
|
|
118
72
|
console.log('š Location:', targetDir);
|
|
119
73
|
|
|
120
|
-
|
|
121
|
-
console.log('\nš Installation Summary:');
|
|
122
|
-
console.log(` ā
New files copied: ${stats.copied.length}`);
|
|
123
|
-
console.log(` āļø Existing files preserved: ${stats.skipped.length}`);
|
|
124
|
-
if (stats.updated.length > 0) {
|
|
125
|
-
console.log(` š Files updated (forced): ${stats.updated.length}`);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (stats.skipped.length > 0 && !isNewInstall) {
|
|
129
|
-
console.log('\nš” Tip: Your custom agents and configurations were preserved.');
|
|
130
|
-
console.log(' To force update all files: CLAUDE_FORCE_UPDATE=true npx claude-flow-novice@latest');
|
|
131
|
-
console.log(' To see all file operations: CLAUDE_VERBOSE=true npx claude-flow-novice@latest');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Verify key components
|
|
135
|
-
const agentsDir = join(targetDir, 'agents');
|
|
136
|
-
const commandsDir = join(targetDir, 'commands');
|
|
137
|
-
const coreDir = join(targetDir, 'core');
|
|
138
|
-
|
|
139
|
-
if (existsSync(agentsDir)) {
|
|
140
|
-
const agentFiles = readdirSync(agentsDir).length;
|
|
141
|
-
console.log(`\nš Total agents available: ${agentFiles}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (existsSync(commandsDir)) {
|
|
145
|
-
const commandFiles = readdirSync(commandsDir).length;
|
|
146
|
-
console.log(`ā” Total commands available: ${commandFiles}`);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (existsSync(coreDir)) {
|
|
150
|
-
const coreFiles = readdirSync(coreDir).length;
|
|
151
|
-
console.log(`š§ Total core files: ${coreFiles}`);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
console.log('\nš Installation complete! claude-flow-novice is ready to use.');
|
|
155
|
-
console.log('šÆ Run: npx claude-flow-novice --help');
|
|
74
|
+
console.log('š Installation complete! claude-flow-novice is ready to use.');
|
|
156
75
|
|
|
157
76
|
} catch (error) {
|
|
158
77
|
console.error('ā Post-install script failed:', error.message);
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -13,16 +13,10 @@ import { fileURLToPath } from 'url';
|
|
|
13
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
14
|
const __dirname = dirname(__filename);
|
|
15
15
|
|
|
16
|
-
const stats = {
|
|
17
|
-
copied: [],
|
|
18
|
-
skipped: [],
|
|
19
|
-
updated: []
|
|
20
|
-
};
|
|
21
|
-
|
|
22
16
|
/**
|
|
23
|
-
*
|
|
17
|
+
* Simple recursive copy - overwrites existing files
|
|
24
18
|
*/
|
|
25
|
-
function
|
|
19
|
+
function simpleCopy(source, target) {
|
|
26
20
|
if (!existsSync(source)) return;
|
|
27
21
|
|
|
28
22
|
const stat = statSync(source);
|
|
@@ -36,34 +30,11 @@ function smartCopy(source, target, forceUpdate = false, verbose = false) {
|
|
|
36
30
|
// Copy contents
|
|
37
31
|
const entries = readdirSync(source);
|
|
38
32
|
for (const entry of entries) {
|
|
39
|
-
|
|
33
|
+
simpleCopy(join(source, entry), join(target, entry));
|
|
40
34
|
}
|
|
41
35
|
} else {
|
|
42
|
-
// File -
|
|
43
|
-
|
|
44
|
-
const relativePath = relative(process.cwd(), target);
|
|
45
|
-
|
|
46
|
-
if (!targetExists) {
|
|
47
|
-
// New file - always copy
|
|
48
|
-
copyFileSync(source, target);
|
|
49
|
-
stats.copied.push(relativePath);
|
|
50
|
-
if (verbose) {
|
|
51
|
-
console.log(` ā
${relativePath}`);
|
|
52
|
-
}
|
|
53
|
-
} else if (forceUpdate) {
|
|
54
|
-
// Existing file + force update - overwrite
|
|
55
|
-
copyFileSync(source, target);
|
|
56
|
-
stats.updated.push(relativePath);
|
|
57
|
-
if (verbose) {
|
|
58
|
-
console.log(` š ${relativePath}`);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
// Existing file - skip to preserve custom changes
|
|
62
|
-
stats.skipped.push(relativePath);
|
|
63
|
-
if (verbose) {
|
|
64
|
-
console.log(` āļø ${relativePath}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
36
|
+
// File - always overwrite
|
|
37
|
+
copyFileSync(source, target);
|
|
67
38
|
}
|
|
68
39
|
}
|
|
69
40
|
|
|
@@ -83,19 +54,9 @@ function copyClaudeDirectory() {
|
|
|
83
54
|
|
|
84
55
|
const sourceDir = possibleSources.find(dir => existsSync(dir));
|
|
85
56
|
const targetDir = join(projectRoot, '.claude');
|
|
86
|
-
const forceUpdate = process.env.CLAUDE_FORCE_UPDATE === 'true';
|
|
87
|
-
const verbose = process.env.CLAUDE_VERBOSE === 'true' || process.env.npm_config_loglevel === 'verbose';
|
|
88
57
|
|
|
89
58
|
console.log('š claude-flow-novice post-install: Setting up .claude directory...');
|
|
90
59
|
|
|
91
|
-
if (forceUpdate) {
|
|
92
|
-
console.log('ā ļø CLAUDE_FORCE_UPDATE=true - will overwrite existing files');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (verbose) {
|
|
96
|
-
console.log('š¢ Verbose mode enabled - showing all file operations\n');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
60
|
// Check if source directory was found
|
|
100
61
|
if (!sourceDir) {
|
|
101
62
|
console.error('ā Source .claude directory not found. Tried:');
|
|
@@ -104,55 +65,13 @@ function copyClaudeDirectory() {
|
|
|
104
65
|
process.exit(1);
|
|
105
66
|
}
|
|
106
67
|
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
if (isNewInstall) {
|
|
110
|
-
mkdirSync(targetDir, { recursive: true });
|
|
111
|
-
console.log('ā
Created .claude directory in project root');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Smart copy - preserve existing files
|
|
115
|
-
smartCopy(sourceDir, targetDir, forceUpdate, verbose);
|
|
68
|
+
// Simple copy - always overwrite
|
|
69
|
+
simpleCopy(sourceDir, targetDir);
|
|
116
70
|
|
|
117
|
-
console.log('ā
Successfully
|
|
71
|
+
console.log('ā
Successfully installed .claude directory');
|
|
118
72
|
console.log('š Location:', targetDir);
|
|
119
73
|
|
|
120
|
-
|
|
121
|
-
console.log('\nš Installation Summary:');
|
|
122
|
-
console.log(` ā
New files copied: ${stats.copied.length}`);
|
|
123
|
-
console.log(` āļø Existing files preserved: ${stats.skipped.length}`);
|
|
124
|
-
if (stats.updated.length > 0) {
|
|
125
|
-
console.log(` š Files updated (forced): ${stats.updated.length}`);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (stats.skipped.length > 0 && !isNewInstall) {
|
|
129
|
-
console.log('\nš” Tip: Your custom agents and configurations were preserved.');
|
|
130
|
-
console.log(' To force update all files: CLAUDE_FORCE_UPDATE=true npx claude-flow-novice@latest');
|
|
131
|
-
console.log(' To see all file operations: CLAUDE_VERBOSE=true npx claude-flow-novice@latest');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Verify key components
|
|
135
|
-
const agentsDir = join(targetDir, 'agents');
|
|
136
|
-
const commandsDir = join(targetDir, 'commands');
|
|
137
|
-
const coreDir = join(targetDir, 'core');
|
|
138
|
-
|
|
139
|
-
if (existsSync(agentsDir)) {
|
|
140
|
-
const agentFiles = readdirSync(agentsDir).length;
|
|
141
|
-
console.log(`\nš Total agents available: ${agentFiles}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (existsSync(commandsDir)) {
|
|
145
|
-
const commandFiles = readdirSync(commandsDir).length;
|
|
146
|
-
console.log(`ā” Total commands available: ${commandFiles}`);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (existsSync(coreDir)) {
|
|
150
|
-
const coreFiles = readdirSync(coreDir).length;
|
|
151
|
-
console.log(`š§ Total core files: ${coreFiles}`);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
console.log('\nš Installation complete! claude-flow-novice is ready to use.');
|
|
155
|
-
console.log('šÆ Run: npx claude-flow-novice --help');
|
|
74
|
+
console.log('š Installation complete! claude-flow-novice is ready to use.');
|
|
156
75
|
|
|
157
76
|
} catch (error) {
|
|
158
77
|
console.error('ā Post-install script failed:', error.message);
|