@nsis/dent-cli 0.4.3 → 0.4.4
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/bin/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{access as e,constants as t,glob as n,readFile as r,writeFile as i}from"node:fs/promises";import{createFormatter as a}from"@nsis/dent";import{blue as o,dim as s}from"kleur/colors";import{platform as c}from"node:os";import{Command as l}from"commander";import{createConsola as u}from"consola";const d=u({level:4});async function f(n){try{await e(n,t.F_OK)}catch{return!1}return!0}async function p(){return(await import(`../package.json`,{with:{type:`json`}})).default.version??`development`}async function m(){let e=new l(`dent`),t=await p(),n=c()===`win32`?`crlf`:`lf`;e.version(t).configureOutput({writeOut:e=>d.log(e),writeErr:e=>d.error(e)}).description(`CLI tool to format NSIS scripts`).arguments(
|
|
1
|
+
import{access as e,constants as t,glob as n,readFile as r,writeFile as i}from"node:fs/promises";import{createFormatter as a}from"@nsis/dent";import{blue as o,dim as s}from"kleur/colors";import{platform as c}from"node:os";import{Command as l}from"commander";import{createConsola as u}from"consola";const d=u({level:4});async function f(n){try{await e(n,t.F_OK)}catch{return!1}return!0}async function p(){return(await import(`../package.json`,{with:{type:`json`}})).default.version??`development`}async function m(){let e=new l(`dent`),t=await p(),n=c()===`win32`?`crlf`:`lf`;e.version(t).configureOutput({writeOut:e=>d.log(e),writeErr:e=>d.error(e)}).description(`CLI tool to format NSIS scripts`).arguments(`[file...]`).option(`-D, --debug`,`prints additional debug messages`,!1).optionsGroup(`Formatting Options`).option(`-e, --eol <"crlf"|"lf">`,`control how line-breaks are represented`,e=>[`crlf`,`lf`].includes(e)?e:(d.warn(`Invalid EOL value provided, defaulting to "${n}".`),n),n).option(`-i, --indent-size <number>`,`number of units per indentation level`,e=>Number.parseInt(e,10),2).option(`-s, --use-spaces`,`indent with spaces instead of tabs`,!1).option(`-t, --trim`,`trim empty lines`,!0).option(`-w, --write`,`edit files in-place`,!1).parse(process.argv);let r=e.opts(),i=Array.isArray(e.args)?e.args:[e.args];return i.length||e.help(),r.debug&&d.debug(`
|
|
2
2
|
CLI parameters:`,{args:i,options:r}),r.indentSize!==2&&r.useSpaces===!1&&d.warn(`The "indent-size" option is ignored when "use-spaces" is not set.`),{args:i,options:r}}const{args:h,options:g}=await m(),_=await Array.fromAsync(n(h,{cwd:process.cwd()}));_.length===0&&(d.error(`No valid input files provided, exiting.`),process.exit(1));const v=a({endOfLines:g.eol,indentSize:g.indentSize,trimEmptyLines:g.trim,useTabs:!g.useSpaces});g.write&&d.start(`Formatting ${h.length} ${h.length===1?`file`:`files`}...`);const y=performance.now();for await(let e of _){if(!e.endsWith(`.nsi`)&&!e.endsWith(`.nsh`)){d.warn(`${o(e)} is not an NSIS script, skipping.`);continue}let t=performance.now();if(await f(e)===!1){d.warn(`${o(e)} does not exist, skipping.`);continue}let n=v((await r(e)).toString()),a=performance.now(),c=Math.round(a-t);g.write?(await i(e,n,{encoding:`utf-8`}),d.info(`${o(e)} formatted ${s(`(${c}ms)`)}`)):process.stdout.write(n)}if(g.write){let e=performance.now(),t=Math.round(e-y);d.success(`Completed in ${t}ms.`)}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={name:`@nsis/dent-cli`,version:`0.4.
|
|
1
|
+
var e={name:`@nsis/dent-cli`,version:`0.4.4`,description:`An opinionated code formatter for NSIS scripts`,license:`MIT`,scripts:{build:`tsdown`,dev:`tsdown --watch`,lint:`concurrently --prefix-colors blue,green,magenta npm:lint:*`,"lint:biome":`biome check`,"lint:e18e":`e18e-cli analyze`,prepack:`npm run build`,"publish:jsr":`deno publish`,"publish:npm":`np`,start:`npm run build -- --watch`,test:`echo "Tests pending" && exit 0`},files:[`bin/`,`LICENSE`,`README.md`],type:`module`,bin:{dent:`./bin/cli.mjs`},engines:{node:`>=20.0.0`},repository:{type:`git`,url:`git+https://github.com/idleberg/node-dent-cli.git`},keywords:[`nsis`,`formatter`],dependencies:{"@nsis/dent":`^0.6.2`,commander:`^14.0.3`,consola:`^3.4.2`,kleur:`^4.1.5`},devDependencies:{"@commitlint/cli":`^20.5.3`,"@commitlint/config-conventional":`^20.5.3`,"@idleberg/configs":`^0.4.2`,"@types/node":`^24.12.2`,concurrently:`^9.2.1`,np:`^11.2.0`,tsdown:`^0.21.10`,typescript:`^6.0.3`},pnpm:{onlyBuiltDependencies:[`lefthook`]},packageManager:`pnpm@10.30.3+sha512.c961d1e0a2d8e354ecaa5166b822516668b7f44cb5bd95122d590dd81922f606f5473b6d23ec4a5be05e7fcd18e8488d47d978bbe981872f1145d06e9a740017`};export{e as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsis/dent-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "An opinionated code formatter for NSIS scripts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"kleur": "^4.1.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@commitlint/cli": "^20.
|
|
34
|
-
"@commitlint/config-conventional": "^20.
|
|
33
|
+
"@commitlint/cli": "^20.5.3",
|
|
34
|
+
"@commitlint/config-conventional": "^20.5.3",
|
|
35
35
|
"@idleberg/configs": "^0.4.2",
|
|
36
|
-
"@types/node": "^24.
|
|
36
|
+
"@types/node": "^24.12.2",
|
|
37
37
|
"concurrently": "^9.2.1",
|
|
38
|
-
"np": "^11.0
|
|
39
|
-
"tsdown": "^0.21.
|
|
40
|
-
"typescript": "^
|
|
38
|
+
"np": "^11.2.0",
|
|
39
|
+
"tsdown": "^0.21.10",
|
|
40
|
+
"typescript": "^6.0.3"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsdown",
|