Deployed the page to Github Pages.

This commit is contained in:
Batuhan Berk Başoğlu 2024-11-03 21:30:09 -05:00
parent 1d79754e93
commit 2c89899458
Signed by: batuhan-basoglu
SSH key fingerprint: SHA256:kEsnuHX+qbwhxSAXPUQ4ox535wFHu/hIRaa53FzxRpo
62797 changed files with 6551425 additions and 15279 deletions

28
node_modules/adjust-sourcemap-loader/.jshintrc generated vendored Normal file
View file

@ -0,0 +1,28 @@
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"freeze": false,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"maxparams": 20,
"maxdepth": 5,
"maxlen": 120,
"scripturl": true,
"node": true,
"esnext": true,
"jasmine": true
}

1
node_modules/adjust-sourcemap-loader/.nvmrc generated vendored Normal file
View file

@ -0,0 +1 @@
8.9

21
node_modules/adjust-sourcemap-loader/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019 Ben Holloway
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.

43
node_modules/adjust-sourcemap-loader/codec/absolute.js generated vendored Normal file
View file

@ -0,0 +1,43 @@
'use strict';
var path = require('path'),
fs = require('fs');
/**
* Codec for absolute paths.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'absolute',
decode: decode,
encode: encode,
root : root
};
/**
* Decode the given uri.
* Any path with leading slash is tested in an absolute sense.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
return path.isAbsolute(uri) && fs.existsSync(uri) && fs.statSync(uri).isFile() && uri;
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @returns {string} A uri
*/
function encode(absolute) {
return absolute;
}
/**
* The source-map root where relevant.
* @this {{options: object}} A loader or compilation
* @returns {string|undefined} The source-map root applicable to any encoded uri
*/
function root() {
}

View file

@ -0,0 +1,21 @@
'use strict';
/**
* Codec for code generated by the Bower plugin.
* @type {{name:string, decode:function, abstract:boolean}}
*/
module.exports = {
name : 'bowerComponent',
decode : decode,
abstract: true
};
/**
* Validate the given uri (abstract).
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else True
*/
function decode(uri) {
return /^\/?([\w-]+)\s+\(bower component\)$/.test(uri);
}

14
node_modules/adjust-sourcemap-loader/codec/index.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
module.exports = [
require('./webpack-protocol'),
require('./webpack-bootstrap'),
require('./bower-component'),
require('./npm-module'),
/* insert here any additional special character CODECs */
require('./output-relative'),
require('./output-root-relative'),
require('./project-relative'),
require('./project-root-relative'),
require('./source-relative'),
require('./source-root-relative'),
require('./absolute')
];

View file

@ -0,0 +1,35 @@
'use strict';
var path = require('path'),
fs = require('fs');
var loaderUtils = require('loader-utils');
var getContextDirectory = require('./utility/get-context-directory');
/**
* Codec for relative paths with respect to the context directory.
* @type {{name:string, decode: function}}
*/
module.exports = {
name : 'npmModule',
decode: decode
};
/**
* Decode the given uri.
* Include only module paths containing `~`.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
if (/~/.test(uri)) {
var relative = loaderUtils.urlToRequest(uri),
base = getContextDirectory.call(this),
absFile = path.normalize(path.join(base, 'node_modules', relative)),
isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();
return isValid && absFile;
}
}

View file

@ -0,0 +1,49 @@
'use strict';
var path = require('path'),
fs = require('fs');
var getOutputDirectory = require('./utility/get-output-directory');
/**
* Codec for relative paths with respect to the output directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'outputRelative',
decode: decode,
encode: encode,
root : getOutputDirectory
};
/**
* Decode the given uri.
* Any path with without leading slash is tested against output directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
var base = !uri.startsWith('/') && getOutputDirectory.call(this),
absFile = !!base && path.normalize(path.join(base, uri)),
isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();
return isValid && absFile;
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri without leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
var base = getOutputDirectory.call(this);
if (!base) {
throw new Error('Cannot locate the Webpack output directory');
}
else {
return path.relative(base, absolute);
}
}

View file

@ -0,0 +1,50 @@
'use strict';
var path = require('path'),
fs = require('fs');
var getContextDirectory = require('./utility/get-context-directory'),
enhancedRelative = require('./utility/enhanced-relative');
/**
* Codec for relative paths with respect to the project directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'projectRelative',
decode: decode,
encode: encode,
root : getContextDirectory
};
/**
* Decode the given uri.
* Any path with without leading slash is tested against project directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
var base = !uri.startsWith('/') && getContextDirectory.call(this),
absFile = !!base && path.normalize(path.join(base, uri)),
isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();
return isValid && absFile;
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri without leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
var base = getContextDirectory.call(this);
if (!base) {
throw new Error('Cannot locate the Webpack project directory');
}
else {
return enhancedRelative(base, absolute);
}
}

View file

@ -0,0 +1,51 @@
'use strict';
var path = require('path'),
fs = require('fs');
/**
* Codec for relative paths with respect to the source directory.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'sourceRelative',
decode: decode,
encode: encode,
root : root
};
/**
* Decode the given uri.
* Any path without leading slash is tested against source directory.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
var base = !uri.startsWith('/') && this.context,
absFile = !!base && path.normalize(path.join(base, uri)),
isValid = !!absFile && fs.existsSync(absFile) && fs.statSync(absFile).isFile();
return isValid && absFile;
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri without leading slash
*/
function encode(absolute) {
/* jshint validthis:true */
return path.relative(this.context, absolute);
}
/**
* The source-map root where relevant.
* @this {{options: object}} A loader or compilation
* @returns {string|undefined} The source-map root applicable to any encoded uri
*/
function root() {
/* jshint validthis:true */
return this.context;
}

View file

@ -0,0 +1,118 @@
'use strict';
var fs = require('fs'),
path = require('path');
var cache;
/**
* Perform <code>path.relative()</code> but try to detect and correct sym-linked node modules.
* @param {string} from The base path
* @param {string} to The full path
*/
function enhancedRelative(from, to) {
// relative path
var relative = path.relative(from, to);
// trailing is the relative path portion without any '../'
var trailing = relative.replace(/^\.{2}[\\\/]/, ''),
leading = to.replace(trailing, '');
// within project is what we want
var isInProject = (relative === trailing);
if (isInProject) {
return relative;
}
// otherwise look at symbolic linked modules
else {
var splitTrailing = trailing.split(/[\\\/]/);
// ensure failures can retry with fresh cache
for (var i = cache ? 2 : 1, foundPath = false; (i > 0) && !foundPath; i--) {
// ensure cache
cache = cache || indexLinkedModules(from);
// take elements from the trailing path and append them the the leading path in an attempt to find a package.json
for (var j = 0; (j < splitTrailing.length) && !foundPath; j++) {
// find the name of packages in the actual file location
// start at the lowest concrete directory that appears in the relative path
var packagePath = path.join.apply(path, [leading].concat(splitTrailing.slice(0, j + 1))),
packageJsonPath = path.join(packagePath, 'package.json'),
packageName = fs.existsSync(packageJsonPath) && require(packageJsonPath).name;
// lookup any package name in the cache
var linkedPackagePath = !!packageName && cache[packageName];
if (linkedPackagePath) {
// the remaining portion of the trailing path, not including the package path
var remainingPath = path.join.apply(path, splitTrailing.slice(j + 1));
// validate the remaining path in the linked location
// failure implies we will keep trying nested sym-linked packages
var linkedFilePath = path.join(linkedPackagePath, remainingPath),
isValid = !!linkedFilePath && fs.existsSync(linkedFilePath) &&
fs.statSync(linkedFilePath).isFile();
// path is found where valid
foundPath = isValid && linkedFilePath;
}
}
// cache cannot be trusted if a file can't be found
// set the cache to false to trigger its rebuild
cache = !!foundPath && cache;
}
// the relative path should now be within the project
return foundPath ? path.relative(from, foundPath) : relative;
}
}
module.exports = enhancedRelative;
/**
* Make a hash of linked modules within the given directory by breadth-first search.
* @param {string} directory A path to start searching
* @returns {object} A collection of sym-linked paths within the project keyed by their package name
*/
function indexLinkedModules(directory) {
var buffer = listSymLinkedModules(directory),
hash = {};
// while there are items in the buffer
while (buffer.length > 0) {
var modulePath = buffer.shift(),
packageJsonPath = path.join(modulePath, 'package.json'),
packageName = fs.existsSync(packageJsonPath) && require(packageJsonPath).name;
if (packageName) {
// add this path keyed by package name, so long as it doesn't exist at a lower level
hash[packageName] = hash[packageName] || modulePath;
// detect nested module and push to the buffer (breadth-first)
buffer.push.apply(buffer, listSymLinkedModules(modulePath));
}
}
return hash;
function listSymLinkedModules(directory) {
var modulesPath = path.join(directory, 'node_modules'),
hasNodeModules = fs.existsSync(modulesPath) && fs.statSync(modulesPath).isDirectory(),
subdirectories = !!hasNodeModules && fs.readdirSync(modulesPath) || [];
return subdirectories
.map(joinDirectory)
.filter(testIsSymLink);
function joinDirectory(subdirectory) {
return path.join(modulesPath, subdirectory);
}
function testIsSymLink(directory) {
return fs.lstatSync(directory).isSymbolicLink(); // must use lstatSync not statSync
}
}
}

