@jinshuju/cli 0.1.2 → 0.2.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/README.md +58 -1
- package/dist/args.d.ts +47 -0
- package/dist/args.js +185 -0
- package/dist/auth.js +43 -11
- package/dist/cli-bin.js +1 -1
- package/dist/cli.d.ts +2 -20
- package/dist/cli.js +71 -659
- package/dist/commands/account.d.ts +2 -0
- package/dist/commands/account.js +15 -0
- package/dist/commands/comment.d.ts +2 -0
- package/dist/commands/comment.js +66 -0
- package/dist/commands/entry.d.ts +31 -0
- package/dist/commands/entry.js +715 -0
- package/dist/commands/field.d.ts +3 -0
- package/dist/commands/field.js +259 -0
- package/dist/commands/folder.d.ts +2 -0
- package/dist/commands/folder.js +31 -0
- package/dist/commands/form.d.ts +2 -0
- package/dist/commands/form.js +394 -0
- package/dist/commands/index.d.ts +16 -0
- package/dist/commands/index.js +68 -0
- package/dist/commands/local.d.ts +10 -0
- package/dist/commands/local.js +76 -0
- package/dist/commands/opensearch.d.ts +2 -0
- package/dist/commands/opensearch.js +73 -0
- package/dist/commands/shared.d.ts +57 -0
- package/dist/commands/shared.js +122 -0
- package/dist/commands/table.d.ts +2 -0
- package/dist/commands/table.js +101 -0
- package/dist/{commands.d.ts → commands/types.d.ts} +24 -30
- package/dist/commands/types.js +1 -0
- package/dist/commands/upload.d.ts +7 -0
- package/dist/commands/upload.js +40 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.js +81 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +45 -5
- package/dist/errors.d.ts +48 -0
- package/dist/errors.js +99 -0
- package/dist/help.d.ts +1 -1
- package/dist/help.js +11 -1
- package/dist/http.d.ts +37 -4
- package/dist/http.js +119 -14
- package/dist/local.d.ts +24 -0
- package/dist/local.js +208 -0
- package/dist/options.d.ts +8 -4
- package/dist/options.js +63 -18
- package/dist/payload.d.ts +14 -8
- package/dist/payload.js +22 -54
- package/dist/render.d.ts +21 -0
- package/dist/render.js +315 -0
- package/dist/result.d.ts +31 -0
- package/dist/result.js +32 -0
- package/dist/values.d.ts +4 -0
- package/dist/values.js +8 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +16 -0
- package/package.json +23 -18
- package/dist/commands.js +0 -1672
package/dist/version.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
/**
|
|
3
|
+
* Read from package.json, not restated here. A release bumps that file and
|
|
4
|
+
* nothing else, so a constant reports the previous version from the moment it
|
|
5
|
+
* is published — 0.1.1 shipped saying 0.1.0.
|
|
6
|
+
*/
|
|
7
|
+
export const VERSION = readVersion();
|
|
8
|
+
function readVersion() {
|
|
9
|
+
try {
|
|
10
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
11
|
+
return pkg.version ?? 'unknown';
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return 'unknown';
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jinshuju/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Command line interface for Jinshuju Open API v1",
|
|
5
|
+
"homepage": "https://github.com/jinshuju/cli#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/jinshuju/cli/issues"
|
|
8
|
+
},
|
|
5
9
|
"license": "Apache-2.0",
|
|
6
10
|
"repository": {
|
|
7
11
|
"type": "git",
|
|
8
12
|
"url": "git+https://github.com/jinshuju/cli.git"
|
|
9
13
|
},
|
|
10
|
-
"homepage": "https://github.com/jinshuju/cli#readme",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/jinshuju/cli/issues"
|
|
13
|
-
},
|
|
14
|
-
"type": "module",
|
|
15
14
|
"bin": {
|
|
16
15
|
"jinshuju": "dist/cli-bin.js",
|
|
17
16
|
"jsj": "dist/cli-bin.js"
|
|
18
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"!dist/**/*.test.js",
|
|
21
|
+
"!dist/**/*.test.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org"
|
|
27
|
+
},
|
|
19
28
|
"scripts": {
|
|
20
29
|
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
|
|
21
30
|
"build": "npm run clean && tsc -p tsconfig.json && chmod +x dist/cli-bin.js",
|
|
22
31
|
"prepare": "npm run build",
|
|
23
32
|
"test": "npm run build && node --test dist/*.test.js",
|
|
24
33
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
-
"lint": "
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"!dist/**/*.test.js",
|
|
30
|
-
"!dist/**/*.test.d.ts"
|
|
31
|
-
],
|
|
32
|
-
"engines": {
|
|
33
|
-
"node": ">=20"
|
|
34
|
+
"lint": "oxlint",
|
|
35
|
+
"fmt": "oxfmt",
|
|
36
|
+
"fmt:check": "oxfmt --check",
|
|
37
|
+
"check": "npm run typecheck && npm run lint && npm run fmt:check"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"@types/node": "^22.10.0",
|
|
41
|
+
"oxfmt": "^0.70.0",
|
|
42
|
+
"oxlint": "^1.85.0",
|
|
37
43
|
"typescript": "^5.9.3"
|
|
38
44
|
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"registry": "https://registry.npmjs.org"
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20"
|
|
42
47
|
}
|
|
43
48
|
}
|