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 TypeMethodDescriptionenvironment(Map<String, String> environment) get()inspectBrk(Path rewriteDistPath) inspectBrk(Path rewriteSourcePath, int inspectBrk) Set the port for the Node.js inspector to listen on.marketplace(org.openrewrite.marketplace.RecipeMarketplace marketplace) metricsCsv(@Nullable Path metricsCsv) Path to the `npx` executable, not just the directory it is installed in.recipeInstallDir(@Nullable Path recipeInstallDir) traceRpcMessages(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
public JavaScriptRewriteRpc.Builder marketplace(org.openrewrite.marketplace.RecipeMarketplace marketplace) -
resolvers
public JavaScriptRewriteRpc.Builder resolvers(List<org.openrewrite.marketplace.RecipeBundleResolver> resolvers) -
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
-
metricsCsv
-
environment
-
traceRpcMessages
Enables info and debug level logging.- Returns:
- This builder.
-
traceRpcMessages
-
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:
rewriteSourcePath- The path to either OpenRewrite TypeScript source code, or inside a node_modules folder e.g., @openrewrite/rewrite. When running a test from within this project, the value should be "rewrite" (since "rewrite-javascript/rewrite" contains the TypeScript source code).inspectBrk- The port for the Node.js inspector to listen on.- Returns:
- This builder
-
inspectBrk
-
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>
-