Socket
Socket
Sign inDemoInstall

@netlify/framework-info

Package Overview
Dependencies
Maintainers
15
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 7.0.0-rc-3 to 7.0.0

dist/index.js

6

build/frameworks.js
// This file is autogenerated at build time
export const FRAMEWORKS = [
module.exports.FRAMEWORKS = [
{

@@ -365,3 +365,3 @@ "id": "astro",

"command": "nx build",
"directory": "apps/<app name>/out"
"directory": "dist/apps/<app name>/.next"
},

@@ -402,3 +402,3 @@ "env": {},

"command": "next build",
"directory": "out"
"directory": ".next"
},

@@ -405,0 +405,0 @@ "env": {},

{
"name": "@netlify/framework-info",
"version": "7.0.0-rc-3",
"version": "7.0.0",
"description": "Framework detection utility",
"type": "module",
"exports": {
"browser": "./dist/index.cjs",
"node": "./src/main.js"
},
"main": "./src/main.js",
"browser": "./dist/index.js",
"files": [
"dist/index.cjs",
"dist/index.js",
"build/*.js",

@@ -78,4 +74,4 @@ "src/**/*.js"

"config": {
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,site,scripts,test,cypress}/**/*.{cjs,mjs,js,jsx,html}\" --ignore-pattern \"test/fixtures/**/*\"",
"prettier": "--ignore-path .gitignore --loglevel warn \"{src,site,scripts,test,cypress}/**/*.{cjs,mjs,js}\" \"*.{cjs,mjs,js,md,yml,json}\" \"!package-lock.json\" \"!CHANGELOG.md\""
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,site,scripts,test,cypress}/**/*.{js,jsx,html}\" --ignore-pattern \"test/fixtures/**/*\"",
"prettier": "--ignore-path .gitignore --loglevel warn \"{src,site,scripts,test,cypress}/**/*.js\" \"*.{js,md,yml,json}\" \"!package-lock.json\" \"!CHANGELOG.md\""
},

@@ -113,3 +109,3 @@ "dependencies": {

"path-browserify": "^1.0.1",
"puppeteer": "^12.0.0",
"puppeteer": "^13.0.0",
"react": "^17.0.1",

@@ -134,6 +130,3 @@ "react-dom": "^17.0.1",

"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
},
"ava": {
"verbose": true
}
}

