expo-desktop 1.0.3 → 1.0.5
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.
|
@@ -23,10 +23,10 @@ export async function testPortAsync(port, hostnames) {
|
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
if (
|
|
26
|
+
// A wildcard bind can succeed while an existing listener on another address
|
|
27
|
+
// still owns the same port. Confirm against the OS listener table on every
|
|
28
|
+
// platform so loopback and wildcard listeners are both detected.
|
|
29
|
+
if ((await getPID(port)) !== null) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
return true;
|
|
@@ -12,7 +12,7 @@ export async function getPID(port) {
|
|
|
12
12
|
return getWindowsPIDAsync(port);
|
|
13
13
|
}
|
|
14
14
|
try {
|
|
15
|
-
const { stdout } = await spawnAsync("lsof", [`-
|
|
15
|
+
const { stdout } = await spawnAsync("lsof", [`-iTCP:${port}`, "-nP", "-t", "-sTCP:LISTEN"], {
|
|
16
16
|
timeout,
|
|
17
17
|
});
|
|
18
18
|
const pid = Number(stdout.split("\n", 1)[0].trim());
|
|
@@ -30,7 +30,9 @@ export async function getPID(port) {
|
|
|
30
30
|
/** Return the PID listening on a TCP port on Windows. */
|
|
31
31
|
async function getWindowsPIDAsync(port) {
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
// `-p tcp` excludes IPv6 listeners on Windows, including Metro on ::1.
|
|
34
|
+
// Inspect both address families and filter the TCP rows below.
|
|
35
|
+
const { stdout } = await spawnAsync("netstat.exe", ["-ano"], {
|
|
34
36
|
timeout,
|
|
35
37
|
});
|
|
36
38
|
for (const line of stdout.split(/\r?\n/)) {
|
|
@@ -101,6 +101,10 @@ export async function installDependenciesAsync(projectRoot, packageManager, flag
|
|
|
101
101
|
export async function configurePackageManager(projectRoot, packageManager, flags = { silent: false }) {
|
|
102
102
|
const manager = createPackageManager(packageManager, { cwd: projectRoot, ...flags });
|
|
103
103
|
switch (manager.name) {
|
|
104
|
+
case "pnpm": {
|
|
105
|
+
await manager.runAsync(['config', '--location', 'project', 'set', 'node-linker', 'hoisted']);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
104
108
|
case "yarn": {
|
|
105
109
|
let yarnVersion;
|
|
106
110
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-desktop",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Best-effort desktop support for Expo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"generate-config": "node scripts/generate-config.ts",
|
|
95
95
|
"schema": "node scripts/update-schema.ts",
|
|
96
96
|
"start": "node src/cli.ts",
|
|
97
|
-
"demo": "npm_config_user_agent=bun node --run start -- create-app --template ../../templates/blank-typescript/expo-desktop-template-blank-typescript-
|
|
97
|
+
"demo": "npm_config_user_agent=bun node --run start -- create-app --template ../../templates/blank-typescript/expo-desktop-template-blank-typescript-55.83.1.tgz",
|
|
98
98
|
"test": "vitest run"
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -78,7 +78,13 @@ function run(argv) {
|
|
|
78
78
|
|
|
79
79
|
updateTerminatedProcessIds(workspace);
|
|
80
80
|
if (terminatedProcessIds.size < processIds.size) {
|
|
81
|
-
|
|
81
|
+
if (terminationTimeoutSeconds === 0) {
|
|
82
|
+
// Zero means no timeout here; CFRunLoopRunInMode(..., 0, ...) only runs once.
|
|
83
|
+
// The observer stops this loop when every matching app has exited.
|
|
84
|
+
$.CFRunLoopRun();
|
|
85
|
+
} else {
|
|
86
|
+
$.CFRunLoopRunInMode($.kCFRunLoopDefaultMode, terminationTimeoutSeconds, false);
|
|
87
|
+
}
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
workspace.removeObserverForKeyPath(observer, "runningApplications");
|