Socket
Socket
Sign inDemoInstall

@netlify/framework-info

Package Overview
Dependencies
Maintainers
14
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 2.3.0 to 3.0.0

13

CHANGELOG.md

@@ -10,2 +10,15 @@ # Changelog

## [3.0.0](https://www.github.com/netlify/framework-info/compare/v2.3.0...v3.0.0) (2021-02-10)
### ⚠ BREAKING CHANGES
* rename title to name (#139)
* rename name property to id (#137)
### Features
* rename name property to id ([#137](https://www.github.com/netlify/framework-info/issues/137)) ([bf298d2](https://www.github.com/netlify/framework-info/commit/bf298d2ce4e4ca010a4cf05642aac952f0afa675))
* rename title to name ([#139](https://www.github.com/netlify/framework-info/issues/139)) ([2b444e0](https://www.github.com/netlify/framework-info/commit/2b444e071b4a2b5c82afa639240c7014bc3a865c))
## [2.3.0](https://www.github.com/netlify/framework-info/compare/v2.2.0...v2.3.0) (2021-02-10)

@@ -12,0 +25,0 @@

2

package.json
{
"name": "@netlify/framework-info",
"version": "2.3.0",
"version": "3.0.0",
"description": "Framework detection utility",

@@ -5,0 +5,0 @@ "main": "./src/main.js",

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

// {
// name: 'gatsby',
// title: 'Gatsby',
// id: 'gatsby',
// name: 'Gatsby',
// category: 'static_site_generator',

@@ -48,4 +48,4 @@ // dev: {

// {
// name: 'vue',
// title: 'Vue.js',
// id: 'vue',
// name: 'Vue.js',
// category: 'frontend_framework',

@@ -70,4 +70,4 @@ // dev: {

// {
// name: 'vue',
// title: 'Vue.js',
// id: 'vue',
// name: 'Vue.js',
// category: 'frontend_framework',

@@ -96,4 +96,4 @@ // dev: {

{
"name": "vue",
"title": 'Vue.js',
"id": "vue",
"name": 'Vue.js',
"category": "frontend_framework",

@@ -143,13 +143,13 @@ "dev": {

#### name
#### id
_Type_: `string`
Name such as `"gatsby"`.
Id such as `"gatsby"`.
## title
## name
_Type_: `string`
Title such as `"Gatsby"`.
Framework name such as `"Gatsby"`.

@@ -210,3 +210,3 @@ #### category

## hasFramework(frameworkName, options?)
## hasFramework(frameworkId, options?)

@@ -218,3 +218,3 @@ `options`: `object?`\

## getFramework(frameworkName, options?)
## getFramework(frameworkId, options?)

@@ -233,3 +233,3 @@ `options`: `object?`\

This prints the names of each framework.
This prints the ids of each framework.

@@ -248,4 +248,4 @@ If known is found, `unknown` is printed.

{
"name": "gatsby",
"title": "Gatsby",
"id": "gatsby",
"name": "Gatsby",
"category": "static_site_generator",

@@ -272,13 +272,13 @@ "detect": {

## name
## id
_Type_: `string`
Name of the framework, lowercase.
Id of the framework.
## title
## name
_Type_: `string`
Title of the framework.
Name of the framework.

@@ -285,0 +285,0 @@ ## category

@@ -52,3 +52,3 @@ #!/usr/bin/env node

return frameworks.map((framework) => getName(framework)).join('\n')
return frameworks.map(({ id }) => id).join('\n')
}

@@ -58,6 +58,2 @@

const getName = function ({ name }) {
return name
}
runCli()

@@ -45,4 +45,4 @@ const pFilter = require('p-filter')

* @typedef {object} Framework
* @property {string} name - framework name such as `"gatsby"`
* @property {string} title - framework title as `"Gatsby"`
* @property {string} id - framework id such as `"gatsby"`
* @property {string} name - framework name such as `"Gatsby"`
* @property {string} category - Category among `"static_site_generator"`, `"frontend_framework"` and `"build_tool"`

@@ -79,3 +79,3 @@ * @property {Dev} dev - Information about the dev command

*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {string} frameworkId - Id such as `"gatsby"`
* @param {Context} [context] - Context

@@ -85,4 +85,4 @@ *

*/
const hasFramework = async function (frameworkName, context) {
const framework = getFrameworkByName(frameworkName)
const hasFramework = async function (frameworkId, context) {
const framework = getFrameworkById(frameworkId)
const { pathExists, packageJson, packageJsonPath } = getContext(context)

@@ -97,3 +97,3 @@ const { npmDependencies } = await getProjectInfo({ pathExists, packageJson, packageJsonPath })

*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {string} frameworkId - Id such as `"gatsby"`
* @param {Context} [context] - Context

@@ -103,4 +103,4 @@ *

*/
const getFramework = async function (frameworkName, context) {
const framework = getFrameworkByName(frameworkName)
const getFramework = async function (frameworkId, context) {
const framework = getFrameworkById(frameworkId)
const { pathExists, packageJson, packageJsonPath, nodeVersion } = getContext(context)

@@ -116,7 +116,7 @@ const { scripts, runScriptCommand } = await getProjectInfo({

const getFrameworkByName = function (frameworkName) {
const framework = FRAMEWORKS.find(({ name }) => name === frameworkName)
const getFrameworkById = function (frameworkId) {
const framework = FRAMEWORKS.find(({ id }) => id === frameworkId)
if (framework === undefined) {
const frameworkNames = FRAMEWORKS.map((knownFramework) => getFrameworkName(knownFramework)).join(', ')
throw new Error(`Invalid framework "${frameworkName}". It should be one of: ${frameworkNames}`)
const frameworkIds = FRAMEWORKS.map((knownFramework) => getFrameworkId(knownFramework)).join(', ')
throw new Error(`Invalid framework "${frameworkId}". It should be one of: ${frameworkIds}`)
}

@@ -126,4 +126,4 @@ return framework

const getFrameworkName = function ({ name }) {
return name
const getFrameworkId = function ({ id }) {
return id
}

@@ -141,4 +141,4 @@

{
id,
name,
title,
category,

@@ -155,4 +155,4 @@ dev: { command: frameworkDevCommand, port },

return {
id,
name,
title,
category,

@@ -159,0 +159,0 @@ dev: { commands: devCommands, port },

{
"name": "angular",
"title": "Angular",
"id": "angular",
"name": "Angular",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "assemble",
"title": "Assemble",
"id": "assemble",
"name": "Assemble",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "brunch",
"title": "Brunch",
"id": "brunch",
"name": "Brunch",
"category": "build_tool",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "create-react-app",
"title": "Create React App",
"id": "create-react-app",
"name": "Create React App",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "docpad",
"title": "DocPad",
"id": "docpad",
"name": "DocPad",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "docusaurus-v2",
"title": "Docusaurus 2",
"id": "docusaurus-v2",
"name": "Docusaurus 2",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "docusaurus",
"title": "Docusaurus",
"id": "docusaurus",
"name": "Docusaurus",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "eleventy",
"title": "Eleventy",
"id": "eleventy",
"name": "Eleventy",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "ember",
"title": "Ember.js",
"id": "ember",
"name": "Ember.js",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "expo",
"title": "Expo",
"id": "expo",
"name": "Expo",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "gatsby",
"title": "Gatsby",
"id": "gatsby",
"name": "Gatsby",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "gridsome",
"title": "Gridsome",
"id": "gridsome",
"name": "Gridsome",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "grunt",
"title": "Grunt",
"id": "grunt",
"name": "Grunt",
"category": "build_tool",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "gulp",
"title": "gulp.js",
"id": "gulp",
"name": "gulp.js",
"category": "build_tool",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "harp",
"title": "Harp",
"id": "harp",
"name": "Harp",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "hexo",
"title": "Hexo",
"id": "hexo",
"name": "Hexo",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "hugo",
"title": "Hugo",
"id": "hugo",
"name": "Hugo",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "jekyll",
"title": "Jekyll",
"id": "jekyll",
"name": "Jekyll",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "metalsmith",
"title": "Metalsmith",
"id": "metalsmith",
"name": "Metalsmith",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "middleman",
"title": "Middleman",
"id": "middleman",
"name": "Middleman",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "next",
"title": "Next.js",
"id": "next",
"name": "Next.js",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "nuxt",
"title": "Next.js",
"id": "nuxt",
"name": "Next.js",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "parcel",
"title": "Parcel",
"id": "parcel",
"name": "Parcel",
"category": "build_tool",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "phenomic",
"title": "Phenomic",
"id": "phenomic",
"name": "Phenomic",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "quasar-v0.17",
"title": "Quasar",
"id": "quasar-v0.17",
"name": "Quasar",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "quasar",
"title": "Quasar",
"id": "quasar",
"name": "Quasar",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "react-static",
"title": "React Static",
"id": "react-static",
"name": "React Static",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "roots",
"title": "Roots",
"id": "roots",
"name": "Roots",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "sapper",
"title": "Sapper",
"id": "sapper",
"name": "Sapper",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "stencil",
"title": "Stencil",
"id": "stencil",
"name": "Stencil",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "svelte",
"title": "Svelte",
"id": "svelte",
"name": "Svelte",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "vue",
"title": "Vue.js",
"id": "vue",
"name": "Vue.js",
"category": "frontend_framework",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "vuepress",
"title": "VuePress",
"id": "vuepress",
"name": "VuePress",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

{
"name": "wintersmith",
"title": "Wintersmith",
"id": "wintersmith",
"name": "Wintersmith",
"category": "static_site_generator",

@@ -5,0 +5,0 @@ "detect": {

@@ -24,3 +24,3 @@ const { getContext } = require('./context')

* @typedef {object} Framework
* @property {string} name - Name such as `"gatsby"`
* @property {string} id - Id such as `"gatsby"`
* @property {string} category - Category among `"static_site_generator"`, `"frontend_framework"` and `"build_tool"`

@@ -48,3 +48,3 @@ * @property {Dev} dev - Information about the dev command

*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {string} frameworkId - Id such as `"gatsby"`
* @param {Options} [options] - Context

@@ -54,5 +54,5 @@ *

*/
const hasFramework = async function (frameworkName, options) {
const hasFramework = async function (frameworkId, options) {
const context = await getContext(options)
return await has(frameworkName, context)
return await has(frameworkId, context)
}

@@ -63,3 +63,3 @@

*
* @param {string} frameworkName - Name such as `"gatsby"`
* @param {string} frameworkId - Id such as `"gatsby"`
* @param {Context} [context] - Context

@@ -69,7 +69,7 @@ *

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

Sorry, the diff of this file is too big to display

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