mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
31
web/node_modules/css-loader/dist/plugins/index.js
generated
vendored
Normal file
31
web/node_modules/css-loader/dist/plugins/index.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "importParser", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _postcssImportParser.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "icssParser", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _postcssIcssParser.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "urlParser", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _postcssUrlParser.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _postcssImportParser = _interopRequireDefault(require("./postcss-import-parser"));
|
||||
|
||||
var _postcssIcssParser = _interopRequireDefault(require("./postcss-icss-parser"));
|
||||
|
||||
var _postcssUrlParser = _interopRequireDefault(require("./postcss-url-parser"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
113
web/node_modules/css-loader/dist/plugins/postcss-icss-parser.js
generated
vendored
Normal file
113
web/node_modules/css-loader/dist/plugins/postcss-icss-parser.js
generated
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _icssUtils = require("icss-utils");
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _postcss.default.plugin('postcss-icss-parser', options => async css => {
|
||||
const importReplacements = Object.create(null);
|
||||
const {
|
||||
icssImports,
|
||||
icssExports
|
||||
} = (0, _icssUtils.extractICSS)(css);
|
||||
const imports = new Map();
|
||||
const tasks = []; // eslint-disable-next-line guard-for-in
|
||||
|
||||
for (const url in icssImports) {
|
||||
const tokens = icssImports[url];
|
||||
|
||||
if (Object.keys(tokens).length === 0) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
let normalizedUrl = url;
|
||||
let prefix = '';
|
||||
const queryParts = normalizedUrl.split('!');
|
||||
|
||||
if (queryParts.length > 1) {
|
||||
normalizedUrl = queryParts.pop();
|
||||
prefix = queryParts.join('!');
|
||||
}
|
||||
|
||||
const request = (0, _utils.requestify)((0, _utils.normalizeUrl)(normalizedUrl, true), options.rootContext);
|
||||
|
||||
const doResolve = async () => {
|
||||
const {
|
||||
resolver,
|
||||
context
|
||||
} = options;
|
||||
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([normalizedUrl, request])]);
|
||||
return {
|
||||
url: resolvedUrl,
|
||||
prefix,
|
||||
tokens
|
||||
};
|
||||
};
|
||||
|
||||
tasks.push(doResolve());
|
||||
}
|
||||
|
||||
const results = await Promise.all(tasks);
|
||||
|
||||
for (let index = 0; index <= results.length - 1; index++) {
|
||||
const {
|
||||
url,
|
||||
prefix,
|
||||
tokens
|
||||
} = results[index];
|
||||
const newUrl = prefix ? `${prefix}!${url}` : url;
|
||||
const importKey = newUrl;
|
||||
let importName = imports.get(importKey);
|
||||
|
||||
if (!importName) {
|
||||
importName = `___CSS_LOADER_ICSS_IMPORT_${imports.size}___`;
|
||||
imports.set(importKey, importName);
|
||||
options.imports.push({
|
||||
importName,
|
||||
url: options.urlHandler(newUrl),
|
||||
icss: true,
|
||||
index
|
||||
});
|
||||
options.api.push({
|
||||
importName,
|
||||
dedupe: true,
|
||||
index
|
||||
});
|
||||
}
|
||||
|
||||
for (const [replacementIndex, token] of Object.keys(tokens).entries()) {
|
||||
const replacementName = `___CSS_LOADER_ICSS_IMPORT_${index}_REPLACEMENT_${replacementIndex}___`;
|
||||
const localName = tokens[token];
|
||||
importReplacements[token] = replacementName;
|
||||
options.replacements.push({
|
||||
replacementName,
|
||||
importName,
|
||||
localName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(importReplacements).length > 0) {
|
||||
(0, _icssUtils.replaceSymbols)(css, importReplacements);
|
||||
}
|
||||
|
||||
for (const name of Object.keys(icssExports)) {
|
||||
const value = (0, _icssUtils.replaceValueSymbols)(icssExports[name], importReplacements);
|
||||
options.exports.push({
|
||||
name,
|
||||
value
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
exports.default = _default;
|
214
web/node_modules/css-loader/dist/plugins/postcss-import-parser.js
generated
vendored
Normal file
214
web/node_modules/css-loader/dist/plugins/postcss-import-parser.js
generated
vendored
Normal file
|
@ -0,0 +1,214 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _util = require("util");
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const pluginName = 'postcss-import-parser';
|
||||
|
||||
function walkAtRules(css, result, options, callback) {
|
||||
const accumulator = [];
|
||||
css.walkAtRules(/^import$/i, atRule => {
|
||||
// Convert only top-level @import
|
||||
if (atRule.parent.type !== 'root') {
|
||||
return;
|
||||
} // Nodes do not exists - `@import url('http://') :root {}`
|
||||
|
||||
|
||||
if (atRule.nodes) {
|
||||
result.warn("It looks like you didn't end your @import statement correctly. Child nodes are attached to it.", {
|
||||
node: atRule
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
nodes: paramsNodes
|
||||
} = (0, _postcssValueParser.default)(atRule.params); // No nodes - `@import ;`
|
||||
// Invalid type - `@import foo-bar;`
|
||||
|
||||
if (paramsNodes.length === 0 || paramsNodes[0].type !== 'string' && paramsNodes[0].type !== 'function') {
|
||||
result.warn(`Unable to find uri in "${atRule.toString()}"`, {
|
||||
node: atRule
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let isStringValue;
|
||||
let url;
|
||||
|
||||
if (paramsNodes[0].type === 'string') {
|
||||
isStringValue = true;
|
||||
url = paramsNodes[0].value;
|
||||
} else {
|
||||
// Invalid function - `@import nourl(test.css);`
|
||||
if (paramsNodes[0].value.toLowerCase() !== 'url') {
|
||||
result.warn(`Unable to find uri in "${atRule.toString()}"`, {
|
||||
node: atRule
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
isStringValue = paramsNodes[0].nodes.length !== 0 && paramsNodes[0].nodes[0].type === 'string';
|
||||
url = isStringValue ? paramsNodes[0].nodes[0].value : _postcssValueParser.default.stringify(paramsNodes[0].nodes);
|
||||
} // Empty url - `@import "";` or `@import url();`
|
||||
|
||||
|
||||
if (url.trim().length === 0) {
|
||||
result.warn(`Unable to find uri in "${atRule.toString()}"`, {
|
||||
node: atRule
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
accumulator.push({
|
||||
atRule,
|
||||
url,
|
||||
isStringValue,
|
||||
mediaNodes: paramsNodes.slice(1)
|
||||
});
|
||||
});
|
||||
callback(null, accumulator);
|
||||
}
|
||||
|
||||
const asyncWalkAtRules = (0, _util.promisify)(walkAtRules);
|
||||
|
||||
var _default = _postcss.default.plugin(pluginName, options => async (css, result) => {
|
||||
const parsedResults = await asyncWalkAtRules(css, result, options);
|
||||
|
||||
if (parsedResults.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const imports = new Map();
|
||||
const tasks = [];
|
||||
|
||||
for (const parsedResult of parsedResults) {
|
||||
const {
|
||||
atRule,
|
||||
url,
|
||||
isStringValue,
|
||||
mediaNodes
|
||||
} = parsedResult;
|
||||
let normalizedUrl = url;
|
||||
let prefix = '';
|
||||
const isRequestable = (0, _utils.isUrlRequestable)(normalizedUrl);
|
||||
|
||||
if (isRequestable) {
|
||||
const queryParts = normalizedUrl.split('!');
|
||||
|
||||
if (queryParts.length > 1) {
|
||||
normalizedUrl = queryParts.pop();
|
||||
prefix = queryParts.join('!');
|
||||
}
|
||||
|
||||
normalizedUrl = (0, _utils.normalizeUrl)(normalizedUrl, isStringValue); // Empty url after normalize - `@import '\
|
||||
// \
|
||||
// \
|
||||
// ';
|
||||
|
||||
if (normalizedUrl.trim().length === 0) {
|
||||
result.warn(`Unable to find uri in "${atRule.toString()}"`, {
|
||||
node: atRule
|
||||
}); // eslint-disable-next-line no-continue
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let media;
|
||||
|
||||
if (mediaNodes.length > 0) {
|
||||
media = _postcssValueParser.default.stringify(mediaNodes).trim().toLowerCase();
|
||||
}
|
||||
|
||||
if (options.filter && !options.filter(normalizedUrl, media)) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
atRule.remove();
|
||||
|
||||
if (isRequestable) {
|
||||
const request = (0, _utils.requestify)(normalizedUrl, options.rootContext);
|
||||
tasks.push((async () => {
|
||||
const {
|
||||
resolver,
|
||||
context
|
||||
} = options;
|
||||
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([request, normalizedUrl])]);
|
||||
return {
|
||||
url: resolvedUrl,
|
||||
media,
|
||||
prefix,
|
||||
isRequestable
|
||||
};
|
||||
})());
|
||||
} else {
|
||||
tasks.push({
|
||||
url,
|
||||
media,
|
||||
prefix,
|
||||
isRequestable
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const results = await Promise.all(tasks);
|
||||
|
||||
for (let index = 0; index <= results.length - 1; index++) {
|
||||
const {
|
||||
url,
|
||||
isRequestable,
|
||||
media
|
||||
} = results[index];
|
||||
|
||||
if (isRequestable) {
|
||||
const {
|
||||
prefix
|
||||
} = results[index];
|
||||
const newUrl = prefix ? `${prefix}!${url}` : url;
|
||||
const importKey = newUrl;
|
||||
let importName = imports.get(importKey);
|
||||
|
||||
if (!importName) {
|
||||
importName = `___CSS_LOADER_AT_RULE_IMPORT_${imports.size}___`;
|
||||
imports.set(importKey, importName);
|
||||
options.imports.push({
|
||||
importName,
|
||||
url: options.urlHandler(newUrl),
|
||||
index
|
||||
});
|
||||
}
|
||||
|
||||
options.api.push({
|
||||
importName,
|
||||
media,
|
||||
index
|
||||
}); // eslint-disable-next-line no-continue
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
options.api.push({
|
||||
url,
|
||||
media,
|
||||
index
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
exports.default = _default;
|
257
web/node_modules/css-loader/dist/plugins/postcss-url-parser.js
generated
vendored
Normal file
257
web/node_modules/css-loader/dist/plugins/postcss-url-parser.js
generated
vendored
Normal file
|
@ -0,0 +1,257 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _util = require("util");
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const pluginName = 'postcss-url-parser';
|
||||
const isUrlFunc = /url/i;
|
||||
const isImageSetFunc = /^(?:-webkit-)?image-set$/i;
|
||||
const needParseDecl = /(?:url|(?:-webkit-)?image-set)\(/i;
|
||||
|
||||
function getNodeFromUrlFunc(node) {
|
||||
return node.nodes && node.nodes[0];
|
||||
}
|
||||
|
||||
function shouldHandleRule(rule, decl, result) {
|
||||
// https://www.w3.org/TR/css-syntax-3/#typedef-url-token
|
||||
if (rule.url.replace(/^[\s]+|[\s]+$/g, '').length === 0) {
|
||||
result.warn(`Unable to find uri in '${decl.toString()}'`, {
|
||||
node: decl
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(0, _utils.isUrlRequestable)(rule.url)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function walkCss(css, result, options, callback) {
|
||||
const accumulator = [];
|
||||
css.walkDecls(decl => {
|
||||
if (!needParseDecl.test(decl.value)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parsed = (0, _postcssValueParser.default)(decl.value);
|
||||
parsed.walk(node => {
|
||||
if (node.type !== 'function') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isUrlFunc.test(node.value)) {
|
||||
const {
|
||||
nodes
|
||||
} = node;
|
||||
const isStringValue = nodes.length !== 0 && nodes[0].type === 'string';
|
||||
const url = isStringValue ? nodes[0].value : _postcssValueParser.default.stringify(nodes);
|
||||
const rule = {
|
||||
node: getNodeFromUrlFunc(node),
|
||||
url,
|
||||
needQuotes: false,
|
||||
isStringValue
|
||||
};
|
||||
|
||||
if (shouldHandleRule(rule, decl, result)) {
|
||||
accumulator.push({
|
||||
decl,
|
||||
rule,
|
||||
parsed
|
||||
});
|
||||
} // Do not traverse inside `url`
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
||||
|
||||
return false;
|
||||
} else if (isImageSetFunc.test(node.value)) {
|
||||
for (const nNode of node.nodes) {
|
||||
const {
|
||||
type,
|
||||
value
|
||||
} = nNode;
|
||||
|
||||
if (type === 'function' && isUrlFunc.test(value)) {
|
||||
const {
|
||||
nodes
|
||||
} = nNode;
|
||||
const isStringValue = nodes.length !== 0 && nodes[0].type === 'string';
|
||||
const url = isStringValue ? nodes[0].value : _postcssValueParser.default.stringify(nodes);
|
||||
const rule = {
|
||||
node: getNodeFromUrlFunc(nNode),
|
||||
url,
|
||||
needQuotes: false,
|
||||
isStringValue
|
||||
};
|
||||
|
||||
if (shouldHandleRule(rule, decl, result)) {
|
||||
accumulator.push({
|
||||
decl,
|
||||
rule,
|
||||
parsed
|
||||
});
|
||||
}
|
||||
} else if (type === 'string') {
|
||||
const rule = {
|
||||
node: nNode,
|
||||
url: value,
|
||||
needQuotes: true,
|
||||
isStringValue: true
|
||||
};
|
||||
|
||||
if (shouldHandleRule(rule, decl, result)) {
|
||||
accumulator.push({
|
||||
decl,
|
||||
rule,
|
||||
parsed
|
||||
});
|
||||
}
|
||||
}
|
||||
} // Do not traverse inside `image-set`
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
callback(null, accumulator);
|
||||
}
|
||||
|
||||
const asyncWalkCss = (0, _util.promisify)(walkCss);
|
||||
|
||||
var _default = _postcss.default.plugin(pluginName, options => async (css, result) => {
|
||||
const parsedResults = await asyncWalkCss(css, result, options);
|
||||
|
||||
if (parsedResults.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const tasks = [];
|
||||
const imports = new Map();
|
||||
const replacements = new Map();
|
||||
let hasUrlImportHelper = false;
|
||||
|
||||
for (const parsedResult of parsedResults) {
|
||||
const {
|
||||
url,
|
||||
isStringValue
|
||||
} = parsedResult.rule;
|
||||
let normalizedUrl = url;
|
||||
let prefix = '';
|
||||
const queryParts = normalizedUrl.split('!');
|
||||
|
||||
if (queryParts.length > 1) {
|
||||
normalizedUrl = queryParts.pop();
|
||||
prefix = queryParts.join('!');
|
||||
}
|
||||
|
||||
normalizedUrl = (0, _utils.normalizeUrl)(normalizedUrl, isStringValue);
|
||||
|
||||
if (!options.filter(normalizedUrl)) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hasUrlImportHelper) {
|
||||
options.imports.push({
|
||||
importName: '___CSS_LOADER_GET_URL_IMPORT___',
|
||||
url: options.urlHandler(require.resolve('../runtime/getUrl.js')),
|
||||
index: -1
|
||||
});
|
||||
hasUrlImportHelper = true;
|
||||
}
|
||||
|
||||
const splittedUrl = normalizedUrl.split(/(\?)?#/);
|
||||
const [pathname, query, hashOrQuery] = splittedUrl;
|
||||
let hash = query ? '?' : '';
|
||||
hash += hashOrQuery ? `#${hashOrQuery}` : '';
|
||||
const request = (0, _utils.requestify)(pathname, options.rootContext);
|
||||
tasks.push((async () => {
|
||||
const {
|
||||
resolver,
|
||||
context
|
||||
} = options;
|
||||
const resolvedUrl = await (0, _utils.resolveRequests)(resolver, context, [...new Set([request, normalizedUrl])]);
|
||||
return {
|
||||
url: resolvedUrl,
|
||||
prefix,
|
||||
hash,
|
||||
parsedResult
|
||||
};
|
||||
})());
|
||||
}
|
||||
|
||||
const results = await Promise.all(tasks);
|
||||
|
||||
for (let index = 0; index <= results.length - 1; index++) {
|
||||
const {
|
||||
url,
|
||||
prefix,
|
||||
hash,
|
||||
parsedResult: {
|
||||
decl,
|
||||
rule,
|
||||
parsed
|
||||
}
|
||||
} = results[index];
|
||||
const newUrl = prefix ? `${prefix}!${url}` : url;
|
||||
const importKey = newUrl;
|
||||
let importName = imports.get(importKey);
|
||||
|
||||
if (!importName) {
|
||||
importName = `___CSS_LOADER_URL_IMPORT_${imports.size}___`;
|
||||
imports.set(importKey, importName);
|
||||
options.imports.push({
|
||||
importName,
|
||||
url: options.urlHandler(newUrl),
|
||||
index
|
||||
});
|
||||
}
|
||||
|
||||
const {
|
||||
needQuotes
|
||||
} = rule;
|
||||
const replacementKey = JSON.stringify({
|
||||
newUrl,
|
||||
hash,
|
||||
needQuotes
|
||||
});
|
||||
let replacementName = replacements.get(replacementKey);
|
||||
|
||||
if (!replacementName) {
|
||||
replacementName = `___CSS_LOADER_URL_REPLACEMENT_${replacements.size}___`;
|
||||
replacements.set(replacementKey, replacementName);
|
||||
options.replacements.push({
|
||||
replacementName,
|
||||
importName,
|
||||
hash,
|
||||
needQuotes
|
||||
});
|
||||
} // eslint-disable-next-line no-param-reassign
|
||||
|
||||
|
||||
rule.node.type = 'word'; // eslint-disable-next-line no-param-reassign
|
||||
|
||||
rule.node.value = replacementName; // eslint-disable-next-line no-param-reassign
|
||||
|
||||
decl.value = parsed.toString();
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
exports.default = _default;
|
Loading…
Add table
Add a link
Reference in a new issue