View file

@ -0,0 +1,17 @@
'use strict';
var path = require('path');
/**
* Infer the compilation context directory from options.
* Relative paths are resolved against process.cwd().
* @this {{options: object}} A loader or compilation
* @returns {string} process.cwd() where not defined else the output path string
*/
function getContextDirectory() {
/* jshint validthis:true */
var context = this.options ? this.options.context : null;
return !!context && path.resolve(context) || process.cwd();
}
module.exports = getContextDirectory;

View file

@ -0,0 +1,22 @@
'use strict';
var path = require('path'),
fs = require('fs');
var getContextDirectory = require('./get-context-directory');
/**
* Infer the compilation output directory from options.
* Relative paths are resolved against the compilation context (or process.cwd() where not specified).
* @this {{options: object}} A loader or compilation
* @returns {undefined|string} The output path string, where defined
*/
function getOutputDirectory() {
/* jshint validthis:true */
var base = this.options && this.options.output ? this.options.output.directory : null,
absBase = !!base && path.resolve(getContextDirectory.call(this), base),
isValid = !!absBase && fs.existsSync(absBase) && fs.statSync(absBase).isDirectory();
return isValid ? absBase : undefined;
}
module.exports = getOutputDirectory;

View file

@ -0,0 +1,21 @@
'use strict';
/**
* Codec for webpack generated bootstrap code.
* @type {{name:string, decode:function, abstract:boolean}}
*/
module.exports = {
name : 'webpackBootstrap',
decode : decode,
abstract: true
};
/**
* Validate the given uri (abstract).
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else True
*/
function decode(uri) {
return /^webpack\/bootstrap\s+\w{20}$/.test(uri);
}

View file

@ -0,0 +1,45 @@
'use strict';
var projectRelative = require('./project-relative');
/**
* Codec for relative paths with respect to the context directory, preceded by a webpack:// protocol.
* @type {{name:string, decode: function, encode: function, root: function}}
*/
module.exports = {
name : 'webpackProtocol',
decode: decode,
encode: encode,
root : root
};
/**
* Decode the given uri.
* @this {{options: object}} A loader or compilation
* @param {string} uri A source uri to decode
* @returns {boolean|string} False where unmatched else the decoded path
*/
function decode(uri) {
/* jshint validthis:true */
var analysis = /^webpack:\/{2}(.*)$/.exec(uri);
return !!analysis && projectRelative.decode.call(this, analysis[1]);
}
/**
* Encode the given file path.
* @this {{options: object}} A loader or compilation
* @param {string} absolute An absolute file path to encode
* @returns {string} A uri
*/
function encode(absolute) {
/* jshint validthis:true */
return 'webpack://' + projectRelative.encode.call(this, absolute);
}
/**
* The source-map root where relevant.
* @this {{options: object}} A loader or compilation
* @returns {string|undefined} The source-map root applicable to any encoded uri
*/
function root() {
}

