@tide-ota/cli 0.0.0-stage → 0.1.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/dist/s3.js ADDED
@@ -0,0 +1,221 @@
1
+ import { S3Error, childElements, parseS3Xml, readS3Text, s3Absent, s3BodyProblem, s3ErrorCode, s3Fetch, s3Target, textOf, } from "@tide-ota/protocol";
2
+ import { BucketError, STRONG_ETAG, byteOrder, checkEtag, checkKey, isKey } from "./bucket.js";
3
+ const LIST_PAGE_LIMIT = 8 * 1024 * 1024;
4
+ const IMF_FIXDATE = /^[A-Z][a-z]{2}, \d{2} [A-Z][a-z]{2} \d{4} \d{2}:\d{2}:\d{2} GMT$/;
5
+ /**
6
+ * Returns a bucket over an S3-compatible API (R2, AWS S3), path-style. One deadline covers each operation, body
7
+ * included. A 412 on a conditional PUT is a lost race; every other failure is a `BucketError` built by `S3Error`.
8
+ */
9
+ export function s3Bucket(config, options = {}) {
10
+ const target = s3Target(config);
11
+ const { timeoutMs = 60_000 } = options;
12
+ /** Sends one request and runs `handle` on its response, both under one deadline. */
13
+ async function call(operation, request, handle) {
14
+ const controller = new AbortController();
15
+ const timer = setTimeout(() => {
16
+ controller.abort();
17
+ }, timeoutMs);
18
+ try {
19
+ return await handle(await s3Fetch(target, request, controller.signal));
20
+ }
21
+ catch (e) {
22
+ const error = e instanceof S3Error
23
+ ? e
24
+ : S3Error.unanswered(operation, controller.signal.aborted, timeoutMs);
25
+ // A mutation that got no answer, a 5xx, or a 200 it cannot read may still have committed.
26
+ const status = error.status;
27
+ const unknown = request.method !== "GET" && (status === undefined || status === 200 || status >= 500);
28
+ throw new BucketError(error.message, unknown ? "unknown" : "failed");
29
+ }
30
+ finally {
31
+ clearTimeout(timer);
32
+ }
33
+ }
34
+ /** Reads an error response's code once and throws the one error it gives. */
35
+ const failure = async (operation, res) => {
36
+ throw new S3Error(operation, { status: res.status, code: await s3ErrorCode(res) });
37
+ };
38
+ async function write(key, bytes, condition, contentType) {
39
+ checkKey(key);
40
+ // Always set and signed: fetch would add an unsigned `cache-control: no-cache` to a conditional request, and S3
41
+ // stores whatever arrives. Objects without a content type are records the server reads, never to be cached.
42
+ const sent = {
43
+ ...condition,
44
+ "cache-control": contentType === undefined ? "no-store" : "public, max-age=31536000, immutable",
45
+ ...(contentType !== undefined && { "content-type": contentType }),
46
+ };
47
+ return await call("PutObject", { method: "PUT", key, body: bytes, headers: sent }, async (res) => {
48
+ if (res.status === 412 && condition !== undefined) {
49
+ await res.body?.cancel();
50
+ return undefined;
51
+ }
52
+ if (res.status !== 200)
53
+ return failure("PutObject", res);
54
+ await res.body?.cancel();
55
+ const etag = res.headers.get("etag");
56
+ if (etag === null || !STRONG_ETAG.test(etag)) {
57
+ throw new S3Error("PutObject", { problem: "etag" });
58
+ }
59
+ return etag;
60
+ });
61
+ }
62
+ /** Sends one listing request and runs `handle` on its validated page. */
63
+ const listPage = (query, handle) => call("ListObjectsV2", { method: "GET", query }, async (res) => {
64
+ if (res.status !== 200)
65
+ return failure("ListObjectsV2", res);
66
+ const text = await readS3Text(res, LIST_PAGE_LIMIT);
67
+ const page = text === undefined ? undefined : parsePage(text, query.prefix);
68
+ if (page === undefined)
69
+ throw invalidListing();
70
+ return handle(page, res);
71
+ });
72
+ return {
73
+ async get(key, maxBytes) {
74
+ checkKey(key);
75
+ return await call("GetObject", { method: "GET", key }, async (res) => {
76
+ if (res.status !== 200)
77
+ return s3Absent("GetObject", res);
78
+ const etag = res.headers.get("etag");
79
+ const size = Number(res.headers.get("content-length"));
80
+ const problem = s3BodyProblem(res) ??
81
+ (etag === null || !STRONG_ETAG.test(etag)
82
+ ? "etag"
83
+ : size > maxBytes
84
+ ? "over"
85
+ : undefined);
86
+ if (problem !== undefined || res.body === null || etag === null) {
87
+ await res.body?.cancel(); // Never buffered: the connection is released.
88
+ throw new S3Error("GetObject", { problem: problem ?? "length" });
89
+ }
90
+ return { bytes: await readExactly(res.body, size), etag };
91
+ });
92
+ },
93
+ put: (key, bytes) => write(key, bytes),
94
+ putIfAbsent: (key, bytes, contentType) => write(key, bytes, { "if-none-match": "*" }, contentType),
95
+ async putIfMatch(key, bytes, etag) {
96
+ checkEtag(etag);
97
+ return await write(key, bytes, { "if-match": etag });
98
+ },
99
+ async delete(key) {
100
+ checkKey(key);
101
+ await call("DeleteObject", { method: "DELETE", key }, async (res) => {
102
+ if (res.status !== 204 && res.status !== 200)
103
+ return failure("DeleteObject", res);
104
+ await res.body?.cancel();
105
+ });
106
+ },
107
+ async list(prefix) {
108
+ const entries = [];
109
+ const sent = new Set();
110
+ let last;
111
+ for (let token;;) {
112
+ const query = {
113
+ "list-type": "2",
114
+ "encoding-type": "url",
115
+ prefix,
116
+ ...(token !== undefined && { "continuation-token": token }),
117
+ };
118
+ token = await listPage(query, (page) => {
119
+ for (const entry of page.entries) {
120
+ const name = "key" in entry ? entry.key : entry.unknown;
121
+ if (last !== undefined && byteOrder(name, last) <= 0)
122
+ throw invalidListing();
123
+ last = name;
124
+ }
125
+ if (page.next !== undefined && sent.has(page.next))
126
+ throw invalidListing();
127
+ entries.push(...page.entries);
128
+ return page.next;
129
+ });
130
+ if (token === undefined)
131
+ return entries;
132
+ sent.add(token);
133
+ }
134
+ },
135
+ time: () => listPage({ "list-type": "2", "encoding-type": "url", "max-keys": "1", prefix: "reply/no-update" }, (_, res) => {
136
+ const date = res.headers.get("date");
137
+ const ms = date !== null && IMF_FIXDATE.test(date) ? Date.parse(date) : NaN;
138
+ if (Number.isNaN(ms))
139
+ throw new S3Error("ListObjectsV2", { problem: "date" });
140
+ return ms;
141
+ }),
142
+ };
143
+ }
144
+ const invalidListing = () => new S3Error("ListObjectsV2", { problem: "listing" });
145
+ /** Returns exactly `size` bytes, or throws when the body is longer or shorter. */
146
+ async function readExactly(body, size) {
147
+ const out = new Uint8Array(size);
148
+ const reader = body.getReader();
149
+ let at = 0;
150
+ for (;;) {
151
+ const { done, value } = await reader.read();
152
+ if (done)
153
+ break;
154
+ if (value.length > size - at) {
155
+ await reader.cancel();
156
+ at = -1;
157
+ break;
158
+ }
159
+ out.set(value, at);
160
+ at += value.length;
161
+ }
162
+ if (at !== size)
163
+ throw new S3Error("GetObject", { problem: "body" });
164
+ return out;
165
+ }
166
+ /** Returns a ListObjectsV2 page for `prefix`, or undefined when it breaks any rule of a flat, URL-encoded listing. */
167
+ function parsePage(text, prefix) {
168
+ const root = parseS3Xml(text);
169
+ if (root?.name !== "ListBucketResult")
170
+ return undefined;
171
+ const truncated = onlyText(root, "IsTruncated");
172
+ if ((truncated !== "true" && truncated !== "false") || onlyText(root, "EncodingType") !== "url") {
173
+ return undefined;
174
+ }
175
+ const echoed = onlyText(root, "Prefix");
176
+ // No delimiter is sent, so a group would hide keys.
177
+ if (echoed === undefined ||
178
+ decodeName(echoed) !== prefix ||
179
+ childElements(root, "CommonPrefixes").length > 0) {
180
+ return undefined;
181
+ }
182
+ const contents = childElements(root, "Contents");
183
+ const keyCount = childElements(root, "KeyCount");
184
+ if (keyCount.length > 1 ||
185
+ (keyCount[0] !== undefined && textOf(keyCount[0]) !== String(contents.length))) {
186
+ return undefined;
187
+ }
188
+ const entries = [];
189
+ for (const c of contents) {
190
+ const raw = onlyText(c, "Key");
191
+ // S3 keys are UTF-8, so a name that does not decode is a broken page, not a stored name.
192
+ const name = raw === undefined ? undefined : decodeName(raw);
193
+ const sizeText = onlyText(c, "Size");
194
+ const size = sizeText !== undefined && /^\d{1,16}$/.test(sizeText) ? Number(sizeText) : NaN;
195
+ if (name === undefined || !name.startsWith(prefix) || !Number.isSafeInteger(size)) {
196
+ return undefined;
197
+ }
198
+ entries.push(isKey(name) ? { key: name, size } : { unknown: name, size });
199
+ }
200
+ let next;
201
+ if (truncated === "true") {
202
+ next = onlyText(root, "NextContinuationToken");
203
+ if (next === undefined || next === "")
204
+ return undefined;
205
+ }
206
+ return { entries, next };
207
+ }
208
+ /** The text of `parent`'s one `name` child; undefined unless there is exactly one. */
209
+ function onlyText(parent, name) {
210
+ const found = childElements(parent, name);
211
+ return found.length === 1 && found[0] !== undefined ? textOf(found[0]) : undefined;
212
+ }
213
+ /** `encoding-type=url` names: + is a space, then percent-decoded as UTF-8. */
214
+ function decodeName(raw) {
215
+ try {
216
+ return decodeURIComponent(raw.replaceAll("+", " "));
217
+ }
218
+ catch {
219
+ return undefined;
220
+ }
221
+ }
@@ -0,0 +1,26 @@
1
+ import type { StoredReply } from "@tide-ota/protocol";
2
+ import type { Bucket } from "./bucket.ts";
3
+ /**
4
+ * One readable record with its signed part as stored, or why it cannot be served; every reason is fixed text, never
5
+ * stored data.
6
+ */
7
+ export type Verdict = {
8
+ readonly kind: StoredReply["kind"];
9
+ readonly updateId?: string;
10
+ readonly time?: string;
11
+ readonly signed: {
12
+ readonly body: Uint8Array<ArrayBuffer>;
13
+ readonly signature: string;
14
+ };
15
+ } | string;
16
+ /**
17
+ * Prints one line per pointer under `reply/` and whether `reply/no-update` exists, reading each record's signed part
18
+ * as stored. Returns 1 when any listed record is unreadable, else 0; a listing failure rejects.
19
+ */
20
+ export declare function status(bucket: Bucket, out: (line: string) => void, err: (line: string) => void): Promise<0 | 1>;
21
+ /** Reads and checks the record at `key`; undefined when absent. */
22
+ export declare function readRecord(bucket: Bucket, key: string): Promise<Verdict | undefined>;
23
+ /** Checks the bytes stored at `key` the way a signing client would receive them. */
24
+ export declare function checkRecord(key: string, bytes: Uint8Array): Verdict;
25
+ /** Exactly the form the publisher writes: an ISO 8601 UTC time with milliseconds that names a real instant. */
26
+ export declare function isTime(value: unknown): value is string;
package/dist/status.js ADDED
@@ -0,0 +1,117 @@
1
+ import { MAX_REPLY_BYTES, NO_UPDATE_KEY, decodeStoredReply, parseExpoSignature, parseMultipart, } from "@tide-ota/protocol";
2
+ import { BucketError } from "./bucket.js";
3
+ const TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
4
+ const utf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
5
+ /**
6
+ * Prints one line per pointer under `reply/` and whether `reply/no-update` exists, reading each record's signed part
7
+ * as stored. Returns 1 when any listed record is unreadable, else 0; a listing failure rejects.
8
+ */
9
+ export async function status(bucket, out, err) {
10
+ let unreadable = false;
11
+ let noUpdate = "missing";
12
+ for (const entry of await bucket.list("reply/")) {
13
+ if (!("key" in entry)) {
14
+ // The name is stored data, so it is not printed.
15
+ err("reply/: unreadable: an object name outside the key grammar");
16
+ unreadable = true;
17
+ continue;
18
+ }
19
+ const { key } = entry;
20
+ const verdict = (await readRecord(bucket, key)) ?? "absent when read";
21
+ if (key === NO_UPDATE_KEY)
22
+ noUpdate = typeof verdict === "string" ? "unreadable" : "present";
23
+ if (typeof verdict === "string") {
24
+ err(`${key}: unreadable: ${verdict}`);
25
+ unreadable = true;
26
+ }
27
+ else if (key !== NO_UPDATE_KEY) {
28
+ const [, channel, runtime, platform] = key.split("/");
29
+ out(`${channel} ${runtime} ${platform} ${verdict.kind} ${verdict.updateId ?? "-"} ${verdict.time}`);
30
+ }
31
+ }
32
+ out(`${NO_UPDATE_KEY}: ${noUpdate}`);
33
+ return unreadable ? 1 : 0;
34
+ }
35
+ /** Reads and checks the record at `key`; undefined when absent. */
36
+ export async function readRecord(bucket, key) {
37
+ let bytes;
38
+ try {
39
+ bytes = (await bucket.get(key, MAX_REPLY_BYTES))?.bytes;
40
+ }
41
+ catch (e) {
42
+ // The listing succeeded, so one failed read is this record's problem; later records are still read.
43
+ return e instanceof BucketError ? e.message : "read failed";
44
+ }
45
+ return bytes === undefined ? undefined : checkRecord(key, bytes);
46
+ }
47
+ /** Checks the bytes stored at `key` the way a signing client would receive them. */
48
+ export function checkRecord(key, bytes) {
49
+ let reply;
50
+ try {
51
+ reply = decodeStoredReply(bytes);
52
+ }
53
+ catch {
54
+ return "not a stored reply";
55
+ }
56
+ const pointer = key !== NO_UPDATE_KEY;
57
+ if (pointer === (reply.kind === "noUpdateAvailable")) {
58
+ return `holds ${reply.kind}, which does not fit its key`;
59
+ }
60
+ const partName = reply.kind === "manifest" ? "manifest" : "directive";
61
+ let part;
62
+ try {
63
+ part = parseMultipart(reply.body, reply.boundary).find((p) => p.name === partName);
64
+ }
65
+ catch {
66
+ return "body is not a valid multipart";
67
+ }
68
+ if (part === undefined)
69
+ return `body has no ${partName} part`;
70
+ // A client configured for code signing rejects a part without one.
71
+ const { body, signature } = part;
72
+ if (signature === undefined)
73
+ return `${partName} part has no expo-signature`;
74
+ const signed = { body, signature };
75
+ try {
76
+ parseExpoSignature(signature);
77
+ }
78
+ catch {
79
+ return `${partName} part has a malformed expo-signature`;
80
+ }
81
+ let json;
82
+ try {
83
+ json = JSON.parse(utf8.decode(body));
84
+ }
85
+ catch {
86
+ return `${partName} part is not JSON`;
87
+ }
88
+ const field = (...path) => path.reduce((o, p) => typeof o === "object" && o !== null && Object.hasOwn(o, p)
89
+ ? o[p]
90
+ : undefined, json);
91
+ if (reply.kind === "manifest") {
92
+ if (field("id") !== reply.updateId)
93
+ return "manifest id differs from the record's updateId";
94
+ if (field("runtimeVersion") !== key.split("/")[2]) {
95
+ return "manifest runtimeVersion differs from its key";
96
+ }
97
+ const createdAt = field("createdAt");
98
+ if (!isTime(createdAt))
99
+ return "manifest createdAt is not a valid time";
100
+ return { kind: reply.kind, updateId: reply.updateId, time: createdAt, signed };
101
+ }
102
+ if (field("type") !== reply.kind)
103
+ return `directive type is not ${reply.kind}`;
104
+ if (reply.kind === "noUpdateAvailable")
105
+ return { kind: reply.kind, signed };
106
+ const commitTime = field("parameters", "commitTime");
107
+ if (!isTime(commitTime))
108
+ return "directive commitTime is not a valid time";
109
+ return { kind: reply.kind, time: commitTime, signed };
110
+ }
111
+ /** Exactly the form the publisher writes: an ISO 8601 UTC time with milliseconds that names a real instant. */
112
+ export function isTime(value) {
113
+ if (typeof value !== "string" || !TIME.test(value))
114
+ return false;
115
+ const ms = Date.parse(value);
116
+ return !Number.isNaN(ms) && new Date(ms).toISOString() === value;
117
+ }
@@ -0,0 +1,7 @@
1
+ import type { Bucket } from "./bucket.ts";
2
+ /**
3
+ * Prints every object under `assets/`, `bundles/` and `updates/` that no release record, base record or legacy map
4
+ * entry names, as `<name> <bytes>`, then the count and total. Returns 1 with nothing on stdout when a listing or read
5
+ * fails, since a partial scan could report a referenced object.
6
+ */
7
+ export declare function storage(bucket: Pick<Bucket, "get" | "list">, out: (line: string) => void, err: (line: string) => void): Promise<0 | 1>;
@@ -0,0 +1,107 @@
1
+ import { CONTENT_KEY, LEGACY_MAP_KEY, contentKey } from "@tide-ota/protocol";
2
+ import { BucketError } from "./bucket.js";
3
+ import { member } from "./keys.js";
4
+ import { BASE_PREFIX, PublishError, RECORD_PREFIX, readBaseRecord, readReleaseRecord, } from "./publish-record.js";
5
+ const REPORTED = ["assets/", "bundles/", RECORD_PREFIX];
6
+ const MAX_MAP_BYTES = 64 * 1024 * 1024;
7
+ const utf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
8
+ /**
9
+ * Prints every object under `assets/`, `bundles/` and `updates/` that no release record, base record or legacy map
10
+ * entry names, as `<name> <bytes>`, then the count and total. Returns 1 with nothing on stdout when a listing or read
11
+ * fails, since a partial scan could report a referenced object.
12
+ */
13
+ export async function storage(bucket, out, err) {
14
+ let unreferenced;
15
+ try {
16
+ unreferenced = await scan(bucket);
17
+ }
18
+ catch (e) {
19
+ if (!(e instanceof PublishError))
20
+ throw e;
21
+ err(`tide: ${e.message}`);
22
+ return 1;
23
+ }
24
+ let total = 0n;
25
+ for (const e of unreferenced) {
26
+ out(`${"key" in e ? e.key : quoted(e.unknown)} ${e.size}`);
27
+ total += BigInt(e.size);
28
+ }
29
+ out(`${unreferenced.length} unreferenced objects, ${total} bytes`);
30
+ return 0;
31
+ }
32
+ /**
33
+ * Lists the reported prefixes and `bases/`, then reads the legacy map, every release record and every base record. A
34
+ * pointer serves its release record, which is retained, so pointers add no root.
35
+ */
36
+ async function scan(bucket) {
37
+ let listed = [];
38
+ // Not push(...): a prefix can hold more entries than a call takes arguments.
39
+ for (const prefix of REPORTED)
40
+ listed = listed.concat(await listing(bucket, prefix));
41
+ const referenced = new Set(await legacyKeys(bucket));
42
+ for (const e of listed) {
43
+ if (!("key" in e) || !e.key.startsWith(RECORD_PREFIX))
44
+ continue;
45
+ const record = await reading(e.key, () => readReleaseRecord(bucket, e.key));
46
+ if (record === undefined)
47
+ continue;
48
+ referenced.add(`bundles/${contentKey(record.launchAsset.hash)}`);
49
+ for (const a of record.assets)
50
+ referenced.add(`assets/${contentKey(a.hash)}`);
51
+ }
52
+ // A base's bundle is what patches start from; its embedded assets are in the store build, not the bucket.
53
+ for (const e of await listing(bucket, BASE_PREFIX)) {
54
+ if (!("key" in e))
55
+ continue; // No reader opens a name outside the grammar.
56
+ const base = await reading(e.key, () => readBaseRecord(bucket, e.key));
57
+ if (base !== undefined)
58
+ referenced.add(`bundles/${contentKey(base.launchAsset.hash)}`);
59
+ }
60
+ // A release record is itself retained.
61
+ return listed.filter((e) => !("key" in e && (e.key.startsWith(RECORD_PREFIX) || referenced.has(e.key))));
62
+ }
63
+ async function listing(bucket, prefix) {
64
+ try {
65
+ return await bucket.list(prefix);
66
+ }
67
+ catch (e) {
68
+ if (!(e instanceof BucketError))
69
+ throw e;
70
+ throw new PublishError(`${prefix} cannot be listed: ${e.message}`);
71
+ }
72
+ }
73
+ async function reading(key, read) {
74
+ try {
75
+ return await read();
76
+ }
77
+ catch (e) {
78
+ if (!(e instanceof BucketError))
79
+ throw e;
80
+ throw new PublishError(`${key} is unreadable: ${e.message}`);
81
+ }
82
+ }
83
+ /**
84
+ * Returns the content keys `legacy/map.json` names; none when absent. It must be exactly
85
+ * `{"version":1,"keys":[...]}`: content keys in strictly ascending order, no trailing newline.
86
+ */
87
+ async function legacyKeys(bucket) {
88
+ const object = await reading(LEGACY_MAP_KEY, () => bucket.get(LEGACY_MAP_KEY, MAX_MAP_BYTES));
89
+ if (object === undefined)
90
+ return [];
91
+ let text, keys;
92
+ try {
93
+ text = utf8.decode(object.bytes);
94
+ keys = member(JSON.parse(text), "keys");
95
+ }
96
+ catch {
97
+ // Falls through to the refusal.
98
+ }
99
+ if (!Array.isArray(keys) ||
100
+ !keys.every((k, i) => typeof k === "string" && CONTENT_KEY.test(k) && (i === 0 || keys[i - 1] < k)) ||
101
+ JSON.stringify({ version: 1, keys }) !== text) {
102
+ throw new PublishError(`${LEGACY_MAP_KEY} is unreadable: not in the form tide writes`);
103
+ }
104
+ return keys;
105
+ }
106
+ /** A name outside the key grammar as a JSON string of printable ASCII, so no stored byte reaches a terminal raw. */
107
+ const quoted = (name) => JSON.stringify(name).replace(/[^\x20-\x7e]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
@@ -0,0 +1,6 @@
1
+ import type { Bucket } from "./bucket.ts";
2
+ /**
3
+ * Returns the bucket the environment configures, with the server's variables: TIDE_DISK_DIR or TIDE_S3_*. A
4
+ * configuration error is a `BucketError` naming variables and rules, never values, and nothing has been sent.
5
+ */
6
+ export declare function bucketFromEnv(env: Readonly<Record<string, string | undefined>>): Bucket;
@@ -0,0 +1,18 @@
1
+ import { storageFromEnv } from "@tide-ota/protocol";
2
+ import { BucketError } from "./bucket.js";
3
+ import { diskBucket } from "./disk.js";
4
+ import { s3Bucket } from "./s3.js";
5
+ /**
6
+ * Returns the bucket the environment configures, with the server's variables: TIDE_DISK_DIR or TIDE_S3_*. A
7
+ * configuration error is a `BucketError` naming variables and rules, never values, and nothing has been sent.
8
+ */
9
+ export function bucketFromEnv(env) {
10
+ let storage;
11
+ try {
12
+ storage = storageFromEnv(env);
13
+ }
14
+ catch (e) {
15
+ throw new BucketError(e.message, "failed");
16
+ }
17
+ return "disk" in storage ? diskBucket(storage.disk) : s3Bucket(storage.s3);
18
+ }
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@tide-ota/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Publish signed Expo OTA updates to your own R2 or S3 bucket, with bundle diffing, rollbacks and AWS KMS signing.",
5
+ "keywords": [
6
+ "expo",
7
+ "expo-updates",
8
+ "eas-update",
9
+ "react-native",
10
+ "react-native-ota",
11
+ "ota",
12
+ "ota-updates",
13
+ "self-hosted",
14
+ "publish",
15
+ "code-signing",
16
+ "rollback",
17
+ "aws-kms",
18
+ "bsdiff"
19
+ ],
20
+ "homepage": "https://github.com/HashimTheArab/tide#publishing",
21
+ "bugs": {
22
+ "url": "https://github.com/HashimTheArab/tide/issues"
23
+ },
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/HashimTheArab/tide.git",
28
+ "directory": "packages/cli"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "LICENSE"
33
+ ],
34
+ "type": "module",
35
+ "engines": {
36
+ "node": ">=24.11"
37
+ },
38
+ "bin": {
39
+ "tide": "./dist/main.js"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "provenance": true
44
+ },
45
+ "dependencies": {
46
+ "@tide-ota/protocol": "0.1.0"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^26.6.6",
50
+ "fast-check": "4.10.2",
51
+ "typescript": "7.0.2",
52
+ "vitest": "^5.1.0"
53
+ },
54
+ "scripts": {
55
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
56
+ "typecheck": "tsc --noEmit -p tsconfig.json",
57
+ "test": "vitest run",
58
+ "test:container": "vitest run --config vitest.container.config.ts"
59
+ }
6
60
  }