@pnpm/building.commands 1100.0.22 → 1100.1.0
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/lib/policy/approveBuilds.js +41 -44
- package/package.json +23 -23
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { checkbox, confirm } from '@inquirer/prompts';
|
|
1
2
|
import { writeSettings } from '@pnpm/config.writer';
|
|
2
3
|
import { parse } from '@pnpm/deps.path';
|
|
3
4
|
import { PnpmError } from '@pnpm/error';
|
|
@@ -6,7 +7,6 @@ import { writeModulesManifest } from '@pnpm/installing.modules-yaml';
|
|
|
6
7
|
import { globalInfo } from '@pnpm/logger';
|
|
7
8
|
import { lexCompare } from '@pnpm/util.lex-comparator';
|
|
8
9
|
import chalk from 'chalk';
|
|
9
|
-
import enquirer from 'enquirer';
|
|
10
10
|
import { renderHelp } from 'render-help';
|
|
11
11
|
import { rebuild } from '../build/index.js';
|
|
12
12
|
import { getAutomaticallyIgnoredBuilds } from './getAutomaticallyIgnoredBuilds.js';
|
|
@@ -86,42 +86,33 @@ export async function handler(opts, params = [], commands) {
|
|
|
86
86
|
buildPackages = sortUniqueStrings([...automaticallyIgnoredBuilds]);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
k() {
|
|
114
|
-
return this.up();
|
|
115
|
-
},
|
|
116
|
-
cancel() {
|
|
117
|
-
// By default, canceling the prompt via Ctrl+c throws an empty string.
|
|
118
|
-
// The custom cancel function prevents that behavior.
|
|
119
|
-
// Otherwise, pnpm CLI would print an error and confuse users.
|
|
120
|
-
// See related issue: https://github.com/enquirer/enquirer/issues/225
|
|
89
|
+
try {
|
|
90
|
+
const buildPackagesValues = await checkbox({
|
|
91
|
+
choices: sortUniqueStrings([...automaticallyIgnoredBuilds]).map((name) => ({
|
|
92
|
+
name,
|
|
93
|
+
value: name,
|
|
94
|
+
})),
|
|
95
|
+
message: 'Choose which packages to build ' +
|
|
96
|
+
`(Press ${chalk.cyan('<space>')} to select, ` +
|
|
97
|
+
`${chalk.cyan('<a>')} to toggle all, ` +
|
|
98
|
+
`${chalk.cyan('<i>')} to invert selection)`,
|
|
99
|
+
required: false,
|
|
100
|
+
theme: {
|
|
101
|
+
icon: { checked: '●', unchecked: '○', cursor: '❯' },
|
|
102
|
+
style: {
|
|
103
|
+
highlight: chalk.bgBlack.whiteBright,
|
|
104
|
+
},
|
|
105
|
+
keybindings: ['vim'],
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
buildPackages = buildPackagesValues;
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
if (err instanceof Error && err.name === 'ExitPromptError') {
|
|
121
112
|
process.exit(0);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
}
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
125
116
|
}
|
|
126
117
|
const allowBuilds = { ...opts.allowBuilds };
|
|
127
118
|
if (params.length) {
|
|
@@ -143,14 +134,20 @@ export async function handler(opts, params = [], commands) {
|
|
|
143
134
|
}
|
|
144
135
|
if (!opts.all && !params.length) {
|
|
145
136
|
if (buildPackages.length) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
137
|
+
let isConfirmed;
|
|
138
|
+
try {
|
|
139
|
+
isConfirmed = await confirm({
|
|
140
|
+
message: `The next packages will now be built: ${buildPackages.join(', ')}.\nDo you approve?`,
|
|
141
|
+
default: false,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
if (err instanceof Error && err.name === 'ExitPromptError') {
|
|
146
|
+
process.exit(0);
|
|
147
|
+
}
|
|
148
|
+
throw err;
|
|
149
|
+
}
|
|
150
|
+
if (!isConfirmed) {
|
|
154
151
|
return;
|
|
155
152
|
}
|
|
156
153
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/building.commands",
|
|
3
|
-
"version": "1100.0
|
|
3
|
+
"version": "1100.1.0",
|
|
4
4
|
"description": "Commands for rebuilding and managing dependency builds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -25,51 +25,51 @@
|
|
|
25
25
|
"!*.map"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@inquirer/prompts": "^8.4.3",
|
|
28
29
|
"@pnpm/util.lex-comparator": "^3.0.2",
|
|
29
|
-
"chalk": "^5.6.
|
|
30
|
-
"
|
|
31
|
-
"p-limit": "^7.1.0",
|
|
30
|
+
"chalk": "^5.6.2",
|
|
31
|
+
"p-limit": "^7.3.0",
|
|
32
32
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
33
33
|
"render-help": "^2.0.0",
|
|
34
|
+
"@pnpm/building.after-install": "1101.0.18",
|
|
34
35
|
"@pnpm/cli.command": "1100.0.1",
|
|
36
|
+
"@pnpm/cli.utils": "1101.0.8",
|
|
37
|
+
"@pnpm/config.reader": "1101.5.0",
|
|
38
|
+
"@pnpm/config.writer": "1100.0.10",
|
|
35
39
|
"@pnpm/cli.common-cli-options-help": "1100.0.1",
|
|
36
|
-
"@pnpm/building.after-install": "1101.0.16",
|
|
37
|
-
"@pnpm/cli.utils": "1101.0.7",
|
|
38
|
-
"@pnpm/config.writer": "1100.0.9",
|
|
39
|
-
"@pnpm/config.reader": "1101.4.0",
|
|
40
40
|
"@pnpm/error": "1100.0.0",
|
|
41
|
-
"@pnpm/deps.path": "1100.0.
|
|
42
|
-
"@pnpm/installing.
|
|
43
|
-
"@pnpm/store.connection-manager": "1100.2.3",
|
|
41
|
+
"@pnpm/deps.path": "1100.0.5",
|
|
42
|
+
"@pnpm/installing.modules-yaml": "1100.0.6",
|
|
44
43
|
"@pnpm/prepare-temp-dir": "1100.0.0",
|
|
45
|
-
"@pnpm/
|
|
46
|
-
"@pnpm/
|
|
47
|
-
"@pnpm/
|
|
44
|
+
"@pnpm/store.connection-manager": "1100.2.5",
|
|
45
|
+
"@pnpm/types": "1101.2.0",
|
|
46
|
+
"@pnpm/installing.commands": "1100.7.0",
|
|
47
|
+
"@pnpm/workspace.projects-sorter": "1100.0.4"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@pnpm/logger": "
|
|
50
|
+
"@pnpm/logger": "^1001.0.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@jest/globals": "30.3.0",
|
|
54
|
-
"@pnpm/registry-mock": "6.0.0",
|
|
55
54
|
"@types/ramda": "0.31.1",
|
|
56
55
|
"execa": "npm:safe-execa@0.3.0",
|
|
57
56
|
"load-json-file": "^7.0.1",
|
|
58
57
|
"read-yaml-file": "^3.0.0",
|
|
59
58
|
"write-package": "7.2.0",
|
|
60
59
|
"write-yaml-file": "^6.0.0",
|
|
61
|
-
"@pnpm/
|
|
62
|
-
"@pnpm/building.commands": "1100.0.22",
|
|
60
|
+
"@pnpm/building.commands": "1100.1.0",
|
|
63
61
|
"@pnpm/constants": "1100.0.0",
|
|
64
62
|
"@pnpm/crypto.object-hasher": "1100.0.0",
|
|
63
|
+
"@pnpm/assert-project": "1100.0.12",
|
|
65
64
|
"@pnpm/logger": "1100.0.0",
|
|
66
|
-
"@pnpm/prepare": "1100.0.10",
|
|
67
|
-
"@pnpm/store.cafs": "1100.1.6",
|
|
68
65
|
"@pnpm/store.index": "1100.1.0",
|
|
69
|
-
"@pnpm/test-fixtures": "1100.0.0",
|
|
70
66
|
"@pnpm/test-ipc-server": "1100.0.0",
|
|
71
|
-
"@pnpm/
|
|
72
|
-
"@pnpm/
|
|
67
|
+
"@pnpm/test-fixtures": "1100.0.0",
|
|
68
|
+
"@pnpm/testing.command-defaults": "1100.0.2",
|
|
69
|
+
"@pnpm/testing.registry-mock": "1100.0.2",
|
|
70
|
+
"@pnpm/prepare": "1100.0.12",
|
|
71
|
+
"@pnpm/store.cafs": "1100.1.7",
|
|
72
|
+
"@pnpm/workspace.projects-filter": "1100.0.17"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=22.13"
|