package-build-stats 7.3.0 → 7.3.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/build/getPackageStats.js
CHANGED
|
@@ -74,19 +74,19 @@ async function getPackageStats(packageString, optionsRaw) {
|
|
|
74
74
|
if (options.debug) {
|
|
75
75
|
console.log('Install path:', installPath)
|
|
76
76
|
}
|
|
77
|
-
await installation_utils_1.default.installPackage(
|
|
78
|
-
packageString,
|
|
79
|
-
installPath,
|
|
80
|
-
{
|
|
81
|
-
isLocal,
|
|
82
|
-
client: options.client,
|
|
83
|
-
limitConcurrency: options.limitConcurrency,
|
|
84
|
-
networkConcurrency: options.networkConcurrency,
|
|
85
|
-
installTimeout: options.installTimeout,
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
const externals = common_utils_1.getExternals(packageName, installPath)
|
|
89
77
|
try {
|
|
78
|
+
await installation_utils_1.default.installPackage(
|
|
79
|
+
packageString,
|
|
80
|
+
installPath,
|
|
81
|
+
{
|
|
82
|
+
isLocal,
|
|
83
|
+
client: options.client,
|
|
84
|
+
limitConcurrency: options.limitConcurrency,
|
|
85
|
+
networkConcurrency: options.networkConcurrency,
|
|
86
|
+
installTimeout: options.installTimeout,
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
const externals = common_utils_1.getExternals(packageName, installPath)
|
|
90
90
|
const [pacakgeJSONDetails, builtDetails] = await Promise.all([
|
|
91
91
|
getPackageJSONDetails(packageName, installPath),
|
|
92
92
|
build_utils_1.default.buildPackageIgnoringMissingDeps({
|
|
@@ -30,9 +30,14 @@ function exec(command, options, timeout) {
|
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
if (timeout) {
|
|
33
|
-
setTimeout(() => {
|
|
33
|
+
timerId = setTimeout(() => {
|
|
34
34
|
process.kill(child.pid)
|
|
35
|
-
reject(
|
|
35
|
+
reject(
|
|
36
|
+
`Execution of ${command.substring(
|
|
37
|
+
0,
|
|
38
|
+
40
|
|
39
|
+
)}... cancelled as it exceeded a timeout of ${timeout} ms`
|
|
40
|
+
)
|
|
36
41
|
}, timeout)
|
|
37
42
|
}
|
|
38
43
|
})
|
package/package.json
CHANGED
package/src/getPackageStats.ts
CHANGED
|
@@ -66,17 +66,16 @@ export default async function getPackageStats(
|
|
|
66
66
|
if (options.debug) {
|
|
67
67
|
console.log('Install path:', installPath)
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
await InstallationUtils.installPackage(packageString, installPath, {
|
|
71
|
-
isLocal,
|
|
72
|
-
client: options.client,
|
|
73
|
-
limitConcurrency: options.limitConcurrency,
|
|
74
|
-
networkConcurrency: options.networkConcurrency,
|
|
75
|
-
installTimeout: options.installTimeout,
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const externals = getExternals(packageName, installPath)
|
|
79
69
|
try {
|
|
70
|
+
await InstallationUtils.installPackage(packageString, installPath, {
|
|
71
|
+
isLocal,
|
|
72
|
+
client: options.client,
|
|
73
|
+
limitConcurrency: options.limitConcurrency,
|
|
74
|
+
networkConcurrency: options.networkConcurrency,
|
|
75
|
+
installTimeout: options.installTimeout,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const externals = getExternals(packageName, installPath)
|
|
80
79
|
const [pacakgeJSONDetails, builtDetails] = await Promise.all([
|
|
81
80
|
getPackageJSONDetails(packageName, installPath),
|
|
82
81
|
BuildUtils.buildPackageIgnoringMissingDeps({
|
|
@@ -7,7 +7,7 @@ import os from 'os'
|
|
|
7
7
|
const homeDirectory = os.homedir()
|
|
8
8
|
|
|
9
9
|
export function exec(command: string, options: any, timeout?: number) {
|
|
10
|
-
let timerId:
|
|
10
|
+
let timerId: NodeJS.Timeout
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
12
|
const child = childProcess.exec(
|
|
13
13
|
command,
|
|
@@ -26,9 +26,14 @@ export function exec(command: string, options: any, timeout?: number) {
|
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
if (timeout) {
|
|
29
|
-
setTimeout(() => {
|
|
29
|
+
timerId = setTimeout(() => {
|
|
30
30
|
process.kill(child.pid)
|
|
31
|
-
reject(
|
|
31
|
+
reject(
|
|
32
|
+
`Execution of ${command.substring(
|
|
33
|
+
0,
|
|
34
|
+
40
|
|
35
|
+
)}... cancelled as it exceeded a timeout of ${timeout} ms`
|
|
36
|
+
)
|
|
32
37
|
}, timeout)
|
|
33
38
|
}
|
|
34
39
|
})
|