putitoutthere 0.3.10 → 0.3.11
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.
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
* synthesis. Extracted verbatim from the "Verify published per-triple npm
|
|
11
11
|
* tarballs honor expected files" bash block.
|
|
12
12
|
*
|
|
13
|
+
* The count is RECURSIVE (#633). A consumer whose build stages the binary
|
|
14
|
+
* nested — `artifacts/<name>-<triple>/bin/<binary>` rather than flat —
|
|
15
|
+
* publishes a tarball whose top level is `package.json` plus the `bin/`
|
|
16
|
+
* directory, and a top-level file count discards that directory along with
|
|
17
|
+
* the payload inside it. The nested layout is legal all the way to publish
|
|
18
|
+
* (`checkCompleteness` lists recursively, so it accepts either shape), so
|
|
19
|
+
* this check has to see it too. Paths are reported relative to `package/`,
|
|
20
|
+
* which is what makes a nested payload legible in the log. One walk decides
|
|
21
|
+
* the verdict, so the failure message can no longer name a file the verdict
|
|
22
|
+
* called absent.
|
|
23
|
+
*
|
|
13
24
|
* The platform package name is reconstructed as `{name}-{triple}` — the
|
|
14
25
|
* default template every fixture uses — because the matrix row carries the
|
|
15
26
|
* main package name (synthesis is a publish-time concern). Returns the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triple.d.ts","sourceRoot":"","sources":["../../../src/verify/npm-tarball/triple.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"triple.d.ts","sourceRoot":"","sources":["../../../src/verify/npm-tarball/triple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAEtE,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,UAAU,EAAE,EAClB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA+CjB"}
|
|
@@ -10,16 +10,28 @@
|
|
|
10
10
|
* synthesis. Extracted verbatim from the "Verify published per-triple npm
|
|
11
11
|
* tarballs honor expected files" bash block.
|
|
12
12
|
*
|
|
13
|
+
* The count is RECURSIVE (#633). A consumer whose build stages the binary
|
|
14
|
+
* nested — `artifacts/<name>-<triple>/bin/<binary>` rather than flat —
|
|
15
|
+
* publishes a tarball whose top level is `package.json` plus the `bin/`
|
|
16
|
+
* directory, and a top-level file count discards that directory along with
|
|
17
|
+
* the payload inside it. The nested layout is legal all the way to publish
|
|
18
|
+
* (`checkCompleteness` lists recursively, so it accepts either shape), so
|
|
19
|
+
* this check has to see it too. Paths are reported relative to `package/`,
|
|
20
|
+
* which is what makes a nested payload legible in the log. One walk decides
|
|
21
|
+
* the verdict, so the failure message can no longer name a file the verdict
|
|
22
|
+
* called absent.
|
|
23
|
+
*
|
|
13
24
|
* The platform package name is reconstructed as `{name}-{triple}` — the
|
|
14
25
|
* default template every fixture uses — because the matrix row carries the
|
|
15
26
|
* main package name (synthesis is a publish-time concern). Returns the
|
|
16
27
|
* process exit code (0 ok, 1 on any metadata-only tarball).
|
|
17
28
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
29
|
+
import { rm } from 'node:fs/promises';
|
|
30
|
+
import { relative } from 'node:path';
|
|
20
31
|
import { downloadNpmTarball } from './download.js';
|
|
21
32
|
import { listFilesRecursive } from '../../utils/list-files-recursive.js';
|
|
22
33
|
import { resolveNpmTarballUrl } from './resolve-url.js';
|
|
34
|
+
import { toPosixPath } from '../../utils/to-posix-path.js';
|
|
23
35
|
export async function verifyNpmTarballTriple(rows, opts) {
|
|
24
36
|
const npmRows = rows.filter((r) => r.kind === 'npm' && r.target !== 'main' && r.target !== 'noarch');
|
|
25
37
|
if (npmRows.length === 0) {
|
|
@@ -39,15 +51,23 @@ export async function verifyNpmTarballTriple(rows, opts) {
|
|
|
39
51
|
continue;
|
|
40
52
|
}
|
|
41
53
|
const { root, packageDir } = await downloadNpmTarball(url, 2);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
// Only the tarball's own root `package.json` is metadata — a nested one
|
|
55
|
+
// is payload like any other file, and excluding it by basename would
|
|
56
|
+
// make "contains only package.json" a false statement about a tarball
|
|
57
|
+
// holding two of them.
|
|
58
|
+
const payload = (await listFilesRecursive(packageDir))
|
|
59
|
+
.map((f) => toPosixPath(relative(packageDir, f)))
|
|
60
|
+
.filter((f) => f !== 'package.json');
|
|
61
|
+
if (payload.length > 0) {
|
|
62
|
+
process.stdout.write(` ok: ${payload.length} non-metadata file(s): ${payload.join(' ')} \n`);
|
|
47
63
|
}
|
|
48
64
|
else {
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
// No listing to print: reaching here means the recursive walk found
|
|
66
|
+
// nothing but the root `package.json`, so any listing would restate
|
|
67
|
+
// the sentence. The old message appended one built from a SECOND,
|
|
68
|
+
// recursive walk while the verdict came from a top-level count — which
|
|
69
|
+
// is how it came to name the very binary it called absent (#633).
|
|
70
|
+
process.stdout.write(`::error::[${platformName}@${version}] tarball contains only package.json (no synthesized binary/.node staged).\n`);
|
|
51
71
|
fail = 1;
|
|
52
72
|
}
|
|
53
73
|
await rm(root, { recursive: true, force: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triple.js","sourceRoot":"","sources":["../../../src/verify/npm-tarball/triple.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"triple.js","sourceRoot":"","sources":["../../../src/verify/npm-tarball/triple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,oBAAoB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