Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed default view engine to pug #283

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3374407
Changed default view engine to pug
DDRAGON Nov 7, 2020
d706d3c
tests: allow verbose npm install output
dougwilson Aug 27, 2020
46733e5
build: use GitHub Actions instead of Travis CI
DDRAGON Apr 26, 2022
c5ef8c7
build: support Node.js 10.x
dougwilson Aug 29, 2020
5d80e50
build: Node.js@6.17
dougwilson Sep 1, 2020
385b415
build: Node.js@8.17
dougwilson Sep 5, 2020
989d685
build: support Node.js 11.x
dougwilson Nov 4, 2020
8d0faa9
build: Node.js@10.23
dougwilson Nov 4, 2020
e2d3d39
build: support Node.js 12.x
dougwilson Jan 12, 2021
ca12362
gen: update express to ~4.16.4
dougwilson Jan 15, 2021
a61281d
gen: update morgan to ~1.10.0
DDRAGON Apr 26, 2022
3937441
build: eslint-plugin-standard@4.1.0
dougwilson Jan 15, 2021
a48a903
build: eslint-plugin-import@2.22.1
dougwilson Jan 18, 2021
f7ce81d
build: ejs@2.6.2
dougwilson Jan 19, 2021
314e99a
build: mocha@6.2.3
dougwilson Jan 19, 2021
bd22fe7
lint: apply standard 13 style
dougwilson Jan 30, 2021
4c8054b
build: support Node.js 13.x
dougwilson Jan 30, 2021
5d57fb6
build: rimraf@2.7.1
dougwilson Feb 6, 2021
7afe91d
build: tree-kill@1.2.2
dougwilson Feb 6, 2021
532e909
build: mocha@7.2.0
dougwilson Feb 7, 2021
3a423ab
build: Node.js@10.24
dougwilson Mar 12, 2021
1bb3eac
build: Node.js@12.21
dougwilson Mar 22, 2021
f2dfb8d
build: support Node.js 14.x
dougwilson Apr 11, 2021
bb5f6ed
lint: apply standard 14 style
dougwilson Apr 21, 2021
00911a5
build: mocha@7.2.0
dougwilson Apr 21, 2021
e6d3aff
build: support Node.js 15.x
dougwilson May 1, 2021
b52369e
gen: update cookie-parser to ~1.4.5
dougwilson May 7, 2021
6ba9ba0
build: eslint-plugin-promise@4.3.1
dougwilson May 11, 2021
b547ee0
build: mocha@8.4.0
dougwilson May 11, 2021
8022389
deps: commander@2.16.0
dougwilson May 29, 2021
ca54a4d
build: Node.js@14.17
dougwilson May 29, 2021
455b583
build: eslint-plugin-import@2.23.4
dougwilson Jun 11, 2021
18458b5
build: rimraf@3.0.2
dougwilson Jun 11, 2021
2bc529b
build: eslint@7.30.0
dougwilson Jul 3, 2021
aba243e
build: Node.js@12.22
dougwilson Jul 9, 2021
8ee9922
build: supertest@6.1.3
dougwilson Jul 9, 2021
f28f0eb
build: mocha@9.0.2
dougwilson Jul 14, 2021
df9fb53
build: disable fast-fail for GitHub Actions
dougwilson Jul 19, 2021
c122a5f
gen: update express to ~4.17.1
dougwilson Jul 30, 2021
3a4c285
gen: update http-errors to ~1.7.2
DDRAGON Apr 26, 2022
09f1190
tests: assert added dependencies for css
dougwilson Aug 1, 2021
2ee67e5
tests: assert added dependency for dust
dougwilson Aug 2, 2021
13eee73
tests: assert added dependency for ejs
dougwilson Aug 2, 2021
1e77810
build: eslint@7.32.0
dougwilson Aug 4, 2021
3160d31
build: supertest@6.1.4
dougwilson Aug 6, 2021
80dddb7
build: mocha@9.0.3
dougwilson Aug 7, 2021
cd23752
build: eslint-plugin-promise@5.1.0
dougwilson Aug 27, 2021
9fa1bf6
build: eslint-plugin-import@2.24.2
dougwilson Aug 27, 2021
a34acba
build: mocha@9.1.0
dougwilson Sep 3, 2021
5b07c12
build: Node.js@14.18
dougwilson Oct 12, 2021
9be93f8
Changed default view engine to pug
DDRAGON Apr 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: ci

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- Node.js 0.10
- Node.js 0.12
- io.js 1.x
- io.js 2.x
- io.js 3.x
- Node.js 4.x
- Node.js 5.x
- Node.js 6.x
- Node.js 7.x
- Node.js 8.x
- Node.js 9.x
- Node.js 10.x
- Node.js 11.x
- Node.js 12.x
- Node.js 13.x
- Node.js 14.x
- Node.js 15.x

