@nsis/dent-cli 0.1.0 → 0.1.2
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 +20 -1
- package/bin/cli.mjs +3 -3
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ This is a TypeScript applicaiton that dependes on a [NodeJS](https://nodejs.org)
|
|
|
17
17
|
You could install the `dent` CLI globally
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
$ npm install --global @nsis/dent-cli
|
|
20
|
+
$ npm install --global @nsis/dent-cli
|
|
21
21
|
$ dent --help
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -29,6 +29,25 @@ Download and execute the latest version using [`npx`](https://medium.com/@maybek
|
|
|
29
29
|
$ npx dent --help
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
### Options
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Usage: index [options] <file...>
|
|
36
|
+
|
|
37
|
+
CLI tool to format NSIS scripts
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
-V, --version output the version number
|
|
41
|
+
--eol <"crlf"|"lf"> control how line-breaks are represented
|
|
42
|
+
-i, --indent-size <number> number of units per indentation level (default: 2)
|
|
43
|
+
-s, --use-spaces indent with spaces instead of tabs (default: false)
|
|
44
|
+
--trim trim empty lines (default: true)
|
|
45
|
+
--write edit files in-place (default: false)
|
|
46
|
+
--quiet suppress output (default: false)
|
|
47
|
+
--debug prints additional debug messages (default: false)
|
|
48
|
+
-h, --help display help for command
|
|
49
|
+
```
|
|
50
|
+
|
|
32
51
|
## Related
|
|
33
52
|
|
|
34
53
|
- [`dent` Library](https://www.npmjs.com/package/@nsis/dent)
|
package/bin/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { Command } from 'commander';
|
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { dirname, resolve } from 'node:path';
|
|
4
4
|
import { promises } from 'node:fs';
|
|
5
|
-
import {
|
|
5
|
+
import { createFormatter } from '@nsis/dent';
|
|
6
6
|
import { glob } from 'glob';
|
|
7
7
|
import logSymbols from 'log-symbols';
|
|
8
8
|
import colors from 'picocolors';
|
|
@@ -33,7 +33,7 @@ async function main() {
|
|
|
33
33
|
if (options.debug) {
|
|
34
34
|
console.log('\nCLI parameters:', { args, options });
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const format = createFormatter({
|
|
37
37
|
endOfLines: options.eol,
|
|
38
38
|
indentSize: options.indent,
|
|
39
39
|
trimEmptyLines: options.trim,
|
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
console.time(`${logSymbols.success} ${colors.blue(file)}`);
|
|
51
51
|
}
|
|
52
52
|
const rawContents = (await promises.readFile(file)).toString();
|
|
53
|
-
const formattedContents =
|
|
53
|
+
const formattedContents = format(rawContents);
|
|
54
54
|
if (options.debug) {
|
|
55
55
|
console.log('\nConversion:', {
|
|
56
56
|
raw: rawContents,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsis/dent-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "An opinionated code formatter for NSIS scripts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"lint": "npm-run-all --parallel lint:*",
|
|
13
13
|
"prepack": "npm run build",
|
|
14
14
|
"start": "npm run build -- --watch",
|
|
15
|
+
"test": "echo \"Tests pending\" && exit 0",
|
|
15
16
|
"prepare": "husky install"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
@@ -28,34 +29,33 @@
|
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
31
|
-
"url": "https://github.com/idleberg/node-dent.git"
|
|
32
|
+
"url": "https://github.com/idleberg/node-dent-cli.git"
|
|
32
33
|
},
|
|
33
34
|
"keywords": [
|
|
34
35
|
"nsis",
|
|
35
36
|
"formatter"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@nsis/dent": "^0.
|
|
39
|
+
"@nsis/dent": "^0.3.1",
|
|
39
40
|
"commander": "^10.0.1",
|
|
40
|
-
"glob": "^10.
|
|
41
|
+
"glob": "^10.3.3",
|
|
41
42
|
"log-symbols": "^5.1.0",
|
|
42
43
|
"picocolors": "^1.0.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@rollup/plugin-commonjs": "^25.0.0",
|
|
46
46
|
"@rollup/plugin-json": "^6.0.0",
|
|
47
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
47
|
+
"@rollup/plugin-typescript": "^11.1.2",
|
|
48
48
|
"@types/node": "^20.2.3",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
50
|
-
"@typescript-eslint/parser": "^
|
|
51
|
-
"eslint": "^8.
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
50
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
51
|
+
"eslint": "^8.45.0",
|
|
52
52
|
"eslint-plugin-json": "^3.1.0",
|
|
53
53
|
"husky": "^8.0.3",
|
|
54
|
-
"lint-staged": "^13.2.
|
|
55
|
-
"npm-run-all2": "^6.0.
|
|
56
|
-
"rollup": "^3.
|
|
57
|
-
"tslib": "^2.
|
|
58
|
-
"typescript": "^5.
|
|
54
|
+
"lint-staged": "^13.2.3",
|
|
55
|
+
"npm-run-all2": "^6.0.6",
|
|
56
|
+
"rollup": "^3.26.2",
|
|
57
|
+
"tslib": "^2.6.0",
|
|
58
|
+
"typescript": "^5.1.6"
|
|
59
59
|
},
|
|
60
60
|
"lint-staged": {
|
|
61
61
|
"*.(json|ts)": "eslint --cache --fix"
|