diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..f46281c --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,34 @@ +name: Create release + +on: + push: + tags: + - 'v*' + +jobs: + create-release: + name: Create GitHub Release + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get semver number + id: get_semver + env: + TAG_NAME: ${{ github.ref }} + run: echo "::set-output name=num::${TAG_NAME:11}" + + - name: Create release on GitHub API + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: "v${{ steps.get_semver.outputs.num }}" + body: | + Version ${{ steps.get_semver.outputs.num }} + draft: false + prerelease: false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..18bb980 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# If you add anything here, consider also adding to .npmignore +v8.log +*.swp +*.swo +auth_info.js +dist +.idea/ +tags +nbproject/ +spec/browser/autogen_suite.js +node_modules +tmtags +*.DS_Store +examples/*/log/* +site/log/* +.log +npm-debug.log +doc/ +test/tmp +coverage/ +/ejs.js +/ejs.min.js +out/ +pkg/ +/package-lock.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3bf7794 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +sudo: false +node_js: + - "8" + - "10" + - "12" diff --git a/README.md b/README.md index 265ebfe..009809c 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,9 @@ is the included content. This project uses [JSDoc](http://usejsdoc.org/). For the full public API -documentation, clone the repository and run `npm run doc`. This will run JSDoc +documentation, clone the repository and run `jake doc`. This will run JSDoc with the proper options and output the documentation to `out/`. If you want -the both the public & private API docs, run `npm run devdoc` instead. +the both the public & private API docs, run `jake devdoc` instead. ### Tags diff --git a/debian/changelog b/debian/changelog index 9b1b505..4fe6a65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -node-ejs (3.1.5-1) UNRELEASED; urgency=medium +node-ejs (3.1.6-1) UNRELEASED; urgency=medium # TODO: fix node-express before upload @@ -18,7 +18,10 @@ * Declare compliance with policy 4.5.1 * Modernize debian/watch - -- Xavier Guimard Sun, 27 Dec 2020 10:40:13 +0100 + [ Debian Janitor ] + * New upstream release. + + -- Xavier Guimard Tue, 08 Jun 2021 18:17:37 -0000 node-ejs (2.5.7-3) unstable; urgency=medium diff --git a/jakefile.js b/jakefile.js index 271c167..3953160 100644 --- a/jakefile.js +++ b/jakefile.js @@ -33,12 +33,18 @@ console.log('Minification completed.'); }); -desc('Generates the EJS API docs'); -task('doc', function (dev) { +desc('Generates the EJS API docs for the public API'); +task('doc', function () { jake.rmRf('out'); - var p = dev ? '-p' : ''; - exec('./node_modules/.bin/jsdoc ' + p + ' -c jsdoc.json lib/* docs/jsdoc/*'); - console.log('Documentation generated.'); + exec('./node_modules/.bin/jsdoc --verbose -c jsdoc.json lib/* docs/jsdoc/*'); + console.log('Documentation generated in ./out.'); +}); + +desc('Generates the EJS API docs for the public and private API'); +task('devdoc', function () { + jake.rmRf('out'); + exec('./node_modules/.bin/jsdoc --verbose -p -c jsdoc.json lib/* docs/jsdoc/*'); + console.log('Documentation generated in ./out.'); }); desc('Publishes the EJS API docs'); diff --git a/lib/ejs.js b/lib/ejs.js index 104aada..aa6322e 100755 --- a/lib/ejs.js +++ b/lib/ejs.js @@ -578,6 +578,8 @@ var escapeFn = opts.escapeFunction; /** @type {FunctionConstructor} */ var ctor; + /** @type {string} */ + var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : 'undefined'; if (!this.source) { this.generateSource(); @@ -609,8 +611,7 @@ if (opts.compileDebug) { src = 'var __line = 1' + '\n' + ' , __lines = ' + JSON.stringify(this.templateText) + '\n' - + ' , __filename = ' + (opts.filename ? - JSON.stringify(opts.filename) : 'undefined') + ';' + '\n' + + ' , __filename = ' + sanitizedFilename + ';' + '\n' + 'try {' + '\n' + this.source + '} catch (e) {' + '\n' @@ -636,7 +637,7 @@ } if (opts.compileDebug && opts.filename) { src = src + '\n' - + '//# sourceURL=' + opts.filename + '\n'; + + '//# sourceURL=' + sanitizedFilename + '\n'; } try { diff --git a/package-lock.json b/package-lock.json index af51801..83bb9f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ejs", - "version": "3.1.2", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -472,9 +472,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -832,9 +832,9 @@ } }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "dev": true, "requires": { "bn.js": "^4.4.0", @@ -950,9 +950,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "strip-json-comments": { @@ -1465,9 +1465,9 @@ "dev": true }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "strip-ansi": { @@ -1769,9 +1769,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash.memoize": { @@ -2422,9 +2422,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } @@ -2826,9 +2826,9 @@ "dev": true }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "string-width": { @@ -3252,9 +3252,9 @@ }, "dependencies": { "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true } } diff --git a/package.json b/package.json index 974efa4..c2b036b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "engine", "ejs" ], - "version": "3.1.5", + "version": "3.1.6", "author": "Matthew Eernisse (http://fleegix.org)", "license": "Apache-2.0", "bin": {