@mxpicture/build-cli 0.2.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/cli.d.ts +2 -0
- package/dist/cli.js +59 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +43 -0
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Argument, program } from "@commander-js/extra-typings";
|
|
3
|
+
import { argv, cwd } from "node:process";
|
|
4
|
+
import { runCleanup } from "@mxpicture/build-api/cleanup";
|
|
5
|
+
import { DepsProcessMode, DepsReplacementMode, } from "@mxpicture/build-api/types";
|
|
6
|
+
import { runFixDeps } from "@mxpicture/build-api/deps";
|
|
7
|
+
import { isAbsolute, resolve } from "node:path";
|
|
8
|
+
program.name("build-cli").version("1.0.0").description("Build CLI");
|
|
9
|
+
program
|
|
10
|
+
.command("cleanup")
|
|
11
|
+
.description("Cleanup e.g. node_modules and dist")
|
|
12
|
+
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
13
|
+
.addArgument(new Argument("[workspacesName]", "Name of workspaces location").default("packages"))
|
|
14
|
+
.action(async (repoRoot, workspacesName) => runCleanup({
|
|
15
|
+
repoRoot,
|
|
16
|
+
workspacesName,
|
|
17
|
+
}));
|
|
18
|
+
program
|
|
19
|
+
.command("deps")
|
|
20
|
+
.description("Manipulate workspace dependencies CLI")
|
|
21
|
+
.addArgument(new Argument("<mode>", "Process mode").choices(Object.values(DepsProcessMode)))
|
|
22
|
+
.addArgument(new Argument("<replacement>", "Replacement mode").choices(Object.values(DepsReplacementMode)))
|
|
23
|
+
.addArgument(new Argument("[repoRoot]", "Repo root path").default(cwd()))
|
|
24
|
+
.action(async (mode, replacement, repoRoot) => runFixDeps({
|
|
25
|
+
repoRoot: isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot),
|
|
26
|
+
mode,
|
|
27
|
+
replacement,
|
|
28
|
+
}));
|
|
29
|
+
// program
|
|
30
|
+
// .command("extract-imports")
|
|
31
|
+
// .description("Extract Typescript Imports")
|
|
32
|
+
// .argument("<tsFilePath>")
|
|
33
|
+
// .action(async (tsFilePath) => {
|
|
34
|
+
// console.log(extractNamedImports(resolve(__dirname, tsFilePath)));
|
|
35
|
+
// });
|
|
36
|
+
// program
|
|
37
|
+
// .command("read-changes")
|
|
38
|
+
// .description("Read changes")
|
|
39
|
+
// .action(async () => {
|
|
40
|
+
// const rootDir = (await VSCodeWorkspace.loadAsync()).root;
|
|
41
|
+
// const dets = await runDetector(rootDir);
|
|
42
|
+
// console.log(dets);
|
|
43
|
+
// });
|
|
44
|
+
// program
|
|
45
|
+
// .command("read-config")
|
|
46
|
+
// .description("Read config.json")
|
|
47
|
+
// .action(async () => {
|
|
48
|
+
// const config = GenConfigJson.instance();
|
|
49
|
+
// try {
|
|
50
|
+
// await config.read();
|
|
51
|
+
// console.log("read successful");
|
|
52
|
+
// } catch {
|
|
53
|
+
// console.log("read failed");
|
|
54
|
+
// await config.init();
|
|
55
|
+
// console.log("created successful");
|
|
56
|
+
// }
|
|
57
|
+
// console.log(config.content);
|
|
58
|
+
// });
|
|
59
|
+
program.parse(argv);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mxpicture/build-cli",
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "Build utilities CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "MXPicture",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/MXPicture/npm-build-cli.git"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"build-cli": "./dist/cli.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\" --ext .ts,.tsx",
|
|
29
|
+
"build": "tsc -b ."
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@mxpicture/build-api": "workspace:*"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
39
|
+
"@types/node": "^25.2.3",
|
|
40
|
+
"eslint": "^9.39.3",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
|
+
}
|
|
43
|
+
}
|