flashtrace 0.12.0 → 0.13.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 +16 -5
- package/bin/flashtrace.js +46 -0
- package/package.json +13 -13
- package/dist/flashtrace.mjs +0 -1429
package/README.md
CHANGED
|
@@ -56,21 +56,32 @@
|
|
|
56
56
|
<a href="https://sonarcloud.io/component_measures?metric=vulnerabilities&id=flashtrace_flashtrace">
|
|
57
57
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=flashtrace_flashtrace&metric=vulnerabilities" alt="SonarCloud amount of vulnerabilities." />
|
|
58
58
|
</a>
|
|
59
|
+
<!--
|
|
60
|
+
The coverage and tests badges read from the orphan `badges` branch,
|
|
61
|
+
which CI rewrites on every push to main. They therefore always show
|
|
62
|
+
main's last published numbers - never the numbers of the branch this
|
|
63
|
+
README is viewed on.
|
|
64
|
+
-->
|
|
65
|
+
<a href="https://github.com/flashtrace/flashtrace/actions/workflows/ci.yml">
|
|
66
|
+
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fflashtrace%2Fflashtrace%2Fbadges%2Fcoverage.json" alt="Line coverage of src/." />
|
|
67
|
+
</a>
|
|
68
|
+
<a href="https://github.com/flashtrace/flashtrace/actions/workflows/ci.yml">
|
|
69
|
+
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fflashtrace%2Fflashtrace%2Fbadges%2Ftests.json" alt="Number of tests." />
|
|
70
|
+
</a>
|
|
59
71
|
</p>
|
|
60
72
|
|
|
61
73
|
## Getting Started
|
|
62
74
|
|
|
63
75
|
To use flashtrace in your project,
|
|
64
76
|
|
|
65
|
-
-
|
|
66
|
-
- or
|
|
77
|
+
- run `npm install flashtrace -D` to add it as a dev dependency (a prebuilt native binary; `npx flashtrace` runs the tracing),
|
|
78
|
+
- or `cargo install flashtrace` to build it from the published crate,
|
|
79
|
+
- or download the binary for your platform from the [releases](https://github.com/flashtrace/flashtrace/releases).
|
|
67
80
|
|
|
68
|
-
You can then execute `npx flashtrace` to run the tracing.
|
|
69
81
|
Read our [Usage Guide](docs/USAGE.md) for more details.
|
|
70
|
-
Node >= 18 is required for flashtrace to work.
|
|
71
82
|
|
|
72
83
|
Looking for a working setup to start from? The [examples/](examples/) folder
|
|
73
|
-
holds
|
|
84
|
+
holds seven self-contained example projects, from a minimal clean trace to a
|
|
74
85
|
deliberately broken one showing every defect flashtrace reports. Each has a
|
|
75
86
|
README, and the end-to-end tests verify their exact report output on every run.
|
|
76
87
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* npm launcher for the flashtrace native binary: resolves the platform
|
|
6
|
+
* package matching this machine (installed through optionalDependencies) and
|
|
7
|
+
* hands the process over to it. No downloads, no install scripts - if the
|
|
8
|
+
* binary is not here, the fix is a reinstall, and this launcher only says so.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require('node:child_process');
|
|
12
|
+
const { constants } = require('node:os');
|
|
13
|
+
|
|
14
|
+
const platformPackage = `@flashtrace/${process.platform}-${process.arch}`;
|
|
15
|
+
const binaryName = process.platform === 'win32' ? 'flashtrace.exe' : 'flashtrace';
|
|
16
|
+
|
|
17
|
+
let binary;
|
|
18
|
+
try {
|
|
19
|
+
binary = require.resolve(`${platformPackage}/bin/${binaryName}`);
|
|
20
|
+
} catch {
|
|
21
|
+
console.error(
|
|
22
|
+
[
|
|
23
|
+
`flashtrace: no prebuilt binary for ${process.platform}-${process.arch}.`,
|
|
24
|
+
'',
|
|
25
|
+
`The package ${platformPackage} should have been installed as an`,
|
|
26
|
+
'optional dependency of flashtrace. If your install ran with',
|
|
27
|
+
'--omit=optional (or --no-optional), reinstall without it. If no such',
|
|
28
|
+
'package exists, this platform has no prebuilt binary; the supported',
|
|
29
|
+
'targets are listed at https://github.com/flashtrace/flashtrace/releases',
|
|
30
|
+
].join('\n'),
|
|
31
|
+
);
|
|
32
|
+
process.exit(2);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
36
|
+
if (result.error) {
|
|
37
|
+
console.error(`flashtrace: failed to run ${binary}: ${result.error.message}`);
|
|
38
|
+
process.exit(2);
|
|
39
|
+
}
|
|
40
|
+
if (result.signal) {
|
|
41
|
+
// the binary died on a signal: die on the same one, so the caller sees it
|
|
42
|
+
process.kill(process.pid, result.signal);
|
|
43
|
+
// still alive when Node ignores that signal (SIGPIPE): the shell's 128 + n
|
|
44
|
+
process.exit(128 + constants.signals[result.signal]);
|
|
45
|
+
}
|
|
46
|
+
process.exit(result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flashtrace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Lightning-fast, reference-based requirement tracing that works anywhere.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
"markdown",
|
|
18
18
|
"cli"
|
|
19
19
|
],
|
|
20
|
-
"type": "module",
|
|
21
|
-
"packageManager": "pnpm@11.10.0",
|
|
22
20
|
"bin": {
|
|
23
|
-
"flashtrace": "
|
|
21
|
+
"flashtrace": "bin/flashtrace.js"
|
|
24
22
|
},
|
|
25
23
|
"files": [
|
|
26
|
-
"
|
|
24
|
+
"bin/"
|
|
27
25
|
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"prepack": "node -e \"for (const file of ['README.md', 'LICENSE']) require('node:fs').copyFileSync('../../' + file, file)\""
|
|
28
|
+
},
|
|
28
29
|
"engines": {
|
|
29
30
|
"node": ">=18"
|
|
30
31
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"esbuild": "^0.28.1"
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"@flashtrace/darwin-arm64": "0.13.0",
|
|
34
|
+
"@flashtrace/darwin-x64": "0.13.0",
|
|
35
|
+
"@flashtrace/linux-arm64": "0.13.0",
|
|
36
|
+
"@flashtrace/linux-x64": "0.13.0",
|
|
37
|
+
"@flashtrace/win32-arm64": "0.13.0",
|
|
38
|
+
"@flashtrace/win32-x64": "0.13.0"
|
|
39
39
|
}
|
|
40
40
|
}
|