@goliapkg/sentori-cli 1.4.1 → 1.6.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/README.md +268 -26
- package/lib/artifacts.d.ts +7 -0
- package/lib/artifacts.d.ts.map +1 -1
- package/lib/artifacts.js +5 -1
- package/lib/artifacts.js.map +1 -1
- package/lib/compatibility.d.ts +6 -0
- package/lib/compatibility.d.ts.map +1 -0
- package/lib/compatibility.js +21 -0
- package/lib/compatibility.js.map +1 -0
- package/lib/index.js +97 -65
- package/lib/index.js.map +1 -1
- package/lib/lenient.js +1 -1
- package/lib/lenient.js.map +1 -1
- package/lib/mcp.js +1 -1
- package/lib/mcp.js.map +1 -1
- package/lib/native-artifacts.d.ts.map +1 -1
- package/lib/native-artifacts.js +5 -0
- package/lib/native-artifacts.js.map +1 -1
- package/lib/probes.js +1 -1
- package/lib/probes.js.map +1 -1
- package/lib/srcbundle.d.ts +37 -2
- package/lib/srcbundle.d.ts.map +1 -1
- package/lib/srcbundle.js +181 -58
- package/lib/srcbundle.js.map +1 -1
- package/lib/upload.d.ts +47 -2
- package/lib/upload.d.ts.map +1 -1
- package/lib/upload.js +65 -2
- package/lib/upload.js.map +1 -1
- package/lib/workflow.d.ts +47 -0
- package/lib/workflow.d.ts.map +1 -0
- package/lib/workflow.js +289 -0
- package/lib/workflow.js.map +1 -0
- package/package.json +11 -7
- package/src/__tests__/artifacts.test.ts +1 -1
- package/src/__tests__/compatibility.test.ts +80 -0
- package/src/__tests__/expand-sourcemaps.test.ts +56 -0
- package/src/__tests__/rn-upload-hook.test.ts +35 -0
- package/src/__tests__/srcbundle.test.ts +66 -0
- package/src/__tests__/upload-verdict.test.ts +77 -0
- package/src/__tests__/workflow.test.ts +102 -0
- package/src/artifacts.ts +12 -1
- package/src/compatibility.ts +21 -0
- package/src/index.ts +83 -66
- package/src/lenient.ts +1 -1
- package/src/mcp.ts +1 -1
- package/src/native-artifacts.ts +5 -0
- package/src/probes.ts +1 -1
- package/src/srcbundle.ts +150 -61
- package/src/upload.ts +88 -3
- package/src/workflow.ts +240 -0
- package/lib/source-bundle.d.ts +0 -28
- package/lib/source-bundle.d.ts.map +0 -1
- package/lib/source-bundle.js +0 -193
- package/lib/source-bundle.js.map +0 -1
package/lib/srcbundle.js
CHANGED
|
@@ -1,69 +1,192 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
// Source archives are build artifacts. Directory mode needs no repository;
|
|
2
|
+
// tag mode reads immutable Git objects without changing the working tree.
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { lstatSync, readFileSync, readdirSync, realpathSync } from 'node:fs';
|
|
6
|
+
import { extname, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
7
|
+
import { unzipSync, zipSync } from 'fflate';
|
|
8
|
+
export const SOURCE_MANIFEST = 'sentori-source-manifest.json';
|
|
9
|
+
export const MAX_SOURCE_FILE_BYTES = 512 * 1024;
|
|
10
|
+
export const MAX_SOURCE_BYTES = 64 * 1024 * 1024;
|
|
11
|
+
const MAX_FILES = 10000;
|
|
12
|
+
const SOURCE_EXTS = new Set(['.swift', '.kt', '.kts', '.java', '.m', '.mm', '.h', '.c', '.cc', '.cpp', '.hpp', '.js', '.jsx', '.ts', '.tsx', '.vue', '.svelte', '.rs', '.go', '.py', '.rb', '.php', '.cs', '.dart']);
|
|
13
|
+
const SKIP_DIRS = new Set(['node_modules', 'build', 'Pods', 'DerivedData', 'dist', 'target', 'vendor', '__pycache__']);
|
|
14
|
+
const sha256 = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
15
|
+
export function safeSourcePath(path) {
|
|
16
|
+
return path.length > 0 && path.length <= 1024 && !/[\\\x00-\x1f:]/.test(path)
|
|
17
|
+
&& !path.startsWith('/') && path.split('/').every(part => part !== '' && part !== '.' && part !== '..');
|
|
18
|
+
}
|
|
19
|
+
function selected(path, includes, excludes) {
|
|
20
|
+
const under = (parent) => parent === '.' || path === parent || path.startsWith(`${parent}/`);
|
|
21
|
+
return includes.some(under) && !excludes.some(under);
|
|
22
|
+
}
|
|
23
|
+
function sourcePath(path, includes) {
|
|
24
|
+
return safeSourcePath(path) && SOURCE_EXTS.has(extname(path).toLowerCase())
|
|
25
|
+
&& !path.split('/').some((part, index, parts) => part.startsWith('.') || SKIP_DIRS.has(part)
|
|
26
|
+
&& !includes.some(include => include === parts.slice(0, index + 1).join('/') || include.startsWith(parts.slice(0, index + 1).join('/') + '/')));
|
|
27
|
+
}
|
|
28
|
+
function readText(bytes, path) {
|
|
29
|
+
if (bytes.includes(0))
|
|
30
|
+
throw new Error(`source is not UTF-8 text: ${path}`);
|
|
31
|
+
try {
|
|
32
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new Error(`source is not UTF-8 text: ${path}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function selectionPath(root, path) {
|
|
39
|
+
const rel = relative(root, resolve(root, path)).split(sep).join('/') || '.';
|
|
40
|
+
if (rel !== '.' && !safeSourcePath(rel))
|
|
41
|
+
throw new Error(`source path is outside --root: ${path}`);
|
|
42
|
+
return rel;
|
|
43
|
+
}
|
|
44
|
+
/** Keep every path relative to ONE root, even with several selected directories. */
|
|
45
|
+
export function collectSources(paths, options = {}) {
|
|
46
|
+
if (!paths.length)
|
|
47
|
+
throw new Error('choose source directories or files (for example: ios android/app/src shared)');
|
|
48
|
+
const root = realpathSync(resolve(options.root ?? '.'));
|
|
49
|
+
const includes = paths.map(path => selectionPath(root, path));
|
|
50
|
+
const excludes = (options.exclude ?? []).map(path => selectionPath(root, path));
|
|
51
|
+
const bundle = Object.create(null);
|
|
25
52
|
const stats = { files: 0, bytes: 0, skipped: 0 };
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
53
|
+
const add = (path, bytes) => {
|
|
54
|
+
if (Object.hasOwn(bundle, path))
|
|
32
55
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
if (bytes.length > MAX_SOURCE_FILE_BYTES)
|
|
57
|
+
throw new Error(`source exceeds 512 KiB: ${path}; explicitly exclude it if not needed`);
|
|
58
|
+
if (stats.bytes + bytes.length > MAX_SOURCE_BYTES || stats.files >= MAX_FILES)
|
|
59
|
+
throw new Error('source bundle exceeds 64 MiB or 10000 files; narrow the selected directories');
|
|
60
|
+
bundle[path] = readText(bytes, path);
|
|
61
|
+
stats.files++;
|
|
62
|
+
stats.bytes += bytes.length;
|
|
63
|
+
};
|
|
64
|
+
let source = { type: 'directory' };
|
|
65
|
+
if (options.gitTag) {
|
|
66
|
+
const git = (args, limit = MAX_SOURCE_BYTES) => execFileSync('git', ['-C', root, ...args], { maxBuffer: limit, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
67
|
+
const top = realpathSync(git(['rev-parse', '--show-toplevel']).toString().trim());
|
|
68
|
+
if (root !== top)
|
|
69
|
+
throw new Error('--root must be the repository root when using --git-tag');
|
|
70
|
+
const tag = options.gitTag;
|
|
71
|
+
git(['check-ref-format', `refs/tags/${tag}`]);
|
|
72
|
+
const commit = git(['rev-parse', '--verify', `refs/tags/${tag}^{commit}`]).toString().trim();
|
|
73
|
+
if (!/^[0-9a-f]{40,64}$/.test(commit))
|
|
74
|
+
throw new Error('tag did not resolve to a commit');
|
|
75
|
+
source = { type: 'git-tag', tag, commit };
|
|
76
|
+
const records = git(['ls-tree', '-rlz', '--full-tree', commit]).toString().split('\0').filter(Boolean);
|
|
77
|
+
const matched = new Set();
|
|
78
|
+
for (const record of records) {
|
|
79
|
+
const tab = record.indexOf('\t');
|
|
80
|
+
const path = record.slice(tab + 1);
|
|
81
|
+
if (!selected(path, includes, excludes) || !sourcePath(path, includes))
|
|
42
82
|
continue;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
size = statSync(full).size;
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
83
|
+
const [mode, type, oid, size] = record.slice(0, tab).trim().split(/\s+/);
|
|
84
|
+
if (type !== 'blob' || !['100644', '100755'].includes(mode)) {
|
|
85
|
+
stats.skipped++;
|
|
49
86
|
continue;
|
|
50
87
|
}
|
|
51
|
-
if (size >
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
if (Number(size) > MAX_SOURCE_FILE_BYTES)
|
|
89
|
+
throw new Error(`source exceeds 512 KiB: ${path}`);
|
|
90
|
+
for (const item of includes)
|
|
91
|
+
if (selected(path, [item], []))
|
|
92
|
+
matched.add(item);
|
|
93
|
+
add(path, git(['cat-file', 'blob', oid], MAX_SOURCE_FILE_BYTES + 1));
|
|
94
|
+
}
|
|
95
|
+
for (const item of includes)
|
|
96
|
+
if (!matched.has(item))
|
|
97
|
+
throw new Error(`no source files at tag ${tag} under ${item}`);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const walk = (path) => {
|
|
101
|
+
const full = resolve(root, path);
|
|
102
|
+
const stat = lstatSync(full);
|
|
103
|
+
if (stat.isSymbolicLink()) {
|
|
104
|
+
stats.skipped++;
|
|
105
|
+
return;
|
|
54
106
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
107
|
+
const real = relative(root, realpathSync(full));
|
|
108
|
+
if (real.startsWith(`..${sep}`) || real === '..' || isAbsolute(real))
|
|
109
|
+
throw new Error(`source resolves outside --root: ${path}`);
|
|
110
|
+
if (stat.isDirectory()) {
|
|
111
|
+
for (const entry of readdirSync(full).sort()) {
|
|
112
|
+
if (entry.startsWith('.') || SKIP_DIRS.has(entry)) {
|
|
113
|
+
stats.skipped++;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const child = path === '.' ? entry : `${path}/${entry}`;
|
|
117
|
+
if (excludes.some(x => child === x || child.startsWith(`${x}/`)))
|
|
118
|
+
continue;
|
|
119
|
+
walk(child);
|
|
120
|
+
}
|
|
59
121
|
}
|
|
60
|
-
|
|
61
|
-
|
|
122
|
+
else if (stat.isFile() && sourcePath(path, includes) && selected(path, includes, excludes)) {
|
|
123
|
+
if (stat.size > MAX_SOURCE_FILE_BYTES)
|
|
124
|
+
throw new Error(`source exceeds 512 KiB: ${path}`);
|
|
125
|
+
add(path, readFileSync(full));
|
|
62
126
|
}
|
|
127
|
+
};
|
|
128
|
+
for (const path of includes)
|
|
129
|
+
walk(path);
|
|
130
|
+
}
|
|
131
|
+
if (!stats.files)
|
|
132
|
+
throw new Error('no supported source files selected; choose the application source directories');
|
|
133
|
+
return { bundle, stats, source };
|
|
134
|
+
}
|
|
135
|
+
export function packSources(paths, release, options = {}) {
|
|
136
|
+
if (!release.trim())
|
|
137
|
+
throw new Error('release is required and must match the SDK release');
|
|
138
|
+
const { bundle, stats, source } = collectSources(paths, options);
|
|
139
|
+
const entries = Object.create(null);
|
|
140
|
+
const manifest = { version: 1, release, source, files: [] };
|
|
141
|
+
for (const path of Object.keys(bundle).sort()) {
|
|
142
|
+
const bytes = Buffer.from(bundle[path], 'utf8');
|
|
143
|
+
entries[path] = bytes;
|
|
144
|
+
manifest.files.push({ path, bytes: bytes.length, sha256: sha256(bytes) });
|
|
145
|
+
}
|
|
146
|
+
entries[SOURCE_MANIFEST] = Buffer.from(JSON.stringify(manifest, null, 2) + '\n');
|
|
147
|
+
return { bytes: zipSync(entries, { level: 6, mtime: new Date(2000, 0, 1) }), manifest, stats };
|
|
148
|
+
}
|
|
149
|
+
/** Validate in memory; the server independently repeats validation. */
|
|
150
|
+
export function inspectSourceArchive(bytes, release) {
|
|
151
|
+
if (bytes.length > MAX_SOURCE_BYTES + 4 * 1024 * 1024)
|
|
152
|
+
throw new Error('source archive is too large');
|
|
153
|
+
const names = new Set();
|
|
154
|
+
let total = 0;
|
|
155
|
+
const files = unzipSync(bytes, { filter: file => {
|
|
156
|
+
const path = file.name.replace(/\/$/, '');
|
|
157
|
+
if (!safeSourcePath(path) || names.has(path))
|
|
158
|
+
throw new Error(`unsafe or duplicate ZIP path: ${file.name}`);
|
|
159
|
+
names.add(path);
|
|
160
|
+
if (names.size > MAX_FILES + 1)
|
|
161
|
+
throw new Error('ZIP contains too many entries');
|
|
162
|
+
const limit = path === SOURCE_MANIFEST ? 4 * 1024 * 1024 : MAX_SOURCE_FILE_BYTES;
|
|
163
|
+
total += file.originalSize;
|
|
164
|
+
if (file.originalSize > limit || total > MAX_SOURCE_BYTES + 4 * 1024 * 1024)
|
|
165
|
+
throw new Error('ZIP exceeds source size limits');
|
|
166
|
+
return !file.name.endsWith('/');
|
|
167
|
+
} });
|
|
168
|
+
const sources = Object.keys(files).filter(path => path !== SOURCE_MANIFEST);
|
|
169
|
+
if (!sources.length)
|
|
170
|
+
throw new Error('source ZIP is empty');
|
|
171
|
+
for (const path of sources)
|
|
172
|
+
readText(files[path], path);
|
|
173
|
+
let manifest;
|
|
174
|
+
if (files[SOURCE_MANIFEST]) {
|
|
175
|
+
manifest = JSON.parse(readText(files[SOURCE_MANIFEST], SOURCE_MANIFEST));
|
|
176
|
+
if (!manifest || manifest.version !== 1 || typeof manifest.release !== 'string' || !manifest.release.trim() || !Array.isArray(manifest.files)
|
|
177
|
+
|| !manifest.source || !['directory', 'git-tag'].includes(manifest.source.type)
|
|
178
|
+
|| manifest.files.some(file => !file || typeof file.path !== 'string'))
|
|
179
|
+
throw new Error('invalid source manifest');
|
|
180
|
+
if (release && manifest.release !== release)
|
|
181
|
+
throw new Error(`ZIP release ${manifest.release} does not match ${release}`);
|
|
182
|
+
if (manifest.files.length !== sources.length || new Set(manifest.files.map(file => file.path)).size !== sources.length)
|
|
183
|
+
throw new Error('source manifest file list does not match ZIP');
|
|
184
|
+
for (const file of manifest.files) {
|
|
185
|
+
const body = files[file.path];
|
|
186
|
+
if (!body || body.length !== file.bytes || sha256(body) !== file.sha256)
|
|
187
|
+
throw new Error(`source manifest checksum mismatch: ${file.path}`);
|
|
63
188
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
walk(root, root);
|
|
67
|
-
return { bundle, stats };
|
|
189
|
+
}
|
|
190
|
+
return { files: sources.sort(), manifest };
|
|
68
191
|
}
|
|
69
192
|
//# sourceMappingURL=srcbundle.js.map
|
package/lib/srcbundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"srcbundle.js","sourceRoot":"","sources":["../src/srcbundle.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,qBAAqB;AACrB,EAAE;AACF,kEAAkE;AAClE,kEAAkE;AAClE,+DAA+D;AAC/D,gEAAgE;AAChE,6DAA6D;AAC7D,gEAAgE;AAChE,2DAA2D;AAE3D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAE1C;;mCAEmC;AACnC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAE/G,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,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,eAAe,QAAQ,CAAC,OAAO,mBAAmB,OAAO,EAAE,CAAC,CAAA;QACzH,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;QACvL,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC7B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAC7I,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAA;AAC5C,CAAC"}
|
package/lib/upload.d.ts
CHANGED
|
@@ -19,7 +19,52 @@ export declare function gzipForWire(bytes: Buffer | Uint8Array, name: string): {
|
|
|
19
19
|
* be 16 KB of pool (offset view) — a Blob built on it would ship
|
|
20
20
|
* garbage bytes around the payload. */
|
|
21
21
|
export declare function wireArrayBuffer(wire: Uint8Array): ArrayBuffer;
|
|
22
|
-
|
|
22
|
+
/** What the server said about the file it just stored.
|
|
23
|
+
*
|
|
24
|
+
* `usable: false` means it landed and will symbolicate nothing —
|
|
25
|
+
* a Hermes bundle passed off as a source map, a zip where a Mach-O
|
|
26
|
+
* was expected. The server has answered this since 2.15.0 and its
|
|
27
|
+
* own comment says "the response says so"; nothing read it, so the
|
|
28
|
+
* first anyone heard was a release page months later with the file
|
|
29
|
+
* sitting under a green light.
|
|
30
|
+
*
|
|
31
|
+
* Warned, never thrown. An artifact upload may not fail a
|
|
32
|
+
* customer's build — see the zero-cost rule — and this one did
|
|
33
|
+
* store. `--strict` is where a caller opts into a hard stop.
|
|
34
|
+
*/
|
|
35
|
+
export type UploadVerdict = {
|
|
23
36
|
id: string;
|
|
24
|
-
|
|
37
|
+
/** `null` for kinds the server does not parse ahead of time. */
|
|
38
|
+
usable?: boolean | null;
|
|
39
|
+
/** What to upload instead. Present only when `usable === false`. */
|
|
40
|
+
hint?: null | string;
|
|
41
|
+
};
|
|
42
|
+
/** Say it once, at the only place every upload passes through. */
|
|
43
|
+
export declare function warnIfUnusable(name: string, v: UploadVerdict): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Turn one path into the source maps under it, each with the name the
|
|
46
|
+
* server should store.
|
|
47
|
+
*
|
|
48
|
+
* A file keeps its basename. A **directory** is walked, and every map
|
|
49
|
+
* under it keeps its path *relative to that directory* — so
|
|
50
|
+
* `dist/pages/cart/index.js.map` is stored as
|
|
51
|
+
* `pages/cart/index.js.map` and not as `index.js.map`.
|
|
52
|
+
*
|
|
53
|
+
* That difference is the whole feature. The server matches a frame to
|
|
54
|
+
* a map by how many trailing path segments they share, precisely
|
|
55
|
+
* because a WeChat mini program names every page's entry `index.js`
|
|
56
|
+
* and a web build names every route chunk after its route. Sending
|
|
57
|
+
* only the basename threw that away on the client, so the matching
|
|
58
|
+
* could never see more than a filename however carefully it was
|
|
59
|
+
* written.
|
|
60
|
+
*
|
|
61
|
+
* Passing a directory used to read the directory as a file and throw
|
|
62
|
+
* `EISDIR`, while `docs/getting-started/web.md` told readers to pass
|
|
63
|
+
* `./dist`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function expandSourcemapPaths(path: string): {
|
|
66
|
+
path: string;
|
|
67
|
+
name: string;
|
|
68
|
+
}[];
|
|
69
|
+
export declare function uploadArtifact(opts: UploadOpts): Promise<UploadVerdict>;
|
|
25
70
|
//# sourceMappingURL=upload.d.ts.map
|
package/lib/upload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAMD;;8DAE8D;AAC9D,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,UAAU,EAC1B,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAWxC;AAED;;;wCAGwC;AACxC,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,CAE7D;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,oEAAoE;IACpE,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,CAAA;AAED,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAStE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CA0BnF;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAsC7E"}
|
package/lib/upload.js
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
// smaller than its decompressed cap precisely so that the big ones
|
|
14
14
|
// (a real RN app's main dSYM runs hundreds of MB) fit as gzip.
|
|
15
15
|
import { readFileSync } from 'node:fs';
|
|
16
|
-
import {
|
|
16
|
+
import { readdirSync, statSync } from 'node:fs';
|
|
17
|
+
import { basename, join, relative, sep } from 'node:path';
|
|
17
18
|
import { gzipSync } from 'node:zlib';
|
|
18
19
|
/** Transport-side limit on the current server (256 MB). Used only to
|
|
19
20
|
* produce a useful error message — the server is the authority. */
|
|
@@ -38,6 +39,66 @@ export function gzipForWire(bytes, name) {
|
|
|
38
39
|
export function wireArrayBuffer(wire) {
|
|
39
40
|
return wire.buffer.slice(wire.byteOffset, wire.byteOffset + wire.byteLength);
|
|
40
41
|
}
|
|
42
|
+
/** Say it once, at the only place every upload passes through. */
|
|
43
|
+
export function warnIfUnusable(name, v) {
|
|
44
|
+
if (v.usable !== false)
|
|
45
|
+
return false;
|
|
46
|
+
// `warn`, not `error`: red text makes a host team believe their
|
|
47
|
+
// build broke, and this one did not.
|
|
48
|
+
console.warn(`[sentori-cli] ${name} stored, but the server cannot read it — ` +
|
|
49
|
+
`it will symbolicate nothing.${v.hint ? ` ${v.hint}` : ''}`);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Turn one path into the source maps under it, each with the name the
|
|
54
|
+
* server should store.
|
|
55
|
+
*
|
|
56
|
+
* A file keeps its basename. A **directory** is walked, and every map
|
|
57
|
+
* under it keeps its path *relative to that directory* — so
|
|
58
|
+
* `dist/pages/cart/index.js.map` is stored as
|
|
59
|
+
* `pages/cart/index.js.map` and not as `index.js.map`.
|
|
60
|
+
*
|
|
61
|
+
* That difference is the whole feature. The server matches a frame to
|
|
62
|
+
* a map by how many trailing path segments they share, precisely
|
|
63
|
+
* because a WeChat mini program names every page's entry `index.js`
|
|
64
|
+
* and a web build names every route chunk after its route. Sending
|
|
65
|
+
* only the basename threw that away on the client, so the matching
|
|
66
|
+
* could never see more than a filename however carefully it was
|
|
67
|
+
* written.
|
|
68
|
+
*
|
|
69
|
+
* Passing a directory used to read the directory as a file and throw
|
|
70
|
+
* `EISDIR`, while `docs/getting-started/web.md` told readers to pass
|
|
71
|
+
* `./dist`.
|
|
72
|
+
*/
|
|
73
|
+
export function expandSourcemapPaths(path) {
|
|
74
|
+
let stat;
|
|
75
|
+
try {
|
|
76
|
+
stat = statSync(path);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Let the caller's read produce the real error, with the real
|
|
80
|
+
// path in it.
|
|
81
|
+
return [{ path, name: basename(path) }];
|
|
82
|
+
}
|
|
83
|
+
if (!stat.isDirectory())
|
|
84
|
+
return [{ path, name: basename(path) }];
|
|
85
|
+
const out = [];
|
|
86
|
+
const walk = (dir) => {
|
|
87
|
+
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
88
|
+
const full = join(dir, e.name);
|
|
89
|
+
if (e.isDirectory())
|
|
90
|
+
walk(full);
|
|
91
|
+
else if (e.name.endsWith('.map') || e.name.endsWith('.map.gz')) {
|
|
92
|
+
// POSIX separators on the wire whatever the build machine is:
|
|
93
|
+
// the server compares these against a frame's `file`, which is
|
|
94
|
+
// a URL or a module path, and neither uses a backslash.
|
|
95
|
+
out.push({ path: full, name: relative(path, full).split(sep).join('/') });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
walk(path);
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
41
102
|
export async function uploadArtifact(opts) {
|
|
42
103
|
const bytes = readFileSync(opts.path);
|
|
43
104
|
if (bytes.length === 0)
|
|
@@ -70,6 +131,8 @@ export async function uploadArtifact(opts) {
|
|
|
70
131
|
const detail = await resp.text().catch(() => '');
|
|
71
132
|
throw new Error(`${resp.status} ${resp.statusText}${detail ? ` — ${detail.slice(0, 200)}` : ''}`);
|
|
72
133
|
}
|
|
73
|
-
|
|
134
|
+
const verdict = (await resp.json());
|
|
135
|
+
warnIfUnusable(opts.name ?? basename(opts.path), verdict);
|
|
136
|
+
return verdict;
|
|
74
137
|
}
|
|
75
138
|
//# sourceMappingURL=upload.js.map
|
package/lib/upload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,kEAAkE;AAClE,8DAA8D;AAC9D,qEAAqE;AACrE,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,2DAA2D;AAC3D,kEAAkE;AAClE,mEAAmE;AACnE,mEAAmE;AACnE,+DAA+D;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,kEAAkE;AAClE,8DAA8D;AAC9D,qEAAqE;AACrE,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,2DAA2D;AAC3D,kEAAkE;AAClE,mEAAmE;AACnE,mEAAmE;AACnE,+DAA+D;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAYpC;oEACoE;AACpE,MAAM,UAAU,GAAG,GAAG,GAAG,I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,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,yDAAyD;QACzD,iEAAiE;QACjE,kEAAkE;QAClE,kDAAkD;QAClD,MAAM,IAAI,KAAK,CACb,kBAAkB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YAChE,mEAAmE;YACnE,eAAe,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC,kBAAkB,CACzE,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QAChD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACnG,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAkB,CAAA;IACpD,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IACzD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type UploadOpts } from './upload.js';
|
|
2
|
+
export type UploadConfig = {
|
|
3
|
+
version: 1;
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
tokenEnv: string;
|
|
6
|
+
release?: string;
|
|
7
|
+
artifacts: {
|
|
8
|
+
sourcemap?: string[];
|
|
9
|
+
dsym?: string[];
|
|
10
|
+
mapping?: string[];
|
|
11
|
+
};
|
|
12
|
+
sources?: {
|
|
13
|
+
root?: string;
|
|
14
|
+
include: string[];
|
|
15
|
+
exclude?: string[];
|
|
16
|
+
gitTag?: string;
|
|
17
|
+
};
|
|
18
|
+
sourceArchive?: string;
|
|
19
|
+
};
|
|
20
|
+
export type UploadPlan = {
|
|
21
|
+
release: string;
|
|
22
|
+
apiUrl: string;
|
|
23
|
+
tokenEnv: string;
|
|
24
|
+
files: {
|
|
25
|
+
kind: UploadOpts['kind'];
|
|
26
|
+
name: string;
|
|
27
|
+
path: string;
|
|
28
|
+
hash: string;
|
|
29
|
+
bytes: number;
|
|
30
|
+
}[];
|
|
31
|
+
source?: {
|
|
32
|
+
files: string[];
|
|
33
|
+
tag?: string;
|
|
34
|
+
commit?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const WORKFLOW_HELP = "Release uploads:\n sentori init --api-url <url> [--release <r>] [--sourcemap <path>] [--dsym <path>]\n [--mapping <path>] [--sources <dir>] [--git-tag <tag>] [--config <file>]\n sentori config validate [--config sentori.config.json] [--release <r>]\n sentori doctor [--config sentori.config.json] [--api-url <url>]\n sentori upload all [--config sentori.config.json] [--release <r>] [--git-tag <tag>]\n [--dry-run] [--strict]\n sentori verify [--config sentori.config.json] [--release <r>] [--git-tag <tag>]\n sentori sources pack --release <r> --output sources.zip [--root .] [--git-tag <tag>]\n [--exclude <path>] <source-dir-or-file...>\n sentori upload srcbundle --release <r> [--root .] [--git-tag <tag>] <sources.zip|source-dir...>\n\nPaths in config are relative to that config. Sources keep paths relative to sources.root.\nSet the API-scope token in SENTORI_TOKEN (or the configured tokenEnv); init never stores it.\nRelease must match the SDK exactly, including its build number. SENTORI_RELEASE is supported.\nGit mode reads the specified tag's commit, never the working tree or a guessed latest tag.\nVerification checks every planned file's bytes and server validation; it does not claim event matching.\n";
|
|
38
|
+
export declare function loadUploadConfig(path: string): UploadConfig;
|
|
39
|
+
export declare function prepareUploadPlan(configPath: string, overrides?: {
|
|
40
|
+
release?: string;
|
|
41
|
+
apiUrl?: string;
|
|
42
|
+
gitTag?: string;
|
|
43
|
+
}): UploadPlan;
|
|
44
|
+
export declare function verifyUploadPlan(plan: UploadPlan, token: string): Promise<string[]>;
|
|
45
|
+
export declare function runWorkflow(command: 'init' | 'validate' | 'upload' | 'verify' | 'doctor', argv: string[]): Promise<number>;
|
|
46
|
+
export declare function runSourcesPack(argv: string[]): Promise<number>;
|
|
47
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AASA,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAGnF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,CAAC,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;IACxE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACnF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AACD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAAC,IAA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