peachsim 0.1.2302 → 0.1.2303

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.
Files changed (89) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +124 -23
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +123 -22
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +124 -23
  31. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +3 -3
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +3 -3
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +124 -23
  68. package/dist-lib/swift-compile.cjs +3 -17
  69. package/dist-lib/swift-compile.mjs +3 -16
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +75 -18
  77. package/dist-lib/vite.cjs +3 -3
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +5 -20
  81. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -0
  82. package/dist-types/packages/peach-engine/src/render-worker/gesture-arbitration-native.d.ts +15 -2
  83. package/package.json +1 -1
  84. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Modules/module.modulemap +52 -0
  85. package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h +1 -1
  86. package/src/core-data-model.ts +92 -3
  87. package/src/expo-native-workspace.ts +26 -2
  88. package/src/swift-compile.ts +1 -25
  89. package/src/swift-packages.ts +22 -1
@@ -94,6 +94,7 @@ export declare const E_OVERFLOW = 8;
94
94
  export declare const E_DISPLAY = 9;
95
95
  export declare const E_KIND = 10;
96
96
  export declare const E_TEXT_ROUNDING = 11;
97
+ export declare const E_SWIFTUI_LAYOUT = 12;
97
98
  export declare const UNIT_UNDEFINED = 0;
98
99
  export declare const UNIT_POINT = 1;
99
100
  export declare const UNIT_PERCENT = 2;
@@ -19,10 +19,18 @@ export type GestureRecognizerEvent = {
19
19
  absoluteX: number;
20
20
  absoluteY: number;
21
21
  duration: number;
22
+ translationX: number;
23
+ translationY: number;
24
+ velocityX: number;
25
+ velocityY: number;
26
+ motion: boolean;
27
+ lastPointer: boolean;
28
+ timestamp: number;
22
29
  };
23
30
  export interface GestureRecognizerHost {
24
31
  locate(tag: number, x: number, y: number): GestureRecognizerLocation | null;
25
32
  publish(event: GestureRecognizerEvent): void;
33
+ scrollAxes(tag: number): number;
26
34
  emit: Emit;
27
35
  cancelNative: CancelNative;
28
36
  }
