Skip to content

Commit

Permalink
chore!: Upgrade scaffold, dropping node <10 support (#8)
Browse files Browse the repository at this point in the history
* Scaffold: Run update-template
* Build: Update for new lint, fix tests for new expect.

Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com>
  • Loading branch information
coreyfarrell and phated committed Sep 1, 2022
1 parent 5d476f9 commit f095480
Show file tree
Hide file tree
Showing 14 changed files with 150 additions and 86 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/dev.yml
@@ -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: 'Build: 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]
os: [ubuntu-latest, windows-latest, macos-latest]

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

- name: Set Node.js version
uses: actions/setup-node@v1
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.0
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.0
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
51 changes: 40 additions & 11 deletions .gitignore
@@ -1,35 +1,64 @@
# 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

# Compiled binary addons (http://nodejs.org/api/addons.html)
# 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 directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
# Dependency directories
node_modules/
jspm_packages/

# Users Environment Variables
.lock-wscript
# 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

# Generated by integration tests
test/fixtures/tmp
test/fixtures/out
3 changes: 0 additions & 3 deletions .jscsrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock=false
2 changes: 2 additions & 0 deletions .prettierignore
@@ -0,0 +1,2 @@
coverage/
.nyc_output/
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
Copyright (c) 2017, 2020 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 9 additions & 13 deletions README.md
Expand Up @@ -6,7 +6,7 @@

# to-through

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Wrap a ReadableStream in a TransformStream.

Expand Down Expand Up @@ -39,18 +39,14 @@ Takes a `readableStream` as the only argument and returns a `through2` stream. I

MIT

[downloads-image]: http://img.shields.io/npm/dm/to-through.svg
[npm-url]: https://npmjs.com/package/to-through
[npm-image]: http://img.shields.io/npm/v/to-through.svg
<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/to-through.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/to-through
[npm-image]: https://img.shields.io/npm/v/to-through.svg?style=flat-square

[travis-url]: https://travis-ci.org/gulpjs/to-through
[travis-image]: http://img.shields.io/travis/gulpjs/to-through.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/to-through
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/to-through.svg?label=appveyor
[ci-url]: https://github.com/gulpjs/to-through/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/to-through/dev?style=flat-square

[coveralls-url]: https://coveralls.io/r/gulpjs/to-through
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/to-through/master.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/to-through/master.svg?style=flat-square
<!-- prettier-ignore-end -->
25 changes: 0 additions & 25 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -21,7 +21,7 @@ function toThrough(readable) {

function onReadable() {
var chunk;
while (chunk = readable.read()) {
while ((chunk = readable.read())) {
self.push(chunk);
}
}
Expand Down
32 changes: 18 additions & 14 deletions package.json
Expand Up @@ -2,40 +2,44 @@
"name": "to-through",
"version": "2.0.0",
"description": "Wrap a ReadableStream in a TransformStream.",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulpjs/to-through",
"license": "MIT",
"engines": {
"node": ">= 0.10"
"node": ">=10.13.0"
},
"main": "index.js",
"files": [
"LICENSE",
"index.js"
],
"scripts": {
"lint": "eslint index.js test/ && jscs index.js test/",
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
"test": "nyc mocha --async-only"
},
"dependencies": {
"through2": "^2.0.3"
},
"devDependencies": {
"eslint": "^1.10.3",
"eslint-config-gulp": "^2.0.0",
"expect": "^1.20.2",
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"jscs": "^2.4.0",
"jscs-preset-gulp": "^1.0.0",
"eslint": "^7.0.0",
"eslint-config-gulp": "^5.0.0",
"expect": "^26.0.1",
"mississippi": "^1.3.0",
"mocha": "^3.2.0"
"mocha": "^7.1.2",
"nyc": "^15.0.1"
},
"nyc": {
"reporter": [
"lcov",
"text-summary"
]
},
"prettier": {
"singleQuote": true
},
"keywords": [
"transform",
Expand Down
3 changes: 0 additions & 3 deletions test/.eslintrc

This file was deleted.

Empty file added test/.gitkeep
Empty file.
9 changes: 4 additions & 5 deletions test/index.js
Expand Up @@ -21,7 +21,7 @@ describe('toThrough (buffer mode)', function() {
var readable = from(contents);

function assert(result) {
expect(result).toEqual(contents.join(''));
expect(result.toString()).toEqual(contents.join(''));
}

pipe([
Expand All @@ -34,7 +34,7 @@ describe('toThrough (buffer mode)', function() {
var readable = from(contents);

function assert(result) {
expect(result).toEqual(contents.join(''));
expect(result.toString()).toEqual(contents.join(''));
}

pipe([
Expand All @@ -48,7 +48,7 @@ describe('toThrough (buffer mode)', function() {
var readable = from(contents);

function assert(result) {
expect(result).toEqual(preContents.concat(contents).join(''));
expect(result.toString()).toEqual(preContents.concat(contents).join(''));
}

pipe([
Expand All @@ -62,7 +62,6 @@ describe('toThrough (buffer mode)', function() {
var readable = from([new Error('boom')]);

function assert(err) {
expect(err).toExist();
expect(err.message).toEqual('boom');
done();
}
Expand All @@ -80,7 +79,7 @@ describe('toThrough (buffer mode)', function() {
var wrapped = toThrough(readable);

function assert(result) {
expect(result).toEqual(preContents.concat(contents).join(''));
expect(result.toString()).toEqual(preContents.concat(contents).join(''));
}

process.nextTick(function() {
Expand Down

0 comments on commit f095480

Please sign in to comment.