@exodus/stasis 1.0.0-beta.0 → 1.0.0-beta.10
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 +32 -8
- package/bin/stasis.js +389 -214
- package/package.json +52 -12
- package/src/audit-corrections.js +96 -0
- package/src/audit.js +289 -64
- package/src/babel-worker.cjs +65 -0
- package/src/babel.js +131 -0
- package/src/bundle-from-lockfile.js +14 -22
- package/src/bundle-reader.js +77 -0
- package/src/cmd/build.js +96 -128
- package/src/cmd/bundle.js +1121 -654
- package/src/cmd/diff.js +2 -19
- package/src/cmd/github-bundle.js +39 -0
- package/src/cmd/output.js +36 -0
- package/src/cmd/sbom.js +7 -19
- package/src/diff.js +80 -129
- package/src/installed-commits.js +182 -0
- package/src/json-stream.js +283 -0
- package/src/loader-mock.js +8 -15
- package/src/loaders/bash.js +49 -116
- package/src/loaders/cargo.js +1716 -0
- package/src/loaders/foundry.js +923 -0
- package/src/loaders/paths.js +33 -0
- package/src/loaders/php.js +375 -402
- package/src/loaders/rust.js +3254 -242
- package/src/loaders/solidity-ownership.js +531 -0
- package/src/loaders/solidity.js +412 -162
- package/src/loaders/toml.js +68 -0
- package/src/metro-resolver.js +150 -0
- package/src/metro-transformer.js +3 -2
- package/src/mock.js +57 -165
- package/src/parse.js +4 -16
- package/src/resolve-fields.js +370 -0
- package/src/resolve-node.js +419 -0
- package/src/resolve-typescript.js +541 -0
- package/src/rollup.js +5 -0
- package/src/sbom.js +120 -97
- package/src/scan.js +348 -180
- package/src/vfs-bundle/entries.js +144 -0
- package/src/vfs-bundle/github.js +202 -0
- package/src/vfs-bundle/prisma.js +439 -0
- package/src/vfs-bundle/soldeer.js +125 -0
- package/src/vfs-bundle/tree.js +647 -0
- package/src/vfs-bundle.js +80 -0
- package/src/why.js +434 -0
- package/src/apis/npm/index.js +0 -36
- package/src/apis/npm/semver.cjs +0 -44
- package/src/cmd/extract.js +0 -193
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
*Analyzeable source code bundles with resolutions + fine-grained lockfiles.*
|
|
4
4
|
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
[](https://esbuild.github.io/)
|
|
7
|
+
[](https://metrobundler.dev/)
|
|
8
|
+
[](https://rollupjs.org/)
|
|
9
|
+
[](https://webpack.js.org/)
|
|
10
|
+
|
|
5
11
|
Both lockfiles and bundles only include what is actually _used_.\
|
|
6
12
|
Generally about 10x smaller than production-focused `node_modules` install.
|
|
7
13
|
|
|
@@ -21,7 +27,7 @@ Lockfile can attest the bundle in a readable form, but that's not required - bun
|
|
|
21
27
|
| Modes: `add`, `replace`, `frozen`, `ignore` | Modes: `load`, `add`, `replace`, `frozen`, `ignore` |
|
|
22
28
|
|
|
23
29
|
The main difference between lockfiles and bundles is that lockfiles contain integrities, and bundles contain full content.\
|
|
24
|
-
See [file formats](https://github.com/
|
|
30
|
+
See [file formats](https://github.com/PreventiveMeasures/stasis/blob/main/doc/file-formats.md).
|
|
25
31
|
|
|
26
32
|
Both can be run in full scope (default) or just in `node_modules` scope.
|
|
27
33
|
|
|
@@ -52,23 +58,41 @@ _Lockfiles (npm/pnpm/etc) not mentioned: they are like the "tarball" column, but
|
|
|
52
58
|
| `stasis run --lock=add --bundle=add --mock app.js` | build without the app's side effects (network, fs writes) |
|
|
53
59
|
| `stasis run --lock=add --child-process app.js` | also attest modules loaded in forked child processes (e.g. Metro transform workers) |
|
|
54
60
|
| `stasis run --bundle=add --fs=sync app.js` | build a bundle that also captures sync `fs.readFileSync`/`readdirSync` reads |
|
|
61
|
+
| `stasis run --lock=add --import=./instrument.mjs app.js` | also load a preload module; its own graph is runner infrastructure, not attested |
|
|
55
62
|
| `stasis bundle src/index.js` | build a bundle statically, without executing it |
|
|
56
|
-
| `stasis bundle --
|
|
57
|
-
| `stasis bundle --
|
|
58
|
-
| `stasis bundle --
|
|
59
|
-
| `stasis
|
|
63
|
+
| `stasis bundle --add src/worker.js` | merge more entries into the existing bundle |
|
|
64
|
+
| `stasis bundle --conditions=react-native,browser app.js` | statically bundle with extra `exports`/`imports` resolution conditions |
|
|
65
|
+
| `stasis bundle --mainFields=react-native,browser,main app.js` | statically bundle honoring legacy package `mainFields` |
|
|
66
|
+
| `stasis bundle --metro --platforms=ios,android app.js` | statically bundle the way Metro resolves, all platforms at once |
|
|
67
|
+
| `stasis bundle --typescript src/index.ts` | statically bundle TS sources, resolving `./x.js` imports to `./x.ts` as tsc does |
|
|
68
|
+
| `stasis add src assets` | add files to the project's bundles as-is, with no dependency resolution |
|
|
69
|
+
| `stasis github-bundle --github=owner/name --sha=<commit> src/index.js` | statically bundle a GitHub repo at a commit, with nothing installed |
|
|
70
|
+
| `stasis build --output=out.js app.stasis.code.br [entry]` | rebuild a runnable JS bundle with esbuild, following the bundle's recorded import graph exactly |
|
|
60
71
|
| `stasis build --output=out.js stasis.lock.json [entry]` | same, reading + verifying sources from disk against the lockfile |
|
|
61
72
|
| `stasis extract app.stasis.code.br` | unpack a bundle back to sources + a `stasis.lock.json` |
|
|
62
73
|
| `stasis diff --stat a.lock.json b.stasis.code.br` | summarize module/file differences between two lockfiles/bundles |
|
|
63
74
|
| `stasis prune` | trim `node_modules` to the lockfile, verifying the rest |
|
|
64
|
-
| `stasis audit stasis.lock.json` | report
|
|
65
|
-
| `stasis audit app.stasis.code.br` |
|
|
75
|
+
| `stasis audit stasis.lock.json` | report advisories for a lockfile's or bundle's dependencies |
|
|
76
|
+
| `stasis audit --why app.stasis.code.br` | same, with the import chains that pull each flagged package in |
|
|
66
77
|
| `stasis sbom --format=spdx stasis.lock.json` | export an SPDX SBOM for a lockfile or bundle |
|
|
67
78
|
| `stasis sbom --format=cyclonedx app.stasis.code.br` | export a CycloneDX SBOM for a lockfile or bundle |
|
|
68
79
|
|
|
80
|
+
Each command's options are documented in [doc/](https://github.com/PreventiveMeasures/stasis/tree/main/doc):
|
|
81
|
+
[`run`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/run.md),
|
|
82
|
+
[`bundle`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/bundle.md) (and `add`),
|
|
83
|
+
[`github-bundle`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/github-bundle.md),
|
|
84
|
+
[`build`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/build.md),
|
|
85
|
+
[`extract`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/extract.md),
|
|
86
|
+
[`diff`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/diff.md),
|
|
87
|
+
[`prune`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/prune.md),
|
|
88
|
+
[`audit`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/audit.md),
|
|
89
|
+
[`sbom`](https://github.com/PreventiveMeasures/stasis/blob/main/doc/sbom.md).
|
|
90
|
+
`stasis bundle` also bundles Solidity, PHP, Bash and Rust sources, see [file formats](https://github.com/PreventiveMeasures/stasis/blob/main/doc/file-formats.md#source-language-bundles-solidity--php--bash--rust).
|
|
91
|
+
|
|
69
92
|
## Runtime
|
|
70
93
|
|
|
71
|
-
The zero-dependency [`@exodus/stasis-core`](../stasis-core) CLI provides `run` and `prune` commands only
|
|
94
|
+
The zero-dependency [`@exodus/stasis-core`](../stasis-core) CLI provides the `run`, `add`, `extract` and `prune` commands only.\
|
|
95
|
+
The bundler plugins live in [`@exodus/stasis-plugins`](../stasis-plugins).
|
|
72
96
|
|
|
73
97
|
## License
|
|
74
98
|
|