@spencer-kit/coder-studio 0.2.0 → 0.2.2

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.
@@ -3,6 +3,7 @@ import fs from 'node:fs/promises';
3
3
  import { execFile, spawn } from 'node:child_process';
4
4
  import { promisify } from 'node:util';
5
5
  const execFileAsync = promisify(execFile);
6
+ const HIDE_WINDOWS_OPTIONS = process.platform === 'win32' ? { windowsHide: true } : {};
6
7
  export function sleep(ms) {
7
8
  return new Promise((resolve) => setTimeout(resolve, ms));
8
9
  }
@@ -24,7 +25,7 @@ export async function terminateProcess(pid, { force = false } = {}) {
24
25
  const args = ['/PID', String(pid), '/T'];
25
26
  if (force)
26
27
  args.push('/F');
27
- await execFileAsync('taskkill', args);
28
+ await execFileAsync('taskkill', args, HIDE_WINDOWS_OPTIONS);
28
29
  return;
29
30
  }
30
31
  process.kill(pid, force ? 'SIGKILL' : 'SIGTERM');
@@ -57,18 +58,18 @@ export function spawnForeground(command, args, options = {}) {
57
58
  export async function openExternal(targetUrl, env = process.env) {
58
59
  if (env.CODER_STUDIO_OPEN_COMMAND) {
59
60
  const [command, ...extraArgs] = env.CODER_STUDIO_OPEN_COMMAND.split(' ');
60
- await execFileAsync(command, [...extraArgs, targetUrl]);
61
+ await execFileAsync(command, [...extraArgs, targetUrl], HIDE_WINDOWS_OPTIONS);
61
62
  return;
62
63
  }
63
64
  if (process.platform === 'darwin') {
64
- await execFileAsync('open', [targetUrl]);
65
+ await execFileAsync('open', [targetUrl], HIDE_WINDOWS_OPTIONS);
65
66
  return;
66
67
  }
67
68
  if (process.platform === 'win32') {
68
- await execFileAsync('cmd', ['/c', 'start', '', targetUrl]);
69
+ await execFileAsync('cmd', ['/c', 'start', '', targetUrl], HIDE_WINDOWS_OPTIONS);
69
70
  return;
70
71
  }
71
- await execFileAsync('xdg-open', [targetUrl]);
72
+ await execFileAsync('xdg-open', [targetUrl], HIDE_WINDOWS_OPTIONS);
72
73
  }
73
74
  export async function ensureFile(pathname) {
74
75
  const handle = await fs.open(pathname, 'a');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spencer-kit/coder-studio",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "CLI runtime manager for Coder Studio.",
6
6
  "bin": {
@@ -12,10 +12,10 @@
12
12
  "README.md"
13
13
  ],
14
14
  "optionalDependencies": {
15
- "@spencer-kit/coder-studio-linux-x64": "0.2.0",
16
- "@spencer-kit/coder-studio-darwin-arm64": "0.2.0",
17
- "@spencer-kit/coder-studio-darwin-x64": "0.2.0",
18
- "@spencer-kit/coder-studio-win32-x64": "0.2.0"
15
+ "@spencer-kit/coder-studio-linux-x64": "0.2.2",
16
+ "@spencer-kit/coder-studio-darwin-arm64": "0.2.2",
17
+ "@spencer-kit/coder-studio-darwin-x64": "0.2.2",
18
+ "@spencer-kit/coder-studio-win32-x64": "0.2.2"
19
19
  },
20
20
  "publishConfig": {
21
21
  "access": "public"