peachsim 0.1.759 → 0.1.761
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/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.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/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +888 -735
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +37 -220
- 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 +37 -220
- 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/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/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.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 +1185 -1026
- package/dist-lib/swift-compile.cjs +66 -8
- package/dist-lib/swift-compile.mjs +66 -8
- package/dist-lib/swift-package.cjs +1 -110
- package/dist-lib/swift-package.mjs +1 -109
- 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 +672 -519
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/native-seam-manifest.ts +8 -0
- package/src/swift-compile.ts +102 -12
- package/src/swift-host.ts +64 -64
- package/src/swift-package-manifest.ts +307 -0
- package/src/swift-package.ts +2 -135
- package/src/swift-packages.ts +341 -0
- package/src/xcode-project.ts +57 -70
- package/src/swift-remote-packages.ts +0 -255
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
|
@@ -130,6 +130,14 @@ export const NATIVE_SEAM_MANIFEST: NativeSeamEntry[] = [
|
|
|
130
130
|
notes:
|
|
131
131
|
'iOS BGTaskScheduler / Android WorkManager TurboModule — no real scheduler in browser; acknowledge registrations, never fire periodic events',
|
|
132
132
|
},
|
|
133
|
+
{
|
|
134
|
+
pkg: 'expo',
|
|
135
|
+
// winter imports this relatively during Expo.fx, before bundle globals.
|
|
136
|
+
// use the same browser-backed native boundary as guest registry imports.
|
|
137
|
+
seamBasenames: ['FormData'],
|
|
138
|
+
target: path.resolve(HERE, '../../peach-compat/src/stubs/expo-winter-formdata.ts'),
|
|
139
|
+
notes: 'winter FormData installation on the browser-native networking boundary',
|
|
140
|
+
},
|
|
133
141
|
{
|
|
134
142
|
pkg: 'expo-apple-authentication',
|
|
135
143
|
// src/ExpoAppleAuthenticationButton.ts is the package's native-view
|
package/src/swift-compile.ts
CHANGED
|
@@ -275,19 +275,108 @@ const OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES)
|
|
|
275
275
|
const SWIFT_IMPORT =
|
|
276
276
|
/^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/
|
|
277
277
|
|
|
278
|
+
// a compilation condition as the wasm compile sees it after the source
|
|
279
|
+
// rewrite below: `os(iOS)` and `os(WASI)` hold, other platforms do not,
|
|
280
|
+
// `canImport` holds for an available module. what the scan cannot know
|
|
281
|
+
// (custom flags, swift versions, features) is undefined, three-valued
|
|
282
|
+
// through `!`, `&&` and `||`.
|
|
283
|
+
function swiftCondition(
|
|
284
|
+
text: string,
|
|
285
|
+
available: ReadonlySet<string>,
|
|
286
|
+
): boolean | undefined {
|
|
287
|
+
const tokens = text.match(/\w+\s*\([^()]*\)|&&|\|\||!|\(|\)|\w+/g) ?? []
|
|
288
|
+
let index = 0
|
|
289
|
+
const atom = (): boolean | undefined => {
|
|
290
|
+
const token = tokens[index++]
|
|
291
|
+
if (token === '!') {
|
|
292
|
+
const value = atom()
|
|
293
|
+
return value === undefined ? undefined : !value
|
|
294
|
+
}
|
|
295
|
+
if (token === '(') {
|
|
296
|
+
const value = either()
|
|
297
|
+
index++
|
|
298
|
+
return value
|
|
299
|
+
}
|
|
300
|
+
if (token === 'true') return true
|
|
301
|
+
if (token === 'false') return false
|
|
302
|
+
const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? '')
|
|
303
|
+
if (!call) return undefined
|
|
304
|
+
const [, name, argument] = call
|
|
305
|
+
if (name === 'os') return argument === 'iOS' || argument === 'WASI'
|
|
306
|
+
if (name === 'canImport') return available.has(argument!)
|
|
307
|
+
if (name === 'targetEnvironment') return false
|
|
308
|
+
if (name === 'arch') return argument === 'wasm32'
|
|
309
|
+
return undefined
|
|
310
|
+
}
|
|
311
|
+
const both = (): boolean | undefined => {
|
|
312
|
+
let value = atom()
|
|
313
|
+
while (tokens[index] === '&&') {
|
|
314
|
+
index++
|
|
315
|
+
const next = atom()
|
|
316
|
+
value = value === false || next === false ? false : value && next ? true : undefined
|
|
317
|
+
}
|
|
318
|
+
return value
|
|
319
|
+
}
|
|
320
|
+
const either = (): boolean | undefined => {
|
|
321
|
+
let value = both()
|
|
322
|
+
while (tokens[index] === '||') {
|
|
323
|
+
index++
|
|
324
|
+
const next = both()
|
|
325
|
+
value =
|
|
326
|
+
value === true || next === true
|
|
327
|
+
? true
|
|
328
|
+
: value === false && next === false
|
|
329
|
+
? false
|
|
330
|
+
: undefined
|
|
331
|
+
}
|
|
332
|
+
return value
|
|
333
|
+
}
|
|
334
|
+
return either()
|
|
335
|
+
}
|
|
336
|
+
|
|
278
337
|
/**
|
|
279
|
-
* the modules a source imports, in order. `
|
|
280
|
-
* outside every `#if
|
|
281
|
-
*
|
|
338
|
+
* the modules a source imports, in order. with `available`, only imports the
|
|
339
|
+
* wasm compile certainly reaches: those outside every `#if`, or in a branch
|
|
340
|
+
* whose condition holds there, `os(iOS)` included since the compile rewrites
|
|
341
|
+
* it to true. a branch the scan cannot decide may compile out, so its
|
|
342
|
+
* imports stay out of the list.
|
|
282
343
|
*/
|
|
283
|
-
export function swiftImportNames(
|
|
344
|
+
export function swiftImportNames(
|
|
345
|
+
contents: string,
|
|
346
|
+
available?: ReadonlySet<string>,
|
|
347
|
+
): string[] {
|
|
284
348
|
const names: string[] = []
|
|
285
|
-
|
|
349
|
+
// per open `#if`: whether its current branch is active, and whether an
|
|
350
|
+
// earlier branch was taken (or may have been)
|
|
351
|
+
const frames: { active: boolean | undefined; taken: boolean | undefined }[] = []
|
|
286
352
|
for (const line of contents.split('\n')) {
|
|
287
|
-
const directive = /^\s*#(if|endif)\b
|
|
288
|
-
if (directive
|
|
289
|
-
|
|
290
|
-
|
|
353
|
+
const directive = /^\s*#(if|elseif|else|endif)\b(.*)$/.exec(line)
|
|
354
|
+
if (directive && available) {
|
|
355
|
+
const [, kind, rest] = directive
|
|
356
|
+
const condition = (rest ?? '').replace(/\/\/.*$/, '').trim()
|
|
357
|
+
if (kind === 'if') {
|
|
358
|
+
const active = swiftCondition(condition, available)
|
|
359
|
+
frames.push({ active, taken: active })
|
|
360
|
+
} else if (kind === 'endif') frames.pop()
|
|
361
|
+
else if (frames.length > 0) {
|
|
362
|
+
const frame = frames[frames.length - 1]!
|
|
363
|
+
const holds = kind === 'else' ? true : swiftCondition(condition, available)
|
|
364
|
+
frame.active =
|
|
365
|
+
frame.taken === true
|
|
366
|
+
? false
|
|
367
|
+
: frame.taken === false
|
|
368
|
+
? holds
|
|
369
|
+
: holds && undefined
|
|
370
|
+
frame.taken =
|
|
371
|
+
frame.taken === true || holds === true
|
|
372
|
+
? true
|
|
373
|
+
: frame.taken === false
|
|
374
|
+
? holds
|
|
375
|
+
: undefined
|
|
376
|
+
}
|
|
377
|
+
continue
|
|
378
|
+
}
|
|
379
|
+
if (available && frames.some((frame) => frame.active !== true)) continue
|
|
291
380
|
const name = SWIFT_IMPORT.exec(line)?.[1]
|
|
292
381
|
if (name) names.push(name)
|
|
293
382
|
}
|
|
@@ -346,8 +435,9 @@ export function swiftAvailableModules(
|
|
|
346
435
|
}
|
|
347
436
|
|
|
348
437
|
/**
|
|
349
|
-
* the modules the sources import
|
|
350
|
-
* provides, each with the files
|
|
438
|
+
* the modules the sources certainly import (swiftImportNames with
|
|
439
|
+
* `available`) that nothing available provides, each with the files
|
|
440
|
+
* importing it. the compiler stops at the first
|
|
351
441
|
* missing module; this names all of them at once.
|
|
352
442
|
*/
|
|
353
443
|
export function missingSwiftModules(
|
|
@@ -357,7 +447,7 @@ export function missingSwiftModules(
|
|
|
357
447
|
const missing = new Map<string, string[]>()
|
|
358
448
|
for (const [file, contents] of Object.entries(files)) {
|
|
359
449
|
if (!file.endsWith('.swift') || file === 'Package.swift') continue
|
|
360
|
-
for (const name of new Set(swiftImportNames(contents,
|
|
450
|
+
for (const name of new Set(swiftImportNames(contents, available))) {
|
|
361
451
|
if (available.has(name)) continue
|
|
362
452
|
missing.set(name, [...(missing.get(name) ?? []), file])
|
|
363
453
|
}
|
package/src/swift-host.ts
CHANGED
|
@@ -24,12 +24,12 @@ import {
|
|
|
24
24
|
swiftApplicationEntry,
|
|
25
25
|
} from './swift-compile'
|
|
26
26
|
import { swiftDistributionRoot, swiftModuleToolchain } from './swift-distribution'
|
|
27
|
-
import { swiftImplicitResourcePaths,
|
|
27
|
+
import { swiftImplicitResourcePaths, type SwiftPackageTarget } from './swift-package'
|
|
28
28
|
import {
|
|
29
29
|
REMOTE_CHECKOUTS,
|
|
30
|
-
|
|
31
|
-
type
|
|
32
|
-
} from './swift-
|
|
30
|
+
resolveSwiftPackages,
|
|
31
|
+
type SwiftPackages,
|
|
32
|
+
} from './swift-packages'
|
|
33
33
|
import {
|
|
34
34
|
MAX_SWIFT_COMPILE_FILES,
|
|
35
35
|
MAX_SWIFT_COMPILE_SOURCE_BYTES,
|
|
@@ -181,7 +181,7 @@ interface XcodeProjectEntry {
|
|
|
181
181
|
target?: string
|
|
182
182
|
/** peach's own modules: a remote product named one links it, never its source. */
|
|
183
183
|
provided: ReadonlySet<string> | null
|
|
184
|
-
|
|
184
|
+
packages?: { key: string; packages: SwiftPackages }
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
const xcodeProjects = new Map<string, XcodeProjectEntry>()
|
|
@@ -207,26 +207,32 @@ export function openXcodeProject(
|
|
|
207
207
|
return root
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
//
|
|
211
|
-
function
|
|
212
|
-
|
|
210
|
+
// packages resolve once per set of linked products, pins and local manifests.
|
|
211
|
+
function swiftPackages(entry: XcodeProjectEntry, app: XcodeAppTarget): SwiftPackages {
|
|
212
|
+
const stamp = (file: string | null) =>
|
|
213
|
+
file && fs.existsSync(file) ? fs.statSync(file).mtimeMs : 0
|
|
213
214
|
const key = JSON.stringify([
|
|
214
|
-
app.
|
|
215
|
+
app.linkedProducts,
|
|
215
216
|
app.packageResolved,
|
|
216
|
-
|
|
217
|
+
stamp(app.packageResolved),
|
|
218
|
+
app.localPackageDirs.map((dir) => stamp(path.join(dir, 'Package.swift'))),
|
|
219
|
+
app.linkedProducts.map(({ source }) =>
|
|
220
|
+
source.kind === 'local' ? stamp(path.join(source.dir, 'Package.swift')) : 0,
|
|
221
|
+
),
|
|
217
222
|
])
|
|
218
|
-
if (entry.
|
|
219
|
-
entry.
|
|
223
|
+
if (entry.packages?.key !== key) {
|
|
224
|
+
entry.packages = {
|
|
220
225
|
key,
|
|
221
|
-
packages:
|
|
222
|
-
app.rootDir,
|
|
223
|
-
app.packageResolved,
|
|
224
|
-
app.
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
packages: resolveSwiftPackages({
|
|
227
|
+
rootDir: app.rootDir,
|
|
228
|
+
resolved: app.packageResolved,
|
|
229
|
+
products: app.linkedProducts,
|
|
230
|
+
localDirs: app.localPackageDirs,
|
|
231
|
+
provided: entry.provided,
|
|
232
|
+
}),
|
|
227
233
|
}
|
|
228
234
|
}
|
|
229
|
-
return entry.
|
|
235
|
+
return entry.packages.packages
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
// the app target's sources compile as one executable target under this
|
|
@@ -252,10 +258,9 @@ function xcodeInputKey(layout: XcodeLayout, file: string, relative: string): str
|
|
|
252
258
|
|
|
253
259
|
interface XcodeLayout {
|
|
254
260
|
app: XcodeAppTarget
|
|
255
|
-
/**
|
|
256
|
-
targets:
|
|
257
|
-
|
|
258
|
-
unavailable: RemotePackages['unavailable']
|
|
261
|
+
/** framework and package targets, with root-relative paths and the nested target directories they exclude. */
|
|
262
|
+
targets: (SwiftPackageTarget & { exclude: string[] })[]
|
|
263
|
+
packages: SwiftPackages
|
|
259
264
|
/** the input directory each app and framework source compiles under. */
|
|
260
265
|
targetDirs: Map<string, string>
|
|
261
266
|
files: string[]
|
|
@@ -281,56 +286,50 @@ function xcodeLayout(root: string): XcodeLayout | null {
|
|
|
281
286
|
path: dir,
|
|
282
287
|
executable: false,
|
|
283
288
|
resources: false,
|
|
289
|
+
exclude: [],
|
|
284
290
|
languageMode: framework.languageMode,
|
|
285
291
|
mainActorIsolation: framework.mainActorIsolation,
|
|
286
292
|
})
|
|
287
293
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
// only target directories: a package at a repository's root holds the
|
|
294
|
-
// whole app beside its sources
|
|
295
|
-
const declared = swiftManifestTargets(manifest).filter((target) => !target.executable)
|
|
296
|
-
const all = declared.flatMap((target) =>
|
|
297
|
-
sourceTreeFiles(path.join(dir, target.path), root).map((file) =>
|
|
298
|
-
path.relative(dir, file).split(path.sep).join(path.posix.sep),
|
|
299
|
-
),
|
|
294
|
+
const packages = swiftPackages(registered, app)
|
|
295
|
+
for (const target of packages.targets) {
|
|
296
|
+
const relative = path.relative(
|
|
297
|
+
target.remote ? path.join(root, REMOTE_CHECKOUTS) : root,
|
|
298
|
+
target.dir,
|
|
300
299
|
)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
const remote = remotePackages(registered, app)
|
|
310
|
-
for (const target of remote.targets) {
|
|
300
|
+
if (
|
|
301
|
+
relative === '..' ||
|
|
302
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
303
|
+
path.isAbsolute(relative)
|
|
304
|
+
)
|
|
305
|
+
throw new Error(`swift input escapes the selected package: ${target.dir}`)
|
|
306
|
+
const posix = relative.split(path.sep).join(path.posix.sep)
|
|
311
307
|
targets.push({
|
|
312
308
|
...target,
|
|
313
|
-
path: path.posix.join(
|
|
314
|
-
|
|
315
|
-
path
|
|
316
|
-
.relative(path.join(root, REMOTE_CHECKOUTS), target.dir)
|
|
317
|
-
.split(path.sep)
|
|
318
|
-
.join(path.posix.sep),
|
|
319
|
-
),
|
|
309
|
+
path: target.remote ? path.posix.join(XCODE_PACKAGES_DIR, posix) : posix,
|
|
310
|
+
exclude: [],
|
|
320
311
|
})
|
|
312
|
+
if (!target.remote) files.add(path.join(target.packageDir, 'Package.swift'))
|
|
321
313
|
for (const file of target.files) files.add(file)
|
|
322
314
|
}
|
|
315
|
+
// swiftpm assigns a file to one target: a target directory nested in
|
|
316
|
+
// another's is that one's exclusion
|
|
317
|
+
for (const target of targets) {
|
|
318
|
+
target.exclude = targets
|
|
319
|
+
.filter((other) => other.path.startsWith(`${target.path}/`))
|
|
320
|
+
.map((other) => other.path.slice(target.path.length + 1))
|
|
321
|
+
}
|
|
323
322
|
return {
|
|
324
323
|
app,
|
|
325
324
|
targets,
|
|
326
|
-
|
|
325
|
+
packages,
|
|
327
326
|
targetDirs,
|
|
328
327
|
files: [...files].sort(),
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
330
|
|
|
332
331
|
// the manifest the compile reads for an xcode app: the app target and each
|
|
333
|
-
//
|
|
332
|
+
// framework and package target, in the forms swiftManifestTargets scans.
|
|
334
333
|
function xcodeManifest(layout: XcodeLayout): string {
|
|
335
334
|
const settings = (mode: number, mainActor: boolean) =>
|
|
336
335
|
`swiftSettings: [.swiftLanguageMode(.v${mode})${mainActor ? ', .defaultIsolation(MainActor.self)' : ''}]`
|
|
@@ -341,7 +340,7 @@ function xcodeManifest(layout: XcodeLayout): string {
|
|
|
341
340
|
` .executableTarget(name: "${layout.app.moduleName}", path: "${XCODE_APP_DIR}", ${settings(layout.app.languageMode, layout.app.mainActorIsolation)}),`,
|
|
342
341
|
...layout.targets.map(
|
|
343
342
|
(target) =>
|
|
344
|
-
` .target(name: "${target.name}", path: "${target.path}", ${target.resources ? 'resources: [], ' : ''}${settings(target.languageMode, target.mainActorIsolation)}),`,
|
|
343
|
+
` .target(name: "${target.name}", path: "${target.path}", ${target.exclude.length > 0 ? `exclude: ${JSON.stringify(target.exclude)}, ` : ''}${target.resources ? 'resources: [], ' : ''}${settings(target.languageMode, target.mainActorIsolation)}),`,
|
|
345
344
|
),
|
|
346
345
|
'])',
|
|
347
346
|
'',
|
|
@@ -941,19 +940,20 @@ function missingModulesMessage(
|
|
|
941
940
|
missing: Map<string, string[]>,
|
|
942
941
|
): string {
|
|
943
942
|
const layout = xcodeLayout(packagePath)
|
|
944
|
-
const
|
|
945
|
-
(layout?.app.
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
943
|
+
const gaps = new Map([
|
|
944
|
+
...(layout?.app.binaryFrameworks ?? []).map(
|
|
945
|
+
(name) =>
|
|
946
|
+
[name, { source: 'the project', reason: 'a vendored binary framework' }] as const,
|
|
947
|
+
),
|
|
948
|
+
...(layout?.packages.modules ?? []),
|
|
949
|
+
...(layout?.packages.unavailable ?? []),
|
|
950
|
+
])
|
|
950
951
|
const width = Math.max(...[...missing.keys()].map((name) => name.length))
|
|
951
952
|
return [
|
|
952
953
|
`Peach does not provide ${missing.size} module${missing.size === 1 ? '' : 's'} this app imports:`,
|
|
953
954
|
...[...missing].map(([name, files]) => {
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
return ` ${name.padEnd(width)} ${files.length} file${files.length === 1 ? '' : 's'}${source ? `, package ${source}` : ''}${reason ? ` (${reason})` : ''}`
|
|
955
|
+
const gap = gaps.get(name)
|
|
956
|
+
return ` ${name.padEnd(width)} ${files.length} file${files.length === 1 ? '' : 's'}${gap ? `, ${gap.source.includes('://') ? `package ${gap.source}` : gap.source.startsWith('/') ? `package ${path.relative(packagePath, gap.source) || '.'}` : gap.source} (${gap.reason})` : ''}`
|
|
957
957
|
}),
|
|
958
958
|
].join('\n')
|
|
959
959
|
}
|