include:
- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0

- name: Node.js 0.12
node-version: "0.12"
npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0

- name: io.js 1.x
node-version: "1.8"
npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0

- name: io.js 2.x
node-version: "2.5"
npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0

- name: io.js 3.x
node-version: "3.3"
npm-i: mocha@3.5.3 rimraf@2.7.1 supertest@2.0.0

- name: Node.js 4.x
node-version: "4.9"
npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2

- name: Node.js 5.x
node-version: "5.12"
npm-i: mocha@5.2.0 rimraf@2.7.1 supertest@3.4.2

- name: Node.js 6.x
node-version: "6.17"
npm-i: mocha@6.2.3

- name: Node.js 7.x
node-version: "7.10"
npm-i: mocha@6.2.3

- name: Node.js 8.x
node-version: "8.17"
npm-i: mocha@7.2.0

- name: Node.js 9.x
node-version: "9.11"
npm-i: mocha@7.2.0

- name: Node.js 10.x
node-version: "10.24"
npm-i: mocha@8.4.0

- name: Node.js 11.x
node-version: "11.15"
npm-i: mocha@8.4.0

- name: Node.js 12.x
node-version: "12.22"

- name: Node.js 13.x
node-version: "13.14"

- name: Node.js 14.x
node-version: "14.18"

- name: Node.js 15.x
node-version: "15.14"

steps:
- uses: actions/checkout@v2

- name: Install Node.js ${{ matrix.node-version }}
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"

- name: Configure npm
run: npm config set shrinkwrap false

- name: Install npm module(s) ${{ matrix.npm-i }}
run: npm install --save-dev ${{ matrix.npm-i }}
if: matrix.npm-i != ''

- name: Setup Node.js version-specific dependencies
shell: bash
run: |
# eslint for linting
# - remove on Node.js < 10
if [[ "$(cut -d. -f1 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
node -pe 'Object.keys(require("./package").devDependencies).join("\n")' | \
grep -E '^eslint(-|$)' | \
sort -r | \
xargs -n1 npm rm --silent --save-dev
fi

- name: Install Node.js dependencies
run: npm install

- name: List environment
id: list_env
shell: bash
run: |
echo "node@$(node -v)"
echo "npm@$(npm -v)"
npm -s ls ||:
(npm -s ls --depth=0 ||:) | awk -F'[ @]' 'NR>1 && $2 { print "::set-output name=" $2 "::" $3 }'

- name: Run tests
run: npm run test-ci

- name: Lint code
if: steps.list_env.outputs.eslint != ''
run: npm run lint
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Linux Build][travis-image]][travis-url]
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
[![Windows Build][appveyor-image]][appveyor-url]

## Installation
Expand Down Expand Up @@ -44,7 +44,7 @@ This generator can also be further configured with the following command line fl
--pug add pug engine support
--hbs add handlebars engine support
-H, --hogan add hogan.js engine support
-v, --view <engine> add view <engine> support (dust|ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)
-v, --view <engine> add view <engine> support (dust|ejs|hbs|hjs|jade|pug|twig|vash) (defaults to pug)
--no-view use static html instead of view engine
-c, --css <engine> add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
--git add .gitignore
Expand All @@ -57,9 +57,9 @@ This generator can also be further configured with the following command line fl

