@emdzej/csfs-cli 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.
- package/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +144 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michał Jaskólski
|
|
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
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @emdzej/csfs-cli
|
|
2
|
+
|
|
3
|
+
Prepare a directory for static hosting, and inspect a tree through any csfs
|
|
4
|
+
backend from a terminal.
|
|
5
|
+
|
|
6
|
+
_Part of [csfs](https://github.com/emdzej/csfs) — a **c**lient **s**ide **f**ile **s**ystem: one read API over static HTTP, a picked directory,
|
|
7
|
+
OPFS, and inside zip archives._
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx @emdzej/csfs-cli manifest ./data --label "my tree"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
No install needed for one-off use.
|
|
14
|
+
|
|
15
|
+
## `manifest` — describe a directory
|
|
16
|
+
|
|
17
|
+
**HTTP cannot list a directory**, so a tree served over static HTTP carries a
|
|
18
|
+
description of itself. This writes it:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
csfs manifest ./data --label "my tree" --pretty
|
|
22
|
+
csfs manifest ./data -o ./public/csfs-manifest.json
|
|
23
|
+
csfs manifest ./data --dry-run # print the summary, write nothing
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then serve the directory from anywhere — S3, GitHub Pages, nginx — and read it
|
|
27
|
+
with [`@emdzej/csfs-http`](https://www.npmjs.com/package/@emdzej/csfs-http).
|
|
28
|
+
|
|
29
|
+
### Archives read in place
|
|
30
|
+
|
|
31
|
+
A large archive can stay packed and answer for a directory that is not on disk:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
csfs manifest ./data \
|
|
35
|
+
--archive "/drawings.zip:/drawings:basename" \
|
|
36
|
+
--archive "/images_1.zip:/images"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The spec is `<archive>:<serves>[:basename]`, and it is repeatable — several
|
|
40
|
+
archives may serve one directory, which is how a multi-disc data set is
|
|
41
|
+
described without renaming anything.
|
|
42
|
+
|
|
43
|
+
`basename` matters when the archive and the extracted layout are **different
|
|
44
|
+
shapes**: a flat `drawings.zip` standing in for a tree bucketed by name, where
|
|
45
|
+
`/drawings/1132/1132C000.png` must find entry `1132C000.png`. Only you know
|
|
46
|
+
which it is, so it is declared rather than guessed. Default is `relative`.
|
|
47
|
+
|
|
48
|
+
Without `--archive`, an archive is just a file in the manifest — still readable
|
|
49
|
+
via `#`, but nothing stands in for a directory. On a real tree, declaring nine
|
|
50
|
+
archives removed **184,610 files** while serving the same bytes.
|
|
51
|
+
|
|
52
|
+
## `ls` and `cat` — look at a tree
|
|
53
|
+
|
|
54
|
+
Both take a local directory _or_ an `http(s)` URL, which is what makes them
|
|
55
|
+
useful for checking a deployment actually works:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
csfs ls ./data /pr
|
|
59
|
+
csfs ls https://data.example.test /pr -R
|
|
60
|
+
csfs cat https://data.example.test /pr/index.dat | xxd | head
|
|
61
|
+
|
|
62
|
+
# and inside an archive, over the network, without downloading it
|
|
63
|
+
csfs cat https://data.example.test "/drawings.zip#/1132C000.png" > out.png
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
That last one is the thing worth trying after a deploy: if it works, the host
|
|
67
|
+
honours `Range` and the manifest is correct. If the host silently ignores
|
|
68
|
+
`Range`, csfs says so rather than handing back the wrong bytes.
|
|
69
|
+
|
|
70
|
+
## Prefer not to install Node?
|
|
71
|
+
|
|
72
|
+
The [demo app](https://csfs.emdzej.pl) builds a manifest from a folder you pick
|
|
73
|
+
in the browser and downloads the result. Same builder, no toolchain.
|
|
74
|
+
|
|
75
|
+
## Licence
|
|
76
|
+
|
|
77
|
+
**MIT** — see [LICENSE](https://github.com/emdzej/csfs/blob/main/LICENSE).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `csfs` — build a manifest, and look at a tree through any backend.
|
|
4
|
+
*
|
|
5
|
+
* The manifest command is the reason this exists: a static host cannot list a
|
|
6
|
+
* directory, so a tree served over HTTP has to describe itself, and something
|
|
7
|
+
* has to write that description. The inspection commands are here because the
|
|
8
|
+
* same code paths the browser uses can then be exercised without a browser —
|
|
9
|
+
* which is how a backend bug becomes a failing command rather than a blank
|
|
10
|
+
* page.
|
|
11
|
+
*/
|
|
12
|
+
import { writeFile } from "node:fs/promises";
|
|
13
|
+
import { Command } from "@commander-js/extra-typings";
|
|
14
|
+
import chalk from "chalk";
|
|
15
|
+
import { walkFileSystem } from "@emdzej/csfs-core";
|
|
16
|
+
import { httpFileSystem } from "@emdzej/csfs-http";
|
|
17
|
+
import { buildManifest, formatManifest, MANIFEST_FILE } from "@emdzej/csfs-manifest";
|
|
18
|
+
import { nodeFileSystem } from "@emdzej/csfs-node";
|
|
19
|
+
import { withArchives } from "@emdzej/csfs-zip";
|
|
20
|
+
/** A URL means HTTP; anything else is a directory. */
|
|
21
|
+
function open(source) {
|
|
22
|
+
const remote = source.startsWith("http://") || source.startsWith("https://");
|
|
23
|
+
return withArchives(remote ? httpFileSystem(source) : nodeFileSystem(source));
|
|
24
|
+
}
|
|
25
|
+
const program = new Command("csfs")
|
|
26
|
+
.description("Client-side file system tooling")
|
|
27
|
+
.version("0.1.0");
|
|
28
|
+
program
|
|
29
|
+
.command("manifest")
|
|
30
|
+
.description("describe a directory so it can be served over static HTTP")
|
|
31
|
+
.argument("<dir>", "directory to describe")
|
|
32
|
+
.option("-o, --out <file>", `where to write it (default: <dir>/${MANIFEST_FILE})`)
|
|
33
|
+
.option("-l, --label <text>", "a name for this tree")
|
|
34
|
+
.option("--pretty", "indent the JSON — larger, but readable in a diff", false)
|
|
35
|
+
.option("--archive <spec...>", "an archive to read in place: <archive>:<serves>[:basename]. " +
|
|
36
|
+
"Repeatable. Without this an archive is just a file.")
|
|
37
|
+
.option("-n, --dry-run", "print the summary and stop", false)
|
|
38
|
+
.action(async (dir, opts) => {
|
|
39
|
+
const fs = nodeFileSystem(dir);
|
|
40
|
+
if (!(await fs.directory("/"))) {
|
|
41
|
+
console.error(chalk.red(`${dir}: not a directory`));
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const archives = (opts.archive ?? []).map((spec) => {
|
|
46
|
+
const [archive, serves, entry] = spec.split(":");
|
|
47
|
+
if (!archive || !serves) {
|
|
48
|
+
throw new Error(`--archive ${spec}: expected <archive>:<serves>[:basename]`);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
archive,
|
|
52
|
+
serves,
|
|
53
|
+
...(entry === "basename" ? { entry: "basename" } : {}),
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
let last = Date.now();
|
|
57
|
+
const manifest = await buildManifest(fs, {
|
|
58
|
+
...(opts.label !== undefined ? { label: opts.label } : {}),
|
|
59
|
+
builtAt: new Date().toISOString(),
|
|
60
|
+
...(archives.length > 0 ? { archives } : {}),
|
|
61
|
+
// A manifest that describes itself carries a size that is wrong the
|
|
62
|
+
// moment it is written, which is worse than its absence.
|
|
63
|
+
filter: (path) => !path.endsWith(`/${MANIFEST_FILE}`),
|
|
64
|
+
onProgress: (found, path) => {
|
|
65
|
+
if (Date.now() - last < 250)
|
|
66
|
+
return;
|
|
67
|
+
last = Date.now();
|
|
68
|
+
process.stderr.write(`\r${chalk.dim(`${found.toLocaleString()} files ${path.slice(-60)}`)} `);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
process.stderr.write("\r");
|
|
72
|
+
const count = Object.keys(manifest.files).length;
|
|
73
|
+
let bytes = 0;
|
|
74
|
+
for (const size of Object.values(manifest.files))
|
|
75
|
+
bytes += size;
|
|
76
|
+
const text = formatManifest(manifest, { pretty: opts.pretty });
|
|
77
|
+
console.log(`${chalk.bold(count.toLocaleString())} files, ${(bytes / 1e9).toFixed(2)} GB, ` +
|
|
78
|
+
`manifest ${(text.length / 1e6).toFixed(2)} MB`);
|
|
79
|
+
for (const a of archives) {
|
|
80
|
+
console.log(chalk.dim(` archive ${a.archive} serves ${a.serves} (${a.entry ?? "relative"})`));
|
|
81
|
+
}
|
|
82
|
+
if (opts.dryRun) {
|
|
83
|
+
console.log(chalk.dim("--dry-run: nothing written."));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const out = opts.out ?? `${dir.replace(/\/+$/, "")}/${MANIFEST_FILE}`;
|
|
87
|
+
await writeFile(out, text);
|
|
88
|
+
console.log(`written to ${chalk.bold(out)}`);
|
|
89
|
+
console.log(chalk.dim("\nServe the directory with Range support and point a client at its URL."));
|
|
90
|
+
});
|
|
91
|
+
program
|
|
92
|
+
.command("ls")
|
|
93
|
+
.description("list a path through any backend")
|
|
94
|
+
.argument("<source>", "a directory, or an http(s) URL")
|
|
95
|
+
.argument("[path]", "path within the tree", "/")
|
|
96
|
+
.option("-R, --recursive", "walk the whole subtree", false)
|
|
97
|
+
.action(async (source, path, opts) => {
|
|
98
|
+
const fs = open(source);
|
|
99
|
+
if (opts.recursive) {
|
|
100
|
+
let files = 0;
|
|
101
|
+
let bytes = 0;
|
|
102
|
+
for await (const entry of walkFileSystem(fs, path)) {
|
|
103
|
+
console.log(`${String(entry.size).padStart(12)} ${entry.path}`);
|
|
104
|
+
files++;
|
|
105
|
+
bytes += entry.size;
|
|
106
|
+
}
|
|
107
|
+
console.log(chalk.dim(`\n${files.toLocaleString()} files, ${(bytes / 1e6).toFixed(1)} MB`));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const dir = await fs.directory(path);
|
|
111
|
+
if (!dir) {
|
|
112
|
+
// A file, or nothing at all. Saying which is more useful than "not
|
|
113
|
+
// found" for either.
|
|
114
|
+
const file = await fs.file(path);
|
|
115
|
+
if (!file) {
|
|
116
|
+
console.error(chalk.red(`${path}: not found`));
|
|
117
|
+
process.exitCode = 1;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
console.log(`${String(file.size).padStart(12)} ${file.path} ${chalk.dim(file.type)}`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
for (const entry of await dir.entries()) {
|
|
124
|
+
const size = entry.kind === "file" ? String(entry.size).padStart(12) : "".padStart(12);
|
|
125
|
+
const name = entry.kind === "directory" ? chalk.bold(`${entry.name}/`) : entry.name;
|
|
126
|
+
console.log(`${size} ${name}`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
program
|
|
130
|
+
.command("cat")
|
|
131
|
+
.description("write a file to stdout, including one inside an archive")
|
|
132
|
+
.argument("<source>", "a directory, or an http(s) URL")
|
|
133
|
+
.argument("<path>", "path within the tree; may use archive.zip#/inner")
|
|
134
|
+
.action(async (source, path) => {
|
|
135
|
+
const file = await open(source).file(path);
|
|
136
|
+
if (!file) {
|
|
137
|
+
console.error(chalk.red(`${path}: not found`));
|
|
138
|
+
process.exitCode = 1;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
process.stdout.write(await file.bytes());
|
|
142
|
+
});
|
|
143
|
+
await program.parseAsync();
|
|
144
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAqB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,sDAAsD;AACtD,SAAS,IAAI,CAAC,MAAc;IAC1B,MAAM,MAAM,GAAG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,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,yDAAyD,CAAC;KACtE,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;KACtD,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;KACtE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEL,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@emdzej/csfs-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Build csfs manifests, and inspect a tree through any backend",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/emdzej/csfs.git",
|
|
9
|
+
"directory": "apps/cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/emdzej/csfs#the-manifest",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/emdzej/csfs/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"csfs",
|
|
17
|
+
"manifest",
|
|
18
|
+
"cli",
|
|
19
|
+
"zip",
|
|
20
|
+
"filesystem"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"bin": {
|
|
24
|
+
"csfs": "dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@commander-js/extra-typings": "^15.0.0",
|
|
34
|
+
"chalk": "^6.0.0",
|
|
35
|
+
"commander": "^15.0.0",
|
|
36
|
+
"@emdzej/csfs-http": "0.1.0",
|
|
37
|
+
"@emdzej/csfs-core": "0.1.0",
|
|
38
|
+
"@emdzej/csfs-manifest": "0.1.0",
|
|
39
|
+
"@emdzej/csfs-node": "0.1.0",
|
|
40
|
+
"@emdzej/csfs-zip": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^22.13.1"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -b",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"clean": "rm -rf dist .turbo *.tsbuildinfo"
|
|
49
|
+
}
|
|
50
|
+
}
|