Skip to content

Commit

Permalink
feat(template): remove dotenv module (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo authored Jun 8, 2020
1 parent 4121c01 commit ba93891
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 119 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ yarn create nuxt-app <my-project>
1. Choose Nuxt.js modules:
- [Axios](https://github.com/nuxt-community/axios-module)
- [Progressive Web App (PWA) Support](https://github.com/nuxt-community/pwa-module)
- [DotEnv](https://github.com/nuxt-community/dotenv-module)
1. Choose linting tools:
- [ESLint](https://github.com/nuxt/eslint-config)
- [Prettier](https://github.com/prettier/prettier)
Expand Down
1 change: 0 additions & 1 deletion packages/cna-template/template/.env

This file was deleted.

4 changes: 0 additions & 4 deletions packages/cna-template/template/nuxt/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ export default {
<%_ if (pwa) { _%>
'@nuxtjs/pwa',
<%_ } _%>
<%_ if (dotenv) { _%>
// Doc: https://github.com/nuxt-community/dotenv-module
'@nuxtjs/dotenv',
<%_ } _%>
],
<%_ if (axios) { _%>
/*
Expand Down
3 changes: 0 additions & 3 deletions packages/cna-template/template/nuxt/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ module.exports = {
if (!features.includes('pwa')) {
delete pkg.dependencies['@nuxtjs/pwa']
}
if (!features.includes('dotenv')) {
delete pkg.dependencies['@nuxtjs/dotenv']
}

// TS
const typescript = language.includes('ts')
Expand Down
1 change: 0 additions & 1 deletion packages/cna-template/template/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@nuxt/typescript-runtime": "^0.4.9",
"@nuxtjs/axios": "^5.11.0",
"@nuxtjs/pwa": "^3.0.0-beta.20",
"@nuxtjs/dotenv": "^1.4.1",
"nuxt": "^2.12.2"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/create-nuxt-app/lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ module.exports = [
pageSize: 10,
choices: [
{ name: 'Axios', value: 'axios' },
{ name: 'Progressive Web App (PWA) Support', value: 'pwa' },
{ name: 'DotEnv', value: 'dotenv' }
{ name: 'Progressive Web App (PWA) Support', value: 'pwa' }
],
default: []
},
Expand Down
5 changes: 1 addition & 4 deletions packages/create-nuxt-app/lib/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
const lintStaged = eslint && this.answers.linter.includes('lintStaged')
const stylelint = this.answers.linter.includes('stylelint')
const axios = this.answers.features.includes('axios')
const dotenv = this.answers.features.includes('dotenv')
const pm = this.answers.pm === 'yarn' ? 'yarn' : 'npm'
const pmRun = this.answers.pm === 'yarn' ? 'yarn' : 'npm run'

Expand All @@ -36,8 +35,7 @@ module.exports = {
axios,
edge,
pm,
pmRun,
dotenv
pmRun
}
},
actions () {
Expand Down Expand Up @@ -84,7 +82,6 @@ module.exports = {
'_jsconfig.json': 'devTools.includes("jsconfig.json")',
'tsconfig.json': 'language.includes("ts")',
'semantic.yml': 'devTools.includes("semantic-pull-requests")',
'.env': 'features.includes("dotenv")',
'_stylelint.config.js': 'linter.includes("stylelint")'
},
templateDir
Expand Down
104 changes: 1 addition & 103 deletions packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,12 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## verify features: Axios, Progressive Web App (PWA) Support, DotEnv
## verify features: Axios, Progressive Web App (PWA) Support

> Generated files
[
'.editorconfig',
'.env',
'.gitignore',
'README.md',
'assets/README.md',
Expand All @@ -517,7 +516,6 @@ Generated by [AVA](https://avajs.dev).
{
dependencies: {
'@nuxtjs/axios': '^5.11.0',
'@nuxtjs/dotenv': '^1.4.1',
'@nuxtjs/pwa': '^3.0.0-beta.20',
nuxt: '^2.12.2',
},
Expand Down Expand Up @@ -578,8 +576,6 @@ Generated by [AVA](https://avajs.dev).
// Doc: https://axios.nuxtjs.org/usage␊
'@nuxtjs/axios',␊
'@nuxtjs/pwa',␊
// Doc: https://github.com/nuxt-community/dotenv-module␊
'@nuxtjs/dotenv',␊
],␊
/*␊
** Axios module configuration␊
Expand All @@ -595,104 +591,6 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## verify features: DotEnv

> Generated files
[
'.editorconfig',
'.env',
'.gitignore',
'README.md',
'assets/README.md',
'components/Logo.vue',
'components/README.md',
'layouts/README.md',
'layouts/default.vue',
'middleware/README.md',
'nuxt.config.js',
'package.json',
'pages/README.md',
'pages/index.vue',
'plugins/README.md',
'static/README.md',
'static/favicon.ico',
'store/README.md',
]

> package.json
{
dependencies: {
'@nuxtjs/dotenv': '^1.4.1',
nuxt: '^2.12.2',
},
devDependencies: {},
private: true,
scripts: {
build: 'nuxt build',
dev: 'nuxt',
generate: 'nuxt generate',
start: 'nuxt start',
},
}

> Generated nuxt.config.js
`␊
export default {␊
/*␊
** Nuxt rendering mode␊
** See https://nuxtjs.org/api/configuration-mode␊
*/␊
mode: 'universal',␊
/*␊
** Headers of the page␊
** See https://nuxtjs.org/api/configuration-head␊
*/␊
head: {␊
title: process.env.npm_package_name || '',␊
meta: [␊
{ charset: 'utf-8' },␊
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }␊
],␊
link: [␊
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
]␊
},␊
/*␊
** Global CSS␊
*/␊
css: [␊
],␊
/*␊
** Plugins to load before mounting the App␊
** https://nuxtjs.org/guide/plugins␊
*/␊
plugins: [␊
],␊
/*␊
** Nuxt.js dev-modules␊
*/␊
buildModules: [␊
],␊
/*␊
** Nuxt.js modules␊
*/␊
modules: [␊
// Doc: https://github.com/nuxt-community/dotenv-module␊
'@nuxtjs/dotenv',␊
],␊
/*␊
** Build configuration␊
** See https://nuxtjs.org/api/configuration-build/␊
*/␊
build: {␊
}␊
}␊
`

## verify features: Progressive Web App (PWA) Support

> Generated files
Expand Down
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.

0 comments on commit ba93891

Please sign in to comment.