[npm-image]: https://img.shields.io/npm/v/express-generator.svg
[npm-url]: https://npmjs.org/package/express-generator
[travis-image]: https://img.shields.io/travis/expressjs/generator/master.svg?label=linux
[travis-url]: https://travis-ci.org/expressjs/generator
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/generator/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/generator
[downloads-image]: https://img.shields.io/npm/dm/express-generator.svg
[downloads-url]: https://npmjs.org/package/express-generator
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/generator/ci/master?label=linux
[github-actions-ci-url]: https://github.com/expressjs/generator/actions/workflows/ci.yml
24 changes: 21 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
environment:
matrix:
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "1.8"
- nodejs_version: "2.5"
- nodejs_version: "3.3"
- nodejs_version: "4.9"
Expand All @@ -11,6 +8,12 @@ environment:
- nodejs_version: "7.10"
- nodejs_version: "8.15"
- nodejs_version: "9.11"
- nodejs_version: "10.24"
- nodejs_version: "11.15"
- nodejs_version: "12.22"
- nodejs_version: "13.14"
- nodejs_version: "14.18"
- nodejs_version: "15.14"
cache:
- node_modules
install:
Expand All @@ -33,10 +36,25 @@ install:
# mocha for testing
# - use 3.x for Node.js < 4
# - use 5.x for Node.js < 6
# - use 6.x for Node.js < 8
# - use 7.x for Node.js < 10
# - use 8.x for Node.js < 12
if ([int]$env:nodejs_version.split(".")[0] -lt 4) {
npm install --silent --save-dev mocha@3.5.3
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev mocha@5.2.0
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 8) {
npm install --silent --save-dev mocha@6.2.3
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 10) {
npm install --silent --save-dev mocha@7.2.0
} elseif ([int]$env:nodejs_version.split(".")[0] -lt 12) {
npm install --silent --save-dev mocha@8.4.0
}
- ps: |
# rimraf for testing cleanup
# - use 2.7.1 for Node.js < 6
if ([int]$env:nodejs_version.split(".")[0] -lt 6) {
npm install --silent --save-dev rimraf@2.7.1
}
- ps: |
# supertest for http calls
Expand Down
24 changes: 12 additions & 12 deletions bin/express-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ program
.option(' --pug', 'add pug engine support', renamedOption('--pug', '--view=pug'))
.option(' --hbs', 'add handlebars engine support', renamedOption('--hbs', '--view=hbs'))
.option('-H, --hogan', 'add hogan.js engine support', renamedOption('--hogan', '--view=hogan'))
.option('-v, --view <engine>', 'add view <engine> support (dust|ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)')
.option('-v, --view <engine>', 'add view <engine> support (dust|ejs|hbs|hjs|jade|pug|twig|vash) (defaults to pug)')
.option(' --no-view', 'use static html instead of view engine')
.option('-c, --css <engine>', 'add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)')
.option(' --git', 'add .gitignore')
Expand Down Expand Up @@ -145,8 +145,8 @@ function createApplication (name, dir) {
start: 'node ./bin/www'
},
dependencies: {
'debug': '~2.6.9',
'express': '~4.16.1'
debug: '~2.6.9',
express: '~4.17.1'
}
}

Expand All @@ -166,7 +166,7 @@ function createApplication (name, dir) {
// Request logger
app.locals.modules.logger = 'morgan'
app.locals.uses.push("logger('dev')")
pkg.dependencies.morgan = '~1.9.1'
pkg.dependencies.morgan = '~1.10.0'

// Body parsers
app.locals.uses.push('express.json()')
Expand All @@ -175,7 +175,7 @@ function createApplication (name, dir) {
// Cookie parser
app.locals.modules.cookieParser = 'cookie-parser'
app.locals.uses.push('cookieParser()')
pkg.dependencies['cookie-parser'] = '~1.4.4'
pkg.dependencies['cookie-parser'] = '~1.4.5'

if (dir !== '.') {
mkdir(dir, '.')
Expand Down Expand Up @@ -212,7 +212,7 @@ function createApplication (name, dir) {
if (program.view) {
// Copy view templates
mkdir(dir, 'views')
pkg.dependencies['http-errors'] = '~1.6.3'
pkg.dependencies['http-errors'] = '~1.7.2'
switch (program.view) {
case 'dust':
copyTemplateMulti('views', dir + '/views', '*.dust')
Expand Down Expand Up @@ -264,7 +264,7 @@ function createApplication (name, dir) {
case 'stylus':
app.locals.modules.stylus = 'stylus'
app.locals.uses.push("stylus.middleware(path.join(__dirname, 'public'))")
pkg.dependencies['stylus'] = '0.54.5'
pkg.dependencies.stylus = '0.54.5'
break
}

Expand Down Expand Up @@ -304,7 +304,7 @@ function createApplication (name, dir) {
break
case 'pug':
app.locals.view = { engine: 'pug' }
pkg.dependencies.pug = '2.0.0-beta11'
pkg.dependencies.pug = '~3.0.2'
break
case 'twig':
app.locals.view = { engine: 'twig' }
Expand Down Expand Up @@ -456,14 +456,14 @@ function main () {
if (program.ejs) program.view = 'ejs'
if (program.hbs) program.view = 'hbs'
if (program.hogan) program.view = 'hjs'
if (program.pug) program.view = 'pug'
if (program.jade) program.view = 'jade'
}

// Default view engine
if (program.view === true) {
warning('the default view engine will not be jade in future releases\n' +
"use `--view=jade' or `--help' for additional options")
program.view = 'jade'
warning('the default view engine is pug now\n' +
"use `--view=jade' if you want to use jade or `--help' for additional options")
program.view = 'pug'
}

// Generate application
Expand Down
Loading