Socket
Socket
Sign inDemoInstall

@netlify/framework-info

Package Overview
Dependencies
Maintainers
19
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/framework-info - npm Package Compare versions

Comparing version 9.3.1-framework-version-detection.0 to 9.3.1-framework-version-detection.1

3

package.json
{
"name": "@netlify/framework-info",
"version": "9.3.1-framework-version-detection.0",
"version": "9.3.1-framework-version-detection.1",
"description": "Framework detection utility",

@@ -74,2 +74,3 @@ "type": "module",

"filter-obj": "^3.0.0",
"find-up": "^6.3.0",
"fs-extra": "^10.1.0",

@@ -76,0 +77,0 @@ "is-plain-obj": "^4.0.0",

import { join } from 'path'
import { cwd } from 'process'
import { cwd, chdir } from 'process'
import { findUp } from 'find-up'
import { getContext, getPackageJson } from './context.js'

@@ -55,3 +57,20 @@ import { listFrameworks as list, hasFramework as has, getFramework as get } from './core.js'

const npmPackage = frameworkInfo.package.name
const { packageJson } = await getPackageJson(join(projectDir, 'node_modules', npmPackage))
// Get path of package.json for the installed framework. We need to traverse up the directories
// in the event that the project uses something like npm workspaces, and the installed framework package
// has been hoisted to the root directory of the project (which differs from the project/application being built)
// Need to change the CWD to the project directory being built in order to make sure we find and use the correct
// package.json
const originalCwd = cwd()
const returnToOriginalDirectory = () => {
chdir(originalCwd)
}
chdir(projectDir)
const installedFrameworkPath = await findUp(join('node_modules', npmPackage, 'package.json'))
const { packageJson } = await getPackageJson(installedFrameworkPath)
returnToOriginalDirectory()
return {

@@ -58,0 +77,0 @@ ...frameworkInfo,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc