rman 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/README.md +2 -1
- package/commands/info.command.js +2 -1
- package/constants.js +1 -1
- package/package.json +1 -1
- package/services/system-info.d.ts +9 -3
- package/services/system-info.js +22 -3
package/README.md
CHANGED
|
@@ -123,7 +123,8 @@ rman list --scope '@myorg/*' --ignore '*-internal'
|
|
|
123
123
|
|
|
124
124
|
### `rman info`
|
|
125
125
|
|
|
126
|
-
Prints local environment (OS/CPU/memory, Node
|
|
126
|
+
Prints local environment (OS/CPU/memory, Node + whichever package manager `.rmanrc
|
|
127
|
+
"packageManager"` configures, git) and repository information.
|
|
127
128
|
|
|
128
129
|
```bash
|
|
129
130
|
rman info
|
package/commands/info.command.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import colors from 'ansi-colors';
|
|
2
2
|
import semver from 'semver';
|
|
3
|
+
import { CiService } from '../services/ci.service.js';
|
|
3
4
|
import { SystemInfo } from '../services/system-info.js';
|
|
4
5
|
function printSystemInfo(systemInfo) {
|
|
5
6
|
const maxName = Object.keys(systemInfo).reduce((l, p) => Object.keys(systemInfo[p]).reduce((i, x) => Math.max(i, x.length), l), 0);
|
|
@@ -48,7 +49,7 @@ export function initCli(repository, program) {
|
|
|
48
49
|
type: 'boolean',
|
|
49
50
|
}),
|
|
50
51
|
handler: async (args) => {
|
|
51
|
-
const systemInfo = await SystemInfo.getSystemInfo();
|
|
52
|
+
const systemInfo = await SystemInfo.getSystemInfo(CiService.resolvePackageManager(repository));
|
|
52
53
|
const repositoryInfo = SystemInfo.getRepositoryInfo(repository);
|
|
53
54
|
if (args.json) {
|
|
54
55
|
console.log(JSON.stringify({ ...systemInfo, repository: repositoryInfo }, undefined, 2));
|
package/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.7';
|
package/package.json
CHANGED
|
@@ -8,9 +8,15 @@ export declare namespace SystemInfo {
|
|
|
8
8
|
root: string;
|
|
9
9
|
packageCount: number;
|
|
10
10
|
}
|
|
11
|
-
/** Whatever `envinfo` reports (OS/CPU/Memory/Shell, Node
|
|
12
|
-
* rman/typescript versions), grouped by category - shape is `envinfo`'s own, not ours. */
|
|
11
|
+
/** Whatever `envinfo` reports (OS/CPU/Memory/Shell, Node + the resolved package manager, git,
|
|
12
|
+
* installed rman/typescript versions), grouped by category - shape is `envinfo`'s own, not ours. */
|
|
13
13
|
type SystemInfo = Record<string, Record<string, unknown>>;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* `packageManager` (the repository's resolved `.rmanrc "packageManager"`, default `'npm'`)
|
|
16
|
+
* decides which package manager's version actually gets queried/reported - a pnpm-configured
|
|
17
|
+
* repo has no real use for npm's own version, since every package-manager-aware command
|
|
18
|
+
* (`ci`/`publish`) already shells out to pnpm, not npm, for it.
|
|
19
|
+
*/
|
|
20
|
+
function getSystemInfo(packageManager?: 'npm' | 'yarn' | 'pnpm' | 'bun', options?: envinfo.RunConfig): Promise<SystemInfo.SystemInfo>;
|
|
15
21
|
function getRepositoryInfo(repository: Repository): SystemInfo.RepositoryInfo;
|
|
16
22
|
}
|
package/services/system-info.js
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import envinfo from 'envinfo';
|
|
2
2
|
export var SystemInfo;
|
|
3
3
|
(function (SystemInfo) {
|
|
4
|
-
|
|
4
|
+
/** `.rmanrc "packageManager"` value -> the `Binaries` key `envinfo` recognizes for it (`npm`/
|
|
5
|
+
* `pnpm`/`bun` are lowercase, `Yarn` isn't - envinfo's own naming, not ours). */
|
|
6
|
+
const PACKAGE_MANAGER_BINARY = {
|
|
7
|
+
npm: 'npm',
|
|
8
|
+
yarn: 'Yarn',
|
|
9
|
+
pnpm: 'pnpm',
|
|
10
|
+
bun: 'bun',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* `packageManager` (the repository's resolved `.rmanrc "packageManager"`, default `'npm'`)
|
|
14
|
+
* decides which package manager's version actually gets queried/reported - a pnpm-configured
|
|
15
|
+
* repo has no real use for npm's own version, since every package-manager-aware command
|
|
16
|
+
* (`ci`/`publish`) already shells out to pnpm, not npm, for it.
|
|
17
|
+
*/
|
|
18
|
+
async function getSystemInfo(packageManager, options) {
|
|
5
19
|
return JSON.parse(await envinfo.run({
|
|
6
20
|
System: ['OS', 'CPU', 'Memory', 'Shell'],
|
|
7
|
-
Binaries: ['Node',
|
|
21
|
+
Binaries: ['Node', PACKAGE_MANAGER_BINARY[packageManager ?? 'npm']],
|
|
8
22
|
Utilities: ['Git'],
|
|
9
23
|
npmPackages: ['rman', 'typescript'],
|
|
10
24
|
npmGlobalPackages: ['typescript'],
|
|
11
25
|
...options,
|
|
12
|
-
},
|
|
26
|
+
},
|
|
27
|
+
// showNotFound: without it, envinfo *omits* a configured-but-uninstalled package manager
|
|
28
|
+
// from Binaries entirely (indistinguishable from never having asked) instead of reporting
|
|
29
|
+
// "Not Found" - worth surfacing, since it means .rmanrc "packageManager" points at
|
|
30
|
+
// something that isn't actually on this machine.
|
|
31
|
+
{ json: true, showNotFound: true }));
|
|
13
32
|
}
|
|
14
33
|
SystemInfo.getSystemInfo = getSystemInfo;
|
|
15
34
|
function getRepositoryInfo(repository) {
|