@xcodekit/xcode-wasm 0.6.1 → 0.6.2
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 +3 -0
- package/package.json +5 -8
- package/xcode.d.ts +66 -0
- package/xcode.js +1209 -6
- package/xcode_bg.wasm +0 -0
- package/node-wrapper.js +0 -48
- package/xcode_bg.js +0 -1113
package/xcode_bg.wasm
CHANGED
|
Binary file
|
package/node-wrapper.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CJS wrapper for @xcodekit/xcode-wasm/node.
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* const { XcodeProject, parse, build } = require("@xcodekit/xcode-wasm/node");
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { readFileSync, writeFileSync } = require("fs");
|
|
9
|
-
const wasm = require("./xcode");
|
|
10
|
-
|
|
11
|
-
class XcodeProject extends wasm.XcodeProject {
|
|
12
|
-
/** @type {string | null} */
|
|
13
|
-
#filePath = null;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Open and parse a .pbxproj file from disk.
|
|
17
|
-
* @param {string} filePath
|
|
18
|
-
* @returns {XcodeProject}
|
|
19
|
-
*/
|
|
20
|
-
static open(filePath) {
|
|
21
|
-
const content = readFileSync(filePath, "utf8");
|
|
22
|
-
const project = new XcodeProject(content);
|
|
23
|
-
project.#filePath = filePath;
|
|
24
|
-
return project;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Parse a .pbxproj string (no file on disk needed).
|
|
29
|
-
* @param {string} content
|
|
30
|
-
* @returns {XcodeProject}
|
|
31
|
-
*/
|
|
32
|
-
static fromString(content) {
|
|
33
|
-
return new XcodeProject(content);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** The file path this project was opened from, or null if fromString/constructor. */
|
|
37
|
-
get filePath() {
|
|
38
|
-
return this.#filePath;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Write the project back to its original file. Throws if no file path is set. */
|
|
42
|
-
save() {
|
|
43
|
-
if (!this.#filePath) throw new Error("No file path set — use open() or save(path)");
|
|
44
|
-
writeFileSync(this.#filePath, this.toBuild());
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
module.exports = { ...wasm, XcodeProject };
|