@xcodekit/xcode-wasm 0.6.1 → 0.6.3

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/node-wrapper.mjs CHANGED
@@ -6,8 +6,13 @@
6
6
  */
7
7
 
8
8
  import { readFileSync, writeFileSync } from "fs";
9
+ import { fileURLToPath } from "url";
9
10
  import * as wasm from "./xcode.js";
10
11
 
12
+ const wasmPath = fileURLToPath(new URL("./xcode_bg.wasm", import.meta.url));
13
+ const wasmBytes = readFileSync(wasmPath);
14
+ await wasm.default({ module_or_path: wasmBytes });
15
+
11
16
  class XcodeProject extends wasm.XcodeProject {
12
17
  /** @type {string | null} */
13
18
  #filePath = null;
package/package.json CHANGED
@@ -2,22 +2,19 @@
2
2
  "name": "@xcodekit/xcode-wasm",
3
3
  "type": "module",
4
4
  "description": "Parse, manipulate, and serialize Xcode .pbxproj files (WASM build)",
5
- "version": "0.6.1",
5
+ "version": "0.6.3",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "xcode_bg.wasm",
9
9
  "xcode.js",
10
- "xcode_bg.js",
11
10
  "xcode.d.ts",
12
11
  "types.d.ts",
13
- "node-wrapper.js",
14
12
  "node-wrapper.mjs",
15
13
  "node-wrapper.d.ts"
16
14
  ],
17
15
  "main": "xcode.js",
18
16
  "types": "xcode.d.ts",
19
17
  "sideEffects": [
20
- "./xcode.js",
21
18
  "./snippets/*"
22
19
  ],
23
20
  "repository": {
@@ -38,14 +35,14 @@
38
35
  "types": "./types.d.ts"
39
36
  },
40
37
  ".": {
38
+ "types": "./xcode.d.ts",
41
39
  "import": "./xcode.js",
42
- "require": "./xcode.js",
43
- "types": "./xcode.d.ts"
40
+ "default": "./xcode.js"
44
41
  },
45
42
  "./node": {
43
+ "types": "./node-wrapper.d.ts",
46
44
  "import": "./node-wrapper.mjs",
47
- "require": "./node-wrapper.js",
48
- "types": "./node-wrapper.d.ts"
45
+ "default": "./node-wrapper.mjs"
49
46
  }
50
47
  }
51
48
  }
package/xcode.d.ts CHANGED
@@ -64,3 +64,69 @@ export function parse(text: string): any;
64
64
  * Parse and immediately re-serialize a .pbxproj string.
65
65
  */
66
66
  export function parseAndBuild(text: string): string;
67
+
68
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
69
+
70
+ export interface InitOutput {
71
+ readonly memory: WebAssembly.Memory;
72
+ readonly __wbg_xcodeproject_free: (a: number, b: number) => void;
73
+ readonly build: (a: number, b: number) => void;
74
+ readonly parse: (a: number, b: number, c: number) => void;
75
+ readonly parseAndBuild: (a: number, b: number, c: number) => void;
76
+ readonly xcodeproject_addBuildFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
77
+ readonly xcodeproject_addDependency: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
78
+ readonly xcodeproject_addFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
79
+ readonly xcodeproject_addFileSystemSyncGroup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
80
+ readonly xcodeproject_addFramework: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
81
+ readonly xcodeproject_addGroup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
82
+ readonly xcodeproject_archiveVersion: (a: number) => bigint;
83
+ readonly xcodeproject_createNativeTarget: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
84
+ readonly xcodeproject_embedExtension: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
85
+ readonly xcodeproject_ensureBuildPhase: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
86
+ readonly xcodeproject_findMainAppTarget: (a: number, b: number, c: number, d: number) => void;
87
+ readonly xcodeproject_findObjectsByIsa: (a: number, b: number, c: number, d: number) => void;
88
+ readonly xcodeproject_findOrphanedReferences: (a: number, b: number) => void;
89
+ readonly xcodeproject_getBuildSetting: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
90
+ readonly xcodeproject_getGroupChildren: (a: number, b: number, c: number, d: number) => void;
91
+ readonly xcodeproject_getNativeTargets: (a: number, b: number) => void;
92
+ readonly xcodeproject_getObjectProperty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
93
+ readonly xcodeproject_getTargetName: (a: number, b: number, c: number, d: number) => void;
94
+ readonly xcodeproject_getUniqueId: (a: number, b: number, c: number, d: number) => void;
95
+ readonly xcodeproject_mainGroupUuid: (a: number, b: number) => void;
96
+ readonly xcodeproject_new: (a: number, b: number, c: number) => void;
97
+ readonly xcodeproject_objectVersion: (a: number) => bigint;
98
+ readonly xcodeproject_removeBuildSetting: (a: number, b: number, c: number, d: number, e: number) => number;
99
+ readonly xcodeproject_renameTarget: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
100
+ readonly xcodeproject_setBuildSetting: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
101
+ readonly xcodeproject_setObjectProperty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
102
+ readonly xcodeproject_setTargetName: (a: number, b: number, c: number, d: number, e: number) => number;
103
+ readonly xcodeproject_toBuild: (a: number, b: number) => void;
104
+ readonly xcodeproject_toJSON: (a: number, b: number) => void;
105
+ readonly __wbindgen_export: (a: number, b: number) => number;
106
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
107
+ readonly __wbindgen_export3: (a: number) => void;
108
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
109
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
110
+ }
111
+
112
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
113
+
114
+ /**
115
+ * Instantiates the given `module`, which can either be bytes or
116
+ * a precompiled `WebAssembly.Module`.
117
+ *
118
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
119
+ *
120
+ * @returns {InitOutput}
121
+ */
122
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
123
+
124
+ /**
125
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
126
+ * for everything else, calls `WebAssembly.instantiate` directly.
127
+ *
128
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
129
+ *
130
+ * @returns {Promise<InitOutput>}
131
+ */
132
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;