Skip to content

Commit

Permalink
fix(deps): update dependency @netlify/framework-info to v9 (#4092)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @netlify/framework-info to v9

* chore: fix `@netlify/framework-info` new version

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ehmicky <ehmicky@gmail.com>
  • Loading branch information
3 people authored Jan 19, 2022
1 parent 318c370 commit 3ef3d3c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"dependencies": {
"@netlify/build": "^26.1.7",
"@netlify/config": "^17.0.3",
"@netlify/framework-info": "^8.0.2",
"@netlify/framework-info": "^9.0.0",
"@netlify/local-functions-proxy": "^1.1.1",
"@netlify/plugin-edge-handlers": "^3.0.4",
"@netlify/plugins-list": "^6.3.0",
Expand Down
4 changes: 3 additions & 1 deletion src/utils/detect-server-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { EOL } = require('os')
const path = require('path')
const process = require('process')

const { getFramework, listFrameworks } = require('@netlify/framework-info')
const frameworkInfoPromise = import('@netlify/framework-info')
const fuzzy = require('fuzzy')
const getPort = require('get-port')
const isPlainObject = require('is-plain-obj')
Expand Down Expand Up @@ -182,6 +182,7 @@ const getSettingsFromFramework = (framework) => {
const hasDevCommand = (framework) => Array.isArray(framework.dev.commands) && framework.dev.commands.length !== 0

const detectFrameworkSettings = async ({ projectDir }) => {
const { listFrameworks } = await frameworkInfoPromise
const projectFrameworks = await listFrameworks({ projectDir })
const frameworks = projectFrameworks.filter((framework) => hasDevCommand(framework))

Expand Down Expand Up @@ -276,6 +277,7 @@ const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
*/
const handleForcedFramework = async ({ devConfig, projectDir }) => {
// this throws if `devConfig.framework` is not a supported framework
const { getFramework } = await frameworkInfoPromise
const frameworkSettings = getSettingsFromFramework(await getFramework(devConfig.framework, { projectDir }))
return mergeSettings({ devConfig, frameworkSettings })
}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/init/frameworks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @ts-check
const { listFrameworks } = require('@netlify/framework-info')
const frameworkInfoPromise = import('@netlify/framework-info')

const getFrameworkInfo = async ({ baseDirectory, nodeVersion }) => {
const { listFrameworks } = await frameworkInfoPromise
const frameworks = await listFrameworks({ projectDir: baseDirectory, nodeVersion })
// several frameworks can be detected - first one has highest priority
if (frameworks.length !== 0) {
Expand Down

1 comment on commit 3ef3d3c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 357 MB

Please sign in to comment.