@s-hirano-ist/s-scripts 1.20.1 → 1.21.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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://dprint.dev/schemas/v0.json",
|
|
3
|
+
"lineWidth": 80,
|
|
4
|
+
"indentWidth": 2,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"markdown": {
|
|
7
|
+
"lineWidth": 80,
|
|
8
|
+
"textWrap": "maintain"
|
|
9
|
+
},
|
|
10
|
+
"json": {
|
|
11
|
+
"indentWidth": 2
|
|
12
|
+
},
|
|
13
|
+
"yaml": {
|
|
14
|
+
"indentWidth": 2,
|
|
15
|
+
"quotes": "preferDouble"
|
|
16
|
+
},
|
|
17
|
+
"plugins": [
|
|
18
|
+
"https://plugins.dprint.dev/markdown-0.21.1.wasm",
|
|
19
|
+
"https://plugins.dprint.dev/json-0.21.3.wasm",
|
|
20
|
+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s-content-format.d.ts","sourceRoot":"","sources":["../src/s-content-format.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const dprintPkgPath = require.resolve("dprint/package.json");
|
|
8
|
+
const dprintBin = path.join(path.dirname(dprintPkgPath), "bin.cjs");
|
|
9
|
+
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
+
const configPath = path.join(packageRoot, "configs", "dprint.json");
|
|
11
|
+
const DEFAULT_EXCLUDES = [
|
|
12
|
+
"!**/node_modules",
|
|
13
|
+
"!**/dist",
|
|
14
|
+
"!**/build",
|
|
15
|
+
"!**/coverage",
|
|
16
|
+
"!**/raw/article/**",
|
|
17
|
+
"!**/bun.lock",
|
|
18
|
+
"!**/package-lock.json",
|
|
19
|
+
"!**/yarn.lock",
|
|
20
|
+
"!**/.env",
|
|
21
|
+
"!**/.env.*",
|
|
22
|
+
];
|
|
23
|
+
const rawArgs = process.argv.slice(2);
|
|
24
|
+
const checkFlagIndex = rawArgs.indexOf("--check");
|
|
25
|
+
const isCheck = checkFlagIndex !== -1;
|
|
26
|
+
const remaining = checkFlagIndex === -1
|
|
27
|
+
? rawArgs
|
|
28
|
+
: [
|
|
29
|
+
...rawArgs.slice(0, checkFlagIndex),
|
|
30
|
+
...rawArgs.slice(checkFlagIndex + 1),
|
|
31
|
+
];
|
|
32
|
+
const subcommand = isCheck ? "check" : "fmt";
|
|
33
|
+
const hasPositional = remaining.some((arg) => !arg.startsWith("-"));
|
|
34
|
+
const finalArgs = hasPositional
|
|
35
|
+
? remaining
|
|
36
|
+
: [...remaining, ".", ...DEFAULT_EXCLUDES];
|
|
37
|
+
const child = spawn(process.execPath, [dprintBin, subcommand, "--config", configPath, ...finalArgs], { stdio: "inherit" });
|
|
38
|
+
child.on("exit", (code, signal) => {
|
|
39
|
+
if (signal) {
|
|
40
|
+
process.kill(process.pid, signal);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
process.exit(code ?? 1);
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=s-content-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s-content-format.js","sourceRoot":"","sources":["../src/s-content-format.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAA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CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,MAAM,SAAS,GAAG,aAAa;IAC9B,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,gBAAgB,CAAC,CAAC;AAE5C,MAAM,KAAK,GAAG,KAAK,CAClB,OAAO,CAAC,QAAQ,EAChB,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,EAC7D,EAAE,KAAK,EAAE,SAAS,EAAE,CACpB,CAAC;AAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IACjC,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAClC,OAAO;IACR,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s-hirano-ist/s-scripts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "CLI scripts for s-private data operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
+
"s-content-format": "./dist/s-content-format.js",
|
|
7
8
|
"fetch-articles": "./dist/fetch-articles.js",
|
|
8
9
|
"fetch-books": "./dist/fetch-books.js",
|
|
9
10
|
"fetch-images": "./dist/fetch-images.js",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"dist",
|
|
37
|
+
"configs",
|
|
36
38
|
"README.md",
|
|
37
39
|
"LICENSE"
|
|
38
40
|
],
|
|
@@ -47,14 +49,15 @@
|
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
51
|
"cheerio": "1.2.0",
|
|
52
|
+
"dprint": "0.54.0",
|
|
50
53
|
"glob": "13.0.6",
|
|
51
54
|
"iconv-lite": "0.7.2",
|
|
52
55
|
"sharp": "0.34.5",
|
|
53
56
|
"turndown": "7.2.4",
|
|
57
|
+
"@s-hirano-ist/s-core": "1.18.8",
|
|
58
|
+
"@s-hirano-ist/s-notification": "1.18.3",
|
|
54
59
|
"@s-hirano-ist/s-database": "1.18.6",
|
|
55
|
-
"@s-hirano-ist/s-notification": "1.18.2",
|
|
56
60
|
"@s-hirano-ist/s-search": "1.18.7",
|
|
57
|
-
"@s-hirano-ist/s-core": "1.18.7",
|
|
58
61
|
"@s-hirano-ist/s-storage": "1.18.4"
|
|
59
62
|
},
|
|
60
63
|
"devDependencies": {
|
|
@@ -67,6 +70,7 @@
|
|
|
67
70
|
"build": "tsc",
|
|
68
71
|
"clean": "rm -rf dist",
|
|
69
72
|
"typecheck": "tsc --noEmit",
|
|
73
|
+
"s-content-format": "tsx src/s-content-format.ts",
|
|
70
74
|
"fetch-articles": "tsx src/fetch-articles.ts",
|
|
71
75
|
"fetch-books": "tsx src/fetch-books.ts",
|
|
72
76
|
"fetch-images": "tsx src/fetch-images.ts",
|