-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for 0 on hsl2hsv and tests #15
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Awesome. Thanks ! |
Released as 0.5.3 |
etnlbck
referenced
this pull request
in etnlbck/postcss-playground
Jul 20, 2015
diff --git a/README.md b/README.md new file mode 100644 index 0000000..88b9339 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Postcss play diff --git a/build/stylesheets/test.css b/build/stylesheets/test.css new file mode 100644 index 0000000..60f97a4 --- /dev/null +++ b/build/stylesheets/test.css @@ -0,0 +1,71 @@ +.foo { + content: 'foo'; +} + +.bar { + content: 'bar'; + background: #056ef0; +} + +.baz { + content: 'baz'; +} + +.col-xs-1 { + width: calc(1/768); +} + +.col-xs-2 { + width: calc(2/768); +} + +.col-xs-3 { + width: calc(3/768); +} + +.col-xs-4 { + width: calc(4/768); +} + +.col-xs-5 { + width: calc(5/768); +} + +.col-xs-6 { + width: calc(6/768); +} + +.col-xs-7 { + width: calc(7/768); +} + +.col-xs-8 { + width: calc(8/768); +} + +.col-xs-9 { + width: calc(9/768); +} + +.col-xs-10 { + width: calc(10/768); +} + +.col-xs-11 { + width: calc(11/768); +} + +.col-xs-12 { + width: calc(12/768); +} + +.menu { + width: calc(4 * 400px); +} + +.menu_link { + background: #056ef0; + width: 400px; +} + +/*# sourceMappingURL=test.css.map */ \ No newline at end of file diff --git a/build/stylesheets/test.css.map b/build/stylesheets/test.css.map new file mode 100644 index 0000000..c19e0ba --- /dev/null +++ b/build/stylesheets/test.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["test.css"],"names":[],"mappings":"AAIE;IACE,eAAc;CAIf;;AALD;IACE,eAAc;IAEZ,oBAAkB;CAErB;;AALD;IACE,eAAc;CAIf;;AAMG;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAMP;IACI,uBAAyB;CAC5B;;AAED;IACI,oBAAkB;IAClB,aAAe;CAClB","file":"test.css","sourcesContent":["@import \"partials/_variables.css\";\n\n$array: (foo, bar, baz);\n@each $i in $array {\n .$i {\n content: '$i';\n @if $i == bar {\n background: $blue;\n }\n }\n}\n\n@define-mixin grid $size, $width, $columns {\n\n @for $i from 1 to 12 {\n .col-$(size)-$(i) {\n width: calc($i/$width);\n }\n }\n}\n\n@mixin grid xs,768,18;\n\n.menu {\n width: calc(4 * $column);\n}\n\n.menu_link {\n background: $blue;\n width: $column;\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..c6079df --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,23 @@ +var + gulp = require('gulp'), + g = require('gulp-load-plugins')(), + postcss = require('gulp-postcss'), + plugins = require('postcss-load-plugins')(), + precss = require('precss'); + +gulp.task('styles', function (cb){ + var processors = [ + precss + ]; + return gulp.src(['*.css'], {cwd: 'src/css'}) + .pipe(g.sourcemaps.init()) + .pipe(postcss(processors)) + .pipe(g.sourcemaps.write('.')) + .pipe(gulp.dest('build/stylesheets/')); +}); + +gulp.watch(['src/css/*.css', 'src/css/partials/*.css'], ['styles']); + +gulp.task('default', ['styles']); + +module.exports = gulp; diff --git a/node_modules/.bin/gulp b/node_modules/.bin/gulp new file mode 120000 index 0000000..5de7332 --- /dev/null +++ b/node_modules/.bin/gulp @@ -0,0 +1 @@ +../gulp/bin/gulp.js \ No newline at end of file diff --git a/node_modules/gulp-load-plugins/README.md b/node_modules/gulp-load-plugins/README.md new file mode 100644 index 0000000..e164c0e --- /dev/null +++ b/node_modules/gulp-load-plugins/README.md @@ -0,0 +1,175 @@ +# gulp-load-plugins + +[![npm](https://nodei.co/npm/gulp-load-plugins.svg?downloads=true)](https://nodei.co/npm/gulp-load-plugins/) + +> Loads in any gulp plugins and attaches them to the global scope, or an object of your choice. + +[![Build Status](https://travis-ci.org/jackfranklin/gulp-load-plugins.svg?branch=master)](https://travis-ci.org/jackfranklin/gulp-load-plugins) + + +## Install + +```sh +$ npm install --save-dev gulp-load-plugins +``` + + +## Usage + +Given a `package.json` file that has some dependencies within: + +```json +{ + "dependencies": { + "gulp-jshint": "*", + "gulp-concat": "*" + } +} +``` + +Adding this into your `Gulpfile.js`: + +```js +var gulp = require('gulp'); +var gulpLoadPlugins = require('gulp-load-plugins'); +var plugins = gulpLoadPlugins(); +``` + +Or, even shorter: + +```js +var plugins = require('gulp-load-plugins')(); +``` + +Will result in the following happening (roughly, plugins are lazy loaded but in practice you won't notice any difference): + +```js +plugins.jshint = require('gulp-jshint'); +plugins.concat = require('gulp-concat'); +``` + +You can then use the plugins just like you would if you'd manually required them, but referring to them as `plugins.name()`, rather than just `name()`. + +This frees you up from having to manually require each gulp plugin. + +## Options + +You can pass in an object of options that are shown below: (the values for the keys are the defaults): + +```js +gulpLoadPlugins({ + pattern: ['gulp-*', 'gulp.*'], // the glob(s) to search for + config: 'package.json', // where to find the plugins, by default searched up from process.cwd() + scope: ['dependencies', 'devDependencies', 'peerDependencies'], // which keys in the config to look within + replaceString: /^gulp(-|\.)/, // what to remove from the name of the module when adding it to the context + camelize: true, // if true, transforms hyphenated plugins names to camel case + lazy: true, // whether the plugins should be lazy loaded on demand + rename: {} // a mapping of plugins to rename +}); +``` + +## Renaming + +From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, imagine you want to load the `gulp-ruby-sass` plugin, but want to refer to it as just `sass`: + +```js +gulpLoadPlugins({ + rename: { + 'gulp-ruby-sass': 'sass' + } +}); +``` + +## npm Scopes + +`gulp-load-plugins` comes with [npm scope](https://docs.npmjs.com/misc/scope) support. The major difference is that scoped plugins are accessible through an object on `plugins` that represents the scope. For example, if the plugin is `@myco/gulp-test-plugin` then you can access the plugin as shown in the following example: + +```js +var plugins = require('gulp-load-plugins')(); + +plugins.myco.testPlugin(); +``` + +## Lazy Loading + +In 0.4.0 and prior, lazy loading used to only work with plugins that return a function. In newer versions though, lazy loading should work for any plugin. If you have a problem related to this please try disabling lazy loading and see if that fixes it. Feel free to open an issue on this repo too. + + +## Credit + +Credit largely goes to @sindresorhus for his [load-grunt-plugins](https://github.com/sindresorhus/load-grunt-tasks) plugin. This plugin is almost identical, just tweaked slightly to work with Gulp and to expose the required plugins. + + +## Changelog + +##### 1.0.0-rc.1 +- This is the first release candidate for what will become version 1 of gulp-load-plugins. Once a fix for [#70](https://github.com/jackfranklin/gulp-load-plugins/issues/70) is landed, I plan to release V1. +- **Breaking Change** support for `NODE_PATH` is no longer supported. It was causing complexities and in [the PR that droppped support](https://github.com/jackfranklin/gulp-load-plugins/pull/75) no one shouted that they required `NODE_PATH` support. + +##### 0.10.0 +- throw a more informative error if a plugin is loaded that gulp-load-plugins can't find. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/68) - thanks @connor4312 +- allow `require` to look on the `NODE_PATH` if it can't find the module in the working directory. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/69) - thanks @chmanie + +##### 0.9.0 +- add support for npm-scoped plugins. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/63) - thanks @hbetts + +##### 0.8.1 +- fixed a bug where gulp-load-plugins would use the right `package.json` file but the wrong `node_modules` directory - thanks @callumacrae + +##### 0.8.0 +- add the ability to rename plugins that gulp-load-plugins loads in. + +##### 0.7.1 +- add `files` property to package.json so only required files are downloaded when installed - thanks @shinnn + + +##### 0.7.0 +- support loading plugins with a dot in the name, such as `gulp.spritesmith` - thanks to @MRuy +- upgrade multimatch to 1.0.0 + + +##### 0.6.0 +- Fix issues around plugin picking wrong package.json file - thanks @iliakan (see [issue](https://github.com/jackfranklin/gulp-load-plugins/issues/35)). + +##### 0.5.3 +- Show a nicer error if the plugin is unable to load any configuration and hence can't find any dependencies to load + +##### 0.5.2 +- Swap out globule for multimatch, thanks @sindresorhus. + +##### 0.5.1 +- Updated some internal dependencies which should see some small improvements - thanks @shinnn for this contribution. + +##### 0.5.0 +- improved lazy loading so it should work with plugins that don't just return a function. Thanks to @nfroidure for help with this. + +##### 0.4.0 +- plugins are lazy loaded for performance benefit. Thanks @julien-f for this. + +##### 0.3.0 +- turn the `camelize` option on by default + +##### 0.2.0 +- added `camelize` option, thanks @kombucha. +- renamed to `gulp-load-plugins`. + +##### 0.1.1 +- add link to this repository into `package.json` (thanks @ben-eb). + +##### 0.1.0 +- move to `gulpLoadplugins` returning an object with the tasks define. + +##### 0.0.5 +- added `replaceString` option to configure exactly what gets replace when the plugin adds the module to the context + +##### 0.0.4 +- fixed keyword typo so plugin appears in search for gulp plugins + +##### 0.0.3 +- removed accidental console.log I'd left in + +##### 0.0.2 +- fixed accidentally missing a dependency out of package.json + +##### 0.0.1 +- initial release diff --git a/node_modules/gulp-load-plugins/index.js b/node_modules/gulp-load-plugins/index.js new file mode 100644 index 0000000..64c16a5 --- /dev/null +++ b/node_modules/gulp-load-plugins/index.js @@ -0,0 +1,105 @@ +'use strict'; +var multimatch = require('multimatch'); +var findup = require('findup-sync'); +var path = require('path'); +var resolve = require('resolve'); + +function arrayify(el) { + return Array.isArray(el) ? el : [el]; +} + +function camelize(str) { + return str.replace(/-(\w)/g, function(m, p1) { + return p1.toUpperCase(); + }); +} + +module.exports = function(options) { + var finalObject = {}; + var configObject; + var requireFn; + options = options || {}; + + var pattern = arrayify(options.pattern || ['gulp-*', 'gulp.*', '@*/gulp{-,.}*']); + var config = options.config || findup('package.json', {cwd: parentDir}); + var scope = arrayify(options.scope || ['dependencies', 'devDependencies', 'peerDependencies']); + var replaceString = options.replaceString || /^gulp(-|\.)/; + var camelizePluginName = options.camelize === false ? false : true; + var lazy = 'lazy' in options ? !!options.lazy : true; + var renameObj = options.rename || {}; + + if(typeof options.requireFn === 'function') { + requireFn = options.requireFn; + } else if(typeof config === 'string') { + requireFn = function (name) { + // This searches up from the specified package.json file, making sure + // the config option behaves as expected. See issue #56. + var src = resolve.sync(name, { basedir: path.dirname(config) }); + return require(src); + }; + } else { + requireFn = require; + } + + configObject = (typeof config === 'string') ? require(config) : config; + + if(!configObject) { + throw new Error('Could not find dependencies. Do you have a package.json file in your project?'); + } + + var names = scope.reduce(function(result, prop) { + return result.concat(Object.keys(configObject[prop] || {})); + }, []); + + pattern.push('!gulp-load-plugins'); + + function defineProperty(object, requireName, name) { + if(lazy) { + Object.defineProperty(object, requireName, { + get: function() { + return requireFn(name); + } + }); + } else { + object[requireName] = requireFn(name); + } + } + + function getRequireName(name) { + var requireName; + + if(renameObj[name]) { + requireName = options.rename[name]; + } else { + requireName = name.replace(replaceString, ''); + requireName = camelizePluginName ? camelize(requireName) : requireName; + } + + return requireName; + } + + var scopeTest = new RegExp('^@'); + var scopeDecomposition = new RegExp('^@(.+)/(.+)'); + + multimatch(names, pattern).forEach(function(name) { + if(scopeTest.test(name)) { + var decomposition = scopeDecomposition.exec(name); + + if(!finalObject.hasOwnProperty(decomposition[1])) { + finalObject[decomposition[1]] = {}; + } + + defineProperty(finalObject[decomposition[1]], getRequireName(decomposition[2]), name); + } else { + defineProperty(finalObject, getRequireName(name), name); + } + + }); + + return finalObject; +}; + +var parentDir = path.dirname(module.parent.filename); + +// Necessary to get the current `module.parent` and resolve paths correctly. +delete require.cache[__filename]; diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore b/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore new file mode 100644 index 0000000..84561e0 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore @@ -0,0 +1,4 @@ +test +.travis.yml +.jshintrc +Gruntfile.js diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT b/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT new file mode 100644 index 0000000..bb2aad6 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 "Cowboy" Ben Alman + +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. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md new file mode 100644 index 0000000..da08371 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md @@ -0,0 +1,47 @@ +# findup-sync [![Build Status](https://secure.travis-ci.org/cowboy/node-findup-sync.png?branch=master)](http://travis-ci.org/cowboy/node-findup-sync) + +Find the first file matching a given pattern in the current directory or the nearest ancestor directory. + +## Getting Started +Install the module with: `npm install findup-sync` + +```js +var findup = require('findup-sync'); + +// Start looking in the CWD. +var filepath1 = findup('{a,b}*.txt'); + +// Start looking somewhere else, and ignore case (probably a good idea). +var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); +``` + +## Usage + +```js +findup(patternOrPatterns [, minimatchOptions]) +``` + +### patternOrPatterns +Type: `String` or `Array` +Default: none + +One or more wildcard glob patterns. Or just filenames. + +### minimatchOptions +Type: `Object` +Default: `{}` + +Options to be passed to [minimatch](https://github.com/isaacs/minimatch). + +Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. + +## Contributing +In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). + +## Release History +2014-12-17 - v0.2.1 - updated to glob 4.3. +2014-12-16 - v0.2.0 - Removed lodash, updated to glob 4.x. +2014-03-14 - v0.1.3 - Updated dependencies. +2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. +2012-11-15 - v0.1.1 - Now works without an options object. +2012-11-01 - v0.1.0 - Initial release. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js new file mode 100644 index 0000000..871a725 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js @@ -0,0 +1,49 @@ +/* + * findup-sync + * https://github.com/cowboy/node-findup-sync + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + */ + +'use strict'; + +// Nodejs libs. +var path = require('path'); + +// External libs. +var glob = require('glob'); + +// Search for a filename in the given directory or all parent directories. +module.exports = function(patterns, options) { + // Normalize patterns to an array. + if (!Array.isArray(patterns)) { patterns = [patterns]; } + // Create globOptions so that it can be modified without mutating the + // original object. + var globOptions = Object.create(options || {}); + globOptions.maxDepth = 1; + globOptions.cwd = path.resolve(globOptions.cwd || '.'); + + var files, lastpath; + do { + // Search for files matching patterns. + files = patterns.map(function(pattern) { + return glob.sync(pattern, globOptions); + }).reduce(function(a, b) { + return a.concat(b); + }).filter(function(entry, index, arr) { + return index === arr.indexOf(entry); + }); + // Return file if found. + if (files.length > 0) { + return path.resolve(path.join(globOptions.cwd, files[0])); + } + // Go up a directory. + lastpath = globOptions.cwd; + globOptions.cwd = path.resolve(globOptions.cwd, '..'); + // If parentpath is the same as basedir, we can't go any higher. + } while (globOptions.cwd !== lastpath); + + // No files were found! + return null; +}; diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md new file mode 100644 index 0000000..e479ae2 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md @@ -0,0 +1,357 @@ +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) + +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Negation + +The intent for negation would be for a pattern starting with `!` to +match everything that *doesn't* match the supplied pattern. However, +the implementation is weird, and for the time being, this should be +avoided. The behavior will change or be deprecated in version 5. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* `cb` {Function} + * `err` {Error | null} + * `matches` {Array<String>} filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` {String} Pattern to be matched +* `options` {Object} +* return: {Array<String>} filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` {String} pattern to search for +* `options` {Object} +* `cb` {Function} Called when an error occurs, or matches are found + * `err` {Error | null} + * `matches` {Array<String>} filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `statCache` Collection of all the stat results the glob search + performed. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'DIR'` - Path exists, and is not a directory + * `'FILE'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the matched. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, and `cache` options, so that parallel glob +operations will be sped up by sharing information about the +filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` Perform a synchronous glob search. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nonegate` Suppress `negate` behavior. (See below.) +* `nocomment` Suppress `comment` behavior. (See below.) +* `nonull` Return the pattern when no matches are found. +* `nodir` Do not match directories, only files. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js new file mode 100644 index 0000000..610d124 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js @@ -0,0 +1,177 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.isAbsolute = process.platform === "win32" ? absWin : absUnix +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var Minimatch = minimatch.Minimatch + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + var result = splitDeviceRe.exec(p) + var device = result[1] || '' + var isUnc = device && device.charAt(1) !== ':' + var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.pattern = pattern + self.strict = options.strict !== false + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + self.found = all +} + +function mark (self, p) { + var c = self.cache[p] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + self.statCache[m] = self.statCache[p] + self.cache[m] = self.cache[p] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(self.root, f) + } else if (exports.isAbsolute(f)) { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } + return abs +} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js new file mode 100644 index 0000000..7401e0b --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js @@ -0,0 +1,649 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var isAbsolute = common.isAbsolute +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +glob.hasMagic = function (pattern, options_) { + var options = util._extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {<filename>: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + //console.error('FINISH', this.matches) + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (!this.matches[index][e]) { + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (!this.stat && !this.mark) + return this.emit('match', e) + + var self = this + this._stat(this._makeAbs(e), function (er, c, st) { + self.emit('stat', e, st) + self.emit('match', e) + }) + } +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[f] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[f] = false + break + + default: // some unusual error. Treat as failure. + this.cache[f] = false + if (this.strict) return this.emit('error', er) + if (!this.silent) console.error('glob error', er) + break + } + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = f + if (f.charAt(0) === '/') + abs = path.join(this.root, f) + else if (this.changedCwd) + abs = path.resolve(this.cwd, f) + + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, f)) { + var c = this.cache[f] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but not how we need it + if (abs.slice(-1) === '/' && c !== 'DIR') + return cb() + + return cb(null, c) + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else + return cb(null, stat.isDirectory() ? 'DIR' : 'FILE', stat) + } + + var self = this + var statcb = inflight('stat\0' + abs, statcb_) + if (statcb) + fs.stat(abs, statcb) + + function statcb_ (er, stat) { + self._stat2(f, abs, er, stat, cb) + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[f] = this.cache[f] || c + return cb(null, c, stat) +} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc new file mode 100644 index 0000000..b7a1550 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc @@ -0,0 +1,17 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "semi": [2, "never"], + "strict": 0, + "quotes": [1, "single", "avoid-escape"], + "no-use-before-define": 0, + "curly": 0, + "no-underscore-dangle": 0, + "no-lonely-if": 1, + "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}], + "no-mixed-requires": 0, + "space-infix-ops": 0 + } +} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js new file mode 100644 index 0000000..8bc96cb --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js @@ -0,0 +1,44 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md new file mode 100644 index 0000000..98eab25 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json new file mode 100644 index 0000000..8145dc8 --- /dev/null +++ b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json @@ -0,0 +1,52 @@ +{ + "name": "wrappy", + "version": "1.0.1", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.4.12" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy", + "gitHead": "006a8cbac6b99988315834c207896eed71fd069a", + "_id": "wrappy@1.0.1", + "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "_from": "wrappy@>=1.0.0 <2.0.0", + "_npmVersion": "2.0.0", + "_nodeVersion": "0.10.31", + "_npmUser": { + …
etnlbck
referenced
this pull request
in etnlbck/postcss-playground
Jul 20, 2015
diff --git a/README.md b/README.md index 88b9339..848b726 100644 --- a/README.md +++ b/README.md @@ -1 +1,12 @@ -# Postcss play +# Postcss js.la +postcss is not a postprocessor. The idea behind it is that CSS should be able to be written without a user having to learn some meta language and it's syntax (SASS, LESS). We should be future proofing. + +postcss is an ecosystem of plugins that transforms CSS. + +- Gulp: ``` npm install gulp-postcss ``` +- CLI: ``` npm install -g postcss-cli ``` + +# Resources +[postcss](https://github.com/postcss) +[PostCSS Docs](https://github.com/postcss/postcss/blob/master/docs/api.md) +[CodePen](https://blog.codepen.io/2015/07/14/postcss-now-supported-on-codepen/) diff --git a/build/index.html b/build/index.html new file mode 100644 index 0000000..09ab0ec --- /dev/null +++ b/build/index.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Test Page</title> + <link href="/stylesheets/test.css" rel="stylesheet" type="text/css"/> + </head> + <body> + <div class="col-xs-1"> + <a href="#">Link Play</a> + </div> + </body> +</html> diff --git a/build/stylesheets/test.css b/build/stylesheets/test.css index 60f97a4..bc770d8 100644 --- a/build/stylesheets/test.css +++ b/build/stylesheets/test.css @@ -1,66 +1,78 @@ +/* PreCSS - FTW */ +/* Yah! Partials */ + +/* Arrays */ + +/* Loops */ .foo { - content: 'foo'; + content: 'foo'; } - .bar { - content: 'bar'; - background: #056ef0; + content: 'bar'; + background: rgba(#056ef0, 0.5); } - .baz { - content: 'baz'; -} - -.col-xs-1 { - width: calc(1/768); -} - -.col-xs-2 { - width: calc(2/768); -} - -.col-xs-3 { - width: calc(3/768); -} - -.col-xs-4 { - width: calc(4/768); -} - -.col-xs-5 { - width: calc(5/768); -} - -.col-xs-6 { - width: calc(6/768); -} - -.col-xs-7 { - width: calc(7/768); -} - -.col-xs-8 { - width: calc(8/768); + content: 'baz'; +} + +/* Mixins +TODO: convert variables to a numerical value. start, end, increment +*/ + +/* Generates a grid with .col-xs-* at min-width: 320px with 18 columns */ + +@media only screen and (min-width: 320px) { + .col-xs-1 { + width: 0.313%; + } + .col-xs-2 { + width: 0.625%; + } + .col-xs-3 { + width: 0.938%; + } + .col-xs-4 { + width: 1.25%; + } + .col-xs-5 { + width: 1.563%; + } + .col-xs-6 { + width: 1.875%; + } + .col-xs-7 { + width: 2.188%; + } + .col-xs-8 { + width: 2.5%; + } + .col-xs-9 { + width: 2.813%; + } + .col-xs-10 { + width: 3.125%; + } + .col-xs-11 { + width: 3.438%; + } + .col-xs-12 { + width: 3.75%; + } +} + +/* CSS4 */ + +:any-link { + background: yellow; +} + +header:has(h1) { + content: ''; } -.col-xs-9 { - width: calc(9/768); -} - -.col-xs-10 { - width: calc(10/768); -} - -.col-xs-11 { - width: calc(11/768); -} - -.col-xs-12 { - width: calc(12/768); -} .menu { - width: calc(4 * 400px); + width: 1600px; } .menu_link { diff --git a/build/stylesheets/test.css.map b/build/stylesheets/test.css.map index c19e0ba..bec68f5 100644 --- a/build/stylesheets/test.css.map +++ b/build/stylesheets/test.css.map @@ -1 +1 @@ -{"version":3,"sources":["test.css"],"names":[],"mappings":"AAIE;IACE,eAAc;CAIf;;AALD;IACE,eAAc;IAEZ,oBAAkB;CAErB;;AALD;IACE,eAAc;CAIf;;AAMG;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,mBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAFD;IACE,oBAAuB;CACxB;;AAMP;IACI,uBAAyB;CAC5B;;AAED;IACI,oBAAkB;IAClB,aAAe;CAClB","file":"test.css","sourcesContent":["@import \"partials/_variables.css\";\n\n$array: (foo, bar, baz);\n@each $i in $array {\n .$i {\n content: '$i';\n @if $i == bar {\n background: $blue;\n }\n }\n}\n\n@define-mixin grid $size, $width, $columns {\n\n @for $i from 1 to 12 {\n .col-$(size)-$(i) {\n width: calc($i/$width);\n }\n }\n}\n\n@mixin grid xs,768,18;\n\n.menu {\n width: calc(4 * $column);\n}\n\n.menu_link {\n background: $blue;\n width: $column;\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["test.css"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,mBAAmB;;AAGnB,YAAY;;AAGZ,WAAW;AAET;EACE,eAAc;CAIf;AALD;EACE,eAAc;EAEZ,+BAA6B;CAEhC;AALD;EACE,eAAc;CAIf;;AAGH;;EAEE;;AAYF,yEAAyE;;AATvE;EAEI;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,aAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,YAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,cAA8B;GAC/B;EAFD;IACE,aAA8B;GAC/B;CAEJ;;AAOH,UAAU;;AAEV;EACE,mBAAmB;CACpB;;AAED;EACE,YAAY;CACb;;;AAGD;IACI,cAAyB;CAC5B;;AAED;IACI,oBAAkB;IAClB,aAAe;CAClB","file":"test.css","sourcesContent":["/* PreCSS - FTW */\n/* Yah! Partials */\n@import \"partials/_variables.css\";\n\n/* Arrays */\n$array: (foo, bar, baz);\n\n/* Loops */\n@each $i in $array {\n .$i {\n content: '$i';\n @if $i == bar {\n background: rgba($blue, 0.5);\n }\n }\n}\n\n/* Mixins\nTODO: convert variables to a numerical value. start, end, increment\n*/\n\n@define-mixin grid $size, $width, $columns {\n @media only screen and (min-width: $(width)px) {\n @for $i from 1 to 12 {\n .col-$(size)-$(i) {\n width: calc(($i/$width)*100)%;\n }\n }\n }\n}\n\n/* Generates a grid with .col-xs-* at min-width: 320px with 18 columns */\n\n@mixin grid xs,320,18;\n\n/* CSS4 */\n\n:any-link {\n background: yellow;\n}\n\nheader:has(h1) {\n content: '';\n}\n\n\n.menu {\n width: calc(4 * $column);\n}\n\n.menu_link {\n background: $blue;\n width: $column;\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index c6079df..622d354 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,7 +7,9 @@ var gulp.task('styles', function (cb){ var processors = [ - precss + precss, + plugins.calc, + plugins.cssnext ]; return gulp.src(['*.css'], {cwd: 'src/css'}) .pipe(g.sourcemaps.init()) diff --git a/node_modules/.bin/gulp b/node_modules/.bin/gulp deleted file mode 120000 index 5de7332..0000000 --- a/node_modules/.bin/gulp +++ /dev/null @@ -1 +0,0 @@ -../gulp/bin/gulp.js \ No newline at end of file diff --git a/node_modules/gulp-load-plugins/README.md b/node_modules/gulp-load-plugins/README.md deleted file mode 100644 index e164c0e..0000000 --- a/node_modules/gulp-load-plugins/README.md +++ /dev/null @@ -1,175 +0,0 @@ -# gulp-load-plugins - -[![npm](https://nodei.co/npm/gulp-load-plugins.svg?downloads=true)](https://nodei.co/npm/gulp-load-plugins/) - -> Loads in any gulp plugins and attaches them to the global scope, or an object of your choice. - -[![Build Status](https://travis-ci.org/jackfranklin/gulp-load-plugins.svg?branch=master)](https://travis-ci.org/jackfranklin/gulp-load-plugins) - - -## Install - -```sh -$ npm install --save-dev gulp-load-plugins -``` - - -## Usage - -Given a `package.json` file that has some dependencies within: - -```json -{ - "dependencies": { - "gulp-jshint": "*", - "gulp-concat": "*" - } -} -``` - -Adding this into your `Gulpfile.js`: - -```js -var gulp = require('gulp'); -var gulpLoadPlugins = require('gulp-load-plugins'); -var plugins = gulpLoadPlugins(); -``` - -Or, even shorter: - -```js -var plugins = require('gulp-load-plugins')(); -``` - -Will result in the following happening (roughly, plugins are lazy loaded but in practice you won't notice any difference): - -```js -plugins.jshint = require('gulp-jshint'); -plugins.concat = require('gulp-concat'); -``` - -You can then use the plugins just like you would if you'd manually required them, but referring to them as `plugins.name()`, rather than just `name()`. - -This frees you up from having to manually require each gulp plugin. - -## Options - -You can pass in an object of options that are shown below: (the values for the keys are the defaults): - -```js -gulpLoadPlugins({ - pattern: ['gulp-*', 'gulp.*'], // the glob(s) to search for - config: 'package.json', // where to find the plugins, by default searched up from process.cwd() - scope: ['dependencies', 'devDependencies', 'peerDependencies'], // which keys in the config to look within - replaceString: /^gulp(-|\.)/, // what to remove from the name of the module when adding it to the context - camelize: true, // if true, transforms hyphenated plugins names to camel case - lazy: true, // whether the plugins should be lazy loaded on demand - rename: {} // a mapping of plugins to rename -}); -``` - -## Renaming - -From 0.8.0, you can pass in an object of mappings for renaming plugins. For example, imagine you want to load the `gulp-ruby-sass` plugin, but want to refer to it as just `sass`: - -```js -gulpLoadPlugins({ - rename: { - 'gulp-ruby-sass': 'sass' - } -}); -``` - -## npm Scopes - -`gulp-load-plugins` comes with [npm scope](https://docs.npmjs.com/misc/scope) support. The major difference is that scoped plugins are accessible through an object on `plugins` that represents the scope. For example, if the plugin is `@myco/gulp-test-plugin` then you can access the plugin as shown in the following example: - -```js -var plugins = require('gulp-load-plugins')(); - -plugins.myco.testPlugin(); -``` - -## Lazy Loading - -In 0.4.0 and prior, lazy loading used to only work with plugins that return a function. In newer versions though, lazy loading should work for any plugin. If you have a problem related to this please try disabling lazy loading and see if that fixes it. Feel free to open an issue on this repo too. - - -## Credit - -Credit largely goes to @sindresorhus for his [load-grunt-plugins](https://github.com/sindresorhus/load-grunt-tasks) plugin. This plugin is almost identical, just tweaked slightly to work with Gulp and to expose the required plugins. - - -## Changelog - -##### 1.0.0-rc.1 -- This is the first release candidate for what will become version 1 of gulp-load-plugins. Once a fix for [#70](https://github.com/jackfranklin/gulp-load-plugins/issues/70) is landed, I plan to release V1. -- **Breaking Change** support for `NODE_PATH` is no longer supported. It was causing complexities and in [the PR that droppped support](https://github.com/jackfranklin/gulp-load-plugins/pull/75) no one shouted that they required `NODE_PATH` support. - -##### 0.10.0 -- throw a more informative error if a plugin is loaded that gulp-load-plugins can't find. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/68) - thanks @connor4312 -- allow `require` to look on the `NODE_PATH` if it can't find the module in the working directory. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/69) - thanks @chmanie - -##### 0.9.0 -- add support for npm-scoped plugins. [PR](https://github.com/jackfranklin/gulp-load-plugins/pull/63) - thanks @hbetts - -##### 0.8.1 -- fixed a bug where gulp-load-plugins would use the right `package.json` file but the wrong `node_modules` directory - thanks @callumacrae - -##### 0.8.0 -- add the ability to rename plugins that gulp-load-plugins loads in. - -##### 0.7.1 -- add `files` property to package.json so only required files are downloaded when installed - thanks @shinnn - - -##### 0.7.0 -- support loading plugins with a dot in the name, such as `gulp.spritesmith` - thanks to @MRuy -- upgrade multimatch to 1.0.0 - - -##### 0.6.0 -- Fix issues around plugin picking wrong package.json file - thanks @iliakan (see [issue](https://github.com/jackfranklin/gulp-load-plugins/issues/35)). - -##### 0.5.3 -- Show a nicer error if the plugin is unable to load any configuration and hence can't find any dependencies to load - -##### 0.5.2 -- Swap out globule for multimatch, thanks @sindresorhus. - -##### 0.5.1 -- Updated some internal dependencies which should see some small improvements - thanks @shinnn for this contribution. - -##### 0.5.0 -- improved lazy loading so it should work with plugins that don't just return a function. Thanks to @nfroidure for help with this. - -##### 0.4.0 -- plugins are lazy loaded for performance benefit. Thanks @julien-f for this. - -##### 0.3.0 -- turn the `camelize` option on by default - -##### 0.2.0 -- added `camelize` option, thanks @kombucha. -- renamed to `gulp-load-plugins`. - -##### 0.1.1 -- add link to this repository into `package.json` (thanks @ben-eb). - -##### 0.1.0 -- move to `gulpLoadplugins` returning an object with the tasks define. - -##### 0.0.5 -- added `replaceString` option to configure exactly what gets replace when the plugin adds the module to the context - -##### 0.0.4 -- fixed keyword typo so plugin appears in search for gulp plugins - -##### 0.0.3 -- removed accidental console.log I'd left in - -##### 0.0.2 -- fixed accidentally missing a dependency out of package.json - -##### 0.0.1 -- initial release diff --git a/node_modules/gulp-load-plugins/index.js b/node_modules/gulp-load-plugins/index.js deleted file mode 100644 index 64c16a5..0000000 --- a/node_modules/gulp-load-plugins/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; -var multimatch = require('multimatch'); -var findup = require('findup-sync'); -var path = require('path'); -var resolve = require('resolve'); - -function arrayify(el) { - return Array.isArray(el) ? el : [el]; -} - -function camelize(str) { - return str.replace(/-(\w)/g, function(m, p1) { - return p1.toUpperCase(); - }); -} - -module.exports = function(options) { - var finalObject = {}; - var configObject; - var requireFn; - options = options || {}; - - var pattern = arrayify(options.pattern || ['gulp-*', 'gulp.*', '@*/gulp{-,.}*']); - var config = options.config || findup('package.json', {cwd: parentDir}); - var scope = arrayify(options.scope || ['dependencies', 'devDependencies', 'peerDependencies']); - var replaceString = options.replaceString || /^gulp(-|\.)/; - var camelizePluginName = options.camelize === false ? false : true; - var lazy = 'lazy' in options ? !!options.lazy : true; - var renameObj = options.rename || {}; - - if(typeof options.requireFn === 'function') { - requireFn = options.requireFn; - } else if(typeof config === 'string') { - requireFn = function (name) { - // This searches up from the specified package.json file, making sure - // the config option behaves as expected. See issue #56. - var src = resolve.sync(name, { basedir: path.dirname(config) }); - return require(src); - }; - } else { - requireFn = require; - } - - configObject = (typeof config === 'string') ? require(config) : config; - - if(!configObject) { - throw new Error('Could not find dependencies. Do you have a package.json file in your project?'); - } - - var names = scope.reduce(function(result, prop) { - return result.concat(Object.keys(configObject[prop] || {})); - }, []); - - pattern.push('!gulp-load-plugins'); - - function defineProperty(object, requireName, name) { - if(lazy) { - Object.defineProperty(object, requireName, { - get: function() { - return requireFn(name); - } - }); - } else { - object[requireName] = requireFn(name); - } - } - - function getRequireName(name) { - var requireName; - - if(renameObj[name]) { - requireName = options.rename[name]; - } else { - requireName = name.replace(replaceString, ''); - requireName = camelizePluginName ? camelize(requireName) : requireName; - } - - return requireName; - } - - var scopeTest = new RegExp('^@'); - var scopeDecomposition = new RegExp('^@(.+)/(.+)'); - - multimatch(names, pattern).forEach(function(name) { - if(scopeTest.test(name)) { - var decomposition = scopeDecomposition.exec(name); - - if(!finalObject.hasOwnProperty(decomposition[1])) { - finalObject[decomposition[1]] = {}; - } - - defineProperty(finalObject[decomposition[1]], getRequireName(decomposition[2]), name); - } else { - defineProperty(finalObject, getRequireName(name), name); - } - - }); - - return finalObject; -}; - -var parentDir = path.dirname(module.parent.filename); - -// Necessary to get the current `module.parent` and resolve paths correctly. -delete require.cache[__filename]; diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore b/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore deleted file mode 100644 index 84561e0..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -test -.travis.yml -.jshintrc -Gruntfile.js diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT b/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -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. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md deleted file mode 100644 index da08371..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# findup-sync [![Build Status](https://secure.travis-ci.org/cowboy/node-findup-sync.png?branch=master)](http://travis-ci.org/cowboy/node-findup-sync) - -Find the first file matching a given pattern in the current directory or the nearest ancestor directory. - -## Getting Started -Install the module with: `npm install findup-sync` - -```js -var findup = require('findup-sync'); - -// Start looking in the CWD. -var filepath1 = findup('{a,b}*.txt'); - -// Start looking somewhere else, and ignore case (probably a good idea). -var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); -``` - -## Usage - -```js -findup(patternOrPatterns [, minimatchOptions]) -``` - -### patternOrPatterns -Type: `String` or `Array` -Default: none - -One or more wildcard glob patterns. Or just filenames. - -### minimatchOptions -Type: `Object` -Default: `{}` - -Options to be passed to [minimatch](https://github.com/isaacs/minimatch). - -Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). - -## Release History -2014-12-17 - v0.2.1 - updated to glob 4.3. -2014-12-16 - v0.2.0 - Removed lodash, updated to glob 4.x. -2014-03-14 - v0.1.3 - Updated dependencies. -2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. -2012-11-15 - v0.1.1 - Now works without an options object. -2012-11-01 - v0.1.0 - Initial release. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js deleted file mode 100644 index 871a725..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/lib/findup-sync.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * findup-sync - * https://github.com/cowboy/node-findup-sync - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - */ - -'use strict'; - -// Nodejs libs. -var path = require('path'); - -// External libs. -var glob = require('glob'); - -// Search for a filename in the given directory or all parent directories. -module.exports = function(patterns, options) { - // Normalize patterns to an array. - if (!Array.isArray(patterns)) { patterns = [patterns]; } - // Create globOptions so that it can be modified without mutating the - // original object. - var globOptions = Object.create(options || {}); - globOptions.maxDepth = 1; - globOptions.cwd = path.resolve(globOptions.cwd || '.'); - - var files, lastpath; - do { - // Search for files matching patterns. - files = patterns.map(function(pattern) { - return glob.sync(pattern, globOptions); - }).reduce(function(a, b) { - return a.concat(b); - }).filter(function(entry, index, arr) { - return index === arr.indexOf(entry); - }); - // Return file if found. - if (files.length > 0) { - return path.resolve(path.join(globOptions.cwd, files[0])); - } - // Go up a directory. - lastpath = globOptions.cwd; - globOptions.cwd = path.resolve(globOptions.cwd, '..'); - // If parentpath is the same as basedir, we can't go any higher. - } while (globOptions.cwd !== lastpath); - - // No files were found! - return null; -}; diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md deleted file mode 100644 index e479ae2..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/README.md +++ /dev/null @@ -1,357 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) - -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Negation - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird, and for the time being, this should be -avoided. The behavior will change or be deprecated in version 5. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array<String>} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array<String>} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array<String>} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'DIR'` - Path exists, and is not a directory - * `'FILE'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, and `cache` options, so that parallel glob -operations will be sped up by sharing information about the -filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` Perform a synchronous glob search. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nonegate` Suppress `negate` behavior. (See below.) -* `nocomment` Suppress `comment` behavior. (See below.) -* `nonull` Return the pattern when no matches are found. -* `nodir` Do not match directories, only files. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js deleted file mode 100644 index 610d124..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/common.js +++ /dev/null @@ -1,177 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.isAbsolute = process.platform === "win32" ? absWin : absUnix -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var Minimatch = minimatch.Minimatch - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - var result = splitDeviceRe.exec(p) - var device = result[1] || '' - var isUnc = device && device.charAt(1) !== ':' - var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.pattern = pattern - self.strict = options.strict !== false - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - self.found = all -} - -function mark (self, p) { - var c = self.cache[p] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - self.statCache[m] = self.statCache[p] - self.cache[m] = self.cache[p] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(self.root, f) - } else if (exports.isAbsolute(f)) { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } - return abs -} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js deleted file mode 100644 index 7401e0b..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/glob.js +++ /dev/null @@ -1,649 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {<filename>: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - //console.error('FINISH', this.matches) - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (!this.matches[index][e]) { - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (!this.stat && !this.mark) - return this.emit('match', e) - - var self = this - this._stat(this._makeAbs(e), function (er, c, st) { - self.emit('stat', e, st) - self.emit('match', e) - }) - } -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[f] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[f] = false - break - - default: // some unusual error. Treat as failure. - this.cache[f] = false - if (this.strict) return this.emit('error', er) - if (!this.silent) console.error('glob error', er) - break - } - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = f - if (f.charAt(0) === '/') - abs = path.join(this.root, f) - else if (this.changedCwd) - abs = path.resolve(this.cwd, f) - - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, f)) { - var c = this.cache[f] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but not how we need it - if (abs.slice(-1) === '/' && c !== 'DIR') - return cb() - - return cb(null, c) - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else - return cb(null, stat.isDirectory() ? 'DIR' : 'FILE', stat) - } - - var self = this - var statcb = inflight('stat\0' + abs, statcb_) - if (statcb) - fs.stat(abs, statcb) - - function statcb_ (er, stat) { - self._stat2(f, abs, er, stat, cb) - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[f] = this.cache[f] || c - return cb(null, c, stat) -} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc deleted file mode 100644 index b7a1550..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env" : { - "node" : true - }, - "rules" : { - "semi": [2, "never"], - "strict": 0, - "quotes": [1, "single", "avoid-escape"], - "no-use-before-define": 0, - "curly": 0, - "no-underscore-dangle": 0, - "no-lonely-if": 1, - "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}], - "no-mixed-requires": 0, - "space-infix-ops": 0 - } -} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE deleted file mode 100644 index 05eeeb8..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md deleted file mode 100644 index 6dc8929..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js deleted file mode 100644 index 8bc96cb..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/inflight.js +++ /dev/null @@ -1,44 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE b/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/gulp-load-plugins/node_modules/findup-sync/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyr…
cuginoAle
added a commit
to cuginoAle/svg-inliner
that referenced
this pull request
Aug 27, 2019
diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..706e22d Binary files /dev/null and b/.DS_Store differ diff --git a/icons/activity.svg b/icons/activity.svg new file mode 100755 index 0000000..4044b44 --- /dev/null +++ b/icons/activity.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7069 3.00248C11.1545 3.03412 11.5262 3.36 11.6161 3.79959L14.2191 16.5255L15.7076 12.796C15.8593 12.4159 16.2272 12.1667 16.6364 12.1667H21C21.5523 12.1667 22 12.6144 22 13.1667C22 13.7189 21.5523 14.1667 21 14.1667H17.314L14.8379 20.3707C14.6741 20.7811 14.2603 21.0353 13.8202 20.996C13.3801 20.9568 13.0179 20.6333 12.9294 20.2004L10.3742 7.70839L8.30541 13.5029C8.1633 13.9009 7.78629 14.1667 7.36364 14.1667H3C2.44772 14.1667 2 13.7189 2 13.1667C2 12.6144 2.44772 12.1667 3 12.1667H6.65884L9.69459 3.66375C9.84545 3.24118 10.2593 2.97084 10.7069 3.00248Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/all-icons.js b/icons/all-icons.js new file mode 100644 index 0000000..a322a0f --- /dev/null +++ b/icons/all-icons.js @@ -0,0 +1,27 @@ + +module.exports = { + ['activity'] : `<svg class="icon-img activity-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7069 3.00248C11.1545 3.03412 11.5262 3.36 11.6161 3.79959L14.2191 16.5255L15.7076 12.796C15.8593 12.4159 16.2272 12.1667 16.6364 12.1667H21C21.5523 12.1667 22 12.6144 22 13.1667C22 13.7189 21.5523 14.1667 21 14.1667H17.314L14.8379 20.3707C14.6741 20.7811 14.2603 21.0353 13.8202 20.996C13.3801 20.9568 13.0179 20.6333 12.9294 20.2004L10.3742 7.70839L8.30541 13.5029C8.1633 13.9009 7.78629 14.1667 7.36364 14.1667H3C2.44772 14.1667 2 13.7189 2 13.1667C2 12.6144 2.44772 12.1667 3 12.1667H6.65884L9.69459 3.66375C9.84545 3.24118 10.2593 2.97084 10.7069 3.00248Z" fill="#7A7F8F"/> +</svg> +`,['arrow-down'] : `<svg class="icon-img arrow-down-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C12.5523 4 13 4.44772 13 5V16.6711L18.2905 11.344C18.6796 10.9521 19.3128 10.9499 19.7047 11.3391C20.0965 11.7282 20.0987 12.3614 19.7095 12.7533L12.7095 19.8019C12.5218 19.9909 12.2664 20.0972 12 20.0972C11.7336 20.0972 11.4782 19.9909 11.2905 19.8019L4.29045 12.7533C3.90128 12.3614 3.90347 11.7282 4.29534 11.3391C4.68722 10.9499 5.32038 10.9521 5.70955 11.344L11 16.6711L11 5C11 4.44772 11.4477 4 12 4Z" fill="#7A7F8F"/> +</svg> +`,['arrow-left'] : `<svg class="icon-img arrow-left-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7047 4.29045C13.0965 4.67962 13.0987 5.31278 12.7095 5.70466L7.40245 11.0486L19 11.0486C19.5523 11.0486 20 11.4963 20 12.0486C20 12.6009 19.5523 13.0486 19 13.0486L7.40245 13.0486L12.7095 18.3926C13.0987 18.7844 13.0965 19.4176 12.7047 19.8068C12.3128 20.1959 11.6796 20.1938 11.2905 19.8019L4.29045 12.7533C3.90318 12.3633 3.90318 11.7339 4.29045 11.344L11.2905 4.29534C11.6796 3.90347 12.3128 3.90128 12.7047 4.29045Z" fill="#7A7F8F"/> +</svg> +`,['arrow-right'] : `<svg class="icon-img arrow-right-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M11.2953 4.29045C11.6872 3.90128 12.3204 3.90347 12.7095 4.29534L19.7095 11.344C20.0968 11.7339 20.0968 12.3633 19.7095 12.7533L12.7095 19.8019C12.3204 20.1938 11.6872 20.1959 11.2953 19.8068C10.9035 19.4176 10.9013 18.7844 11.2905 18.3926L16.5976 13.0486H5C4.44772 13.0486 4 12.6009 4 12.0486C4 11.4963 4.44772 11.0486 5 11.0486L16.5976 11.0486L11.2905 5.70466C10.9013 5.31278 10.9035 4.67962 11.2953 4.29045Z" fill="#7A7F8F"/> +</svg> +`,['arrow-up'] : `<svg class="icon-img arrow-up-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C12.2664 4 12.5218 4.10631 12.7095 4.29534L19.7095 11.344C20.0987 11.7358 20.0965 12.369 19.7047 12.7582C19.3128 13.1473 18.6796 13.1451 18.2905 12.7533L13 7.42608L13 19.0972C13 19.6495 12.5523 20.0972 12 20.0972C11.4477 20.0972 11 19.6495 11 19.0972L11 7.42608L5.70955 12.7533C5.32038 13.1451 4.68722 13.1473 4.29534 12.7582C3.90347 12.369 3.90128 11.7358 4.29045 11.344L11.2905 4.29534C11.4782 4.10631 11.7336 4 12 4Z" fill="#7A7F8F"/> +</svg> +`,['attachment'] : `<svg class="icon-img attachment-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M17.0752 5.61917C16.3037 4.89388 15.0139 4.66135 13.8838 5.72375C12.3271 7.18712 10.4177 8.98869 8.8971 10.4247C8.13688 11.1427 7.47399 11.7691 7.00116 12.2161L6.24891 12.9274L6.24807 12.9281C5.29067 13.8399 4.97297 14.7875 5.0018 15.6165C5.0314 16.4675 5.43038 17.2972 6.08976 17.9314C7.38689 19.1789 9.59283 19.589 11.5486 17.7504C13.9289 15.5128 15.8722 13.7038 17.2208 12.4539C17.8951 11.829 18.4207 11.3438 18.7778 11.0148C18.9564 10.8502 19.0929 10.7247 19.1848 10.6403L19.3238 10.5127L20 11.2494L20.6756 11.9867L20.5379 12.1131C20.4467 12.1969 20.3109 12.3218 20.133 12.4857C19.7772 12.8135 19.253 13.2973 18.5803 13.9208C17.2348 15.1678 15.2949 16.9736 12.9185 19.2076C10.1176 21.8407 6.6984 21.2916 4.70338 19.3729C3.7167 18.424 3.05284 17.1188 3.00301 15.6861C2.95241 14.2313 3.53869 12.7465 4.86883 11.4798L4.87127 11.4775L5.62726 10.7627C6.10027 10.3155 6.7634 9.68887 7.52389 8.97066C9.04474 7.53437 10.9555 5.73153 12.5139 4.26655C14.4988 2.4006 16.9916 2.79557 18.4451 4.16196C19.1656 4.83928 19.6663 5.78424 19.7051 6.841C19.7447 7.9206 19.2977 9.00097 18.3338 9.90711C16.7773 11.3703 15.2922 12.7731 13.9837 14.0097C13.7866 14.196 13.5935 14.3785 13.4047 14.5569C12.3408 15.5625 11.415 16.4376 10.6935 17.1159C9.4666 18.2693 7.88974 18.1519 6.94453 17.2522C6.48739 16.817 6.18474 16.1981 6.18857 15.5031C6.19247 14.7949 6.51278 14.1177 7.09855 13.567C7.93202 12.7835 9.84124 10.9821 11.543 9.37576C12.3937 8.57276 13.1923 7.81877 13.7782 7.26553L14.7369 6.36009L15.4238 7.08683L16.1104 7.8139L15.1513 8.71967C14.5653 9.27297 13.7667 10.027 12.9159 10.8302C11.2147 12.436 9.30373 14.239 8.46843 15.0242C8.21982 15.258 8.18898 15.4338 8.18854 15.5141C8.18803 15.6076 8.22782 15.7125 8.32347 15.8036C8.41928 15.8948 8.55499 15.9544 8.70752 15.954C8.84814 15.9536 9.06561 15.9012 9.32358 15.6587C10.0428 14.9826 10.9661 14.1099 12.0299 13.1044C12.2189 12.9257 12.4124 12.7429 12.6099 12.5562C13.9187 11.3193 15.4054 9.91504 16.9639 8.44991C17.5576 7.89187 17.7225 7.35119 17.7064 6.91432C17.6896 6.45461 17.4672 5.98768 17.0752 5.61917ZM20 11.2494L20.6756 11.9867C21.0828 11.6136 21.1104 10.981 20.7373 10.5739C20.3642 10.1667 19.731 10.1396 19.3238 10.5127L20 11.2494ZM16.1508 6.40019C16.5301 6.8017 16.5119 7.43468 16.1104 7.8139L15.4238 7.08683L14.7369 6.36009C15.1384 5.98087 15.7716 5.99868 16.1508 6.40019Z" fill="#7A7F8F"/> +</svg> +`,['bell'] : `<svg class="icon-img bell-svg" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9333 4C8.70519 4 6.05778 6.6693 6.05778 10V14.8462C6.05778 15.2802 5.99774 15.6638 5.89932 16H17.9673C17.8689 15.6638 17.8089 15.2802 17.8089 14.8462V10.0007C17.8089 6.67003 15.1615 4 11.9333 4ZM19.8089 10C19.8089 5.59874 16.2997 2 11.9333 2C7.56695 2 4.05778 5.59871 4.05778 10V14.8462C4.05778 15.4158 3.87748 15.7393 3.7426 15.911C3.67025 16.0031 3.60134 16.063 3.5584 16.0958C3.54025 16.1097 3.52739 16.1182 3.52186 16.1217C3.12579 16.3372 2.92188 16.7926 3.02759 17.2333C3.13546 17.6829 3.53757 18 4 18H19.8667C20.3291 18 20.7312 17.6829 20.8391 17.2333C20.9448 16.7926 20.7409 16.3372 20.3448 16.1217C20.3393 16.1182 20.3264 16.1097 20.3083 16.0958C20.2653 16.063 20.1964 16.0031 20.1241 15.911C19.9892 15.7393 19.8089 15.4158 19.8089 14.8462V10Z" fill="#7A7F8F"/> +<path d="M14 19.3333C14 20.2538 13.1046 21 12 21C10.8954 21 10 20.2538 10 19.3333C10 19 10 19 12 19C14 19 14 19 14 19.3333Z" fill="#7A7F8F"/> +</svg> +` + + } diff --git a/icons/all-icons.md b/icons/all-icons.md new file mode 100644 index 0000000..29d64b1 --- /dev/null +++ b/icons/all-icons.md @@ -0,0 +1,9 @@ +| Name | icon | +|---|---| +|activity|<img src=".//activity.svg" width="100%" height="44" />| +|arrow-down|<img src=".//arrow-down.svg" width="100%" height="44" />| +|arrow-left|<img src=".//arrow-left.svg" width="100%" height="44" />| +|arrow-right|<img src=".//arrow-right.svg" width="100%" height="44" />| +|arrow-up|<img src=".//arrow-up.svg" width="100%" height="44" />| +|attachment|<img src=".//attachment.svg" width="100%" height="44" />| +|bell|<img src=".//bell.svg" width="100%" height="44" />| \ No newline at end of file diff --git a/icons/arrow-down.svg b/icons/arrow-down.svg new file mode 100755 index 0000000..8a6e2fd --- /dev/null +++ b/icons/arrow-down.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C12.5523 4 13 4.44772 13 5V16.6711L18.2905 11.344C18.6796 10.9521 19.3128 10.9499 19.7047 11.3391C20.0965 11.7282 20.0987 12.3614 19.7095 12.7533L12.7095 19.8019C12.5218 19.9909 12.2664 20.0972 12 20.0972C11.7336 20.0972 11.4782 19.9909 11.2905 19.8019L4.29045 12.7533C3.90128 12.3614 3.90347 11.7282 4.29534 11.3391C4.68722 10.9499 5.32038 10.9521 5.70955 11.344L11 16.6711L11 5C11 4.44772 11.4477 4 12 4Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/arrow-left.svg b/icons/arrow-left.svg new file mode 100755 index 0000000..e174e6d --- /dev/null +++ b/icons/arrow-left.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7047 4.29045C13.0965 4.67962 13.0987 5.31278 12.7095 5.70466L7.40245 11.0486L19 11.0486C19.5523 11.0486 20 11.4963 20 12.0486C20 12.6009 19.5523 13.0486 19 13.0486L7.40245 13.0486L12.7095 18.3926C13.0987 18.7844 13.0965 19.4176 12.7047 19.8068C12.3128 20.1959 11.6796 20.1938 11.2905 19.8019L4.29045 12.7533C3.90318 12.3633 3.90318 11.7339 4.29045 11.344L11.2905 4.29534C11.6796 3.90347 12.3128 3.90128 12.7047 4.29045Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/arrow-right.svg b/icons/arrow-right.svg new file mode 100755 index 0000000..843f590 --- /dev/null +++ b/icons/arrow-right.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M11.2953 4.29045C11.6872 3.90128 12.3204 3.90347 12.7095 4.29534L19.7095 11.344C20.0968 11.7339 20.0968 12.3633 19.7095 12.7533L12.7095 19.8019C12.3204 20.1938 11.6872 20.1959 11.2953 19.8068C10.9035 19.4176 10.9013 18.7844 11.2905 18.3926L16.5976 13.0486H5C4.44772 13.0486 4 12.6009 4 12.0486C4 11.4963 4.44772 11.0486 5 11.0486L16.5976 11.0486L11.2905 5.70466C10.9013 5.31278 10.9035 4.67962 11.2953 4.29045Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/arrow-up.svg b/icons/arrow-up.svg new file mode 100755 index 0000000..6f1c307 --- /dev/null +++ b/icons/arrow-up.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C12.2664 4 12.5218 4.10631 12.7095 4.29534L19.7095 11.344C20.0987 11.7358 20.0965 12.369 19.7047 12.7582C19.3128 13.1473 18.6796 13.1451 18.2905 12.7533L13 7.42608L13 19.0972C13 19.6495 12.5523 20.0972 12 20.0972C11.4477 20.0972 11 19.6495 11 19.0972L11 7.42608L5.70955 12.7533C5.32038 13.1451 4.68722 13.1473 4.29534 12.7582C3.90347 12.369 3.90128 11.7358 4.29045 11.344L11.2905 4.29534C11.4782 4.10631 11.7336 4 12 4Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/attachment.svg b/icons/attachment.svg new file mode 100755 index 0000000..6eed93a --- /dev/null +++ b/icons/attachment.svg @@ -0,0 +1,3 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M17.0752 5.61917C16.3037 4.89388 15.0139 4.66135 13.8838 5.72375C12.3271 7.18712 10.4177 8.98869 8.8971 10.4247C8.13688 11.1427 7.47399 11.7691 7.00116 12.2161L6.24891 12.9274L6.24807 12.9281C5.29067 13.8399 4.97297 14.7875 5.0018 15.6165C5.0314 16.4675 5.43038 17.2972 6.08976 17.9314C7.38689 19.1789 9.59283 19.589 11.5486 17.7504C13.9289 15.5128 15.8722 13.7038 17.2208 12.4539C17.8951 11.829 18.4207 11.3438 18.7778 11.0148C18.9564 10.8502 19.0929 10.7247 19.1848 10.6403L19.3238 10.5127L20 11.2494L20.6756 11.9867L20.5379 12.1131C20.4467 12.1969 20.3109 12.3218 20.133 12.4857C19.7772 12.8135 19.253 13.2973 18.5803 13.9208C17.2348 15.1678 15.2949 16.9736 12.9185 19.2076C10.1176 21.8407 6.6984 21.2916 4.70338 19.3729C3.7167 18.424 3.05284 17.1188 3.00301 15.6861C2.95241 14.2313 3.53869 12.7465 4.86883 11.4798L4.87127 11.4775L5.62726 10.7627C6.10027 10.3155 6.7634 9.68887 7.52389 8.97066C9.04474 7.53437 10.9555 5.73153 12.5139 4.26655C14.4988 2.4006 16.9916 2.79557 18.4451 4.16196C19.1656 4.83928 19.6663 5.78424 19.7051 6.841C19.7447 7.9206 19.2977 9.00097 18.3338 9.90711C16.7773 11.3703 15.2922 12.7731 13.9837 14.0097C13.7866 14.196 13.5935 14.3785 13.4047 14.5569C12.3408 15.5625 11.415 16.4376 10.6935 17.1159C9.4666 18.2693 7.88974 18.1519 6.94453 17.2522C6.48739 16.817 6.18474 16.1981 6.18857 15.5031C6.19247 14.7949 6.51278 14.1177 7.09855 13.567C7.93202 12.7835 9.84124 10.9821 11.543 9.37576C12.3937 8.57276 13.1923 7.81877 13.7782 7.26553L14.7369 6.36009L15.4238 7.08683L16.1104 7.8139L15.1513 8.71967C14.5653 9.27297 13.7667 10.027 12.9159 10.8302C11.2147 12.436 9.30373 14.239 8.46843 15.0242C8.21982 15.258 8.18898 15.4338 8.18854 15.5141C8.18803 15.6076 8.22782 15.7125 8.32347 15.8036C8.41928 15.8948 8.55499 15.9544 8.70752 15.954C8.84814 15.9536 9.06561 15.9012 9.32358 15.6587C10.0428 14.9826 10.9661 14.1099 12.0299 13.1044C12.2189 12.9257 12.4124 12.7429 12.6099 12.5562C13.9187 11.3193 15.4054 9.91504 16.9639 8.44991C17.5576 7.89187 17.7225 7.35119 17.7064 6.91432C17.6896 6.45461 17.4672 5.98768 17.0752 5.61917ZM20 11.2494L20.6756 11.9867C21.0828 11.6136 21.1104 10.981 20.7373 10.5739C20.3642 10.1667 19.731 10.1396 19.3238 10.5127L20 11.2494ZM16.1508 6.40019C16.5301 6.8017 16.5119 7.43468 16.1104 7.8139L15.4238 7.08683L14.7369 6.36009C15.1384 5.98087 15.7716 5.99868 16.1508 6.40019Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/bell.svg b/icons/bell.svg new file mode 100755 index 0000000..8b4864c --- /dev/null +++ b/icons/bell.svg @@ -0,0 +1,4 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9333 4C8.70519 4 6.05778 6.6693 6.05778 10V14.8462C6.05778 15.2802 5.99774 15.6638 5.89932 16H17.9673C17.8689 15.6638 17.8089 15.2802 17.8089 14.8462V10.0007C17.8089 6.67003 15.1615 4 11.9333 4ZM19.8089 10C19.8089 5.59874 16.2997 2 11.9333 2C7.56695 2 4.05778 5.59871 4.05778 10V14.8462C4.05778 15.4158 3.87748 15.7393 3.7426 15.911C3.67025 16.0031 3.60134 16.063 3.5584 16.0958C3.54025 16.1097 3.52739 16.1182 3.52186 16.1217C3.12579 16.3372 2.92188 16.7926 3.02759 17.2333C3.13546 17.6829 3.53757 18 4 18H19.8667C20.3291 18 20.7312 17.6829 20.8391 17.2333C20.9448 16.7926 20.7409 16.3372 20.3448 16.1217C20.3393 16.1182 20.3264 16.1097 20.3083 16.0958C20.2653 16.063 20.1964 16.0031 20.1241 15.911C19.9892 15.7393 19.8089 15.4158 19.8089 14.8462V10Z" fill="#7A7F8F"/> +<path d="M14 19.3333C14 20.2538 13.1046 21 12 21C10.8954 21 10 20.2538 10 19.3333C10 19 10 19 12 19C14 19 14 19 14 19.3333Z" fill="#7A7F8F"/> +</svg> diff --git a/icons/icons.md b/icons/icons.md new file mode 100644 index 0000000..29d64b1 --- /dev/null +++ b/icons/icons.md @@ -0,0 +1,9 @@ +| Name | icon | +|---|---| +|activity|<img src=".//activity.svg" width="100%" height="44" />| +|arrow-down|<img src=".//arrow-down.svg" width="100%" height="44" />| +|arrow-left|<img src=".//arrow-left.svg" width="100%" height="44" />| +|arrow-right|<img src=".//arrow-right.svg" width="100%" height="44" />| +|arrow-up|<img src=".//arrow-up.svg" width="100%" height="44" />| +|attachment|<img src=".//attachment.svg" width="100%" height="44" />| +|bell|<img src=".//bell.svg" width="100%" height="44" />| \ No newline at end of file diff --git a/index.js b/index.js new file mode 100755 index 0000000..4ead8cf --- /dev/null +++ b/index.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node + +const fs = require('fs') +const chalk = require('chalk') + +const exportDir = `${__dirname}/icons` +const indexFile = `${exportDir}/all-icons.js` +const iconsDir = `./` +const mdIconsMap = `${exportDir}/all-icons.md` +const ver = require('./package.json').version + +const logo = ` +--------------------------------------------- +╔═╗┬ ┬┌─┐ ╦┌┐┌┬ ┬┌┐┌┌─┐┬─┐ +╚═╗└┐┌┘│ ┬ ║││││ ││││├┤ ├┬┘ +╚═╝ └┘ └─┘ ╩┘└┘┴─┘┴┘└┘└─┘┴└─ ver. ${ver} +--------------------------------------------- + +` + +console.log(logo) + +const svgs = [] +fs.readdir(iconsDir, function (err, items) { + if (err) { + console.error(err) + } else { + const files = items.filter(file => file.indexOf('.svg') > 0) + console.log(`Working...`) + + files.forEach((file, i) => { + const svg = fs.readFileSync(`${iconsDir}/${file}`, 'utf8') + const fileName = file.split('.')[0] + + const svgTag = svg.replace('<svg ', `<svg class="icon-img ${fileName}-svg" `) + svgs.push(`['${fileName}'] : \`${svgTag}\``) + }) + + const md = files.map(f => `|${f.split('.')[0]}|<img src="${iconsDir}/${f}" width="100%" height="44" />|`).join('\n') + fs.writeFileSync(mdIconsMap, `| Name | icon |\n|---|---|\n${md}`) + } + + // write our generic index.js + + fs.writeFileSync(indexFile, ` +module.exports = { + ${svgs.join(',')}\n + }\n`) + + console.log(`${chalk.green('✔')} Exported ${svgs.length} svgs to all-index.js`) + console.log('---------------------------------------------') + console.log() +}) diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..90a871c --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..5452169 --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,88 @@ +{ + "_from": "ansi-styles@^3.2.1", + "_id": "ansi-styles@3.2.1", + "_inBundle": false, + "_integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "_location": "/ansi-styles", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-styles@^3.2.1", + "name": "ansi-styles", + "escapedName": "ansi-styles", + "rawSpec": "^3.2.1", + "saveSpec": null, + "fetchSpec": "^3.2.1" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "_shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d", + "_spec": "ansi-styles@^3.2.1", + "_where": "/Users/alessio/Sites/inline-svg-cli/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "ava": { + "require": "babel-polyfill" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^1.9.0" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava" + }, + "version": "3.2.1" +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..3158e2d --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900"> + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js new file mode 100644 index 0000000..1cc5fa8 --- /dev/null +++ b/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/chalk/index.js.flow b/node_modules/chalk/index.js.flow new file mode 100644 index 0000000..622caaa --- /dev/null +++ b/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray<string>; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 0000000..7c46386 --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,104 @@ +{ + "_from": "chalk", + "_id": "chalk@2.4.2", + "_inBundle": false, + "_integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "_location": "/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "chalk", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "_shasum": "cd42541677a54333cf541a49108c1432b44c9424", + "_spec": "chalk", + "_where": "/Users/alessio/Sites/inline-svg-cli", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" + }, + "types": "types/index.d.ts", + "version": "2.4.2", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 0000000..d298e2c --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +<h1 align="center"> + <br> + <br> + <img width="320" src="media/logo.svg" alt="Chalk"> + <br> + <br> + <br> +</h1> + +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + +<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900"> + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + +<a href="https://www.patreon.com/sindresorhus"> + <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160"> +</a> + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.`<style>[.<style>...](string, [string...])` + +Example: `chalk.red.bold.underline('Hello', 'world');` + +Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. + +Multiple arguments will be separated by space. + +### chalk.enabled + +Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property. + +Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`. + +If you need to change this in a reusable module, create a new instance: + +```js +const ctx = new chalk.constructor({enabled: false}); +``` + +### chalk.level + +Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers. + +If you need to change this in a reusable module, create a new instance: + +```js +const ctx = new chalk.constructor({level: 0}); +``` + +Levels are as follows: + +0. All colors disabled +1. Basic color support (16 colors) +2. 256 color support +3. Truecolor support (16 million colors) + +### chalk.supportsColor + +Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience. + +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* +- `visible` (Text is emitted only if enabled) + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` *(On Windows the bright version is used since normal blue is illegible)* +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Tagged template literal + +Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals). + +```js +const chalk = require('chalk'); + +const miles = 18; +const calculateFeet = miles => miles * 5280; + +console.log(chalk` + There are {bold 5280 feet} in a mile. + In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}. +`); +``` + +Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`). + +Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent: + +```js +console.log(chalk.bold.rgb(10, 100, 200)('Hello!')); +console.log(chalk`{bold.rgb(10,100,200) Hello!}`); +``` + +Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters. + +All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped. + + +## 256 and Truecolor color support + +Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps. + +Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red). + +Examples: + +- `chalk.hex('#DEADED').underline('Hello, world!')` +- `chalk.keyword('orange')('Some orange text')` +- `chalk.rgb(15, 100, 204).inverse('Hello!')` + +Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors). + +- `chalk.bgHex('#DEADED').underline('Hello, world!')` +- `chalk.bgKeyword('orange')('Some orange text')` +- `chalk.bgRgb(15, 100, 204).inverse('Hello!')` + +The following color models can be used: + +- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')` +- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')` +- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')` +- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')` +- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')` +- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')` +- `ansi16` +- `ansi256` + + +## Windows + +If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`. + + +## Origin story + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative. + + +## Related + +- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module +- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal +- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color +- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes +- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes +- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models +- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal +- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings +- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings +- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/chalk/templates.js b/node_modules/chalk/templates.js new file mode 100644 index 0000000..dbdf9b2 --- /dev/null +++ b/node_modules/chalk/templates.js @@ -0,0 +1,128 @@ +'use strict'; +const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; + +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); + +function unescape(c) { + if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } + + return ESCAPES.get(c) || c; +} + +function parseArguments(name, args) { + const results = []; + const chunks = args.trim().split(/\s*,\s*/g); + let matches; + + for (const chunk of chunks) { + if (!isNaN(chunk)) { + results.push(Number(chunk)); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } + + return results; +} + +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + + const results = []; + let matches; + + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } + + return results; +} + +function buildStyle(chalk, styles) { + const enabled = {}; + + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } + + let current = chalk; + for (const styleName of Object.keys(enabled)) { + if (Array.isArray(enabled[styleName])) { + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + + if (enabled[styleName].length > 0) { + current = current[styleName].apply(current, enabled[styleName]); + } else { + current = current[styleName]; + } + } + } + + return current; +} + +module.exports = (chalk, tmp) => { + const styles = []; + const chunks = []; + let chunk = []; + + // eslint-disable-next-line max-params + tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { + if (escapeChar) { + chunk.push(unescape(escapeChar)); + } else if (style) { + const str = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } + + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(chr); + } + }); + + chunks.push(chunk.join('')); + + if (styles.length > 0) { + const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMsg); + } + + return chunks.join(''); +}; diff --git a/node_modules/chalk/types/index.d.ts b/node_modules/chalk/types/index.d.ts new file mode 100644 index 0000000..b4e4dc5 --- /dev/null +++ b/node_modules/chalk/types/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for Chalk +// Definitions by: Thomas Sauer <https://github.com/t-sauer> + +export const enum Level { + None = 0, + Basic = 1, + Ansi256 = 2, + TrueColor = 3 +} + +export interface ChalkOptions { + enabled?: boolean; + level?: Level; +} + +export interface ChalkConstructor { + new (options?: ChalkOptions): Chalk; + (options?: ChalkOptions): Chalk; +} + +export interface ColorSupport { + level: Level; + hasBasic: boolean; + has256: boolean; + has16m: boolean; +} + +export interface Chalk { + (...text: string[]): string; + (text: TemplateStringsArray, ...placeholders: string[]): string; + constructor: ChalkConstructor; + enabled: boolean; + level: Level; + rgb(r: number, g: number, b: number): this; + hsl(h: number, s: number, l: number): this; + hsv(h: number, s: number, v: number): this; + hwb(h: number, w: number, b: number): this; + bgHex(color: string): this; + bgKeyword(color: string): this; + bgRgb(r: number, g: number, b: number): this; + bgHsl(h: number, s: number, l: number): this; + bgHsv(h: number, s: number, v: number): this; + bgHwb(h: number, w: number, b: number): this; + hex(color: string): this; + keyword(color: string): this; + + readonly reset: this; + readonly bold: this; + readonly dim: this; + readonly italic: this; + readonly underline: this; + readonly inverse: this; + readonly hidden: this; + readonly strikethrough: this; + + readonly visible: this; + + readonly black: this; + readonly red: this; + readonly green: this; + readonly yellow: this; + readonly blue: this; + readonly magenta: this; + readonly cyan: this; + readonly white: this; + readonly gray: this; + readonly grey: this; + readonly blackBright: this; + readonly redBright: this; + readonly greenBright: this; + readonly yellowBright: this; + readonly blueBright: this; + readonly magentaBright: this; + readonly cyanBright: this; + readonly whiteBright: this; + + readonly bgBlack: this; + readonly bgRed: this; + readonly bgGreen: this; + readonly bgYellow: this; + readonly bgBlue: this; + readonly bgMagenta: this; + readonly bgCyan: this; + readonly bgWhite: this; + readonly bgBlackBright: this; + readonly bgRedBright: this; + readonly bgGreenBright: this; + readonly bgYellowBright: this; + readonly bgBlueBright: this; + readonly bgMagentaBright: this; + readonly bgCyanBright: this; + readonly bgWhiteBright: this; +} + +declare const chalk: Chalk & { supportsColor: ColorSupport }; + +export default chalk diff --git a/node_modules/color-convert/CHANGELOG.md b/node_modules/color-convert/CHANGELOG.md new file mode 100644 index 0000000..0a7bce4 --- /dev/null +++ b/node_modules/color-convert/CHANGELOG.md @@ -0,0 +1,54 @@ +# 1.0.0 - 2016-01-07 + +- Removed: unused speed test +- Added: Automatic routing between previously unsupported conversions +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Removed: `convert()` class +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Changed: all functions to lookup dictionary +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Changed: `ansi` to `ansi256` +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Fixed: argument grouping for functions requiring only one argument +([#27](https://github.com/Qix-/color-convert/pull/27)) + +# 0.6.0 - 2015-07-23 + +- Added: methods to handle +[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: + - rgb2ansi16 + - rgb2ansi + - hsl2ansi16 + - hsl2ansi + - hsv2ansi16 + - hsv2ansi + - hwb2ansi16 + - hwb2ansi + - cmyk2ansi16 + - cmyk2ansi + - keyword2ansi16 + - keyword2ansi + - ansi162rgb + - ansi162hsl + - ansi162hsv + - ansi162hwb + - ansi162cmyk + - ansi162keyword + - ansi2rgb + - ansi2hsl + - ansi2hsv + - ansi2hwb + - ansi2cmyk + - ansi2keyword +([#18](https://github.com/harthur/color-convert/pull/18)) + +# 0.5.3 - 2015-06-02 + +- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` +([#15](https://github.com/harthur/color-convert/issues/15)) + +--- + +Check out commit logs for older releases diff --git a/node_modules/color-convert/LICENSE b/node_modules/color-convert/LICENSE new file mode 100644 index 0000000..5b4c386 --- /dev/null +++ b/node_modules/color-convert/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.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. + diff --git a/node_modules/color-convert/README.md b/node_modules/color-convert/README.md new file mode 100644 index 0000000..d4b08fc --- /dev/null +++ b/node_modules/color-convert/README.md @@ -0,0 +1,68 @@ +# color-convert + +[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) + +Color-convert is a color conversion library for JavaScript and node. +It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): + +```js +var convert = require('color-convert'); + +convert.rgb.hsl(140, 200, 100); // [96, 48, 59] +convert.keyword.rgb('blue'); // [0, 0, 255] + +var rgbChannels = convert.rgb.channels; // 3 +var cmykChannels = convert.cmyk.channels; // 4 +var ansiChannels = convert.ansi16.channels; // 1 +``` + +# Install + +```console +$ npm install color-convert +``` + +# API + +Simply get the property of the _from_ and _to_ conversion that you're looking for. + +All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. + +All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). + +```js +var convert = require('color-convert'); + +// Hex to LAB +convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] +convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] + +// RGB to CMYK +convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] +convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] +``` + +### Arrays +All functions that accept multiple arguments also support passing an array. + +Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) + +```js +var convert = require('color-convert'); + +convert.rgb.hex(123, 45, 67); // '7B2D43' +convert.rgb.hex([123, 45, 67]); // '7B2D43' +``` + +## Routing + +Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so …
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14.