10
node_modules/adjust-sourcemap-loader/index.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
/*
* MIT License http://opensource.org/licenses/MIT
* Author: Ben Holloway @bholloway
*/
'use strict';
module.exports = Object.assign(require('./lib/loader'), {
moduleFilenameTemplate: require('./lib/module-filename-template'),
codec : require('./codec')
});

40
node_modules/adjust-sourcemap-loader/lib/loader.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
'use strict';
var path = require('path');
var loaderUtils = require('loader-utils');
var process = require('./process');
/**
* Webpack loader that manipulates the source-map of a preceding loader.
* @this {object} The loader context
* @param {string} content The content
* @param {object} sourceMap The source-map
* @returns {string|String}
*/
function loader(content, sourceMap) {
/* jshint validthis:true */
// loader result is cacheable
this.cacheable();
// webpack 1: prefer loader query, else options object
// webpack 2: prefer loader options
// webpack 3: deprecate loader.options object
// webpack 4: loader.options no longer defined
var options = Object.assign(
{},
this.options && this.options.adjustSourcemapLoader,
loaderUtils.getOptions(this),
{sep: path.sep}
);
// process the source-map
var outputMap = process(this, options, sourceMap);
// need to use callback when there are multiple arguments
this.callback(null, content, outputMap);
}
module.exports = loader;

View file

@ -0,0 +1,11 @@
'use strict';
var process = require('./process');
function moduleFilenameTemplate(options) {
return function templateFn(parameters) {
return process(parameters, options, parameters.resourcePath);
};
}
module.exports = moduleFilenameTemplate;

View file

@ -0,0 +1,58 @@
'use strict';
var PACKAGE_NAME = require('../../package.json').name,
PADDING = (new Array(11)).join(' ');
/**
* Format a debug message
* @param {{resourcePath:string, loaders:Array, loaderIndex:number}} context A loader or compilation
* @param {{input:Array.<string>, absolute:Array.<string>, output:Array.<string>, root:string}} info Source-map info
* @returns {string} An encoded debug string
*/
function debugMessage(context, info) {
return [
' ',
PACKAGE_NAME + ':',
' ' + context.resourcePath,
formatField('@', precedingRequest(context)),
formatField('INPUT', info.input || '(source-map absent)'),
formatField('ABSOLUTE', info.absolute),
formatField('OUTPUT', info.output),
formatField('ROOT', info.root)
]
.filter(Boolean)
.join('\n');
}
module.exports = debugMessage;
/**
* Find the request that precedes this loader in the loader chain
* @param {{loaders:Array, loaderIndex:number}} loader The loader context
* @returns {string} The request of the preceding loader
*/
function precedingRequest(loader) {
var isLoader = ('loaderIndex' in loader) && ('loaders' in loader) && Array.isArray(loader.loaders);
if (isLoader) {
var index = loader.loaderIndex + 1;
return (index in loader.loaders) ? loader.loaders[index].request : '(no preceding loader)';
}
}
/**
* Where the data is truthy then format it with a right-aligned title.
* @param {string} title
* @param {*} data The data to display
* @returns {boolean|string} False where data is falsey, else formatted message
*/
function formatField(title, data) {
return !!data && (rightAlign(title) + formatData(data));
function rightAlign(text) {
return (PADDING + text + ' ').slice(-PADDING.length);
}
function formatData(data) {
return Array.isArray(data) ? data.join('\n' + PADDING) : data;
}
}

View file

