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 #236

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 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 @@ -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 = '~2.0.0'
break
case 'twig':
app.locals.view = { engine: 'twig' }
Expand Down Expand Up @@ -461,9 +461,9 @@ function main () {

// 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
32 changes: 16 additions & 16 deletions test/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('express(1)', function () {
})
})

it('should print jade view warning', function () {
assert.strictEqual(ctx.stderr, "\n warning: the default view engine will not be jade in future releases\n warning: use `--view=jade' or `--help' for additional options\n\n")
it('should print pug view warning', function () {
assert.strictEqual(ctx.stderr, "\n warning: the default view engine is pug now\n warning: use `--view=jade' if you want to use jade or `--help' for additional options\n\n")
})

it('should provide debug instructions', function () {
Expand All @@ -51,10 +51,10 @@ describe('express(1)', function () {
assert.notStrictEqual(ctx.files.indexOf('package.json'), -1)
})

it('should have jade templates', function () {
assert.notStrictEqual(ctx.files.indexOf('views/error.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/index.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/layout.jade'), -1)
it('should have pug templates', function () {
assert.notStrictEqual(ctx.files.indexOf('views/error.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/index.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/layout.pug'), -1)
})

it('should have a package.json file', function () {
Expand All @@ -72,8 +72,8 @@ describe('express(1)', function () {
' "debug": "~2.6.9",\n' +
' "express": "~4.16.1",\n' +
' "http-errors": "~1.6.3",\n' +
' "jade": "~1.11.0",\n' +
' "morgan": "~1.9.1"\n' +
' "morgan": "~1.9.1",\n' +
' "pug": "~2.0.0"\n' +
' }\n' +
'}\n')
})
Expand Down Expand Up @@ -222,10 +222,10 @@ describe('express(1)', function () {
assert.notStrictEqual(ctx.files.indexOf('foo/package.json'), -1)
})

it('should have jade templates', function () {
assert.notStrictEqual(ctx.files.indexOf('foo/views/error.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('foo/views/index.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('foo/views/layout.jade'), -1)
it('should have pug templates', function () {
assert.notStrictEqual(ctx.files.indexOf('foo/views/error.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('foo/views/index.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('foo/views/layout.pug'), -1)
})
})

Expand Down Expand Up @@ -475,10 +475,10 @@ describe('express(1)', function () {
assert.notStrictEqual(ctx.files.indexOf('.gitignore'), -1, 'should have .gitignore file')
})

it('should have jade templates', function () {
assert.notStrictEqual(ctx.files.indexOf('views/error.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/index.jade'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/layout.jade'), -1)
it('should have pug templates', function () {
assert.notStrictEqual(ctx.files.indexOf('views/error.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/index.pug'), -1)
assert.notStrictEqual(ctx.files.indexOf('views/layout.pug'), -1)
})
})

Expand Down