@util.js/node-lerna 0.41.3 → 0.41.5
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 +0 -1
- package/lib/LernaUtils.js +15 -11
- package/package.json +6 -7
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/@util.js/node-lerna"><img alt="NPM Status" src="https://img.shields.io/npm/v/@util.js/node-lerna.svg?style=flat"></a>
|
|
7
|
-
<a href="https://travis-ci.org/creemama/utiljs"><img alt="Travis CI Build Status" src="https://img.shields.io/travis/creemama/utiljs/master.svg?style=flat-square&label=Travis+CI"></a>
|
|
8
7
|
</p>
|
|
9
8
|
|
|
10
9
|
@util.js/node-lerna is part of [Util.js](https://github.com/creemama/utiljs).
|
package/lib/LernaUtils.js
CHANGED
|
@@ -37,7 +37,7 @@ async function internalAudit(thiz, packagesDir) {
|
|
|
37
37
|
const { stdout, stderr } = await thiz.promises.promisify(execute)(
|
|
38
38
|
thiz,
|
|
39
39
|
"npm audit",
|
|
40
|
-
{ cwd: `${packagesDir}/..` }
|
|
40
|
+
{ cwd: `${packagesDir}/..` },
|
|
41
41
|
);
|
|
42
42
|
thiz.console.log(stdout);
|
|
43
43
|
if (stderr) thiz.console.error(stdout);
|
|
@@ -58,21 +58,25 @@ async function internalAudit(thiz, packagesDir) {
|
|
|
58
58
|
thiz.console.log(`Skipping ${packageDir} ...`);
|
|
59
59
|
errorCode = handleError(thiz, error, packageDir);
|
|
60
60
|
return null;
|
|
61
|
-
})
|
|
61
|
+
}),
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
packageDescriptors = (await thiz.promises.all(packageDescriptors)).filter(
|
|
65
|
-
(packageDesc) => packageDesc != null
|
|
65
|
+
(packageDesc) => packageDesc != null,
|
|
66
66
|
);
|
|
67
67
|
|
|
68
68
|
const packages = packageDescriptors.map(
|
|
69
|
-
(packageDescriptor) => packageDescriptor.packageObj.name
|
|
69
|
+
(packageDescriptor) => packageDescriptor.packageObj.name,
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
for (let i = 0; i < packageDescriptors.length; i++) {
|
|
73
73
|
await processPackage(thiz, packageDescriptors[i], packages).catch(
|
|
74
74
|
(error) =>
|
|
75
|
-
(errorCode = handleError(
|
|
75
|
+
(errorCode = handleError(
|
|
76
|
+
thiz,
|
|
77
|
+
error,
|
|
78
|
+
packageDescriptors[i].packageDir,
|
|
79
|
+
)),
|
|
76
80
|
);
|
|
77
81
|
}
|
|
78
82
|
|
|
@@ -82,11 +86,11 @@ async function internalAudit(thiz, packagesDir) {
|
|
|
82
86
|
async function describePackage(thiz, packageDir) {
|
|
83
87
|
const packageJson = await thiz.files.readFile(
|
|
84
88
|
`${packageDir}/package.json`,
|
|
85
|
-
"utf8"
|
|
89
|
+
"utf8",
|
|
86
90
|
);
|
|
87
91
|
const packageLockJson = await thiz.files.readFile(
|
|
88
92
|
`${packageDir}/package-lock.json`,
|
|
89
|
-
"utf8"
|
|
93
|
+
"utf8",
|
|
90
94
|
);
|
|
91
95
|
const packageObj = thiz.json.parse(packageJson);
|
|
92
96
|
const packageLockObj = thiz.json.parse(packageLockJson);
|
|
@@ -137,12 +141,12 @@ async function processPackage(thiz, packageDescriptor, packages) {
|
|
|
137
141
|
if (packageFound) {
|
|
138
142
|
await thiz.files.copyFile(
|
|
139
143
|
`${packageDir}/package-lock.json`,
|
|
140
|
-
`${packageDir}/package-lock.json.bak
|
|
144
|
+
`${packageDir}/package-lock.json.bak`,
|
|
141
145
|
);
|
|
142
146
|
await thiz.files.writeFile(
|
|
143
147
|
`${packageDir}/package-lock.json`,
|
|
144
148
|
thiz.json.stringify(packageLockObj, null, "\t"),
|
|
145
|
-
"utf8"
|
|
149
|
+
"utf8",
|
|
146
150
|
);
|
|
147
151
|
}
|
|
148
152
|
|
|
@@ -151,7 +155,7 @@ async function processPackage(thiz, packageDescriptor, packages) {
|
|
|
151
155
|
const { stdout, stderr } = await thiz.promises.promisify(execute)(
|
|
152
156
|
thiz,
|
|
153
157
|
"npm audit",
|
|
154
|
-
{ cwd: packageDir }
|
|
158
|
+
{ cwd: packageDir },
|
|
155
159
|
);
|
|
156
160
|
thiz.console.log(stdout);
|
|
157
161
|
if (stderr) thiz.console.error(stdout);
|
|
@@ -160,7 +164,7 @@ async function processPackage(thiz, packageDescriptor, packages) {
|
|
|
160
164
|
if (packageFound) {
|
|
161
165
|
await thiz.files.copyFile(
|
|
162
166
|
`${packageDir}/package-lock.json.bak`,
|
|
163
|
-
`${packageDir}/package-lock.json
|
|
167
|
+
`${packageDir}/package-lock.json`,
|
|
164
168
|
);
|
|
165
169
|
await thiz.files.rmrf(`${packageDir}/package-lock.json.bak`);
|
|
166
170
|
}
|
package/package.json
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"utiljs-lerna-audit": "./cli.js"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@util.js/node-files": "0.41.
|
|
8
|
-
"@util.js/numbers": "0.41.
|
|
9
|
-
"@util.js/objects": "0.41.
|
|
10
|
-
"@util.js/privates": "0.41.
|
|
11
|
-
"@util.js/promises": "0.41.
|
|
7
|
+
"@util.js/node-files": "0.41.5",
|
|
8
|
+
"@util.js/numbers": "0.41.5",
|
|
9
|
+
"@util.js/objects": "0.41.5",
|
|
10
|
+
"@util.js/privates": "0.41.5",
|
|
11
|
+
"@util.js/promises": "0.41.5"
|
|
12
12
|
},
|
|
13
13
|
"description": "JavaScript utility methods for Lerna",
|
|
14
14
|
"keywords": [
|
|
@@ -30,6 +30,5 @@
|
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "https://github.com/creemama/utiljs/tree/master/packages/utiljs-node-lerna"
|
|
32
32
|
},
|
|
33
|
-
"version": "0.41.
|
|
34
|
-
"gitHead": "e17139b7f85c3abec178d8facdacc2aa6c5bb553"
|
|
33
|
+
"version": "0.41.5"
|
|
35
34
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright 2018 Chris Topher (c@creemama.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
-
so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|