@ -0,0 +1,78 @@
'use strict';
var getFieldAsFn = require('./get-field-as-fn');
/**
* Create a decoder for input sources using the given codec hash
* @this {object} A loader or compilation
* @param {Array.<object>} codecs A list of codecs, each with a `decode` function
* @param {boolean} mustDecode Return an error for a source that is not decoded
* @returns {function(string):string|Error} A decode function that returns an absolute path or else an Error
*/
function decodeSourcesWith(codecs, mustDecode) {
/* jshint validthis:true */
var context = this;
// get a list of valid decoders
var candidates = [].concat(codecs)
.reduce(reduceValidDecoder.bind(null, codecs), []);
/**
* Attempt to decode the given source path using the previously supplied codecs
* @param {string} inputSource A source path from a source map
* @returns {Error|string|undefined} An absolute path if decoded else an error if encountered else undefined
*/
return function decode(inputSource) {
// attempt all candidates until a match
for (var i = 0, decoded = null; i < candidates.length && !decoded; i++) {
// call the decoder
try {
decoded = candidates[i].decode.call(context, inputSource);
}
catch (exception) {
return getNamedError(exception);
}
// match implies a return value
if (decoded) {
// abstract sources cannot be decoded, only validated
if (candidates[i].abstract) {
return undefined;
}
// non-string implies error
if (typeof decoded !== 'string') {
return getNamedError('Decoder returned a truthy value but it is not a string:\n' + decoded);
}
// otherwise success
else {
return decoded;
}
}
}
// default is undefined or error
return mustDecode ? new Error('No viable decoder for source: ' + inputSource) : undefined;
function getNamedError(details) {
var name = candidates[i].name || '(unnamed)',
message = [
'Decoding with codec: ' + name,
'Incoming source: ' + inputSource,
details && (details.stack ? details.stack : details)
]
.filter(Boolean)
.join('\n');
return new Error(message);
}
};
}
module.exports = decodeSourcesWith;
function reduceValidDecoder(reduced, codec) {
var decoder = getFieldAsFn('decode')(codec);
return decoder ? reduced.concat(codec) : reduced;
}

View file

@ -0,0 +1,48 @@
'use strict';
var getFieldAsFn = require('./get-field-as-fn'),
CustomError = require('./get-error');
/**
* Create an encoder for output sources using the given codec hash
* @throws Error Where the given codec is missing an encode function
* @this {object} A loader or compilation
* @param {{encode:function}} codec A single codec with an `encode` function
* @returns {function(string):string|Error|false} An encode function that takes an absolute path
*/
function encodeSourcesWith(codec) {
/* jshint validthis:true */
var context = this,
encoder = getFieldAsFn('encode')(codec);
if (!encoder) {
return new CustomError('Specified format does not support encoding (it lacks an "encoder" function)');
}
else {
return function encode(absoluteSource) {
// call the encoder
var encoded;
try {
encoded = absoluteSource && encoder.call(context, absoluteSource);
}
catch (exception) {
return getNamedError(exception);
}
return encoded;
function getNamedError(details) {
var name = codec.name || '(unnamed)',
message = [
'Encoding with codec: ' + name,
'Absolute source: ' + absoluteSource,
details && (details.stack ? details.stack : details)
]
.filter(Boolean)
.join('\n');
return new Error(message);
}
};
}
}
module.exports = encodeSourcesWith;

View file

@ -0,0 +1,17 @@
'use strict';
var PACKAGE_NAME = require('../../package.json').name;
/**
* Get an Error instance for the given message
* @param {...*} message Any number of message arguments
* @returns {Error}
*/
function getError() {
var message = (PACKAGE_NAME + ':\n' + Array.prototype.slice.call(arguments).join(' '))
.split(/\s*\n\s*/)
.join('\n ');
return new Error(message);
}
module.exports = getError;

View file

@ -0,0 +1,14 @@
'use strict';
/**
* Create a method that will retrieve the given field from an object where that field has a function value
* @param {string} field The field to consider
* @returns {function(object):function} A method that gets functions from the given field
*/
function getFieldAsFn(field) {
return function getFromValue(value) {
return !!value && (typeof value === 'object') && (typeof value[field] === 'function') && value[field];
};
}
module.exports = getFieldAsFn;

View file

