briff-scan 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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -2
  3. package/dist/cli.mjs +8417 -0
  4. package/package.json +30 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fikret Yunus Yildiz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
- # Temporary Holding Version
1
+ # briff-scan
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The scanner for [Briff](https://briff.dev), the weekly briefing built from your own stack.
4
+ It reads a repo's lockfiles and runtime files and sends Briff the package names, installed
5
+ versions and runtimes it finds. **No source code and no file contents leave the machine.**
6
+
7
+ ## What it sends
8
+
9
+ For each repo: `{ name, version, direct }` per installed package and
10
+ `{ runtime, version, file }` per declared runtime, plus the repo name. Nothing else.
11
+
12
+ - Lockfiles: `package-lock.json` / `npm-shrinkwrap.json` (v1–v3), `pnpm-lock.yaml` (v5–v9),
13
+ `yarn.lock` (v1 and Berry). Installed versions come from the lockfile, never from ranges.
14
+ - Runtimes: `.nvmrc`, `.node-version`, `package.json` engines/volta, `composer.json` /
15
+ `composer.lock`, `.python-version`, `pyproject.toml`, `runtime.txt`, `Pipfile`, `go.mod`,
16
+ `.ruby-version`, `Gemfile.lock`, `pom.xml`, Gradle files, `.sdkmanrc`, `global.json`,
17
+ `*.csproj`, `rust-toolchain(.toml)`, `Cargo.toml`, `.tool-versions`, `mise.toml`, and every
18
+ `FROM` / `image:` in Dockerfiles and compose files.
19
+ - `node_modules`, build output, test fixtures and dot-directories are skipped.
20
+
21
+ Run `npx briff-scan@0 --dry-run --json` to see the exact payload before sending anything.
22
+
23
+ ## GitHub Actions
24
+
25
+ Create a scan token in Briff (onboarding, or Settings → Scan tokens), add it to the repo as the
26
+ secret `BRIFF_TOKEN`, and commit `.github/workflows/briff.yml`:
27
+
28
+ ```yaml
29
+ name: briff
30
+ on:
31
+ push: { branches: [main] }
32
+ schedule:
33
+ - cron: "0 3 * * 1" # Mondays 03:00 UTC, before the bulletin
34
+ jobs:
35
+ scan:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-node@v4
40
+ with: { node-version: 22 }
41
+ - run: npx briff-scan@0
42
+ env:
43
+ BRIFF_API_URL: https://app.briff.dev
44
+ BRIFF_TOKEN: ${{ secrets.BRIFF_TOKEN }}
45
+ ```
46
+
47
+ In Actions it scans the checked-out repo and names it `owner/repo`.
48
+
49
+ ## Local use
50
+
51
+ Node 20 or later.
52
+
53
+ ```bash
54
+ npx briff-scan@0 --dry-run # this repo; sends nothing
55
+ BRIFF_TOKEN=brf_... npx briff-scan@0 # upload this repo
56
+ BRIFF_TOKEN=brf_... npx briff-scan@0 --all-repos --root ~/code # every git repo in a folder
57
+ ```
58
+
59
+ ## Options
60
+
61
+ | Option | Env | Default |
62
+ | --------------------- | --------------- | ---------------------------------------------------- |
63
+ | `--api <url>` | `BRIFF_API_URL` | `https://app.briff.dev` |
64
+ | `--token <token>` | `BRIFF_TOKEN` | required unless `--dry-run` |
65
+ | `--root <dir>` | | current directory |
66
+ | `--repo-name <name>` | | `GITHUB_REPOSITORY` in Actions, else the folder name |
67
+ | `--all-repos` | | off: the root is one repo |
68
+ | `--include-worktrees` | | off (with `--all-repos`) |
69
+ | `--max-depth <n>` | | 6 |
70
+ | `--chunk <n>` | | 10 repos per upload (with `--all-repos`) |
71
+ | `--dry-run` | | off |
72
+ | `--json` | | off: machine-readable output |
73
+
74
+ Exit codes: 0 done, 1 the scan or upload failed, 2 bad options.
75
+
76
+ ## Licence
77
+
78
+ MIT. The bundle includes [yaml](https://github.com/eemeli/yaml) (ISC); its licence is at the
79
+ end of `dist/cli.mjs`.