@netlify/build-info
Advanced tools
Comparing version 7.11.3 to 8.0.0-rc.0
@@ -27,3 +27,3 @@ import { gte } from 'semver'; | ||
if (this.version && gte(this.version, '17.0.0-rc')) { | ||
this.plugins.push('@netlify/angular-runtime'); | ||
this.plugins.push({ name: '@netlify/angular-runtime' }); | ||
const angularJson = await this.project.fs.gracefullyReadFile('angular.json'); | ||
@@ -30,0 +30,0 @@ if (angularJson) { |
@@ -36,2 +36,8 @@ import type { PackageJson } from 'read-pkg'; | ||
export type FrameworkInfo = ReturnType<Framework['toJSON']>; | ||
export type BuildPlugin = { | ||
name: string; | ||
/** Plugins that should be always installed */ | ||
alwaysInstall?: boolean; | ||
source?: 'toml'; | ||
}; | ||
export interface Framework { | ||
@@ -64,3 +70,3 @@ project: Project; | ||
}; | ||
plugins: string[]; | ||
plugins: BuildPlugin[]; | ||
env: Record<string, string>; | ||
@@ -121,3 +127,3 @@ detect(): Promise<DetectedFramework | undefined>; | ||
excludedNpmDependencies: string[]; | ||
plugins: string[]; | ||
plugins: BuildPlugin[]; | ||
staticAssetsDirectory?: string; | ||
@@ -124,0 +130,0 @@ env: {}; |
@@ -233,3 +233,3 @@ import { coerce, parse } from 'semver'; | ||
: undefined, | ||
plugins: this.plugins, | ||
plugins: this.plugins.map(({ name }) => name), | ||
}; | ||
@@ -236,0 +236,0 @@ } |
@@ -39,3 +39,3 @@ import { gte } from 'semver'; | ||
if (nodeVersion && gte(nodeVersion, '12.13.0')) { | ||
this.plugins.push('@netlify/plugin-gatsby'); | ||
this.plugins.push({ name: '@netlify/plugin-gatsby' }); | ||
} | ||
@@ -42,0 +42,0 @@ return this; |
@@ -28,5 +28,13 @@ import { gte } from 'semver'; | ||
const nodeVersion = await this.project.getCurrentNodeVersion(); | ||
if (nodeVersion && gte(nodeVersion, '10.13.0')) { | ||
this.plugins.push('@netlify/plugin-nextjs'); | ||
const runtimeFromRollout = this.project.featureFlags['project_ceruledge_ui']; | ||
if (nodeVersion && | ||
gte(nodeVersion, '18.0.0') && | ||
this.detected.package?.version && | ||
gte(this.detected.package.version, '13.5.0') && | ||
typeof runtimeFromRollout === 'string') { | ||
this.plugins.push({ name: runtimeFromRollout ?? '@netlify/plugin-nextjs', alwaysInstall: true }); | ||
} | ||
else if (nodeVersion && gte(nodeVersion, '10.13.0')) { | ||
this.plugins.push({ name: '@netlify/plugin-nextjs', alwaysInstall: true }); | ||
} | ||
return this; | ||
@@ -33,0 +41,0 @@ } |
@@ -15,8 +15,5 @@ import { argv, exit } from 'process'; | ||
string: true, | ||
describe: 'comma separated list of feature flags', | ||
coerce: (value = '') => value | ||
.split(',') | ||
.map((flag) => flag.trim()) | ||
.filter((flag) => flag.length) | ||
.reduce((prev, cur) => ({ ...prev, [cur]: true }), {}), | ||
describe: 'JSON stringified list of feature flags with values', | ||
alias: 'ff', | ||
coerce: (value) => JSON.parse(value), | ||
}, | ||
@@ -27,3 +24,8 @@ }), async ({ projectDir, rootDir, featureFlags }) => { | ||
try { | ||
console.log(JSON.stringify(await getBuildInfo({ projectDir, rootDir, featureFlags, bugsnagClient }), | ||
console.log(JSON.stringify(await getBuildInfo({ | ||
projectDir, | ||
rootDir, | ||
featureFlags, | ||
bugsnagClient, | ||
}), | ||
// hide null values from the string output as we use null to identify it has already run but did not detect anything | ||
@@ -30,0 +32,0 @@ // undefined marks that it was never run |
@@ -32,4 +32,4 @@ import { Client } from '@bugsnag/js'; | ||
rootDir?: string; | ||
featureFlags?: Record<string, boolean>; | ||
featureFlags?: Record<string, boolean | number | string>; | ||
bugsnagClient?: Client; | ||
}): Promise<Info>; |
@@ -28,2 +28,3 @@ import { Project } from '../project.js'; | ||
.setBugsnag(config.bugsnagClient) | ||
.setFeatureFlags(config.featureFlags) | ||
.setEnvironment(process.env) | ||
@@ -30,0 +31,0 @@ .setNodeVersion(process.version); |
@@ -53,2 +53,4 @@ import type { Client, NotifiableError } from '@bugsnag/js'; | ||
logger: Logger; | ||
/** A list of enabled feature flags */ | ||
featureFlags: Record<string, boolean | number | string>; | ||
/** A function that is used to report errors */ | ||
@@ -60,2 +62,3 @@ reportFn: typeof report; | ||
setNodeVersion(version: string): this; | ||
setFeatureFlags(flags?: Record<string, boolean | number | string>): this; | ||
getCurrentNodeVersion(): Promise<SemVer | null>; | ||
@@ -62,0 +65,0 @@ isRedwoodProject(): Promise<boolean>; |
@@ -44,2 +44,4 @@ import { coerce, parse } from 'semver'; | ||
logger; | ||
/** A list of enabled feature flags */ | ||
featureFlags = {}; | ||
/** A function that is used to report errors */ | ||
@@ -54,2 +56,6 @@ reportFn = report; | ||
} | ||
setFeatureFlags(flags = {}) { | ||
this.featureFlags = { ...this.featureFlags, ...flags }; | ||
return this; | ||
} | ||
async getCurrentNodeVersion() { | ||
@@ -56,0 +62,0 @@ if (this._nodeVersion) { |
@@ -1,2 +0,2 @@ | ||
import { type Framework } from '../frameworks/framework.js'; | ||
import { BuildPlugin, type Framework } from '../frameworks/framework.js'; | ||
import { type Project } from '../project.js'; | ||
@@ -26,6 +26,4 @@ export type Settings = { | ||
env: Record<string, string | undefined>; | ||
/** Plugins installed via the netlify.toml */ | ||
plugins_from_config_file: string[]; | ||
/** Plugins that are detected via the framework detection and therefore recommended */ | ||
plugins_recommended: string[]; | ||
plugins: BuildPlugin[]; | ||
pollingStrategies: string[]; | ||
@@ -32,0 +30,0 @@ /** The baseDirectory for the UI to configure (used to run the command in this working directory) */ |
@@ -42,4 +42,3 @@ async function applyBuildSystemOverrides(settings, project, baseDirectory) { | ||
env: framework.env || {}, | ||
plugins_from_config_file: [], | ||
plugins_recommended: framework.plugins || [], | ||
plugins: framework.plugins || [], | ||
framework: { | ||
@@ -46,0 +45,0 @@ id: framework.id, |
@@ -20,3 +20,5 @@ import Bugsnag from '@bugsnag/js'; | ||
try { | ||
const settings = {}; | ||
const settings = { | ||
plugins: [], | ||
}; | ||
const { build, dev, functions, template, plugins } = gracefulParseToml(await fs.readFile(tomlFilePath)); | ||
@@ -27,5 +29,7 @@ settings.buildCommand = build?.command ?? settings.buildCommand; | ||
settings.frameworkPort = dev?.port ?? settings.frameworkPort; | ||
settings.plugins_from_config_file = plugins?.map((p) => p.package) ?? settings.plugins_from_config_file; | ||
settings.functionsDir = (build?.functions || functions?.directory) ?? settings.functionsDir; | ||
settings.template = template ?? settings.template; | ||
for (const plugin of plugins || []) { | ||
settings.plugins.push({ name: plugin.package, source: 'toml' }); | ||
} | ||
return settings; | ||
@@ -32,0 +36,0 @@ } |
{ | ||
"name": "@netlify/build-info", | ||
"version": "7.11.3", | ||
"version": "8.0.0-rc.0", | ||
"description": "Build info utility", | ||
@@ -75,4 +75,3 @@ "type": "module", | ||
"node": "^14.16.0 || >=16.0.0" | ||
}, | ||
"gitHead": "38149ec7d75e04570da65c58c42ed04f11698491" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315594
5785
286
2