diff --git a/README.md b/README.md index c15678bf..d0a5a82c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ console.log(await listFrameworks({ projectDir: './path/to/gatsby/website' })) // [ // { // name: 'gatsby', +// title: 'Gatsby', // category: 'static_site_generator', // dev: { // commands: ['gatsby develop'], @@ -44,6 +45,7 @@ console.log(await listFrameworks({ projectDir: './path/to/vue/website' })) // [ // { // name: 'vue', +// title: 'Vue.js', // category: 'frontend_framework', // dev: { // commands: ['npm run serve'], @@ -64,6 +66,7 @@ console.log(await hasFramework('vue', { projectDir: './path/to/vue/website' })) console.log(await getFramework('vue', { projectDir: './path/to/vue/website' })) // { // name: 'vue', +// title: 'Vue.js', // category: 'frontend_framework', // dev: { // commands: ['npm run serve'], @@ -88,6 +91,7 @@ $ framework-info --long ./path/to/vue/website [ { "name": "vue", + "title": 'Vue.js', "category": "frontend_framework", "dev": { "commands": ["npm run serve"], @@ -138,6 +142,12 @@ _Type_: `string` Name such as `"gatsby"`. +## title + +_Type_: `string` + +Title such as `"Gatsby"`. + #### category _Type_: `string` @@ -228,6 +238,7 @@ Each framework is a JSON file in the `/src/frameworks/` directory. For example: ```json { "name": "gatsby", + "title": "Gatsby", "category": "static_site_generator", "detect": { "npmDependencies": ["gatsby"], @@ -255,6 +266,12 @@ _Type_: `string` Name of the framework, lowercase. +## title + +_Type_: `string` + +Title of the framework. + ## category _Type_: `string` diff --git a/src/core.js b/src/core.js index d0db624c..6627ae2d 100644 --- a/src/core.js +++ b/src/core.js @@ -42,7 +42,8 @@ const getContext = (context) => { /** * @typedef {object} Framework - * @property {string} name - Name such as `"gatsby"` + * @property {string} name - framework name such as `"gatsby"` + * @property {string} title - framework title as `"Gatsby"` * @property {string} category - Category among `"static_site_generator"`, `"frontend_framework"` and `"build_tool"` * @property {Dev} dev - Information about the dev command * @property {Build} build - Information about the build command @@ -131,6 +132,7 @@ const getProjectInfo = async function ({ pathExists, packageJson, packageJsonPat const getFrameworkInfo = function ( { name, + title, category, dev: { command: frameworkDevCommand, port }, build: { command: frameworkBuildCommand, directory }, @@ -143,6 +145,7 @@ const getFrameworkInfo = function ( const recommendedPlugins = getPlugins(plugins, { nodeVersion }) return { name, + title, category, dev: { commands: devCommands, port }, build: { commands: [frameworkBuildCommand], directory }, diff --git a/src/frameworks/angular.json b/src/frameworks/angular.json index 9c0139c0..d723aabd 100644 --- a/src/frameworks/angular.json +++ b/src/frameworks/angular.json @@ -1,5 +1,6 @@ { "name": "angular", + "title": "Angular", "category": "frontend_framework", "detect": { "npmDependencies": ["@angular/cli"], diff --git a/src/frameworks/assemble.json b/src/frameworks/assemble.json index 5a65176c..76fa9482 100644 --- a/src/frameworks/assemble.json +++ b/src/frameworks/assemble.json @@ -1,5 +1,6 @@ { "name": "assemble", + "title": "Assemble", "category": "static_site_generator", "detect": { "npmDependencies": ["assemble"], diff --git a/src/frameworks/brunch.json b/src/frameworks/brunch.json index d964649a..5f50e183 100644 --- a/src/frameworks/brunch.json +++ b/src/frameworks/brunch.json @@ -1,5 +1,6 @@ { "name": "brunch", + "title": "Brunch", "category": "build_tool", "detect": { "npmDependencies": ["brunch"], diff --git a/src/frameworks/create-react-app.json b/src/frameworks/create-react-app.json index f2b8d8ff..5cb5d366 100644 --- a/src/frameworks/create-react-app.json +++ b/src/frameworks/create-react-app.json @@ -1,5 +1,6 @@ { "name": "create-react-app", + "title": "Create React App", "category": "frontend_framework", "detect": { "npmDependencies": ["react-scripts"], diff --git a/src/frameworks/docpad.json b/src/frameworks/docpad.json index 68baea91..41d0fff7 100644 --- a/src/frameworks/docpad.json +++ b/src/frameworks/docpad.json @@ -1,5 +1,6 @@ { "name": "docpad", + "title": "DocPad", "category": "static_site_generator", "detect": { "npmDependencies": ["docpad"], diff --git a/src/frameworks/docusaurus-v2.json b/src/frameworks/docusaurus-v2.json index 352782c7..53aa164d 100644 --- a/src/frameworks/docusaurus-v2.json +++ b/src/frameworks/docusaurus-v2.json @@ -1,5 +1,6 @@ { "name": "docusaurus-v2", + "title": "Docusaurus 2", "category": "static_site_generator", "detect": { "npmDependencies": ["@docusaurus/core"], diff --git a/src/frameworks/docusaurus.json b/src/frameworks/docusaurus.json index 0c001ca1..1604cf95 100644 --- a/src/frameworks/docusaurus.json +++ b/src/frameworks/docusaurus.json @@ -1,5 +1,6 @@ { "name": "docusaurus", + "title": "Docusaurus", "category": "static_site_generator", "detect": { "npmDependencies": ["docusaurus"], diff --git a/src/frameworks/eleventy.json b/src/frameworks/eleventy.json index 23a21c9e..207e6aaa 100644 --- a/src/frameworks/eleventy.json +++ b/src/frameworks/eleventy.json @@ -1,5 +1,6 @@ { "name": "eleventy", + "title": "Eleventy", "category": "static_site_generator", "detect": { "npmDependencies": ["@11ty/eleventy"], diff --git a/src/frameworks/ember.json b/src/frameworks/ember.json index 043e0860..3c8b4bb5 100644 --- a/src/frameworks/ember.json +++ b/src/frameworks/ember.json @@ -1,5 +1,6 @@ { "name": "ember", + "title": "Ember.js", "category": "frontend_framework", "detect": { "npmDependencies": ["ember-cli"], diff --git a/src/frameworks/expo.json b/src/frameworks/expo.json index 4cc16305..8f0a6782 100644 --- a/src/frameworks/expo.json +++ b/src/frameworks/expo.json @@ -1,5 +1,6 @@ { "name": "expo", + "title": "Expo", "category": "frontend_framework", "detect": { "npmDependencies": ["expo"], diff --git a/src/frameworks/gatsby.json b/src/frameworks/gatsby.json index 9b03b7fb..fdbc52a7 100644 --- a/src/frameworks/gatsby.json +++ b/src/frameworks/gatsby.json @@ -1,5 +1,6 @@ { "name": "gatsby", + "title": "Gatsby", "category": "static_site_generator", "detect": { "npmDependencies": ["gatsby"], diff --git a/src/frameworks/gridsome.json b/src/frameworks/gridsome.json index 325f600b..89aa91e0 100644 --- a/src/frameworks/gridsome.json +++ b/src/frameworks/gridsome.json @@ -1,5 +1,6 @@ { "name": "gridsome", + "title": "Gridsome", "category": "static_site_generator", "detect": { "npmDependencies": ["gridsome"], diff --git a/src/frameworks/grunt.json b/src/frameworks/grunt.json index 1b64e16e..41026062 100644 --- a/src/frameworks/grunt.json +++ b/src/frameworks/grunt.json @@ -1,5 +1,6 @@ { "name": "grunt", + "title": "Grunt", "category": "build_tool", "detect": { "npmDependencies": ["grunt"], diff --git a/src/frameworks/gulp.json b/src/frameworks/gulp.json index c202b5ee..b026a90e 100644 --- a/src/frameworks/gulp.json +++ b/src/frameworks/gulp.json @@ -1,5 +1,6 @@ { "name": "gulp", + "title": "gulp.js", "category": "build_tool", "detect": { "npmDependencies": ["gulp"], diff --git a/src/frameworks/harp.json b/src/frameworks/harp.json index 346d48b2..820806cb 100644 --- a/src/frameworks/harp.json +++ b/src/frameworks/harp.json @@ -1,5 +1,6 @@ { "name": "harp", + "title": "Harp", "category": "static_site_generator", "detect": { "npmDependencies": ["harp"], diff --git a/src/frameworks/hexo.json b/src/frameworks/hexo.json index 4adbfaf9..fa6dea02 100644 --- a/src/frameworks/hexo.json +++ b/src/frameworks/hexo.json @@ -1,5 +1,6 @@ { "name": "hexo", + "title": "Hexo", "category": "static_site_generator", "detect": { "npmDependencies": ["hexo"], diff --git a/src/frameworks/hugo.json b/src/frameworks/hugo.json index bb7a60d3..8d86c1b3 100644 --- a/src/frameworks/hugo.json +++ b/src/frameworks/hugo.json @@ -1,5 +1,6 @@ { "name": "hugo", + "title": "Hugo", "category": "static_site_generator", "detect": { "npmDependencies": [], diff --git a/src/frameworks/jekyll.json b/src/frameworks/jekyll.json index ba4a7991..a15a63f0 100644 --- a/src/frameworks/jekyll.json +++ b/src/frameworks/jekyll.json @@ -1,5 +1,6 @@ { "name": "jekyll", + "title": "Jekyll", "category": "static_site_generator", "detect": { "npmDependencies": [], diff --git a/src/frameworks/metalsmith.json b/src/frameworks/metalsmith.json index ba054643..fdb997b8 100644 --- a/src/frameworks/metalsmith.json +++ b/src/frameworks/metalsmith.json @@ -1,5 +1,6 @@ { "name": "metalsmith", + "title": "Metalsmith", "category": "static_site_generator", "detect": { "npmDependencies": ["metalsmith"], diff --git a/src/frameworks/middleman.json b/src/frameworks/middleman.json index 919c0478..6de4e52f 100644 --- a/src/frameworks/middleman.json +++ b/src/frameworks/middleman.json @@ -1,5 +1,6 @@ { "name": "middleman", + "title": "Middleman", "category": "static_site_generator", "detect": { "npmDependencies": [], diff --git a/src/frameworks/next.json b/src/frameworks/next.json index 2746b1d9..95ec9812 100644 --- a/src/frameworks/next.json +++ b/src/frameworks/next.json @@ -1,5 +1,6 @@ { "name": "next", + "title": "Next.js", "category": "static_site_generator", "detect": { "npmDependencies": ["next"], diff --git a/src/frameworks/nuxt.json b/src/frameworks/nuxt.json index a3354ee3..5b6d96e6 100644 --- a/src/frameworks/nuxt.json +++ b/src/frameworks/nuxt.json @@ -1,5 +1,6 @@ { "name": "nuxt", + "title": "Next.js", "category": "static_site_generator", "detect": { "npmDependencies": ["nuxt"], diff --git a/src/frameworks/parcel.json b/src/frameworks/parcel.json index 5b9fa098..51b32541 100644 --- a/src/frameworks/parcel.json +++ b/src/frameworks/parcel.json @@ -1,5 +1,6 @@ { "name": "parcel", + "title": "Parcel", "category": "build_tool", "detect": { "npmDependencies": ["parcel-bundler", "parcel"], diff --git a/src/frameworks/phenomic.json b/src/frameworks/phenomic.json index ab786dd2..2c9583f2 100644 --- a/src/frameworks/phenomic.json +++ b/src/frameworks/phenomic.json @@ -1,5 +1,6 @@ { "name": "phenomic", + "title": "Phenomic", "category": "static_site_generator", "detect": { "npmDependencies": ["@phenomic/core"], diff --git a/src/frameworks/quasar-v0.17.json b/src/frameworks/quasar-v0.17.json index c2860a9d..293ab508 100644 --- a/src/frameworks/quasar-v0.17.json +++ b/src/frameworks/quasar-v0.17.json @@ -1,5 +1,6 @@ { "name": "quasar-v0.17", + "title": "Quasar", "category": "frontend_framework", "detect": { "npmDependencies": ["quasar-cli"], diff --git a/src/frameworks/quasar.json b/src/frameworks/quasar.json index 1ff9fc6a..ba1aba54 100644 --- a/src/frameworks/quasar.json +++ b/src/frameworks/quasar.json @@ -1,5 +1,6 @@ { "name": "quasar", + "title": "Quasar", "category": "frontend_framework", "detect": { "npmDependencies": ["@quasar/app"], diff --git a/src/frameworks/react-static.json b/src/frameworks/react-static.json index 3eada384..de62c233 100644 --- a/src/frameworks/react-static.json +++ b/src/frameworks/react-static.json @@ -1,5 +1,6 @@ { "name": "react-static", + "title": "React Static", "category": "static_site_generator", "detect": { "npmDependencies": ["react-static"], diff --git a/src/frameworks/roots.json b/src/frameworks/roots.json index 9436f528..db499f48 100644 --- a/src/frameworks/roots.json +++ b/src/frameworks/roots.json @@ -1,5 +1,6 @@ { "name": "roots", + "title": "Roots", "category": "static_site_generator", "detect": { "npmDependencies": ["roots"], diff --git a/src/frameworks/sapper.json b/src/frameworks/sapper.json index 20c25a04..211034a6 100644 --- a/src/frameworks/sapper.json +++ b/src/frameworks/sapper.json @@ -1,5 +1,6 @@ { "name": "sapper", + "title": "Sapper", "category": "frontend_framework", "detect": { "npmDependencies": ["sapper"], diff --git a/src/frameworks/stencil.json b/src/frameworks/stencil.json index ffe642bf..3a82f0e0 100644 --- a/src/frameworks/stencil.json +++ b/src/frameworks/stencil.json @@ -1,5 +1,6 @@ { "name": "stencil", + "title": "Stencil", "category": "static_site_generator", "detect": { "npmDependencies": ["@stencil/core"], diff --git a/src/frameworks/svelte.json b/src/frameworks/svelte.json index 37171697..c1429296 100644 --- a/src/frameworks/svelte.json +++ b/src/frameworks/svelte.json @@ -1,5 +1,6 @@ { "name": "svelte", + "title": "Svelte", "category": "frontend_framework", "detect": { "npmDependencies": ["svelte"], diff --git a/src/frameworks/vue.json b/src/frameworks/vue.json index 65837e89..96d6861a 100644 --- a/src/frameworks/vue.json +++ b/src/frameworks/vue.json @@ -1,5 +1,6 @@ { "name": "vue", + "title": "Vue.js", "category": "frontend_framework", "detect": { "npmDependencies": ["@vue/cli-service"], diff --git a/src/frameworks/vuepress.json b/src/frameworks/vuepress.json index e8e51ea6..6bef0ecb 100644 --- a/src/frameworks/vuepress.json +++ b/src/frameworks/vuepress.json @@ -1,5 +1,6 @@ { "name": "vuepress", + "title": "VuePress", "category": "static_site_generator", "detect": { "npmDependencies": ["vuepress"], diff --git a/src/frameworks/wintersmith.json b/src/frameworks/wintersmith.json index 680d8442..547e10bc 100644 --- a/src/frameworks/wintersmith.json +++ b/src/frameworks/wintersmith.json @@ -1,5 +1,6 @@ { "name": "wintersmith", + "title": "Wintersmith", "category": "static_site_generator", "detect": { "npmDependencies": ["wintersmith"], diff --git a/test/frameworks.js b/test/frameworks.js index aea4e75f..c8396052 100644 --- a/test/frameworks.js +++ b/test/frameworks.js @@ -47,10 +47,11 @@ const PLUGIN_SCHEMA = { const MAX_PORT = 65535 const FRAMEWORK_JSON_SCHEMA = { type: 'object', - required: ['name', 'category', 'detect', 'dev', 'build', 'env'], + required: ['name', 'title', 'category', 'detect', 'dev', 'build', 'env'], additionalProperties: false, properties: { name: { type: 'string', pattern: '^[a-z\\d_]+', minLength: 1 }, + title: { type: 'string', pattern: '^\\w+', minLength: 1 }, category: { type: 'string', enum: ['static_site_generator', 'frontend_framework', 'build_tool'], diff --git a/test/snapshots/bin.js.md b/test/snapshots/bin.js.md index 5dbeaf63..1415c9d7 100644 --- a/test/snapshots/bin.js.md +++ b/test/snapshots/bin.js.md @@ -25,6 +25,7 @@ Generated by [AVA](https://ava.li). `[␊ {␊ "name": "vuepress",␊ + "title": "VuePress",␊ "category": "static_site_generator",␊ "dev": {␊ "commands": [␊ @@ -43,6 +44,7 @@ Generated by [AVA](https://ava.li). },␊ {␊ "name": "vue",␊ + "title": "Vue.js",␊ "category": "frontend_framework",␊ "dev": {␊ "commands": [␊ @@ -75,6 +77,7 @@ Generated by [AVA](https://ava.li). `[␊ {␊ "name": "next",␊ + "title": "Next.js",␊ "category": "static_site_generator",␊ "dev": {␊ "commands": [␊ @@ -102,6 +105,7 @@ Generated by [AVA](https://ava.li). `[␊ {␊ "name": "next",␊ + "title": "Next.js",␊ "category": "static_site_generator",␊ "dev": {␊ "commands": [␊ diff --git a/test/snapshots/bin.js.snap b/test/snapshots/bin.js.snap index 69660a0c..05c62323 100644 Binary files a/test/snapshots/bin.js.snap and b/test/snapshots/bin.js.snap differ diff --git a/test/snapshots/main.js.md b/test/snapshots/main.js.md index 476892b8..07db798a 100644 --- a/test/snapshots/main.js.md +++ b/test/snapshots/main.js.md @@ -25,6 +25,7 @@ Generated by [AVA](https://ava.li). env: {}, name: 'sapper', plugins: [], + title: 'Sapper', } ## Should detect frameworks @@ -49,5 +50,6 @@ Generated by [AVA](https://ava.li). env: {}, name: 'sapper', plugins: [], + title: 'Sapper', }, ] diff --git a/test/snapshots/main.js.snap b/test/snapshots/main.js.snap index 12c361d8..37acf60c 100644 Binary files a/test/snapshots/main.js.snap and b/test/snapshots/main.js.snap differ