pm-auto 1.0.6 → 1.0.7
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/config.json +45 -0
- package/dist/build_command.d.ts +6 -1
- package/dist/build_command.d.ts.map +1 -1
- package/dist/build_command.js +61 -22
- package/dist/build_command.js.map +1 -1
- package/dist/config_path.d.ts +1 -0
- package/dist/config_path.d.ts.map +1 -1
- package/dist/config_path.js +60 -2
- package/dist/config_path.js.map +1 -1
- package/dist/config_reader.d.ts +2 -12
- package/dist/config_reader.d.ts.map +1 -1
- package/dist/config_reader.js +72 -89
- package/dist/config_reader.js.map +1 -1
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +1 -0
- package/dist/display.js.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +18 -28
- package/dist/orchestrator.js.map +1 -1
- package/dist/run_commands.d.ts +6 -0
- package/dist/run_commands.d.ts.map +1 -0
- package/dist/{install.js → run_commands.js} +4 -4
- package/dist/run_commands.js.map +1 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/build_command.ts +73 -23
- package/src/config_path.ts +63 -2
- package/src/config_reader.ts +86 -107
- package/src/display.ts +1 -0
- package/src/index.ts +6 -9
- package/src/orchestrator.ts +21 -36
- package/src/{install.ts → run_commands.ts} +3 -3
- package/src/types/index.ts +12 -3
- package/tests/build_command.test.ts +239 -41
- package/tests/config_reader.test.ts +51 -92
- package/tests/{install.test.ts → run_command.test.ts} +23 -23
- package/dist/install.d.ts +0 -6
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js.map +0 -1
- package/test.json +0 -87
package/config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"example": {
|
|
3
|
+
"presetName": "example",
|
|
4
|
+
"description": "A sample configuration demonstrating all options for PM-Auto",
|
|
5
|
+
"packageManager": "bun",
|
|
6
|
+
"packages": [
|
|
7
|
+
{
|
|
8
|
+
"command": "create-next-app",
|
|
9
|
+
"interactive": true,
|
|
10
|
+
"dev": false,
|
|
11
|
+
"version": "latest",
|
|
12
|
+
"flags": ["."]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"command": "shadcn",
|
|
16
|
+
"interactive": true,
|
|
17
|
+
"dev": false,
|
|
18
|
+
"version": "latest",
|
|
19
|
+
"flags": ["init"]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"command": "gsap",
|
|
23
|
+
"interactive": false,
|
|
24
|
+
"dev": false,
|
|
25
|
+
"version": "3.11.4",
|
|
26
|
+
"flags": ["--peer-deps"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"command": "@react-three/fiber",
|
|
30
|
+
"interactive": false,
|
|
31
|
+
"dev": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"command": "clsx",
|
|
35
|
+
"interactive": false,
|
|
36
|
+
"dev": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"command": "@types/three",
|
|
40
|
+
"interactive": false,
|
|
41
|
+
"dev": true
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/build_command.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import type { ConfigType, CommandResult } from "./types/index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Build commands from project configurations.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the package name from a raw command string
|
|
7
|
+
* Removes version and any flags (starts with -)
|
|
8
|
+
*/
|
|
9
|
+
export declare function cleanCommand(rawCommand: string): string;
|
|
10
|
+
export declare function buildInstallCommands(projects: ConfigType[]): CommandResult[];
|
|
6
11
|
export declare function buildUninstallCommands(projects: ConfigType[]): CommandResult[];
|
|
7
12
|
//# sourceMappingURL=build_command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_command.d.ts","sourceRoot":"","sources":["../src/build_command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;GAEG;AAEH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"build_command.d.ts","sourceRoot":"","sources":["../src/build_command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;GAEG;AAEH;;;GAGG;AAEH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgBvD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAmG1D;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAqD5D"}
|
package/dist/build_command.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build commands from project configurations.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Extracts the package name from a raw command string
|
|
6
|
+
* Removes version and any flags (starts with -)
|
|
7
|
+
*/
|
|
8
|
+
export function cleanCommand(rawCommand) {
|
|
9
|
+
// Split by spaces and pick first segment that doesn't start with "-"
|
|
10
|
+
const parts = rawCommand.trim().split(" ");
|
|
11
|
+
for (const part of parts) {
|
|
12
|
+
if (!part.startsWith("-")) {
|
|
13
|
+
// Remove version if exists
|
|
14
|
+
const atIndex = part.indexOf("@");
|
|
15
|
+
if (atIndex > 0) {
|
|
16
|
+
return part.slice(0, atIndex).trim();
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return part.trim();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return ""; // fallback
|
|
24
|
+
}
|
|
25
|
+
export function buildInstallCommands(projects) {
|
|
5
26
|
// Initialize arrays properly
|
|
6
27
|
const commandArray = [];
|
|
7
28
|
for (const project of projects) {
|
|
@@ -10,20 +31,28 @@ export function buildCommands(projects) {
|
|
|
10
31
|
npm: {
|
|
11
32
|
install: "npm install",
|
|
12
33
|
run: "npx",
|
|
34
|
+
dev: "-D",
|
|
13
35
|
},
|
|
14
36
|
pnpm: {
|
|
15
37
|
install: "pnpm add",
|
|
16
38
|
run: "pnpm dlx",
|
|
39
|
+
dev: "-D",
|
|
17
40
|
},
|
|
18
41
|
yarn: {
|
|
19
42
|
install: "yarn add",
|
|
20
43
|
run: "yarn dlx",
|
|
44
|
+
dev: "-D",
|
|
45
|
+
},
|
|
46
|
+
bun: {
|
|
47
|
+
install: "bun add",
|
|
48
|
+
run: "bunx",
|
|
49
|
+
dev: "-d",
|
|
21
50
|
},
|
|
22
51
|
};
|
|
23
52
|
const manager = commandPrefixes[packageManager] ||
|
|
24
53
|
commandPrefixes.npm;
|
|
25
54
|
const result = {
|
|
26
|
-
|
|
55
|
+
presetName: project.presetName,
|
|
27
56
|
interactive: [],
|
|
28
57
|
nonInteractive: [],
|
|
29
58
|
};
|
|
@@ -42,24 +71,32 @@ export function buildCommands(projects) {
|
|
|
42
71
|
}
|
|
43
72
|
// Add interactive packages as separate commands (sequential)
|
|
44
73
|
interactive.forEach((pkg) => {
|
|
45
|
-
result.interactive.push(`${manager.run} ${pkg.command}`);
|
|
74
|
+
result.interactive.push(`${manager.run} ${cleanCommand(pkg.command)}${pkg.version ? `@${pkg.version}` : ""} ${pkg.flags?.join(" ") || ""}`.trim());
|
|
46
75
|
});
|
|
47
|
-
// Batch all non-interactive packages
|
|
76
|
+
// Batch all non-interactive packages
|
|
48
77
|
if (nonInteractive.length > 0) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
78
|
+
const batchPackages = [];
|
|
79
|
+
nonInteractive.forEach((pkg) => {
|
|
80
|
+
const base = cleanCommand(pkg.command); // package name or full command
|
|
81
|
+
let cmd = base;
|
|
82
|
+
// Append version if present
|
|
83
|
+
if (pkg.version) {
|
|
84
|
+
cmd += `@${pkg.version}`;
|
|
53
85
|
}
|
|
54
|
-
|
|
55
|
-
.
|
|
56
|
-
|
|
57
|
-
nonInteractive.map((pkg) => {
|
|
58
|
-
if (pkg.command.includes("-")) {
|
|
59
|
-
result.nonInteractive.push(`${manager.install} ${pkg.command}`);
|
|
86
|
+
// Append dev flag if true (mapped per manager)
|
|
87
|
+
if (pkg.dev) {
|
|
88
|
+
cmd += ` ${manager.dev}`;
|
|
60
89
|
}
|
|
90
|
+
// Append any extra flags
|
|
91
|
+
if (pkg.flags?.length) {
|
|
92
|
+
cmd += ` ${pkg.flags.join(" ")}`;
|
|
93
|
+
}
|
|
94
|
+
batchPackages.push(cmd);
|
|
61
95
|
});
|
|
62
|
-
|
|
96
|
+
// Push a single install command for all batchable packages
|
|
97
|
+
if (batchPackages.length > 0) {
|
|
98
|
+
result.nonInteractive.push(`${manager.install} ${batchPackages.join(" ")}`);
|
|
99
|
+
}
|
|
63
100
|
}
|
|
64
101
|
commandArray.push(result);
|
|
65
102
|
}
|
|
@@ -71,25 +108,27 @@ export function buildUninstallCommands(projects) {
|
|
|
71
108
|
const { packageManager, packages } = project;
|
|
72
109
|
const commandPrefixes = {
|
|
73
110
|
npm: {
|
|
74
|
-
|
|
111
|
+
uninstall: "npm uninstall",
|
|
75
112
|
},
|
|
76
113
|
pnpm: {
|
|
77
|
-
|
|
114
|
+
uninstall: "pnpm remove",
|
|
78
115
|
},
|
|
79
116
|
yarn: {
|
|
80
|
-
|
|
117
|
+
uninstall: "yarn remove",
|
|
118
|
+
},
|
|
119
|
+
bun: {
|
|
120
|
+
uninstall: "bun remove",
|
|
81
121
|
},
|
|
82
122
|
};
|
|
83
123
|
const manager = commandPrefixes[packageManager] ||
|
|
84
124
|
commandPrefixes.npm;
|
|
85
125
|
const result = {
|
|
86
|
-
|
|
126
|
+
presetName: project.presetName,
|
|
87
127
|
interactive: [],
|
|
88
128
|
nonInteractive: [],
|
|
89
129
|
};
|
|
90
130
|
// Separate interactive from non-interactive packages
|
|
91
131
|
const nonInteractive = [];
|
|
92
|
-
// const interactive: PackageType[] = [];
|
|
93
132
|
if (packages) {
|
|
94
133
|
packages.forEach((pkg) => {
|
|
95
134
|
if (!pkg.interactive) {
|
|
@@ -100,9 +139,9 @@ export function buildUninstallCommands(projects) {
|
|
|
100
139
|
// Batch all non-interactive packages into ONE command
|
|
101
140
|
if (nonInteractive.length > 0) {
|
|
102
141
|
const packageNames = nonInteractive
|
|
103
|
-
.map((pkg) => pkg.command
|
|
142
|
+
.map((pkg) => cleanCommand(pkg.command))
|
|
104
143
|
.join(" ");
|
|
105
|
-
result.nonInteractive.push(`${manager.
|
|
144
|
+
result.nonInteractive.push(`${manager.uninstall} ${packageNames}`);
|
|
106
145
|
}
|
|
107
146
|
commandArray.push(result);
|
|
108
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_command.js","sourceRoot":"","sources":["../src/build_command.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"build_command.js","sourceRoot":"","sources":["../src/build_command.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;GAGG;AAEH,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,qEAAqE;IACrE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,2BAA2B;YAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAClC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,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AC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC3B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,sDAAsD;QACtD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,YAAY,GAAG,cAAc;iBAChC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;iBACvC,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/config_path.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_path.d.ts","sourceRoot":"","sources":["../src/config_path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config_path.d.ts","sourceRoot":"","sources":["../src/config_path.ts"],"names":[],"mappings":"AA0DA,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAa3D;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAgBvD;AAED,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAiB7C"}
|
package/dist/config_path.js
CHANGED
|
@@ -4,17 +4,75 @@ import * as os from "os";
|
|
|
4
4
|
import { display } from "./display.js";
|
|
5
5
|
const SETTINGS_DIR = path.join(os.homedir(), ".pm-auto");
|
|
6
6
|
const SETTINGS_FILE = path.join(SETTINGS_DIR, "settings.json");
|
|
7
|
+
const EXAMPLE_CONFIG_TEXT = `{
|
|
8
|
+
"example": {
|
|
9
|
+
"presetName": "example",
|
|
10
|
+
"description": "A sample configuration demonstrating all options for PM-Auto",
|
|
11
|
+
"packageManager": "bun",
|
|
12
|
+
"packages": [
|
|
13
|
+
{
|
|
14
|
+
"command": "create-next-app",
|
|
15
|
+
"interactive": true,
|
|
16
|
+
"dev": false,
|
|
17
|
+
"version": "latest",
|
|
18
|
+
"flags": ["."]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"command": "shadcn",
|
|
22
|
+
"interactive": true,
|
|
23
|
+
"dev": false,
|
|
24
|
+
"version": "latest",
|
|
25
|
+
"flags": ["init"]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"command": "gsap",
|
|
29
|
+
"interactive": false,
|
|
30
|
+
"dev": false,
|
|
31
|
+
"version": "3.11.4",
|
|
32
|
+
"flags": ["--peer-deps"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"command": "@react-three/fiber",
|
|
36
|
+
"interactive": false,
|
|
37
|
+
"dev": false
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"command": "clsx",
|
|
41
|
+
"interactive": false,
|
|
42
|
+
"dev": false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"command": "@types/three",
|
|
46
|
+
"interactive": false,
|
|
47
|
+
"dev": true
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export function prependToFile(filePath, text) {
|
|
54
|
+
display(`Prepending to example to file: ${filePath}`, "info");
|
|
55
|
+
// Read old content if file exists
|
|
56
|
+
const oldContent = fs.existsSync(filePath)
|
|
57
|
+
? fs.readFileSync(filePath, "utf8")
|
|
58
|
+
: "";
|
|
59
|
+
// Write new content at the top
|
|
60
|
+
if (!oldContent.includes(text)) {
|
|
61
|
+
fs.writeFileSync(filePath, text + oldContent, "utf8");
|
|
62
|
+
}
|
|
63
|
+
display(`Example prepended successfully: ${filePath}`, "success");
|
|
64
|
+
}
|
|
7
65
|
export function saveConfigPath(configPath) {
|
|
8
66
|
// Create directory if it doesn't exist
|
|
9
67
|
if (!fs.existsSync(SETTINGS_DIR)) {
|
|
10
68
|
fs.mkdirSync(SETTINGS_DIR, { recursive: true });
|
|
11
69
|
}
|
|
12
|
-
//check if file exists
|
|
13
70
|
try {
|
|
14
71
|
const real = fs.realpathSync(configPath);
|
|
15
72
|
const settings = { configPath: real };
|
|
16
73
|
fs.writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 2));
|
|
17
|
-
display(`Config file path saved: ${configPath}`, "
|
|
74
|
+
display(`Config file path saved: ${configPath}`, "info");
|
|
75
|
+
prependToFile(real, EXAMPLE_CONFIG_TEXT);
|
|
18
76
|
}
|
|
19
77
|
catch (err) {
|
|
20
78
|
display(`Error saving config file: ${err.message}`, "error");
|
package/dist/config_path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_path.js","sourceRoot":"","sources":["../src/config_path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"config_path.js","sourceRoot":"","sources":["../src/config_path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE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AC,2BAA2B,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;QACzD,aAAa,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,6BAA6B,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,0BAA0B;IAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAClC,OAAO,CACL,2EAA2E,EAC3E,MAAM,CACP,CAAC;QACF,OAAO,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAa,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;IACnC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,mCAAmC,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/dist/config_reader.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Detect the package manager used in the project.
|
|
5
|
-
*/
|
|
6
|
-
export declare function detectPackageManager(projectPath?: string): PackageManager | void;
|
|
7
|
-
/**
|
|
8
|
-
* Gets the required packages from the config file, transforms into a js object and with the options given
|
|
9
|
-
* it modifies the object and returns it
|
|
10
|
-
*/
|
|
11
|
-
export declare const getConfigObject: (packages: string[], options?: any) => Promise<ConfigType[] | CommandResult[]>;
|
|
1
|
+
import type { ConfigType } from "./types/index.js";
|
|
2
|
+
export declare const getConfigObject: (packages: string[], options?: any) => Promise<ConfigType[]>;
|
|
12
3
|
export declare const getConfigKeys: (options: any) => Promise<void>;
|
|
13
4
|
export declare const getPackageDescription: (packageName: string) => Promise<void>;
|
|
14
|
-
export {};
|
|
15
5
|
//# sourceMappingURL=config_reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_reader.d.ts","sourceRoot":"","sources":["../src/config_reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config_reader.d.ts","sourceRoot":"","sources":["../src/config_reader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuBlE,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAAE,EAClB,UAAU,GAAG,KACZ,OAAO,CAAC,UAAU,EAAE,CAgFtB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,SAAS,GAAG,kBA2B/C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,aAAa,MAAM,kBAyB9D,CAAC"}
|
package/dist/config_reader.js
CHANGED
|
@@ -1,105 +1,88 @@
|
|
|
1
1
|
import fs from "fs/promises";
|
|
2
2
|
import { getConfigPath } from "./config_path.js";
|
|
3
|
-
import * as fsd from "fs";
|
|
4
|
-
import * as path from "path";
|
|
5
3
|
import { display } from "./display.js";
|
|
6
4
|
import { confirm, isCancel, cancel } from "@clack/prompts";
|
|
7
|
-
/**
|
|
8
|
-
* Detect the package manager used in the project.
|
|
9
|
-
*/
|
|
10
|
-
export function detectPackageManager(projectPath = process.cwd()) {
|
|
11
|
-
// Check for lock files in order of specificity
|
|
12
|
-
if (fsd.existsSync(path.join(projectPath, "pnpm-lock.yaml"))) {
|
|
13
|
-
return "pnpm";
|
|
14
|
-
}
|
|
15
|
-
if (fsd.existsSync(path.join(projectPath, "yarn.lock"))) {
|
|
16
|
-
return "yarn";
|
|
17
|
-
}
|
|
18
|
-
if (fsd.existsSync(path.join(projectPath, "package-lock.json"))) {
|
|
19
|
-
return "npm";
|
|
20
|
-
}
|
|
21
|
-
// Default to npm if no lock file found
|
|
22
|
-
display("No Lock File Found", "error");
|
|
23
|
-
}
|
|
24
5
|
/**
|
|
25
6
|
* Gets the required packages from the config file, transforms into a js object and with the options given
|
|
26
7
|
* it modifies the object and returns it
|
|
27
8
|
*/
|
|
9
|
+
//Check if the value is an array of ConfigType objects
|
|
10
|
+
function isConfigTypeArray(value) {
|
|
11
|
+
return (Array.isArray(value) &&
|
|
12
|
+
value.every((item) => typeof item === "object" &&
|
|
13
|
+
item !== null &&
|
|
14
|
+
"packages" in item &&
|
|
15
|
+
Array.isArray(item.packages)));
|
|
16
|
+
}
|
|
28
17
|
export const getConfigObject = async (packages, options) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
const configPath = getConfigPath();
|
|
19
|
+
//read config file content
|
|
20
|
+
let configContent = "";
|
|
21
|
+
try {
|
|
22
|
+
configContent = await fs.readFile(configPath, "utf8");
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
display(`File not found ${error} Try updating the config file path`, "error");
|
|
26
|
+
}
|
|
27
|
+
const configObject = JSON.parse(configContent);
|
|
28
|
+
let result = [];
|
|
29
|
+
if (isConfigTypeArray(Object.values(configObject))) {
|
|
30
|
+
result = Object.values(configObject);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
display("Invalid config file format", "error");
|
|
34
|
+
}
|
|
35
|
+
//filter the packages the user wants to install
|
|
36
|
+
if (packages.length > 0 && result.length > 0) {
|
|
37
|
+
result = packages
|
|
38
|
+
.map((pkgName) => {
|
|
39
|
+
const found = result.find((pkg) => pkg.presetName === pkgName);
|
|
40
|
+
if (!found) {
|
|
41
|
+
display(`Package '${pkgName}' not found in config`, "warning");
|
|
42
|
+
}
|
|
43
|
+
return found;
|
|
44
|
+
})
|
|
45
|
+
.filter((pkg) => pkg !== undefined);
|
|
46
|
+
}
|
|
47
|
+
/*
|
|
48
|
+
* Config object modification with the options given
|
|
49
|
+
*/
|
|
50
|
+
//Add flags to previous configured flags (-A/-add-flags)
|
|
51
|
+
if (options.addFlags) {
|
|
52
|
+
result.forEach((config) => {
|
|
53
|
+
config.packages.forEach((pkg) => {
|
|
54
|
+
if (pkg.flags) {
|
|
55
|
+
pkg.flags.push(pkg.interactive ? "" : options.addFlags);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
pkg.flags = [pkg.interactive ? "" : options.addFlags];
|
|
48
59
|
}
|
|
49
|
-
return found;
|
|
50
|
-
})
|
|
51
|
-
.filter((pkg) => pkg !== undefined);
|
|
52
|
-
}
|
|
53
|
-
/*
|
|
54
|
-
* Config object modification with the options given
|
|
55
|
-
*/
|
|
56
|
-
//Add command to previous configured commands (-A/-add-command)
|
|
57
|
-
if (options.addCommand) {
|
|
58
|
-
result.forEach((config) => {
|
|
59
|
-
config.packages.forEach((pkg) => {
|
|
60
|
-
pkg.command = pkg.interactive
|
|
61
|
-
? pkg.command
|
|
62
|
-
: pkg.command + " " + options.addCommand;
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//Dry run - Display commands before execution
|
|
67
|
-
if (options.dryRun) {
|
|
68
|
-
display("Dry Run:", "info");
|
|
69
|
-
result.forEach((config) => {
|
|
70
|
-
display(`Package name -> ${config.name}`, "info");
|
|
71
|
-
config.packages.forEach((pkg) => {
|
|
72
|
-
display(`running ${pkg.command}`, "info");
|
|
73
|
-
});
|
|
74
60
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//Dry run - Display commands before execution
|
|
64
|
+
if (options.dryRun) {
|
|
65
|
+
display("Dry Run:", "info");
|
|
66
|
+
result.forEach((config) => {
|
|
67
|
+
display(`Package name -> ${config.presetName}`, "info");
|
|
68
|
+
config.packages.forEach((pkg) => {
|
|
69
|
+
display(`running ${pkg.command}`, "info");
|
|
78
70
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
});
|
|
72
|
+
const continuation = await confirm({
|
|
73
|
+
message: "Continue?",
|
|
74
|
+
initialValue: true,
|
|
75
|
+
});
|
|
76
|
+
if (isCancel(continuation)) {
|
|
77
|
+
cancel("Operation cancelled.");
|
|
78
|
+
process.exit(0);
|
|
79
|
+
}
|
|
80
|
+
if (!continuation) {
|
|
81
|
+
display("Operation cancelled. ", "success");
|
|
82
|
+
process.exit(0);
|
|
87
83
|
}
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
//generate command for package.json
|
|
92
|
-
const pm = detectPackageManager();
|
|
93
|
-
const command = pm + " install";
|
|
94
|
-
const result = [
|
|
95
|
-
{
|
|
96
|
-
name: "package.json",
|
|
97
|
-
interactive: [],
|
|
98
|
-
nonInteractive: [command],
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
return result;
|
|
102
84
|
}
|
|
85
|
+
return result;
|
|
103
86
|
};
|
|
104
87
|
export const getConfigKeys = async (options) => {
|
|
105
88
|
const configPath = getConfigPath();
|
|
@@ -138,7 +121,7 @@ export const getPackageDescription = async (packageName) => {
|
|
|
138
121
|
const configObject = JSON.parse(configContent);
|
|
139
122
|
const configObjectArray = Object.values(configObject);
|
|
140
123
|
configObjectArray.forEach((configObject) => {
|
|
141
|
-
if (configObject.
|
|
124
|
+
if (configObject.presetName === packageName) {
|
|
142
125
|
const description = !configObject.description
|
|
143
126
|
? "No description"
|
|
144
127
|
: configObject.description;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config_reader.js","sourceRoot":"","sources":["../src/config_reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,
|
|
1
|
+
{"version":3,"file":"config_reader.js","sourceRoot":"","sources":["../src/config_reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE3D;;;GAGG;AAEH,sDAAsD;AACtD,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,CACT,CAAC,IAAI,EAAE,EAAE,CACP,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,KAAK,IAAI;YACb,UAAU,IAAI,IAAI;YAClB,KAAK,CAAC,OAAO,CAAE,IAAY,CAAC,QAAQ,CAAC,CACxC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,QAAkB,EAClB,OAAa,EACU,EAAE;IACzB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,0BAA0B;IAC1B,IAAI,aAAa,GAAG,EAAE,CAAC;IACvB,IAAI,CAAC;QACH,aAAa,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAoB,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CACL,kBAAkB,KAAK,oCAAoC,EAC3D,OAAO,CACR,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAA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AC/C,MAAM,iBAAiB,GAAiB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEpE,iBAAiB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;QACzC,IAAI,YAAY,CAAC,UAAU,KAAK,WAAW,EAAE,CAAC;YAC5C,MAAM,WAAW,GAAG,CAAC,YAAY,CAAC,WAAW;gBAC3C,CAAC,CAAC,gBAAgB;gBAClB,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC;YAC7B,OAAO,CAAC,GAAG,WAAW,MAAM,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/display.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE,CAAC;AAC7E,eAAO,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,EAAE,CAAC;AAC7E,eAAO,MAAM,CAAC;eA4BwnG,CAAC;cAAiC,CAAC,cAAc,CAAC;iBAAoC,CAAC;CA5BnsG,CAAC;AAC3B,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,EAAE,MAAM,WAAW;eA2B+kG,CAAC;cAAiC,CAAC,cAAc,CAAC;iBAAoC,CAAC;aAD5tG,CAAC"}
|
package/dist/display.js
CHANGED
package/dist/display.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAA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AAK,OAAO;YACV,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAElB,KAAK,SAAS;YACZ,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,0BAA0B;YAC1D,MAAM;QAER,KAAK,SAAS;YACZ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7B,MAAM;QAER,KAAK,MAAM;YACT,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3B,MAAM;QAER,KAAK,SAAS;YACZ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACd,OAAO,CAAC,CAAC,CAAC,4CAA4C;QAExD;YACE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,8 +10,8 @@ intro(chalk.inverse(" pm-auto "));
|
|
|
10
10
|
const program = new Command();
|
|
11
11
|
program
|
|
12
12
|
.name("pm-auto")
|
|
13
|
-
.version("1.0.
|
|
14
|
-
.description("
|
|
13
|
+
.version("1.0.7")
|
|
14
|
+
.description("Automate your project setup with one command");
|
|
15
15
|
program
|
|
16
16
|
.command("config <path>")
|
|
17
17
|
.description("Set the path to the configuration file")
|
|
@@ -23,8 +23,7 @@ program
|
|
|
23
23
|
.alias("add")
|
|
24
24
|
.alias("i")
|
|
25
25
|
.description("Install packages using the detected package manager (Aliases: add, i)")
|
|
26
|
-
.option("-
|
|
27
|
-
.option("-A, --add-command <command>", "Add a custom command to all installation commands from config file")
|
|
26
|
+
.option("-A, --add-flags <flags>", "Add custom flags to already defined flags from config file")
|
|
28
27
|
.option("-D, --dry-run", "Dry run - Display commands before execution")
|
|
29
28
|
.action((packages, options) => {
|
|
30
29
|
orchestrator("install", packages, options);
|
|
@@ -44,11 +43,11 @@ program
|
|
|
44
43
|
.command("list")
|
|
45
44
|
.alias("ls")
|
|
46
45
|
.description("List all packages from the config file")
|
|
47
|
-
.option("
|
|
46
|
+
.option("--desc", "Display packages description", false)
|
|
48
47
|
.action((options) => {
|
|
49
48
|
getConfigKeys(options);
|
|
50
49
|
});
|
|
51
|
-
//
|
|
50
|
+
//Display a config description
|
|
52
51
|
program
|
|
53
52
|
.command("describe <package>")
|
|
54
53
|
.alias("desc")
|