inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
/**
* **PostCSS Syntax Error**
*
* Loader wrapper for postcss syntax errors
*
* @class SyntaxError
* @extends Error
*
* @param {Object} err CssSyntaxError
*/
export default class PostCSSSyntaxError extends Error {
stack: any;
constructor(error: any);
}

View File

@@ -0,0 +1,40 @@
/**
* **PostCSS Syntax Error**
*
* Loader wrapper for postcss syntax errors
*
* @class SyntaxError
* @extends Error
*
* @param {Object} err CssSyntaxError
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return PostCSSSyntaxError;
}
});
class PostCSSSyntaxError extends Error {
constructor(error){
super(error);
const { line, column, reason, plugin, file } = error;
this.name = 'SyntaxError';
this.message = `${this.name}\n\n`;
if (typeof line !== 'undefined') {
this.message += `(${line}:${column}) `;
}
this.message += plugin ? `${plugin}: ` : '';
this.message += file ? `${file} ` : '<css input> ';
this.message += reason;
const code = error.showSourceCode();
if (code) {
this.message += `\n\n${code}\n`;
}
this.stack = false;
}
}
//# sourceMappingURL=Error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/postcss-loader/src/Error.ts"],"sourcesContent":["/**\n * **PostCSS Syntax Error**\n *\n * Loader wrapper for postcss syntax errors\n *\n * @class SyntaxError\n * @extends Error\n *\n * @param {Object} err CssSyntaxError\n */\nexport default class PostCSSSyntaxError extends Error {\n stack: any\n constructor(error: any) {\n super(error)\n\n const { line, column, reason, plugin, file } = error\n\n this.name = 'SyntaxError'\n\n this.message = `${this.name}\\n\\n`\n\n if (typeof line !== 'undefined') {\n this.message += `(${line}:${column}) `\n }\n\n this.message += plugin ? `${plugin}: ` : ''\n this.message += file ? `${file} ` : '<css input> '\n this.message += reason\n\n const code = error.showSourceCode()\n\n if (code) {\n this.message += `\\n\\n${code}\\n`\n }\n\n this.stack = false\n }\n}\n"],"names":["PostCSSSyntaxError","Error","constructor","error","line","column","reason","plugin","file","name","message","code","showSourceCode","stack"],"mappings":"AAAA;;;;;;;;;CASC;;;;+BACD;;;eAAqBA;;;AAAN,MAAMA,2BAA2BC;IAE9CC,YAAYC,KAAU,CAAE;QACtB,KAAK,CAACA;QAEN,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGL;QAE/C,IAAI,CAACM,IAAI,GAAG;QAEZ,IAAI,CAACC,OAAO,GAAG,GAAG,IAAI,CAACD,IAAI,CAAC,IAAI,CAAC;QAEjC,IAAI,OAAOL,SAAS,aAAa;YAC/B,IAAI,CAACM,OAAO,IAAI,CAAC,CAAC,EAAEN,KAAK,CAAC,EAAEC,OAAO,EAAE,CAAC;QACxC;QAEA,IAAI,CAACK,OAAO,IAAIH,SAAS,GAAGA,OAAO,EAAE,CAAC,GAAG;QACzC,IAAI,CAACG,OAAO,IAAIF,OAAO,GAAGA,KAAK,CAAC,CAAC,GAAG;QACpC,IAAI,CAACE,OAAO,IAAIJ;QAEhB,MAAMK,OAAOR,MAAMS,cAAc;QAEjC,IAAID,MAAM;YACR,IAAI,CAACD,OAAO,IAAI,CAAC,IAAI,EAAEC,KAAK,EAAE,CAAC;QACjC;QAEA,IAAI,CAACE,KAAK,GAAG;IACf;AACF"}

View File

@@ -0,0 +1,14 @@
/**
* **PostCSS Plugin Warning**
*
* Loader wrapper for postcss plugin warnings (`root.messages`)
*
* @class Warning
* @extends Error
*
* @param {Object} warning PostCSS Warning
*/
export default class Warning extends Error {
stack: any;
constructor(warning: any);
}

View File