@@ -26,3 +26,3 @@ [![npm version](https://img.shields.io/npm/v/@netlify/framework-info.svg)](https://npmjs.org/package/@netlify/framework-info)

```js
import { listFrameworks, hasFramework, getFramework } from '@netlify/framework-info'
const { listFrameworks, hasFramework, getFramework } = require('@netlify/framework-info')

@@ -29,0 +29,0 @@ console.log(await listFrameworks({ projectDir: './path/to/gatsby/website' }))

@@ -1,6 +0,6 @@

import { cwd, version } from 'process'
const { cwd, version } = require('process')
import isPlainObj from 'is-plain-obj'
import locatePath from 'locate-path'
import readPkgUp from 'read-pkg-up'
const isPlainObj = require('is-plain-obj')
const locatePath = require('locate-path')
const readPkgUp = require('read-pkg-up')

@@ -26,3 +26,3 @@ const getPackageJson = async (projectDir) => {

export const getContext = async ({ projectDir = cwd(), nodeVersion = version } = {}) => {
const getContext = async ({ projectDir = cwd(), nodeVersion = version } = {}) => {
const { packageJson, packageJsonPath = projectDir } = await getPackageJson(projectDir)

@@ -36,1 +36,3 @@ return {

}
module.exports = { getContext }

@@ -1,13 +0,14 @@

import pFilter from 'p-filter'
const pFilter = require('p-filter')
import { FRAMEWORKS } from '../build/frameworks.js'
const { FRAMEWORKS } = require('../build/frameworks')
import { usesFramework } from './detect.js'
import { getDevCommands } from './dev.js'
import { getPackageJsonContent } from './package.js'
import { getPlugins } from './plugins.js'
import { getRunScriptCommand } from './run_script.js'
const { usesFramework } = require('./detect')
const { getDevCommands } = require('./dev')
const { getPackageJsonContent } = require('./package')
const { getPlugins } = require('./plugins')
const { getRunScriptCommand } = require('./run_script')
const getContext = (context) => {
const { pathExists, packageJson, packageJsonPath = '.', nodeVersion } = context
return { pathExists, packageJson, packageJsonPath, nodeVersion }

@@ -68,3 +69,3 @@ }

*/
export const listFrameworks = async function (context) {
const listFrameworks = async function (context) {
const { pathExists, packageJson, packageJsonPath, nodeVersion } = getContext(context)

@@ -91,3 +92,3 @@ const { npmDependencies, scripts, runScriptCommand } = await getProjectInfo({

*/
export const hasFramework = async function (frameworkId, context) {
const hasFramework = async function (frameworkId, context) {
const framework = getFrameworkById(frameworkId)

@@ -108,3 +109,3 @@ const { pathExists, packageJson, packageJsonPath } = getContext(context)

*/
export const getFramework = async function (frameworkId, context) {
const getFramework = async function (frameworkId, context) {
const framework = getFrameworkById(frameworkId)

@@ -170,1 +171,3 @@ const { pathExists, packageJson, packageJsonPath, nodeVersion } = getContext(context)

}
module.exports = { listFrameworks, hasFramework, getFramework }

@@ -1,2 +0,2 @@

import pLocate from 'p-locate'
const pLocate = require('p-locate')

@@ -9,3 +9,3 @@ // Checks if the project is using a specific framework:

// - if `framework.configFiles` is set, one of the files must exist
export const usesFramework = async function (
const usesFramework = async function (
{

@@ -48,1 +48,3 @@ detect: {

}
module.exports = { usesFramework }

@@ -6,3 +6,3 @@ // Retrieve framework's dev commands.

// - `framework.dev.command`
export const getDevCommands = function ({ frameworkDevCommand, scripts, runScriptCommand }) {
const getDevCommands = function ({ frameworkDevCommand, scripts, runScriptCommand }) {
if (frameworkDevCommand === undefined) {

@@ -70,1 +70,3 @@ return []

const EXCLUDED_SCRIPTS = ['netlify dev']
module.exports = { getDevCommands }
// We purposely order the following array to ensure the most relevant framework
// is always first, if several frameworks are detected at once.
// Therefore, we cannot use `fs.readdir()`.
export const FRAMEWORK_NAMES = [
module.exports.FRAMEWORK_NAMES = [
// Static site generators

@@ -6,0 +6,0 @@ 'astro',

@@ -1,3 +0,3 @@

import { getContext } from './context.js'
import { listFrameworks as list, hasFramework as has, getFramework as get } from './core.js'
const { getContext } = require('./context')
const { listFrameworks: list, hasFramework: has, getFramework: get } = require('./core')

@@ -39,3 +39,3 @@ /**

*/
export const listFrameworks = async function (opts) {
const listFrameworks = async function (opts) {
const context = await getContext(opts)

@@ -53,3 +53,3 @@ return await list(context)

*/
export const hasFramework = async function (frameworkId, options) {
const hasFramework = async function (frameworkId, options) {
const context = await getContext(options)

@@ -67,5 +67,7 @@ return await has(frameworkId, context)

*/
export const getFramework = async function (frameworkId, options) {
const getFramework = async function (frameworkId, options) {
const context = await getContext(options)
return await get(frameworkId, context)
}
module.exports = { listFrameworks, hasFramework, getFramework }

@@ -1,5 +0,5 @@

import filterObj from 'filter-obj'
import isPlainObj from 'is-plain-obj'
const filterObj = require('filter-obj')
const isPlainObj = require('is-plain-obj')
export const getPackageJsonContent = function ({ packageJson }) {
const getPackageJsonContent = function ({ packageJson }) {
if (packageJson === undefined) {

@@ -40,1 +40,3 @@ return { npmDependencies: [], scripts: {} }

}
module.exports = { getPackageJsonContent }

@@ -1,3 +0,3 @@

import Ajv from 'ajv'
import semver from 'semver'
const Ajv = require('ajv').default
const semver = require('semver')

@@ -13,3 +13,3 @@ const MIN_NODE_VERSION_KEYWORD = {

export const getPlugins = function (plugins, { nodeVersion }) {
const getPlugins = function (plugins, { nodeVersion }) {
return plugins

@@ -19,1 +19,3 @@ .filter(({ condition }) => ajv.validate(condition, { nodeVersion }))

}
module.exports = { getPlugins }

@@ -1,5 +0,5 @@

import { dirname } from 'path'
const { dirname } = require('path')
// Retrieve the command to run `package.json` `scripts` commands
export const getRunScriptCommand = async function ({ pathExists, packageJsonPath }) {
const getRunScriptCommand = async function ({ pathExists, packageJsonPath }) {
const yarnExists = await pathExists(`${dirname(packageJsonPath)}/yarn.lock`)

@@ -12,1 +12,3 @@ if (yarnExists) {

}
module.exports = { getRunScriptCommand }
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