@pnpm/exec.build-commands 1000.1.0 → 1001.0.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/approveBuilds.d.ts +1 -1
- package/lib/approveBuilds.js +33 -17
- package/lib/approveBuilds.js.map +1 -1
- package/package.json +11 -10
package/lib/approveBuilds.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Config } from '@pnpm/config';
|
|
2
2
|
import { type RebuildCommandOpts } from '@pnpm/plugin-commands-rebuild';
|
|
3
|
-
export type ApproveBuildsCommandOpts = Pick<Config, 'modulesDir' | 'dir' | 'rootProjectManifest' | 'rootProjectManifestDir'>;
|
|
3
|
+
export type ApproveBuildsCommandOpts = Pick<Config, 'modulesDir' | 'dir' | 'rootProjectManifest' | 'rootProjectManifestDir' | 'onlyBuiltDependencies' | 'ignoredBuiltDependencies'>;
|
|
4
4
|
export declare const commandNames: string[];
|
|
5
5
|
export declare function help(): string;
|
|
6
6
|
export declare function cliOptionsTypes(): Record<string, unknown>;
|
package/lib/approveBuilds.js
CHANGED
|
@@ -10,10 +10,12 @@ exports.rcOptionsTypes = rcOptionsTypes;
|
|
|
10
10
|
exports.handler = handler;
|
|
11
11
|
const logger_1 = require("@pnpm/logger");
|
|
12
12
|
const read_project_manifest_1 = require("@pnpm/read-project-manifest");
|
|
13
|
+
const util_lex_comparator_1 = require("@pnpm/util.lex-comparator");
|
|
13
14
|
const render_help_1 = __importDefault(require("render-help"));
|
|
14
15
|
const enquirer_1 = require("enquirer");
|
|
15
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
16
17
|
const plugin_commands_rebuild_1 = require("@pnpm/plugin-commands-rebuild");
|
|
18
|
+
const workspace_manifest_writer_1 = require("@pnpm/workspace.manifest-writer");
|
|
17
19
|
const getAutomaticallyIgnoredBuilds_1 = require("./getAutomaticallyIgnoredBuilds");
|
|
18
20
|
exports.commandNames = ['approve-builds'];
|
|
19
21
|
function help() {
|
|
@@ -87,30 +89,26 @@ async function handler(opts) {
|
|
|
87
89
|
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
88
90
|
const buildPackages = result.map(({ value }) => value);
|
|
89
91
|
const ignoredPackages = automaticallyIgnoredBuilds.filter((automaticallyIgnoredBuild) => !buildPackages.includes(automaticallyIgnoredBuild));
|
|
92
|
+
let updatedIgnoredBuiltDependencies;
|
|
90
93
|
if (ignoredPackages.length) {
|
|
91
|
-
if (opts.
|
|
92
|
-
|
|
93
|
-
...opts.rootProjectManifest.pnpm,
|
|
94
|
-
ignoredBuiltDependencies: sortUniqueStrings(ignoredPackages),
|
|
95
|
-
};
|
|
94
|
+
if (opts.ignoredBuiltDependencies == null) {
|
|
95
|
+
updatedIgnoredBuiltDependencies = sortUniqueStrings(ignoredPackages);
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
|
-
|
|
99
|
-
...opts.
|
|
98
|
+
updatedIgnoredBuiltDependencies = sortUniqueStrings([
|
|
99
|
+
...opts.ignoredBuiltDependencies,
|
|
100
100
|
...ignoredPackages,
|
|
101
101
|
]);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
let updatedOnlyBuiltDependencies;
|
|
104
105
|
if (buildPackages.length) {
|
|
105
|
-
if (opts.
|
|
106
|
-
|
|
107
|
-
...opts.rootProjectManifest.pnpm,
|
|
108
|
-
onlyBuiltDependencies: sortUniqueStrings(buildPackages),
|
|
109
|
-
};
|
|
106
|
+
if (opts.onlyBuiltDependencies == null) {
|
|
107
|
+
updatedOnlyBuiltDependencies = sortUniqueStrings(buildPackages);
|
|
110
108
|
}
|
|
111
109
|
else {
|
|
112
|
-
|
|
113
|
-
...opts.
|
|
110
|
+
updatedOnlyBuiltDependencies = sortUniqueStrings([
|
|
111
|
+
...opts.onlyBuiltDependencies,
|
|
114
112
|
...buildPackages,
|
|
115
113
|
]);
|
|
116
114
|
}
|
|
@@ -128,12 +126,30 @@ Do you approve?`,
|
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
const { writeProjectManifest } = await (0, read_project_manifest_1.readProjectManifest)(opts.rootProjectManifestDir);
|
|
131
|
-
|
|
129
|
+
if (opts.rootProjectManifest.pnpm?.ignoredBuiltDependencies != null || opts.rootProjectManifest.pnpm?.onlyBuiltDependencies != null || opts.workspaceDir == null) {
|
|
130
|
+
opts.rootProjectManifest.pnpm = opts.rootProjectManifest.pnpm ?? {};
|
|
131
|
+
if (updatedOnlyBuiltDependencies) {
|
|
132
|
+
opts.rootProjectManifest.pnpm.onlyBuiltDependencies = updatedOnlyBuiltDependencies;
|
|
133
|
+
}
|
|
134
|
+
if (updatedIgnoredBuiltDependencies) {
|
|
135
|
+
opts.rootProjectManifest.pnpm.ignoredBuiltDependencies = updatedIgnoredBuiltDependencies;
|
|
136
|
+
}
|
|
137
|
+
await writeProjectManifest(opts.rootProjectManifest);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
await (0, workspace_manifest_writer_1.updateWorkspaceManifest)(opts.workspaceDir, {
|
|
141
|
+
onlyBuiltDependencies: updatedOnlyBuiltDependencies,
|
|
142
|
+
ignoredBuiltDependencies: updatedIgnoredBuiltDependencies,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
132
145
|
if (buildPackages.length) {
|
|
133
|
-
return plugin_commands_rebuild_1.rebuild.handler(
|
|
146
|
+
return plugin_commands_rebuild_1.rebuild.handler({
|
|
147
|
+
...opts,
|
|
148
|
+
onlyBuiltDependencies: updatedOnlyBuiltDependencies,
|
|
149
|
+
}, buildPackages);
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
152
|
function sortUniqueStrings(array) {
|
|
137
|
-
return Array.from(new Set(array)).sort(
|
|
153
|
+
return Array.from(new Set(array)).sort(util_lex_comparator_1.lexCompare);
|
|
138
154
|
}
|
|
139
155
|
//# sourceMappingURL=approveBuilds.js.map
|
package/lib/approveBuilds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approveBuilds.js","sourceRoot":"","sources":["../src/approveBuilds.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"approveBuilds.js","sourceRoot":"","sources":["../src/approveBuilds.ts"],"names":[],"mappings":";;;;;;AAeA,oBAkBC;AAED,0CAIC;AAED,wCAEC;AAED,0BAqGC;AAjJD,yCAAyC;AACzC,uEAAiE;AACjE,mEAAsD;AACtD,8DAAoC;AACpC,uCAAiC;AACjC,kDAAyB;AACzB,2EAAgF;AAChF,+EAAyE;AACzE,mFAA+E;AAIlE,QAAA,YAAY,GAAG,CAAC,gBAAgB,CAAC,CAAA;AAE9C,SAAgB,IAAI;IAClB,OAAO,IAAA,qBAAU,EAAC;QAChB,WAAW,EAAE,8DAA8D;QAC3E,MAAM,EAAE,EAAE;QACV,gBAAgB,EAAE;YAChB;gBACE,KAAK,EAAE,SAAS;gBAEhB,IAAI,EAAE;oBACJ;wBACE,WAAW,EAAE,yCAAyC;wBACtD,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE,IAAI;qBACjB;iBACF;aACF;SACF;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,eAAe;IAC7B,OAAO;QACL,MAAM,EAAE,OAAO;KAChB,CAAA;AACH,CAAC;AAED,SAAgB,cAAc;IAC5B,OAAO,EAAE,CAAA;AACX,CAAC;AAEM,KAAK,UAAU,OAAO,CAAE,IAAmD;IAChF,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI;QAAE,OAAM;IAC5C,MAAM,0BAA0B,GAAG,MAAM,IAAA,6DAA6B,EAAC,IAAI,CAAC,CAAA;IAC5E,IAAI,CAAC,0BAA0B,EAAE,MAAM,EAAE,CAAC;QACxC,IAAA,mBAAU,EAAC,yCAAyC,CAAC,CAAA;QACrD,OAAM;IACR,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,iBAAM,EAAC;QAC9B,OAAO,EAAE,iBAAiB,CAAC,CAAC,GAAG,0BAA0B,CAAC,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,CAAC,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,IAAI,EAAE,CAAA;QACnE,IAAI,4BAA4B,EAAE,CAAC;YACjC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,qBAAqB,GAAG,4BAA4B,CAAA;QACpF,CAAC;QACD,IAAI,+BAA+B,EAAE,CAAC;YACpC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,wBAAwB,GAAG,+BAA+B,CAAA;QAC1F,CAAC;QACD,MAAM,oBAAoB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;IACtD,CAAC;SAAM,CAAC;QACN,MAAM,IAAA,mDAAuB,EAAC,IAAI,CAAC,YAAY,EAAE;YAC/C,qBAAqB,EAAE,4BAA4B;YACnD,wBAAwB,EAAE,+BAA+B;SAC1D,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,OAAO,iCAAO,CAAC,OAAO,CAAC;YACrB,GAAG,IAAI;YACP,qBAAqB,EAAE,4BAA4B;SACpD,EAAE,aAAa,CAAC,CAAA;IACnB,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAE,KAAe;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,gCAAU,CAAC,CAAA;AACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/exec.build-commands",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1001.0.0",
|
|
4
4
|
"description": "Commands for managing dependency builds",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,21 +27,22 @@
|
|
|
27
27
|
"@types/ramda": "0.29.12",
|
|
28
28
|
"load-json-file": "^6.2.0",
|
|
29
29
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
30
|
-
"@pnpm/
|
|
31
|
-
"@pnpm/
|
|
32
|
-
"@pnpm/
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/exec.build-commands": "1000.1.0"
|
|
30
|
+
"@pnpm/exec.build-commands": "1001.0.0",
|
|
31
|
+
"@pnpm/prepare": "0.0.112",
|
|
32
|
+
"@pnpm/types": "1000.2.0",
|
|
33
|
+
"@pnpm/plugin-commands-installation": "1002.0.0"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
36
|
+
"@pnpm/util.lex-comparator": "3.0.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"enquirer": "^2.4.1",
|
|
39
39
|
"render-help": "^1.0.3",
|
|
40
|
-
"@pnpm/config": "1002.
|
|
41
|
-
"@pnpm/
|
|
42
|
-
"@pnpm/plugin-commands-rebuild": "1001.1.7",
|
|
40
|
+
"@pnpm/config": "1002.4.0",
|
|
41
|
+
"@pnpm/plugin-commands-rebuild": "1002.0.0",
|
|
43
42
|
"@pnpm/prepare-temp-dir": "0.0.0",
|
|
44
|
-
"@pnpm/
|
|
43
|
+
"@pnpm/modules-yaml": "1000.1.3",
|
|
44
|
+
"@pnpm/read-project-manifest": "1000.0.6",
|
|
45
|
+
"@pnpm/workspace.manifest-writer": "1000.0.0"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"@pnpm/logger": ">=5.1.0 <1001.0.0"
|