Skip to content

Commit

Permalink
Breaking: Upgrade scaffold, dropping node <10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Feb 28, 2021
1 parent 64cccd9 commit 6d28767
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 44 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "gulp"
"extends": "gulp",
"rules": {
"max-statements": 0
}
}
16 changes: 14 additions & 2 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
## Security contact information
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
| 0.7.0 | :white_check_mark: |
| < 0.7.0 | :x: |

## Reporting a Vulnerability

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

50 changes: 43 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,67 @@
# 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

# Test results
test.xunit
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage/
.nyc_output/
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# rechoir

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis 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] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Prepare a node environment to require files with different extensions.

Expand All @@ -19,10 +19,10 @@ This module, in conjunction with [interpret]-like objects, can register any file

## rechoir for enterprise

Available as part of the Tidelift Subscription

The maintainers of rechoir and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-rechoir?utm_source=npm-rechoir&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
Available as part of the Tidelift Subscription.

The maintainers of `rechoir` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.][tidelift-url]


## Usage

Expand All @@ -42,7 +42,7 @@ console.log(require('./test/fixtures/test.toml'));

### `prepare(config, filepath, [cwd], [noThrow])`

Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions](http://nodejs.org/api/globals.html#globals_require_extensions).
Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions].

`config` An [interpret]-like configuration object.

Expand All @@ -62,22 +62,21 @@ If a loader is already registered, this will simply return `true`.

MIT

[interpret]: http://github.com/gulpjs/interpret
[Liftoff]: http://github.com/gulpjs/liftoff
[interpret]: https://github.com/gulpjs/interpret
[require.extensions]: https://nodejs.org/api/modules.html#modules_require_extensions
[Liftoff]: https://github.com/js-cli/js-liftoff

[downloads-image]: http://img.shields.io/npm/dm/rechoir.svg
[downloads-image]: https://img.shields.io/npm/dm/rechoir.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/rechoir
[npm-image]: http://img.shields.io/npm/v/rechoir.svg
[npm-image]: https://img.shields.io/npm/v/rechoir.svg?style=flat-square

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

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/rechoir
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/rechoir.svg?label=appveyor

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

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/rechoir/master.svg

[tidelift-url]: https://tidelift.com/subscription/pkg/npm-rechoir?utm_source=npm-rechoir&utm_medium=referral&utm_campaign=enterprise&utm_term=repo
28 changes: 17 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"repository": "gulpjs/rechoir",
"license": "MIT",
"engines": {
"node": ">= 0.10"
"node": ">= 10.13.0"
},
"main": "index.js",
"files": [
Expand All @@ -21,20 +21,26 @@
"scripts": {
"lint": "eslint .",
"pretest": "rm -rf tmp/ && 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": {
"resolve": "^1.9.0"
"resolve": "^1.20.0"
},
"devDependencies": {
"eslint": "^2.13.0",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.20.2",
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"mocha": "^3.5.3"
"eslint": "^7.21.0",
"eslint-config-gulp": "^5.0.1",
"expect": "^26.6.2",
"mocha": "^8.3.0",
"nyc": "^15.1.0"
},
"nyc": {
"reporter": [
"lcov",
"text-summary"
]
},
"prettier": {
"singleQuote": true
},
"keywords": [
"require",
Expand Down
3 changes: 0 additions & 3 deletions test/.eslintrc

This file was deleted.

12 changes: 6 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('rechoir', function() {
});

it('should return an error if the specified module cannot be registered', function(done) {
expect(register(__dirname, 'whatev')).toBeAn(Error);
expect(register(__dirname, 'whatev')).toBeInstanceOf(Error);

done();
});
Expand Down Expand Up @@ -176,11 +176,11 @@ describe('rechoir', function() {

// Check the failure entries in the thrown or returned error object.
function checkFailures(e) {
expect(e.failures).toBeAn('array');
expect(e.failures[0].error).toBeAn(Error);
expect(e.failures).toBeInstanceOf(Array);
expect(e.failures[0].error).toBeInstanceOf(Error);
expect(e.failures[0].moduleName).toEqual('nothere');
expect(e.failures[0].module).toEqual(null);
expect(e.failures[1].error).toBeAn(Error);
expect(e.failures[1].error).toBeInstanceOf(Error);
expect(e.failures[1].moduleName).toEqual('orhere');
expect(e.failures[1].module).toEqual(null);
}
Expand All @@ -193,7 +193,7 @@ describe('rechoir', function() {
err = e;
checkFailures(e);
}
expect(err).toBeAn(Error);
expect(err).toBeInstanceOf(Error);

done();
});
Expand All @@ -216,7 +216,7 @@ describe('rechoir', function() {
}, testFilePath);
expect(function() {
require(testFilePath);
}).toNotThrow(Error);
}).not.toThrow(Error);

done();
});
Expand Down

0 comments on commit 6d28767

Please sign in to comment.