@mui/internal-docs-infra 0.13.1-canary.6 → 0.13.1-canary.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-docs-infra",
3
- "version": "0.13.1-canary.6",
3
+ "version": "0.13.1-canary.7",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI Infra - internal documentation creation tools.",
6
6
  "license": "MIT",
@@ -814,5 +814,5 @@
814
814
  "bin": {
815
815
  "docs-infra": "./cli/index.mjs"
816
816
  },
817
- "gitSha": "c2a0ca83b8dd00ae2fa2b5714dbc6684d50926d9"
817
+ "gitSha": "73b01ccc61d2096ec1bac12c735482f8d056c917"
818
818
  }
@@ -39,8 +39,6 @@ class InMemoryLanguageServiceHost {
39
39
  * per-file version checks entirely, avoiding O(n) `getScriptVersion` calls.
40
40
  */
41
41
  projectVersion = 0;
42
- options;
43
- projectPath;
44
42
  getVersionCallCount = 0;
45
43
  getSnapshotCallCount = 0;
46
44
 
@@ -10,7 +10,6 @@ export interface PerformanceLog {
10
10
  export declare class PerformanceTracker {
11
11
  private logs;
12
12
  private baseTime;
13
- constructor();
14
13
  mark(name: string): number;
15
14
  measure(name: string, startTime: number, endTime: number): void;
16
15
  getLogs(): PerformanceLog[];
@@ -4,10 +4,7 @@
4
4
 
5
5
  export class PerformanceTracker {
6
6
  logs = [];
7
- baseTime;
8
- constructor() {
9
- this.baseTime = performance.now();
10
- }
7
+ baseTime = performance.now();
11
8
  mark(name) {
12
9
  const time = performance.now();
13
10
  this.logs.push({
@@ -28,11 +28,7 @@ async function fileExists(path) {
28
28
  * Socket server that handles requests from other workers
29
29
  */
30
30
  export class SocketServer {
31
- server;
32
- socketPath;
33
31
  connections = new Set();
34
- requestHandler;
35
-
36
32
  /**
37
33
  * Request queue to serialize processTypes calls.
38
34
  * The TypeScript language service is a singleton that uses setRootFiles()
@@ -6,6 +6,12 @@ import { fileURLToPath } from 'url';
6
6
  // eslint-disable-next-line n/prefer-node-protocol
7
7
  import { isMainThread, Worker } from 'worker_threads';
8
8
  import { SocketClient, tryAcquireServerLock, releaseServerLock } from "./socketClient.mjs";
9
+ /**
10
+ * Returns the path of the worker file, which must be compiled JS, not TS.
11
+ */
12
+ function getWorkerPath() {
13
+ return path.join(path.dirname(fileURLToPath(import.meta.url)), 'worker.mjs');
14
+ }
9
15
 
10
16
  /**
11
17
  * Shared interface for types processing managers.
@@ -20,16 +26,9 @@ class TypesMetaWorkerManager {
20
26
  worker = null;
21
27
  pendingRequests = new Map();
22
28
  requestId = 0;
23
- workerPath;
24
- constructor() {
25
- // Worker file must be compiled JS, not TS
26
- // Use import.meta.url to get current directory in ESM
27
- const currentDir = path.dirname(fileURLToPath(import.meta.url));
28
- this.workerPath = path.join(currentDir, 'worker.mjs');
29
- }
30
29
  ensureWorker() {
31
30
  if (!this.worker) {
32
- this.worker = new Worker(this.workerPath);
31
+ this.worker = new Worker(getWorkerPath());
33
32
  this.worker.on('message', response => {
34
33
  const {
35
34
  requestId,
@@ -111,9 +110,7 @@ class WorkerThreadTypesProcessor {
111
110
  if (isServer) {
112
111
  // We won the lock — spawn the bare worker which will become a socket server.
113
112
  // Keep the lock held so no other worker tries to spawn a second server.
114
- const currentDir = path.dirname(fileURLToPath(import.meta.url));
115
- const workerPath = path.join(currentDir, 'worker.mjs');
116
- this.serverWorker = new Worker(workerPath, {
113
+ this.serverWorker = new Worker(getWorkerPath(), {
117
114
  workerData: {
118
115
  isServer: true
119
116
  }