@siftline/cli 0.0.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/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +9 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.mjs +2 -0
- package/dist/src-B28Y6vHX.mjs +51 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Todayweb
|
|
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,19 @@
|
|
|
1
|
+
# @siftline/cli
|
|
2
|
+
|
|
3
|
+
The Siftline command line: measure a recipe against its fixtures, then label for real.
|
|
4
|
+
|
|
5
|
+
This package is a walking skeleton. The `siftline` bin prints its version and a usage
|
|
6
|
+
block; `test` and `label` are named there but not implemented, which is enough to prove
|
|
7
|
+
the bin, shebang, build, type, test, pack and publish path. The commands land next.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx @siftline/cli --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Exit codes: `0` for `--help` and `--version`, `1` for anything else.
|
|
14
|
+
|
|
15
|
+
ESM only. Node 22.14 or newer.
|
|
16
|
+
|
|
17
|
+
## Licence
|
|
18
|
+
|
|
19
|
+
MIT — see [LICENSE](./LICENSE).
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { r as run } from "./src-B28Y6vHX.mjs";
|
|
3
|
+
//#region src/cli.ts
|
|
4
|
+
const result = run(process.argv.slice(2));
|
|
5
|
+
if (result.stdout !== "") process.stdout.write(result.stdout);
|
|
6
|
+
if (result.stderr !== "") process.stderr.write(result.stderr);
|
|
7
|
+
process.exitCode = result.code;
|
|
8
|
+
//#endregion
|
|
9
|
+
export {};
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The published version of `@siftline/cli`, baked in at build time.
|
|
4
|
+
*
|
|
5
|
+
* Changesets bumps `package.json`; this constant follows it without a second edit.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VERSION: string;
|
|
8
|
+
/**
|
|
9
|
+
* The usage block. `test` and `label` are named before they exist so that the bin
|
|
10
|
+
* wiring is proven — and so that `siftline --help` never lies about what it does.
|
|
11
|
+
*/
|
|
12
|
+
export declare const USAGE: string;
|
|
13
|
+
/** What one invocation produced: the text to write and the process exit code. */
|
|
14
|
+
export interface CliResult {
|
|
15
|
+
readonly code: 0 | 1;
|
|
16
|
+
readonly stdout: string;
|
|
17
|
+
readonly stderr: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Interpret command line arguments. Pure on purpose: the bin is the only place that
|
|
21
|
+
* touches the process, so the behaviour stays testable without one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function run(argv: readonly string[]): CliResult;
|
|
24
|
+
//#endregion
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VERSION } from "@siftline/core";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* The published version of `@siftline/cli`, baked in at build time.
|
|
6
|
+
*
|
|
7
|
+
* Changesets bumps `package.json`; this constant follows it without a second edit.
|
|
8
|
+
*/
|
|
9
|
+
const VERSION$1 = "0.0.1";
|
|
10
|
+
/**
|
|
11
|
+
* The usage block. `test` and `label` are named before they exist so that the bin
|
|
12
|
+
* wiring is proven — and so that `siftline --help` never lies about what it does.
|
|
13
|
+
*/
|
|
14
|
+
const USAGE = [
|
|
15
|
+
`siftline ${VERSION$1} (engine ${VERSION})`,
|
|
16
|
+
"",
|
|
17
|
+
"Usage",
|
|
18
|
+
" siftline <command> [options]",
|
|
19
|
+
"",
|
|
20
|
+
"Commands",
|
|
21
|
+
" test Measure a recipe against its fixtures (not yet implemented)",
|
|
22
|
+
" label Label inputs with a recipe (not yet implemented)",
|
|
23
|
+
"",
|
|
24
|
+
"Options",
|
|
25
|
+
" --help Print this help and exit",
|
|
26
|
+
" --version Print the version and exit"
|
|
27
|
+
].join("\n");
|
|
28
|
+
/**
|
|
29
|
+
* Interpret command line arguments. Pure on purpose: the bin is the only place that
|
|
30
|
+
* touches the process, so the behaviour stays testable without one.
|
|
31
|
+
*/
|
|
32
|
+
function run(argv) {
|
|
33
|
+
const [first, ...rest] = argv;
|
|
34
|
+
if (rest.length === 0 && first === "--version") return {
|
|
35
|
+
code: 0,
|
|
36
|
+
stdout: `${VERSION$1}\n`,
|
|
37
|
+
stderr: ""
|
|
38
|
+
};
|
|
39
|
+
if (rest.length === 0 && first === "--help") return {
|
|
40
|
+
code: 0,
|
|
41
|
+
stdout: `${USAGE}\n`,
|
|
42
|
+
stderr: ""
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
code: 1,
|
|
46
|
+
stdout: "",
|
|
47
|
+
stderr: `siftline: ${first === void 0 ? "no command given" : `unknown command: ${argv.join(" ")}`}\n\n${USAGE}\n`
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { VERSION$1 as n, run as r, USAGE as t };
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@siftline/cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "The Siftline command line: measure a recipe against its fixtures, then label for real.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"classification",
|
|
7
|
+
"cli",
|
|
8
|
+
"siftline",
|
|
9
|
+
"triage"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://docs.siftline.dev",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Siftline/toolkit/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Todayweb",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/Siftline/toolkit.git",
|
|
20
|
+
"directory": "packages/cli"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"siftline": "./dist/cli.mjs"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
|
+
"default": "./dist/index.mjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsdown",
|
|
41
|
+
"dev": "tsdown --watch",
|
|
42
|
+
"lint": "oxlint --type-aware --deny-warnings",
|
|
43
|
+
"lint:fix": "oxlint --type-aware --deny-warnings --fix",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"typecheck": "tsc --noEmit"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@siftline/core": "^0.0.2"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@arethetypeswrong/core": "0.18.5",
|
|
52
|
+
"@siftline/config": "workspace:*",
|
|
53
|
+
"publint": "0.3.24",
|
|
54
|
+
"tsdown": "0.23.0",
|
|
55
|
+
"typescript": "7.0.2",
|
|
56
|
+
"vitest": "4.1.11"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=22.14"
|
|
60
|
+
}
|
|
61
|
+
}
|