peachsim 0.1.1902 → 0.1.1905
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/cli/commands/record.ts +78 -43
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +97 -40
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -1
- package/dist-lib/cloud-contract.mjs +2 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -1
- package/dist-lib/cloud.mjs +2 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +3 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +91 -34
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +98 -40
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +4 -3
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +3 -3
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +99 -41
- package/dist-lib/swift-compile.cjs +31 -18
- package/dist-lib/swift-compile.mjs +30 -18
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +30 -20
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/fiber-debug-metadata.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/usr/include/darwin.modulemap +430 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/src/bridge-contract.ts +25 -0
- package/src/cloud-contract.ts +1 -0
- package/src/expo-native-workspace.ts +31 -3
- package/src/expo-swift-host.ts +18 -8
- package/src/expo-workspace-exclusion.ts +15 -1
- package/src/nitro-adapter.lock.json +400 -1360
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-compile.ts +14 -14
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-host.ts +2 -1
- package/src/swift-shared-sdk.ts +12 -7
- package/src/swift-wasm-prune.ts +9 -1
- package/src/turbo-runtime.lock.json +20 -48
- package/src/workspace-root.ts +31 -7
package/src/swift-compile.ts
CHANGED
|
@@ -1539,7 +1539,7 @@ const SWIFT_HEADER_PRODUCTS_TARGET = 'PeachHeaderProducts'
|
|
|
1539
1539
|
|
|
1540
1540
|
// build-cli replaces this in every bundle; source runs read the files directly.
|
|
1541
1541
|
declare const __SWIFT_COMPILER_DIGEST__: string | undefined
|
|
1542
|
-
const compilerSourceDigest =
|
|
1542
|
+
export const compilerSourceDigest =
|
|
1543
1543
|
typeof __SWIFT_COMPILER_DIGEST__ === 'string'
|
|
1544
1544
|
? __SWIFT_COMPILER_DIGEST__
|
|
1545
1545
|
: swiftCompilerSourceDigest(import.meta.dirname)
|
|
@@ -1747,8 +1747,6 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1747
1747
|
* then links only the stdlib and system archives its sources reference.
|
|
1748
1748
|
*/
|
|
1749
1749
|
distributionLink?: { path: string; files: Map<string, string | Buffer> }
|
|
1750
|
-
/** link the distribution as an archive pruned after the link: size-optimized artifacts only. */
|
|
1751
|
-
lazyDistribution?: boolean
|
|
1752
1750
|
/**
|
|
1753
1751
|
* framework products already built in their own scratch. objects link whole,
|
|
1754
1752
|
* and modules import from that scratch, so this package's targets never
|
|
@@ -1811,11 +1809,9 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1811
1809
|
foundationCategoryObjects.map((name) => `lib/Foundation-${name}.o`),
|
|
1812
1810
|
)
|
|
1813
1811
|
const roots = swiftObjcRootObjects(distribution.id, moduleRoot, distribution.objects)
|
|
1814
|
-
const eager =
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
)
|
|
1818
|
-
: new Set(objects)
|
|
1812
|
+
const eager = new Set(
|
|
1813
|
+
objects.filter((object) => roots.has(object) || categoryObjects.has(object)),
|
|
1814
|
+
)
|
|
1819
1815
|
// native headers can reference a framework without a Swift import, and a
|
|
1820
1816
|
// native target can share a module name with distribution Swift helpers.
|
|
1821
1817
|
// retain those objects in the archive so undefined symbols select them.
|
|
@@ -5698,7 +5694,6 @@ export function writeSwiftProject(
|
|
|
5698
5694
|
path: path.join(layout.root, '.peach-distribution-objects.rsp'),
|
|
5699
5695
|
files,
|
|
5700
5696
|
},
|
|
5701
|
-
lazyDistribution: input.optimize,
|
|
5702
5697
|
}
|
|
5703
5698
|
: {}),
|
|
5704
5699
|
...(prebuilt && frameworkLink
|
|
@@ -6515,9 +6510,14 @@ async function buildFrameworkProducts(
|
|
|
6515
6510
|
objects.push(object)
|
|
6516
6511
|
linked.owners.set(object, 'Foundation')
|
|
6517
6512
|
}
|
|
6518
|
-
// the providers compile from this revision's source
|
|
6513
|
+
// the providers compile from this revision's source; a slot that moved to
|
|
6514
|
+
// another revision rebuilds them
|
|
6519
6515
|
const providerDir = path.join(scratch, 'darwin-records')
|
|
6520
|
-
|
|
6516
|
+
const providerStamp = path.join(providerDir, '.complete')
|
|
6517
|
+
if (
|
|
6518
|
+
!existsSync(providerStamp) ||
|
|
6519
|
+
readFileSync(providerStamp, 'utf8') !== args.frameworkKey
|
|
6520
|
+
) {
|
|
6521
6521
|
rmSync(providerDir, { recursive: true, force: true })
|
|
6522
6522
|
mkdirSync(providerDir)
|
|
6523
6523
|
const sdkPaths = swiftSdkPaths(args.moduleRoot, args.toolchainBin)
|
|
@@ -6529,7 +6529,7 @@ async function buildFrameworkProducts(
|
|
|
6529
6529
|
minimum: darwinRecordsMinimum(),
|
|
6530
6530
|
out: providerDir,
|
|
6531
6531
|
})
|
|
6532
|
-
writeFileSync(
|
|
6532
|
+
writeFileSync(providerStamp, args.frameworkKey)
|
|
6533
6533
|
}
|
|
6534
6534
|
const providers = readdirSync(providerDir)
|
|
6535
6535
|
.filter((file) => file.endsWith('.o'))
|
|
@@ -6926,7 +6926,7 @@ function compileSwiftProjectOnce(
|
|
|
6926
6926
|
.join(':'),
|
|
6927
6927
|
}
|
|
6928
6928
|
: {}),
|
|
6929
|
-
|
|
6929
|
+
PEACH_DEFER_WASM_LINK: '1',
|
|
6930
6930
|
},
|
|
6931
6931
|
maxBuffer: 64 * 1024 * 1024,
|
|
6932
6932
|
timeout: options.timeoutMs,
|
|
@@ -7202,7 +7202,7 @@ function compileSwiftProjectOnce(
|
|
|
7202
7202
|
}
|
|
7203
7203
|
if (options.project) removeProjectLinks(root)
|
|
7204
7204
|
// the guest link prunes and links the response file itself.
|
|
7205
|
-
if (
|
|
7205
|
+
if (!guestGraph)
|
|
7206
7206
|
pruneSwiftWasmLink(
|
|
7207
7207
|
root,
|
|
7208
7208
|
options.toolchainBin,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "5b877d1f76e5632c",
|
|
3
3
|
"release": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
|
|
4
|
-
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-
|
|
5
|
-
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-
|
|
6
|
-
"wasmSdkChecksum": "
|
|
7
|
-
"source": "
|
|
4
|
+
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-5d19b8c2",
|
|
5
|
+
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-5d19b8c2.artifactbundle.tar.gz",
|
|
6
|
+
"wasmSdkChecksum": "126c1ffe1333693500bf20fd4636ef875763219ddd01eda44739e4d0507b982b",
|
|
7
|
+
"source": "66933eae0596429b7e226afed62a3378bfeeaaa5",
|
|
8
8
|
"targets": [
|
|
9
9
|
"ImagePlayground",
|
|
10
10
|
"QuickLookThumbnailing",
|
|
@@ -231,16 +231,16 @@
|
|
|
231
231
|
},
|
|
232
232
|
"hosts": {
|
|
233
233
|
"darwin-arm64": {
|
|
234
|
-
"sha256": "
|
|
235
|
-
"size":
|
|
234
|
+
"sha256": "e7deb164da91f1db28e61446222c55307cc72205b6cebc09c8fa6ba3d8c6ebaa",
|
|
235
|
+
"size": 99291577
|
|
236
236
|
},
|
|
237
237
|
"linux-x64": {
|
|
238
|
-
"sha256": "
|
|
239
|
-
"size":
|
|
238
|
+
"sha256": "539f08f19e935db924207a9bbf9dc3d078918d00d5fcc6978c0a96de34d2de08",
|
|
239
|
+
"size": 102010416
|
|
240
240
|
},
|
|
241
241
|
"linux-arm64": {
|
|
242
|
-
"sha256": "
|
|
243
|
-
"size":
|
|
242
|
+
"sha256": "618d3171b5a2d005e35024512666650c714129a89cdcfdd48be034cd7e124074",
|
|
243
|
+
"size": 101501579
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
package/src/swift-host.ts
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
swiftCPredefines,
|
|
41
41
|
swiftDistributionAt,
|
|
42
42
|
swiftOptionalFramework,
|
|
43
|
+
compilerSourceDigest,
|
|
43
44
|
} from './swift-compile'
|
|
44
45
|
import {
|
|
45
46
|
assetSymbolText,
|
|
@@ -1575,7 +1576,6 @@ function sourceTreeFiles(dir: string, canonicalRoot: string): string[] {
|
|
|
1575
1576
|
walk(full)
|
|
1576
1577
|
} else if (stat.isFile()) {
|
|
1577
1578
|
found.push(full)
|
|
1578
|
-
if (found.length > 4096) throw new Error('swift package exceeds 4096 input files')
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
1581
|
ancestors.delete(realDirectory)
|
|
@@ -2201,6 +2201,7 @@ export function sourceContentStamp(
|
|
|
2201
2201
|
moduleRootOverride?: string,
|
|
2202
2202
|
): string {
|
|
2203
2203
|
const hash = createHash('sha256')
|
|
2204
|
+
hash.update(compilerSourceDigest)
|
|
2204
2205
|
hash.update(JSON.stringify(xcodeProjects().get(packagePath)?.behavior ?? {}))
|
|
2205
2206
|
const libraries = projects().get(packagePath)?.libraries
|
|
2206
2207
|
if (libraries) hash.update(JSON.stringify(libraries))
|
package/src/swift-shared-sdk.ts
CHANGED
|
@@ -260,7 +260,7 @@ export function swiftSharedSdkViewOptions(
|
|
|
260
260
|
.map((entry) => path.join(entry.parentPath, entry.name))
|
|
261
261
|
.sort()
|
|
262
262
|
const key = JSON.stringify([
|
|
263
|
-
'
|
|
263
|
+
'v18',
|
|
264
264
|
toolchainBin,
|
|
265
265
|
sdk,
|
|
266
266
|
frameworks,
|
|
@@ -312,12 +312,17 @@ export function swiftSharedSdkViewOptions(
|
|
|
312
312
|
// IFF_* flags and if_indextoname that native packages compile against.
|
|
313
313
|
const overrides = new Map<string, string>([
|
|
314
314
|
[path.join(sysroot, 'darwin/System/Library/Frameworks'), frameworks],
|
|
315
|
-
...[
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
...[
|
|
316
|
+
'MacTypes.h',
|
|
317
|
+
'net/if.h',
|
|
318
|
+
'notify.h',
|
|
319
|
+
'notify.modulemap',
|
|
320
|
+
'module.modulemap',
|
|
321
|
+
'darwin.modulemap',
|
|
322
|
+
].map((header): [string, string] => [
|
|
323
|
+
path.join(sysroot, 'darwin/usr/include', header),
|
|
324
|
+
path.join(swiftSharedSdkRoot(moduleRoot, distribution), 'usr/include', header),
|
|
325
|
+
]),
|
|
321
326
|
])
|
|
322
327
|
// preserve bundle-only support headers while taking the shared darwin
|
|
323
328
|
// overlays from the same owner as the framework declarations.
|
package/src/swift-wasm-prune.ts
CHANGED
|
@@ -1171,6 +1171,10 @@ export function pruneSwiftWasmLink(
|
|
|
1171
1171
|
} else {
|
|
1172
1172
|
eagerFiles.push(t)
|
|
1173
1173
|
}
|
|
1174
|
+
} else {
|
|
1175
|
+
// an archive region of build objects, such as source-built darwin
|
|
1176
|
+
// record providers, links lazily ahead of the sdk archive they override.
|
|
1177
|
+
lazyBuildObjects.set(t, parseWasmObjectCached(t, false, false))
|
|
1174
1178
|
}
|
|
1175
1179
|
} else if (
|
|
1176
1180
|
!inStartLib &&
|
|
@@ -2088,7 +2092,11 @@ export function pruneSwiftWasmLink(
|
|
|
2088
2092
|
outTokens.push('--end-lib')
|
|
2089
2093
|
continue
|
|
2090
2094
|
}
|
|
2091
|
-
if (inStartLib)
|
|
2095
|
+
if (inStartLib) {
|
|
2096
|
+
if (lazyBuildObjects.has(t) && extractedObjs.has(lazyBuildObjects.get(t)!))
|
|
2097
|
+
outTokens.push(t)
|
|
2098
|
+
continue
|
|
2099
|
+
}
|
|
2092
2100
|
if (lazyBuildObjects.has(t)) {
|
|
2093
2101
|
if (extractedObjs.has(lazyBuildObjects.get(t)!)) outTokens.push(t)
|
|
2094
2102
|
} else if (t === swiftrtOrigPath && patchedSwiftrtPath) {
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"compiler": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
|
|
10
10
|
"sdk": {
|
|
11
|
-
"id": "swift-6.4.0-RELEASE_wasm-peach-
|
|
12
|
-
"checksum": "
|
|
11
|
+
"id": "swift-6.4.0-RELEASE_wasm-peach-5d19b8c2",
|
|
12
|
+
"checksum": "126c1ffe1333693500bf20fd4636ef875763219ddd01eda44739e4d0507b982b"
|
|
13
13
|
},
|
|
14
14
|
"framework": {
|
|
15
|
-
"distribution": "
|
|
15
|
+
"distribution": "5b877d1f76e5632c",
|
|
16
16
|
"wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
|
|
17
17
|
},
|
|
18
18
|
"archives": [
|
|
@@ -20,99 +20,71 @@
|
|
|
20
20
|
"headers": {
|
|
21
21
|
"reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
|
|
22
22
|
},
|
|
23
|
-
"sha256": "
|
|
23
|
+
"sha256": "b7b687d712180e51c13ca264a4ca6419ed5905f80daba8eef846ce9cc8a43b9e",
|
|
24
24
|
"size": 25397
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"headers": {
|
|
28
28
|
"reactNativeJsi": "21a624ea24fd17d56bf26832d496fc1177067f89640414c20e6486c7984dfb0a"
|
|
29
29
|
},
|
|
30
|
-
"sha256": "
|
|
31
|
-
"size":
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"headers": {
|
|
35
|
-
"reactNativeJsi": "253c4370ac99834de15e5e693d98675d1fcb985929be9c2334cac1cfdc53b1c8"
|
|
36
|
-
},
|
|
37
|
-
"sha256": "6b9a17fdb01d68f95b2624183a2e6f96572e9992cd3f9ff4af866f95327e45d5",
|
|
38
|
-
"size": 25185
|
|
30
|
+
"sha256": "59a5f9a42a8bd6d071601a2a6f22884aee93aefffd750ebc7d26011fbc3700d3",
|
|
31
|
+
"size": 26142
|
|
39
32
|
},
|
|
40
33
|
{
|
|
41
34
|
"headers": {
|
|
42
35
|
"reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
|
|
43
36
|
},
|
|
44
|
-
"sha256": "
|
|
45
|
-
"size":
|
|
37
|
+
"sha256": "313efb2b9c8c07a9437297022ddab5498b9fbb1e15913ac8275847284ca29bf0",
|
|
38
|
+
"size": 25400
|
|
46
39
|
},
|
|
47
40
|
{
|
|
48
41
|
"headers": {
|
|
49
42
|
"reactNativeJsi": "33596664ee7d7a6623f0796a6feb429543316c3a41b211150acda6e1d835286c"
|
|
50
43
|
},
|
|
51
|
-
"sha256": "
|
|
52
|
-
"size":
|
|
44
|
+
"sha256": "79cc33e915390266e1b5616ebd11bb87cb042be5c1ff9f66d0f7e06a5507ca70",
|
|
45
|
+
"size": 25171
|
|
53
46
|
},
|
|
54
47
|
{
|
|
55
48
|
"headers": {
|
|
56
49
|
"reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
|
|
57
50
|
},
|
|
58
|
-
"sha256": "
|
|
59
|
-
"size":
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"headers": {
|
|
63
|
-
"reactNativeJsi": "72f7c28bb4efe1266c3d10a030b02bb01b8907bc9322e5993ce41ebd950a381b"
|
|
64
|
-
},
|
|
65
|
-
"sha256": "59429c49aee7ab4e4536e2941423590bbeddaea210289f4642eee1a8b16cab01",
|
|
66
|
-
"size": 25186
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"headers": {
|
|
70
|
-
"reactNativeJsi": "92d95409cae874b4705931e94c48e89e2b5188f82f51bb69de790604e4bdf1f6"
|
|
71
|
-
},
|
|
72
|
-
"sha256": "b93158b2b6cab97515d3d2fac6897a8a5e37ab1fd891f1b4c253ee0e7297bd40",
|
|
73
|
-
"size": 25190
|
|
51
|
+
"sha256": "ac01f2f3e42d725ade0c4b146c7d001a31b375a249ad212932d7400496d7704a",
|
|
52
|
+
"size": 25397
|
|
74
53
|
},
|
|
75
54
|
{
|
|
76
55
|
"headers": {
|
|
77
56
|
"reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
|
|
78
57
|
},
|
|
79
|
-
"sha256": "
|
|
58
|
+
"sha256": "9efac07541cac3df7749d9e818d1903172a633e603f5b5cada291107e8ba629a",
|
|
80
59
|
"size": 26142
|
|
81
60
|
},
|
|
82
61
|
{
|
|
83
62
|
"headers": {
|
|
84
63
|
"reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
|
|
85
64
|
},
|
|
86
|
-
"sha256": "
|
|
87
|
-
"size":
|
|
65
|
+
"sha256": "e3661c6c2f4e910e2effb2790c2352b1c17ca715e151e30706a26b63f2e81164",
|
|
66
|
+
"size": 26141
|
|
88
67
|
},
|
|
89
68
|
{
|
|
90
69
|
"headers": {
|
|
91
70
|
"reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
|
|
92
71
|
},
|
|
93
|
-
"sha256": "
|
|
94
|
-
"size":
|
|
72
|
+
"sha256": "0fb09a0aefaedcf5a3615c3d16ef5887493724f565ac1b4558ad95992fdc65c2",
|
|
73
|
+
"size": 25270
|
|
95
74
|
},
|
|
96
75
|
{
|
|
97
76
|
"headers": {
|
|
98
77
|
"reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
|
|
99
78
|
},
|
|
100
|
-
"sha256": "
|
|
79
|
+
"sha256": "5e399d924b76337831060b8efeea41c9dd96161b4fc97831d76f8320255a289b",
|
|
101
80
|
"size": 26145
|
|
102
81
|
},
|
|
103
82
|
{
|
|
104
83
|
"headers": {
|
|
105
84
|
"reactNativeJsi": "c8270f1315745ecc204c4209a4f50f58ff6f14b4a385ad6820a69800270b53c6"
|
|
106
85
|
},
|
|
107
|
-
"sha256": "
|
|
108
|
-
"size":
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"headers": {
|
|
112
|
-
"reactNativeJsi": "e986ff3c1eb684aa954f75fe5944e7e1a7867318684557ea113a1aa14c84ff4c"
|
|
113
|
-
},
|
|
114
|
-
"sha256": "eff53af48010757fddb321d2be9a4c7e5a5f665804e0e598caaebac951be5095",
|
|
115
|
-
"size": 24915
|
|
86
|
+
"sha256": "784131eff39d4a98341918c993959c871c728afbfbcbe330796c4cadb6b07aa8",
|
|
87
|
+
"size": 25109
|
|
116
88
|
}
|
|
117
89
|
]
|
|
118
90
|
}
|
package/src/workspace-root.ts
CHANGED
|
@@ -2,14 +2,38 @@ import fs from 'node:fs'
|
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
|
|
4
4
|
// the nearest ancestor holding a workspace or lock file, else the app itself
|
|
5
|
+
const LOCKFILES = ['pnpm-workspace.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock']
|
|
6
|
+
|
|
7
|
+
function declaresMember(root: string, app: string) {
|
|
8
|
+
const manifest = path.join(root, 'package.json')
|
|
9
|
+
if (!fs.existsSync(manifest)) return false
|
|
10
|
+
const { workspaces } = JSON.parse(fs.readFileSync(manifest, 'utf8'))
|
|
11
|
+
const patterns: string[] = Array.isArray(workspaces)
|
|
12
|
+
? workspaces
|
|
13
|
+
: (workspaces?.packages ?? [])
|
|
14
|
+
const relative = path.relative(root, app).split(path.sep).join('/')
|
|
15
|
+
return patterns.some((pattern) =>
|
|
16
|
+
new RegExp(
|
|
17
|
+
`^${path.posix
|
|
18
|
+
.normalize(pattern)
|
|
19
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
20
|
+
.replace(/\*\*/g, '\0')
|
|
21
|
+
.replace(/\*/g, '[^/]*')
|
|
22
|
+
.replace(/\0/g, '.*')}$`,
|
|
23
|
+
).test(relative),
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// the nearest lockfile names the install root unless a higher root's workspaces
|
|
28
|
+
// list the app, as a nested workspace root inside a larger monorepo does
|
|
5
29
|
export function findWorkspaceRoot(app: string): string {
|
|
30
|
+
let nearest: string | null = null
|
|
31
|
+
let declared: string | null = null
|
|
6
32
|
for (let dir = app; ; dir = path.dirname(dir)) {
|
|
7
|
-
if (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
return dir
|
|
13
|
-
if (path.dirname(dir) === dir) return app
|
|
33
|
+
if (LOCKFILES.some((name) => fs.existsSync(path.join(dir, name)))) {
|
|
34
|
+
nearest ??= dir
|
|
35
|
+
if (dir !== app && declaresMember(dir, app)) declared = dir
|
|
36
|
+
}
|
|
37
|
+
if (path.dirname(dir) === dir) return declared ?? nearest ?? app
|
|
14
38
|
}
|
|
15
39
|
}
|