@ -0,0 +1,117 @@
'use strict';
var debugMessage = require('./debug-message'),
toRegExp = require('./to-reg-exp'),
throwErrors = require('./throw-errors'),
decodeSourcesWith = require('./decode-sources-with'),
locateRootWith = require('./locate-root-with'),
encodeSourcesWith = require('./encode-sources-with'),
testCodec = require('./test-codec');
var CODECS = require('../../codec');
/**
* Process the given source-map per the given options.
* @param {{resourcePath:string, context:string, output:{path:string}}} context A loader or compilation
* @param {{debug:boolean, fail:boolean, format:string|boolean, root:string, codecs:object}} opt Options hash
* @param {object|string} sourceMapOrSource An incoming source-map or single source path
* @returns {undefined|object|string} An amended source-map or source path else undefined
*/
function process(context, opt, sourceMapOrSource) {
// default options
var options = Object.assign({
sep : '/',
debug : false,
fail : false,
format: false,
root : false,
codecs: CODECS
}, opt);
// validate codecs
var codecs = options.codecs
.filter(testCodec);
// determine what is present
var inputMap = !!sourceMapOrSource && (typeof sourceMapOrSource === 'object') && sourceMapOrSource,
inputPath = (typeof sourceMapOrSource === 'string') && sourceMapOrSource,
inputSources = inputMap && inputMap.sources || inputPath && [inputPath];
// what we need to produce
var absoluteSources,
outputSources,
outputRoot,
outputMap;
if (inputSources) {
// decode each source with the first valid codec
absoluteSources = inputSources
.map(decodeSourcesWith.call(context, codecs, options.fail));
// check for decode errors
throwErrors(context.resourcePath, absoluteSources);
// output map is a copy unless absent or we are removing
outputMap = (!inputMap || (options.format === 'remove')) ? undefined : Object.assign({}, inputMap);
// some change in format
if (options.format) {
// find the specified codec in the codecs list
var codec = codecs
.filter(testNamedCodec)
.pop();
if (!codec) {
throw new Error('Specified format "' + options.format + '" does not match any available codec.');
}
// use the encoder where specified in 'format'
outputSources = absoluteSources
.map(encodeSourcesWith.call(context, codec))
.map(insertAbstractSources)
.map(convertPathSep);
outputRoot = !!options.root && locateRootWith.call(context, codec)() || undefined;
// check for encode errors
throwErrors(context.resourcePath, outputSources.concat(outputRoot));
// commit the change
if (outputMap) {
outputMap.sources = outputSources;
outputMap.sourceRoot = outputRoot;
}
}
}
// debugging information
var isDebug = toRegExp(options.debug).test(context.resourcePath);
if (isDebug) {
console.log(debugMessage(context, {
input : inputSources,
absolute: absoluteSources,
output : outputSources,
root : outputRoot
}));
}
// complete
return inputMap ? outputMap : outputSources ? outputSources[0] : undefined;
function testNamedCodec(value) {
return (value.name === options.format);
}
function insertAbstractSources(value, i) {
return value || inputSources[i];
}
function convertPathSep(value) {
return (value instanceof Error) ? value : value.replace(/[\\\/]/g, options.sep);
}
}
module.exports = process;

View file

@ -0,0 +1,47 @@
'use strict';
var getFieldAsFn = require('./get-field-as-fn'),
CustomError = require('./get-error');
/**
* Locate the root for input sources using the given codec hash
* @throws Error Where the given codec is missing an encode function
* @this {object} A loader or compilation
* @param {{encode:function}} codec A single codec with an `encode` function
* @returns {function(string):string|Error} An encode function that takes an absolute path
*/
function locateRootWith(codec) {
/* jshint validthis:true */
var context = this,
root = getFieldAsFn('root')(codec);
if (!root) {
return new CustomError('Specified format does not support encoding (it lacks a "root" function)');
}
else {
return function locate() {
// call the root
var located;
try {
located = root.call(context);
}
catch (exception) {
return getNamedError(exception);
}
return located;
function getNamedError(details) {
var name = codec.name || '(unnamed)',
message = [
'Locating root with codec: ' + name,
details && (details.stack ? details.stack : details)
]
.filter(Boolean)
.join('\n');
return new Error(message);
}
};
}
}
module.exports = locateRootWith;

View file