@@ -45,6 +53,7 @@ interface GestureArbitrationNative {
45
53
  peachArbitration?: (kind: number, id: number, tag: number, oldState: number, visible: number) => void;
46
54
  peachGestureLocate?: (index: number, tag: number, x: number, y: number) => number;
47
55
  peachGestureEvent?: (index: number) => void;
56
+ peachGestureScrollAxes?: (index: number, tag: number) => number;
48
57
  _peach_arbitration_buffer(size: number): number;
49
58
  _peach_gesture_locate_buffer(): number;
50
59
  _peach_gesture_event_buffer(): number;
@@ -52,11 +61,13 @@ interface GestureArbitrationNative {
52
61
  _peach_gesture_update(index: number, tag: number, length: number): void;
53
62
  _peach_gesture_remove(index: number, tag: number): void;
54
63
  _peach_gesture_set_android(index: number, android: number): void;
55
- _peach_gesture_feed(index: number, tag: number, phase: number, time: number, length: number): void;
64
+ _peach_gesture_feed(index: number, tag: number, phase: number, time: number, timestamp: number, length: number): void;
56
65
  _peach_gesture_advance(index: number, now: number): void;
57
66
  _peach_gesture_next_deadline(index: number): number;
58
67
  _peach_gesture_state(index: number, tag: number): number;
59
68
  _peach_gesture_activations(index: number, tag: number): number;
69
+ _peach_gesture_cleanups(index: number, tag: number): number;
70
+ _peach_gesture_yielded(index: number, tag: number): number;
60
71
  _peach_gesture_set_state(index: number, tag: number, state: number, manualPointers: number): void;
61
72
  _peach_gesture_cancel(index: number, tag: number): void;
62
73
  _peach_gesture_reset_for_pointer(index: number, tag: number): void;
@@ -96,12 +107,14 @@ export declare class GestureArbitrator {
96
107
  addRecognizer(tag: number, config: readonly number[]): void;
97
108
  updateRecognizer(tag: number, config: readonly number[]): void;
98
109
  removeRecognizer(tag: number): void;
99
- feedRecognizer(tag: number, phase: keyof typeof RECOGNIZER_PHASE, event: GestureRecognizerPointer, time: number, android: boolean): void;
110
+ feedRecognizer(tag: number, phase: keyof typeof RECOGNIZER_PHASE, event: GestureRecognizerPointer, time: number, timestamp: number, android: boolean): void;
100
111
  setRecognizerState(tag: number, state: number, manualPointers: number | null, android: boolean): void;
101
112
  cancelRecognizer(tag: number): void;
102
113
  resetRecognizerForPointer(tag: number): void;
103
114
  recognizerState(tag: number): number;
104
115
  recognizerActivations(tag: number): number;
116
+ recognizerCleanups(tag: number): number;
117
+ recognizerYielded(tag: number): boolean;
105
118
  private releaseEvents;
106
119
  upsert(graph: GestureArbitrationGraph, cancelNative: CancelNative, emit: Emit): boolean;
107
120
  drop(handlerTag: number, cancelNative: CancelNative, emit: Emit): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2302",
3
+ "version": "0.1.2303",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -0,0 +1,52 @@
1
+ framework module Accelerate {
2
+ umbrella header "Accelerate.h"
3
+ export *
4
+ module * { export * }
5
+
6
+ framework module vImage [extern_c] {
7
+ umbrella header "vImage.h"
8
+ export *
9
+ module * { export * }
10
+ }
11
+
12
+ framework module vecLib {
13
+ umbrella header "vecLib.h"
14
+ export *
15
+ module * { export * }
16
+
17
+ module vDSP_translate {
18
+ requires x86, !x86_64
19
+ header "vDSP_translate.h"
20
+ export *
21
+ }
22
+ module Sparse_Solve {
23
+ header "Sparse/Solve.h"
24
+ // Sparse/SolveImplementation.h should not be included without
25
+ // context/directly. Make it textual, same for its dependency
26
+ // SolveImplementationTyped.h
27
+ textual header "Sparse/SolveImplementation.h"
28
+ textual header "Sparse/SolveImplementationTyped.h"
29
+ export *
30
+ }
31
+ module LinearAlgebra {
32
+ header "LinearAlgebra/LinearAlgebra.h"
33
+ // These headers aren't supposed to be included directly or
34
+ // have their own submodules since they depend on context.
35
+ textual header "LinearAlgebra/object.h"
36
+ textual header "LinearAlgebra/matrix.h"
37
+ textual header "LinearAlgebra/vector.h"
38
+ textual header "LinearAlgebra/splat.h"
39
+ textual header "LinearAlgebra/arithmetic.h"
40
+ textual header "LinearAlgebra/linear_systems.h"
41
+ textual header "LinearAlgebra/norms.h"
42
+ export *
43
+ }
44
+ module Quadrature {
45
+ header "Quadrature/Quadrature.h"
46
+ // These headers aren't supposed to be included directly or
47
+ // have their own submodules since they depend on context.
48
+ textual header "Quadrature/Integration.h"
49
+ export *
50
+ }
51
+ }
52
+ }
@@ -14,7 +14,7 @@
14
14
 
15
15
  NS_ASSUME_NONNULL_BEGIN
16
16
 
17
- NS_CLASS_AVAILABLE_IOS(4_0) QL_EXPORT
17
+ NS_CLASS_AVAILABLE_IOS(4_0) QL_EXPORT PEACH_SWIFT_CLASS(SwiftUI)
18
18
  @interface QLPreviewController : UIViewController
19
19
 
20
20
  /*!
@@ -24,12 +24,27 @@ type Common = {
24
24
  renaming: string
25
25
  userInfo: UserInfo
26
26
  }
27
+ // an NSDecimal: up to eight little-endian 16-bit mantissa words, length of them used
28
+ type Decimal = {
29
+ kind: 'decimal'
30
+ exponent: number
31
+ length: number
32
+ negative: boolean
33
+ compact: boolean
34
+ mantissa: Buffer
35
+ }
27
36
  type Attribute = Common & {
28
37
  kind: 'attribute'
29
38
  transient: boolean
30
39
  type: number
31
40
  className: string | null
32
- defaultValue: string | number | boolean | null
41
+ defaultValue:
42
+ | string
43
+ | number
44
+ | boolean
45
+ | Decimal
46
+ | { kind: 'date'; time: number }
47
+ | null
33
48
  transformer: string | null
34
49
  flags: number
35
50
  cloudEncryption: boolean
@@ -124,7 +139,56 @@ function userInfo(source: Source, owner: Tag): UserInfo {
124
139
  : entries
125
140
  }
126
141
 
142
+ // momc archives a decimal default as the NSDecimal its string scans to: a
143
+ // nonzero value compacts (1.50 is 15e-1, 100 is 1e2), a zero keeps its fraction
144
+ // digits uncompacted (0.00 is 0e-2) and a negative zero is plain zero.
145
+ function decimal(text: string): Decimal | null {
146
+ const match = /^([+-]?)(\d*)(?:\.(\d*))?(?:[eE]([+-]?\d+))?$/.exec(text)
147
+ if (!match) return null
148
+ const [, sign, whole = '', fraction = '', power] = match
149
+ if (whole + fraction === '') return null
150
+ let mantissa = BigInt(whole + fraction)
151
+ let exponent = Number(power ?? 0) - fraction.length
152
+ if (mantissa === 0n) {
153
+ if (power !== undefined) return null
154
+ const zero = {
155
+ kind: 'decimal' as const,
156
+ length: 0,
157
+ negative: false,
158
+ compact: false,
159
+ mantissa: Buffer.alloc(16),
160
+ }
161
+ return { ...zero, exponent: sign === '-' ? 0 : exponent }
162
+ }
163
+ while (mantissa % 10n === 0n) {
164
+ mantissa /= 10n
165
+ exponent++
166
+ }
167
+ if (mantissa >> 128n !== 0n || exponent < -128 || exponent > 127) return null
168
+ const words = Buffer.alloc(16)
169
+ let length = 0
170
+ for (let word = 0; word < 8; word++) {
171
+ const value = Number((mantissa >> BigInt(16 * word)) & 0xffffn)
172
+ words.writeUInt16LE(value, 2 * word)
173
+ if (value !== 0) length = word + 1
174
+ }
175
+ return {
176
+ kind: 'decimal',
177
+ exponent,
178
+ length,
179
+ negative: sign === '-',
180
+ compact: true,
181
+ mantissa: words,
182
+ }
183
+ }
184
+
127
185
  function defaultValue(model: string, member: Tag, type: string) {
186
+ const interval = member.attrs.defaultDateTimeInterval
187
+ // momc keeps a date default to the whole minute at or before it
188
+ if (type === 'Date' && interval !== undefined && Number.isFinite(Number(interval)))
189
+ return { kind: 'date' as const, time: Math.floor(Number(interval) / 60) * 60 }
190
+ if (interval !== undefined)
191
+ refuse(model, `${member.attrs.name} has the ${type} date interval ${interval}`)
128
192
  const text = member.attrs.defaultValueString
129
193
  if (text === undefined) return null
130
194
  if (type.startsWith('Integer ') && /^-?\d+$/.test(text)) return Number(text)
@@ -132,6 +196,8 @@ function defaultValue(model: string, member: Tag, type: string) {
132
196
  return Number(text)
133
197
  if (type === 'Boolean' && (text === 'YES' || text === 'NO')) return text === 'YES'
134
198
  if (type === 'String') return text
199
+ const scanned = type === 'Decimal' ? decimal(text) : null
200
+ if (scanned) return scanned
135
201
  refuse(model, `${member.attrs.name} has the ${type} default ${JSON.stringify(text)}`)
136
202
  }
137
203
 
@@ -150,6 +216,7 @@ function attribute(source: Source, member: Tag): Attribute {
150
216
  'transient',
151
217
  'attributeType',
152
218
  'defaultValueString',
219
+ 'defaultDateTimeInterval',
153
220
  'usesScalarValueType',
154
221
  'customClassName',
155
222
  'valueTransformerName',
@@ -357,6 +424,14 @@ const classChains: Record<string, string[]> = {
357
424
  NSArray: ['NSArray', 'NSObject'],
358
425
  NSMutableArray: ['NSMutableArray', 'NSArray', 'NSObject'],
359
426
  NSSet: ['NSSet', 'NSObject'],
427
+ NSDate: ['NSDate', 'NSObject'],
428
+ NSDecimalNumberPlaceholder: [
429
+ 'NSDecimalNumberPlaceholder',
430
+ 'NSDecimalNumber',
431
+ 'NSNumber',
432
+ 'NSValue',
433
+ 'NSObject',
434
+ ],
360
435
  }
361
436
 
362
437
  // the NSKeyedArchiver object table: objects reserve their slot first so the
@@ -409,6 +484,21 @@ class KeyedArchive {
409
484
  }
410
485
  }
411
486
 
487
+ function archiveDefault(archive: KeyedArchive, value: Attribute['defaultValue']) {
488
+ if (value === null) return NULL
489
+ if (typeof value !== 'object') return archive.add(value)
490
+ if (value.kind === 'date')
491
+ return archive.fill(archive.reserve(), 'NSDate', { 'NS.time': value.time })
492
+ return archive.fill(archive.reserve(), 'NSDecimalNumberPlaceholder', {
493
+ 'NS.compact': value.compact,
494
+ 'NS.exponent': value.exponent,
495
+ 'NS.length': value.length,
496
+ 'NS.mantissa': value.mantissa,
497
+ 'NS.mantissa.bo': 1,
498
+ 'NS.negative': value.negative,
499
+ })
500
+ }
501
+
412
502
  function archiveModel(model: Model) {
413
503
  const archive = new KeyedArchive()
414
504
  const modelIndex = archive.reserve()
@@ -443,8 +533,7 @@ function archiveModel(model: Model) {
443
533
  ...shared,
444
534
  NSAttributeType: property.type,
445
535
  NSAttributeValueClassName: archive.string(property.className),
446
- NSDefaultValue:
447
- property.defaultValue === null ? NULL : archive.add(property.defaultValue),
536
+ NSDefaultValue: archiveDefault(archive, property.defaultValue),
448
537
  NSFlagsKey: property.flags,
449
538
  NSValueTransformerName: archive.string(property.transformer),
450
539
  ...(property.transient ? { NSIsTransient: true } : {}),
@@ -33,6 +33,30 @@ const isolatedGitEnv = {
33
33
  GIT_CONFIG_SYSTEM: '/dev/null',
34
34
  }
35
35
 
36
+ function cleanWorkspaceGitEnv(): NodeJS.ProcessEnv {
37
+ const env: NodeJS.ProcessEnv = { ...process.env }
38
+ for (const key of [
39
+ 'GIT_DIR',
40
+ 'GIT_COMMON_DIR',
41
+ 'GIT_WORK_TREE',
42
+ 'GIT_INDEX_FILE',
43
+ 'GIT_OBJECT_DIRECTORY',
44
+ 'GIT_ALTERNATE_OBJECT_DIRECTORIES',
45
+ 'GIT_PREFIX',
46
+ 'GIT_SHALLOW_FILE',
47
+ 'GIT_GRAFT_FILE',
48
+ 'GIT_NAMESPACE',
49
+ 'GIT_IMPLICIT_WORK_TREE',
50
+ 'GIT_CONFIG',
51
+ 'GIT_CEILING_DIRECTORIES',
52
+ 'GIT_DISCOVERY_ACROSS_FILESYSTEM',
53
+ 'GIT_SUPER_PREFIX',
54
+ ]) {
55
+ delete env[key]
56
+ }
57
+ return { ...env, ...isolatedGitEnv }
58
+ }
59
+
36
60
  // CocoaPods refuses a non UTF-8 locale, so even its version probe names one.
37
61
  const utf8Env = { ...process.env, LANG: 'en_US.UTF-8', LC_ALL: 'en_US.UTF-8' }
38
62
 
@@ -824,7 +848,7 @@ export async function prepareInstalledExpoWorkspace(app: string, work: string) {
824
848
  function trackedSourceEntries(root: string, work: string): string[] {
825
849
  const listed = spawnSync('git', ['ls-files', '--stage', '-z'], {
826
850
  cwd: root,
827
- env: { ...process.env, ...isolatedGitEnv },
851
+ env: cleanWorkspaceGitEnv(),
828
852
  maxBuffer: 256 * 1024 * 1024,
829
853
  })
830
854
  if (listed.status !== 0) return []
@@ -839,7 +863,7 @@ function trackedSourceEntries(root: string, work: string): string[] {
839
863
 
840
864
  function initializeWorkspaceGit(root: string, work: string) {
841
865
  requireNativeGit()
842
- const env = { ...process.env, ...isolatedGitEnv }
866
+ const env = cleanWorkspaceGitEnv()
843
867
  execFileSync('git', ['init', '--quiet'], { cwd: work, env })
844
868
  execFileSync(
845
869
  'git',
@@ -2685,30 +2685,6 @@ export function lowerAVAssetURLCluster(source: string): string {
2685
2685
  return out
2686
2686
  }
2687
2687
 
2688
- // NSValue(time:) boxes a CMTime struct, which the sdk's NSValue cluster
2689
- // cannot encode (its concrete value traps on struct objCType strings), and
2690
- // a convenience initializer cannot substitute the box subclass, so compiled
2691
- // sources construct the landed NSStructBox through NSValue.boxedTime
2692
- // instead; only the token changes, spacing and the argument list stay as
2693
- // written. NSValue.boxedTime keeps the time: label for exactly this reason.
2694
- // every other NSValue construction keeps its spelling: timeRange:,
2695
- // timeMapping: and the struct-taking siblings stay on their trapping stubs,
2696
- // the explicit .init(time:) spelling stays on the shim, and the sdk's own
2697
- // NSValue(bytes:objCType:) still traps on struct encodings (the probe's
2698
- // sdk-trap negative pins that wall as the one the box avoids).
2699
- export function lowerNSValueTimeBox(source: string): string {
2700
- const masked = swiftCodeMask(source)
2701
- const pattern = /\bNSValue\s*\(\s*time\s*:/g
2702
- const edits: [number, number, string][] = []
2703
- let hit: RegExpExecArray | null
2704
- while ((hit = pattern.exec(masked)) !== null)
2705
- edits.push([hit.index, 'NSValue'.length, 'NSValue.boxedTime'])
2706
- let out = source
2707
- for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
2708
- out = out.slice(0, at) + insert + out.slice(at + remove)
2709
- return out
2710
- }
2711
-
2712
2688
  export function swiftCodeMask(source: string): string {
2713
2689
  const chars = source.split('')
2714
2690
  const blank = (from: number, to: number): void => {
@@ -3525,7 +3501,7 @@ export function swiftSourceAsIOS(
3525
3501
  continue
3526
3502
  }
3527
3503
  }
3528
- return lowerNSValueTimeBox(lowerAVAssetURLCluster(out + conditioned.slice(copied)))
3504
+ return lowerAVAssetURLCluster(out + conditioned.slice(copied))
3529
3505
  }
3530
3506
 
3531
3507
  // a native module's file closure includes referenced top-level declarations
@@ -343,11 +343,32 @@ async function fetchCheckout(
343
343
  if (preparedSwiftPin(checkouts, identity, pin.location, pin.revision)) return
344
344
  requireNativeGit()
345
345
  const key = checkoutKey(dir, pin)
346
+ const gitEnv: NodeJS.ProcessEnv = { ...process.env }
347
+ for (const name of [
348
+ 'GIT_DIR',
349
+ 'GIT_COMMON_DIR',
350
+ 'GIT_WORK_TREE',
351
+ 'GIT_INDEX_FILE',
352
+ 'GIT_OBJECT_DIRECTORY',
353
+ 'GIT_ALTERNATE_OBJECT_DIRECTORIES',
354
+ 'GIT_PREFIX',
355
+ 'GIT_SHALLOW_FILE',
356
+ 'GIT_GRAFT_FILE',
357
+ 'GIT_NAMESPACE',
358
+ 'GIT_IMPLICIT_WORK_TREE',
359
+ 'GIT_CONFIG',
360
+ 'GIT_CEILING_DIRECTORIES',
361
+ 'GIT_DISCOVERY_ACROSS_FILESYSTEM',
362
+ 'GIT_SUPER_PREFIX',
363
+ ]) {
364
+ delete gitEnv[name]
365
+ }
366
+ gitEnv.GIT_TERMINAL_PROMPT = '0'
346
367
  const git: Git = async (cwd, ...args) =>
347
368
  (
348
369
  await execFileAsync('git', ['-C', cwd, ...args], {
349
370
  encoding: 'utf8',
350
- env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
371
+ env: gitEnv,
351
372
  signal,
352
373
  })
353
374
  ).stdout.trim()