@xcodekit/xcode-wasm 0.4.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Evgenii Mozharovskii
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,334 @@
1
+ # @xcodekit/xcode
2
+
3
+ Super fast Xcode `.pbxproj` parser and serializer written in Rust.
4
+
5
+ Drop-in replacement for the low-level API of [`@bacons/xcode`](https://github.com/EvanBacon/xcode) — same `parse()` and `build()` interface, **3-15x faster parsing**, byte-identical output. Available as a native binary (napi) or universal WASM.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # Native (fastest, Node.js only)
11
+ npm install @xcodekit/xcode
12
+
13
+ # WASM (universal — browsers, Deno, Cloudflare Workers, etc.)
14
+ npm install @xcodekit/xcode-wasm
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```js
20
+ import { parse, build } from "@xcodekit/xcode";
21
+ import { readFileSync, writeFileSync } from "fs";
22
+
23
+ // Parse a .pbxproj file
24
+ const text = readFileSync("project.pbxproj", "utf8");
25
+ const project = parse(text);
26
+
27
+ // Modify it
28
+ project.objects["YOUR_UUID"] = {
29
+ isa: "PBXFileReference",
30
+ path: "NewFile.swift",
31
+ sourceTree: "<group>",
32
+ };
33
+
34
+ // Write it back
35
+ const output = build(project);
36
+ writeFileSync("project.pbxproj", output);
37
+ ```
38
+
39
+ ## API
40
+
41
+ ### Low-Level (JSON)
42
+
43
+ #### `parse(text: string): object`
44
+
45
+ Parse a `.pbxproj` string into a JSON-compatible object. Matches the output of `@bacons/xcode/json`'s `parse()`.
46
+
47
+ ```js
48
+ const project = parse(readFileSync("project.pbxproj", "utf8"));
49
+ ```
50
+
51
+ #### `build(project: object): string`
52
+
53
+ Serialize a JSON object back to `.pbxproj` format. Produces byte-identical output to `@bacons/xcode/json`'s `build()`.
54
+
55
+ ```js
56
+ writeFileSync("project.pbxproj", build(project));
57
+ ```
58
+
59
+ #### `buildFromJSON(json: string): string`
60
+
61
+ Same as `build()` but accepts `JSON.stringify(project)` directly. Faster because it avoids napi's recursive JS-to-Rust object marshalling.
62
+
63
+ ```js
64
+ const output = buildFromJSON(JSON.stringify(project));
65
+ ```
66
+
67
+ #### `parseAndBuild(text: string): string`
68
+
69
+ Parse and immediately re-serialize. Stays entirely in Rust with zero JS/Rust marshalling — the fastest possible round-trip path.
70
+
71
+ ```js
72
+ const output = parseAndBuild(readFileSync("project.pbxproj", "utf8"));
73
+ ```
74
+
75
+ ### High-Level (XcodeProject)
76
+
77
+ #### `XcodeProject.open(filePath)` / `XcodeProject.fromString(content)`
78
+
79
+ Open from disk or parse from a string (e.g. content fetched over the network).
80
+
81
+ ```js
82
+ import { XcodeProject } from "@xcodekit/xcode";
83
+
84
+ // From disk
85
+ const project = XcodeProject.open("ios/MyApp.xcodeproj/project.pbxproj");
86
+
87
+ // From string (no file on disk needed)
88
+ const project = XcodeProject.fromString(pbxprojContent);
89
+
90
+ // Properties
91
+ project.archiveVersion; // 1
92
+ project.objectVersion; // 46
93
+ project.filePath; // path if opened from disk, null if fromString
94
+ project.mainGroupUuid; // root group UUID
95
+
96
+ // Targets
97
+ const targets = project.getNativeTargets(); // UUID[]
98
+ const mainApp = project.findMainAppTarget("ios"); // UUID | null
99
+ project.getTargetName(mainApp); // "MyApp"
100
+ project.setTargetName(mainApp, "NewName");
101
+
102
+ // Build settings
103
+ project.getBuildSetting(targetUuid, "PRODUCT_BUNDLE_IDENTIFIER");
104
+ project.setBuildSetting(targetUuid, "SWIFT_VERSION", "5.0");
105
+ project.removeBuildSetting(targetUuid, "CODE_SIGN_IDENTITY");
106
+
107
+ // Files & groups
108
+ const fileUuid = project.addFile(project.mainGroupUuid, "Sources/App.swift");
109
+ const groupUuid = project.addGroup(project.mainGroupUuid, "Features");
110
+ const children = project.getGroupChildren(groupUuid);
111
+
112
+ // Build phases
113
+ const phase = project.ensureBuildPhase(targetUuid, "PBXSourcesBuildPhase");
114
+ project.addBuildFile(phase, fileUuid);
115
+
116
+ // Frameworks
117
+ project.addFramework(targetUuid, "SwiftUI");
118
+
119
+ // Create targets
120
+ const widgetTarget = project.createNativeTarget(
121
+ "MyWidget",
122
+ "com.apple.product-type.app-extension",
123
+ "com.example.mywidget",
124
+ );
125
+
126
+ // Embed extension into host app
127
+ project.addDependency(mainApp, widgetTarget);
128
+ project.embedExtension(mainApp, widgetTarget);
129
+
130
+ // Xcode 16+ file system sync groups
131
+ project.addFileSystemSyncGroup(widgetTarget, "MyWidget");
132
+
133
+ // Generic object access
134
+ project.getObjectProperty(uuid, "path");
135
+ project.setObjectProperty(uuid, "path", "new/path");
136
+ const proxies = project.findObjectsByIsa("PBXContainerItemProxy");
137
+
138
+ // Validation
139
+ const orphans = project.findOrphanedReferences();
140
+ // [{ referrerUuid, referrerIsa, property, orphanUuid }]
141
+
142
+ // Serialize
143
+ const pbxproj = project.toBuild(); // string
144
+ const json = project.toJSON(); // object
145
+
146
+ // Write back to disk
147
+ project.save();
148
+
149
+ // Deterministic UUID generation
150
+ const uuid = project.getUniqueId("my-seed-string"); // 24-char hex
151
+ ```
152
+
153
+ All `XcodeProject` methods operate in Rust/WASM — only primitive strings cross the boundary. This is the fastest path for project manipulation.
154
+
155
+ ### WASM
156
+
157
+ The WASM build (`@xcodekit/xcode-wasm`) has the same API with two differences:
158
+
159
+ - `parse()` / `build()` work with JSON **strings** (not JS objects) — call `JSON.parse()` / `JSON.stringify()` on your side
160
+ - `XcodeProject` is created with `new XcodeProject(content)` instead of factory methods
161
+ - No `open()` / `save()` — no filesystem in WASM
162
+
163
+ ```js
164
+ import { parse, build, XcodeProject } from "@xcodekit/xcode-wasm";
165
+
166
+ // Low-level
167
+ const json = parse(text); // returns JSON string
168
+ const project = JSON.parse(json);
169
+ const output = build(json); // accepts JSON string
170
+
171
+ // High-level (same API as napi)
172
+ const xcode = new XcodeProject(text);
173
+ xcode.setBuildSetting(target, "SWIFT_VERSION", "6.0");
174
+ const pbxproj = xcode.toBuild();
175
+ ```
176
+
177
+ ## Performance
178
+
179
+ Benchmarked on Apple M4 Pro, Node.js v24. Median of 200 iterations.
180
+
181
+ - **WASM** — `@xcodekit/xcode-wasm`, the WebAssembly build. Runs everywhere without native compilation, including edge runtimes and browsers.
182
+ - **napi** — `@xcodekit/xcode`, the native Node.js addon via napi-rs. Fastest on supported platforms (macOS, Linux, Windows).
183
+ - **TS** — `@bacons/xcode/json`, the original TypeScript implementation using Chevrotain.
184
+
185
+ ### Parse
186
+
187
+ | Fixture | WASM | napi | TS | WASM vs TS | napi vs TS |
188
+ | -------------------------- | ------ | ------ | ------- | ---------- | ---------- |
189
+ | swift-protobuf (257 KB) | 2.9 ms | 3.7 ms | 43.9 ms | **15.2x** | **11.8x** |
190
+ | Cocoa-Application (166 KB) | 2.4 ms | 3.2 ms | 17.2 ms | **7.3x** | **5.4x** |
191
+ | AFNetworking (99 KB) | 1.3 ms | 1.7 ms | 6.6 ms | **5.1x** | **3.9x** |
192
+ | watch (48 KB) | 0.7 ms | 0.9 ms | 2.1 ms | **3.0x** | **2.3x** |
193
+ | project (19 KB) | 0.3 ms | 0.4 ms | 0.8 ms | **2.9x** | **2.2x** |
194
+
195
+ ### Build
196
+
197
+ | Fixture | WASM | napi | TS | WASM vs TS | napi vs TS |
198
+ | -------------------------- | ------ | ------ | ------- | ----------- | ----------- |
199
+ | swift-protobuf (257 KB) | 4.1 ms | 5.2 ms | 12.0 ms | **2.9x** | **2.3x** |
200
+ | Cocoa-Application (166 KB) | 3.3 ms | 4.5 ms | 2.7 ms | 1.2x slower | 1.7x slower |
201
+ | AFNetworking (99 KB) | 1.6 ms | 2.3 ms | 1.8 ms | **1.1x** | 1.3x slower |
202
+ | watch (48 KB) | 0.8 ms | 1.1 ms | 0.4 ms | 1.9x slower | 2.7x slower |
203
+ | project (19 KB) | 0.3 ms | 0.4 ms | 0.2 ms | 1.9x slower | 2.7x slower |
204
+
205
+ > [!NOTE]
206
+ > TypeScript wins `build()` on smaller files because it operates directly on native JS objects with zero serialization cost. Rust pays a fixed overhead for JSON deserialization (~0.1 ms) which dominates on small inputs. On large files (>100 KB) where actual serialization work dominates, Rust wins.
207
+ >
208
+ > In practice this doesn't matter much — the parse speedup more than compensates, as the round-trip tables below show.
209
+
210
+ ### Round-Trip (parse + build)
211
+
212
+ | Fixture | WASM | napi | TS | WASM vs TS | napi vs TS |
213
+ | -------------------------- | ------ | ------ | ------- | ---------- | ---------- |
214
+ | swift-protobuf (257 KB) | 7.0 ms | 9.0 ms | 55.9 ms | **8.0x** | **6.2x** |
215
+ | Cocoa-Application (166 KB) | 5.7 ms | 7.7 ms | 19.9 ms | **3.5x** | **2.6x** |
216
+ | AFNetworking (99 KB) | 2.9 ms | 4.0 ms | 8.4 ms | **2.9x** | **2.1x** |
217
+ | watch (48 KB) | 1.5 ms | 2.0 ms | 2.5 ms | **1.7x** | **1.3x** |
218
+ | project (19 KB) | 0.6 ms | 0.8 ms | 1.0 ms | **1.7x** | **1.3x** |
219
+
220
+ ### Round-Trip (parseAndBuild — zero marshalling)
221
+
222
+ | Fixture | WASM | napi | TS | WASM vs TS | napi vs TS |
223
+ | -------------------------- | ------ | ------ | ------- | ---------- | ---------- |
224
+ | swift-protobuf (257 KB) | 4.8 ms | 4.4 ms | 62.7 ms | **13.1x** | **14.2x** |
225
+ | Cocoa-Application (166 KB) | 3.7 ms | 3.7 ms | 22.4 ms | **6.0x** | **6.1x** |
226
+ | AFNetworking (99 KB) | 1.9 ms | 1.8 ms | 9.2 ms | **4.7x** | **5.1x** |
227
+ | watch (48 KB) | 0.9 ms | 0.9 ms | 2.8 ms | **3.0x** | **3.1x** |
228
+ | project (19 KB) | 0.4 ms | 0.3 ms | 1.0 ms | **2.8x** | **2.9x** |
229
+
230
+ ### Package Size
231
+
232
+ | | WASM | napi | TS |
233
+ | ------------ | ------ | ------ | ------- |
234
+ | Uncompressed | 245 KB | 559 KB | 1.1 MB |
235
+ | Gzipped | 96 KB | 270 KB | ~400 KB |
236
+
237
+ Run benchmarks yourself:
238
+
239
+ ```bash
240
+ make bench # all benchmarks
241
+ make bench-rust # pure Rust (no JS overhead)
242
+ make bench-js # napi vs TypeScript
243
+ make bench-wasm # WASM vs napi vs TypeScript
244
+ ```
245
+
246
+ ## Choosing the Right Package
247
+
248
+ | Environment | Package | Notes |
249
+ | ---------------------------------- | ---------------------- | ---------------------------------------- |
250
+ | Node.js | `@xcodekit/xcode` | Fastest. Native binary per platform. |
251
+ | Browser / Deno / Workers | `@xcodekit/xcode-wasm` | Universal. 96 KB gzipped. |
252
+ | Node.js without native compilation | `@xcodekit/xcode-wasm` | Works everywhere, no build tools needed. |
253
+
254
+ ## Compatibility
255
+
256
+ - Full feature parity with `@bacons/xcode/json` (parse/build)
257
+ - 13/13 round-trip fixtures produce **byte-identical** output
258
+ - All escape sequences: standard (`\n`, `\t`, etc.), Unicode (`\Uxxxx`), octal, NeXTSTEP (128 entries)
259
+ - Xcode 16+ file system synchronized groups
260
+ - Swift Package Manager references
261
+ - 119 tests (62 Rust + 38 napi JS + 19 WASM JS)
262
+
263
+ ## Supported Platforms
264
+
265
+ ### napi (`@xcodekit/xcode`)
266
+
267
+ | Platform | Architecture |
268
+ | -------- | ---------------------------------- |
269
+ | macOS | arm64 (Apple Silicon), x64 (Intel) |
270
+ | Linux | x64 (glibc), arm64 (glibc) |
271
+ | Windows | x64 (MSVC) |
272
+
273
+ ### WASM (`@xcodekit/xcode-wasm`)
274
+
275
+ Any environment that supports WebAssembly — browsers, Node.js, Deno, Bun, Cloudflare Workers, etc.
276
+
277
+ ## Development
278
+
279
+ ```bash
280
+ # Prerequisites
281
+ # - Rust toolchain (cargo)
282
+ # - Node.js >= 18
283
+ # - wasm-pack (for WASM builds)
284
+
285
+ # Install dependencies
286
+ npm install
287
+
288
+ # Run tests
289
+ make test # all tests (Rust + napi JS + WASM JS)
290
+ make test-rust # Rust tests only (fast, no Node needed)
291
+ make test-js # napi JS tests (builds debug binary first)
292
+ make test-wasm # WASM JS tests (requires: make build-wasm)
293
+
294
+ # Build
295
+ make build # napi release build
296
+ make build-debug # napi debug build (faster compilation)
297
+ make build-wasm # WASM build (web + node + bundler targets)
298
+
299
+ # Other
300
+ make check # Type-check all targets without building
301
+ make fmt # cargo fmt
302
+ make lint # cargo clippy
303
+ make clean # Remove all artifacts
304
+ ```
305
+
306
+ ### Project Structure
307
+
308
+ ```
309
+ src/
310
+ lib.rs # napi + wasm exports
311
+ parser/
312
+ lexer.rs # Fast byte-scanning tokenizer
313
+ parser.rs # Recursive descent parser → PlistValue
314
+ escape.rs # String unescape (standard, Unicode, octal, NeXTSTEP)
315
+ writer/
316
+ serializer.rs # PlistValue → .pbxproj (section sorting, inline formatting)
317
+ comments.rs # UUID → inline comment generation
318
+ quotes.rs # String quoting/escaping
319
+ types/
320
+ plist.rs # PlistValue enum (String, Integer, Float, Data, Object, Array)
321
+ isa.rs # ISA enum (29 variants)
322
+ constants.rs # File type mappings, SDK versions, default build settings
323
+ project/
324
+ xcode_project.rs # High-level project container
325
+ uuid.rs # Deterministic MD5-based UUID generation
326
+ paths.rs # sourceTree path resolution
327
+ build_settings.rs # $(VARIABLE:transform) resolver
328
+ objects/
329
+ mod.rs # PbxObject + PbxObjectExt trait
330
+ ```
331
+
332
+ ## License
333
+
334
+ MIT
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@xcodekit/xcode-wasm",
3
+ "type": "module",
4
+ "description": "Parse, manipulate, and serialize Xcode .pbxproj files (WASM build)",
5
+ "version": "0.4.0",
6
+ "license": "MIT",
7
+ "files": [
8
+ "xcode_bg.wasm",
9
+ "xcode.js",
10
+ "xcode_bg.js",
11
+ "xcode.d.ts"
12
+ ],
13
+ "main": "xcode.js",
14
+ "types": "xcode.d.ts",
15
+ "sideEffects": [
16
+ "./xcode.js",
17
+ "./snippets/*"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/mozharovsky/xcode"
22
+ },
23
+ "keywords": [
24
+ "xcode",
25
+ "pbxproj",
26
+ "ios",
27
+ "apple",
28
+ "parser",
29
+ "wasm",
30
+ "rust"
31
+ ]
32
+ }
package/xcode.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * High-level project manipulation — stays in WASM memory.
6
+ */
7
+ export class XcodeProject {
8
+ free(): void;
9
+ [Symbol.dispose](): void;
10
+ addBuildFile(phase_uuid: string, file_ref_uuid: string): string | undefined;
11
+ addDependency(target_uuid: string, depends_on: string): string | undefined;
12
+ addFile(group_uuid: string, path: string): string | undefined;
13
+ addFileSystemSyncGroup(target_uuid: string, path: string): string | undefined;
14
+ addFramework(target_uuid: string, framework_name: string): string | undefined;
15
+ addGroup(parent_uuid: string, name: string): string | undefined;
16
+ createNativeTarget(name: string, product_type: string, bundle_id: string): string | undefined;
17
+ embedExtension(host: string, extension: string): string | undefined;
18
+ ensureBuildPhase(target_uuid: string, phase_isa: string): string | undefined;
19
+ findMainAppTarget(platform?: string | null): string | undefined;
20
+ findObjectsByIsa(isa: string): string[];
21
+ findOrphanedReferences(): string;
22
+ getBuildSetting(target_uuid: string, key: string): string | undefined;
23
+ getGroupChildren(group_uuid: string): string[];
24
+ getNativeTargets(): string[];
25
+ getObjectProperty(uuid: string, key: string): string | undefined;
26
+ getTargetName(target_uuid: string): string | undefined;
27
+ getUniqueId(seed: string): string;
28
+ /**
29
+ * Parse a .pbxproj string into an XcodeProject.
30
+ */
31
+ constructor(content: string);
32
+ removeBuildSetting(target_uuid: string, key: string): boolean;
33
+ setBuildSetting(target_uuid: string, key: string, value: string): boolean;
34
+ setObjectProperty(uuid: string, key: string, value: string): boolean;
35
+ setTargetName(target_uuid: string, name: string): boolean;
36
+ /**
37
+ * Serialize the project back to .pbxproj format.
38
+ */
39
+ toBuild(): string;
40
+ /**
41
+ * Convert the project to a JSON string.
42
+ */
43
+ toJSON(): string;
44
+ readonly archiveVersion: bigint;
45
+ readonly mainGroupUuid: string | undefined;
46
+ readonly objectVersion: bigint;
47
+ }
48
+
49
+ /**
50
+ * Serialize a JSON string back to .pbxproj format.
51
+ */
52
+ export function build(json: string): string;
53
+
54
+ /**
55
+ * Parse a .pbxproj string into a JSON string.
56
+ */
57
+ export function parse(text: string): string;
58
+
59
+ /**
60
+ * Parse and immediately re-serialize a .pbxproj string.
61
+ */
62
+ export function parseAndBuild(text: string): string;
package/xcode.js ADDED
@@ -0,0 +1,9 @@
1
+ /* @ts-self-types="./xcode.d.ts" */
2
+
3
+ import * as wasm from "./xcode_bg.wasm";
4
+ import { __wbg_set_wasm } from "./xcode_bg.js";
5
+ __wbg_set_wasm(wasm);
6
+
7
+ export {
8
+ XcodeProject, build, parse, parseAndBuild
9
+ } from "./xcode_bg.js";
package/xcode_bg.js ADDED
@@ -0,0 +1,841 @@
1
+ /**
2
+ * High-level project manipulation — stays in WASM memory.
3
+ */
4
+ export class XcodeProject {
5
+ __destroy_into_raw() {
6
+ const ptr = this.__wbg_ptr;
7
+ this.__wbg_ptr = 0;
8
+ XcodeProjectFinalization.unregister(this);
9
+ return ptr;
10
+ }
11
+ free() {
12
+ const ptr = this.__destroy_into_raw();
13
+ wasm.__wbg_xcodeproject_free(ptr, 0);
14
+ }
15
+ /**
16
+ * @param {string} phase_uuid
17
+ * @param {string} file_ref_uuid
18
+ * @returns {string | undefined}
19
+ */
20
+ addBuildFile(phase_uuid, file_ref_uuid) {
21
+ try {
22
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
23
+ const ptr0 = passStringToWasm0(phase_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
24
+ const len0 = WASM_VECTOR_LEN;
25
+ const ptr1 = passStringToWasm0(file_ref_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
26
+ const len1 = WASM_VECTOR_LEN;
27
+ wasm.xcodeproject_addBuildFile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
28
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
29
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
30
+ let v3;
31
+ if (r0 !== 0) {
32
+ v3 = getStringFromWasm0(r0, r1).slice();
33
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
34
+ }
35
+ return v3;
36
+ } finally {
37
+ wasm.__wbindgen_add_to_stack_pointer(16);
38
+ }
39
+ }
40
+ /**
41
+ * @param {string} target_uuid
42
+ * @param {string} depends_on
43
+ * @returns {string | undefined}
44
+ */
45
+ addDependency(target_uuid, depends_on) {
46
+ try {
47
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
48
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
49
+ const len0 = WASM_VECTOR_LEN;
50
+ const ptr1 = passStringToWasm0(depends_on, wasm.__wbindgen_export, wasm.__wbindgen_export2);
51
+ const len1 = WASM_VECTOR_LEN;
52
+ wasm.xcodeproject_addDependency(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
53
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
54
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
55
+ let v3;
56
+ if (r0 !== 0) {
57
+ v3 = getStringFromWasm0(r0, r1).slice();
58
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
59
+ }
60
+ return v3;
61
+ } finally {
62
+ wasm.__wbindgen_add_to_stack_pointer(16);
63
+ }
64
+ }
65
+ /**
66
+ * @param {string} group_uuid
67
+ * @param {string} path
68
+ * @returns {string | undefined}
69
+ */
70
+ addFile(group_uuid, path) {
71
+ try {
72
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
73
+ const ptr0 = passStringToWasm0(group_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
74
+ const len0 = WASM_VECTOR_LEN;
75
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
76
+ const len1 = WASM_VECTOR_LEN;
77
+ wasm.xcodeproject_addFile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
78
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
79
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
80
+ let v3;
81
+ if (r0 !== 0) {
82
+ v3 = getStringFromWasm0(r0, r1).slice();
83
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
84
+ }
85
+ return v3;
86
+ } finally {
87
+ wasm.__wbindgen_add_to_stack_pointer(16);
88
+ }
89
+ }
90
+ /**
91
+ * @param {string} target_uuid
92
+ * @param {string} path
93
+ * @returns {string | undefined}
94
+ */
95
+ addFileSystemSyncGroup(target_uuid, path) {
96
+ try {
97
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
98
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
101
+ const len1 = WASM_VECTOR_LEN;
102
+ wasm.xcodeproject_addFileSystemSyncGroup(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
103
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
104
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
105
+ let v3;
106
+ if (r0 !== 0) {
107
+ v3 = getStringFromWasm0(r0, r1).slice();
108
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
109
+ }
110
+ return v3;
111
+ } finally {
112
+ wasm.__wbindgen_add_to_stack_pointer(16);
113
+ }
114
+ }
115
+ /**
116
+ * @param {string} target_uuid
117
+ * @param {string} framework_name
118
+ * @returns {string | undefined}
119
+ */
120
+ addFramework(target_uuid, framework_name) {
121
+ try {
122
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
123
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
124
+ const len0 = WASM_VECTOR_LEN;
125
+ const ptr1 = passStringToWasm0(framework_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
126
+ const len1 = WASM_VECTOR_LEN;
127
+ wasm.xcodeproject_addFramework(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
128
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
129
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
130
+ let v3;
131
+ if (r0 !== 0) {
132
+ v3 = getStringFromWasm0(r0, r1).slice();
133
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
134
+ }
135
+ return v3;
136
+ } finally {
137
+ wasm.__wbindgen_add_to_stack_pointer(16);
138
+ }
139
+ }
140
+ /**
141
+ * @param {string} parent_uuid
142
+ * @param {string} name
143
+ * @returns {string | undefined}
144
+ */
145
+ addGroup(parent_uuid, name) {
146
+ try {
147
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
148
+ const ptr0 = passStringToWasm0(parent_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
149
+ const len0 = WASM_VECTOR_LEN;
150
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
151
+ const len1 = WASM_VECTOR_LEN;
152
+ wasm.xcodeproject_addGroup(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
153
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
154
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
155
+ let v3;
156
+ if (r0 !== 0) {
157
+ v3 = getStringFromWasm0(r0, r1).slice();
158
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
159
+ }
160
+ return v3;
161
+ } finally {
162
+ wasm.__wbindgen_add_to_stack_pointer(16);
163
+ }
164
+ }
165
+ /**
166
+ * @returns {bigint}
167
+ */
168
+ get archiveVersion() {
169
+ const ret = wasm.xcodeproject_archiveVersion(this.__wbg_ptr);
170
+ return ret;
171
+ }
172
+ /**
173
+ * @param {string} name
174
+ * @param {string} product_type
175
+ * @param {string} bundle_id
176
+ * @returns {string | undefined}
177
+ */
178
+ createNativeTarget(name, product_type, bundle_id) {
179
+ try {
180
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
181
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
182
+ const len0 = WASM_VECTOR_LEN;
183
+ const ptr1 = passStringToWasm0(product_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
184
+ const len1 = WASM_VECTOR_LEN;
185
+ const ptr2 = passStringToWasm0(bundle_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
186
+ const len2 = WASM_VECTOR_LEN;
187
+ wasm.xcodeproject_createNativeTarget(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
188
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
189
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
190
+ let v4;
191
+ if (r0 !== 0) {
192
+ v4 = getStringFromWasm0(r0, r1).slice();
193
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
194
+ }
195
+ return v4;
196
+ } finally {
197
+ wasm.__wbindgen_add_to_stack_pointer(16);
198
+ }
199
+ }
200
+ /**
201
+ * @param {string} host
202
+ * @param {string} extension
203
+ * @returns {string | undefined}
204
+ */
205
+ embedExtension(host, extension) {
206
+ try {
207
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
208
+ const ptr0 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
209
+ const len0 = WASM_VECTOR_LEN;
210
+ const ptr1 = passStringToWasm0(extension, wasm.__wbindgen_export, wasm.__wbindgen_export2);
211
+ const len1 = WASM_VECTOR_LEN;
212
+ wasm.xcodeproject_embedExtension(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
213
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
214
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
215
+ let v3;
216
+ if (r0 !== 0) {
217
+ v3 = getStringFromWasm0(r0, r1).slice();
218
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
219
+ }
220
+ return v3;
221
+ } finally {
222
+ wasm.__wbindgen_add_to_stack_pointer(16);
223
+ }
224
+ }
225
+ /**
226
+ * @param {string} target_uuid
227
+ * @param {string} phase_isa
228
+ * @returns {string | undefined}
229
+ */
230
+ ensureBuildPhase(target_uuid, phase_isa) {
231
+ try {
232
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
233
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
234
+ const len0 = WASM_VECTOR_LEN;
235
+ const ptr1 = passStringToWasm0(phase_isa, wasm.__wbindgen_export, wasm.__wbindgen_export2);
236
+ const len1 = WASM_VECTOR_LEN;
237
+ wasm.xcodeproject_ensureBuildPhase(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
238
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
239
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
240
+ let v3;
241
+ if (r0 !== 0) {
242
+ v3 = getStringFromWasm0(r0, r1).slice();
243
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
244
+ }
245
+ return v3;
246
+ } finally {
247
+ wasm.__wbindgen_add_to_stack_pointer(16);
248
+ }
249
+ }
250
+ /**
251
+ * @param {string | null} [platform]
252
+ * @returns {string | undefined}
253
+ */
254
+ findMainAppTarget(platform) {
255
+ try {
256
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
257
+ var ptr0 = isLikeNone(platform) ? 0 : passStringToWasm0(platform, wasm.__wbindgen_export, wasm.__wbindgen_export2);
258
+ var len0 = WASM_VECTOR_LEN;
259
+ wasm.xcodeproject_findMainAppTarget(retptr, this.__wbg_ptr, ptr0, len0);
260
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
261
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
262
+ let v2;
263
+ if (r0 !== 0) {
264
+ v2 = getStringFromWasm0(r0, r1).slice();
265
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
266
+ }
267
+ return v2;
268
+ } finally {
269
+ wasm.__wbindgen_add_to_stack_pointer(16);
270
+ }
271
+ }
272
+ /**
273
+ * @param {string} isa
274
+ * @returns {string[]}
275
+ */
276
+ findObjectsByIsa(isa) {
277
+ try {
278
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
279
+ const ptr0 = passStringToWasm0(isa, wasm.__wbindgen_export, wasm.__wbindgen_export2);
280
+ const len0 = WASM_VECTOR_LEN;
281
+ wasm.xcodeproject_findObjectsByIsa(retptr, this.__wbg_ptr, ptr0, len0);
282
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
283
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
284
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
285
+ wasm.__wbindgen_export3(r0, r1 * 4, 4);
286
+ return v2;
287
+ } finally {
288
+ wasm.__wbindgen_add_to_stack_pointer(16);
289
+ }
290
+ }
291
+ /**
292
+ * @returns {string}
293
+ */
294
+ findOrphanedReferences() {
295
+ let deferred1_0;
296
+ let deferred1_1;
297
+ try {
298
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
299
+ wasm.xcodeproject_findOrphanedReferences(retptr, this.__wbg_ptr);
300
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
301
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
302
+ deferred1_0 = r0;
303
+ deferred1_1 = r1;
304
+ return getStringFromWasm0(r0, r1);
305
+ } finally {
306
+ wasm.__wbindgen_add_to_stack_pointer(16);
307
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
308
+ }
309
+ }
310
+ /**
311
+ * @param {string} target_uuid
312
+ * @param {string} key
313
+ * @returns {string | undefined}
314
+ */
315
+ getBuildSetting(target_uuid, key) {
316
+ try {
317
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
318
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
319
+ const len0 = WASM_VECTOR_LEN;
320
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
321
+ const len1 = WASM_VECTOR_LEN;
322
+ wasm.xcodeproject_getBuildSetting(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
323
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
324
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
325
+ let v3;
326
+ if (r0 !== 0) {
327
+ v3 = getStringFromWasm0(r0, r1).slice();
328
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
329
+ }
330
+ return v3;
331
+ } finally {
332
+ wasm.__wbindgen_add_to_stack_pointer(16);
333
+ }
334
+ }
335
+ /**
336
+ * @param {string} group_uuid
337
+ * @returns {string[]}
338
+ */
339
+ getGroupChildren(group_uuid) {
340
+ try {
341
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
342
+ const ptr0 = passStringToWasm0(group_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
343
+ const len0 = WASM_VECTOR_LEN;
344
+ wasm.xcodeproject_getGroupChildren(retptr, this.__wbg_ptr, ptr0, len0);
345
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
346
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
347
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
348
+ wasm.__wbindgen_export3(r0, r1 * 4, 4);
349
+ return v2;
350
+ } finally {
351
+ wasm.__wbindgen_add_to_stack_pointer(16);
352
+ }
353
+ }
354
+ /**
355
+ * @returns {string[]}
356
+ */
357
+ getNativeTargets() {
358
+ try {
359
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
360
+ wasm.xcodeproject_getNativeTargets(retptr, this.__wbg_ptr);
361
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
362
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
363
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
364
+ wasm.__wbindgen_export3(r0, r1 * 4, 4);
365
+ return v1;
366
+ } finally {
367
+ wasm.__wbindgen_add_to_stack_pointer(16);
368
+ }
369
+ }
370
+ /**
371
+ * @param {string} uuid
372
+ * @param {string} key
373
+ * @returns {string | undefined}
374
+ */
375
+ getObjectProperty(uuid, key) {
376
+ try {
377
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
378
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
379
+ const len0 = WASM_VECTOR_LEN;
380
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
381
+ const len1 = WASM_VECTOR_LEN;
382
+ wasm.xcodeproject_getObjectProperty(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
383
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
384
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
385
+ let v3;
386
+ if (r0 !== 0) {
387
+ v3 = getStringFromWasm0(r0, r1).slice();
388
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
389
+ }
390
+ return v3;
391
+ } finally {
392
+ wasm.__wbindgen_add_to_stack_pointer(16);
393
+ }
394
+ }
395
+ /**
396
+ * @param {string} target_uuid
397
+ * @returns {string | undefined}
398
+ */
399
+ getTargetName(target_uuid) {
400
+ try {
401
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
402
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
403
+ const len0 = WASM_VECTOR_LEN;
404
+ wasm.xcodeproject_getTargetName(retptr, this.__wbg_ptr, ptr0, len0);
405
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
406
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
407
+ let v2;
408
+ if (r0 !== 0) {
409
+ v2 = getStringFromWasm0(r0, r1).slice();
410
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
411
+ }
412
+ return v2;
413
+ } finally {
414
+ wasm.__wbindgen_add_to_stack_pointer(16);
415
+ }
416
+ }
417
+ /**
418
+ * @param {string} seed
419
+ * @returns {string}
420
+ */
421
+ getUniqueId(seed) {
422
+ let deferred2_0;
423
+ let deferred2_1;
424
+ try {
425
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
426
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
427
+ const len0 = WASM_VECTOR_LEN;
428
+ wasm.xcodeproject_getUniqueId(retptr, this.__wbg_ptr, ptr0, len0);
429
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
430
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
431
+ deferred2_0 = r0;
432
+ deferred2_1 = r1;
433
+ return getStringFromWasm0(r0, r1);
434
+ } finally {
435
+ wasm.__wbindgen_add_to_stack_pointer(16);
436
+ wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
437
+ }
438
+ }
439
+ /**
440
+ * @returns {string | undefined}
441
+ */
442
+ get mainGroupUuid() {
443
+ try {
444
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
445
+ wasm.xcodeproject_mainGroupUuid(retptr, this.__wbg_ptr);
446
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
447
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
448
+ let v1;
449
+ if (r0 !== 0) {
450
+ v1 = getStringFromWasm0(r0, r1).slice();
451
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
452
+ }
453
+ return v1;
454
+ } finally {
455
+ wasm.__wbindgen_add_to_stack_pointer(16);
456
+ }
457
+ }
458
+ /**
459
+ * Parse a .pbxproj string into an XcodeProject.
460
+ * @param {string} content
461
+ */
462
+ constructor(content) {
463
+ try {
464
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
465
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
466
+ const len0 = WASM_VECTOR_LEN;
467
+ wasm.xcodeproject_new(retptr, ptr0, len0);
468
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
469
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
470
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
471
+ if (r2) {
472
+ throw takeObject(r1);
473
+ }
474
+ this.__wbg_ptr = r0 >>> 0;
475
+ XcodeProjectFinalization.register(this, this.__wbg_ptr, this);
476
+ return this;
477
+ } finally {
478
+ wasm.__wbindgen_add_to_stack_pointer(16);
479
+ }
480
+ }
481
+ /**
482
+ * @returns {bigint}
483
+ */
484
+ get objectVersion() {
485
+ const ret = wasm.xcodeproject_objectVersion(this.__wbg_ptr);
486
+ return ret;
487
+ }
488
+ /**
489
+ * @param {string} target_uuid
490
+ * @param {string} key
491
+ * @returns {boolean}
492
+ */
493
+ removeBuildSetting(target_uuid, key) {
494
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
495
+ const len0 = WASM_VECTOR_LEN;
496
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
497
+ const len1 = WASM_VECTOR_LEN;
498
+ const ret = wasm.xcodeproject_removeBuildSetting(this.__wbg_ptr, ptr0, len0, ptr1, len1);
499
+ return ret !== 0;
500
+ }
501
+ /**
502
+ * @param {string} target_uuid
503
+ * @param {string} key
504
+ * @param {string} value
505
+ * @returns {boolean}
506
+ */
507
+ setBuildSetting(target_uuid, key, value) {
508
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
509
+ const len0 = WASM_VECTOR_LEN;
510
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
+ const len1 = WASM_VECTOR_LEN;
512
+ const ptr2 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
513
+ const len2 = WASM_VECTOR_LEN;
514
+ const ret = wasm.xcodeproject_setBuildSetting(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
515
+ return ret !== 0;
516
+ }
517
+ /**
518
+ * @param {string} uuid
519
+ * @param {string} key
520
+ * @param {string} value
521
+ * @returns {boolean}
522
+ */
523
+ setObjectProperty(uuid, key, value) {
524
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
525
+ const len0 = WASM_VECTOR_LEN;
526
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
527
+ const len1 = WASM_VECTOR_LEN;
528
+ const ptr2 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
529
+ const len2 = WASM_VECTOR_LEN;
530
+ const ret = wasm.xcodeproject_setObjectProperty(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
531
+ return ret !== 0;
532
+ }
533
+ /**
534
+ * @param {string} target_uuid
535
+ * @param {string} name
536
+ * @returns {boolean}
537
+ */
538
+ setTargetName(target_uuid, name) {
539
+ const ptr0 = passStringToWasm0(target_uuid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
540
+ const len0 = WASM_VECTOR_LEN;
541
+ const ptr1 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
542
+ const len1 = WASM_VECTOR_LEN;
543
+ const ret = wasm.xcodeproject_setTargetName(this.__wbg_ptr, ptr0, len0, ptr1, len1);
544
+ return ret !== 0;
545
+ }
546
+ /**
547
+ * Serialize the project back to .pbxproj format.
548
+ * @returns {string}
549
+ */
550
+ toBuild() {
551
+ let deferred1_0;
552
+ let deferred1_1;
553
+ try {
554
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
555
+ wasm.xcodeproject_toBuild(retptr, this.__wbg_ptr);
556
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
557
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
558
+ deferred1_0 = r0;
559
+ deferred1_1 = r1;
560
+ return getStringFromWasm0(r0, r1);
561
+ } finally {
562
+ wasm.__wbindgen_add_to_stack_pointer(16);
563
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
564
+ }
565
+ }
566
+ /**
567
+ * Convert the project to a JSON string.
568
+ * @returns {string}
569
+ */
570
+ toJSON() {
571
+ let deferred2_0;
572
+ let deferred2_1;
573
+ try {
574
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
575
+ wasm.xcodeproject_toJSON(retptr, this.__wbg_ptr);
576
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
577
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
578
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
579
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
580
+ var ptr1 = r0;
581
+ var len1 = r1;
582
+ if (r3) {
583
+ ptr1 = 0; len1 = 0;
584
+ throw takeObject(r2);
585
+ }
586
+ deferred2_0 = ptr1;
587
+ deferred2_1 = len1;
588
+ return getStringFromWasm0(ptr1, len1);
589
+ } finally {
590
+ wasm.__wbindgen_add_to_stack_pointer(16);
591
+ wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
592
+ }
593
+ }
594
+ }
595
+ if (Symbol.dispose) XcodeProject.prototype[Symbol.dispose] = XcodeProject.prototype.free;
596
+
597
+ /**
598
+ * Serialize a JSON string back to .pbxproj format.
599
+ * @param {string} json
600
+ * @returns {string}
601
+ */
602
+ export function build(json) {
603
+ let deferred3_0;
604
+ let deferred3_1;
605
+ try {
606
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
607
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
608
+ const len0 = WASM_VECTOR_LEN;
609
+ wasm.build(retptr, ptr0, len0);
610
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
611
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
612
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
613
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
614
+ var ptr2 = r0;
615
+ var len2 = r1;
616
+ if (r3) {
617
+ ptr2 = 0; len2 = 0;
618
+ throw takeObject(r2);
619
+ }
620
+ deferred3_0 = ptr2;
621
+ deferred3_1 = len2;
622
+ return getStringFromWasm0(ptr2, len2);
623
+ } finally {
624
+ wasm.__wbindgen_add_to_stack_pointer(16);
625
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
626
+ }
627
+ }
628
+
629
+ /**
630
+ * Parse a .pbxproj string into a JSON string.
631
+ * @param {string} text
632
+ * @returns {string}
633
+ */
634
+ export function parse(text) {
635
+ let deferred3_0;
636
+ let deferred3_1;
637
+ try {
638
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
639
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
640
+ const len0 = WASM_VECTOR_LEN;
641
+ wasm.parse(retptr, ptr0, len0);
642
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
643
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
644
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
645
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
646
+ var ptr2 = r0;
647
+ var len2 = r1;
648
+ if (r3) {
649
+ ptr2 = 0; len2 = 0;
650
+ throw takeObject(r2);
651
+ }
652
+ deferred3_0 = ptr2;
653
+ deferred3_1 = len2;
654
+ return getStringFromWasm0(ptr2, len2);
655
+ } finally {
656
+ wasm.__wbindgen_add_to_stack_pointer(16);
657
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
658
+ }
659
+ }
660
+
661
+ /**
662
+ * Parse and immediately re-serialize a .pbxproj string.
663
+ * @param {string} text
664
+ * @returns {string}
665
+ */
666
+ export function parseAndBuild(text) {
667
+ let deferred3_0;
668
+ let deferred3_1;
669
+ try {
670
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
671
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
672
+ const len0 = WASM_VECTOR_LEN;
673
+ wasm.parseAndBuild(retptr, ptr0, len0);
674
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
675
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
676
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
677
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
678
+ var ptr2 = r0;
679
+ var len2 = r1;
680
+ if (r3) {
681
+ ptr2 = 0; len2 = 0;
682
+ throw takeObject(r2);
683
+ }
684
+ deferred3_0 = ptr2;
685
+ deferred3_1 = len2;
686
+ return getStringFromWasm0(ptr2, len2);
687
+ } finally {
688
+ wasm.__wbindgen_add_to_stack_pointer(16);
689
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
690
+ }
691
+ }
692
+ export function __wbg_Error_8c4e43fe74559d73(arg0, arg1) {
693
+ const ret = Error(getStringFromWasm0(arg0, arg1));
694
+ return addHeapObject(ret);
695
+ }
696
+ export function __wbg___wbindgen_throw_be289d5034ed271b(arg0, arg1) {
697
+ throw new Error(getStringFromWasm0(arg0, arg1));
698
+ }
699
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
700
+ // Cast intrinsic for `Ref(String) -> Externref`.
701
+ const ret = getStringFromWasm0(arg0, arg1);
702
+ return addHeapObject(ret);
703
+ }
704
+ const XcodeProjectFinalization = (typeof FinalizationRegistry === 'undefined')
705
+ ? { register: () => {}, unregister: () => {} }
706
+ : new FinalizationRegistry(ptr => wasm.__wbg_xcodeproject_free(ptr >>> 0, 1));
707
+
708
+ function addHeapObject(obj) {
709
+ if (heap_next === heap.length) heap.push(heap.length + 1);
710
+ const idx = heap_next;
711
+ heap_next = heap[idx];
712
+
713
+ heap[idx] = obj;
714
+ return idx;
715
+ }
716
+
717
+ function dropObject(idx) {
718
+ if (idx < 132) return;
719
+ heap[idx] = heap_next;
720
+ heap_next = idx;
721
+ }
722
+
723
+ function getArrayJsValueFromWasm0(ptr, len) {
724
+ ptr = ptr >>> 0;
725
+ const mem = getDataViewMemory0();
726
+ const result = [];
727
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
728
+ result.push(takeObject(mem.getUint32(i, true)));
729
+ }
730
+ return result;
731
+ }
732
+
733
+ let cachedDataViewMemory0 = null;
734
+ function getDataViewMemory0() {
735
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
736
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
737
+ }
738
+ return cachedDataViewMemory0;
739
+ }
740
+
741
+ function getStringFromWasm0(ptr, len) {
742
+ ptr = ptr >>> 0;
743
+ return decodeText(ptr, len);
744
+ }
745
+
746
+ let cachedUint8ArrayMemory0 = null;
747
+ function getUint8ArrayMemory0() {
748
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
749
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
750
+ }
751
+ return cachedUint8ArrayMemory0;
752
+ }
753
+
754
+ function getObject(idx) { return heap[idx]; }
755
+
756
+ let heap = new Array(128).fill(undefined);
757
+ heap.push(undefined, null, true, false);
758
+
759
+ let heap_next = heap.length;
760
+
761
+ function isLikeNone(x) {
762
+ return x === undefined || x === null;
763
+ }
764
+
765
+ function passStringToWasm0(arg, malloc, realloc) {
766
+ if (realloc === undefined) {
767
+ const buf = cachedTextEncoder.encode(arg);
768
+ const ptr = malloc(buf.length, 1) >>> 0;
769
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
770
+ WASM_VECTOR_LEN = buf.length;
771
+ return ptr;
772
+ }
773
+
774
+ let len = arg.length;
775
+ let ptr = malloc(len, 1) >>> 0;
776
+
777
+ const mem = getUint8ArrayMemory0();
778
+
779
+ let offset = 0;
780
+
781
+ for (; offset < len; offset++) {
782
+ const code = arg.charCodeAt(offset);
783
+ if (code > 0x7F) break;
784
+ mem[ptr + offset] = code;
785
+ }
786
+ if (offset !== len) {
787
+ if (offset !== 0) {
788
+ arg = arg.slice(offset);
789
+ }
790
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
791
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
792
+ const ret = cachedTextEncoder.encodeInto(arg, view);
793
+
794
+ offset += ret.written;
795
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
796
+ }
797
+
798
+ WASM_VECTOR_LEN = offset;
799
+ return ptr;
800
+ }
801
+
802
+ function takeObject(idx) {
803
+ const ret = getObject(idx);
804
+ dropObject(idx);
805
+ return ret;
806
+ }
807
+
808
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
809
+ cachedTextDecoder.decode();
810
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
811
+ let numBytesDecoded = 0;
812
+ function decodeText(ptr, len) {
813
+ numBytesDecoded += len;
814
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
815
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
816
+ cachedTextDecoder.decode();
817
+ numBytesDecoded = len;
818
+ }
819
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
820
+ }
821
+
822
+ const cachedTextEncoder = new TextEncoder();
823
+
824
+ if (!('encodeInto' in cachedTextEncoder)) {
825
+ cachedTextEncoder.encodeInto = function (arg, view) {
826
+ const buf = cachedTextEncoder.encode(arg);
827
+ view.set(buf);
828
+ return {
829
+ read: arg.length,
830
+ written: buf.length
831
+ };
832
+ };
833
+ }
834
+
835
+ let WASM_VECTOR_LEN = 0;
836
+
837
+
838
+ let wasm;
839
+ export function __wbg_set_wasm(val) {
840
+ wasm = val;
841
+ }
package/xcode_bg.wasm ADDED
Binary file