@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/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
- isSameSemantics: ()=>function isSameSemantics(node1, node2) {
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 && isSameSemantics(node1.callee, node2.callee) && node1.arguments.every((node, i)=>isSameSemantics(node, node2.arguments[i]));
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 && isSameSemantics(node1.object, node2.object) && isSameSemantics(node1.property, node2.property);
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)=>isSameSemantics(prop, node2.properties[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 && isSameSemantics(node1.key, node2.key) && isSameSemantics(node1.value, node2.value);
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 > 419430400 && (jsonList.push(currentContent), currentContent = '', currentLength = 0), line.length && (currentContent += line, 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 > 419430400 && (jsonList.push(currentContent), currentContent = '', currentLength = 0), line.length && (currentContent += line, 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
- jsonList.length < 1 && jsonList.push(currentContent), resolve(jsonList);
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: this.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,
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
5
5
  * @license BSD-3-Clause
6
- * @version 11.0.22
6
+ * @version 11.0.23
7
7
  */
@@ -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;
@@ -1,5 +1,6 @@
1
1
  import type { Plugin } from '@rsdoctor/shared/types';
2
2
  export declare class ProbeLoaderPlugin {
3
+ private readonly instrumentedCompilers;
3
4
  apply(compiler: Plugin.BaseCompiler): void;
4
5
  private addProbeLoader;
5
6
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { logger } from './logger.js';
2
- export { RsdoctorRspackMultiplePlugin, RsdoctorRspackPlugin, } from './rspack-plugin/index.js';
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 { RsdoctorMultiplePluginOptions, RsdoctorRspackPluginOptions, } from './types/index.js';
5
+ export type { RsdoctorRspackPluginOptions } from './types/index.js';