@netlify/build-info 6.3.1 → 6.4.0

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/node/bin.js CHANGED
@@ -8,9 +8,18 @@ yargs(hideBin(argv))
8
8
  string: true,
9
9
  describe: `The root directory of the project if different from projectDir`,
10
10
  },
11
- }), async ({ projectDir, rootDir }) => {
11
+ featureFlags: {
12
+ string: true,
13
+ describe: 'comma separated list of feature flags',
14
+ coerce: (value = '') => value
15
+ .split(',')
16
+ .map((flag) => flag.trim())
17
+ .filter((flag) => flag.length)
18
+ .reduce((prev, cur) => ({ ...prev, [cur]: true }), {}),
19
+ },
20
+ }), async ({ projectDir, rootDir, featureFlags }) => {
12
21
  try {
13
- console.log(JSON.stringify(await getBuildInfo(projectDir, rootDir), null, 2));
22
+ console.log(JSON.stringify(await getBuildInfo({ projectDir, rootDir, featureFlags }), null, 2));
14
23
  }
15
24
  catch (error) {
16
25
  console.error(error);
@@ -17,4 +17,8 @@ export declare class NoopLogger implements Logger {
17
17
  error(): void;
18
18
  }
19
19
  /** Get the build info object that is used inside buildbot */
20
- export declare function getBuildInfo(projectDir?: string, rootDir?: string): Promise<Info>;
20
+ export declare function getBuildInfo(config?: {
21
+ projectDir?: string;
22
+ rootDir?: string;
23
+ featureFlags?: Record<string, boolean>;
24
+ }): Promise<Info>;
@@ -14,11 +14,11 @@ export class NoopLogger {
14
14
  }
15
15
  }
16
16
  /** Get the build info object that is used inside buildbot */
17
- export async function getBuildInfo(projectDir, rootDir) {
17
+ export async function getBuildInfo(config = { featureFlags: {} }) {
18
18
  const fs = new NodeFS();
19
19
  // prevent logging in output as we use the stdout to capture the json
20
20
  fs.logger = new NoopLogger();
21
- const project = new Project(fs, projectDir, rootDir);
21
+ const project = new Project(fs, config.projectDir, config.rootDir);
22
22
  project.setEnvironment(process.env);
23
23
  let frameworks = [];
24
24
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build-info",
3
- "version": "6.3.1",
3
+ "version": "6.4.0",
4
4
  "description": "Build info utility",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "author": "Netlify Inc.",
38
38
  "dependencies": {
39
- "@netlify/framework-info": "^9.8.3",
39
+ "@netlify/framework-info": "^9.8.4",
40
40
  "find-up": "^6.3.0",
41
41
  "minimatch": "^6.2.0",
42
42
  "read-pkg": "^7.1.0",
@@ -61,5 +61,5 @@
61
61
  "engines": {
62
62
  "node": "^14.16.0 || >=16.0.0"
63
63
  },
64
- "gitHead": "a58be2a61fb699c450457b38c11275550855db8b"
64
+ "gitHead": "9e76bdc5f3578448583d28a2d96459d4f0a51a12"
65
65
  }