@mxpicture/build-cli 0.2.9 → 0.2.10
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 +16 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4,13 +4,18 @@ 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, join, resolve } from "node:path";
|
|
7
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
8
8
|
import { runNpmPublisher } from "@mxpicture/build-api/npmPublish";
|
|
9
9
|
import { consoleLogger, setLogger } from "@mxpicture/build-api/logger";
|
|
10
10
|
import { runBarrel } from "@mxpicture/build-api/barrel";
|
|
11
|
+
import { runChangeset } from "@mxpicture/build-api/changeset";
|
|
12
|
+
import { readPackageJsonSync } from "@mxpicture/build-api/workspace";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
11
14
|
setLogger(consoleLogger);
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
16
|
const resolveRoot = (repoRoot) => isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot);
|
|
13
|
-
|
|
17
|
+
const pkg = readPackageJsonSync(resolve(__dirname, "../package.json"));
|
|
18
|
+
program.name("build-cli").version(pkg.version).description("Build CLI");
|
|
14
19
|
program
|
|
15
20
|
.command("cleanup")
|
|
16
21
|
.description("Cleanup e.g. node_modules and dist")
|
|
@@ -48,6 +53,15 @@ program
|
|
|
48
53
|
repoRoot,
|
|
49
54
|
workspacesName,
|
|
50
55
|
}));
|
|
56
|
+
program
|
|
57
|
+
.command("changeset")
|
|
58
|
+
.description("Create changeset")
|
|
59
|
+
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
60
|
+
.addArgument(new Argument("[workspacesName]", "Name of workspaces location").default("packages"))
|
|
61
|
+
.action(async (repoRoot, workspacesName) => runChangeset({
|
|
62
|
+
repoRoot,
|
|
63
|
+
workspacesName,
|
|
64
|
+
}));
|
|
51
65
|
// program
|
|
52
66
|
// .command("extract-imports")
|
|
53
67
|
// .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.10",
|
|
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.10"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@commander-js/extra-typings": "^14.0.0",
|