@@ -0,0 +1,35 @@
/**
* **PostCSS Plugin Warning**
*
* Loader wrapper for postcss plugin warnings (`root.messages`)
*
* @class Warning
* @extends Error
*
* @param {Object} warning PostCSS Warning
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return Warning;
}
});
class Warning extends Error {
constructor(warning){
super(warning);
const { text, line, column, plugin } = warning;
this.name = 'Warning';
this.message = `${this.name}\n\n`;
if (typeof line !== 'undefined') {
this.message += `(${line}:${column}) `;
}
this.message += plugin ? `${plugin}: ` : '';
this.message += text;
this.stack = false;
}
}
//# sourceMappingURL=Warning.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/postcss-loader/src/Warning.ts"],"sourcesContent":["/**\n * **PostCSS Plugin Warning**\n *\n * Loader wrapper for postcss plugin warnings (`root.messages`)\n *\n * @class Warning\n * @extends Error\n *\n * @param {Object} warning PostCSS Warning\n */\nexport default class Warning extends Error {\n stack: any\n constructor(warning: any) {\n super(warning)\n\n const { text, line, column, plugin } = warning\n\n this.name = 'Warning'\n\n this.message = `${this.name}\\n\\n`\n\n if (typeof line !== 'undefined') {\n this.message += `(${line}:${column}) `\n }\n\n this.message += plugin ? `${plugin}: ` : ''\n this.message += text\n\n this.stack = false\n }\n}\n"],"names":["Warning","Error","constructor","warning","text","line","column","plugin","name","message","stack"],"mappings":"AAAA;;;;;;;;;CASC;;;;+BACD;;;eAAqBA;;;AAAN,MAAMA,gBAAgBC;IAEnCC,YAAYC,OAAY,CAAE;QACxB,KAAK,CAACA;QAEN,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGJ;QAEvC,IAAI,CAACK,IAAI,GAAG;QAEZ,IAAI,CAACC,OAAO,GAAG,GAAG,IAAI,CAACD,IAAI,CAAC,IAAI,CAAC;QAEjC,IAAI,OAAOH,SAAS,aAAa;YAC/B,IAAI,CAACI,OAAO,IAAI,CAAC,CAAC,EAAEJ,KAAK,CAAC,EAAEC,OAAO,EAAE,CAAC;QACxC;QAEA,IAAI,CAACG,OAAO,IAAIF,SAAS,GAAGA,OAAO,EAAE,CAAC,GAAG;QACzC,IAAI,CAACE,OAAO,IAAIL;QAEhB,IAAI,CAACM,KAAK,GAAG;IACf;AACF"}

View File

@@ -0,0 +1,10 @@
/**
* **PostCSS Loader**
*
* Loads && processes CSS with [PostCSS](https://github.com/postcss/postcss)
*/
export default function loader(this: any,
/** Source */
content: string,
/** Source Map */
sourceMap: any, meta: any): Promise<void>;

View File

@@ -0,0 +1,126 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, /**
* **PostCSS Loader**
*
* Loads && processes CSS with [PostCSS](https://github.com/postcss/postcss)
*/ "default", {
enumerable: true,
get: function() {
return loader;
}
});
const _Warning = /*#__PURE__*/ _interop_require_default(require("./Warning"));
const _Error = /*#__PURE__*/ _interop_require_default(require("./Error"));
const _utils = require("./utils");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
async function loader(/** Source */ content, /** Source Map */ sourceMap, meta) {
const loaderSpan = this.currentTraceSpan.traceChild('postcss-loader');
const callback = this.async();
loaderSpan.traceAsyncFn(async ()=>{
const options = this.getOptions();
const file = this.resourcePath;
const useSourceMap = typeof options.sourceMap !== 'undefined' ? options.sourceMap : this.sourceMap;
const processOptions = {
from: file,
to: file
};
if (useSourceMap) {
processOptions.map = {
inline: false,
annotation: false,
...processOptions.map
};
}
if (sourceMap && processOptions.map) {
processOptions.map.prev = loaderSpan.traceChild('normalize-source-map').traceFn(()=>(0, _utils.normalizeSourceMap)(sourceMap, this.context));
}
let root;
// Reuse PostCSS AST from other loaders
if (meta && meta.ast && meta.ast.type === 'postcss') {
;
({ root } = meta.ast);
loaderSpan.setAttribute('astUsed', 'true');
}
// Initializes postcss with plugins
const { postcssWithPlugins } = await options.postcss();
let result;
try {
result = await loaderSpan.traceChild('postcss-process').traceAsyncFn(()=>postcssWithPlugins.process(root || content, processOptions));
} catch (error) {
if (error.file) {
this.addDependency(error.file);
}
if (error.name === 'CssSyntaxError') {
throw Object.defineProperty(new _Error.default(error), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
});
}
throw error;
}
for (const warning of result.warnings()){
this.emitWarning(Object.defineProperty(new _Warning.default(warning), "__NEXT_ERROR_CODE", {
value: "E394",
enumerable: false,
configurable: true
}));
}
for (const message of result.messages){
// eslint-disable-next-line default-case
switch(message.type){
case 'dependency':
this.addDependency(message.file);
break;
case 'build-dependency':
this.addBuildDependency(message.file);
break;
case 'missing-dependency':
this.addMissingDependency(message.file);
break;
case 'context-dependency':
this.addContextDependency(message.file);
break;
case 'dir-dependency':
this.addContextDependency(message.dir);
break;
case 'asset':
if (message.content && message.file) {
this.emitFile(message.file, message.content, message.sourceMap, message.info);
}
}
}
// eslint-disable-next-line no-undefined
let map = result.map ? result.map.toJSON() : undefined;
if (map && useSourceMap) {
map = (0, _utils.normalizeSourceMapAfterPostcss)(map, this.context);
}
const ast = {
type: 'postcss',
version: result.processor.version,
root: result.root
};
return [
result.css,
map,
{
ast
}
];
}).then(([css, map, { ast }])=>{
callback == null ? void 0 : callback(null, css, map, {
ast
});
}, (err)=>{
callback == null ? void 0 : callback(err);
});
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
declare function normalizeSourceMap(map: any, resourceContext: string): any;
declare function normalizeSourceMapAfterPostcss(map: any, resourceContext: string): any;
export { normalizeSourceMap, normalizeSourceMapAfterPostcss };

