xnip-darwin-x64 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES.md +66 -0
- package/binary.json +57 -0
- package/lib/validate.cjs +164 -0
- package/package.json +31 -4
- package/xnip +0 -0
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SeaLoong
|
|
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.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Third-party data notices
|
|
2
|
+
|
|
3
|
+
The TLS root certificate data bundled through webpki-roots 1.0.9 is provided under
|
|
4
|
+
CDLA-Permissive-2.0. Its license text is reproduced below.
|
|
5
|
+
|
|
6
|
+
# Community Data License Agreement - Permissive - Version 2.0
|
|
7
|
+
|
|
8
|
+
This is the Community Data License Agreement - Permissive, Version
|
|
9
|
+
2.0 (the "agreement"). Data Provider(s) and Data Recipient(s) agree
|
|
10
|
+
as follows:
|
|
11
|
+
|
|
12
|
+
## 1. Provision of the Data
|
|
13
|
+
|
|
14
|
+
1.1. A Data Recipient may use, modify, and share the Data made
|
|
15
|
+
available by Data Provider(s) under this agreement if that Data
|
|
16
|
+
Recipient follows the terms of this agreement.
|
|
17
|
+
|
|
18
|
+
1.2. This agreement does not impose any restriction on a Data
|
|
19
|
+
Recipient's use, modification, or sharing of any portions of the
|
|
20
|
+
Data that are in the public domain or that may be used, modified,
|
|
21
|
+
or shared under any other legal exception or limitation.
|
|
22
|
+
|
|
23
|
+
## 2. Conditions for Sharing Data
|
|
24
|
+
|
|
25
|
+
2.1. A Data Recipient may share Data, with or without modifications, so
|
|
26
|
+
long as the Data Recipient makes available the text of this agreement
|
|
27
|
+
with the shared Data.
|
|
28
|
+
|
|
29
|
+
## 3. No Restrictions on Results
|
|
30
|
+
|
|
31
|
+
3.1. This agreement does not impose any restriction or obligations
|
|
32
|
+
with respect to the use, modification, or sharing of Results.
|
|
33
|
+
|
|
34
|
+
## 4. No Warranty; Limitation of Liability
|
|
35
|
+
|
|
36
|
+
4.1. All Data Recipients receive the Data subject to the following
|
|
37
|
+
terms:
|
|
38
|
+
|
|
39
|
+
THE DATA IS PROVIDED ON AN "AS IS" BASIS, WITHOUT REPRESENTATIONS,
|
|
40
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED
|
|
41
|
+
INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
|
|
42
|
+
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
43
|
+
|
|
44
|
+
NO DATA PROVIDER SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
|
|
45
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
|
|
46
|
+
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
|
|
47
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
48
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE DATA OR RESULTS,
|
|
49
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
50
|
+
|
|
51
|
+
## 5. Definitions
|
|
52
|
+
|
|
53
|
+
5.1. "Data" means the material received by a Data Recipient under
|
|
54
|
+
this agreement.
|
|
55
|
+
|
|
56
|
+
5.2. "Data Provider" means any person who is the source of Data
|
|
57
|
+
provided under this agreement and in reliance on a Data Recipient's
|
|
58
|
+
agreement to its terms.
|
|
59
|
+
|
|
60
|
+
5.3. "Data Recipient" means any person who receives Data directly
|
|
61
|
+
or indirectly from a Data Provider and agrees to the terms of this
|
|
62
|
+
agreement.
|
|
63
|
+
|
|
64
|
+
5.4. "Results" means any outcome obtained by computational analysis
|
|
65
|
+
of Data, including for example machine learning models and models'
|
|
66
|
+
insights.
|
package/binary.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 2,
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"publication": "public-release",
|
|
5
|
+
"localOnly": false,
|
|
6
|
+
"release": {
|
|
7
|
+
"schema_version": 1,
|
|
8
|
+
"version": "0.5.3",
|
|
9
|
+
"source_commit": "ad9baa1b2541a9b4b6bf0b39ac5c41a5848a657d",
|
|
10
|
+
"archives": {
|
|
11
|
+
"linux-x64": {
|
|
12
|
+
"package": "xnip-linux-x64-musl",
|
|
13
|
+
"target": "x86_64-unknown-linux-musl",
|
|
14
|
+
"archive_sha256": "aefdb9875013ce97e8848cfa234c3c70bc916959c281fac9e500010949c29e7c",
|
|
15
|
+
"sha256": "c11a36159a3626714ad92ba77860d6593c486efd22d38e760e70cd3c467d0467"
|
|
16
|
+
},
|
|
17
|
+
"linux-arm64": {
|
|
18
|
+
"package": "xnip-linux-arm64-musl",
|
|
19
|
+
"target": "aarch64-unknown-linux-musl",
|
|
20
|
+
"archive_sha256": "92fefdcf4ddae3631f1272fc707c36ec28101687e6064f64ae7c8a8b59f0f555",
|
|
21
|
+
"sha256": "859dfa56ebf467cc739208ed73b9b476b2e1d7f2da79706bef118e2f45fafb87"
|
|
22
|
+
},
|
|
23
|
+
"darwin-x64": {
|
|
24
|
+
"package": "xnip-darwin-x64",
|
|
25
|
+
"target": "x86_64-apple-darwin",
|
|
26
|
+
"archive_sha256": "ea95c59417d69768671bb7498756d4c0b4b3e7f9a5fde2afef4a7fd426444e81",
|
|
27
|
+
"sha256": "9b2320b6fd11e3c88079fffa26b4cfb5c8da003c2dc1528189e226820a441338"
|
|
28
|
+
},
|
|
29
|
+
"darwin-arm64": {
|
|
30
|
+
"package": "xnip-darwin-arm64",
|
|
31
|
+
"target": "aarch64-apple-darwin",
|
|
32
|
+
"archive_sha256": "9d19ff6f6e35b2cb534557c5a3ac12494a0ddec9aeb1dc42562bd116e9b55d41",
|
|
33
|
+
"sha256": "1c65ffd3cdfaec7b4edf3278eab68974f8f5dee0b8df1868da2f1760af167174"
|
|
34
|
+
},
|
|
35
|
+
"win32-x64": {
|
|
36
|
+
"package": "xnip-win32-x64",
|
|
37
|
+
"target": "x86_64-pc-windows-msvc",
|
|
38
|
+
"archive_sha256": "90d08b42f15ee30eeeae748e5bd80de4de544c120dbdbf35eae992df478daedc",
|
|
39
|
+
"sha256": "f21cc1447595b5ebd5ca7fe54de815c189d398c8de7fef4f5bc08ee06f6d59f8"
|
|
40
|
+
},
|
|
41
|
+
"win32-arm64": {
|
|
42
|
+
"package": "xnip-win32-arm64",
|
|
43
|
+
"target": "aarch64-pc-windows-msvc",
|
|
44
|
+
"archive_sha256": "cbe92200f1fcf2b3604617e66e77e27614eb32efc343d8ddac1bd43b41b4d729",
|
|
45
|
+
"sha256": "3e167d4b6bae6ea11dc00da17035d62b81f2dfc9c7e632a1eb8e6ffbd10b39e4"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"package": "xnip-darwin-x64",
|
|
50
|
+
"target": "x86_64-apple-darwin",
|
|
51
|
+
"binary": "xnip",
|
|
52
|
+
"sha256": "9b2320b6fd11e3c88079fffa26b4cfb5c8da003c2dc1528189e226820a441338",
|
|
53
|
+
"size": 7195968,
|
|
54
|
+
"format": "Mach-O",
|
|
55
|
+
"archive_sha256": "ea95c59417d69768671bb7498756d4c0b4b3e7f9a5fde2afef4a7fd426444e81",
|
|
56
|
+
"source_commit": "ad9baa1b2541a9b4b6bf0b39ac5c41a5848a657d"
|
|
57
|
+
}
|
package/lib/validate.cjs
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Both parent and native packages carry this validator. It never executes a
|
|
3
|
+
// payload, downloads files, authenticates or publishes.
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const crypto = require("node:crypto");
|
|
7
|
+
const base = path.resolve(__dirname, "..");
|
|
8
|
+
const repository = "https://github.com/SeaLoong/xnip.git";
|
|
9
|
+
const platforms = {
|
|
10
|
+
"linux-x64": ["x86_64-unknown-linux-musl", "xnip-linux-x64-musl"],
|
|
11
|
+
"linux-arm64": ["aarch64-unknown-linux-musl", "xnip-linux-arm64-musl"],
|
|
12
|
+
"darwin-x64": ["x86_64-apple-darwin", "xnip-darwin-x64"],
|
|
13
|
+
"darwin-arm64": ["aarch64-apple-darwin", "xnip-darwin-arm64"],
|
|
14
|
+
"win32-x64": ["x86_64-pc-windows-msvc", "xnip-win32-x64"],
|
|
15
|
+
"win32-arm64": ["aarch64-pc-windows-msvc", "xnip-win32-arm64"],
|
|
16
|
+
};
|
|
17
|
+
const maxExecutable = 128 * 1024 * 1024;
|
|
18
|
+
const hex = (value, width) => typeof value === "string" && new RegExp("^[a-f0-9]{" + width + "}$").test(value);
|
|
19
|
+
const hash = data => crypto.createHash("sha256").update(data).digest("hex");
|
|
20
|
+
const fail = message => { throw new Error("xnip prepack: " + message); };
|
|
21
|
+
function ordinary(relative) {
|
|
22
|
+
if (typeof relative !== "string" || !relative || relative.includes("\0")
|
|
23
|
+
|| path.isAbsolute(relative) || relative.split(/[\\/]/).includes("..")) fail("unsafe package path");
|
|
24
|
+
const file = path.resolve(base, relative);
|
|
25
|
+
const stat = fs.lstatSync(file);
|
|
26
|
+
if (!stat.isFile() || stat.isSymbolicLink()) fail("expected ordinary file: " + relative);
|
|
27
|
+
return { file, stat };
|
|
28
|
+
}
|
|
29
|
+
function json(relative) {
|
|
30
|
+
return JSON.parse(fs.readFileSync(ordinary(relative).file, "utf8"));
|
|
31
|
+
}
|
|
32
|
+
function exactKeys(value, keys) {
|
|
33
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
34
|
+
&& Object.keys(value).sort().join("|") === [...keys].sort().join("|");
|
|
35
|
+
}
|
|
36
|
+
function validRelease(release, version) {
|
|
37
|
+
if (!release || release.schema_version !== 1 || release.version !== version
|
|
38
|
+
|| !hex(release.source_commit, 40) || !exactKeys(release.archives, Object.keys(platforms))) fail("invalid six-platform release provenance");
|
|
39
|
+
for (const [key, [target, name]] of Object.entries(platforms)) {
|
|
40
|
+
const entry = release.archives[key];
|
|
41
|
+
if (!entry || entry.target !== target || entry.package !== name
|
|
42
|
+
|| !hex(entry.archive_sha256, 64) || !hex(entry.sha256, 64)) fail("invalid release archive provenance: " + key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function publication(metadata, pkg) {
|
|
46
|
+
if (metadata.schema_version !== 2 || metadata.version !== pkg.version
|
|
47
|
+
|| typeof metadata.localOnly !== "boolean") fail("invalid preparation identity");
|
|
48
|
+
if (metadata.publication === "public-release") {
|
|
49
|
+
if (pkg.private !== false || metadata.localOnly !== false
|
|
50
|
+
|| pkg.publishConfig?.access !== "public" || pkg.bundledDependencies || pkg.bundleDependencies) fail("public release cannot contain private or host-local metadata");
|
|
51
|
+
validRelease(metadata.release, pkg.version);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (metadata.publication !== "private-local" || pkg.private !== true || metadata.release !== null) fail("private flag does not authorize a public release");
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
function identity(entry, key, localOnly, isPublic, release) {
|
|
58
|
+
const expected = platforms[key];
|
|
59
|
+
if (!expected) fail("unknown platform " + key);
|
|
60
|
+
const gnuLocal = localOnly && key.startsWith("linux-")
|
|
61
|
+
&& entry.target === expected[0].replace("-musl", "-gnu")
|
|
62
|
+
&& entry.package === "xnip-" + key + "-gnu-local";
|
|
63
|
+
if (!gnuLocal && (entry.target !== expected[0] || entry.package !== expected[1])) fail("platform package/target mismatch: " + key);
|
|
64
|
+
const binary = key.startsWith("win32-") ? "xnip.exe" : "xnip";
|
|
65
|
+
if (entry.binary !== binary || !hex(entry.sha256, 64)
|
|
66
|
+
|| !Number.isSafeInteger(entry.size) || entry.size <= 0 || entry.size > maxExecutable) fail("invalid executable identity: " + key);
|
|
67
|
+
if (localOnly ? entry.source !== "local-host-build" : entry.source !== undefined) fail("invalid local build provenance");
|
|
68
|
+
if (isPublic) {
|
|
69
|
+
const archive = release.archives[key];
|
|
70
|
+
if (!hex(entry.archive_sha256, 64) || entry.archive_sha256 !== archive.archive_sha256
|
|
71
|
+
|| entry.sha256 !== archive.sha256 || entry.source_commit !== release.source_commit
|
|
72
|
+
|| gnuLocal || entry.format === "dynamic ELF (host-local only)") fail("public payload does not match release provenance");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function binaryFormat(data, key, allowDynamic) {
|
|
76
|
+
const arch = key.split("-")[1];
|
|
77
|
+
if (key.startsWith("win32-")) {
|
|
78
|
+
if (data.length < 64 || data.toString("latin1", 0, 2) !== "MZ") fail("not a PE executable");
|
|
79
|
+
const offset = data.readUInt32LE(60);
|
|
80
|
+
if (offset + 6 > data.length || data.toString("latin1", offset, offset + 4) !== "PE\0\0") fail("invalid PE header");
|
|
81
|
+
if (data.readUInt16LE(offset + 4) !== (arch === "x64" ? 0x8664 : 0xaa64)) fail("PE architecture mismatch");
|
|
82
|
+
return "PE";
|
|
83
|
+
}
|
|
84
|
+
if (key.startsWith("darwin-")) {
|
|
85
|
+
if (data.length < 32 || data.readUInt32LE(0) !== 0xfeedfacf) fail("not a Mach-O 64 executable");
|
|
86
|
+
if (data.readUInt32LE(4) !== (arch === "x64" ? 0x1000007 : 0x100000c)) fail("Mach-O architecture mismatch");
|
|
87
|
+
return "Mach-O";
|
|
88
|
+
}
|
|
89
|
+
if (data.length < 64 || data.toString("latin1", 0, 6) !== "\x7fELF\x02\x01") fail("not a little-endian ELF 64 executable");
|
|
90
|
+
if (data.readUInt16LE(18) !== (arch === "x64" ? 62 : 183)) fail("ELF architecture mismatch");
|
|
91
|
+
const integer64 = offset => {
|
|
92
|
+
const value = data.readBigUInt64LE(offset);
|
|
93
|
+
if (value > BigInt(Number.MAX_SAFE_INTEGER)) fail("oversized ELF offset");
|
|
94
|
+
return Number(value);
|
|
95
|
+
};
|
|
96
|
+
const offset = integer64(32), width = data.readUInt16LE(54), count = data.readUInt16LE(56);
|
|
97
|
+
if (width < 56 || count > 1024 || offset + width * count > data.length) fail("invalid ELF program headers");
|
|
98
|
+
let dynamic = false;
|
|
99
|
+
for (let index = 0; index < count; index++) {
|
|
100
|
+
const header = offset + width * index, kind = data.readUInt32LE(header);
|
|
101
|
+
if (kind === 3) dynamic = true;
|
|
102
|
+
if (kind === 2) {
|
|
103
|
+
const start = integer64(header + 8), size = integer64(header + 32);
|
|
104
|
+
if (start + size > data.length || size % 16) fail("invalid ELF dynamic table");
|
|
105
|
+
for (let at = start; at < start + size; at += 16) {
|
|
106
|
+
if (data.readBigInt64LE(at) === 1n) dynamic = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (dynamic && !allowDynamic) fail("Linux distribution payload must be static, without interpreter/shared dependencies");
|
|
111
|
+
return dynamic ? "dynamic ELF (host-local only)" : "static ELF";
|
|
112
|
+
}
|
|
113
|
+
const pkg = json("package.json");
|
|
114
|
+
if (!/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.+-]+)?$/.test(pkg.version)
|
|
115
|
+
|| pkg.repository?.type !== "git" || pkg.repository?.url !== repository
|
|
116
|
+
|| !exactKeys(pkg.scripts, ["prepack"]) || pkg.scripts.prepack !== "node lib/validate.cjs") fail("invalid package version/repository/prepack metadata");
|
|
117
|
+
const native = fs.existsSync(path.join(base, "binary.json"));
|
|
118
|
+
const metadata = json(native ? "binary.json" : "native-manifest.json");
|
|
119
|
+
const isPublic = publication(metadata, pkg);
|
|
120
|
+
for (const relative of ["LICENSE", "THIRD_PARTY_LICENSES.md"]) ordinary(relative);
|
|
121
|
+
if (native) {
|
|
122
|
+
const keys = Object.keys(platforms).filter(key => pkg.name === platforms[key][1]
|
|
123
|
+
|| pkg.name === "xnip-" + key + "-gnu-local");
|
|
124
|
+
if (keys.length !== 1) fail("invalid native package name");
|
|
125
|
+
const key = keys[0], [os, cpu] = key.split("-");
|
|
126
|
+
identity(metadata, key, metadata.localOnly, isPublic, metadata.release);
|
|
127
|
+
if (JSON.stringify(pkg.files) !== JSON.stringify([metadata.binary,"binary.json","lib/validate.cjs","LICENSE","THIRD_PARTY_LICENSES.md"])) fail("native package file allowlist mismatch");
|
|
128
|
+
if (metadata.package !== pkg.name || !exactKeys(pkg.exports, ["./package.json"])
|
|
129
|
+
|| pkg.exports["./package.json"] !== "./package.json"
|
|
130
|
+
|| JSON.stringify(pkg.os) !== JSON.stringify([os]) || JSON.stringify(pkg.cpu) !== JSON.stringify([cpu])) fail("native package platform metadata mismatch");
|
|
131
|
+
const { file, stat } = ordinary(metadata.binary);
|
|
132
|
+
if (stat.size !== metadata.size || stat.size > maxExecutable) fail("native executable size mismatch");
|
|
133
|
+
const bytes = fs.readFileSync(file);
|
|
134
|
+
if (hash(bytes) !== metadata.sha256) fail("native executable checksum mismatch");
|
|
135
|
+
const markers = new Set([...bytes.toString("latin1").matchAll(/\x00XNIP_BUILD_ID_V1:([0-9A-Za-z.+-]+)\|([0-9A-Za-z_-]+)\x00/g)]
|
|
136
|
+
.map(match => match[1] + "|" + match[2]));
|
|
137
|
+
if (markers.size !== 1 || !markers.has(pkg.version + "|" + metadata.target)) fail("binary build identity mismatch");
|
|
138
|
+
const format = binaryFormat(bytes, key, metadata.localOnly && metadata.target.endsWith("-gnu"));
|
|
139
|
+
if (format !== metadata.format) fail("executable format metadata mismatch");
|
|
140
|
+
} else {
|
|
141
|
+
if (JSON.stringify(pkg.files) !== JSON.stringify(["bin/","lib/","integrations/","native-manifest.json","README.md","LICENSE","THIRD_PARTY_LICENSES.md"])) fail("parent package file allowlist mismatch");
|
|
142
|
+
if (pkg.name !== "xnip" || metadata.repository?.url !== repository || metadata.repository?.type !== "git") fail("invalid parent package identity");
|
|
143
|
+
const present = Object.keys(metadata.platforms || {});
|
|
144
|
+
if (present.length !== (metadata.localOnly ? 1 : 6)
|
|
145
|
+
|| present.some(key => !platforms[key])) fail("invalid prepared platform set");
|
|
146
|
+
const expectedDependencies = {};
|
|
147
|
+
for (const key of present) {
|
|
148
|
+
const entry = metadata.platforms[key];
|
|
149
|
+
identity(entry, key, metadata.localOnly, isPublic, metadata.release);
|
|
150
|
+
expectedDependencies[entry.package] = pkg.version;
|
|
151
|
+
}
|
|
152
|
+
if (!exactKeys(pkg.optionalDependencies, Object.keys(expectedDependencies))
|
|
153
|
+
|| Object.entries(expectedDependencies).some(([name, version]) => pkg.optionalDependencies[name] !== version)) fail("optional dependencies must pin every platform exactly");
|
|
154
|
+
if (metadata.localOnly && JSON.stringify(pkg.bundledDependencies) !== JSON.stringify(Object.keys(expectedDependencies))) fail("private host-local package must bundle its one payload");
|
|
155
|
+
const required = {
|
|
156
|
+
"./native": "./lib/native.cjs", "./dsh": "./integrations/dsh/index.mjs",
|
|
157
|
+
"./pi": "./integrations/pi/index.mjs", "./package.json": "./package.json",
|
|
158
|
+
};
|
|
159
|
+
if (pkg.bin?.xnip !== "./bin/xnip.cjs" || !exactKeys(pkg.exports, Object.keys(required))
|
|
160
|
+
|| Object.entries(required).some(([key, value]) => pkg.exports[key] !== value)
|
|
161
|
+
|| pkg.dsh?.bundle?.patch !== "./integrations/dsh/cordis.patch.yml"
|
|
162
|
+
|| JSON.stringify(pkg.pi?.extensions) !== '["./integrations/pi/index.mjs"]') fail("invalid CLI or harness entry points");
|
|
163
|
+
for (const relative of [pkg.bin.xnip, ...Object.values(required), pkg.dsh.bundle.patch]) ordinary(relative);
|
|
164
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xnip-darwin-x64",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/SeaLoong/xnip.git"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prepack": "node lib/validate.cjs"
|
|
12
|
+
},
|
|
13
|
+
"description": "xnip native executable for x86_64-apple-darwin",
|
|
14
|
+
"os": [
|
|
15
|
+
"darwin"
|
|
16
|
+
],
|
|
17
|
+
"cpu": [
|
|
18
|
+
"x64"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"xnip",
|
|
25
|
+
"binary.json",
|
|
26
|
+
"lib/validate.cjs",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"THIRD_PARTY_LICENSES.md"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/xnip
ADDED
|
Binary file
|
package/README.md
DELETED