@pnpm/exec.build-commands 1000.1.1 → 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 +31 -16
- package/lib/approveBuilds.js.map +1 -1
- package/package.json +10 -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
|
@@ -15,6 +15,7 @@ const render_help_1 = __importDefault(require("render-help"));
|
|
|
15
15
|
const enquirer_1 = require("enquirer");
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
17
|
const plugin_commands_rebuild_1 = require("@pnpm/plugin-commands-rebuild");
|
|
18
|
+
const workspace_manifest_writer_1 = require("@pnpm/workspace.manifest-writer");
|
|
18
19
|
const getAutomaticallyIgnoredBuilds_1 = require("./getAutomaticallyIgnoredBuilds");
|
|
19
20
|
exports.commandNames = ['approve-builds'];
|
|
20
21
|
function help() {
|
|
@@ -88,30 +89,26 @@ async function handler(opts) {
|
|
|
88
89
|
}); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
89
90
|
const buildPackages = result.map(({ value }) => value);
|
|
90
91
|
const ignoredPackages = automaticallyIgnoredBuilds.filter((automaticallyIgnoredBuild) => !buildPackages.includes(automaticallyIgnoredBuild));
|
|
92
|
+
let updatedIgnoredBuiltDependencies;
|
|
91
93
|
if (ignoredPackages.length) {
|
|
92
|
-
if (opts.
|
|
93
|
-
|
|
94
|
-
...opts.rootProjectManifest.pnpm,
|
|
95
|
-
ignoredBuiltDependencies: sortUniqueStrings(ignoredPackages),
|
|
96
|
-
};
|
|
94
|
+
if (opts.ignoredBuiltDependencies == null) {
|
|
95
|
+
updatedIgnoredBuiltDependencies = sortUniqueStrings(ignoredPackages);
|
|
97
96
|
}
|
|
98
97
|
else {
|
|
99
|
-
|
|
100
|
-
...opts.
|
|
98
|
+
updatedIgnoredBuiltDependencies = sortUniqueStrings([
|
|
99
|
+
...opts.ignoredBuiltDependencies,
|
|
101
100
|
...ignoredPackages,
|
|
102
101
|
]);
|
|
103
102
|
}
|
|
104
103
|
}
|
|
104
|
+
let updatedOnlyBuiltDependencies;
|
|
105
105
|
if (buildPackages.length) {
|
|
106
|
-
if (opts.
|
|
107
|
-
|
|
108
|
-
...opts.rootProjectManifest.pnpm,
|
|
109
|
-
onlyBuiltDependencies: sortUniqueStrings(buildPackages),
|
|
110
|
-
};
|
|
106
|
+
if (opts.onlyBuiltDependencies == null) {
|
|
107
|
+
updatedOnlyBuiltDependencies = sortUniqueStrings(buildPackages);
|
|
111
108
|
}
|
|
112
109
|
else {
|
|
113
|
-
|
|
114
|
-
...opts.
|
|
110
|
+
updatedOnlyBuiltDependencies = sortUniqueStrings([
|
|
111
|
+
...opts.onlyBuiltDependencies,
|
|
115
112
|
...buildPackages,
|
|
116
113
|
]);
|
|
117
114
|
}
|
|
@@ -129,9 +126,27 @@ Do you approve?`,
|
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
128
|
const { writeProjectManifest } = await (0, read_project_manifest_1.readProjectManifest)(opts.rootProjectManifestDir);
|
|
132
|
-
|
|
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
|
+
}
|
|
133
145
|
if (buildPackages.length) {
|
|
134
|
-
return plugin_commands_rebuild_1.rebuild.handler(
|
|
146
|
+
return plugin_commands_rebuild_1.rebuild.handler({
|
|
147
|
+
...opts,
|
|
148
|
+
onlyBuiltDependencies: updatedOnlyBuiltDependencies,
|
|
149
|
+
}, buildPackages);
|
|
135
150
|
}
|
|
136
151
|
}
|
|
137
152
|
function sortUniqueStrings(array) {
|
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;A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AoB,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,22 +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/types": "1000.1.1"
|
|
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": {
|
|
37
36
|
"@pnpm/util.lex-comparator": "3.0.0",
|
|
38
37
|
"chalk": "^4.1.2",
|
|
39
38
|
"enquirer": "^2.4.1",
|
|
40
39
|
"render-help": "^1.0.3",
|
|
41
|
-
"@pnpm/config": "1002.
|
|
42
|
-
"@pnpm/
|
|
43
|
-
"@pnpm/plugin-commands-rebuild": "1001.1.8",
|
|
40
|
+
"@pnpm/config": "1002.4.0",
|
|
41
|
+
"@pnpm/plugin-commands-rebuild": "1002.0.0",
|
|
44
42
|
"@pnpm/prepare-temp-dir": "0.0.0",
|
|
45
|
-
"@pnpm/
|
|
43
|
+
"@pnpm/modules-yaml": "1000.1.3",
|
|
44
|
+
"@pnpm/read-project-manifest": "1000.0.6",
|
|
45
|
+
"@pnpm/workspace.manifest-writer": "1000.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@pnpm/logger": ">=5.1.0 <1001.0.0"
|