@ -0,0 +1,37 @@
'use strict';
var assert = require('assert');
/**
* Reducer function that converts a codec list to a hash.
* @throws Error on bad codec
* @param {{name:string, decode:function, encode:function, root:function}} candidate A possible codec
* @returns True where an error is not thrown
*/
function testCodec(candidate) {
assert(
!!candidate && (typeof candidate === 'object'),
'Codec must be an object'
);
assert(
(typeof candidate.name === 'string') && /^[\w-]+$/.test(candidate.name),
'Codec.name must be a kebab-case string'
);
assert(
(typeof candidate.decode === 'function') && (candidate.decode.length === 1),
'Codec.decode must be a function that accepts a single source string'
);
assert(
(typeof candidate.encode === 'undefined') ||
((typeof candidate.encode === 'function') && (candidate.encode.length === 1)),
'Codec.encode must be a function that accepts a single absolute path string, or else be omitted'
);
assert(
(typeof candidate.root === 'undefined') ||
(typeof candidate.root === 'function') && (candidate.root.length === 0),
'Codec.root must be a function that accepts no arguments, or else be omitted'
);
return true;
}
module.exports = testCodec;

View file

@ -0,0 +1,30 @@
'use strict';
var getError = require('./get-error');
/**
* Where the given list is non-null and contains error instances then consolidate and throw
* @throws Error
* @param {string} resourcePath The path to the resource being processed
* @param {null|Array} candidates A possible Array with possible error elements
*/
function throwErrors(resourcePath, candidates) {
var errors = !!candidates && candidates
.filter(testIsError)
.map(getMessage);
var hasError = !!errors && errors.length;
if (hasError) {
throw getError(['For resource: ' + resourcePath].concat(errors).join('\n'));
}
function testIsError(candidate) {
return !!candidate && (typeof candidate === 'object') && (candidate instanceof Error);
}
function getMessage(error) {
return error.message;
}
}
module.exports = throwErrors;

View file

@ -0,0 +1,19 @@
'use strict';
var regexParser = require('regex-parser');
var REGEXP = /(\/?)(.+)\1([a-z]*)/i;
/**
* Parse the give value as a regular expression or give a pass-none expression where it is invalid
* @param {RegExp|string|*} value An existing expression, or its string representation, or degenerate value
* @returns {RegExp} The given expression or one matching the RegExp string else a pass-none expression
*/
function toRegExp(value) {
return ((typeof value === 'object') && (typeof value.test === 'function') && value) ||
((typeof value === 'string') && REGEXP.test(value) && regexParser(value)) ||
(/^true$|^$/.test(value) && /.*/) ||
/matchnone^/;
}
module.exports = toRegExp;

38
node_modules/adjust-sourcemap-loader/package.json generated vendored Normal file
View file

@ -0,0 +1,38 @@
{
"name": "adjust-sourcemap-loader",
"version": "4.0.0",
"description": "Webpack loader that adjusts source maps",
"main": "index.js",
"engines": {
"node": ">=8.9"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bholloway/adjust-sourcemap-loader.git"
},
"keywords": [
"webpack",
"loader",
"source-map",
"sourcemap",
"sources",
"resolve",
"adjust"
],
"author": "bholloway",
"license": "MIT",
"bugs": {
"url": "https://github.com/bholloway/adjust-sourcemap-loader/issues"
},
"homepage": "https://github.com/bholloway/adjust-sourcemap-loader",
"dependencies": {
"loader-utils": "^2.0.0",
"regex-parser": "^2.2.11"
},
"devDependencies": {
"jshint": "^2.12.0"
},
"scripts": {
"lint": "jshint index.js lib codec"
}
}

143
node_modules/adjust-sourcemap-loader/readme.md generated vendored Normal file
View file

