@netlify/build-info 6.1.1-rc → 6.1.2

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/bin.js CHANGED
File without changes
package/lib/context.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { PackageJson } from 'read-pkg';
2
- export declare type ContextOptions = {
2
+ export type ContextOptions = {
3
3
  projectDir?: string;
4
4
  rootDir?: string;
5
5
  };
6
- export declare type Context = {
6
+ export type Context = {
7
7
  projectDir: string;
8
8
  rootDir?: string;
9
9
  rootPackageJson: PackageJson;
@@ -1,4 +1,4 @@
1
- export declare type BuildSystem = {
1
+ export type BuildSystem = {
2
2
  name: string;
3
3
  version?: string | undefined;
4
4
  };
@@ -125,12 +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
- let pkgJson;
128
+ let pkgJson = {};
129
129
  try {
130
130
  pkgJson = JSON.parse(readFileSync(path.join(path.dirname(configPath), 'package.json'), 'utf-8'));
131
131
  }
132
132
  catch {
133
- pkgJson = JSON.parse('{}');
133
+ // noop
134
134
  }
135
135
  return pkgJson;
136
136
  };
@@ -3,7 +3,7 @@ export declare const enum PkgManager {
3
3
  PNPM = "pnpm",
4
4
  NPM = "npm"
5
5
  }
6
- export declare type PkgManagerFields = {
6
+ export type PkgManagerFields = {
7
7
  /** The package managers name that is used for logging */
8
8
  name: PkgManager;
9
9
  /** The package managers install command */
@@ -2,7 +2,7 @@ import { ContextOptions } from './context.js';
2
2
  import { BuildSystem } from './detect-build-system.js';
3
3
  import { PkgManagerFields } from './detect-package-manager.js';
4
4
  import { WorkspaceInfo } from './workspaces.js';
5
- export declare type Info = {
5
+ export type Info = {
6
6
  jsWorkspaces?: WorkspaceInfo;
7
7
  packageManager?: PkgManagerFields;
8
8
  frameworks: unknown[];
@@ -16,10 +16,15 @@ export const getBuildInfo = async (opts) => {
16
16
  // noop
17
17
  }
18
18
  const info = { frameworks };
19
+ try {
20
+ info.buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
21
+ }
22
+ catch (error) {
23
+ // noop
24
+ }
19
25
  // only if we find a root package.json we know this is a javascript workspace
20
26
  if (Object.keys(context.rootPackageJson).length > 0) {
21
27
  info.packageManager = await detectPackageManager(context.projectDir, context.rootDir);
22
- info.buildSystems = await detectBuildSystems(context.projectDir, context.rootDir);
23
28
  const workspaceInfo = await getWorkspaceInfo(info.packageManager, context);
24
29
  if (workspaceInfo) {
25
30
  info.jsWorkspaces = workspaceInfo;
@@ -1,7 +1,7 @@
1
1
  import { PackageJson } from 'read-pkg';
2
2
  import type { Context } from './context.js';
3
3
  import { PkgManagerFields } from './detect-package-manager.js';
4
- export declare type WorkspaceInfo = {
4
+ export type WorkspaceInfo = {
5
5
  /** if we are in the current workspace root or not */
6
6
  isRoot: boolean;
7
7
  /** the workspace root directory */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build-info",
3
- "version": "6.1.1-rc",
3
+ "version": "6.1.2",
4
4
  "description": "Build info utility",
5
5
  "type": "module",
6
6
  "exports": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "author": "Netlify Inc.",
32
32
  "dependencies": {
33
- "@netlify/framework-info": "^9.5.3",
33
+ "@netlify/framework-info": "^9.6.0",
34
34
  "@npmcli/map-workspaces": "^2.0.0",
35
35
  "find-up": "^6.3.0",
36
36
  "read-pkg": "^7.1.0",
@@ -51,5 +51,6 @@
51
51
  },
52
52
  "engines": {
53
53
  "node": "^14.16.0 || >=16.0.0"
54
- }
54
+ },
55
+ "gitHead": "393d364c081e1967c5dc3acfd2b1a9c865b5fdb9"
55
56
  }