expo-desktop 0.1.7 → 0.1.9

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 path from "node:path";
4
4
  import { env } from "node:process";
5
5
  import readline from "node:readline";
6
+ import { stripVTControlCharacters } from "node:util";
6
7
  /**
7
8
  * Clack {@link Task} that runs a subprocess; piped stdout/stderr lines are sent
8
9
  * through the task `message` callback (not `log.message`). Lines are also kept in
@@ -74,7 +75,7 @@ function runPromisifiedSpawn({ command, args, options, logLine, debugLogDir, })
74
75
  try {
75
76
  await fs.mkdir(logDir, { recursive: true });
76
77
  const body = lineBuffer.length > 0
77
- ? lineBuffer.join("\n")
78
+ ? lineBuffer.map((line) => stripVTControlCharacters(line)).join("\n")
78
79
  : "(no stdout/stderr lines were captured; streams may have been inherited or ignored.)";
79
80
  await fs.writeFile(absPath, `${header}${body}\n`, "utf-8");
80
81
  wrotePath = absPath;
@@ -76,11 +76,13 @@ export async function createExpoDesktopApp({ name, packageManager, versions, })
76
76
  // TODO: Set up Windows app.cpp entrypoint
77
77
  }
78
78
  async function createExpoApp({ name, packageManager, versions, }) {
79
- const command = packageManager;
79
+ // `npm create` drops flags meant for create-expo-app unless you add `--`; use
80
+ // `npx --yes` instead to forward args correctly and skip prompts.
81
+ const command = packageManager === "npm" ? "npx" : packageManager;
80
82
  const args = [
81
- "create",
82
- "expo-app",
83
+ ...(packageManager === "npm" ? ["--yes", "create-expo-app"] : ["create", "expo-app"]),
83
84
  name.filesafeName,
85
+ "--yes",
84
86
  "--template",
85
87
  `blank-typescript@${versions.expoBlankTypeScript}`,
86
88
  "--no-install",
@@ -93,7 +95,11 @@ async function createExpoApp({ name, packageManager, versions, }) {
93
95
  title: "create-expo-app",
94
96
  command,
95
97
  args,
96
- options: { stdio: "inherit" },
98
+ options: {
99
+ stdio: "inherit",
100
+ // Suppresses npx/npm exec "Ok to proceed?" and similar yes/no prompts.
101
+ env: { npm_config_yes: "true" },
102
+ },
97
103
  debugLogDir: projectPath,
98
104
  }),
99
105
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-desktop",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Best-effort desktop support for Expo",
5
5
  "keywords": [
6
6
  "android",