@ -0,0 +1,143 @@
# Adjust Source-map Loader
[![NPM](https://nodei.co/npm/adjust-sourcemap-loader.png)](http://github.com/bholloway/adjust-sourcemap-loader)
Webpack loader that adjusts source maps.
Use as a **loader** to debug source-maps or to adjust source-maps between other loaders.
Use as a **module filename template** to ensure the final source-map are to your liking.
## Usage : Loader
``` javascript
require('adjust-sourcemap?format=absolute!babel?sourceMap');
```
### Source maps required
Note that **source maps** must be enabled on any preceding loader. In the above example we use `babel?sourceMap`.
### Apply via webpack config
It is preferable to adjust your `webpack.config` so to avoid having to prefix every `require()` statement:
``` javascript
module.exports = {
module: {
loaders: [
{
test : /\.js/,
loaders: ['adjust-sourcemap?format=absolute', 'babel?sourceMap']
}
]
}
};
```
## Usage : Module filename template
Specifying a certain format as the final step in a loader chain will **not** influence the final source format that Webpack will output. Instead the format is determined by the **module filename template**.
There are limitations to the filename templating that Webpack provides. This package may also operate as a custom template function that will convert output source-map sources to the desired `format`.
In the following example we ensure project-relative source-map sources are output.
```javascript
var templateFn = require('adjust-sourcemap-loader')
.moduleFilenameTemplate({
format: 'projectRelative'
});
module.exports = {
output: {
...
devtoolModuleFilenameTemplate : templateFn,
devtoolFallbackModuleFilenameTemplate: templateFn
}
};
```
## Options
As a loader, options may be set using [query parameters](https://webpack.github.io/docs/using-loaders.html#query-parameters) or by using [programmatic parameters](https://webpack.github.io/docs/how-to-write-a-loader.html#programmable-objects-as-query-option). Programmatic means the following in your `webpack.config`.
```javascript
module.exports = {
adjustSourcemapLoader: {
...
}
}
```
Where `...` is a hash of any of the following options.
* **`debug`** : `boolean|RegExp` May be used alone (boolean) or with a `RegExp` to match the resource(s) you are interested in debugging.
* **`fail`** : `boolean` Implies an **Error** if a source-map source cannot be decoded.
* **`format`** : `string` Optional output format for source-map `sources`. Must be the name of one of the available `codecs`. Omitting the format will result in **no change** and the outgoing source-map will match the incomming one.
* **`root`** : `boolean` A boolean flag that indices that a `sourceRoot` path sould be included in the output map. This is contingent on a `format` being specified.
* **`codecs`** : `Array.<{name:string, decode:function, encode:function, root:function}>` Optional Array of codecs. There are a number of built-in codecs available. If you specify you own codecs you will loose those that are built-in. However you can include them from the `codec/` directory.
Note that **query** parameters take precedence over **programmatic** parameters.
### Changing the format
Built-in codecs that may be specified as a `format` include:
* `absolute`
* `outputRelative`
* `projectRelative`
* `webpackProtocol`
* `sourceRelative` (works for loader only, **not** Module filename template)
### Specifying codecs
There are additional built-in codecs that do not support encoding. These are still necessary to decode source-map sources. If you specify your own `options.codecs` then you should **also include the built-in codecs**. Otherwise you will find that some sources cannot be decoded.
The existing codecs may be found in `/codec`, or on the loader itself:
```javascript
var inBuiltCodecs = require('adjust-sourcemap-loader').codecs,
myCodecs = [
{
name : 'foo',
decode: function(uri) {...},
encode: function(absolute) {...},
root : function() {...}
},
...
];
module.exports = {
adjustSourcemapLoader: {
codecs: inBuiltCodecs.concat(myCodecs)
}
}
```
The codec **order is important**. Those that come first have precedence. Any codec that detects a distinct URI should be foremost so that illegal paths are not encountered by successive codecs.
### Abstract codecs
A codec that detects generated code and cannot `decode()` a URI to an absolute file path.
Instead of implementing `encode()` or `root()` it should instead specify `abstract:true`. Its `decode()` function then may return `boolean` where it detects such generated sources.
For example, a built-in abstract codec will match the **Webpack bootstrap** code and ensure that its illegal source uri is not encountered by later coders.
## How it works
The loader will receive a source map as its second parameter, so long as the preceding loader was using source-maps.
The exception is the **css-loader** where the source-map is in the content, which is **not currently supported** .
The source-map `sources` are parsed by applying **codec.decode()** functions until one of them returns an absolute path to a file that exists. The exception is abstract codecs, where the source with remain unchanged.
If a format is specified then the source-map `sources` are recreated by applying the **codec.encode()** function for the stated `format` and (where the `root` option is specified) the **codec.root()** function will set the source-map `sourceRoot`.
If a codec does not specify **codec.encode()** or **codec.root()** then it may **not** be used as the `format`.