nekos 3.1.0 → 3.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/.prettierignore +24 -0
- package/.prettierrc.json +3 -0
- package/README.md +1 -0
- package/bin/nekos.js +20 -3
- package/package.json +7 -3
package/.prettierignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# GitHub
|
|
2
|
+
.github/
|
|
3
|
+
archives/
|
|
4
|
+
img/
|
|
5
|
+
|
|
6
|
+
# Dependencies
|
|
7
|
+
node_modules/
|
|
8
|
+
|
|
9
|
+
# Dev
|
|
10
|
+
scripts/
|
|
11
|
+
test/
|
|
12
|
+
|
|
13
|
+
# No Format
|
|
14
|
+
aa/
|
|
15
|
+
dist/
|
|
16
|
+
private/
|
|
17
|
+
.gitignore
|
|
18
|
+
.npmignore
|
|
19
|
+
*.json
|
|
20
|
+
*.md
|
|
21
|
+
|
|
22
|
+
# Config
|
|
23
|
+
tsconfig.json
|
|
24
|
+
.env
|
package/.prettierrc.json
ADDED
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/nekos)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://github.com/prettier/prettier)
|
|
5
6
|
[](https://github.com/otoneko110/nekos/actions/workflows/validate-aa.yml)
|
|
6
7
|
|
|
7
8
|
A simple CLI tool to display cat ASCII art in your console.
|
package/bin/nekos.js
CHANGED
|
@@ -2,15 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
import { program } from "commander";
|
|
4
4
|
import nekos from "../dist/index.js";
|
|
5
|
+
import { consola } from "consola";
|
|
6
|
+
import { isPackageLatest } from "is-package-latest";
|
|
7
|
+
import pkg from "../package.json" with { type: "json" };
|
|
8
|
+
|
|
9
|
+
async function versionInfo(p) {
|
|
10
|
+
const res = await isPackageLatest(p);
|
|
11
|
+
if (!res.isLatest)
|
|
12
|
+
consola.warn(
|
|
13
|
+
`New version released! =^・w・^=\n\n${res.currentVersion} --> ${res.latestVersion}\n\nnpm install -g ${res.name}@latest`,
|
|
14
|
+
);
|
|
15
|
+
return p.version;
|
|
16
|
+
}
|
|
5
17
|
|
|
6
18
|
program
|
|
19
|
+
.version(
|
|
20
|
+
await versionInfo(pkg),
|
|
21
|
+
"-v, --version",
|
|
22
|
+
"Check the current version.",
|
|
23
|
+
)
|
|
7
24
|
.option(
|
|
8
25
|
"-i, --id <id>",
|
|
9
|
-
"Display a specific cat by its ID (filename without .txt)"
|
|
26
|
+
"Display a specific cat by its ID (filename without .txt)",
|
|
10
27
|
)
|
|
11
28
|
.option(
|
|
12
29
|
"-c, --colors [colors...]",
|
|
13
|
-
'Specify colors (e.g., RANDOM, RAINBOW, #ff00ff, "#ff0000 #00ff00")'
|
|
30
|
+
'Specify colors (e.g., RANDOM, RAINBOW, #ff00ff, "#ff0000 #00ff00")',
|
|
14
31
|
);
|
|
15
32
|
|
|
16
33
|
program.parse(process.argv);
|
|
@@ -24,7 +41,7 @@ if (options.id) {
|
|
|
24
41
|
|
|
25
42
|
if (options.colors) {
|
|
26
43
|
const finalColors = options.colors.flatMap((colorString) =>
|
|
27
|
-
colorString.split(" ")
|
|
44
|
+
colorString.split(" "),
|
|
28
45
|
);
|
|
29
46
|
|
|
30
47
|
if (finalColors.length === 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nekos",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Let's have cute cats mess around in the log!",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nekos": "bin/nekos.js"
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "cross-env FORCE_COLOR=1 node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
18
18
|
"clean": "rimraf dist",
|
|
19
|
+
"format": "prettier --write .",
|
|
20
|
+
"format:check": "prettier --check .",
|
|
19
21
|
"build:types": "tsc",
|
|
20
22
|
"build:js": "node scripts/build.js",
|
|
21
|
-
"build": "npm run clean && npm run build:types && npm run build:js"
|
|
23
|
+
"build": "npm run clean && npm run format && npm run build:types && npm run build:js"
|
|
22
24
|
},
|
|
23
25
|
"repository": {
|
|
24
26
|
"type": "git",
|
|
@@ -43,13 +45,15 @@
|
|
|
43
45
|
"@randplus/color": "^3.0.0",
|
|
44
46
|
"commander": "^14.0.0",
|
|
45
47
|
"consola": "^3.4.2",
|
|
46
|
-
"gradient-string": "^3.0.0"
|
|
48
|
+
"gradient-string": "^3.0.0",
|
|
49
|
+
"is-package-latest": "^1.0.0"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@types/node": "^24.3.0",
|
|
50
53
|
"cross-env": "^10.0.0",
|
|
51
54
|
"esbuild": "^0.25.9",
|
|
52
55
|
"jest": "^30.1.1",
|
|
56
|
+
"prettier": "3.6.2",
|
|
53
57
|
"rimraf": "^6.0.1",
|
|
54
58
|
"typescript": "^5.9.2"
|
|
55
59
|
}
|