Package org.openrewrite.javascript.rpc
Class JavaScriptRewriteRpc.Builder
java.lang.Object
org.openrewrite.javascript.rpc.JavaScriptRewriteRpc.Builder
- All Implemented Interfaces:
Supplier<JavaScriptRewriteRpc>
- Enclosing class:
JavaScriptRewriteRpc
public static class JavaScriptRewriteRpc.Builder
extends Object
implements Supplier<JavaScriptRewriteRpc>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()inspectBrk(@Nullable Integer inspectBrk) Set the port for the Node.js inspector to listen on.marketplace(org.openrewrite.config.Environment marketplace) maxHeapSize(@Nullable Integer maxHeapSize) Set the maximum heap size for the Node.js process in megabytes.Path to the `npx` executable, not just the directory it is installed in.profiler()profiler(boolean profiler) Enable V8 CPU profiling for performance analysis.recipeInstallDir(@Nullable Path recipeInstallDir) verboseLogging(boolean verboseLogging) Enables info and debug level logging.workingDirectory(@Nullable Path workingDirectory) Set the working directory for the Node.js process.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
marketplace
-
recipeInstallDir
-
npxPath
Path to the `npx` executable, not just the directory it is installed in.- Parameters:
npxPath- The path to the `npx` executable.- Returns:
- This builder
-
timeout
-
log
-
verboseLogging
Enables info and debug level logging.- Returns:
- This builder.
-
verboseLogging
-
inspectBrk
Set the port for the Node.js inspector to listen on. When this is set, you can use an "Attach to Node.js/Chrome" run configuration in IDEA to debug the JavaScript Rewrite RPC process. The Rewrite RPC process will block waiting for this connection.- Parameters:
inspectBrk- The port for the Node.js inspector to listen on.- Returns:
- This builder
-
inspectBrk
-
profiler
Enable V8 CPU profiling for performance analysis. When enabled, the process will generate a CPU profile that can be analyzed to identify performance bottlenecks. The profile is saved in Chrome DevTools format (.cpuprofile) on shutdown.Profiling uses the V8 Inspector API and works with both npx and direct node execution modes. The profile file can be loaded in Chrome DevTools for analysis.
- Parameters:
profiler- Whether to enable profiling- Returns:
- This builder
-
profiler
-
maxHeapSize
Set the maximum heap size for the Node.js process in megabytes. Default V8 heap size is approximately 1.5-2 GB on 64-bit systems. For large repositories with many source files, you may need to increase this.- Parameters:
maxHeapSize- Maximum heap size in megabytes (e.g., 4096 for 4GB)- Returns:
- This builder
-
workingDirectory
Set the working directory for the Node.js process. This affects where profile logs and other output files are generated. If not set, the process inherits the current working directory.- Parameters:
workingDirectory- The working directory for the Node.js process- Returns:
- This builder
-
get
- Specified by:
getin interfaceSupplier<JavaScriptRewriteRpc>
-