@netlify/build 28.0.1 → 28.1.0-framework-version-detection

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.
@@ -1,9 +1,10 @@
1
+ import { getBuildInfo } from '@netlify/build-info';
1
2
  import { resolveConfig, updateConfig, restoreConfig } from '@netlify/config';
2
3
  import mapObj from 'map-obj';
3
4
  import { getChildEnv } from '../env/main.js';
4
5
  import { addApiErrorHandlers } from '../error/api.js';
5
6
  import { changeErrorType } from '../error/info.js';
6
- import { logBuildDir, logConfigPath, logConfig, logContext } from '../log/messages/config.js';
7
+ import { logBuildDir, logConfigPath, logConfig, logContext, logFrameworkVersion } from '../log/messages/config.js';
7
8
  import { logConfigOnUpload, logHeadersOnUpload, logRedirectsOnUpload } from '../log/messages/mutations.js';
8
9
  import { measureDuration } from '../time/main.js';
9
10
  import { getPackageJson } from '../utils/package.js';
@@ -39,7 +40,9 @@ export const getConfigOpts = function ({ config, defaultConfig, cwd, repositoryR
39
40
  // Retrieve configuration object
40
41
  const tLoadConfig = async function ({ configOpts, cachedConfig, cachedConfigPath, envOpt, debug, logs, nodePath }) {
41
42
  const { configPath, headersPath, redirectsPath, buildDir, repositoryRoot, config: netlifyConfig, context: contextA, branch: branchA, token: tokenA, api, siteInfo, env, } = await resolveInitialConfig(configOpts, cachedConfig, cachedConfigPath);
42
- logConfigInfo({ logs, configPath, buildDir, netlifyConfig, context: contextA, debug });
43
+ const buildInfo = await getBuildInfo({ projectDir: buildDir });
44
+ const frameworkInfo = buildInfo.frameworks;
45
+ logConfigInfo({ logs, configPath, buildDir, netlifyConfig, context: contextA, debug, frameworkInfo });
43
46
  const apiA = addApiErrorHandlers(api);
44
47
  const envValues = mapObj(env, (key, { value }) => [key, value]);
45
48
  const childEnv = getChildEnv({ envOpt, env: envValues });
@@ -68,11 +71,12 @@ export const loadConfig = measureDuration(tLoadConfig, 'resolve_config');
68
71
  const resolveInitialConfig = async function (configOpts, cachedConfig, cachedConfigPath) {
69
72
  return await resolveConfig({ ...configOpts, cachedConfig, cachedConfigPath });
70
73
  };
71
- const logConfigInfo = function ({ logs, configPath, buildDir, netlifyConfig, context, debug }) {
74
+ const logConfigInfo = function ({ logs, configPath, buildDir, netlifyConfig, context, debug, frameworkInfo }) {
72
75
  logBuildDir(logs, buildDir);
73
76
  logConfigPath(logs, configPath);
74
77
  logConfig({ logs, netlifyConfig, debug });
75
78
  logContext(logs, context);
79
+ logFrameworkVersion(logs, frameworkInfo);
76
80
  };
77
81
  // Retrieve the configuration after it's been changed.
78
82
  // This ensures any configuration changes done by plugins is validated and
@@ -56,6 +56,13 @@ export const logBuildDir = function (logs, buildDir) {
56
56
  logSubHeader(logs, 'Current directory');
57
57
  logMessage(logs, buildDir);
58
58
  };
59
+ export const logFrameworkVersion = function (logs, frameworkInfo = []) {
60
+ if (frameworkInfo.length > 0)
61
+ logSubHeader(logs, 'Detected the following installed frameworks and their versions');
62
+ frameworkInfo.forEach((framework) => {
63
+ logMessage(logs, `${framework.id}@${framework.package.version}`);
64
+ });
65
+ };
59
66
  export const logConfigPath = function (logs, configPath = NO_CONFIG_MESSAGE) {
60
67
  logSubHeader(logs, 'Config file');
61
68
  logMessage(logs, configPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "28.0.1",
3
+ "version": "28.1.0-framework-version-detection",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/core/main.js",
@@ -64,6 +64,7 @@
64
64
  "license": "MIT",
65
65
  "dependencies": {
66
66
  "@bugsnag/js": "^7.0.0",
67
+ "@netlify/build-info": "5.2.0-framework-version-detection",
67
68
  "@netlify/cache-utils": "^5.0.1",
68
69
  "@netlify/config": "^19.0.1",
69
70
  "@netlify/edge-bundler": "^2.8.0",
@@ -149,6 +150,5 @@
149
150
  "compilerOptions": {
150
151
  "module": "commonjs"
151
152
  }
152
- },
153
- "gitHead": "701e883d4e19c048e8de9801e49e21de5c891a18"
153
+ }
154
154
  }