expo-desktop 0.1.6 → 0.1.8

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;
@@ -1,13 +1,14 @@
1
1
  import { confirm, isCancel, text, log, select } from "@clack/prompts";
2
2
  import { default as kleur } from "kleur";
3
3
  import { green, grey } from "kleur/colors";
4
+ import { platform } from "node:process";
4
5
  import { title } from "../common/clack.js";
5
- import { createExpoDesktopApp } from "./create-expo-desktop-app.js";
6
+ import { createExpoDesktopApp, localDev } from "./create-expo-desktop-app.js";
6
7
  import { previewFileTree } from "./preview-file-tree.js";
7
8
  import { promptForVersion } from "./prompt-for-version.js";
8
9
  export async function newExpoDesktopProject(args) {
9
10
  // A dev-time switch for skipping the questions
10
- const skip = true;
11
+ const skip = localDev;
11
12
  if (skip) {
12
13
  await createExpoDesktopApp({
13
14
  name: {
@@ -40,7 +41,8 @@ export async function newExpoDesktopProject(args) {
40
41
  { value: "bun", label: "Bun (recommended)" },
41
42
  { value: "pnpm", label: "pnpm" },
42
43
  ],
43
- initialValue: "bun",
44
+ // As far as I've found on ARM Windows, Bun just segfaults on install :(
45
+ initialValue: platform === "win32" ? "pnpm" : "bun",
44
46
  });
45
47
  if (isCancel(packageManager)) {
46
48
  process.exit(0);
@@ -13,11 +13,12 @@ import { packageManagerExec } from "../common/npm.js";
13
13
  /**
14
14
  * A crude switch to use to help with local development.
15
15
  *
16
+ * - Skips the questionnaire at the start.
16
17
  * - Installs the local copy of expo-desktop-config-plugins rather than pinning
17
18
  * to a published release.
18
19
  * - Adds the apply-config-plugins.mjs script.
19
20
  */
20
- const localDev = false;
21
+ export const localDev = false;
21
22
  export async function createExpoDesktopApp({ name, packageManager, versions, }) {
22
23
  const { projectPath } = await createExpoApp({ name, packageManager, versions });
23
24
  await appendRootGitignoreSpawnDebugLogs(projectPath);
@@ -76,10 +77,14 @@ export async function createExpoDesktopApp({ name, packageManager, versions, })
76
77
  }
77
78
  async function createExpoApp({ name, packageManager, versions, }) {
78
79
  const command = packageManager;
80
+ // npm treats flags after `npm create <pkg> <name>` as its own unless we use
81
+ // `--`; otherwise e.g. `--template` is dropped and the template string becomes
82
+ // a bogus positional arg (create-expo-app then fails inside `npm pack`).
79
83
  const args = [
80
84
  "create",
81
85
  "expo-app",
82
86
  name.filesafeName,
87
+ ...(packageManager === "npm" ? ["--"] : []),
83
88
  "--template",
84
89
  `blank-typescript@${versions.expoBlankTypeScript}`,
85
90
  "--no-install",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-desktop",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Best-effort desktop support for Expo",
5
5
  "keywords": [
6
6
  "android",