@mxpicture/build-cli 0.2.6 → 0.2.8
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.js +15 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,11 @@ import { argv, cwd } from "node:process";
|
|
|
4
4
|
import { runCleanup } from "@mxpicture/build-api/cleanup";
|
|
5
5
|
import { DepsProcessMode, DepsReplacementMode, } from "@mxpicture/build-api/types";
|
|
6
6
|
import { runFixDeps } from "@mxpicture/build-api/deps";
|
|
7
|
-
import { isAbsolute, resolve } from "node:path";
|
|
7
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
8
|
+
import { runNpmPublisher } from "@mxpicture/build-api/npmPublish";
|
|
9
|
+
import { consoleLogger, setLogger } from "@mxpicture/build-api/logger";
|
|
10
|
+
setLogger(consoleLogger);
|
|
11
|
+
const resolveRoot = (repoRoot) => isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot);
|
|
8
12
|
program.name("build-cli").version("1.0.0").description("Build CLI");
|
|
9
13
|
program
|
|
10
14
|
.command("cleanup")
|
|
@@ -12,7 +16,7 @@ program
|
|
|
12
16
|
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
13
17
|
.addArgument(new Argument("[workspacesName]", "Name of workspaces location").default("packages"))
|
|
14
18
|
.action(async (repoRoot, workspacesName) => runCleanup({
|
|
15
|
-
repoRoot,
|
|
19
|
+
repoRoot: resolveRoot(repoRoot),
|
|
16
20
|
workspacesName,
|
|
17
21
|
}));
|
|
18
22
|
program
|
|
@@ -22,10 +26,18 @@ program
|
|
|
22
26
|
.addArgument(new Argument("<replacement>", "Replacement mode").choices(Object.values(DepsReplacementMode)))
|
|
23
27
|
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
24
28
|
.action(async (mode, replacement, repoRoot) => runFixDeps({
|
|
25
|
-
repoRoot:
|
|
29
|
+
repoRoot: resolveRoot(repoRoot),
|
|
26
30
|
mode,
|
|
27
31
|
replacement,
|
|
28
32
|
}));
|
|
33
|
+
program
|
|
34
|
+
.command("npm-publish")
|
|
35
|
+
.description("Publish to npmjs")
|
|
36
|
+
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
37
|
+
.addArgument(new Argument("[workspacesName]", "Name of workspaces location").default("packages"))
|
|
38
|
+
.action(async (repoRoot, workspacesName) => runNpmPublisher({
|
|
39
|
+
packagesDir: join(resolveRoot(repoRoot), workspacesName),
|
|
40
|
+
}));
|
|
29
41
|
// program
|
|
30
42
|
// .command("extract-imports")
|
|
31
43
|
// .description("Extract Typescript Imports")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxpicture/build-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Build utilities CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MXPicture",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@mxpicture/build-api": "^0.2.
|
|
35
|
+
"@mxpicture/build-api": "^0.2.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@commander-js/extra-typings": "^14.0.0",
|