From c09f32e33b62fcc1bf72690af4055597f9f02d5a Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Oct 2023 20:19:37 +0800 Subject: [PATCH] chore: move friendly-errors-webpack-plugin (#4757) --- .../.eslintrc.js | 8 - .../CHANGELOG.md | 64 ----- .../friendly-errors-webpack-plugin/README.md | 29 -- .../compiled/stacktracey/index.js | 1 - .../compiled/stacktracey/license | 24 -- .../compiled/stacktracey/package.json | 1 - .../compiled/stacktracey/stacktracey.d.ts | 88 ------ .../example/package.json | 3 - .../example/src/answer.js | 1 - .../example/src/foo.js | 1 - .../example/src/index.js | 3 - .../example/src/moduleParseError.js | 3 - .../example/webpack.config.js | 23 -- .../modern.config.js | 5 - .../package.json | 90 ------ .../src/core/context.ts | 69 ----- .../src/core/output.ts | 15 - .../src/core/parse.ts | 68 ----- .../src/formatter/base.ts | 6 - .../src/formatter/index.ts | 2 - .../src/formatter/pretty.ts | 57 ---- .../src/index.ts | 3 - .../src/plugin.ts | 39 --- .../src/shared/types.ts | 18 -- .../src/shared/utils.ts | 41 --- .../src/shim.d.ts | 34 --- .../src/transformer/cleanMessage.ts | 9 - .../src/transformer/flattenErrorCauses.ts | 57 ---- .../src/transformer/index.ts | 3 - .../src/transformer/moduleParseError.ts | 29 -- .../tests/.eslintrc.js | 10 - .../tests/__snapshots__/webpack.test.ts.snap | 120 -------- .../tests/pathReplacements.ts | 13 - .../tests/setup.ts | 15 - .../tests/shim.d.ts | 1 - .../tests/tsconfig.json | 14 - .../tests/webpack.test.ts | 126 --------- .../tsconfig.json | 13 - .../vitest.config.ts | 19 -- pnpm-lock.yaml | 258 +++++------------- 40 files changed, 63 insertions(+), 1320 deletions(-) delete mode 100644 packages/builder/friendly-errors-webpack-plugin/.eslintrc.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/CHANGELOG.md delete mode 100644 packages/builder/friendly-errors-webpack-plugin/README.md delete mode 100644 packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/index.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/license delete mode 100644 packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/package.json delete mode 100644 packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/stacktracey.d.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/package.json delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/src/answer.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/src/foo.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/src/index.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/src/moduleParseError.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/example/webpack.config.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/modern.config.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/package.json delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/core/context.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/core/output.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/core/parse.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/formatter/base.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/formatter/index.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/formatter/pretty.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/index.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/plugin.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/shared/types.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/shared/utils.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/shim.d.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/transformer/cleanMessage.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/transformer/flattenErrorCauses.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/transformer/index.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/src/transformer/moduleParseError.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/.eslintrc.js delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/__snapshots__/webpack.test.ts.snap delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/pathReplacements.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/setup.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/shim.d.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/tsconfig.json delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts delete mode 100644 packages/builder/friendly-errors-webpack-plugin/tsconfig.json delete mode 100644 packages/builder/friendly-errors-webpack-plugin/vitest.config.ts diff --git a/packages/builder/friendly-errors-webpack-plugin/.eslintrc.js b/packages/builder/friendly-errors-webpack-plugin/.eslintrc.js deleted file mode 100644 index 86232e638571..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - extends: ['@modern-js'], - ignorePatterns: ['vitest.config.ts', 'tests/fixtures/', 'example/'], - parserOptions: { - project: require.resolve('./tsconfig.json'), - }, -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/CHANGELOG.md b/packages/builder/friendly-errors-webpack-plugin/CHANGELOG.md deleted file mode 100644 index 464c9792a730..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -# @modern-js/friendly-errors-webpack-plugin - -## 2.35.1 - -### Patch Changes - -- Updated dependencies [ea3fe18] -- Updated dependencies [9dd3151] -- Updated dependencies [4980480] -- Updated dependencies [6a1d46e] - - @modern-js/utils@2.35.1 - -## 2.35.0 - -### Patch Changes - -- Updated dependencies [15b834f] - - @modern-js/utils@2.35.0 - -## 2.34.0 - -### Patch Changes - -- Updated dependencies [a77b82a] -- Updated dependencies [c8b448b] - - @modern-js/utils@2.34.0 - -## 2.33.1 - -### Patch Changes - -- @modern-js/utils@2.33.1 - -## 2.33.0 - -### Patch Changes - -- Updated dependencies [fd82137] -- Updated dependencies [bc1f8da] - - @modern-js/utils@2.33.0 - -## 2.32.1 - -### Patch Changes - -- @modern-js/utils@2.32.1 - -## 2.32.0 - -### Patch Changes - -- Updated dependencies [e5a3fb4] -- Updated dependencies [6076166] -- Updated dependencies [a030aff] -- Updated dependencies [3c91100] -- Updated dependencies [5255eba] - - @modern-js/utils@2.32.0 - -## 2.31.2 - -### Patch Changes - -- Updated dependencies [15d30abdc66] - - @modern-js/utils@2.31.2 diff --git a/packages/builder/friendly-errors-webpack-plugin/README.md b/packages/builder/friendly-errors-webpack-plugin/README.md deleted file mode 100644 index 04df9b1bcb44..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# @modern-js/friendly-errors-webpack-plugin - -Transform and format webpack error into being more human-readable. - -## Getting Started - -Install the plugin by your favorite package manager, such as: - -```shell -$ pnpm add -D @modern-js/friendly-errors-webpack-plugin -``` - -Then config it like: - -```js -// webpack.config.js -const { FriendlyErrorsWebpackPlugin } = require('@modern-js/friendly-errors-webpack-plugin'); - -/** @type {import('webpack').Configuration} */ -module.exports = { - plugins: [ - new FriendlyErrorsWebpackPlugin(), - ], -}; -``` - -Now you will get an output like the one below. - -![screenshot](https://lf3-static.bytednsdoc.com/obj/eden-cn/hrbzheh7lpqulduloj/c6f14fbfb6c8fe734df7979f079d18c36e11be9f.png) diff --git a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/index.js b/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/index.js deleted file mode 100644 index 940eff3f28e9..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e={480:(e,r,n)=>{"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);ri(e,r-1)+"…";const asColumns=(e,r)=>{const zip=(e,r)=>e.reduce(((e,r)=>r.map(((r,n)=>[].concat(_toConsumableArray(e[n]||[]),[r])))),[]).map((e=>r.apply(undefined,_toConsumableArray(e)))),n=e.map((e=>e.map((e=>e.replace(/\n/g,"\\n"))))),o=n.map((e=>e.map(a))),i=zip(o,Math.max),s=t.assign({delimiter:" ",minColumnWidths:i.map((e=>0)),maxTotalWidth:0},r),u=a(s.delimiter),l=i.reduce(((e,r)=>e+r),0),c=i.map((e=>e/l)),p=s.maxTotalWidth-u*(i.length-1),f=Math.max(0,l-p),h=zip([s.minColumnWidths,i,c],((e,r,n)=>Math.max(e,Math.floor(r-f*n)))),d=o.map((e=>zip([h,e],((e,r)=>e-r))));return zip([n,d],((e,r)=>zip([e,r],((e,r)=>r>=0?s.right?" ".repeat(r)+e:e+" ".repeat(r):limit(e,a(e)+r))).join(s.delimiter)))};const asTable=e=>t.assign((r=>{var n;if(r[0]&&Array.isArray(r[0])){return asColumns(r.map((r=>r.map(((r,n)=>r===undefined?"":e.print(r,n))))),e).join("\n")}const o=[].concat(_toConsumableArray(new Set((n=[]).concat.apply(n,_toConsumableArray(r.map(t.keys)))))),i=[o.map(e.title)].concat(_toConsumableArray(r.map((r=>o.map((n=>r[n]===undefined?"":e.print(r[n],n))))))),s=asColumns(i,e);return(e.dash?[s[0],e.dash.repeat(a(s[0]))].concat(_toConsumableArray(s.slice(1))):s).join("\n")}),e,{configure:r=>asTable(t.assign({},e,r))});e.exports=asTable({maxTotalWidth:Number.MAX_SAFE_INTEGER,print:String,title:String,dash:"-",right:false})},578:e=>{"use strict";e.exports=dataUriToBuffer;function dataUriToBuffer(e){if(!/^data\:/i.test(e)){throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")')}e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(-1===r||r<=4){throw new TypeError("malformed data: URI")}var n=e.substring(5,r).split(";");var t=n[0]||"text/plain";var o=t;var i=false;var a="";for(var s=1;s{"use strict";const{assign:t}=Object,o=typeof window!=="undefined"&&window.window===window&&window.navigator,i=n(435).SourceMapConsumer,a=n(215),s=n(719),u=n(578),l=o?null:n(998);const memoize=e=>{const m=r=>r in m.cache?m.cache[r]:m.cache[r]=e(r);m.forgetEverything=()=>{m.cache=Object.create(null)};m.cache=Object.create(null);return m};function impl(e,r){const n=r?a:Promise;const o=memoize((r=>SourceFile(r,e(r))));function SourceFile(e,i){if(i===undefined)return o(s.resolve(e));return n.resolve(i).then((n=>{let o;let i;let s;let _resolve=e=>(s=s||SourceMapResolverFromFetchedFile(o))(e);return o={path:e,text:n,get lines(){return i=i||n.split("\n")},resolve(e){const n=_resolve(e);if(r){try{return a.valueFrom(n)}catch(r){return t({},e,{error:r})}}else{return Promise.resolve(n)}},_resolve:_resolve}}))}function SourceMapResolverFromFetchedFile(e){const r=/\u0023 sourceMappingURL=(.+)\n?/g;let n=undefined;while(true){const t=r.exec(e.text);if(t)n=t;else break}const o=n&&n[1];const defaultResolver=r=>t({},r,{sourceFile:e,sourceLine:e.lines[r.line-1]||""});return o?SourceMapResolver(e.path,o,defaultResolver):defaultResolver}function SourceMapResolver(e,r,n){const o=r.startsWith("data:")?SourceFile(e,u(r).toString()):SourceFile(s.relativeToFile(e,r));const a=o.then((e=>i(JSON.parse(e.text))));const l=memoize((function sourceFor(e){return o.then((r=>{const n=s.relativeToFile(r.path,e);return a.then((r=>SourceFile(n,r.sourceContentFor(e,true)||undefined)))}))}));return e=>a.then((r=>{const o=r.originalPositionFor(e);return o.source?l(o.source).then((r=>r._resolve(t({},e,{line:o.line,column:o.column+1,name:o.name})))):n(e)})).catch((r=>t(n(e),{sourceMapError:r})))}return t((function getSource(e){const n=SourceFile(e);if(r){try{return a.valueFrom(n)}catch(r){const n={path:e,text:"",lines:[],error:r,resolve(e){return t({},e,{error:r,sourceLine:"",sourceFile:n})}};return n}}return n}),{resetCache:()=>o.forgetEverything(),getCache:()=>o.cache})}e.exports=impl((function fetchFileSync(e){return new a((r=>{if(o){let n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);r(n.responseText)}else{r(l("fs").readFileSync(e,{encoding:"utf8"}))}}))}),true);e.exports.async=impl((function fetchFileAsync(e){return new Promise(((r,n)=>{if(o){let t=new XMLHttpRequest;t.open("GET",e);t.onreadystatechange=e=>{if(t.readyState===4){if(t.status===200){r(t.responseText)}else{n(new Error(t.statusText))}}};t.send(null)}else{l("fs").readFile(e,{encoding:"utf8"},((e,t)=>{e?n(e):r(t)}))}}))}))},215:e=>{"use strict";e.exports=class SyncPromise{constructor(e){try{e((e=>{this.setValue(e,false)}),(e=>{this.setValue(e,true)}))}catch(e){this.setValue(e,true)}}setValue(e,r){this.val=e instanceof SyncPromise?e.val:e;this.rejected=r||(e instanceof SyncPromise?e.rejected:false)}static valueFrom(e){if(e instanceof SyncPromise){if(e.rejected)throw e.val;else return e.val}else{return e}}then(e){try{if(!this.rejected)return SyncPromise.resolve(e(this.val))}catch(e){return SyncPromise.reject(e)}return this}catch(e){try{if(this.rejected)return SyncPromise.resolve(e(this.val))}catch(e){return SyncPromise.reject(e)}return this}static resolve(e){return new SyncPromise((r=>{r(e)}))}static reject(e){return new SyncPromise(((r,n)=>{n(e)}))}}},719:e=>{"use strict";const r=typeof window!=="undefined"&&window.window===window&&window.navigator;const n=r?window.location.href:process.cwd();const t=new RegExp("^((https|http)://)?[a-z0-9A-Z]{3}.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z].com|net|cn|cc (:s[0-9]{1-4})?/$");const o=e.exports={concat(e,r){const n=e[e.length-1]==="/",t=r[0]==="/";return e+(n||t?"":"/")+(n&&t?r.substring(1):r)},resolve(e){if(o.isAbsolute(e)){return o.normalize(e)}return o.normalize(o.concat(n,e))},normalize(e){let n=[],t=0;e.split("/").reverse().filter((e=>e!==".")).forEach((e=>{if(e===".."){t++}else if(t===0){n.push(e)}else{t--}}));const o=n.reverse().join("/");return(r&&o[0]==="/"?o[1]==="/"?window.location.protocol:window.location.origin:"")+o},isData:e=>e.indexOf("data:")===0,isURL:e=>t.test(e),isAbsolute:e=>e[0]==="/"||/^[^\/]*:/.test(e),relativeToFile(e,r){return o.isData(e)||o.isAbsolute(r)?o.normalize(r):o.normalize(o.concat(e.split("/").slice(0,-1).join("/"),r))}}},501:e=>{"use strict";var r=function(){function sliceIterator(e,r){var n=[];var t=true;var o=false;var i=undefined;try{for(var a=e[Symbol.iterator](),s;!(t=(s=a.next()).done);t=true){n.push(s.value);if(r&&n.length===r)break}}catch(e){o=true;i=e}finally{try{if(!t&&a["return"])a["return"]()}finally{if(o)throw i}}return n}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();const n="[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]",t="\0-\b\v-›­​\u2028\u2029\ufeff︀-️",o="\n"+t,i=new RegExp("(?:"+n+")|["+t+"]","g"),a=new RegExp("(?:"+n+")|["+o+"]","g"),s=new RegExp("((?:"+n+")|[\t"+o+"])?([^\t"+o+"]*)","g");e.exports={zeroWidthCharacters:a,ansiEscapeCodes:new RegExp(n,"g"),strlen:e=>Array.from(e.replace(a,"")).length,isBlank:e=>e.replace(a,"").replace(/\s/g,"").length===0,blank:e=>Array.from(e.replace(i,"")).map((e=>e==="\t"||e==="\n"?e:" ")).join(""),partition(e){for(var r,n=[];s.lastIndex!==e.length&&(r=s.exec(e));){n.push([r[1]||"",r[2]])}s.lastIndex=0;return n},first(n,t){let o="",i=0;for(const s of e.exports.partition(n)){var a=r(s,2);const e=a[0];const n=a[1];const u=Array.from(n).slice(0,t-i);o+=e+u.join("");i+=u.length}return o}}},409:(e,r,n)=>{var t=n(308);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(268);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=s}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var u=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&s);p&=a;u=u+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var s=Math.floor((n-e)/2)+e;var u=i(t,o[s],true);if(u===0){return s}else if(u>0){if(n-s>1){return recursiveSearch(s,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,s,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return s}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},768:(e,r,n)=>{var t=n(308);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},927:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(308);var i=n(183);var a=n(409).I;var s=n(19);var u=n(927).U;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(s,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(e.column===undefined){var u=s.originalLine;while(s&&s.originalLine===u){t.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)});s=this._originalMappings[++a]}}else{var l=s.originalColumn;while(s&&s.originalLine===r&&s.originalColumn==l){t.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)});s=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var s=o.getArg(n,"names",[]);var u=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(u){u=o.normalize(u)}i=i.map(String).map(o.normalize).map((function(e){return u&&o.isAbsolute(u)&&o.isAbsolute(e)?o.relative(u,e):e}));this._names=a.fromArray(s.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(u,e,r)}));this.sourceRoot=u;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){S.source=l+y[1];l+=y[1];S.originalLine=i+y[2];i=S.originalLine;S.originalLine+=1;S.originalColumn=a+y[3];a=S.originalColumn;if(y.length>4){S.name=c+y[4];c+=y[4]}}v.push(S);if(typeof S.originalLine==="number"){g.push(S)}}}u(v,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=v;u(g,o.compareByOriginalPositions);this.__originalMappings=g};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var s={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(19);var o=n(308);var i=n(409).I;var a=n(768).H;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var s=new i;var u=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!s.has(l)){s.add(l)}var c=r.name;if(c!=null&&!u.has(c)){u.add(c)}}),this);this._sources=s;this._names=u;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var s=0;var u="";var l;var c;var p;var f;var h=this._mappings.toArray();for(var d=0,g=h.length;d0){if(!o.compareByGeneratedPositionsInflated(c,h[d-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-s);s=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}u+=l}return u};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.h=SourceMapGenerator},129:(e,r,n)=>{var t;var o=n(746).h;var i=n(308);var a=/(\r?\n)/;var s=10;var u="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[u]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var s=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return s=0;r--){this.prepend(e[r])}}else if(e[u]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,s=0,u=i.length-1;u>=0;u--){a=i[u];if(a==="."){i.splice(u,1)}else if(a===".."){s++}else if(s>0){if(a===""){i.splice(u+1,s);s=0}else{i.splice(u,2);s--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},435:(e,r,n)=>{n(746).h;r.SourceMapConsumer=n(939).SourceMapConsumer;n(129)},200:e=>{"use strict";e.exports=(e,r)=>{const n=e||[],t=[];let o={label:undefined,items:[n.first]};n.forEach((e=>{const n=r(e);if(o.label!==n&&o.items.length){t.push(o={label:n,items:[e]})}else{o.items.push(e)}}));return t}},881:(e,r,n)=>{"use strict";const t=Object,o=typeof window!=="undefined"&&window.window===window&&window.navigator,i=null&&(o?null:n(430)),lastOf=e=>e[e.length-1],a=n(676),s=n(200),u=n(480),nixSlashes=e=>e.replace(/\\/g,"/"),l=o?window.location.href:nixSlashes(process.cwd())+"/";class StackTracey{constructor(e,r){const t=e,i=e&&(e instanceof SyntaxError&&!o);if(!e){e=new Error;r=r===undefined?1:r}if(e instanceof Error){e=e.stack||""}if(typeof e==="string"){e=this.rawParse(e).slice(r).map((e=>this.extractEntryMetadata(e)))}if(Array.isArray(e)){if(i){const r=n(837).inspect(t).split("\n"),o=r[0].split(":"),i=o.pop(),a=o.join(":");if(a){e.unshift({file:nixSlashes(a),line:i,column:(r[2]||"").indexOf("^")+1,sourceLine:r[1],callee:"(syntax error)",syntaxError:true})}}this.items=e}else{this.items=[]}}extractEntryMetadata(e){const r=this.decomposePath(e.file||"");const n=r[0];const o=r[1];return t.assign(e,{calleeShort:e.calleeShort||lastOf((e.callee||"").split(".")),fileRelative:n,fileShort:this.shortenPath(n),fileName:lastOf((e.file||"").split("/")),thirdParty:this.isThirdParty(n,o)&&!e.index,externalDomain:o})}shortenPath(e){return e.replace(/^node_modules\//,"").replace(/^webpack\/bootstrap\//,"").replace(/^__parcel_source_root\//,"")}decomposePath(e){let r=e;if(o)r=r.replace(l,"");const t=r.match(/^(http|https)\:\/\/?([^\/]+)\/(.*)/);const i=t?t[2]:undefined;r=t?t[3]:r;if(!o)r=n(17).relative(l,r);return[nixSlashes(r).replace(/^.*\:\/\/?\/?/,""),i]}isThirdParty(e,r){return r||e[0]==="~"||e[0]==="/"||e.indexOf("node_modules")===0||e.indexOf("webpack/bootstrap")===0}rawParse(e){const r=(e||"").split("\n");const n=r.map((e=>{e=e.trim();let r,n=[],t,i,a;if((i=e.match(/at (.+) \(eval at .+ \((.+)\), .+\)/))||(i=e.match(/at (.+) \((.+)\)/))||e.slice(0,3)!=="at "&&(i=e.match(/(.*)@(.*)/))){r=i[1];t=i[2]==="native";n=(i[2].match(/(.*):(\d+):(\d+)/)||i[2].match(/(.*):(\d+)/)||[]).slice(1)}else if(a=e.match(/^(at\s+)*(.+):(\d+):(\d+)/)){n=a.slice(2)}else{return undefined}if(r&&!n[0]){const e=r.split(".")[0];if(e==="Array"){t=true}}return{beforeParse:e,callee:r||"",index:o&&n[0]===window.location.href,native:t||false,file:nixSlashes(n[0]||""),line:parseInt(n[1]||"",10)||undefined,column:parseInt(n[2]||"",10)||undefined}}));return n.filter((e=>e!==undefined))}withSourceAt(e){return this.items[e]&&this.withSource(this.items[e])}withSourceAsyncAt(e){return this.items[e]&&this.withSourceAsync(this.items[e])}withSource(e){if(this.shouldSkipResolving(e)){return e}else{let r=a(e.file||"").resolve(e);if(!r.sourceFile){return e}return this.withSourceResolved(e,r)}}withSourceAsync(e){if(this.shouldSkipResolving(e)){return Promise.resolve(e)}else{return a.async(e.file||"").then((r=>r.resolve(e))).then((r=>this.withSourceResolved(e,r))).catch((r=>this.withSourceResolved(e,{error:r,sourceLine:""})))}}shouldSkipResolving(e){return e.sourceFile||e.error||e.file&&e.file.indexOf("<")>=0}withSourceResolved(e,r){if(r.sourceFile&&!r.sourceFile.error){r.file=nixSlashes(r.sourceFile.path);r=this.extractEntryMetadata(r)}if(r.sourceLine.includes("// @hide")){r.sourceLine=r.sourceLine.replace("// @hide","");r.hide=true}if(r.sourceLine.includes("__webpack_require__")||r.sourceLine.includes("/******/ ({")){r.thirdParty=true}return t.assign({sourceLine:""},e,r)}withSources(){return this.map((e=>this.withSource(e)))}withSourcesAsync(){return Promise.all(this.items.map((e=>this.withSourceAsync(e)))).then((e=>new StackTracey(e)))}mergeRepeatedLines(){return new StackTracey(s(this.items,(e=>e.file+e.line)).map((e=>e.items.slice(1).reduce(((e,r)=>{e.callee=(e.callee||"")+" → "+(r.callee||"");e.calleeShort=(e.calleeShort||"")+" → "+(r.calleeShort||"");return e}),t.assign({},e.items[0])))))}clean(){const e=this.withSources().mergeRepeatedLines();return e.filter(e.isClean.bind(e))}cleanAsync(){return this.withSourcesAsync().then((e=>{e=e.mergeRepeatedLines();return e.filter(e.isClean.bind(e))}))}isClean(e,r){return r===0||!(e.thirdParty||e.hide||e.native)}at(e){return t.assign({beforeParse:"",callee:"",index:false,native:false,file:"",line:0,column:0},this.items[e])}asTable(e){const r=e&&e.maxColumnWidths||this.maxColumnWidths();const trimEnd=(e,r)=>e&&(e.length>r?e.slice(0,r-1)+"…":e);const trimStart=(e,r)=>e&&(e.length>r?"…"+e.slice(-(r-1)):e);const n=this.map((e=>["at "+trimEnd(e.calleeShort,r.callee),trimStart(e.fileShort&&e.fileShort+":"+e.line||"",r.file),trimEnd((e.sourceLine||"").trim()||"",r.sourceLine)]));return u(n.items)}maxColumnWidths(){return{callee:30,file:60,sourceLine:80}}static resetCache(){a.resetCache();a.async.resetCache()}static locationsEqual(e,r){return e.file===r.file&&e.line===r.line&&e.column===r.column}}["map","filter","slice","concat"].forEach((e=>{StackTracey.prototype[e]=function(){return new StackTracey(this.items[e].apply(this.items,arguments))}}));e.exports=StackTracey},998:e=>{function webpackEmptyContext(e){var r=new Error("Cannot find module '"+e+"'");r.code="MODULE_NOT_FOUND";throw r}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=998;e.exports=webpackEmptyContext},430:e=>{function webpackEmptyContext(e){var r=new Error("Cannot find module '"+e+"'");r.code="MODULE_NOT_FOUND";throw r}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=430;e.exports=webpackEmptyContext},17:e=>{"use strict";e.exports=require("path")},837:e=>{"use strict";e.exports=require("util")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}return o.exports}(()=>{__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n=__webpack_require__(881);module.exports=n})(); \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/license b/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/license deleted file mode 100644 index 68a49daad8ff..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/license +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -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 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. - -For more information, please refer to diff --git a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/package.json b/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/package.json deleted file mode 100644 index 25de30ef1515..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"stacktracey","author":"Vitaly Gordon ","version":"2.1.8","license":"Unlicense","types":"./stacktracey.d.ts"} diff --git a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/stacktracey.d.ts b/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/stacktracey.d.ts deleted file mode 100644 index bf4e3a4ab5f1..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/compiled/stacktracey/stacktracey.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -declare class StackTracey { - - constructor (input?: Error|string|StackTracey.Entry[], offset?: number) - - items: StackTracey.Entry[] - - extractEntryMetadata (e: StackTracey.Entry): StackTracey.Entry - - shortenPath (relativePath: string): string - relativePath (fullPath: string): string - isThirdParty (relativePath: string): boolean - - rawParse (str: string): StackTracey.Entry[] - - withSourceAt (i: number): StackTracey.Entry - withSourceAsyncAt (i: number): Promise - - withSource (entry: StackTracey.Entry): StackTracey.Entry - withSourceAsync (entry: StackTracey.Entry): Promise - - withSources (): StackTracey - withSourcesAsync (): Promise - mergeRepeatedLines (): StackTracey - - clean (): StackTracey - cleanAsync (): Promise - - isClean (entry: StackTracey.Entry, index: number): boolean - - map (f: (x: StackTracey.Entry, i: number, arr: StackTracey.Entry[]) => StackTracey.Entry): StackTracey - filter (f: (x: StackTracey.Entry, i: number, arr: StackTracey.Entry[]) => boolean): StackTracey - slice (from?: number, to?: number): StackTracey - concat (...args: StackTracey.Entry[]): StackTracey - - at (i: number): StackTracey.Entry - - asTable (opts?: { maxColumnWidths?: StackTracey.MaxColumnWidths }): string - - maxColumnWidths (): StackTracey.MaxColumnWidths - - static resetCache (): void - static locationsEqual (a: StackTracey.Location, b: StackTracey.Location): boolean -} - -declare namespace StackTracey { - - interface SourceFile { - - path: string - text: string - lines: string[] - error?: Error - } - - interface Location { - - file: string - line?: number - column?: number - } - - interface Entry extends Location { - - beforeParse: string - callee: string - index: boolean - native: boolean - - calleeShort: string - fileRelative: string - fileShort: string - fileName: string - thirdParty: boolean - - hide?: boolean - sourceLine?: string - sourceFile?: SourceFile - error?: Error - } - - interface MaxColumnWidths { - callee: number - file: number - sourceLine: number - } -} - -export = StackTracey diff --git a/packages/builder/friendly-errors-webpack-plugin/example/package.json b/packages/builder/friendly-errors-webpack-plugin/example/package.json deleted file mode 100644 index 6e452bd1f100..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "@friendly-errors/example" -} \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/example/src/answer.js b/packages/builder/friendly-errors-webpack-plugin/example/src/answer.js deleted file mode 100644 index ccb5b9caa2ec..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/src/answer.js +++ /dev/null @@ -1 +0,0 @@ -export const answer = () => 42; \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/example/src/foo.js b/packages/builder/friendly-errors-webpack-plugin/example/src/foo.js deleted file mode 100644 index 79ece54d14f3..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/src/foo.js +++ /dev/null @@ -1 +0,0 @@ -3d2u8j0c;l, kms nk \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/example/src/index.js b/packages/builder/friendly-errors-webpack-plugin/example/src/index.js deleted file mode 100644 index ac10ca83014b..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/src/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { answer } from './answer' - -alert(answer()) \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/example/src/moduleParseError.js b/packages/builder/friendly-errors-webpack-plugin/example/src/moduleParseError.js deleted file mode 100644 index 7d6ded89a1da..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/src/moduleParseError.js +++ /dev/null @@ -1,3 +0,0 @@ -import { foo } from './foo'; - -console.log('foo: ', foo); \ No newline at end of file diff --git a/packages/builder/friendly-errors-webpack-plugin/example/webpack.config.js b/packages/builder/friendly-errors-webpack-plugin/example/webpack.config.js deleted file mode 100644 index ad8a76d95ec9..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/example/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path'); -// const { FriendlyErrorsWebpackPlugin } = require('@modern-js/friendly-errors-webpack-plugin'); - -/** @type {import('webpack').Configuration} */ -module.exports = { - mode: 'development', - entry: [ - './src/index.js', - './src/moduleParseError.js' - ].map(f => path.resolve(__dirname, f)), - output: { - path: path.resolve(__dirname, 'dist'), - }, - optimization: { - minimize: false, - }, - cache: false, - stats: { - errors: false, - }, - devtool: 'source-map', - // plugins: [new FriendlyErrorsWebpackPlugin()], -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/modern.config.js b/packages/builder/friendly-errors-webpack-plugin/modern.config.js deleted file mode 100644 index c2bf3e85b393..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/modern.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const { tscLikeBuildConfig } = require('@scripts/build'); - -module.exports = { - buildConfig: tscLikeBuildConfig, -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/package.json b/packages/builder/friendly-errors-webpack-plugin/package.json deleted file mode 100644 index 8f7dd2248ae0..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "@modern-js/friendly-errors-webpack-plugin", - "description": "Recognizes certain classes of webpack errors and cleans, aggregates and prioritizes them to provide a better Developer Experience", - "homepage": "https://modernjs.dev", - "bugs": "https://github.com/modern-js-dev/modern.js/issues", - "repository": { - "type": "git", - "url": "https://github.com/web-infra-dev/modern.js", - "directory": "packages/builder/friendly-errors-webpack-plugin" - }, - "license": "MIT", - "keywords": [ - "friendly", - "errors", - "webpack", - "plugin" - ], - "engines": { - "node": ">=14.0.0" - }, - "version": "2.35.1", - "jsnext:source": "./src/index.ts", - "types": "./src/index.ts", - "main": "./dist/index.js", - "module": "./dist/index.js", - "exports": { - ".": { - "jsnext:source": "./src/index.ts", - "default": "./dist/index.js" - }, - "./formatter": { - "jsnext:source": "./src/formatter/index.ts", - "default": "./dist/formatter/index.ts" - }, - "./transformer": { - "jsnext:source": "./src/transformer/index.ts", - "default": "./dist/transformer/index.ts" - }, - "./shared/*": { - "jsnext:source": "./src/shared/*.ts", - "default": "./dist/shared/*.js" - } - }, - "typesVersions": { - "*": { - "formatter": [ - "./dist/formatter/index.d.ts" - ], - "transformer": [ - "./dist/transformer/index.d.ts" - ], - "shared/*": [ - "./dist/shared/*.d.ts" - ] - } - }, - "scripts": { - "prepublishOnly": "only-allow-pnpm", - "build": "modern-lib build", - "dev": "modern-lib build --watch", - "test": "echo foo", - "test:local": "vitest run", - "test:watch": "vitest dev --no-coverage", - "test:ui": "vitest --ui", - "example:build": "webpack -c example/webpack.config.js" - }, - "dependencies": { - "@modern-js/utils": "workspace:*", - "@swc/helpers": "0.5.1" - }, - "devDependencies": { - "@modern-js/builder-shared": "workspace:*", - "@modern-js/e2e": "workspace:*", - "@scripts/build": "workspace:*", - "@scripts/vitest-config": "workspace:*", - "@types/node": "^14", - "ansi-to-html": "^0.7.2", - "typescript": "^5", - "webpack": "^5.88.1", - "webpack-cli": "^5.1.4" - }, - "peerDependencies": { - "webpack": "^5.0.0" - }, - "sideEffects": false, - "files": [ - "dist", - "compiled" - ] -} diff --git a/packages/builder/friendly-errors-webpack-plugin/src/core/context.ts b/packages/builder/friendly-errors-webpack-plugin/src/core/context.ts deleted file mode 100644 index f16a6a25ac61..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/core/context.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - ErrorFormatter, - ErrorTransformer, - ThrowableType, -} from '../shared/types'; -import { prettyFormatter } from '../formatter'; -import { - cleanMessageTransformer, - flattenCausesTransformer, - moduleParseErrorTransformer, -} from '../transformer'; - -const outputFormattedError = (msg: string, type: ThrowableType): any => { - if (type === 'error') { - console.error(msg); - } else if (type === 'warning') { - console.warn(msg); - } -}; - -export const builtinTransformers = [ - cleanMessageTransformer, - flattenCausesTransformer, - moduleParseErrorTransformer, -] as const; - -export interface ContextInitiationOptions { - cwd?: string; - output?: typeof outputFormattedError; - type?: ThrowableType; - withSources?: boolean; - formatters?: boolean | ErrorFormatter[]; - transformers?: boolean | ErrorTransformer[]; -} - -export class Context { - cwd: string; - - output: typeof outputFormattedError; - - type: ThrowableType; - - withSources: boolean; - - formatters: ErrorFormatter[] = []; - - transformers: ErrorTransformer[] = []; - - constructor(options: ContextInitiationOptions = {}) { - this.cwd = options.cwd || process.cwd(); - this.output = options.output || outputFormattedError; - this.type = options.type || 'error'; - this.withSources = options.withSources ?? true; - - if (Array.isArray(options.formatters)) { - this.formatters.push(...options.formatters); - } - if (options.formatters !== false) { - this.formatters.push(prettyFormatter); - } - const transformers: ErrorTransformer[] = []; - if (options.transformers !== false) { - transformers.push(...builtinTransformers); - } - if (Array.isArray(options.transformers)) { - transformers.push(...options.transformers); - } - } -} diff --git a/packages/builder/friendly-errors-webpack-plugin/src/core/output.ts b/packages/builder/friendly-errors-webpack-plugin/src/core/output.ts deleted file mode 100644 index 5f8b545f1ddf..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/core/output.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { inspect } from 'util'; -import { transformError } from '../shared/utils'; -import { Context, ContextInitiationOptions } from './context'; -import { ParsedError } from './parse'; - -export const outputPrettyError = ( - error: Error, - options: ContextInitiationOptions = {}, -) => { - const ctx = new Context(options); - const parsed = new ParsedError(error, ctx); - // TODO: transform recursively. - const transformed = transformError(ctx.transformers, parsed); - ctx.output(inspect(transformed), ctx.type); -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/core/parse.ts b/packages/builder/friendly-errors-webpack-plugin/src/core/parse.ts deleted file mode 100644 index b7bfaa4d75b4..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/core/parse.ts +++ /dev/null @@ -1,68 +0,0 @@ -import assert from 'assert'; -import { inspect } from 'util'; -import _ from '@modern-js/utils/lodash'; -import { JSONValue } from '@modern-js/builder-shared'; -import { ThrowableType, TracingFrame } from '../shared/types'; -import StackTracey from '../../compiled/stacktracey'; -import { formatError } from '../shared/utils'; -import { Context } from './context'; - -export const getErrorCause = (error: Error) => { - assert(typeof error === 'object', 'Error must be an object'); - const err = error as any; - return [err.cause, err.error, err.originalError].find(_.isError); -}; - -export type Serializable = { - [K in keyof T]: T[K] extends JSONValue ? T[K] : never; -}; - -export class ParsedError { - type: ThrowableType = 'error'; - - cause?: ParsedError; - - causes: ParsedError[] = []; - - trace: TracingFrame[] = []; - - parent?: ParsedError; - - raw: E; - - name: string; - - message: string; - - context: Context; - - constructor(error: E, context = new Context()) { - this.raw = error; - this.name = this.raw.name ?? 'Error'; - this.message = this.raw.message ?? ''; - this.context = context; - - if (context.withSources) { - this.trace = new StackTracey(error).withSources().items; - } else { - this.trace = new StackTracey(error).items; - } - - const rawCause = getErrorCause(this.raw); - if (rawCause) { - this.cause = new ParsedError(rawCause); - this.cause.parent = this; - this.causes.push(this.cause, ...this.cause.causes); - } - } - - [inspect.custom]() { - const formatted = formatError(this.context.formatters, this); - return formatted; - } - - freeze(): Readonly { - const ret = { ...this, [inspect.custom]: _.constant(inspect(this)) }; - return Object.freeze(ret); - } -} diff --git a/packages/builder/friendly-errors-webpack-plugin/src/formatter/base.ts b/packages/builder/friendly-errors-webpack-plugin/src/formatter/base.ts deleted file mode 100644 index cc71f8e735fd..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/formatter/base.ts +++ /dev/null @@ -1,6 +0,0 @@ -import util from 'util'; -import { ErrorFormatter } from '../shared/types'; - -export const baseFormatter: ErrorFormatter = e => { - return util.inspect(e.raw); -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/formatter/index.ts b/packages/builder/friendly-errors-webpack-plugin/src/formatter/index.ts deleted file mode 100644 index 0c1f01cc226c..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/formatter/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { baseFormatter } from './base'; -export { prettyFormatter } from './pretty'; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/formatter/pretty.ts b/packages/builder/friendly-errors-webpack-plugin/src/formatter/pretty.ts deleted file mode 100644 index 997d91d15fbc..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/formatter/pretty.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { WebpackError } from 'webpack'; -import chalk from '@modern-js/utils/chalk'; -import type StackTracey from '../../compiled/stacktracey'; -import { ErrorFormatter } from '../shared/types'; - -const formatTraceEntry = (entry: StackTracey.Entry) => { - const { callee, file, line, column } = entry; - const prompt = chalk.gray('at'); - let location = ''; - file && (location = file); - line && (location += `:${line}`); - column && (location += `:${column}`); - const sign = `${callee} (${location})`; - return ` ${prompt} ${sign}`; -}; - -const SIGN_TEXT = { - error: ' ERROR ', - warning: ' WARN ', - cause: ' CAUSE ', -} as const; - -const SIGN_COLOR = { - error: chalk.bgRed.bold.black, - warning: chalk.bgYellow.bold.black, -} as const; - -/** - * @example - * ```plaintext - * [ ERROR ] ModuleNotFoundError: Module not found: Error: Can't resolve './index.js' in 'foo' - * ↑ SIGN ↑ NAME ↑ MSG - * ``` - */ -export const prettyFormatter: ErrorFormatter = e => { - const leadings: string[] = []; - { - const text = SIGN_TEXT[e.parent ? 'cause' : e.type]; - const sign = SIGN_COLOR[e.type](text); - leadings.push(sign, ' '); - } - { - const colorize = e.type === 'error' ? chalk.red.bold : chalk.yellow.bold; - const name = colorize(e.name); - leadings.push(name, chalk.gray(': '), e.message); - } - const ret = [leadings.join('')]; - - if (e.raw instanceof WebpackError) { - typeof e.raw.details === 'string' && ret.push(e.raw.details); - } - ret.push(...e.trace.map(formatTraceEntry)); - - e.cause && ret.push(prettyFormatter(e.cause)!); - - return ret.join('\n'); -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/index.ts b/packages/builder/friendly-errors-webpack-plugin/src/index.ts deleted file mode 100644 index 00d96d2843aa..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './shared/types'; -export * from './shared/utils'; -export * from './plugin'; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/plugin.ts b/packages/builder/friendly-errors-webpack-plugin/src/plugin.ts deleted file mode 100644 index 2dd9c5060847..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/plugin.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type * as webpack from 'webpack'; -import { outputPrettyError } from './core/output'; -import { ContextInitiationOptions } from './core/context'; - -export class FriendlyErrorsWebpackPlugin { - // eslint-disable-next-line @typescript-eslint/typedef - name = 'FriendlyErrorsWebpackPlugin' as const; - - options: ContextInitiationOptions; - - constructor(options?: ContextInitiationOptions) { - this.options = options ?? {}; - } - - apply(compiler: webpack.Compiler): void { - compiler.hooks.done.tapPromise(this.name, async stats => { - { - const opts: ContextInitiationOptions = { - ...this.options, - type: 'warning', - }; - const warnings = stats.compilation.getWarnings(); - for (const warning of warnings) { - outputPrettyError(warning, opts); - } - } - { - const opts: ContextInitiationOptions = { - ...this.options, - type: 'error', - }; - const errors = stats.compilation.getErrors(); - for (const error of errors) { - outputPrettyError(error, opts); - } - } - }); - } -} diff --git a/packages/builder/friendly-errors-webpack-plugin/src/shared/types.ts b/packages/builder/friendly-errors-webpack-plugin/src/shared/types.ts deleted file mode 100644 index b28231080193..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/shared/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ParsedError } from '../core/parse'; -import StackTracey from '../../compiled/stacktracey'; - -export type TracingFrame = StackTracey.Entry; - -export interface WithSourcesMixin { - withSources?: boolean; -} - -export interface IsCauseMixin { - isCause?: boolean; -} - -export type ErrorTransformer = (error: ParsedError) => ParsedError | void; - -export type ErrorFormatter = (error: ParsedError) => string | void; - -export type ThrowableType = 'error' | 'warning'; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/shared/utils.ts b/packages/builder/friendly-errors-webpack-plugin/src/shared/utils.ts deleted file mode 100644 index 11d3f571ce2d..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/shared/utils.ts +++ /dev/null @@ -1,41 +0,0 @@ -import _ from '@modern-js/utils/lodash'; -import { baseFormatter } from '../formatter'; -import { ParsedError } from '../core/parse'; -import { ErrorFormatter, ErrorTransformer } from './types'; - -export const cloneObject = (error: T): T => { - const cloned = Object.create(Object.getPrototypeOf(error)); - return _.merge(cloned, error); -}; - -export const cloneErrorObject = (error: T): T => { - const cloned = cloneObject(error); - for (const k of Object.getOwnPropertyNames(error) as (keyof T)[]) { - cloned[k] || (cloned[k] = error[k]); - } - return cloned; -}; - -export const transformError = ( - transformers: ErrorTransformer[], - error: ParsedError, -): ParsedError => { - return transformers.reduce( - (error, transformer) => transformer(error) || error, - error, - ); -}; - -export const formatError = ( - formatters: ErrorFormatter[] = [baseFormatter], - error: ParsedError, -) => { - let formatted = ''; - for (const formatter of formatters) { - formatted = formatter(error) ?? formatted; - if (formatted) { - break; - } - } - return formatted ?? baseFormatter(error); -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/shim.d.ts b/packages/builder/friendly-errors-webpack-plugin/src/shim.d.ts deleted file mode 100644 index d975a211a01d..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/shim.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import 'ansi-html'; - -declare module 'ansi-html' { - declare function ansiHtml(source: string): string; - export default ansiHtml; -} - -interface Error { - cause?: unknown; - error?: unknown; - originalError?: unknown; -} - -declare module 'webpack/lib/ChunkRenderError' { - import { Chunk, Compilation, WebpackError } from 'webpack'; - - export default class ChunkRenderError extends WebpackError { - constructor(chunk: Chunk, compilation: Compilation, error: Error); - } -} - -declare module 'webpack/lib/ModuleParseError' { - import { WebpackError } from 'webpack'; - - export default class ModuleParseError extends WebpackError { - constructor( - // eslint-disable-next-line node/prefer-global/buffer - source: string | Buffer, - err: Error, - loaders: string[], - type: string, - ); - } -} diff --git a/packages/builder/friendly-errors-webpack-plugin/src/transformer/cleanMessage.ts b/packages/builder/friendly-errors-webpack-plugin/src/transformer/cleanMessage.ts deleted file mode 100644 index 71fe9921aeef..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/transformer/cleanMessage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ErrorTransformer } from '../shared/types'; - -export const cleanMessageTransformer: ErrorTransformer = error => { - const { raw } = error; - if (raw.stack) { - error.message = error.message.replace(raw.stack, ''); - } - return error; -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/transformer/flattenErrorCauses.ts b/packages/builder/friendly-errors-webpack-plugin/src/transformer/flattenErrorCauses.ts deleted file mode 100644 index ccd0c21d5e40..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/transformer/flattenErrorCauses.ts +++ /dev/null @@ -1,57 +0,0 @@ -import _ from '@modern-js/utils/lodash'; -import StackTracey from '../../compiled/stacktracey'; -import { ErrorTransformer } from '../shared/types'; - -export const compareTraces = ( - trace1: readonly StackTracey.Entry[], - trace2: readonly StackTracey.Entry[], -) => { - if (trace1.length !== trace2.length) { - return false; - } - for (let i = 0; i < trace1.length; i++) { - const s1 = trace1[i]; - const s2 = trace2[i]; - if (s1.file !== s2.file || s1.line !== s2.line || s1.column !== s2.column) { - return false; - } - } - return true; -}; - -export const compareTraceFragments = ( - trace1: readonly StackTracey.Entry[], - trace2: readonly StackTracey.Entry[], -) => { - const len = Math.min(trace1.length, trace2.length); - return compareTraces( - trace1.length === len ? trace1 : trace1.slice(0, len), - trace2.length === len ? trace2 : trace2.slice(0, len), - ); -}; - -export const mergeTraceHeads = (traces: StackTracey.Entry[][]) => { - const heads: StackTracey.Entry[] = []; - const tails: StackTracey.Entry[] = []; - for (const [head, ...rest] of traces) { - if (!heads.length) { - heads.push(head); - tails.push(...rest); - } else if (compareTraceFragments(tails, rest)) { - heads.push(head); - } else { - return null; - } - } - return [...heads, ...tails]; -}; - -export const flattenCausesTransformer: ErrorTransformer = e => { - const traces = [e.trace, ..._.map(e.causes, 'trace')]; - const merged = mergeTraceHeads(traces); - if (merged) { - e.trace = merged; - e.causes = []; - } - return e; -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/transformer/index.ts b/packages/builder/friendly-errors-webpack-plugin/src/transformer/index.ts deleted file mode 100644 index 6c5b629e76cd..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/transformer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { cleanMessageTransformer } from './cleanMessage'; -export { flattenCausesTransformer } from './flattenErrorCauses'; -export { moduleParseErrorTransformer } from './moduleParseError'; diff --git a/packages/builder/friendly-errors-webpack-plugin/src/transformer/moduleParseError.ts b/packages/builder/friendly-errors-webpack-plugin/src/transformer/moduleParseError.ts deleted file mode 100644 index 46715385ac17..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/src/transformer/moduleParseError.ts +++ /dev/null @@ -1,29 +0,0 @@ -import chalk from '@modern-js/utils/chalk'; -import { ErrorTransformer } from '../shared/types'; - -export const moduleParseErrorTransformer: ErrorTransformer = e => { - if (e.name === 'ModuleParseError') { - const rawError: Error = (e.raw as any).error; - const rawStack = rawError?.stack; - - // remove last line wrapping. - let sliceEnding = -1; - // remove stack text. - rawStack && (sliceEnding += e.message.indexOf(rawStack)); - e.message = e.message.slice(0, sliceEnding); - - // remove traces of cause error. - e.trace = e.trace.slice(e.trace.length - e.causes[0]!.trace.length); - - // add more description about builder. - e.message += ' You can try to fix it by:\n'; - const tips = [ - 'Check if the file is valid.', - 'Enable relational config of `tools`: https://modernjs.dev/builder/en/api/config-tools.html', - 'Install builder plugins: https://modernjs.dev/builder/en/plugin', - ]; - e.message += tips.map(tip => ` ${chalk.gray(`*`)} ${tip}`).join('\n'); - e.message += '\n'; - e.message += 'Or you can try to configure bundler loaders manually.'; - } -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/.eslintrc.js b/packages/builder/friendly-errors-webpack-plugin/tests/.eslintrc.js deleted file mode 100644 index cd5c0871d21d..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import('eslint').ESLint.ConfigData} */ -module.exports = { - extends: ['@modern-js'], - parserOptions: { - project: require.resolve('./tsconfig.json'), - }, - rules: { - 'no-console': 'off', - }, -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/__snapshots__/webpack.test.ts.snap b/packages/builder/friendly-errors-webpack-plugin/tests/__snapshots__/webpack.test.ts.snap deleted file mode 100644 index 5a48cf9f7b54..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/__snapshots__/webpack.test.ts.snap +++ /dev/null @@ -1,120 +0,0 @@ -// Vitest Snapshot v1 - -exports[`webpack > compilation.errors 1`] = ` -" ERROR ModuleParseError: Module parse failed: Identifier directly after number (1:1) -You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https:/webpack.js.org/concepts#loaders -> 3d2u8j0c;l, kms nk - at handleParseError (/node_modules//webpack/lib/NormalModule.js:) - at (/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at processResult (/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at (/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at (/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at iterateNormalLoaders (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at Array.eval (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at runCallbacks (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/enhanced-resolve@5.15.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/enhanced-resolve@5.15.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js:) - at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:) - CAUSE SyntaxError: Identifier directly after number (1:1) - at (syntax error) (SyntaxError: Identifier directly after number (1:1)) - at Object.pp$4.raise (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Object.pp.readNumber (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Object.pp.getTokenFromCode (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Object.pp.readToken (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Object.readToken (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn-import-assertions@1.9.0_acorn@8.8.1/node_modules/acorn-import-assertions/lib/index.js:) - at Object.pp.nextToken (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Object.parse (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Function.parse (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/acorn@8.8.1/node_modules/acorn/dist/acorn.js:) - at Function._parse (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/javascript/JavascriptParser.js:) - at JavascriptParser.parse (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/javascript/JavascriptParser.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at processResult (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at iterateNormalLoaders (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/loader-runner@4.3.0/node_modules/loader-runner/lib/LoaderRunner.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/NormalModule.js:) - at Array.eval (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at runCallbacks (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/enhanced-resolve@5.15.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/enhanced-resolve@5.15.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js:) - at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:) - ERROR Error: foo - at (/tests/webpack.test.ts:) - at _next26 (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at _next4 (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.eval [as call] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_DELEGATE [as _call] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at Compiler.newCompilation (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at Compiler.compile (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Compiler.readRecords (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Compiler.run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at new Promise () - at webpackBuild (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-chain.98d42d89.mjs:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-chain.98d42d89.mjs:) - at runTest (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runSuite (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runSuite (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runFiles (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async startTestsNode (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at (async /Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/entry.mjs:) - at async Module.withEnv (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/entry.mjs:) - at (async file:/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tinypool@0.2.4/node_modules/tinypool/dist/esm/worker.js:) -" -`; - -exports[`webpack > throw new error 1`] = ` -" ERROR Error: bar - at (/tests/webpack.test.ts:) - at _next26 (/node_modules//tapable/lib/HookCodeFactory.js:) - at _next4 (/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.eval [as call] (/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_DELEGATE [as _call] (/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at Compiler.newCompilation (/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at Compiler.compile (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Compiler.readRecords (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Hook.eval [as callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:) - at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:) - at run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at Compiler.run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/webpack@5.82.1_esbuild@0.15.7_webpack-cli@5.1.4/node_modules/webpack/lib/Compiler.js:) - at (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at new Promise () - at webpackBuild (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at (/Users/bytedance/repositories/modern.js/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-chain.98d42d89.mjs:) - at (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-chain.98d42d89.mjs:) - at runTest (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runSuite (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runSuite (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async runFiles (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async startTestsNode (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at (async /Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/entry.mjs:) - at async Module.withEnv (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/chunk-runtime-error.87a2b5a2.mjs:) - at async run (/Users/bytedance/repositories/modern.js/node_modules/.pnpm/vitest@0.21.1_@vitest+ui@0.21.1/node_modules/vitest/dist/entry.mjs:) - at (async file:/Users/bytedance/repositories/modern.js/node_modules/.pnpm/tinypool@0.2.4/node_modules/tinypool/dist/esm/worker.js:)" -`; diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/pathReplacements.ts b/packages/builder/friendly-errors-webpack-plugin/tests/pathReplacements.ts deleted file mode 100644 index 9efb81008c2f..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/pathReplacements.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { applyMatcherReplacement } from '@scripts/vitest-config'; -import { snapshotSerializer } from './setup'; -import { ErrorTransformer } from '@/shared/types'; - -export const transformPathReplacements: ErrorTransformer = error => { - const { pathMatchers } = snapshotSerializer; - - for (const entry of error.trace) { - entry.file = applyMatcherReplacement(pathMatchers, entry.file); - } - error.causes.length && transformPathReplacements(error.causes[0]); - return error; -}; diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/setup.ts b/packages/builder/friendly-errors-webpack-plugin/tests/setup.ts deleted file mode 100644 index d88629458bbc..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/setup.ts +++ /dev/null @@ -1,15 +0,0 @@ -// eslint-disable-next-line node/prefer-global/console -import { Console } from 'console'; -import { expect } from 'vitest'; -import { createSnapshotSerializer } from '@scripts/vitest-config'; - -global.console.Console = Console; - -export const snapshotSerializer = createSnapshotSerializer({ - replace: [ - { match: /(?<=at.+?:)\d+:\d+(?=\W)/g, mark: 'pos' }, - { match: /(?:\s+at .*)+/g, mark: 'stack' }, - ], -}); - -expect.addSnapshotSerializer(snapshotSerializer); diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/shim.d.ts b/packages/builder/friendly-errors-webpack-plugin/tests/shim.d.ts deleted file mode 100644 index f53d0241d834..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/shim.d.ts +++ /dev/null @@ -1 +0,0 @@ -import '../src/shim'; diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/tsconfig.json b/packages/builder/friendly-errors-webpack-plugin/tests/tsconfig.json deleted file mode 100644 index 2af64b519203..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "@modern-js/tsconfig/base", - "compilerOptions": { - "noEmit": true, - "declaration": false, - "jsx": "preserve", - "baseUrl": "./", - "isolatedModules": true, - "paths": { - "@/*": ["../src/*"] - } - }, - "include": ["**/*.ts"] -} diff --git a/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts b/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts deleted file mode 100644 index d69b46072184..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tests/webpack.test.ts +++ /dev/null @@ -1,126 +0,0 @@ -import path from 'path'; -import { SpyInstance, describe, expect, test, vi } from 'vitest'; -import webpack, { WebpackError } from 'webpack'; -import TerminalRenderer from 'ansi-to-html'; -import _ from '@modern-js/utils/lodash'; -import fs from '@modern-js/utils/fs-extra'; -import webpackConfig from '../example/webpack.config'; -import { FriendlyErrorsWebpackPlugin } from '@/plugin'; -import { outputPrettyError } from '@/core/output'; - -const themes = { - oneDark: { - fg: '#abb2bf', - bg: '#282c34', - colors: [ - '#282c34', - '#e06c75', - '#98c379', - '#e5c07b', - '#61afef', - '#c678dd', - '#56b6c2', - '#abb2bf', - '#5c6370', - '#be5046', - '#98c379', - '#d19a66', - '#61afef', - '#c678dd', - '#56b6c2', - '#ffffff', - ], - }, - oneLight: { - fg: '#383a42', - bg: '#fafafa', - colors: [ - '#fafafa', - '#e06c75', - '#98c379', - '#d19a66', - '#61afef', - '#c678dd', - '#56b6c2', - '#abb2bf', - '#383a42', - '#e06c75', - '#50a14f', - '#d19a66', - '#61afef', - '#c678dd', - '#56b6c2', - '#ffffff', - ], - }, -} satisfies Record[0]>; - -export const webpackBuild = async (compiler: webpack.Compiler) => { - return new Promise((resolve, reject) => { - compiler.run((err, stats) => { - // When using run or watch, call close and wait for it to finish before calling run or watch again. - // Concurrent compilations will corrupt the output files. - compiler.close(closeErr => { - console.error(closeErr); - if (err || !stats || stats.hasErrors()) { - const buildError: Error & { stats?: webpack.Stats } = - err || new Error('Webpack build failed!'); - buildError.stats = stats; - reject(buildError); - } else { - resolve({ stats }); - } - }); - }); - }); -}; - -const renderMockedLogs = (mocked: SpyInstance) => { - const { calls } = mocked.mock; - const logs = []; - for (const args of calls) { - logs.push(args.join(' ')); - } - let rendered = ''; - const scope = Date.now(); - for (const [name, opts] of Object.entries(themes)) { - const renderer = new TerminalRenderer(opts); - rendered = renderer.toHtml(logs.join('\n')); - fs.outputFile( - path.resolve(__dirname, `./dist/${scope}/${name}.html`), - `
${rendered}
`, - ); - } - return rendered; -}; - -describe('webpack', () => { - test('compilation.errors', async () => { - const mockedError = vi.spyOn(console, 'error').mockImplementation(_.noop); - const config: webpack.Configuration = { - ...webpackConfig, - plugins: [new FriendlyErrorsWebpackPlugin()], - }; - const compiler = webpack(config); - compiler.hooks.compilation.tap('dev', compilation => { - compilation.errors.push(new WebpackError('foo')); - }); - await expect(webpackBuild(compiler)).rejects.toThrow(); - renderMockedLogs(mockedError); - expect(cleanOutput(mockedError)).toMatchSnapshot(); - }, 30_000); - - test('throw new error', async () => { - const mockedError = vi.spyOn(console, 'error').mockImplementation(_.noop); - const config: webpack.Configuration = { - ...webpackConfig, - }; - const compiler = webpack(config); - compiler.hooks.compilation.tap('dev', () => { - throw new Error('bar'); - }); - await webpackBuild(compiler).catch(e => outputPrettyError(e)); - renderMockedLogs(mockedError); - expect(cleanOutput(mockedError)).toMatchSnapshot(); - }, 30_000); -}); diff --git a/packages/builder/friendly-errors-webpack-plugin/tsconfig.json b/packages/builder/friendly-errors-webpack-plugin/tsconfig.json deleted file mode 100644 index 9c45ebc2327f..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "@modern-js/tsconfig/base", - "compilerOptions": { - "target": "ES2019", - "declaration": true, - "outDir": "./dist", - "jsx": "preserve", - "baseUrl": "./", - "isolatedModules": true, - "paths": {} - }, - "include": ["src", "./shims.d.ts"] -} diff --git a/packages/builder/friendly-errors-webpack-plugin/vitest.config.ts b/packages/builder/friendly-errors-webpack-plugin/vitest.config.ts deleted file mode 100644 index 86eefc05c1ff..000000000000 --- a/packages/builder/friendly-errors-webpack-plugin/vitest.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import path from 'path'; -import { defineConfig } from 'vitest/config'; -import { withTestPreset } from '@scripts/vitest-config'; - -const config = defineConfig({ - resolve: { - alias: { - '~': path.resolve(__dirname), - '@': path.resolve(__dirname, 'src'), - } - }, - test: { - root: __dirname, - environment: 'node', - setupFiles: ['./tests/setup.ts'], - }, -}); - -export default withTestPreset(config); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71e78e7e210b..f1d953f31ada 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -196,7 +196,7 @@ importers: version: 3.3.3(webpack@5.88.1) webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) devDependencies: '@arco-design/web-react': specifier: ^2.46.0 @@ -278,7 +278,7 @@ importers: version: 0.7.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) webpack-sources: specifier: ^3.2.3 version: 3.2.3 @@ -384,7 +384,7 @@ importers: version: 4.1.0 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) webpack-subresource-integrity: specifier: 5.1.0 version: 5.1.0(html-webpack-plugin@5.5.3)(webpack@5.88.1) @@ -420,43 +420,6 @@ importers: specifier: ^5 version: 5.0.4 - packages/builder/friendly-errors-webpack-plugin: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils - '@swc/helpers': - specifier: 0.5.1 - version: 0.5.1 - devDependencies: - '@modern-js/builder-shared': - specifier: workspace:* - version: link:../builder-shared - '@modern-js/e2e': - specifier: workspace:* - version: link:../../toolkit/e2e - '@scripts/build': - specifier: workspace:* - version: link:../../../scripts/build - '@scripts/vitest-config': - specifier: workspace:* - version: link:../../../scripts/vitest-config - '@types/node': - specifier: ^14 - version: 14.18.35 - ansi-to-html: - specifier: ^0.7.2 - version: 0.7.2 - typescript: - specifier: ^5 - version: 5.0.4 - webpack: - specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) - webpack-cli: - specifier: ^5.1.4 - version: 5.1.4(webpack@5.88.1) - packages/builder/plugin-esbuild: dependencies: '@modern-js/builder-shared': @@ -523,7 +486,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/builder/plugin-node-polyfill: dependencies: @@ -597,7 +560,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/builder/plugin-swc: dependencies: @@ -710,7 +673,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/builder/plugin-vue2: dependencies: @@ -753,7 +716,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/cli/babel-preset-app: dependencies: @@ -1028,7 +991,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/cli/plugin-changeset: dependencies: @@ -1153,7 +1116,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/cli/plugin-i18n: dependencies: @@ -1437,7 +1400,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/cli/plugin-swc: dependencies: @@ -1782,7 +1745,7 @@ importers: version: 1.3.0 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/devtools/plugin: dependencies: @@ -3755,7 +3718,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/runtime/plugin-testing: dependencies: @@ -4602,7 +4565,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) websocket: specifier: ^1 version: 1.0.34 @@ -4772,7 +4735,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) packages/solutions/module-tools: dependencies: @@ -5352,7 +5315,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) scripts/build: devDependencies: @@ -5459,7 +5422,7 @@ importers: version: 5.0.4 webpack: specifier: ^5.88.1 - version: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + version: 5.88.1(esbuild@0.17.19) devDependencies: '@babel/helper-annotate-as-pure': specifier: ^7.22.5 @@ -11930,7 +11893,7 @@ packages: webpack: '>=4.6.0' dependencies: make-dir: 3.1.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /@manypkg/find-root@1.1.0: @@ -11960,7 +11923,7 @@ packages: dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - supports-color dev: true @@ -12658,7 +12621,7 @@ packages: react-refresh: 0.11.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.14.0)(webpack@5.88.1): @@ -12697,7 +12660,7 @@ packages: react-refresh: 0.14.0 schema-utils: 3.3.0 source-map: 0.7.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /@polka/url@0.5.0: @@ -14771,7 +14734,7 @@ packages: react-dom: 18.2.0(react@18.2.0) regenerator-runtime: 0.13.11 ts-dedent: 2.2.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - '@storybook/mdx2-csf' - eslint @@ -15095,7 +15058,7 @@ packages: ts-dedent: 2.2.0 typescript: 5.0.4 util-deprecate: 1.0.2 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) webpack-dev-middleware: 4.3.0(webpack@5.88.1) webpack-hot-middleware: 2.25.2 webpack-virtual-modules: 0.4.6 @@ -15264,7 +15227,7 @@ packages: typescript: 5.0.4 unfetch: 4.2.0 util-deprecate: 1.0.2 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /@storybook/core-common@6.5.12(eslint@8.28.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.0.4): @@ -15446,7 +15409,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - '@storybook/mdx2-csf' - bluebird @@ -15607,7 +15570,7 @@ packages: ts-dedent: 2.2.0 typescript: 5.0.4 util-deprecate: 1.0.2 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) webpack-dev-middleware: 4.3.0(webpack@5.88.1) webpack-virtual-modules: 0.4.6 transitivePeerDependencies: @@ -15697,7 +15660,7 @@ packages: react-docgen-typescript: 2.2.2(typescript@5.0.4) tslib: 2.4.0 typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - supports-color dev: false @@ -15771,7 +15734,7 @@ packages: ts-dedent: 2.2.0 typescript: 5.0.4 util-deprecate: 1.0.2 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - '@storybook/mdx2-csf' - '@swc/core' @@ -17033,7 +16996,7 @@ packages: dependencies: '@types/node': 18.11.17 tapable: 2.2.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - '@swc/core' - esbuild @@ -17819,40 +17782,6 @@ packages: resolution: {integrity: sha512-DPQgBAedzjsFD7rgv7b6OKmpHq5VTBUCLmYfDiov2FC2C79QGaz+4iNmlVAem5iSicvN8DWTwU1kZ48XYLtuqg==} dev: false - /@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.88.1): - resolution: {integrity: sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - dependencies: - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.88.1) - - /@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.88.1): - resolution: {integrity: sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - dependencies: - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.88.1) - - /@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack@5.88.1): - resolution: {integrity: sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==} - engines: {node: '>=14.15.0'} - peerDependencies: - webpack: 5.x.x - webpack-cli: 5.x.x - webpack-dev-server: '*' - peerDependenciesMeta: - webpack-dev-server: - optional: true - dependencies: - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack@5.88.1) - /@xobotyi/scrollbar-width@1.9.5: resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} dev: true @@ -18146,14 +18075,6 @@ packages: entities: 2.2.0 dev: false - /ansi-to-html@0.7.2: - resolution: {integrity: sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g==} - engines: {node: '>=8.0.0'} - hasBin: true - dependencies: - entities: 2.2.0 - dev: true - /antd@4.17.2(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1/xwj72mzg2ly5byvnxsgucEL5JMrinlsaAr4Y+vjobmTBSI9l9zOVkwwOG8kPIrFkhrzC1I42n6GZKnTwfZmg==} peerDependencies: @@ -18681,7 +18602,7 @@ packages: loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /babel-loader@9.1.3(@babel/core@7.22.15)(webpack@5.88.1): @@ -18694,7 +18615,7 @@ packages: '@babel/core': 7.22.15 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /babel-plugin-add-react-displayname@0.0.5: @@ -19882,6 +19803,7 @@ packages: /colorette@2.0.19: resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} + dev: true /colors@1.1.2: resolution: {integrity: sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==} @@ -19915,10 +19837,6 @@ packages: engines: {node: '>=14'} dev: true - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -20394,7 +20312,7 @@ packages: normalize-path: 3.0.0 schema-utils: 3.3.0 serialize-javascript: 6.0.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /core-js-compat@3.32.1: @@ -20648,7 +20566,7 @@ packages: postcss-value-parser: 4.2.0 schema-utils: 3.3.0 semver: 7.3.7 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /css-loader@6.7.1(webpack@5.88.1): @@ -20665,7 +20583,7 @@ packages: postcss-modules-values: 4.0.0(postcss@8.4.31) postcss-value-parser: 4.2.0 semver: 7.3.7 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) /css-minimizer-webpack-plugin@5.0.1(esbuild@0.17.19)(webpack@5.88.1): resolution: {integrity: sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg==} @@ -20699,7 +20617,7 @@ packages: postcss: 8.4.31 schema-utils: 4.2.0 serialize-javascript: 6.0.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /css-select@4.3.0: @@ -21536,11 +21454,6 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - /envinfo@7.10.0: - resolution: {integrity: sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==} - engines: {node: '>=4'} - hasBin: true - /eol@0.9.1: resolution: {integrity: sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==} dev: false @@ -21698,7 +21611,7 @@ packages: json5: 2.2.3 loader-utils: 2.0.4 tapable: 2.2.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) webpack-sources: 1.4.3 dev: true @@ -22510,10 +22423,6 @@ packages: resolution: {integrity: sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==} dev: true - /fastest-levenshtein@1.0.16: - resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} - engines: {node: '>= 4.9.1'} - /fastest-stable-stringify@2.0.2: resolution: {integrity: sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==} dev: true @@ -22627,7 +22536,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /file-system-cache@1.1.0: @@ -22991,7 +22900,7 @@ packages: semver: 7.3.7 tapable: 1.1.3 typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /fork-ts-checker-webpack-plugin@8.0.0(typescript@5.0.4)(webpack@5.88.1): @@ -23014,7 +22923,7 @@ packages: semver: 7.3.7 tapable: 2.2.1 typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /form-data@3.0.1: @@ -24049,7 +23958,7 @@ packages: lodash: 4.17.21 pretty-error: 4.0.0 tapable: 2.2.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) /html5shiv@3.7.3: resolution: {integrity: sha512-SZwGvLGNtgp8GbgFX7oXEp8OR1aBt5LliX6dG0kdD1kl3KhMonN0QcSa/A3TsTgFewaGCbIryQunjayWDXzxmw==} @@ -24417,10 +24326,6 @@ packages: engines: {node: '>= 0.10'} dev: false - /interpret@3.1.1: - resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} - engines: {node: '>=10.13.0'} - /intersection-observer@0.10.0: resolution: {integrity: sha512-fn4bQ0Xq8FTej09YC/jqKZwtijpvARlRp6wxL5WTA6yPe2YWSJ5RJh7Nm79rK2qB0wr6iDQzH60XGq5V/7u8YQ==} dev: false @@ -26042,7 +25947,7 @@ packages: dependencies: klona: 2.0.5 less: 4.1.3 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /less@4.1.3: @@ -27314,7 +27219,7 @@ packages: webpack: ^5.0.0 dependencies: schema-utils: 4.2.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /minimalistic-assert@1.0.1: @@ -27742,7 +27647,7 @@ packages: webpack: ^5.0.0 dependencies: loader-utils: 2.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /node-mocks-http@1.11.0: @@ -28907,7 +28812,7 @@ packages: klona: 2.0.5 postcss: 8.4.31 semver: 7.5.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /postcss-media-minmax@5.0.0(postcss@8.4.31): @@ -30774,7 +30679,7 @@ packages: react-docgen-typescript: 2.2.2(typescript@5.0.4) tslib: 2.3.1 typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - supports-color dev: false @@ -31272,12 +31177,6 @@ packages: dependencies: picomatch: 2.3.0 - /rechoir@0.8.0: - resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} - engines: {node: '>= 10.13.0'} - dependencies: - resolve: 1.22.4 - /recursive-readdir@2.2.3: resolution: {integrity: sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==} engines: {node: '>=6.0.0'} @@ -31828,7 +31727,7 @@ packages: webpack: ^5.75.0 dependencies: tapable: 2.2.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) webpack-sources: 2.3.1 dev: false @@ -31968,7 +31867,7 @@ packages: klona: 2.0.5 neo-async: 2.6.2 sass: 1.54.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /sass@1.54.4: @@ -32733,7 +32632,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /string-similarity@4.0.4: @@ -32942,7 +32841,7 @@ packages: dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /style-loader@3.3.3(webpack@5.88.1): @@ -32951,7 +32850,7 @@ packages: peerDependencies: webpack: ^5.0.0 dependencies: - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /style-mod@4.1.0: @@ -33015,7 +32914,7 @@ packages: klona: 2.0.5 normalize-path: 3.0.0 stylus: 0.59.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /stylus@0.59.0: @@ -33430,7 +33329,7 @@ packages: schema-utils: 3.3.0 serialize-javascript: 6.0.1 terser: 5.19.2 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) /terser@4.8.0: resolution: {integrity: sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==} @@ -33754,7 +33653,7 @@ packages: micromatch: 4.0.5 semver: 7.3.7 typescript: 5.0.4 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /ts-node@10.9.1(@swc/core@1.3.42)(@types/node@14.18.35)(typescript@5.0.4): @@ -34510,7 +34409,7 @@ packages: loader-utils: 2.0.4 mime-types: 2.1.35 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /url-parse@1.5.10: @@ -34936,7 +34835,7 @@ packages: loader-utils: 1.4.0 vue-hot-reload-api: 2.3.4 vue-style-loader: 4.1.3 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) transitivePeerDependencies: - arc-templates - atpl @@ -35008,7 +34907,7 @@ packages: chalk: 4.1.2 hash-sum: 2.0.0 watchpack: 2.4.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /vue-style-loader@4.1.3: @@ -35171,38 +35070,6 @@ packages: - utf-8-validate dev: true - /webpack-cli@5.1.4(webpack@5.88.1): - resolution: {integrity: sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==} - engines: {node: '>=14.15.0'} - hasBin: true - peerDependencies: - '@webpack-cli/generators': '*' - webpack: 5.x.x - webpack-bundle-analyzer: '*' - webpack-dev-server: '*' - peerDependenciesMeta: - '@webpack-cli/generators': - optional: true - webpack-bundle-analyzer: - optional: true - webpack-dev-server: - optional: true - dependencies: - '@discoveryjs/json-ext': 0.5.7 - '@webpack-cli/configtest': 2.1.1(webpack-cli@5.1.4)(webpack@5.88.1) - '@webpack-cli/info': 2.0.2(webpack-cli@5.1.4)(webpack@5.88.1) - '@webpack-cli/serve': 2.0.5(webpack-cli@5.1.4)(webpack@5.88.1) - colorette: 2.0.19 - commander: 10.0.1 - cross-spawn: 7.0.3 - envinfo: 7.10.0 - fastest-levenshtein: 1.0.16 - import-local: 3.1.0 - interpret: 3.1.1 - rechoir: 0.8.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) - webpack-merge: 5.8.0 - /webpack-dev-middleware@3.7.3(webpack@4.46.0): resolution: {integrity: sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==} engines: {node: '>= 6'} @@ -35229,7 +35096,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 3.3.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /webpack-dev-middleware@6.1.1(webpack@5.88.1): @@ -35246,7 +35113,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.2.0 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: true /webpack-filter-warnings-plugin@1.2.1(webpack@4.46.0): @@ -35281,7 +35148,7 @@ packages: webpack: ^5.47.0 dependencies: tapable: 2.2.1 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) webpack-sources: 2.3.1 dev: true @@ -35291,6 +35158,7 @@ packages: dependencies: clone-deep: 4.0.1 wildcard: 2.0.0 + dev: true /webpack-sources@1.4.3: resolution: {integrity: sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==} @@ -35321,7 +35189,7 @@ packages: dependencies: html-webpack-plugin: 5.5.3(webpack@5.88.1) typed-assert: 1.0.9 - webpack: 5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4) + webpack: 5.88.1(esbuild@0.17.19) dev: false /webpack-virtual-modules@0.2.2: @@ -35416,7 +35284,7 @@ packages: - uglify-js dev: true - /webpack@5.88.1(esbuild@0.17.19)(webpack-cli@5.1.4): + /webpack@5.88.1(esbuild@0.17.19): resolution: {integrity: sha512-FROX3TxQnC/ox4N+3xQoWZzvGXSuscxR32rbzjpXgEzWudJFEJBpdlkkob2ylrv5yzzufD1zph1OoFsLtm6stQ==} engines: {node: '>=10.13.0'} hasBin: true @@ -35449,7 +35317,6 @@ packages: tapable: 2.2.1 terser-webpack-plugin: 5.3.9(esbuild@0.17.19)(webpack@5.88.1) watchpack: 2.4.0 - webpack-cli: 5.1.4(webpack@5.88.1) webpack-sources: 3.2.3 transitivePeerDependencies: - '@swc/core' @@ -35620,6 +35487,7 @@ packages: /wildcard@2.0.0: resolution: {integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==} + dev: true /window-size@0.1.0: resolution: {integrity: sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==}