expo-desktop 1.0.0-beta.8 → 1.0.0

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/build/cli.js CHANGED
@@ -141,9 +141,10 @@ const main = defineCommand({
141
141
  type: "boolean",
142
142
  description: "Skip starting the Metro bundler",
143
143
  },
144
- "no-background": {
144
+ background: {
145
145
  type: "boolean",
146
- description: "Launch the macOS app in the foreground",
146
+ description: "Launch the macOS app in the background instead of the foreground",
147
+ default: false,
147
148
  },
148
149
  "no-single-instance": {
149
150
  type: "boolean",
@@ -180,7 +181,6 @@ const main = defineCommand({
180
181
  parseNoArg(args, "no-build-cache");
181
182
  parseNoArg(args, "no-install");
182
183
  parseNoArg(args, "no-bundler");
183
- parseNoArg(args, "no-background");
184
184
  parseNoArg(args, "no-single-instance");
185
185
  (await import("./run/macos/command.js")).run(args);
186
186
  },
@@ -21,7 +21,7 @@ import { env } from "./env.js";
21
21
  import { downloadAndExtractGitHubRepositoryAsync } from "./github.js";
22
22
  import { Log } from "./log.js";
23
23
  import { applyBetaTag, applyKnownNpmPackageNameRules, downloadAndExtractNpmModuleAsync, getResolvedTemplateName, } from "./npm.js";
24
- import { formatRunCommand, formatSelfCommand } from "./resolve-package-manager.js";
24
+ import { formatRunCommand } from "./resolve-package-manager.js";
25
25
  import * as Template from "./template.js";
26
26
  const require = createRequire(import.meta.url);
27
27
  const JsonFile = require("@expo/json-file").default;
@@ -637,7 +637,7 @@ export function logProjectReady({ cdPath, packageManager, }) {
637
637
  console.log(`Before you can run desktop platforms (with ${exampleMacos} or ${exampleWindows}), you need to generate a ${chalk.bold("development build")} as follows:`);
638
638
  console.log();
639
639
  }
640
- console.log(`${cdPath ? "- " : ""}${chalk.bold(`${formatSelfCommand(packageManager)} prebuild`)} `);
640
+ console.log(`${cdPath ? "- " : ""}${chalk.bold(`node --run prebuild`)} `);
641
641
  // console.log(`- ${chalk.bold(formatRunCommand(packageManager, "android"))}`);
642
642
  // const iOSComment = isMacOS
643
643
  // ? ""
@@ -80,7 +80,7 @@ export async function cloneTemplateAndCopyToProjectAsync({ projectRoot, template
80
80
  // On subsequent prebuilds, the same properties get updated via config
81
81
  // plugins (by modifying the XML trees of the wapproj, vcxproj,
82
82
  // appxManifest, sln, etc.) in withExpoDesktop().
83
- // packages/expo-desktop-config-plugins/src/plugins/with-expo-desktop.js
83
+ // packages/expo-desktop-config-plugins/src/plugins/with-expo/with-expo-desktop.js
84
84
  const windowsTemplateStrings = getWindowsTemplateStrings({
85
85
  name,
86
86
  packageGuid,
@@ -14,7 +14,7 @@ export async function run(args) {
14
14
  install: !args["no-install"],
15
15
  buildCache: !args["no-build-cache"],
16
16
  bundler: !args["no-bundler"],
17
- background: !args["no-background"],
17
+ background: args.background ?? false,
18
18
  singleInstance: !args["no-single-instance"],
19
19
  ...(args.scheme !== undefined ? { scheme: args.scheme } : {}),
20
20
  ...(args.binary !== undefined ? { binary: args.binary } : {}),
@@ -12,9 +12,6 @@ export async function launchAppAsync(binaryPath, _manager, props) {
12
12
  if (props.device.osType !== "macOS") {
13
13
  throw new Error("Unexpected non-macOS device while launching a macOS app.");
14
14
  }
15
- if (props.singleInstance) {
16
- await waitForExistingInstancesToTerminateAsync(props.bundleId);
17
- }
18
15
  const args = [
19
16
  ...(props.background ? ["--background"] : []),
20
17
  ...(!props.singleInstance ? ["--new"] : []),
@@ -33,7 +30,7 @@ export async function launchAppAsync(binaryPath, _manager, props) {
33
30
  throw error;
34
31
  }
35
32
  }
36
- async function waitForExistingInstancesToTerminateAsync(bundleId) {
33
+ export async function waitForExistingInstancesToTerminateAsync(bundleId) {
37
34
  const scriptPath = fileURLToPath(new URL("../../../scripts/terminateApp.jxa.js", import.meta.url));
38
35
  const spinner = ora(`waiting for app ${bundleId} to terminate...`).start();
39
36
  try {
@@ -15,7 +15,7 @@ import { ensureNativeProjectAsync } from "./ensureNativeProject.js";
15
15
  import { resolveBuildCache, uploadBuildCache, } from "./expo/build-cache-providers/build-cache-providers.js";
16
16
  import { exportEagerAsync } from "./expo/exportEager.js";
17
17
  import { getSchemesForMacosAsync } from "./expo/scheme.js";
18
- import { getLaunchInfoForBinaryAsync, launchAppAsync } from "./launchApp.js";
18
+ import { getLaunchInfoForBinaryAsync, launchAppAsync, waitForExistingInstancesToTerminateAsync, } from "./launchApp.js";
19
19
  import { resolveOptionsAsync } from "./options/resolveOptions.js";
20
20
  import * as XcodeBuild from "./XcodeBuild.js";
21
21
  export async function runMacosAsync(projectRoot, options) {
@@ -119,6 +119,11 @@ export async function runMacosAsync(projectRoot, options) {
119
119
  }
120
120
  const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);
121
121
  const isCustomBinary = !!options.binary;
122
+ const singleInstance = options.singleInstance ?? true;
123
+ // Finish the termination spinner before Metro takes over terminal output.
124
+ if (singleInstance) {
125
+ await waitForExistingInstancesToTerminateAsync(launchInfo.bundleId);
126
+ }
122
127
  // Start the dev server which creates all of the required info for launching
123
128
  // the app on the host device.
124
129
  const manager = await startBundlerAsync(projectRoot, {
@@ -137,9 +142,8 @@ export async function runMacosAsync(projectRoot, options) {
137
142
  isSimulator: false,
138
143
  device: props.device,
139
144
  shouldStartBundler: props.shouldStartBundler,
140
- background: options.background ?? true,
141
- singleInstance: options.singleInstance ?? true,
142
- bundleId: launchInfo.bundleId,
145
+ background: options.background ?? false,
146
+ singleInstance,
143
147
  });
144
148
  // Log the location of the JS logs for the host device.
145
149
  if (props.shouldStartBundler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-desktop",
3
- "version": "1.0.0-beta.8",
3
+ "version": "1.0.0",
4
4
  "description": "Best-effort desktop support for Expo",
5
5
  "keywords": [
6
6
  "android",
@@ -52,8 +52,8 @@
52
52
  "chalk": "^4.1.2",
53
53
  "citty": "^0.2.2",
54
54
  "debug": "^4.4.3",
55
- "expo-desktop-config-plugins": "^1.2.0-beta.1",
56
- "expo-desktop-prebuild-config": "^1.1.0-beta.2",
55
+ "expo-desktop-config-plugins": "^1.2.0",
56
+ "expo-desktop-prebuild-config": "^1.1.0",
57
57
  "getenv": "^2.0.0",
58
58
  "glob": "^10.5.0",
59
59
  "kleur": "^4.1.5",