View File

@@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
normalizeSourceMap: null,
normalizeSourceMapAfterPostcss: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
normalizeSourceMap: function() {
return normalizeSourceMap;
},
normalizeSourceMapAfterPostcss: function() {
return normalizeSourceMapAfterPostcss;
}
});
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const IS_NATIVE_WIN32_PATH = /^[a-z]:[/\\]|^\\\\/i;
const ABSOLUTE_SCHEME = /^[a-z0-9+\-.]+:/i;
function getURLType(source) {
if (source[0] === '/') {
if (source[1] === '/') {
return 'scheme-relative';
}
return 'path-absolute';
}
if (IS_NATIVE_WIN32_PATH.test(source)) {
return 'path-absolute';
}
return ABSOLUTE_SCHEME.test(source) ? 'absolute' : 'path-relative';
}
function normalizeSourceMap(map, resourceContext) {
let newMap = map;
// Some loader emit source map as string
// Strip any JSON XSSI avoidance prefix from the string (as documented in the source maps specification), and then parse the string as JSON.
if (typeof newMap === 'string') {
newMap = JSON.parse(newMap);
}
delete newMap.file;
const { sourceRoot } = newMap;
delete newMap.sourceRoot;
if (newMap.sources) {
newMap.sources = newMap.sources.map((source)=>{
const sourceType = getURLType(source);
// Do no touch `scheme-relative` and `absolute` URLs
if (sourceType === 'path-relative' || sourceType === 'path-absolute') {
const absoluteSource = sourceType === 'path-relative' && sourceRoot ? _path.default.resolve(sourceRoot, _path.default.normalize(source)) : _path.default.normalize(source);
return _path.default.relative(resourceContext, absoluteSource);
}
return source;
});
}
return newMap;
}
function normalizeSourceMapAfterPostcss(map, resourceContext) {
const newMap = map;
// result.map.file is an optional property that provides the output filename.
// Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.
// eslint-disable-next-line no-param-reassign
delete newMap.file;
// eslint-disable-next-line no-param-reassign
newMap.sourceRoot = '';
// eslint-disable-next-line no-param-reassign
newMap.sources = newMap.sources.map((source)=>{
if (source.startsWith('<')) {
return source;
}
const sourceType = getURLType(source);
// Do no touch `scheme-relative`, `path-absolute` and `absolute` types
if (sourceType === 'path-relative') {
return _path.default.resolve(resourceContext, source);
}
return source;
});
return newMap;
}
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/build/webpack/loaders/postcss-loader/src/utils.ts"],"sourcesContent":["import path from 'path'\n\nconst IS_NATIVE_WIN32_PATH = /^[a-z]:[/\\\\]|^\\\\\\\\/i\nconst ABSOLUTE_SCHEME = /^[a-z0-9+\\-.]+:/i\n\nfunction getURLType(source: string) {\n if (source[0] === '/') {\n if (source[1] === '/') {\n return 'scheme-relative'\n }\n\n return 'path-absolute'\n }\n\n if (IS_NATIVE_WIN32_PATH.test(source)) {\n return 'path-absolute'\n }\n\n return ABSOLUTE_SCHEME.test(source) ? 'absolute' : 'path-relative'\n}\n\nfunction normalizeSourceMap(map: any, resourceContext: string) {\n let newMap = map\n\n // Some loader emit source map as string\n // Strip any JSON XSSI avoidance prefix from the string (as documented in the source maps specification), and then parse the string as JSON.\n if (typeof newMap === 'string') {\n newMap = JSON.parse(newMap)\n }\n\n delete newMap.file\n\n const { sourceRoot } = newMap\n\n delete newMap.sourceRoot\n\n if (newMap.sources) {\n newMap.sources = newMap.sources.map((source: string) => {\n const sourceType = getURLType(source)\n\n // Do no touch `scheme-relative` and `absolute` URLs\n if (sourceType === 'path-relative' || sourceType === 'path-absolute') {\n const absoluteSource =\n sourceType === 'path-relative' && sourceRoot\n ? path.resolve(sourceRoot, path.normalize(source))\n : path.normalize(source)\n\n return path.relative(resourceContext, absoluteSource)\n }\n\n return source\n })\n }\n\n return newMap\n}\n\nfunction normalizeSourceMapAfterPostcss(map: any, resourceContext: string) {\n const newMap = map\n\n // result.map.file is an optional property that provides the output filename.\n // Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.\n // eslint-disable-next-line no-param-reassign\n delete newMap.file\n\n // eslint-disable-next-line no-param-reassign\n newMap.sourceRoot = ''\n\n // eslint-disable-next-line no-param-reassign\n newMap.sources = newMap.sources.map((source: string) => {\n if (source.startsWith('<')) {\n return source\n }\n\n const sourceType = getURLType(source)\n\n // Do no touch `scheme-relative`, `path-absolute` and `absolute` types\n if (sourceType === 'path-relative') {\n return path.resolve(resourceContext, source)\n }\n\n return source\n })\n\n return newMap\n}\n\nexport { normalizeSourceMap, normalizeSourceMapAfterPostcss }\n"],"names":["normalizeSourceMap","normalizeSourceMapAfterPostcss","IS_NATIVE_WIN32_PATH","ABSOLUTE_SCHEME","getURLType","source","test","map","resourceContext","newMap","JSON","parse","file","sourceRoot","sources","sourceType","absoluteSource","path","resolve","normalize","relative","startsWith"],"mappings":";;;;;;;;;;;;;;;IAuFSA,kBAAkB;eAAlBA;;IAAoBC,8BAA8B;eAA9BA;;;6DAvFZ;;;;;;AAEjB,MAAMC,uBAAuB;AAC7B,MAAMC,kBAAkB;AAExB,SAASC,WAAWC,MAAc;IAChC,IAAIA,MAAM,CAAC,EAAE,KAAK,KAAK;QACrB,IAAIA,MAAM,CAAC,EAAE,KAAK,KAAK;YACrB,OAAO;QACT;QAEA,OAAO;IACT;IAEA,IAAIH,qBAAqBI,IAAI,CAACD,SAAS;QACrC,OAAO;IACT;IAEA,OAAOF,gBAAgBG,IAAI,CAACD,UAAU,aAAa;AACrD;AAEA,SAASL,mBAAmBO,GAAQ,EAAEC,eAAuB;IAC3D,IAAIC,SAASF;IAEb,wCAAwC;IACxC,4IAA4I;IAC5I,IAAI,OAAOE,WAAW,UAAU;QAC9BA,SAASC,KAAKC,KAAK,CAACF;IACtB;IAEA,OAAOA,OAAOG,IAAI;IAElB,MAAM,EAAEC,UAAU,EAAE,GAAGJ;IAEvB,OAAOA,OAAOI,UAAU;IAExB,IAAIJ,OAAOK,OAAO,EAAE;QAClBL,OAAOK,OAAO,GAAGL,OAAOK,OAAO,CAACP,GAAG,CAAC,CAACF;YACnC,MAAMU,aAAaX,WAAWC;YAE9B,oDAAoD;YACpD,IAAIU,eAAe,mBAAmBA,eAAe,iBAAiB;gBACpE,MAAMC,iBACJD,eAAe,mBAAmBF,aAC9BI,aAAI,CAACC,OAAO,CAACL,YAAYI,aAAI,CAACE,SAAS,CAACd,WACxCY,aAAI,CAACE,SAAS,CAACd;gBAErB,OAAOY,aAAI,CAACG,QAAQ,CAACZ,iBAAiBQ;YACxC;YAEA,OAAOX;QACT;IACF;IAEA,OAAOI;AACT;AAEA,SAASR,+BAA+BM,GAAQ,EAAEC,eAAuB;IACvE,MAAMC,SAASF;IAEf,6EAA6E;IAC7E,uGAAuG;IACvG,6CAA6C;IAC7C,OAAOE,OAAOG,IAAI;IAElB,6CAA6C;IAC7CH,OAAOI,UAAU,GAAG;IAEpB,6CAA6C;IAC7CJ,OAAOK,OAAO,GAAGL,OAAOK,OAAO,CAACP,GAAG,CAAC,CAACF;QACnC,IAAIA,OAAOgB,UAAU,CAAC,MAAM;YAC1B,OAAOhB;QACT;QAEA,MAAMU,aAAaX,WAAWC;QAE9B,sEAAsE;QACtE,IAAIU,eAAe,iBAAiB;YAClC,OAAOE,aAAI,CAACC,OAAO,CAACV,iBAAiBH;QACvC;QAEA,OAAOA;IACT;IAEA,OAAOI;AACT"}