@ngxtm/devkit 3.6.0 → 3.6.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/cli/index.js +6 -4
- package/cli/update.js +8 -17
- package/package.json +1 -1
package/cli/index.js
CHANGED
|
@@ -63,6 +63,8 @@ function parseArgs(args) {
|
|
|
63
63
|
options.update = true;
|
|
64
64
|
} else if (arg === '--clean' || arg === '-c') {
|
|
65
65
|
options.clean = true;
|
|
66
|
+
} else if (arg === '--no-clean') {
|
|
67
|
+
options.clean = false;
|
|
66
68
|
} else if (arg === '--installed' || arg === '-i') {
|
|
67
69
|
options.installed = true;
|
|
68
70
|
} else if (arg === '--all' || arg === '-a') {
|
|
@@ -105,7 +107,7 @@ COMMANDS:
|
|
|
105
107
|
Auto-detects tech stack and installs relevant rules.
|
|
106
108
|
|
|
107
109
|
update Update existing installation
|
|
108
|
-
Re-detects project
|
|
110
|
+
Re-detects project, updates commands, and cleans old rules.
|
|
109
111
|
|
|
110
112
|
detect Show detected technologies for current project
|
|
111
113
|
Useful to see what devkit will install.
|
|
@@ -134,7 +136,7 @@ OPTIONS:
|
|
|
134
136
|
--all, -a Install for all supported tools (skip menu)
|
|
135
137
|
--tools=LIST Install for specific tools (comma-separated)
|
|
136
138
|
Example: --tools=claude,cursor
|
|
137
|
-
--clean
|
|
139
|
+
--no-clean Skip removing rules for technologies no longer detected
|
|
138
140
|
--installed, -i Show only installed rules (with rules command)
|
|
139
141
|
--path=DIR Specify project directory (default: current directory)
|
|
140
142
|
--help, -h Show this help
|
|
@@ -150,8 +152,8 @@ EXAMPLES:
|
|
|
150
152
|
devkit init --all # Install for all tools
|
|
151
153
|
devkit init --tools=claude,cursor # Install for specific tools
|
|
152
154
|
devkit init --force # Overwrite existing installation
|
|
153
|
-
devkit update #
|
|
154
|
-
devkit update --clean
|
|
155
|
+
devkit update # Full update (commands + clean old rules)
|
|
156
|
+
devkit update --no-clean # Update without removing old rules
|
|
155
157
|
devkit detect # Show what would be detected
|
|
156
158
|
devkit rules # List all available rules
|
|
157
159
|
devkit rules --installed # Show installed rules
|
package/cli/update.js
CHANGED
|
@@ -99,8 +99,8 @@ function updateProject(options = {}) {
|
|
|
99
99
|
console.log(' No changes in detected technologies.');
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// Update rules if needed
|
|
103
|
-
if (added.length > 0 || options.force) {
|
|
102
|
+
// Update rules if needed (always update by default)
|
|
103
|
+
if (added.length > 0 || options.force !== false) {
|
|
104
104
|
const newRules = getRulesForTypes(added);
|
|
105
105
|
const rulesDir = path.join(claudeDir, 'rules');
|
|
106
106
|
|
|
@@ -116,8 +116,8 @@ function updateProject(options = {}) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
// Remove old rules
|
|
120
|
-
if (removed.length > 0 && options.clean) {
|
|
119
|
+
// Remove old rules (enabled by default, use --no-clean to skip)
|
|
120
|
+
if (removed.length > 0 && options.clean !== false) {
|
|
121
121
|
const rulesDir = path.join(claudeDir, 'rules');
|
|
122
122
|
|
|
123
123
|
console.log('\n Removing old rules...');
|
|
@@ -131,26 +131,17 @@ function updateProject(options = {}) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
// Update commands
|
|
135
|
-
if (options.force) {
|
|
134
|
+
// Update commands (enabled by default)
|
|
135
|
+
if (options.force !== false) {
|
|
136
136
|
console.log('\n Updating commands...');
|
|
137
137
|
const mergedCommandsDir = path.join(PACKAGE_ROOT, 'merged-commands');
|
|
138
138
|
const commandsDir = path.join(claudeDir, 'commands');
|
|
139
139
|
|
|
140
140
|
if (fs.existsSync(mergedCommandsDir)) {
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
if (fs.existsSync(commandsDir)) {
|
|
144
|
-
fs.renameSync(commandsDir, backupDir);
|
|
145
|
-
}
|
|
146
|
-
|
|
141
|
+
// Copy directly - copyDir will overwrite existing files
|
|
142
|
+
// No need for backup/rename which fails on Windows when files are open
|
|
147
143
|
const count = copyDir(mergedCommandsDir, commandsDir);
|
|
148
144
|
console.log(` Commands: ${count} files`);
|
|
149
|
-
|
|
150
|
-
// Remove backup
|
|
151
|
-
if (fs.existsSync(backupDir)) {
|
|
152
|
-
fs.rmSync(backupDir, { recursive: true, force: true });
|
|
153
|
-
}
|
|
154
145
|
}
|
|
155
146
|
}
|
|
156
147
|
|