@netlify/build-info 6.1.0 → 6.1.1

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.
@@ -125,5 +125,12 @@ const lookFor = (configFile, baseDir, rootDir, type) => {
125
125
  return findUpSync(configFile, { cwd: baseDir, stopAt: rootDir, type: type });
126
126
  };
127
127
  const getPkgJson = (configPath) => {
128
- return JSON.parse(readFileSync(path.join(path.dirname(configPath), 'package.json'), 'utf-8'));
128
+ let pkgJson = {};
129
+ try {
130
+ pkgJson = JSON.parse(readFileSync(path.join(path.dirname(configPath), 'package.json'), 'utf-8'));
131
+ }
132
+ catch {
133
+ // noop
134
+ }
135
+ return pkgJson;
129
136
  };
@@ -6,18 +6,22 @@ import { getWorkspaceInfo } from './workspaces.js';
6
6
  export const getBuildInfo = async (opts) => {
7
7
  const context = await getContext(opts);
8
8
  let frameworks = [];
9
- let buildSystems = [];
10
9
  try {
11
- // if the framework or buildSystem detection is crashing we should not crash the build info and package-manager
10
+ // if the framework detection is crashing we should not crash the build info and package-manager
12
11
  // detection
13
12
  frameworks = await listFrameworks({ projectDir: context.projectDir });
14
- buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
15
13
  }
16
14
  catch {
17
15
  // TODO: build reporting to buildbot see: https://github.com/netlify/pillar-workflow/issues/1001
18
16
  // noop
19
17
  }
20
- const info = { frameworks, buildSystems };
18
+ const info = { frameworks };
19
+ try {
20
+ info.buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
21
+ }
22
+ catch (error) {
23
+ // noop
24
+ }
21
25
  // only if we find a root package.json we know this is a javascript workspace
22
26
  if (Object.keys(context.rootPackageJson).length > 0) {
23
27
  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.1.0",
3
+ "version": "6.1.1",
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": "e22d6106d734d2b4b7b49d2a2350be21913c0cbf"
55
+ "gitHead": "d73939073c53d2c725f7bf7f89d2b68d3d372e32"
56
56
  }