Skip to content

Commit

Permalink
Scaffold: Normalize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 28, 2018
1 parent 5dbc34c commit 59315ec
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 74 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "gulp"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

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

# Coverage directory used by tools like istanbul
coverage

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

# Compiled binary addons (http://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

# Users Environment Variables
.lock-wscript

# Garbage files
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: false
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
- '0.12'
- '0.10'
after_script:
- npm run coveralls
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Tyler Kellen
Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>

# interpret
> A dictionary of file extensions and associated module loaders.

[![NPM](https://nodei.co/npm/interpret.png)](https://nodei.co/npm/interpret/)
[![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]

A dictionary of file extensions and associated module loaders.

## What is it
This is used by [Liftoff](http://github.com/tkellen/node-liftoff) to automatically require dependencies for configuration files, and by [rechoir](http://github.com/tkellen/node-rechoir) for registering module loaders.
Expand Down Expand Up @@ -143,3 +150,19 @@ Consumers should use the exported `extensions` or `jsVariants` object to determi
4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw.

[require.extensions]: http://nodejs.org/api/globals.html#globals_require_extensions

[downloads-image]: http://img.shields.io/npm/dm/interpret.svg
[npm-url]: https://www.npmjs.com/package/interpret
[npm-image]: http://img.shields.io/npm/v/interpret.svg

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

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

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

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# http://www.appveyor.com/docs/appveyor-yml
# http://www.appveyor.com/docs/lang/nodejs-iojs

environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- node --version
- npm --version
- cmd: npm test

build: off

# build version format
version: "{build}"
99 changes: 40 additions & 59 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
const extensions = {
var extensions = {
'.babel.js': [
{
module: '@babel/register',
register: function (module) {
module({
// register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353
// which only captures the final extension (.babel.js -> .js)
extensions: '.js'
});
}
register: function(module) {
// register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353
// which only captures the final extension (.babel.js -> .js)
module({ extensions: '.js' });
},
},
{
module: 'babel-register',
register: function (module) {
module({
// register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353
// which only captures the final extension (.babel.js -> .js)
extensions: '.js'
});
}
register: function(module) {
// register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353
// which only captures the final extension (.babel.js -> .js)
module({ extensions: '.js' });
},
},
{
module: 'babel-core/register',
register: function (module) {
module({
extensions: '.js'
});
}
register: function(module) {
module({ extensions: '.js' });
},
},
{
module: 'babel/register',
register: function (module) {
module({
extensions: '.js'
});
}
}
register: function(module) {
module({ extensions: '.js' });
},
},
],
'.buble.js': 'buble/register',
'.cirru': 'cirru-script/lib/register',
Expand All @@ -54,65 +46,54 @@ const extensions = {
'.jsx': [
{
module: '@babel/register',
register: function (module) {
module({
extensions: '.jsx'
});
}
register: function(module) {
module({ extensions: '.jsx' });
},
},
{
module: 'babel-register',
register: function (module) {
module({
extensions: '.jsx'
});
}
register: function(module) {
module({ extensions: '.jsx' });
},
},
{
module: 'babel-core/register',
register: function (module) {
module({
extensions: '.jsx'
});
}
register: function(module) {
module({ extensions: '.jsx' });
},
},
{
module: 'babel/register',
register: function (module) {
module({
extensions: '.jsx'
});
register: function(module) {
module({ extensions: '.jsx' });
},
},
{
module: 'node-jsx',
register: function (module) {
module.install({
extension: '.jsx',
harmony: true
});
}
}
register: function(module) {
module.install({ extension: '.jsx', harmony: true });
},
},
],
'.litcoffee': ['coffeescript/register', 'coffee-script/register', 'coffeescript', 'coffee-script'],
'.liticed': 'iced-coffee-script/register',
'.ls': ['livescript', 'LiveScript'],
'.node': null,
'.toml': {
module: 'toml-require',
register: function (module) {
register: function(module) {
module.install();
}
},
},
'.ts': ['ts-node/register', 'typescript-node/register', 'typescript-register', 'typescript-require'],
'.tsx': ['ts-node/register', 'typescript-node/register'],
'.wisp': 'wisp/engine/node',
'.xml': 'require-xml',
'.yaml': 'require-yaml',
'.yml': 'require-yaml'
'.yml': 'require-yaml',
};

const jsVariantExtensions = [
var jsVariantExtensions = [
'.js',
'.babel.js',
'.buble.js',
Expand All @@ -129,13 +110,13 @@ const jsVariantExtensions = [
'.liticed',
'.ls',
'.ts',
'.wisp'
'.wisp',
];

module.exports = {
extensions: extensions,
jsVariants: jsVariantExtensions.reduce(function (result, ext) {
jsVariants: jsVariantExtensions.reduce(function(result, ext) {
result[ext] = extensions[ext];
return result;
}, {})
}, {}),
};
34 changes: 22 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
"name": "interpret",
"description": "A dictionary of file extensions and associated module loaders.",
"version": "1.1.0",
"homepage": "https://github.com/tkellen/node-interpret",
"author": {
"name": "Tyler Kellen",
"url": "http://goingslowly.com/"
"description": "A dictionary of file extensions and associated module loaders.",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>",
"Tyler Kellen <tyler@sleekcode.net> (http://goingslowly.com/)"
],
"repository": "gulpjs/interpret",
"license": "MIT",
"engines": {
"node": ">= 0.10"
},
"repository": {
"type": "git",
"url": "git://github.com/tkellen/node-interpret.git"
"main": "index.js",
"files": [
"LICENSE",
"index.js"
],
"scripts": {
"lint": "eslint .",
"test": "npm run lint"
},
"bugs": {
"url": "https://github.com/tkellen/node-interpret/issues"
"dependencies": {},
"devDependencies": {
"eslint": "^2.13.0",
"eslint-config-gulp": "^3.0.1"
},
"license": "MIT",
"main": "index.js",
"keywords": [
"cirru-script",
"cjsx",
Expand Down

0 comments on commit 59315ec

Please sign in to comment.