This commit is contained in:
sentsin
2017-08-21 08:50:25 +08:00
parent 06c11ba9cd
commit 7feaa4eca0
1899 changed files with 181363 additions and 22513 deletions

13
node_modules/gulp-header/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

17
node_modules/gulp-header/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,17 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
node_modules
test
.travis.yml

20
node_modules/gulp-header/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2013-2015 Michael J. Ryan <tracker1> and GoDaddy.com
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.

84
node_modules/gulp-header/README.md generated vendored Normal file
View File

@@ -0,0 +1,84 @@
# 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)
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/).
## Install
```javascript
npm install --save-dev gulp-header
```
## Usage
```javascript
// assign the module to a local variable
var header = require('gulp-header');
// literal string
// NOTE: a line separator will not be added automatically
gulp.src('./foo/*.js')
.pipe(header('Hello'))
.pipe(gulp.dest('./dist/'))
// ejs style templating
gulp.src('./foo/*.js')
.pipe(header('Hello <%= name %>\n', { name : 'World'} ))
.pipe(gulp.dest('./dist/'))
// ES6-style template string
gulp.src('./foo/*.js')
.pipe(header('Hello ${name}\n', { name : 'World'} ))
.pipe(gulp.dest('./dist/'))
// using data from package.json
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
gulp.src('./foo/*.js')
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('./dist/'))
// reading the header file from disk
var fs = require('fs');
gulp.src('./foo/*.js')
.pipe(header(fs.readFileSync('header.txt', 'utf8'), { pkg : pkg } ))
.pipe(gulp.dest('./dist/'))
```
## Issues and Alerts
My handle on twitter is [@tracker1](https://twitter.com/tracker1) - If there is an urgent issue, I get twitter notifications sent to my phone.
## API
### header(text, data)
#### text
Type: `String`
Default: `''`
The template text.
#### data
Type: `Object`
Default: `{}`
The data object used to populate the text.
In addition to the passed in data, `file` will be the stream object for the file being templated against and `filepath` will be the path relative from the stream's basepath.
*NOTE: using `false` will disable template processing of the header*

10
node_modules/gulp-header/changelog.md generated vendored Normal file
View File

@@ -0,0 +1,10 @@
# Changelog
Will welcome if anyone wants to backfill prior changelogs.
## 1.8.8 - 2016-08-10
* #47 Support for gulp-data
* #46 Fix undefined template local "filename"
* #46 Document `file` and `filename` locals.
* #45 Started CHANGELOG.md

102
node_modules/gulp-header/index.js generated vendored Normal file
View File

@@ -0,0 +1,102 @@
/* jshint node: true */
'use strict';
/**
* Module dependencies.
*/
var Concat = require('concat-with-sourcemaps');
var extend = require('object-assign');
var through = require('through2');
var gutil = require('gulp-util');
var stream = require('stream');
var path = require('path');
var fs = require('fs');
/**
* gulp-header plugin
*/
module.exports = function (headerText, data) {
headerText = headerText || '';
function TransformStream(file, enc, cb) {
// direct support for gulp-data
if (file.data) {
data = extend(file.data, data);
}
// format template
var filename = path.basename(file.path);
var template = data === false ? headerText : gutil.template(headerText, extend({ file: file, filename: filename }, data));
if (file && typeof file === 'string') {
this.push(template + file);
return cb();
}
// if not an existing file, passthrough
if (!isExistingFile(file)) {
this.push(file);
return cb();
}
// handle file stream;
if (file.isStream()) {
var stream = through();
stream.write(new Buffer(template));
stream.on('error', this.emit.bind(this, 'error'));
file.contents = file.contents.pipe(stream);
this.push(file);
return cb();
}
// variables to handle direct file content manipulation
var concat = new Concat(true, filename);
// add template
concat.add(null, new Buffer(template));
// add sourcemap
concat.add(file.relative, file.contents, file.sourceMap);
// make sure streaming content is preserved
if (file.contents && !isStream(file.contents)) {
file.contents = concat.content;
}
// apply source map
if (concat.sourceMapping) {
file.sourceMap = JSON.parse(concat.sourceMap);
}
// make sure the file goes through the next gulp plugin
this.push(file);
// tell the stream engine that we are done with this file
cb();
}
return through.obj(TransformStream);
};
/**
* is stream?
*/
function isStream(obj) {
return obj instanceof stream.Stream;
}
/**
* Is File, and Exists
*/
function isExistingFile(file) {
try {
if (!(file && typeof file === 'object')) return false;
if (file.isDirectory()) return false;
if (file.isStream()) return true;
if (file.isBuffer()) return true;
if (typeof file.contents === 'string') return true;
} catch(err) {}
return false;
}

119
node_modules/gulp-header/package.json generated vendored Normal file
View File

@@ -0,0 +1,119 @@
{
"_args": [
[
{
"raw": "gulp-header@^1.8.8",
"scope": null,
"escapedName": "gulp-header",
"name": "gulp-header",
"rawSpec": "^1.8.8",
"spec": ">=1.8.8 <2.0.0",
"type": "range"
},
"D:\\web\\layui\\res\\layui"
]
],
"_from": "gulp-header@>=1.8.8 <2.0.0",
"_id": "gulp-header@1.8.8",
"_inCache": true,
"_location": "/gulp-header",
"_nodeVersion": "4.4.7",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/gulp-header-1.8.8.tgz_1470820645345_0.7174483358394355"
},
"_npmUser": {
"name": "tracker1",
"email": "tracker1@gmail.com"
},
"_npmVersion": "2.15.8",
"_phantomChildren": {},
"_requested": {
"raw": "gulp-header@^1.8.8",
"scope": null,
"escapedName": "gulp-header",
"name": "gulp-header",
"rawSpec": "^1.8.8",
"spec": ">=1.8.8 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.8.tgz",
"_shasum": "4509c64677aab56b5ee8e4669a79b1655933a49e",
"_shrinkwrap": null,
"_spec": "gulp-header@^1.8.8",
"_where": "D:\\web\\layui\\res\\layui",
"author": {
"name": "Michael J. Ryan",
"email": "mxryan@godaddy.com",
"url": "http://github.com/tracker1"
},
"bugs": {
"url": "https://github.com/tracker1/gulp-header/issues"
},
"contributors": [
{
"name": "GoDaddy.com",
"url": "http://github.com/godaddy"
},
{
"name": "Douglas Duteil",
"email": "douglasduteil@gmail.com",
"url": "http://github.com/douglasduteil"
}
],
"dependencies": {
"concat-with-sourcemaps": "*",
"gulp-util": "*",
"object-assign": "*",
"through2": "^2.0.0"
},
"description": "Gulp extension to add header to file(s) in the pipeline.",
"devDependencies": {
"event-stream": "^3.1.7",
"gulp": "^3.9.0",
"mocha": "*",
"should": "*",
"vinyl": "*"
},
"directories": {
"test": "test"
},
"dist": {
"shasum": "4509c64677aab56b5ee8e4669a79b1655933a49e",
"tarball": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.8.tgz"
},
"gitHead": "4d219649ba55069fe742195341fa3b71ae65976f",
"homepage": "https://github.com/tracker1/gulp-header#readme",
"https-proxy": null,
"keywords": [
"header",
"gulpplugin",
"eventstream"
],
"license": "MIT",
"main": "./index.js",
"maintainers": [
{
"name": "tracker1",
"email": "tracker1@gmail.com"
}
],
"name": "gulp-header",
"optionalDependencies": {},
"proxy": null,
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/tracker1/gulp-header.git"
},
"scripts": {
"publish-major": "npm version major && git push origin master && git push --tags",
"publish-minor": "npm version minor && git push origin master && git push --tags",
"publish-patch": "npm version patch && git push origin master && git push --tags",
"test": "mocha --reporter spec"
},
"version": "1.8.8"
}