Skip to content

Commit 111ec87

Browse files
Michael J. Ryantracker1
authored andcommitted
Updates for gulp-footer
* Swap mocha for jest, better code coverage output * Swap should for jest's expect * Add github workflows for test and publish * add coverage to gitignore/npmignore
1 parent 81b76c5 commit 111ec87

File tree

11 files changed

+5823
-2614
lines changed

11 files changed

+5823
-2614
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Node.js Release
2+
3+
on:
4+
create:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
- run: npm ci
17+
- run: npm test
18+
19+
publish-npm:
20+
needs: test
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v1
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: 12
27+
registry-url: https://registry.npmjs.org/
28+
- run: npm ci
29+
- run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32+
# publish-gpr:
33+
# needs: build
34+
# runs-on: ubuntu-latest
35+
# steps:
36+
# - uses: actions/checkout@v1
37+
# - uses: actions/setup-node@v1
38+
# with:
39+
# node-version: 12
40+
# registry-url: https://npm.pkg.github.com/
41+
# scope: "@gulp-community"
42+
# - run: npm ci
43+
# - run: npm publish
44+
# env:
45+
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test-master.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tests
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the master branch
6+
push:
7+
tags-ignore:
8+
- v*
9+
branches:
10+
- master
11+
pull_request:
12+
branches:
13+
- master
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v1
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: 12
23+
- run: npm ci
24+
- run: npm test

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
coverage
2+
13
lib-cov
24
*.seed
35
*.log
@@ -12,4 +14,4 @@ logs
1214
results
1315

1416
npm-debug.log
15-
node_modules
17+
node_modules

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
coverage
2+
13
lib-cov
24
*.seed
35
*.log

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
The canonical location of this project is now [gulp-community/gulp-header](https://github.com/gulp-community/gulp-header).
22

3-
# gulp-header [![NPM version](https://badge.fury.io/js/gulp-header.png)](http://badge.fury.io/js/gulp-header) [![Build Status](https://travis-ci.org/tracker1/gulp-header.svg?branch=master)](https://travis-ci.org/tracker1/gulp-header)
3+
# gulp-header
4+
5+
[![npm version](https://img.shields.io/github/package-json/v/gulp-community/gulp-header)](https://www.npmjs.com/package/gulp-header)
6+
[![Actions Status](https://github.com/gulp-community/gulp-header/workflows/Tests/badge.svg)](https://github.com/gulp-community/gulp-header/actions)
7+
[![Code Coverage](https://img.shields.io/coveralls/github/gulp-community/gulp-header)](https://github.com/gulp-community/gulp-header)
8+
[![Dependency Status](https://img.shields.io/librariesio/release/npm/gulp-header)](https://libraries.io/npm/gulp-header)
9+
![Github Issues](https://img.shields.io/github/issues/gulp-community/gulp-header?style=plastic)
10+
[![MIT License](https://img.shields.io/github/license/gulp-community/gulp-header)](./LICENSE)
411

512
gulp-header is a [Gulp](https://github.com/gulpjs/gulp) extension to add a header to file(s) in the pipeline. [Gulp is a streaming build system](https://github.com/gulpjs/gulp) utilizing [node.js](http://nodejs.org/).
613

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module.exports = (headerText, data) => {
1919
// format template
2020
const filename = path.basename(file.path);
2121
const template =
22-
data === false ?
23-
headerText
22+
data === false
23+
? headerText
2424
: lodashTemplate(headerText)(
2525
Object.assign({}, file.data || {}, { file: file, filename: filename }, data)
2626
);
@@ -78,14 +78,14 @@ module.exports = (headerText, data) => {
7878
/**
7979
* is stream?
8080
*/
81-
const isStream = (obj) => {
81+
const isStream = obj => {
8282
return obj instanceof stream.Stream;
8383
};
8484

8585
/**
8686
* Is File, and Exists
8787
*/
88-
const isExistingFile = (file) => {
88+
const isExistingFile = file => {
8989
try {
9090
if (!(file && typeof file === 'object')) return false;
9191
if (file.isDirectory()) return false;

0 commit comments

Comments
 (0)