@netlify/build-info 6.0.6 → 6.0.7
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/context.js +8 -1
- package/lib/get-build-info.js +11 -3
- package/package.json +2 -2
package/lib/context.js
CHANGED
|
@@ -29,7 +29,14 @@ export const getContext = async (config = {}) => {
|
|
|
29
29
|
// If rootDir equals projectDir we'll be getting the projectDir package.json
|
|
30
30
|
// Later on if we also need the projectDir package.json we can check for it
|
|
31
31
|
// and only perform one resolution
|
|
32
|
-
|
|
32
|
+
let rootPackageJson = {};
|
|
33
|
+
try {
|
|
34
|
+
rootPackageJson = await getRootPackageJson(absoluteProjectDir, validRootDir || absoluteProjectDir);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// gracefully handle un-parseable package.json files
|
|
38
|
+
//noop
|
|
39
|
+
}
|
|
33
40
|
return {
|
|
34
41
|
projectDir: absoluteProjectDir,
|
|
35
42
|
rootDir: validRootDir,
|
package/lib/get-build-info.js
CHANGED
|
@@ -4,9 +4,17 @@ import { detectPackageManager } from './detect-package-manager.js';
|
|
|
4
4
|
import { getWorkspaceInfo } from './workspaces.js';
|
|
5
5
|
export const getBuildInfo = async (opts) => {
|
|
6
6
|
const context = await getContext(opts);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
let frameworks = [];
|
|
8
|
+
try {
|
|
9
|
+
// if the framework detection is crashing we should not crash the build info and package-manager
|
|
10
|
+
// detection
|
|
11
|
+
frameworks = await listFrameworks({ projectDir: context.projectDir });
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// TODO: build reporting to buildbot see: https://github.com/netlify/pillar-workflow/issues/1001
|
|
15
|
+
// noop
|
|
16
|
+
}
|
|
17
|
+
const info = { frameworks };
|
|
10
18
|
// only if we find a root package.json we know this is a javascript workspace
|
|
11
19
|
if (Object.keys(context.rootPackageJson).length > 0) {
|
|
12
20
|
info.packageManager = await detectPackageManager(context.projectDir, context.rootDir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build-info",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "Build info utility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": "^14.16.0 || >=16.0.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ce45ef8b90bf083933edff661a2c1b4ff1cb2ac7"
|
|
56
56
|
}
|