@nemo-cli/package 0.0.1-beta.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/README.md +20 -0
- package/bin/index.mjs +5 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +322 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# `@nemo-cli/package`
|
|
2
|
+
|
|
3
|
+
> @nemo-cli/package Make pnpm Workspace Operation Easier
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
```
|
|
7
|
+
$ pnpm add @nemo-cli/package --global
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
np add [...packages]
|
|
14
|
+
np add -D -E
|
|
15
|
+
np add [...packages] -S -E
|
|
16
|
+
|
|
17
|
+
np remove
|
|
18
|
+
|
|
19
|
+
np upgrade
|
|
20
|
+
```
|
package/bin/index.mjs
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as commander0 from "commander";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const pkg: {
|
|
5
|
+
name: string;
|
|
6
|
+
version: `${number}.${number}.${number}`;
|
|
7
|
+
keywords: string[];
|
|
8
|
+
license: string;
|
|
9
|
+
author: string;
|
|
10
|
+
description: string;
|
|
11
|
+
workspaces: string[] | Record<string, string[]>;
|
|
12
|
+
};
|
|
13
|
+
declare const init: () => commander0.Command;
|
|
14
|
+
declare const run: () => void;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { init, pkg, run };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;cASa,GAAA;EAAA,IAAA;EAAA,OAAA;EAAA,QAAA;EAAA,OAAA;EAAA,MAAA;EAAA,WAAA;EAAA,UAAA,aAAoC,MAAA;AAAA;AAAA,cAEpC,IAAA,QAaZ,UAAA,CAbgB,OAAA;AAAA,cAeJ,GAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { colors, createCheckbox, createCommand, createHelpExample, createInput, createNote, createSelect, createSpinner, emptyDirs, getPackageDependencies, getWorkspaceDirs, getWorkspaceNames, handleError, isString, log, readPackage, x } from "@nemo-cli/shared";
|
|
2
|
+
import { ErrorMessage, Message, ProcessMessage } from "@nemo-cli/ui";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
//#region src/constants.ts
|
|
6
|
+
const HELP_MESSAGE = {
|
|
7
|
+
install: createHelpExample("np add commander @inquirer/prompts", "np add typescript unbuild vitest --dev --exact"),
|
|
8
|
+
main: createHelpExample("np --version", "np --help", "np <command> [options]"),
|
|
9
|
+
clean: createHelpExample("np clean [dirname]"),
|
|
10
|
+
up: createHelpExample("np up"),
|
|
11
|
+
remove: createHelpExample("np remove"),
|
|
12
|
+
list: createHelpExample("np list"),
|
|
13
|
+
add: createHelpExample("np add", "np add -p my-package dep1 dep2")
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/commands/add.ts
|
|
18
|
+
const ROOT_VALUE = "root";
|
|
19
|
+
const addHandle = async (dependencies, options) => {
|
|
20
|
+
const { saveProd = true, exact = false, peer = false, workspaces } = options;
|
|
21
|
+
const flags = [
|
|
22
|
+
saveProd ? "--save-prod" : "--save-dev",
|
|
23
|
+
exact ? "--save-exact" : "",
|
|
24
|
+
peer ? "--save-peer" : ""
|
|
25
|
+
].filter(Boolean);
|
|
26
|
+
const filter = workspaces.find((item) => item === ROOT_VALUE) ? "-w" : workspaces.map((name) => `--filter=${name}`);
|
|
27
|
+
await ProcessMessage({
|
|
28
|
+
command: "pnpm",
|
|
29
|
+
commandArgs: [
|
|
30
|
+
...flags,
|
|
31
|
+
"add",
|
|
32
|
+
...filter,
|
|
33
|
+
...dependencies
|
|
34
|
+
],
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
Message({
|
|
37
|
+
text: "Dependencies added successfully",
|
|
38
|
+
name: "summer"
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
onError: (_error) => {
|
|
42
|
+
Message({
|
|
43
|
+
text: "Dependencies added failed",
|
|
44
|
+
name: "passion"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}).waitUntilExit();
|
|
48
|
+
};
|
|
49
|
+
const ensurePackage = async (input) => {
|
|
50
|
+
const packageNames = (isString(input) ? [input] : input)?.map((input$1) => input$1.trim()) || [];
|
|
51
|
+
if (packageNames.length === 0) return (await createInput({
|
|
52
|
+
message: "Enter dependency names (space or comma separated):",
|
|
53
|
+
validate: (name) => !name ? "Please enter the package name you want to install" : void 0
|
|
54
|
+
})).split(/[\s,,]+/).filter(Boolean);
|
|
55
|
+
return packageNames;
|
|
56
|
+
};
|
|
57
|
+
const addCommand = (program) => {
|
|
58
|
+
program.command("add [dependencies...]").alias("install").alias("i").description("Add dependencies to a specific workspace package.").option("-D, --save-dev", "Is Development dependencies").option("-S, --save-prod", "Is Productive dependencies").option("-E, --exact", "Is exact dependencies").addHelpText("after", HELP_MESSAGE.install).action(async (dependencies, options) => {
|
|
59
|
+
const workspaceNames = await getWorkspaceNames();
|
|
60
|
+
if (!workspaceNames?.length) {
|
|
61
|
+
ErrorMessage({
|
|
62
|
+
text: "No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.",
|
|
63
|
+
name: "summer"
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const workspaces = await createCheckbox({
|
|
68
|
+
message: "Select a workspace to add dependencies to:",
|
|
69
|
+
options: [{
|
|
70
|
+
label: "Root",
|
|
71
|
+
value: ROOT_VALUE
|
|
72
|
+
}].concat(workspaceNames.map((pkg$1) => ({
|
|
73
|
+
label: `${pkg$1.name} (${pkg$1.path})`,
|
|
74
|
+
value: pkg$1.name
|
|
75
|
+
}))),
|
|
76
|
+
required: true
|
|
77
|
+
});
|
|
78
|
+
await addHandle(await ensurePackage(dependencies), {
|
|
79
|
+
workspaces,
|
|
80
|
+
...options
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
return program;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/commands/clean.ts
|
|
88
|
+
const cleanHandle = (directory) => {
|
|
89
|
+
try {
|
|
90
|
+
emptyDirs(directory);
|
|
91
|
+
log.success("pnpm clean success!", directory.join(", "));
|
|
92
|
+
} catch (error) {
|
|
93
|
+
log.error("pnpm clean", error.message ?? "clean error!");
|
|
94
|
+
process.exit(0);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const cleanCommand = (command) => {
|
|
98
|
+
command.command("clean").description("Clear workspace build directory").argument("[dirname]", "Build directory name").addHelpText("after", HELP_MESSAGE.clean).action(async (dirname) => {
|
|
99
|
+
const workspaceDir = await getWorkspaceDirs();
|
|
100
|
+
const _dirname = dirname || await createInput({ message: "Enter folder name in all workspace cleanup" });
|
|
101
|
+
cleanHandle(workspaceDir.packages.map((cwd) => `${cwd}/${_dirname}`));
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/commands/list.ts
|
|
107
|
+
function displayDependencies(packageName, dependencies) {
|
|
108
|
+
log.info(`Dependencies for ${packageName}:`);
|
|
109
|
+
const prodDeps = dependencies.filter((dep) => dep.type === "dependencies");
|
|
110
|
+
const devDeps = dependencies.filter((dep) => dep.type === "devDependencies");
|
|
111
|
+
if (prodDeps.length > 0) createNote({
|
|
112
|
+
message: prodDeps.map((d) => `- ${colors.green(d.name)} ${d.version}`).join("\n"),
|
|
113
|
+
title: "Production"
|
|
114
|
+
});
|
|
115
|
+
else log.show(" Production: (No production dependencies)", { type: "warn" });
|
|
116
|
+
if (devDeps.length > 0) createNote({
|
|
117
|
+
message: devDeps.map((d) => `- ${colors.green(d.name)} ${d.version}`).join("\n"),
|
|
118
|
+
title: "Development"
|
|
119
|
+
});
|
|
120
|
+
else log.show(" Development: (No development dependencies)", { type: "warn" });
|
|
121
|
+
}
|
|
122
|
+
function listCommand(command) {
|
|
123
|
+
command.command("list").alias("ls").description("List dependencies of a specific workspace package.").action(async () => {
|
|
124
|
+
log.info("Fetching workspace packages...");
|
|
125
|
+
const workspaceNames = await getWorkspaceNames();
|
|
126
|
+
if (!workspaceNames || workspaceNames.length === 0) {
|
|
127
|
+
log.error("No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const selectedPackageInfo = await createSelect({
|
|
131
|
+
message: "Select the target package to list its dependencies:",
|
|
132
|
+
options: workspaceNames.map((pkg$1) => ({
|
|
133
|
+
label: `${pkg$1.name} (path: ${pkg$1.path})`,
|
|
134
|
+
value: {
|
|
135
|
+
name: pkg$1.name,
|
|
136
|
+
path: pkg$1.path
|
|
137
|
+
}
|
|
138
|
+
}))
|
|
139
|
+
});
|
|
140
|
+
if (!selectedPackageInfo) {
|
|
141
|
+
log.info("No package selected. Aborting list operation.");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const workspaceRoot = process.cwd();
|
|
145
|
+
const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path);
|
|
146
|
+
log.show(`Fetching dependencies for package ${selectedPackageInfo.name}...`);
|
|
147
|
+
const dependencies = await getPackageDependencies(selectedPackageDir);
|
|
148
|
+
if (!dependencies || dependencies.length === 0) {
|
|
149
|
+
log.info(`No dependencies found in package ${selectedPackageInfo.name}.`);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
displayDependencies(selectedPackageInfo.name, dependencies);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/commands/remove.ts
|
|
158
|
+
async function removeHandle(packageName, dependencies) {
|
|
159
|
+
if (!packageName || dependencies.length === 0) {
|
|
160
|
+
log.error("Package name and at least one dependency to remove are required.");
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const depsString = dependencies.join(" ");
|
|
164
|
+
log.info(`Attempting to remove dependencies [${depsString}] from package [${packageName}]...`);
|
|
165
|
+
try {
|
|
166
|
+
const commandParts = [
|
|
167
|
+
"remove",
|
|
168
|
+
...dependencies,
|
|
169
|
+
"--filter",
|
|
170
|
+
packageName
|
|
171
|
+
];
|
|
172
|
+
log.info(`Executing command: pnpm remove ${depsString} --filter ${packageName}`);
|
|
173
|
+
const { stdout, stderr, exitCode } = await x("pnpm", commandParts);
|
|
174
|
+
if (stdout) log.info(`Command output (stdout):\n${stdout}`);
|
|
175
|
+
if (stderr) log.warn(`Command output (stderr):\n${stderr}`);
|
|
176
|
+
if (exitCode) log.error(`Failed to remove dependencies. Command exited with code ${exitCode}.`);
|
|
177
|
+
else log.success(`Successfully removed dependencies [${depsString}] from package [${packageName}].`);
|
|
178
|
+
} catch (error) {
|
|
179
|
+
handleError(error, "An error occurred while removing dependencies: ");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function removeCommand(command) {
|
|
183
|
+
command.command("remove").alias("rm").description("Remove dependencies from a specific workspace package.").action(async () => {
|
|
184
|
+
log.info("Fetching workspace packages...");
|
|
185
|
+
const workspaceNames = await getWorkspaceNames();
|
|
186
|
+
if (!workspaceNames || workspaceNames.length === 0) {
|
|
187
|
+
log.error("No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.");
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const selectedPackageInfo = await createSelect({
|
|
191
|
+
message: "Select the target package to remove dependencies from:",
|
|
192
|
+
options: workspaceNames.map((pkg$1) => ({
|
|
193
|
+
value: {
|
|
194
|
+
name: pkg$1.name,
|
|
195
|
+
path: pkg$1.path
|
|
196
|
+
},
|
|
197
|
+
label: `${pkg$1.name} (path: ${pkg$1.path})`
|
|
198
|
+
}))
|
|
199
|
+
});
|
|
200
|
+
if (!selectedPackageInfo?.name) {
|
|
201
|
+
log.info("No package selected. Aborting remove operation.");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const workspaceRoot = process.cwd();
|
|
205
|
+
const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path);
|
|
206
|
+
log.info(`Fetching dependencies for package ${selectedPackageInfo.name}...`);
|
|
207
|
+
const dependencies = await getPackageDependencies(selectedPackageDir);
|
|
208
|
+
if (!dependencies || dependencies.length === 0) {
|
|
209
|
+
log.info(`No dependencies found in package ${selectedPackageInfo.name}. Nothing to remove.`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const dependencyChoices = dependencies.map((dep) => ({
|
|
213
|
+
value: dep.name,
|
|
214
|
+
label: `${dep.name} (current: ${dep.version}, type: ${dep.type})`
|
|
215
|
+
}));
|
|
216
|
+
const selectedDependencies = await createCheckbox({
|
|
217
|
+
message: `Select dependencies to remove from ${selectedPackageInfo.name} (space to select, enter to confirm):`,
|
|
218
|
+
options: dependencyChoices
|
|
219
|
+
});
|
|
220
|
+
if (!selectedDependencies || selectedDependencies.length === 0) {
|
|
221
|
+
log.info("No dependencies selected for removal. Aborting.");
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const spinner = createSpinner("Removing dependencies...");
|
|
225
|
+
await removeHandle(selectedPackageInfo.name, selectedDependencies);
|
|
226
|
+
spinner.stop("Removed dependencies");
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/commands/upgrade.ts
|
|
232
|
+
async function upgradeHandle(packageName, dependencies) {
|
|
233
|
+
if (!packageName || dependencies.length === 0) {
|
|
234
|
+
log.error("Package name and at least one dependency to upgrade are required.");
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
log.info(`Attempting to upgrade dependencies [${dependencies.join(", ")}] in package [${packageName}] to their latest versions...`);
|
|
238
|
+
for (const dep of dependencies) {
|
|
239
|
+
const depWithVersion = `${dep}@latest`;
|
|
240
|
+
log.info(`Upgrading ${dep} in ${packageName} to @latest... (pnpm add ${depWithVersion} --filter ${packageName})`);
|
|
241
|
+
try {
|
|
242
|
+
const { stdout, stderr, exitCode } = await x("pnpm", [
|
|
243
|
+
"add",
|
|
244
|
+
depWithVersion,
|
|
245
|
+
"--filter",
|
|
246
|
+
packageName
|
|
247
|
+
]);
|
|
248
|
+
if (stdout) log.info(`Output for ${depWithVersion} (stdout):\n${stdout}`);
|
|
249
|
+
if (stderr) log.warn(`Output for ${depWithVersion} (stderr):\n${stderr}`);
|
|
250
|
+
if (exitCode) log.error(`Failed to upgrade ${dep} in ${packageName}. Command exited with code ${exitCode}.`);
|
|
251
|
+
else log.success(`Successfully upgraded ${dep} in ${packageName}.`);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
handleError(error, `An error occurred while upgrading ${dep} in ${packageName}: `);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
log.info(`Finished upgrade process for package [${packageName}].`);
|
|
257
|
+
}
|
|
258
|
+
function upgradeCommand(command) {
|
|
259
|
+
command.command("upgrade").alias("up").description("Upgrade dependencies in a specific workspace package.").action(async () => {
|
|
260
|
+
log.info("Fetching workspace packages...");
|
|
261
|
+
const workspaceNames = await getWorkspaceNames();
|
|
262
|
+
if (!workspaceNames || workspaceNames.length === 0) {
|
|
263
|
+
log.error("No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.");
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const selectedPackageInfo = await createSelect({
|
|
267
|
+
message: "Select the target package to upgrade dependencies for:",
|
|
268
|
+
options: workspaceNames.map((pkg$1) => ({
|
|
269
|
+
label: `${pkg$1.name} (path: ${pkg$1.path})`,
|
|
270
|
+
value: {
|
|
271
|
+
name: pkg$1.name,
|
|
272
|
+
path: pkg$1.path
|
|
273
|
+
}
|
|
274
|
+
}))
|
|
275
|
+
});
|
|
276
|
+
if (!selectedPackageInfo?.name) {
|
|
277
|
+
log.info("No package selected. Aborting upgrade.");
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const workspaceRoot = process.cwd();
|
|
281
|
+
const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path);
|
|
282
|
+
log.info(`Fetching dependencies for package ${selectedPackageInfo.name}...`);
|
|
283
|
+
const dependencies = await getPackageDependencies(selectedPackageDir);
|
|
284
|
+
if (!dependencies || dependencies.length === 0) {
|
|
285
|
+
log.info(`No dependencies found in package ${selectedPackageInfo.name}. Nothing to upgrade.`);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const dependencyChoices = dependencies.map((dep) => ({
|
|
289
|
+
label: `${dep.name} (current: ${dep.version}, type: ${dep.type})`,
|
|
290
|
+
value: dep.name
|
|
291
|
+
}));
|
|
292
|
+
const selectedDependencies = await createCheckbox({
|
|
293
|
+
message: `Select dependencies to upgrade in ${selectedPackageInfo.name} (space to select, enter to confirm):`,
|
|
294
|
+
options: dependencyChoices
|
|
295
|
+
});
|
|
296
|
+
if (!selectedDependencies || selectedDependencies.length === 0) {
|
|
297
|
+
log.info("No dependencies selected for upgrade. Aborting.");
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
await upgradeHandle(selectedPackageInfo.name, selectedDependencies);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/index.ts
|
|
306
|
+
const pkg = readPackage(import.meta, "..");
|
|
307
|
+
const init = () => {
|
|
308
|
+
const command = createCommand("np").version(pkg.version).description(`${pkg.name} CLI helper for pnpm workspaces`).addHelpText("after", HELP_MESSAGE.main);
|
|
309
|
+
addCommand(command);
|
|
310
|
+
upgradeCommand(command);
|
|
311
|
+
removeCommand(command);
|
|
312
|
+
listCommand(command);
|
|
313
|
+
cleanCommand(command);
|
|
314
|
+
return command;
|
|
315
|
+
};
|
|
316
|
+
const run = () => {
|
|
317
|
+
init().parse(process.argv);
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
//#endregion
|
|
321
|
+
export { init, pkg, run };
|
|
322
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["input","pkg","pkg","pkg","pkg"],"sources":["../src/constants.ts","../src/commands/add.ts","../src/commands/clean.ts","../src/commands/list.ts","../src/commands/remove.ts","../src/commands/upgrade.ts","../src/index.ts"],"sourcesContent":["import { createHelpExample } from '@nemo-cli/shared'\n\nexport const HELP_MESSAGE = {\n install: createHelpExample('np add commander @inquirer/prompts', 'np add typescript unbuild vitest --dev --exact'),\n main: createHelpExample('np --version', 'np --help', 'np <command> [options]'),\n clean: createHelpExample('np clean [dirname]'),\n up: createHelpExample('np up'), // Example for the refactored interactive upgrade command\n remove: createHelpExample('np remove'), // Example for the interactive remove command\n list: createHelpExample('np list'), // Example for the interactive list command\n add: createHelpExample('np add', 'np add -p my-package dep1 dep2'),\n}\n\nexport const ERROR_MESSAGE = {\n notRootWorkspace: \"It's not workspace root directory, Please open this command in the workspace root directory\",\n}\n","import { type Command, createCheckbox, createInput, getWorkspaceNames, isString } from '@nemo-cli/shared'\nimport { ErrorMessage, Message, ProcessMessage } from '@nemo-cli/ui'\nimport { HELP_MESSAGE } from '../constants'\n\ntype AddHandleOptions = {\n workspaces: string[]\n saveProd?: boolean\n exact?: boolean\n peer?: boolean\n}\n\nconst ROOT_VALUE = 'root'\nconst addHandle = async (dependencies: string[], options: AddHandleOptions) => {\n const { saveProd = true, exact = false, peer = false, workspaces } = options\n\n const flags = [\n saveProd ? '--save-prod' : '--save-dev',\n exact ? '--save-exact' : '',\n peer ? '--save-peer' : '',\n ].filter(Boolean)\n const isRootWorkspace = workspaces.find((item) => item === ROOT_VALUE)\n\n const filter = isRootWorkspace ? '-w' : workspaces.map((name) => `--filter=${name}`)\n\n const commandParts = [...flags, 'add', ...filter, ...dependencies]\n\n const instance = ProcessMessage({\n command: 'pnpm',\n commandArgs: commandParts,\n onSuccess: () => {\n Message({\n text: 'Dependencies added successfully',\n name: 'summer',\n })\n },\n onError: (_error) => {\n Message({\n text: 'Dependencies added failed',\n name: 'passion',\n })\n // spinner.stop(`An error occurred while adding dependencies: ${error}`)\n },\n })\n await instance.waitUntilExit()\n}\n\nconst ensurePackage = async (input: string | string[]): Promise<string[]> => {\n const inputList = isString(input) ? [input] : input\n const packageNames = inputList?.map((input) => input.trim()) || []\n\n if (packageNames.length === 0) {\n const packageName = await createInput({\n message: 'Enter dependency names (space or comma separated):',\n validate: (name) => (!name ? 'Please enter the package name you want to install' : undefined),\n })\n return packageName.split(/[\\s,,]+/).filter(Boolean)\n }\n return packageNames\n}\n\nexport const addCommand = (program: Command) => {\n program\n .command('add [dependencies...]')\n .alias('install')\n .alias('i')\n .description('Add dependencies to a specific workspace package.')\n .option('-D, --save-dev', 'Is Development dependencies')\n .option('-S, --save-prod', 'Is Productive dependencies')\n .option('-E, --exact', 'Is exact dependencies')\n .addHelpText('after', HELP_MESSAGE.install)\n .action(async (dependencies: string[], options: { saveDev?: boolean; saveProd?: boolean; exact?: boolean }) => {\n const workspaceNames = await getWorkspaceNames()\n if (!workspaceNames?.length) {\n ErrorMessage({\n text: 'No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.',\n name: 'summer',\n })\n return\n }\n\n const workspaceOptions = [{ label: 'Root', value: ROOT_VALUE }].concat(\n workspaceNames.map((pkg) => ({\n label: `${pkg.name} (${pkg.path})`,\n value: pkg.name,\n }))\n )\n\n const workspaces = await createCheckbox({\n message: 'Select a workspace to add dependencies to:',\n options: workspaceOptions,\n required: true,\n })\n\n const finalDependencies = await ensurePackage(dependencies)\n\n await addHandle(finalDependencies, { workspaces, ...options })\n })\n\n return program\n}\n\nexport default addCommand\n","import { type Command, createInput, emptyDirs, getWorkspaceDirs, log } from '@nemo-cli/shared'\n\nimport { HELP_MESSAGE } from '../constants'\n\nconst cleanHandle = (directory: string[]) => {\n try {\n emptyDirs(directory)\n log.success('pnpm clean success!', directory.join(', '))\n } catch (error) {\n log.error('pnpm clean', (error as Error).message ?? 'clean error!')\n process.exit(0)\n }\n}\nexport const cleanCommand = (command: Command) => {\n command\n .command('clean')\n .description('Clear workspace build directory')\n .argument('[dirname]', 'Build directory name')\n .addHelpText('after', HELP_MESSAGE.clean)\n .action(async (dirname) => {\n const workspaceDir = await getWorkspaceDirs()\n const _dirname = dirname || (await createInput({ message: 'Enter folder name in all workspace cleanup' }))\n const target = workspaceDir.packages.map((cwd) => `${cwd}/${_dirname}`)\n cleanHandle(target)\n })\n}\n","import path from 'node:path'\nimport type { Command } from '@nemo-cli/shared'\nimport { colors, createNote, createSelect, getPackageDependencies, getWorkspaceNames, log } from '@nemo-cli/shared'\n\nfunction displayDependencies(\n packageName: string,\n dependencies: Array<{\n name: string\n version: string\n type: 'dependencies' | 'devDependencies'\n }>\n) {\n log.info(`Dependencies for ${packageName}:`)\n\n const prodDeps = dependencies.filter((dep) => dep.type === 'dependencies')\n const devDeps = dependencies.filter((dep) => dep.type === 'devDependencies')\n\n if (prodDeps.length > 0) {\n createNote({\n message: prodDeps.map((d) => `- ${colors.green(d.name)} ${d.version}`).join('\\n'),\n title: 'Production',\n })\n } else {\n log.show(' Production: (No production dependencies)', { type: 'warn' })\n }\n\n if (devDeps.length > 0) {\n createNote({\n message: devDeps.map((d) => `- ${colors.green(d.name)} ${d.version}`).join('\\n'),\n title: 'Development',\n })\n } else {\n log.show(' Development: (No development dependencies)', { type: 'warn' })\n }\n}\n\nexport function listCommand(command: Command) {\n command\n .command('list')\n .alias('ls')\n .description('List dependencies of a specific workspace package.')\n .action(async () => {\n log.info('Fetching workspace packages...')\n const workspaceNames = await getWorkspaceNames()\n if (!workspaceNames || workspaceNames.length === 0) {\n log.error('No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.')\n return\n }\n\n const packageChoices = workspaceNames.map((pkg) => ({\n label: `${pkg.name} (path: ${pkg.path})`,\n value: { name: pkg.name, path: pkg.path },\n }))\n\n const selectedPackageInfo = await createSelect({\n message: 'Select the target package to list its dependencies:',\n options: packageChoices,\n })\n if (!selectedPackageInfo) {\n log.info('No package selected. Aborting list operation.')\n return\n }\n\n const workspaceRoot = process.cwd() // Assuming CLI runs from workspace root\n const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path)\n\n log.show(`Fetching dependencies for package ${selectedPackageInfo.name}...`)\n\n const dependencies = await getPackageDependencies(selectedPackageDir)\n\n if (!dependencies || dependencies.length === 0) {\n log.info(`No dependencies found in package ${selectedPackageInfo.name}.`)\n return\n }\n\n displayDependencies(selectedPackageInfo.name, dependencies)\n })\n}\n","import path from 'node:path'\nimport type { Command } from '@nemo-cli/shared'\nimport {\n createCheckbox,\n createSelect,\n createSpinner,\n getPackageDependencies,\n getWorkspaceNames,\n handleError,\n log,\n x,\n} from '@nemo-cli/shared'\n\nasync function removeHandle(packageName: string, dependencies: string[]) {\n if (!packageName || dependencies.length === 0) {\n log.error('Package name and at least one dependency to remove are required.')\n return\n }\n\n const depsString = dependencies.join(' ')\n log.info(`Attempting to remove dependencies [${depsString}] from package [${packageName}]...`)\n\n try {\n const commandParts = ['remove', ...dependencies, '--filter', packageName]\n log.info(`Executing command: pnpm remove ${depsString} --filter ${packageName}`)\n\n const { stdout, stderr, exitCode } = await x('pnpm', commandParts)\n\n if (stdout) {\n log.info(`Command output (stdout):\\n${stdout}`)\n }\n // pnpm often uses stderr for progress or warnings, not just errors for `remove`\n if (stderr) {\n log.warn(`Command output (stderr):\\n${stderr}`)\n }\n\n if (exitCode) {\n log.error(`Failed to remove dependencies. Command exited with code ${exitCode}.`)\n } else {\n log.success(`Successfully removed dependencies [${depsString}] from package [${packageName}].`)\n }\n } catch (error: unknown) {\n handleError(error, 'An error occurred while removing dependencies: ')\n }\n}\n\nexport function removeCommand(command: Command) {\n command\n .command('remove')\n .alias('rm')\n .description('Remove dependencies from a specific workspace package.')\n .action(async () => {\n log.info('Fetching workspace packages...')\n const workspaceNames = await getWorkspaceNames()\n if (!workspaceNames || workspaceNames.length === 0) {\n log.error('No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.')\n return\n }\n\n const packageChoices = workspaceNames.map((pkg) => ({\n value: { name: pkg.name, path: pkg.path },\n label: `${pkg.name} (path: ${pkg.path})`,\n }))\n\n const selectedPackageInfo = await createSelect({\n message: 'Select the target package to remove dependencies from:',\n options: packageChoices,\n })\n if (!selectedPackageInfo?.name) {\n log.info('No package selected. Aborting remove operation.')\n return\n }\n\n const workspaceRoot = process.cwd() // Assuming CLI runs from workspace root\n const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path)\n\n log.info(`Fetching dependencies for package ${selectedPackageInfo.name}...`)\n const dependencies = await getPackageDependencies(selectedPackageDir)\n\n if (!dependencies || dependencies.length === 0) {\n log.info(`No dependencies found in package ${selectedPackageInfo.name}. Nothing to remove.`)\n return\n }\n\n const dependencyChoices = dependencies.map((dep) => ({\n value: dep.name,\n label: `${dep.name} (current: ${dep.version}, type: ${dep.type})`,\n }))\n\n const selectedDependencies = await createCheckbox({\n message: `Select dependencies to remove from ${selectedPackageInfo.name} (space to select, enter to confirm):`,\n options: dependencyChoices,\n })\n\n if (!selectedDependencies || selectedDependencies.length === 0) {\n log.info('No dependencies selected for removal. Aborting.')\n return\n }\n const spinner = createSpinner('Removing dependencies...')\n await removeHandle(selectedPackageInfo.name, selectedDependencies)\n spinner.stop('Removed dependencies')\n })\n}\n","import path from 'node:path'\nimport type { Command } from '@nemo-cli/shared'\nimport {\n createCheckbox,\n createSelect,\n getPackageDependencies,\n getWorkspaceNames,\n handleError,\n log,\n x,\n} from '@nemo-cli/shared'\n\n// New upgradeHandle function\nasync function upgradeHandle(packageName: string, dependencies: string[]) {\n if (!packageName || dependencies.length === 0) {\n log.error('Package name and at least one dependency to upgrade are required.')\n return\n }\n\n log.info(\n `Attempting to upgrade dependencies [${dependencies.join(', ')}] in package [${packageName}] to their latest versions...`\n )\n\n for (const dep of dependencies) {\n const depWithVersion = `${dep}@latest`\n log.info(`Upgrading ${dep} in ${packageName} to @latest... (pnpm add ${depWithVersion} --filter ${packageName})`)\n try {\n const commandParts = ['add', depWithVersion, '--filter', packageName]\n const { stdout, stderr, exitCode } = await x('pnpm', commandParts)\n\n if (stdout) {\n log.info(`Output for ${depWithVersion} (stdout):\\n${stdout}`)\n }\n if (stderr) {\n // pnpm often uses stderr for progress or warnings, not just errors\n log.warn(`Output for ${depWithVersion} (stderr):\\n${stderr}`)\n }\n\n if (exitCode) {\n log.error(`Failed to upgrade ${dep} in ${packageName}. Command exited with code ${exitCode}.`)\n } else {\n log.success(`Successfully upgraded ${dep} in ${packageName}.`)\n }\n } catch (error: unknown) {\n handleError(error, `An error occurred while upgrading ${dep} in ${packageName}: `)\n }\n }\n log.info(`Finished upgrade process for package [${packageName}].`)\n}\n\n// Refactored upgradeCommand function\nexport function upgradeCommand(command: Command) {\n command\n .command('upgrade')\n .alias('up')\n .description('Upgrade dependencies in a specific workspace package.')\n // Old options (-L, -g) are removed as per requirements\n .action(async () => {\n log.info('Fetching workspace packages...')\n const workspaceNames = await getWorkspaceNames()\n if (!workspaceNames || workspaceNames.length === 0) {\n log.error('No workspace packages found. Please check your pnpm-workspace.yaml or run from a workspace root.')\n return\n }\n\n const packageChoices = workspaceNames.map((pkg) => ({\n label: `${pkg.name} (path: ${pkg.path})`,\n value: { name: pkg.name, path: pkg.path }, // Store both name and relative path\n }))\n\n const selectedPackageInfo = await createSelect({\n message: 'Select the target package to upgrade dependencies for:',\n options: packageChoices,\n })\n if (!selectedPackageInfo?.name) {\n log.info('No package selected. Aborting upgrade.')\n return\n }\n\n // Construct full path to the selected package's directory from workspace root\n // Assuming getWorkspacePackages returns paths relative to workspace root\n // And current working directory for getPackageDependencies should be absolute or relative to where the script runs.\n // For simplicity, we assume the shared functions handle path resolution correctly or this CLI runs from workspace root.\n // If packageInfo.path is relative to workspace root:\n const workspaceRoot = process.cwd() // Or find it dynamically if needed\n const selectedPackageDir = path.join(workspaceRoot, selectedPackageInfo.path)\n\n log.info(`Fetching dependencies for package ${selectedPackageInfo.name}...`)\n const dependencies = await getPackageDependencies(selectedPackageDir)\n\n if (!dependencies || dependencies.length === 0) {\n log.info(`No dependencies found in package ${selectedPackageInfo.name}. Nothing to upgrade.`)\n return\n }\n\n const dependencyChoices = dependencies.map((dep) => ({\n label: `${dep.name} (current: ${dep.version}, type: ${dep.type})`,\n value: dep.name,\n }))\n\n const selectedDependencies = await createCheckbox({\n message: `Select dependencies to upgrade in ${selectedPackageInfo.name} (space to select, enter to confirm):`,\n options: dependencyChoices,\n })\n\n if (!selectedDependencies || selectedDependencies.length === 0) {\n log.info('No dependencies selected for upgrade. Aborting.')\n return\n }\n\n await upgradeHandle(selectedPackageInfo.name, selectedDependencies)\n })\n}\n","import { createCommand, readPackage } from '@nemo-cli/shared'\n\nimport { addCommand } from './commands/add'\nimport { cleanCommand } from './commands/clean'\nimport { listCommand } from './commands/list'\nimport { removeCommand } from './commands/remove'\nimport { upgradeCommand } from './commands/upgrade'\nimport { HELP_MESSAGE } from './constants'\n\nexport const pkg = readPackage(import.meta, '..')\n\nexport const init = () => {\n const command = createCommand('np')\n .version(pkg.version)\n .description(`${pkg.name} CLI helper for pnpm workspaces`)\n .addHelpText('after', HELP_MESSAGE.main)\n\n addCommand(command)\n upgradeCommand(command)\n removeCommand(command)\n listCommand(command)\n cleanCommand(command)\n\n return command\n}\n\nexport const run = () => {\n const command = init()\n command.parse(process.argv)\n}\n"],"mappings":";;;;;AAEA,MAAa,eAAe;CAC1B,SAAS,kBAAkB,sCAAsC,iDAAiD;CAClH,MAAM,kBAAkB,gBAAgB,aAAa,yBAAyB;CAC9E,OAAO,kBAAkB,qBAAqB;CAC9C,IAAI,kBAAkB,QAAQ;CAC9B,QAAQ,kBAAkB,YAAY;CACtC,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qBAAqB;GACnE;;;;;ACtGN,MAAa,MAAM,YAAY,OAAO,MAAM,KAAK;AAEjD,MAAa,aAAa;CACxB,MAAM,UAAU,cAAc,KAAK,CAChC,QAAQ,IAAI,QAAQ,CACpB,YAAY,GAAG,IAAI,KAAK,iCAAiC,CACzD,YAAY,SAAS,aAAa,KAAK;AAE1C,YAAW,QAAQ;AACnB,gBAAe,QAAQ;AACvB,eAAc,QAAQ;AACtB,aAAY,QAAQ;AACpB,cAAa,QAAQ;AAErB,QAAO;;AAGT,MAAa,YAAY;AAEvB,CADgB,MAAM,CACd,MAAM,QAAQ,KAAK"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nemo-cli/package",
|
|
3
|
+
"version": "0.0.1-beta.4",
|
|
4
|
+
"description": "pnpm workspace handle",
|
|
5
|
+
"author": "gaozimeng <gaozimeng0425@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/GaoZimeng0425/nemo-cli#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"directories": {
|
|
9
|
+
"lib": "dist",
|
|
10
|
+
"test": "__tests__"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"np": "./bin/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/GaoZimeng0425/nemo-cli.git"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"dev": "rolldown --watch -c ./rolldown.config.ts",
|
|
28
|
+
"build": "rolldown -c ./rolldown.config.ts",
|
|
29
|
+
"test": "vitest",
|
|
30
|
+
"coverage": "vitest run --coverage",
|
|
31
|
+
"check": "tsc --incremental --noEmit",
|
|
32
|
+
"prepublish": "npm run build",
|
|
33
|
+
"prepack": "rolldown"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"import": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/GaoZimeng0425/nemo-cli/issues"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@nemo-cli/shared": "workspace:*",
|
|
49
|
+
"@nemo-cli/ui": "workspace:*"
|
|
50
|
+
}
|
|
51
|
+
}
|