@confirmdev/listalyze 0.2.1
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/PUBLISH.md +71 -0
- package/README.md +87 -0
- package/dist/index.js +7911 -0
- package/dist/vendor/license-nag/license_nag.cjs +215 -0
- package/dist/vendor/license-nag/license_nag_bg.wasm +0 -0
- package/package.json +38 -0
package/PUBLISH.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Publishing `@listalyze/cli`
|
|
2
|
+
|
|
3
|
+
This package is a **self-contained, standalone npm package**. It has **zero
|
|
4
|
+
`workspace:*` dependencies** and an **empty runtime `dependencies`** block:
|
|
5
|
+
|
|
6
|
+
- The engine packages (`@listalyze/engine-js`, `@listalyze/core`,
|
|
7
|
+
`@listalyze/operation-schemas`) are **inlined** into `dist/index.js` by esbuild
|
|
8
|
+
(`--packages=bundle`).
|
|
9
|
+
- The license-nag WASM module is **vendored**, not a dependency. Its committed
|
|
10
|
+
nodejs binding (`license_nag.cjs` + `license_nag_bg.wasm`) lives in
|
|
11
|
+
`vendor/license-nag/` and is copied into `dist/vendor/license-nag/` at build
|
|
12
|
+
time. At runtime the bundle `require`s the `.cjs` from a path relative to
|
|
13
|
+
itself, and the `.cjs` loads its sibling `.wasm`. **`@listalyze/license-nag`
|
|
14
|
+
does NOT need to be published separately.**
|
|
15
|
+
|
|
16
|
+
The vendored files are kept in sync from `packages/license-nag/pkg/` by the
|
|
17
|
+
`sync-vendor` build step. If you regenerate the WASM bindings (re-run
|
|
18
|
+
`packages/license-nag/build.sh`), just rebuild the CLI to re-vendor them.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1. Build (typecheck + re-vendor + esbuild bundle -> dist/, including dist/vendor/)
|
|
24
|
+
pnpm --filter @listalyze/cli build
|
|
25
|
+
|
|
26
|
+
# 2. Pack and REVIEW the file list before publishing
|
|
27
|
+
cd apps/cli
|
|
28
|
+
npm pack
|
|
29
|
+
tar tzf listalyze-cli-*.tgz
|
|
30
|
+
# Expect exactly:
|
|
31
|
+
# package/package.json
|
|
32
|
+
# package/README.md
|
|
33
|
+
# package/PUBLISH.md
|
|
34
|
+
# package/dist/index.js
|
|
35
|
+
# package/dist/vendor/license-nag/license_nag.cjs
|
|
36
|
+
# package/dist/vendor/license-nag/license_nag_bg.wasm
|
|
37
|
+
|
|
38
|
+
# 3. (Optional but recommended) prove the tarball is standalone in a clean dir
|
|
39
|
+
TMP=$(mktemp -d) && cd "$TMP" && npm init -y >/dev/null \
|
|
40
|
+
&& npm install /ABS/PATH/TO/listalyze-cli-*.tgz \
|
|
41
|
+
&& printf 'b\na\na\n' | LISTALYZE_SKIP_NAG_DELAY=1 ./node_modules/.bin/listalyze dedupe
|
|
42
|
+
# stdout should be: b\na (nag box prints to stderr)
|
|
43
|
+
|
|
44
|
+
# 4. Publish (needs the owner's npm auth token + the @listalyze scope/org)
|
|
45
|
+
cd /path/to/repo/apps/cli
|
|
46
|
+
npm publish --access public
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Before the first publish — package name / scope
|
|
50
|
+
|
|
51
|
+
The package is named **`@listalyze/cli`**. To publish under that name the
|
|
52
|
+
**`@listalyze` npm org/scope must exist** and your npm account must be a member
|
|
53
|
+
with publish rights (`npm whoami`, then `npm org ls listalyze`). The final public
|
|
54
|
+
name/scope is **the owner's call** — if `@listalyze` is unavailable, either:
|
|
55
|
+
|
|
56
|
+
- create the `@listalyze` org on npmjs.com, or
|
|
57
|
+
- rename to another scope you own (e.g. `@your-org/listalyze-cli`), or
|
|
58
|
+
- publish unscoped (e.g. `listalyze`) if the name is free.
|
|
59
|
+
|
|
60
|
+
`publishConfig.access` is already `public` (required for free scoped packages).
|
|
61
|
+
`files` ships only `dist/` (including `dist/vendor/`), `README.md`, and
|
|
62
|
+
`PUBLISH.md`. `bin.listalyze` → `dist/index.js`. `engines.node` is `>=20`.
|
|
63
|
+
|
|
64
|
+
## Notes
|
|
65
|
+
|
|
66
|
+
- `npm publish` is intentionally **manual** — it is never run by CI or any build
|
|
67
|
+
script in this repo.
|
|
68
|
+
- `package.json` is currently `"private": true` to guard against accidental
|
|
69
|
+
publishes from the monorepo. Flip it to `false` (or remove the field) in the
|
|
70
|
+
publish commit when you are ready to ship.
|
|
71
|
+
- Do not commit the generated `.tgz`.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# @listalyze/cli
|
|
2
|
+
|
|
3
|
+
The command-line surface of **Listalyze** — a local-first, privacy-first list &
|
|
4
|
+
text power tool. It runs entirely offline on your machine and uses the same
|
|
5
|
+
engine as the web app.
|
|
6
|
+
|
|
7
|
+
> **Fully-usable open beta.** Every command works today with no account
|
|
8
|
+
> required. The CLI shows a brief WinRAR/PKZIP-style "Unregistered copy"
|
|
9
|
+
> reminder on **stderr** before each data command (and pauses ~2.5s). The
|
|
10
|
+
> reminder is annoyance-only — it never blocks a command, and **stdout stays
|
|
11
|
+
> clean** so pipes are unaffected. Registering a seat silences it. Run
|
|
12
|
+
> `listalyze register` to learn more.
|
|
13
|
+
|
|
14
|
+
## Install / build
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm --filter @listalyze/cli build # typecheck + esbuild bundle -> dist/index.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`build` typechecks (`tsc --noEmit`) and then esbuilds `src/index.ts` into a
|
|
22
|
+
single, self-contained, executable `dist/index.js`. The engine packages
|
|
23
|
+
(`@listalyze/engine-js`, `@listalyze/core`, `@listalyze/operation-schemas`) are
|
|
24
|
+
**inlined** from their TypeScript source, so the bundle runs with **no need to
|
|
25
|
+
pre-build** any workspace package. The license-nag WASM module
|
|
26
|
+
(`license_nag.cjs` + `license_nag_bg.wasm`) is **vendored** into
|
|
27
|
+
`vendor/license-nag/` and copied to `dist/vendor/license-nag/` at build time, so
|
|
28
|
+
it has **no separate dependency** — the published package is fully standalone
|
|
29
|
+
with an empty `dependencies` block.
|
|
30
|
+
|
|
31
|
+
The binary is `listalyze` (`bin` → `dist/index.js`).
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
Every command reads from **stdin** (or `-i/--input <file>`) and writes to
|
|
36
|
+
**stdout** (or `-o/--output <file>`).
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
printf 'banana\napple\napple\n' | node apps/cli/dist/index.js dedupe
|
|
40
|
+
printf 'banana\napple\n' | node apps/cli/dist/index.js sort
|
|
41
|
+
listalyze sort -i list.txt -o sorted.txt
|
|
42
|
+
listalyze register # how to license Listalyze Pro
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Set `LISTALYZE_SKIP_NAG_DELAY=1` to skip the unregistered-copy delay (the
|
|
46
|
+
reminder is still printed to stderr).
|
|
47
|
+
|
|
48
|
+
### Commands
|
|
49
|
+
|
|
50
|
+
| Command | Description | Flags |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `sort` | Sort lines | `--desc`, `--numeric`, `--natural` |
|
|
53
|
+
| `dedupe` | Remove duplicate lines (keep first) | |
|
|
54
|
+
| `trim` | Trim leading/trailing whitespace per line | |
|
|
55
|
+
| `remove-blanks` | Remove blank/whitespace-only lines | |
|
|
56
|
+
| `regex-extract <pattern>` | Emit every regex match, one per line | `--flags <f>` (default `gi`) |
|
|
57
|
+
| `regex-replace <pattern> <replacement>` | Replace regex matches | `--flags <f>` (default `g`) |
|
|
58
|
+
| `stats` | Print list statistics | |
|
|
59
|
+
| `register` | Show how to register Listalyze Pro | |
|
|
60
|
+
|
|
61
|
+
Top-level: `--help`/`-h`, `--version`/`-v`. Each command also accepts `--help`.
|
|
62
|
+
`--help`, `--version`, and `register` never show the registration reminder.
|
|
63
|
+
|
|
64
|
+
On a pipeline error the first error message is printed to stderr and the process
|
|
65
|
+
exits non-zero.
|
|
66
|
+
|
|
67
|
+
## Registration
|
|
68
|
+
|
|
69
|
+
`listalyze register` explains Listalyze Pro: **$6/month or $36/year per seat**,
|
|
70
|
+
with one subscription covering web + CLI + desktop + mobile. Registration and
|
|
71
|
+
login open at launch; for now, join the launch list at
|
|
72
|
+
<https://listalyze.com/pricing>.
|
|
73
|
+
|
|
74
|
+
The CLI reads a license token from `~/.config/listalyze/license.json`
|
|
75
|
+
(`{ "token": "..." }`). A valid token silences the reminder. In-CLI sign-in
|
|
76
|
+
(ConfirmID device/loopback login) that fetches and writes that token is a future
|
|
77
|
+
task — this build cannot fetch a token yet.
|
|
78
|
+
|
|
79
|
+
## Publishing
|
|
80
|
+
|
|
81
|
+
> `npm publish` is a **manual** step (it is intentionally not run by CI or any
|
|
82
|
+
> build script here).
|
|
83
|
+
|
|
84
|
+
The package is **fully standalone** (zero `workspace:*` deps, empty runtime
|
|
85
|
+
`dependencies`): engine packages are bundled and license-nag is vendored. See
|
|
86
|
+
[`PUBLISH.md`](./PUBLISH.md) for the exact steps (`build` → `npm pack` →
|
|
87
|
+
`npm publish --access public`) and the name/scope notes.
|