Added Gulp.js for compiling SCSS stylesheets

This commit is contained in:
2022-11-01 18:49:18 -04:00
parent 7c793dac88
commit 91f72d4893
2956 changed files with 361906 additions and 7 deletions

21
node_modules/vinyl/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
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.

452
node_modules/vinyl/README.md generated vendored Normal file
View File

@ -0,0 +1,452 @@
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# vinyl
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Virtual file format.
## What is Vinyl?
Vinyl is a very simple metadata object that describes a file. When you think of a file, two attributes come to mind: `path` and `contents`. These are the main attributes on a Vinyl object. A file does not necessarily represent something on your computers file system. You have files on S3, FTP, Dropbox, Box, CloudThingly.io and other services. Vinyl can be used to describe files from all of these sources.
## What is a Vinyl Adapter?
While Vinyl provides a clean way to describe a file, we also need a way to access these files. Each file source needs what I call a "Vinyl adapter". A Vinyl adapter simply exposes a `src(globs)` and a `dest(folder)` method. Each return a stream. The `src` stream produces Vinyl objects, and the `dest` stream consumes Vinyl objects. Vinyl adapters can expose extra methods that might be specific to their input/output medium, such as the `symlink` method [`vinyl-fs`][vinyl-fs] provides.
## Usage
```js
var Vinyl = require('vinyl');
var jsFile = new Vinyl({
cwd: '/',
base: '/test/',
path: '/test/file.js',
contents: Buffer.from('var x = 123')
});
```
## API
### `new Vinyl([options])`
The constructor is used to create a new instance of `Vinyl`. Each instance represents a separate file, directory or symlink.
All internally managed paths (`cwd`, `base`, `path`, `history`) are normalized and have trailing separators removed. See [Normalization and concatenation][normalization] for more information.
Options may be passed upon instantiation to create a file with specific properties.
#### `options`
Options are not mutated by the constructor.
##### `options.cwd`
The current working directory of the file.
Type: `String`
Default: `process.cwd()`
##### `options.base`
Used for calculating the `relative` property. This is typically where a glob starts.
Type: `String`
Default: `options.cwd`
##### `options.path`
The full path to the file.
Type: `String`
Default: `undefined`
##### `options.history`
Stores the path history. If `options.path` and `options.history` are both passed, `options.path` is appended to `options.history`. All `options.history` paths are normalized by the `file.path` setter.
Type: `Array`
Default: `[]` (or `[options.path]` if `options.path` is passed)
##### `options.stat`
The result of an `fs.stat` call. This is how you mark the file as a directory or symbolic link. See [isDirectory()][is-directory], [isSymbolic()][is-symbolic] and [fs.Stats][fs-stats] for more information.
Type: [`fs.Stats`][fs-stats]
Default: `undefined`
##### `options.contents`
The contents of the file. If `options.contents` is a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
Default: `null`
##### `options.{custom}`
Any other option properties will be directly assigned to the new Vinyl object.
```js
var Vinyl = require('vinyl');
var file = new Vinyl({ foo: 'bar' });
file.foo === 'bar'; // true
```
### Instance methods
Each Vinyl object will have instance methods. Every method will be available but may return differently based on what properties were set upon instantiation or modified since.
#### `file.isBuffer()`
Returns `true` if the file contents are a [`Buffer`][buffer], otherwise `false`.
#### `file.isStream()`
Returns `true` if the file contents are a [`Stream`][stream], otherwise `false`.
#### `file.isNull()`
Returns `true` if the file contents are `null`, otherwise `false`.
#### `file.isDirectory()`
Returns `true` if the file represents a directory, otherwise `false`.
A file is considered a directory when:
- `file.isNull()` is `true`
- `file.stat` is an object
- `file.stat.isDirectory()` returns `true`
When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isDirectory()` method.
#### `file.isSymbolic()`
Returns `true` if the file represents a symbolic link, otherwise `false`.
A file is considered symbolic when:
- `file.isNull()` is `true`
- `file.stat` is an object
- `file.stat.isSymbolicLink()` returns `true`
When constructing a Vinyl object, pass in a valid [`fs.Stats`][fs-stats] object via `options.stat`. If you are mocking the [`fs.Stats`][fs-stats] object, you may need to stub the `isSymbolicLink()` method.
#### `file.clone([options])`
Returns a new Vinyl object with all attributes cloned.
__By default custom attributes are cloned deeply.__
If `options` or `options.deep` is `false`, custom attributes will not be cloned deeply.
If `file.contents` is a [`Buffer`][buffer] and `options.contents` is `false`, the [`Buffer`][buffer] reference will be reused instead of copied.
#### `file.inspect()`
Returns a formatted-string interpretation of the Vinyl object. Automatically called by node's `console.log`.
### Instance properties
Each Vinyl object will have instance properties. Some may be unavailable based on what properties were set upon instantiation or modified since.
#### `file.contents`
Gets and sets the contents of the file. If set to a [`ReadableStream`][readable-stream], it is wrapped in a [`cloneable-readable`][cloneable-readable] stream.
Throws when set to any value other than a [`ReadableStream`][readable-stream], a [`Buffer`][buffer] or `null`.
Type: [`ReadableStream`][readable-stream], [`Buffer`][buffer], or `null`
#### `file.cwd`
Gets and sets current working directory. Will always be normalized and have trailing separators removed.
Throws when set to any value other than non-empty strings.
Type: `String`
#### `file.base`
Gets and sets base directory. Used for relative pathing (typically where a glob starts).
When `null` or `undefined`, it simply proxies the `file.cwd` property. Will always be normalized and have trailing separators removed.
Throws when set to any value other than non-empty strings or `null`/`undefined`.
Type: `String`
#### `file.path`
Gets and sets the absolute pathname string or `undefined`. Setting to a different value appends the new path to `file.history`. If set to the same value as the current path, it is ignored. All new values are normalized and have trailing separators removed.
Throws when set to any value other than a string.
Type: `String`
#### `file.history`
Array of `file.path` values the Vinyl object has had, from `file.history[0]` (original) through `file.history[file.history.length - 1]` (current). `file.history` and its elements should normally be treated as read-only and only altered indirectly by setting `file.path`.
Type: `Array`
#### `file.relative`
Gets the result of `path.relative(file.base, file.path)`.
Throws when set or when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.relative); // file.js
```
#### `file.dirname`
Gets and sets the dirname of `file.path`. Will always be normalized and have trailing separators removed.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.dirname); // /test
file.dirname = '/specs';
console.log(file.dirname); // /specs
console.log(file.path); // /specs/file.js
```
#### `file.basename`
Gets and sets the basename of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.basename); // file.js
file.basename = 'file.txt';
console.log(file.basename); // file.txt
console.log(file.path); // /test/file.txt
```
#### `file.stem`
Gets and sets stem (filename without suffix) of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.stem); // file
file.stem = 'foo';
console.log(file.stem); // foo
console.log(file.path); // /test/foo.js
```
#### `file.extname`
Gets and sets extname of `file.path`.
Throws when `file.path` is not set.
Type: `String`
Example:
```js
var file = new File({
cwd: '/',
base: '/test/',
path: '/test/file.js'
});
console.log(file.extname); // .js
file.extname = '.txt';
console.log(file.extname); // .txt
console.log(file.path); // /test/file.txt
```
#### `file.symlink`
Gets and sets the path where the file points to if it's a symbolic link. Will always be normalized and have trailing separators removed.
Throws when set to any value other than a string.
Type: `String`
### `Vinyl.isVinyl(file)`
Static method used for checking if an object is a Vinyl file. Use this method instead of `instanceof`.
Takes an object and returns `true` if it is a Vinyl file, otherwise returns `false`.
__Note: This method uses an internal flag that some older versions of Vinyl didn't expose.__
Example:
```js
var Vinyl = require('vinyl');
var file = new Vinyl();
var notAFile = {};
Vinyl.isVinyl(file); // true
Vinyl.isVinyl(notAFile); // false
```
### `Vinyl.isCustomProp(property)`
Static method used by Vinyl when setting values inside the constructor or when copying properties in `file.clone()`.
Takes a string `property` and returns `true` if the property is not used internally, otherwise returns `false`.
This method is useful for inheritting from the Vinyl constructor. Read more in [Extending Vinyl][extending-vinyl].
Example:
```js
var Vinyl = require('vinyl');
Vinyl.isCustomProp('sourceMap'); // true
Vinyl.isCustomProp('path'); // false -> internal getter/setter
```
## Normalization and concatenation
Since all properties are normalized in their setters, you can just concatenate with `/`, and normalization takes care of it properly on all platforms.
Example:
```js
var file = new File();
file.path = '/' + 'test' + '/' + 'foo.bar';
console.log(file.path);
// posix => /test/foo.bar
// win32 => \\test\\foo.bar
```
But never concatenate with `\`, since that is a valid filename character on posix system.
## Extending Vinyl
When extending Vinyl into your own class with extra features, you need to think about a few things.
When you have your own properties that are managed internally, you need to extend the static `isCustomProp` method to return `false` when one of these properties is queried.
```js
var Vinyl = require('vinyl');
var builtInProps = ['foo', '_foo'];
class SuperFile extends Vinyl {
constructor(options) {
super(options);
this._foo = 'example internal read-only value';
}
get foo() {
return this._foo;
}
static isCustomProp(name) {
return super.isCustomProp(name) && builtInProps.indexOf(name) === -1;
}
}
// `foo` won't be assigned to the object below
new SuperFile({ foo: "something" });
```
This makes properties `foo` and `_foo` skipped when passed in options to `constructor(options)` so they don't get assigned to the new object and override your custom implementation. They also won't be copied when cloning. __Note:__ The `_foo` and `foo` properties will still exist on the created/cloned object because you are assigning `_foo` in the constructor and `foo` is defined on the prototype.
Same goes for `clone()`. If you have your own internal stuff that needs special handling during cloning, you should extend it to do so.
## License
MIT
[is-symbolic]: #issymbolic
[is-directory]: #isdirectory
[normalization]: #normalization-and-concatenation
[extending-vinyl]: #extending-vinyl
[stream]: https://nodejs.org/api/stream.html#stream_stream
[readable-stream]: https://nodejs.org/api/stream.html#stream_readable_streams
[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer
[fs-stats]: http://nodejs.org/api/fs.html#fs_class_fs_stats
[vinyl-fs]: https://github.com/gulpjs/vinyl-fs
[cloneable-readable]: https://github.com/mcollina/cloneable-readable
[downloads-image]: https://img.shields.io/npm/dm/vinyl.svg
[npm-url]: https://www.npmjs.com/package/vinyl
[npm-image]: https://img.shields.io/npm/v/vinyl.svg
[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=$PROJECT_ID&branchName=master
[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/vinyl?branchName=master
[travis-url]: https://travis-ci.org/gulpjs/vinyl
[travis-image]: https://img.shields.io/travis/gulpjs/vinyl.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/vinyl
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/vinyl.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl/master.svg
[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

338
node_modules/vinyl/index.js generated vendored Normal file
View File

@ -0,0 +1,338 @@
'use strict';
var path = require('path');
var util = require('util');
var isBuffer = require('buffer').Buffer.isBuffer;
var clone = require('clone');
var cloneable = require('cloneable-readable');
var replaceExt = require('replace-ext');
var cloneStats = require('clone-stats');
var cloneBuffer = require('clone-buffer');
var removeTrailingSep = require('remove-trailing-separator');
var isStream = require('./lib/is-stream');
var normalize = require('./lib/normalize');
var inspectStream = require('./lib/inspect-stream');
var builtInFields = [
'_contents', '_symlink', 'contents', 'stat', 'history', 'path',
'_base', 'base', '_cwd', 'cwd',
];
function File(file) {
var self = this;
if (!file) {
file = {};
}
// Stat = files stats object
this.stat = file.stat || null;
// Contents = stream, buffer, or null if not read
this.contents = file.contents || null;
// Replay path history to ensure proper normalization and trailing sep
var history = Array.prototype.slice.call(file.history || []);
if (file.path) {
history.push(file.path);
}
this.history = [];
history.forEach(function(path) {
self.path = path;
});
this.cwd = file.cwd || process.cwd();
this.base = file.base;
this._isVinyl = true;
this._symlink = null;
// Set custom properties
Object.keys(file).forEach(function(key) {
if (self.constructor.isCustomProp(key)) {
self[key] = file[key];
}
});
}
File.prototype.isBuffer = function() {
return isBuffer(this.contents);
};
File.prototype.isStream = function() {
return isStream(this.contents);
};
File.prototype.isNull = function() {
return (this.contents === null);
};
File.prototype.isDirectory = function() {
if (!this.isNull()) {
return false;
}
if (this.stat && typeof this.stat.isDirectory === 'function') {
return this.stat.isDirectory();
}
return false;
};
File.prototype.isSymbolic = function() {
if (!this.isNull()) {
return false;
}
if (this.stat && typeof this.stat.isSymbolicLink === 'function') {
return this.stat.isSymbolicLink();
}
return false;
};
File.prototype.clone = function(opt) {
var self = this;
if (typeof opt === 'boolean') {
opt = {
deep: opt,
contents: true,
};
} else if (!opt) {
opt = {
deep: true,
contents: true,
};
} else {
opt.deep = opt.deep === true;
opt.contents = opt.contents !== false;
}
// Clone our file contents
var contents;
if (this.isStream()) {
contents = this.contents.clone();
} else if (this.isBuffer()) {
contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
}
var file = new this.constructor({
cwd: this.cwd,
base: this.base,
stat: (this.stat ? cloneStats(this.stat) : null),
history: this.history.slice(),
contents: contents,
});
if (this.isSymbolic()) {
file.symlink = this.symlink;
}
// Clone our custom properties
Object.keys(this).forEach(function(key) {
if (self.constructor.isCustomProp(key)) {
file[key] = opt.deep ? clone(self[key], true) : self[key];
}
});
return file;
};
File.prototype.inspect = function() {
var inspect = [];
// Use relative path if possible
var filePath = this.path ? this.relative : null;
if (filePath) {
inspect.push('"' + filePath + '"');
}
if (this.isBuffer()) {
inspect.push(this.contents.inspect());
}
if (this.isStream()) {
inspect.push(inspectStream(this.contents));
}
return '<File ' + inspect.join(' ') + '>';
};
// Newer Node.js versions use this symbol for custom inspection.
if (util.inspect.custom) {
File.prototype[util.inspect.custom] = File.prototype.inspect;
}
File.isCustomProp = function(key) {
return builtInFields.indexOf(key) === -1;
};
File.isVinyl = function(file) {
return (file && file._isVinyl === true) || false;
};
// Virtual attributes
// Or stuff with extra logic
Object.defineProperty(File.prototype, 'contents', {
get: function() {
return this._contents;
},
set: function(val) {
if (!isBuffer(val) && !isStream(val) && (val !== null)) {
throw new Error('File.contents can only be a Buffer, a Stream, or null.');
}
// Ask cloneable if the stream is a already a cloneable
// this avoid piping into many streams
// reducing the overhead of cloning
if (isStream(val) && !cloneable.isCloneable(val)) {
val = cloneable(val);
}
this._contents = val;
},
});
Object.defineProperty(File.prototype, 'cwd', {
get: function() {
return this._cwd;
},
set: function(cwd) {
if (!cwd || typeof cwd !== 'string') {
throw new Error('cwd must be a non-empty string.');
}
this._cwd = removeTrailingSep(normalize(cwd));
},
});
Object.defineProperty(File.prototype, 'base', {
get: function() {
return this._base || this._cwd;
},
set: function(base) {
if (base == null) {
delete this._base;
return;
}
if (typeof base !== 'string' || !base) {
throw new Error('base must be a non-empty string, or null/undefined.');
}
base = removeTrailingSep(normalize(base));
if (base !== this._cwd) {
this._base = base;
} else {
delete this._base;
}
},
});
// TODO: Should this be moved to vinyl-fs?
Object.defineProperty(File.prototype, 'relative', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get relative.');
}
return path.relative(this.base, this.path);
},
set: function() {
throw new Error('File.relative is generated from the base and path attributes. Do not modify it.');
},
});
Object.defineProperty(File.prototype, 'dirname', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get dirname.');
}
return path.dirname(this.path);
},
set: function(dirname) {
if (!this.path) {
throw new Error('No path specified! Can not set dirname.');
}
this.path = path.join(dirname, this.basename);
},
});
Object.defineProperty(File.prototype, 'basename', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get basename.');
}
return path.basename(this.path);
},
set: function(basename) {
if (!this.path) {
throw new Error('No path specified! Can not set basename.');
}
this.path = path.join(this.dirname, basename);
},
});
// Property for getting/setting stem of the filename.
Object.defineProperty(File.prototype, 'stem', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get stem.');
}
return path.basename(this.path, this.extname);
},
set: function(stem) {
if (!this.path) {
throw new Error('No path specified! Can not set stem.');
}
this.path = path.join(this.dirname, stem + this.extname);
},
});
Object.defineProperty(File.prototype, 'extname', {
get: function() {
if (!this.path) {
throw new Error('No path specified! Can not get extname.');
}
return path.extname(this.path);
},
set: function(extname) {
if (!this.path) {
throw new Error('No path specified! Can not set extname.');
}
this.path = replaceExt(this.path, extname);
},
});
Object.defineProperty(File.prototype, 'path', {
get: function() {
return this.history[this.history.length - 1];
},
set: function(path) {
if (typeof path !== 'string') {
throw new Error('path should be a string.');
}
path = removeTrailingSep(normalize(path));
// Record history only when path changed
if (path && path !== this.path) {
this.history.push(path);
}
},
});
Object.defineProperty(File.prototype, 'symlink', {
get: function() {
return this._symlink;
},
set: function(symlink) {
// TODO: should this set the mode to symbolic if set?
if (typeof symlink !== 'string') {
throw new Error('symlink should be a string');
}
this._symlink = removeTrailingSep(normalize(symlink));
},
});
module.exports = File;

13
node_modules/vinyl/lib/inspect-stream.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
'use strict';
function inspectStream(stream) {
var streamType = stream.constructor.name;
// Avoid StreamStream
if (streamType === 'Stream') {
streamType = '';
}
return '<' + streamType + 'Stream>';
}
module.exports = inspectStream;

15
node_modules/vinyl/lib/is-stream.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
'use strict';
function isStream(stream) {
if (!stream) {
return false;
}
if (typeof stream.pipe !== 'function') {
return false;
}
return true;
}
module.exports = isStream;

9
node_modules/vinyl/lib/normalize.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
'use strict';
var path = require('path');
function normalize(str) {
return str === '' ? str : path.normalize(str);
}
module.exports = normalize;

54
node_modules/vinyl/package.json generated vendored Normal file
View File

@ -0,0 +1,54 @@
{
"name": "vinyl",
"version": "2.2.1",
"description": "Virtual file format.",
"author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
"contributors": [
"Eric Schoffstall <yo@contra.io>",
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulpjs/vinyl",
"license": "MIT",
"engines": {
"node": ">= 0.10"
},
"main": "index.js",
"files": [
"LICENSE",
"index.js",
"lib"
],
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "nyc mocha --async-only",
"azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {
"clone": "^2.1.1",
"clone-buffer": "^1.0.0",
"clone-stats": "^1.0.0",
"cloneable-readable": "^1.0.0",
"remove-trailing-separator": "^1.0.1",
"replace-ext": "^1.0.0"
},
"devDependencies": {
"coveralls": "github:phated/node-coveralls#2.x",
"eslint": "^2.13.1",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.20.2",
"mississippi": "^1.2.0",
"mocha": "^3.0.0",
"nyc": "^10.3.2",
"safer-buffer": "^2.1.2"
},
"keywords": [
"virtual",
"filesystem",
"file",
"directory",
"stat",
"path"
]
}