Skip to content

Commit

Permalink
Merge pull request #1053 from mozilla/develop
Browse files Browse the repository at this point in the history
Add babel transpilation support and phantomjs browser tests (now also testing nunjucks-slim)
  • Loading branch information
fdintino committed Feb 20, 2018
2 parents 989a7ee + 79b8ef3 commit 5ca49e8
Show file tree
Hide file tree
Showing 95 changed files with 5,950 additions and 39,217 deletions.
19 changes: 19 additions & 0 deletions .babelrc
@@ -0,0 +1,19 @@
{
"presets": [
["@babel/env", {
"loose": true,
"targets": {
"browsers": ["last 2 versions", "safari >= 7", "ie 9"],
"node": "4"
}
}]
],
"env": {
"test": {
"plugins": ["./scripts/lib/arrow-function-coverage-fix", "istanbul"]
}
},
"ignore": [
"scripts/lib/arrow-function-coverage-fix.js"
]
}
62 changes: 42 additions & 20 deletions .eslintrc.js
@@ -1,30 +1,52 @@
module.exports = {
'extends': 'eslint:recommended',
'parserOptions': {
'sourceType': 'module',
'ecmaVersion': 2017
'extends': [
'airbnb-base/legacy',
],
'parserOptions': {
'sourceType': 'module',
'ecmaVersion': 2017,
},
'env': {
'node': true,
'es6': true,
'mocha': true,
'browser': true
},
'rules': {
'indent': ['error', 2, { 'SwitchCase': 1 }],
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'semi': [2, 'always'],
'brace-style': ['error', '1tbs'],
'comma-style': ['error', 'last'],
'comma-spacing': ['error', {'after': true, 'before': false}],
'eol-last': ['error', 'always'],
'func-call-spacing': ['error', 'never'],
'semi-spacing': ['error', {'before': false, 'after': true}],
'keyword-spacing': ['error', {'before': true, 'after': true}],
"rules": {
// The one assertion of personal preference: no spaces before parentheses
// of anonymous functions
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
// Temporarily disabled rules
//
// no-use-before-define is a good rule, but it would make the diff for
// linting the code even more inscrutible than it already is.
'no-use-before-define': 'off',
// Relax some rules
'no-cond-assign': ['error', 'except-parens'],
'no-unused-vars': ['error', {
'args': 'none',
}],
// Disable some overly-strict airbnb style rules
'no-underscore-dangle': 'off',
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
'function-paren-newline': 'off',
'no-plusplus': 'off',
'object-curly-spacing': 'off',
'no-multi-assign': 'off',
'no-else-return': 'off',
// While technically useless from the point of view of the regex parser,
// escaping characters inside character classes is more consistent. I
// would say that they make the regular expression more readable, if the
// idea of readable regular expressions wasn't absurd on its face.
'no-useless-escape': 'off',
'no-constant-condition': 'off'
// I'm inclined to reverse this rule to be ['error', 'always'], but not just yet
// IE 8 is a thing of the past and trailing commas are useful.
'comma-dangle': 'off',
},
'globals': {
'nunjucks': false
}
'nunjucks': false,
},
};
11 changes: 10 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,13 @@ node_modules
coverage
.#*
docs/_site
docs/files
docs/files
/src/
/index.js
/index.js.map
/tests/browser/nunjucks*
.nyc_output
/browser
/tests/browser/precompiled-templates.js
/samples/express/js/nunjucks.js
/samples/express/js/templates.js
3 changes: 3 additions & 0 deletions .npmignore
@@ -1,5 +1,8 @@
node_modules
coverage
.nyc_output
docs
tests
bench
nunjucks
scripts
10 changes: 8 additions & 2 deletions .travis.yml
@@ -1,6 +1,12 @@
language: node_js
sudo: false
node_js:
- "7"
- "8"
- "6"
- "5"
- "4"
install:
- npm install
- npm install codecov
script:
- npm test
- npm run codecov
7 changes: 6 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,14 +2,19 @@ Changelog
=========


master (unreleased)
3.1.0 (Feb 19 2018)
-------------------

* Support nunjucks.installJinjaCompat() with slim build. Fixes
[#1019](https://github.com/mozilla/nunjucks/issues/1019)

* Fix calling render callback twice when a conditional import throws an error.
Solves [#1029](https://github.com/mozilla/nunjucks/issues/1029)

* Support objects created with Object.create(null). fixes [#468](https://github.com/mozilla/nunjucks/issues/468)

* Support ESNext iterators, using Array.from. Merge of
[#1058](https://github.com/mozilla/nunjucks/pull/1058)

3.0.1 (May 24 2017)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -9,7 +9,7 @@ Nunjucks has the following purpose:

* Aim for templating feature parity with Jinja2.
* Aim for templating feature parity with Twig, but only when not conflicting with Jinja2 parity.
* Works in Node >= v0.10 (as defined in [Travis test matrix]).(https://github.com/mozilla/nunjucks/blob/master/.travis.yml#L9).
* Works in Node LTS 4, 6, and >= 8.
* Works in all modern browsers (with [ES5 support](http://kangax.github.io/compat-table/es5/)).
* Works in IE8 with [es5-shim](https://github.com/es-shims/es5-shim).
* Keep footprint browser files as small as possible (save on bandwidth, download time).
Expand Down
5 changes: 3 additions & 2 deletions appveyor.yml
Expand Up @@ -5,9 +5,8 @@ init:
# Test against these versions of Node.js.
environment:
matrix:
- nodejs_version: "7"
- nodejs_version: "8"
- nodejs_version: "6"
- nodejs_version: "5"
- nodejs_version: "4"

# Install scripts. (runs after repo cloning)
Expand All @@ -16,6 +15,7 @@ install:
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install
- npm install codecov

# Post-install test scripts.
test_script:
Expand All @@ -24,6 +24,7 @@ test_script:
- npm --version
# run tests
- npm test
- npm run codecov

# Don't actually build.
build: off
8 changes: 0 additions & 8 deletions bin/bundle

This file was deleted.

89 changes: 0 additions & 89 deletions bin/bundle.js

This file was deleted.

0 comments on commit 5ca49e8

Please sign in to comment.