Angular Modernizer
    Preparing search index...
    • Get the absolute path to the compiled analysis worker script (dist/analysis-worker.js). Pass it as workerScriptPath to WorkerPool or to ParallelExecutor.executeParallel.

      Each worker started from the script:

      • reads workerId and tsConfigPath from workerData and loads the whole project from that tsconfig into its own ts-morph Project, because rules need cross-file context
      • creates its own PublicApi and posts { type: 'ready', workerId }; if loading fails it posts { type: 'init-error', workerId, error } and exits
      • receives WorkerTask messages and answers each with a WorkerResult

      For a task the worker loads the analysis rules of the plugins in pluginIds (architecture, solid, angular, analyzer, standalone or the full package names; standalone has no analysis rules), keeps only the rules in ruleIds when the list is not empty, and runs them on filePath, which must belong to the loaded project. A rule that throws is skipped. All results get the severity warning. A failed task returns no results and sets error.

      Returns string

      import { getWorkerScriptPath } from '@angular-modernizer/worker';
      import { WorkerPool } from '@angular-modernizer/core';

      const pool = new WorkerPool({
      tsConfigPath: '/path/to/tsconfig.json',
      workerScriptPath: getWorkerScriptPath(),
      });

      The WorkerPool analysis path is deprecated since 1.1 and will be removed in 2.0; the MCP scans run in a scan worker instead.