@eclipse-glsp/cli 2.7.0-next.20 → 2.7.0-next.22
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/cli.js +55 -40
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -15537,25 +15537,38 @@ var DEFAULT_TARGET_DIR = "examples/workflow-test";
|
|
|
15537
15537
|
function generatePlaywrightEnvContent(options) {
|
|
15538
15538
|
const { dir, discoveredRepos } = options;
|
|
15539
15539
|
const lines = [];
|
|
15540
|
+
const hasServerNode = discoveredRepos.includes("glsp-server-node");
|
|
15541
|
+
const hasServerJava = discoveredRepos.includes("glsp-server");
|
|
15542
|
+
const hasClient = discoveredRepos.includes("glsp-client");
|
|
15540
15543
|
lines.push("# Generated by: glsp repo playwright env");
|
|
15541
15544
|
lines.push("# Regenerate this file after workspace changes.");
|
|
15542
15545
|
lines.push("");
|
|
15546
|
+
lines.push("# General");
|
|
15547
|
+
lines.push("GLSP_SERVER_PORT=8081");
|
|
15548
|
+
lines.push("GLSP_SERVER_DEBUG=true");
|
|
15549
|
+
lines.push("GLSP_WEBSOCKET_PATH=workflow");
|
|
15550
|
+
if (hasServerNode) {
|
|
15551
|
+
lines.push("GLSP_SERVER_TYPE=node");
|
|
15552
|
+
lines.push("GLSP_SERVER_START_CMD=npx glsp repo server-node start");
|
|
15553
|
+
} else if (hasServerJava) {
|
|
15554
|
+
lines.push("GLSP_SERVER_TYPE=java");
|
|
15555
|
+
lines.push("GLSP_SERVER_START_CMD=npx glsp repo server-java start");
|
|
15556
|
+
} else {
|
|
15557
|
+
lines.push("GLSP_SERVER_TYPE=unknown");
|
|
15558
|
+
lines.push("# GLSP_SERVER_START_CMD=npx glsp repo server-node start");
|
|
15559
|
+
}
|
|
15560
|
+
lines.push("");
|
|
15543
15561
|
lines.push("# Optional port overrides (uncomment to change defaults)");
|
|
15544
|
-
lines.push("# GLSP_SERVER_PORT=8081");
|
|
15545
15562
|
lines.push("# STANDALONE_PORT=8082");
|
|
15546
15563
|
lines.push("# STANDALONE_BROWSER_PORT=8083");
|
|
15547
15564
|
lines.push("# THEIA_PORT=3000");
|
|
15548
15565
|
lines.push("");
|
|
15549
|
-
const hasServerNode = discoveredRepos.includes("glsp-server-node");
|
|
15550
|
-
const hasClient = discoveredRepos.includes("glsp-client");
|
|
15551
15566
|
if (hasServerNode && hasClient) {
|
|
15552
15567
|
lines.push("# Standalone Node (WebSocket)");
|
|
15553
|
-
lines.push("
|
|
15554
|
-
lines.push("STANDALONE_START_CMD=glsp repo client run start -- --external-server --no-open");
|
|
15568
|
+
lines.push("STANDALONE_START_CMD=npx glsp repo client start --external-server --no-open");
|
|
15555
15569
|
} else {
|
|
15556
15570
|
lines.push("# Standalone Node (WebSocket) \u2014 missing repos, uncomment when available");
|
|
15557
|
-
lines.push("#
|
|
15558
|
-
lines.push("# STANDALONE_START_CMD=glsp repo client run start -- --external-server --no-open");
|
|
15571
|
+
lines.push("# STANDALONE_START_CMD=npx glsp repo client start --external-server --no-open");
|
|
15559
15572
|
}
|
|
15560
15573
|
lines.push("");
|
|
15561
15574
|
if (hasServerNode && hasClient) {
|
|
@@ -15563,23 +15576,23 @@ function generatePlaywrightEnvContent(options) {
|
|
|
15563
15576
|
const bundleExists = fs20.existsSync(bundlePath);
|
|
15564
15577
|
lines.push("# Standalone Browser (Web Worker)");
|
|
15565
15578
|
if (bundleExists) {
|
|
15566
|
-
lines.push(`STANDALONE_BROWSER_START_CMD=glsp repo client
|
|
15579
|
+
lines.push(`STANDALONE_BROWSER_START_CMD=npx glsp repo client start --browser --external-server ${bundlePath} --no-open`);
|
|
15567
15580
|
} else {
|
|
15568
15581
|
LOGGER.warn(`Browser bundle not found at ${bundlePath}. Build glsp-server-node first.`);
|
|
15569
|
-
lines.push(`# STANDALONE_BROWSER_START_CMD=glsp repo client
|
|
15582
|
+
lines.push(`# STANDALONE_BROWSER_START_CMD=npx glsp repo client start --browser --external-server ${bundlePath} --no-open`);
|
|
15570
15583
|
}
|
|
15571
15584
|
} else {
|
|
15572
15585
|
lines.push("# Standalone Browser (Web Worker) \u2014 missing repos, uncomment when available");
|
|
15573
|
-
lines.push("# STANDALONE_BROWSER_START_CMD=glsp repo client
|
|
15586
|
+
lines.push("# STANDALONE_BROWSER_START_CMD=npx glsp repo client start --browser --external-server <bundle-path> --no-open");
|
|
15574
15587
|
}
|
|
15575
15588
|
lines.push("");
|
|
15576
15589
|
const hasTheia = discoveredRepos.includes("glsp-theia-integration");
|
|
15577
15590
|
if (hasTheia) {
|
|
15578
15591
|
lines.push("# Theia");
|
|
15579
|
-
lines.push("THEIA_START_CMD=glsp repo theia start");
|
|
15592
|
+
lines.push("THEIA_START_CMD=npx glsp repo theia start");
|
|
15580
15593
|
} else {
|
|
15581
15594
|
lines.push("# Theia \u2014 repo not found, uncomment when available");
|
|
15582
|
-
lines.push("# THEIA_START_CMD=glsp repo theia start");
|
|
15595
|
+
lines.push("# THEIA_START_CMD=npx glsp repo theia start");
|
|
15583
15596
|
}
|
|
15584
15597
|
lines.push("");
|
|
15585
15598
|
const hasVscode = discoveredRepos.includes("glsp-vscode-integration");
|
|
@@ -15598,28 +15611,10 @@ function generatePlaywrightEnvContent(options) {
|
|
|
15598
15611
|
} else {
|
|
15599
15612
|
lines.push("# VSCODE_VSIX_PATH=<path-to-vsix>");
|
|
15600
15613
|
}
|
|
15601
|
-
lines.push("");
|
|
15602
|
-
lines.push("# VSCode Web Extension");
|
|
15603
|
-
lines.push(`VSCODE_WEB_VSIX_ID=${WEB_VSIX_ID}`);
|
|
15604
|
-
let webVsixPath;
|
|
15605
|
-
try {
|
|
15606
|
-
webVsixPath = discoverWebVsix(vscodeRepoDir);
|
|
15607
|
-
} catch {
|
|
15608
|
-
LOGGER.warn("Web extension VSIX file not found. Build and package the web extension first.");
|
|
15609
|
-
}
|
|
15610
|
-
if (webVsixPath) {
|
|
15611
|
-
lines.push(`VSCODE_WEB_VSIX_PATH=${webVsixPath}`);
|
|
15612
|
-
} else {
|
|
15613
|
-
lines.push("# VSCODE_WEB_VSIX_PATH=<path-to-web-vsix>");
|
|
15614
|
-
}
|
|
15615
15614
|
} else {
|
|
15616
15615
|
lines.push("# VSCode \u2014 repo not found, uncomment when available");
|
|
15617
15616
|
lines.push(`# VSCODE_VSIX_ID=${VSIX_ID}`);
|
|
15618
15617
|
lines.push("# VSCODE_VSIX_PATH=<path-to-vsix>");
|
|
15619
|
-
lines.push("");
|
|
15620
|
-
lines.push("# VSCode Web Extension \u2014 repo not found, uncomment when available");
|
|
15621
|
-
lines.push(`# VSCODE_WEB_VSIX_ID=${WEB_VSIX_ID}`);
|
|
15622
|
-
lines.push("# VSCODE_WEB_VSIX_PATH=<path-to-web-vsix>");
|
|
15623
15618
|
}
|
|
15624
15619
|
lines.push("");
|
|
15625
15620
|
return lines.join("\n");
|
|
@@ -15649,7 +15644,7 @@ var PlaywrightEnvCommand = baseCommand().name("env").description("Generate a .en
|
|
|
15649
15644
|
// src/commands/repo/run.ts
|
|
15650
15645
|
var path22 = __toESM(require("path"));
|
|
15651
15646
|
function createScopedRunCommand(repo) {
|
|
15652
|
-
return baseCommand().name("run").allowUnknownOption(true).description(`Run an arbitrary yarn script in ${repo}`).argument("<script>", "The yarn script to run").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (script, _cmdOptions, thisCmd) => {
|
|
15647
|
+
return baseCommand().name("run").allowUnknownOption(true).allowExcessArguments(true).description(`Run an arbitrary yarn script in ${repo}`).argument("<script>", "The yarn script to run").option("-d, --dir <path>", "Target directory where repos are cloned").option("-v, --verbose", "Verbose output", false).action(async (script, _cmdOptions, thisCmd) => {
|
|
15653
15648
|
const cli = thisCmd.opts();
|
|
15654
15649
|
configureRepoEnv(cli);
|
|
15655
15650
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
@@ -15668,24 +15663,30 @@ function discoverJar(repoDir) {
|
|
|
15668
15663
|
const targetDir = path23.resolve(repoDir, JAR_TARGET_DIR);
|
|
15669
15664
|
return discoverNewestFile(JAR_PATTERN, targetDir, `No *-glsp.jar found in ${targetDir}. Run \`glsp repo server build\` first.`);
|
|
15670
15665
|
}
|
|
15671
|
-
|
|
15666
|
+
function collectPassthroughArgs(cmd) {
|
|
15667
|
+
const raw = cmd.args;
|
|
15668
|
+
return raw.length > 0 ? ` ${raw.join(" ")}` : "";
|
|
15669
|
+
}
|
|
15670
|
+
var TheiaStartCommand = baseCommand().name("start").allowUnknownOption(true).allowExcessArguments(true).description("Start the Theia application for glsp-theia-integration").option("-d, --dir <path>", "Target directory where repos are cloned").option("--electron", "Start electron variant instead of browser", false).option("--debug", "Connect to external GLSP server for debugging", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15672
15671
|
const cli = thisCmd.opts();
|
|
15673
15672
|
configureRepoEnv(cli);
|
|
15674
15673
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15675
15674
|
const repoDir = path23.resolve(dir, "glsp-theia-integration");
|
|
15676
15675
|
const target = cli.electron ? "electron" : "browser";
|
|
15677
15676
|
const script = cli.debug ? "start:debug" : "start";
|
|
15678
|
-
|
|
15677
|
+
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15678
|
+
await execForeground(`yarn ${target} ${script}${passthrough}`, { cwd: repoDir, verbose: cli.verbose });
|
|
15679
15679
|
});
|
|
15680
|
-
var ClientStartCommand = baseCommand().name("start").description("Start the standalone example for glsp-client").option("-d, --dir <path>", "Target directory where repos are cloned").option("--browser", "Run in browser-only mode with WebWorker server", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15680
|
+
var ClientStartCommand = baseCommand().name("start").allowUnknownOption(true).allowExcessArguments(true).description("Start the standalone example for glsp-client").option("-d, --dir <path>", "Target directory where repos are cloned").option("--browser", "Run in browser-only mode with WebWorker server", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15681
15681
|
const cli = thisCmd.opts();
|
|
15682
15682
|
configureRepoEnv(cli);
|
|
15683
15683
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15684
15684
|
const repoDir = path23.resolve(dir, "glsp-client");
|
|
15685
15685
|
const script = cli.browser ? "start:browser" : "start";
|
|
15686
|
-
|
|
15686
|
+
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15687
|
+
await execForeground(`yarn ${script}${passthrough}`, { cwd: repoDir, verbose: cli.verbose });
|
|
15687
15688
|
});
|
|
15688
|
-
var ServerStartCommand = baseCommand().name("start").description("Start the glsp-server Java GLSP server").option("-d, --dir <path>", "Target directory where repos are cloned").option("-p, --port <port>", "Port to start the server on").option("--socket", "Use socket connection instead of websocket", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15689
|
+
var ServerStartCommand = baseCommand().name("start").allowUnknownOption(true).allowExcessArguments(true).description("Start the glsp-server Java GLSP server").option("-d, --dir <path>", "Target directory where repos are cloned").option("-p, --port <port>", "Port to start the server on").option("--socket", "Use socket connection instead of websocket", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15689
15690
|
const cli = thisCmd.opts();
|
|
15690
15691
|
configureRepoEnv(cli);
|
|
15691
15692
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
@@ -15695,16 +15696,18 @@ var ServerStartCommand = baseCommand().name("start").description("Start the glsp
|
|
|
15695
15696
|
const socketPort = cli.port ?? 5007;
|
|
15696
15697
|
const wsPort = cli.port ?? 8081;
|
|
15697
15698
|
const javaCmd = cli.socket ? `java -jar ${jarPath} --port=${socketPort}` : `java -jar ${jarPath} --websocket --port=${wsPort}`;
|
|
15698
|
-
|
|
15699
|
+
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15700
|
+
await execForeground(`${javaCmd}${passthrough}`, { cwd: repoDir, verbose: cli.verbose });
|
|
15699
15701
|
});
|
|
15700
|
-
var ServerNodeStartCommand = baseCommand().name("start").description("Start the glsp-server-node GLSP server").option("-d, --dir <path>", "Target directory where repos are cloned").option("-p, --port <port>", "Port to start the server on").option("--socket", "Use socket connection instead of websocket", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15702
|
+
var ServerNodeStartCommand = baseCommand().name("start").allowUnknownOption(true).allowExcessArguments(true).description("Start the glsp-server-node GLSP server").option("-d, --dir <path>", "Target directory where repos are cloned").option("-p, --port <port>", "Port to start the server on").option("--socket", "Use socket connection instead of websocket", false).option("-v, --verbose", "Verbose output", false).action(async (_cmdOptions, thisCmd) => {
|
|
15701
15703
|
const cli = thisCmd.opts();
|
|
15702
15704
|
configureRepoEnv(cli);
|
|
15703
15705
|
const dir = resolveWorkspaceDir(cli.dir);
|
|
15704
15706
|
const repoDir = path23.resolve(dir, "glsp-server-node");
|
|
15705
15707
|
const yarnCmd = cli.socket ? "yarn start" : "yarn start:websocket";
|
|
15706
15708
|
const portArg = cli.port ? ` --port ${cli.port}` : "";
|
|
15707
|
-
|
|
15709
|
+
const passthrough = collectPassthroughArgs(thisCmd);
|
|
15710
|
+
await execForeground(`${yarnCmd}${portArg}${passthrough}`, { cwd: repoDir, verbose: cli.verbose });
|
|
15708
15711
|
});
|
|
15709
15712
|
|
|
15710
15713
|
// src/commands/repo/switch.ts
|
|
@@ -15818,6 +15821,12 @@ function createSubrepoCommand(repo) {
|
|
|
15818
15821
|
cmd.addCommand(extraCmd);
|
|
15819
15822
|
}
|
|
15820
15823
|
}
|
|
15824
|
+
cmd.hook("preSubcommand", (_, subcommand) => {
|
|
15825
|
+
const parentDir = cmd.getOptionValue("dir");
|
|
15826
|
+
if (parentDir && !subcommand.getOptionValue("dir")) {
|
|
15827
|
+
subcommand.setOptionValue("dir", parentDir);
|
|
15828
|
+
}
|
|
15829
|
+
});
|
|
15821
15830
|
const alias = SHORT_ALIASES[repo];
|
|
15822
15831
|
if (alias) {
|
|
15823
15832
|
cmd.alias(alias);
|
|
@@ -15947,7 +15956,13 @@ Run "glsp repo workspace init" first.`);
|
|
|
15947
15956
|
var WorkspaceCommand = baseCommand().name("workspace").description("Manage VS Code workspace files for GLSP projects").addCommand(WorkspaceInitCommand).addCommand(WorkspaceOpenCommand);
|
|
15948
15957
|
|
|
15949
15958
|
// src/commands/repo/repo.ts
|
|
15950
|
-
var RepoCommand = baseCommand().name("repo").description("Multi-repository management for GLSP projects").addCommand(CloneCommand).addCommand(ForkCommand).addCommand(BuildCommand).addCommand(LinkCommand).addCommand(UnlinkCommand).addCommand(PwdCommand).addCommand(LogCommand).addCommand(WorkspaceCommand);
|
|
15959
|
+
var RepoCommand = baseCommand().name("repo").description("Multi-repository management for GLSP projects").option("-d, --dir <path>", "Target directory where repos are cloned (inherited by subcommands)").addCommand(CloneCommand).addCommand(ForkCommand).addCommand(BuildCommand).addCommand(LinkCommand).addCommand(UnlinkCommand).addCommand(PwdCommand).addCommand(LogCommand).addCommand(WorkspaceCommand);
|
|
15960
|
+
RepoCommand.hook("preSubcommand", (_, subcommand) => {
|
|
15961
|
+
const parentDir = RepoCommand.opts().dir;
|
|
15962
|
+
if (parentDir && !subcommand.getOptionValue("dir")) {
|
|
15963
|
+
subcommand.setOptionValue("dir", parentDir);
|
|
15964
|
+
}
|
|
15965
|
+
});
|
|
15951
15966
|
for (const repo of GLSPRepo.choices) {
|
|
15952
15967
|
RepoCommand.addCommand(createSubrepoCommand(repo));
|
|
15953
15968
|
}
|