@rsdoctor/core 2.0.0-beta.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/26.js +193 -136
- package/dist/630.js +12 -12
- package/dist/630.js.LICENSE.txt +1 -1
- package/dist/build-utils/build/chunks/assetsModules.d.ts +2 -2
- package/dist/build-utils/build/json.d.ts +1 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +153 -95
- package/dist/inner-plugins/plugins/bundle.d.ts +3 -3
- package/dist/inner-plugins/plugins/loader.d.ts +2 -0
- package/dist/inner-plugins/utils/config.d.ts +3 -1
- package/dist/inner-plugins/utils/normalize-config.d.ts +3 -8
- package/dist/inner-plugins/utils/ruleWarnings.d.ts +2 -0
- package/dist/proxy-loader.js +7 -3
- package/dist/rspack-plugin/index.d.ts +0 -1
- package/dist/rspack-plugin/plugin.d.ts +7 -3
- package/dist/rspack-plugin/session.d.ts +0 -1
- package/dist/rspack-plugin/writeStore.d.ts +2 -0
- package/dist/rule-utils/parser/utils.d.ts +3 -6
- package/dist/rules/rules/ecma-version-check/index.d.ts +1 -1
- package/dist/sdk/multiple/primary.d.ts +2 -2
- package/dist/sdk/sdk/core.d.ts +3 -2
- package/dist/sdk/sdk/types.d.ts +1 -1
- package/dist/sdk/utils/index.d.ts +1 -0
- package/dist/sdk/utils/manifestSharding.d.ts +16 -0
- package/dist/types/loader.d.ts +5 -0
- package/dist/types/plugin.d.ts +0 -8
- package/package.json +24 -24
- package/dist/rspack-plugin/multiple.d.ts +0 -10
package/dist/630.js
CHANGED
|
@@ -26,22 +26,22 @@ __webpack_require__.r(utils_namespaceObject), __webpack_require__.d(utils_namesp
|
|
|
26
26
|
getIdentifierInPattern: ()=>getIdentifierInPattern,
|
|
27
27
|
isES5: ()=>isES5,
|
|
28
28
|
isES6: ()=>isES6,
|
|
29
|
-
|
|
29
|
+
isSameSyntax: ()=>function isSameSyntax(node1, node2) {
|
|
30
30
|
if (node1.type !== node2.type) return !1;
|
|
31
31
|
switch(node1.type){
|
|
32
32
|
case 'CallExpression':
|
|
33
|
-
return node1.arguments.length === node2.arguments.length && !!node1.optional == !!node2.optional &&
|
|
33
|
+
return node1.arguments.length === node2.arguments.length && !!node1.optional == !!node2.optional && isSameSyntax(node1.callee, node2.callee) && node1.arguments.every((node, i)=>isSameSyntax(node, node2.arguments[i]));
|
|
34
34
|
case 'MemberExpression':
|
|
35
|
-
return node1.computed === node2.computed && !!node1.optional == !!node2.optional &&
|
|
35
|
+
return node1.computed === node2.computed && !!node1.optional == !!node2.optional && isSameSyntax(node1.object, node2.object) && isSameSyntax(node1.property, node2.property);
|
|
36
36
|
case 'Identifier':
|
|
37
37
|
return node1.name === node2.name;
|
|
38
38
|
case 'Literal':
|
|
39
39
|
if (asserts.isSimpleLiteral(node1) && asserts.isSimpleLiteral(node2)) return node1.value === node2.value;
|
|
40
40
|
return node1.raw === node2.raw;
|
|
41
41
|
case 'ObjectExpression':
|
|
42
|
-
return node1.properties.length === node2.properties.length && node1.properties.every((prop, i)=>
|
|
42
|
+
return node1.properties.length === node2.properties.length && node1.properties.every((prop, i)=>isSameSyntax(prop, node2.properties[i]));
|
|
43
43
|
case 'Property':
|
|
44
|
-
return node1.computed === node2.computed && node1.kind === node2.kind && node1.method === node2.method &&
|
|
44
|
+
return node1.computed === node2.computed && node1.kind === node2.kind && node1.method === node2.method && isSameSyntax(node1.key, node2.key) && isSameSyntax(node1.value, node2.value);
|
|
45
45
|
default:
|
|
46
46
|
throw Error(`Unknown node type: ${node1.type}`);
|
|
47
47
|
}
|
|
@@ -398,21 +398,21 @@ var esm_JsonStreamStringify = function(_Readable) {
|
|
|
398
398
|
writable: !1
|
|
399
399
|
}), JsonStreamStringify;
|
|
400
400
|
}(Readable);
|
|
401
|
-
function stringify(json, replacer, space, cycle) {
|
|
401
|
+
function stringify(json, replacer, space, cycle, chunkSize = 419430400) {
|
|
402
402
|
let jsonList = [];
|
|
403
403
|
return json && 'object' == typeof json ? new Promise((resolve, reject)=>{
|
|
404
404
|
let stream = new esm_JsonStreamStringify(json, replacer, space, cycle), currentLength = 0, currentContent = '', batchProcessor = new Transform({
|
|
405
405
|
readableObjectMode: !0,
|
|
406
406
|
transform (chunk, _encoding, callback) {
|
|
407
407
|
chunk.toString().split('\\n').forEach((line)=>{
|
|
408
|
-
currentLength + line.length >
|
|
408
|
+
currentLength + line.length > chunkSize && (jsonList.push(currentContent), currentContent = '', currentLength = 0), line.length && (currentContent += line, currentLength += line.length);
|
|
409
409
|
}), callback();
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
412
|
stream.pipe(batchProcessor).on('data', (line)=>{
|
|
413
|
-
currentLength + line.length >
|
|
413
|
+
currentLength + line.length > chunkSize && (jsonList.push(currentContent), currentContent = '', currentLength = 0), line.length && (currentContent += line, currentLength += line.length);
|
|
414
414
|
}).on('end', ()=>{
|
|
415
|
-
|
|
415
|
+
currentContent.length > 0 && jsonList.push(currentContent), resolve(jsonList);
|
|
416
416
|
}).on('error', (err)=>reject(err));
|
|
417
417
|
}) : Promise.resolve(JSON.stringify(json, replacer, space));
|
|
418
418
|
}
|
|
@@ -601,7 +601,7 @@ function filesize(arg, { bits = !1, pad = !1, base = -1, round = 2, locale = "",
|
|
|
601
601
|
if (output === EXPONENT) return e;
|
|
602
602
|
e3 = e, symbolTable = STRINGS_symbol[actualStandard][bits ? "bits" : "bytes"], u = isDecimal && 1 === e3 ? bits ? "kbit" : "kB" : symbolTable[e3], result[1] = u;
|
|
603
603
|
var symbol, num1, e1, precision1, val1, e2, e3, e4, u1, e5 = e;
|
|
604
|
-
if (neg && (result[0] = -result[0]), symbols[result[1]] && (result[1] = symbols[result[1]]), numericValue = "string" == typeof result[0] ? parseFloat(result[0]) : result[0], result[0] = function(value, locale, localeOptions, separator, pad, round, roundingFunc) {
|
|
604
|
+
if (neg && (result[0] = "string" == typeof result[0] ? `-${result[0]}` : -result[0]), symbols[result[1]] && (result[1] = symbols[result[1]]), numericValue = "string" == typeof result[0] ? parseFloat(result[0]) : result[0], result[0] = function(value, locale, localeOptions, separator, pad, round, roundingFunc) {
|
|
605
605
|
let result = value, localePad = pad && round > 0 ? {
|
|
606
606
|
minimumFractionDigits: round,
|
|
607
607
|
maximumFractionDigits: round
|
|
@@ -1247,7 +1247,7 @@ function getSDK(compilerId) {
|
|
|
1247
1247
|
return sdk;
|
|
1248
1248
|
}
|
|
1249
1249
|
export default function(...args) {
|
|
1250
|
-
let time = Date.now(), code = args[0], _options = this.getOptions(), compilation = this._compilation, sdk = getSDK(compilation?.compiler?.compilerPath || _options.builderName), loaderData = {
|
|
1250
|
+
let time = Date.now(), code = args[0], _options = this.getOptions(), compilation = this._compilation, sdk = getSDK(compilation?.compiler?.compilerPath || _options.builderName), targetLoaderIndex = 'start' === _options.type ? this.loaderIndex - 1 : this.loaderIndex + 1, loaderData = {
|
|
1251
1251
|
resource: {
|
|
1252
1252
|
path: this._module?.layer ? `${this.resourcePath}[${this._module.layer}]` : this.resourcePath,
|
|
1253
1253
|
query: parseQuery(this.resourceQuery),
|
|
@@ -1260,7 +1260,7 @@ export default function(...args) {
|
|
|
1260
1260
|
loaders: [
|
|
1261
1261
|
{
|
|
1262
1262
|
loader: _options.loader,
|
|
1263
|
-
loaderIndex:
|
|
1263
|
+
loaderIndex: targetLoaderIndex,
|
|
1264
1264
|
path: _options.loader,
|
|
1265
1265
|
input: 'start' === _options.type ? code : null,
|
|
1266
1266
|
result: 'end' === _options.type ? code : null,
|
package/dist/630.js.LICENSE.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SDK } from '@rsdoctor/shared/types';
|
|
1
|
+
import { SDK, Plugin } from '@rsdoctor/shared/types';
|
|
2
2
|
export type GzipOptions = {
|
|
3
3
|
enabled: false;
|
|
4
4
|
} | {
|
|
@@ -20,4 +20,4 @@ export type GzipOptions = {
|
|
|
20
20
|
* If not provided and no source maps exist (sourceMapSets is empty), all assets will be parsed via AST.
|
|
21
21
|
* @returns Promise that resolves when module data collection is complete
|
|
22
22
|
*/
|
|
23
|
-
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, sourceMapSets: Map<string, string>, hasParseBundle?: boolean, assetsWithoutSourceMap?: Set<string>, gzipOptions?: GzipOptions): Promise<void>;
|
|
23
|
+
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, sourceMapSets: Map<string, string>, hasParseBundle?: boolean, assetsWithoutSourceMap?: Set<string>, gzipOptions?: GzipOptions, brotli?: Plugin.NormalizedBrotliConfig): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SDK } from '@rsdoctor/shared/types';
|
|
2
|
-
export declare function stringify<T, P = T extends undefined ? undefined : string>(json: T, replacer?: (this: any, key: string, value: any) => any, space?: string | number, cycle?: boolean): Promise<P>;
|
|
2
|
+
export declare function stringify<T, P = T extends undefined ? undefined : string>(json: T, replacer?: (this: any, key: string, value: any) => any, space?: string | number, cycle?: boolean, chunkSize?: number): Promise<P>;
|
|
3
3
|
export declare const readPackageJson: (file: string, readFile?: SDK.GetPackageFile) => SDK.PackageBasicData | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { logger } from './logger.js';
|
|
2
|
-
export {
|
|
2
|
+
export { RsdoctorRspackPlugin } from './rspack-plugin/index.js';
|
|
3
3
|
export { Linter, LinterType, Rule as LinterRule, defineRule, rules, } from './rules/index.js';
|
|
4
4
|
export { RsdoctorSDK, resolveClientDiffHtmlPath } from './sdk/index.js';
|
|
5
|
-
export type {
|
|
5
|
+
export type { RsdoctorRspackPluginOptions } from './types/index.js';
|