@node-cli/comments 0.2.9 → 0.2.11
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/dist/parse.js +2 -2
- package/dist/parse.js.map +1 -1
- package/package.json +7 -7
package/dist/parse.js
CHANGED
|
@@ -69,14 +69,14 @@ import { defaultFlags } from "./defaults.js";
|
|
|
69
69
|
{
|
|
70
70
|
exit: 1,
|
|
71
71
|
message: "You must provide at least one file path or glob pattern",
|
|
72
|
-
test: function(_flags, parameters) {
|
|
72
|
+
test: function test(_flags, parameters) {
|
|
73
73
|
return Object.keys(parameters || {}).length === 0;
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
exit: 1,
|
|
78
78
|
message: "--stdout can only be used with a single file",
|
|
79
|
-
test: function(flags, parameters) {
|
|
79
|
+
test: function test(flags, parameters) {
|
|
80
80
|
return flags.stdout === true && parameters && Object.keys(parameters).length > 1;
|
|
81
81
|
}
|
|
82
82
|
}
|
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["/* v8 ignore start */\nimport { parser } from \"@node-cli/parser\";\nimport { defaultFlags } from \"./defaults.js\";\n\nexport type Flags = {\n\twidth?: number;\n\tdryRun?: boolean;\n\tstdout?: boolean;\n\tnoLineWrap?: boolean;\n\tmergeLineComments?: boolean;\n\tboring?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n};\nexport type Parameters = {\n\tfiles?: string;\n};\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tshowHelp?: () => void;\n};\n\n/* v8 ignore next 120 */\nexport const config: Configuration = parser({\n\tmeta: import.meta,\n\texamples: [\n\t\t{\n\t\t\tcommand: \"comments src/**/*.ts\",\n\t\t\tcomment: \"## Reflow comments in all TS source files\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --dry-run src/index.ts\",\n\t\t\tcomment: \"## Show diff for a single file without writing\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --width 100 --merge-line-comments 'src/**/*.ts'\",\n\t\t\tcomment: \"## Use width 100 and merge groups of line comments\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --no-line-wrap src/file.ts\",\n\t\t\tcomment: \"## Disable wrapping of // comments\",\n\t\t},\n\t],\n\tflags: {\n\t\twidth: {\n\t\t\tdescription: \"Max output line width (default 80)\",\n\t\t\ttype: \"number\",\n\t\t\tdefault: defaultFlags.width,\n\t\t},\n\t\tdryRun: {\n\t\t\tshortFlag: \"D\",\n\t\t\tdescription: \"Show diff, don't write files (exit 1 if changes)\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tstdout: {\n\t\t\tdescription: \"Print transformed output of a single file to STDOUT\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tnoLineWrap: {\n\t\t\tdescription: \"Disable wrapping of // single-line comments\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tmergeLineComments: {\n\t\t\tdescription: \"Merge consecutive // lines into JSDoc blocks\",\n\t\t\ttype: \"boolean\",\n\t\t\tdefault: defaultFlags.mergeLineComments,\n\t\t},\n\t\tboring: {\n\t\t\tshortFlag: \"b\",\n\t\t\tdescription: \"Do not use color output\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tfiles: {\n\t\t\tdescription: \"File paths and/or glob patterns to process\",\n\t\t},\n\t},\n\trestrictions: [\n\t\t{\n\t\t\texit: 1,\n\t\t\tmessage: \"You must provide at least one file path or glob pattern\",\n\t\t\ttest: (_flags: Flags, parameters: Record<string, string>) =>\n\t\t\t\tObject.keys(parameters || {}).length === 0,\n\t\t},\n\t\t{\n\t\t\texit: 1,\n\t\t\tmessage: \"--stdout can only be used with a single file\",\n\t\t\ttest: (flags: Flags, parameters: Record<string, string>) =>\n\t\t\t\tflags.stdout === true &&\n\t\t\t\tparameters &&\n\t\t\t\tObject.keys(parameters).length > 1,\n\t\t},\n\t],\n\tusage: \"comments [options] <files...>\",\n});\n/* v8 ignore stop */\n"],"names":["parser","defaultFlags","config","meta","examples","command","comment","flags","width","description","type","default","dryRun","shortFlag","stdout","noLineWrap","mergeLineComments","boring","help","version","parameters","files","restrictions","exit","message","test","_flags","Object","keys","length","usage"],"mappings":"AAAA,mBAAmB,GACnB,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,YAAY,QAAQ,gBAAgB;AAqB7C,sBAAsB,GACtB,OAAO,IAAMC,SAAwBF,OAAO;IAC3CG,MAAM;IACNC,UAAU;QACT;YACCC,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;KACA;IACDC,OAAO;QACNC,OAAO;YACNC,aAAa;YACbC,MAAM;YACNC,SAASV,aAAaO,KAAK;QAC5B;QACAI,QAAQ;YACPC,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAI,QAAQ;YACPL,aAAa;YACbC,MAAM;QACP;QACAK,YAAY;YACXN,aAAa;YACbC,MAAM;QACP;QACAM,mBAAmB;YAClBP,aAAa;YACbC,MAAM;YACNC,SAASV,aAAae,iBAAiB;QACxC;QACAC,QAAQ;YACPJ,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAQ,MAAM;YACLL,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAS,SAAS;YACRN,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;IACD;IACAU,YAAY;QACXC,OAAO;YACNZ,aAAa;QACd;IACD;IACAa,cAAc;QACb;YACCC,MAAM;YACNC,SAAS;YACTC,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["/* v8 ignore start */\nimport { parser } from \"@node-cli/parser\";\nimport { defaultFlags } from \"./defaults.js\";\n\nexport type Flags = {\n\twidth?: number;\n\tdryRun?: boolean;\n\tstdout?: boolean;\n\tnoLineWrap?: boolean;\n\tmergeLineComments?: boolean;\n\tboring?: boolean;\n\thelp?: boolean;\n\tversion?: boolean;\n};\nexport type Parameters = {\n\tfiles?: string;\n};\nexport type Configuration = {\n\tflags?: Flags;\n\tparameters?: Parameters;\n\tshowHelp?: () => void;\n};\n\n/* v8 ignore next 120 */\nexport const config: Configuration = parser({\n\tmeta: import.meta,\n\texamples: [\n\t\t{\n\t\t\tcommand: \"comments src/**/*.ts\",\n\t\t\tcomment: \"## Reflow comments in all TS source files\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --dry-run src/index.ts\",\n\t\t\tcomment: \"## Show diff for a single file without writing\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --width 100 --merge-line-comments 'src/**/*.ts'\",\n\t\t\tcomment: \"## Use width 100 and merge groups of line comments\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"comments --no-line-wrap src/file.ts\",\n\t\t\tcomment: \"## Disable wrapping of // comments\",\n\t\t},\n\t],\n\tflags: {\n\t\twidth: {\n\t\t\tdescription: \"Max output line width (default 80)\",\n\t\t\ttype: \"number\",\n\t\t\tdefault: defaultFlags.width,\n\t\t},\n\t\tdryRun: {\n\t\t\tshortFlag: \"D\",\n\t\t\tdescription: \"Show diff, don't write files (exit 1 if changes)\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tstdout: {\n\t\t\tdescription: \"Print transformed output of a single file to STDOUT\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tnoLineWrap: {\n\t\t\tdescription: \"Disable wrapping of // single-line comments\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tmergeLineComments: {\n\t\t\tdescription: \"Merge consecutive // lines into JSDoc blocks\",\n\t\t\ttype: \"boolean\",\n\t\t\tdefault: defaultFlags.mergeLineComments,\n\t\t},\n\t\tboring: {\n\t\t\tshortFlag: \"b\",\n\t\t\tdescription: \"Do not use color output\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tfiles: {\n\t\t\tdescription: \"File paths and/or glob patterns to process\",\n\t\t},\n\t},\n\trestrictions: [\n\t\t{\n\t\t\texit: 1,\n\t\t\tmessage: \"You must provide at least one file path or glob pattern\",\n\t\t\ttest: (_flags: Flags, parameters: Record<string, string>) =>\n\t\t\t\tObject.keys(parameters || {}).length === 0,\n\t\t},\n\t\t{\n\t\t\texit: 1,\n\t\t\tmessage: \"--stdout can only be used with a single file\",\n\t\t\ttest: (flags: Flags, parameters: Record<string, string>) =>\n\t\t\t\tflags.stdout === true &&\n\t\t\t\tparameters &&\n\t\t\t\tObject.keys(parameters).length > 1,\n\t\t},\n\t],\n\tusage: \"comments [options] <files...>\",\n});\n/* v8 ignore stop */\n"],"names":["parser","defaultFlags","config","meta","examples","command","comment","flags","width","description","type","default","dryRun","shortFlag","stdout","noLineWrap","mergeLineComments","boring","help","version","parameters","files","restrictions","exit","message","test","_flags","Object","keys","length","usage"],"mappings":"AAAA,mBAAmB,GACnB,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,YAAY,QAAQ,gBAAgB;AAqB7C,sBAAsB,GACtB,OAAO,IAAMC,SAAwBF,OAAO;IAC3CG,MAAM;IACNC,UAAU;QACT;YACCC,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;KACA;IACDC,OAAO;QACNC,OAAO;YACNC,aAAa;YACbC,MAAM;YACNC,SAASV,aAAaO,KAAK;QAC5B;QACAI,QAAQ;YACPC,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAI,QAAQ;YACPL,aAAa;YACbC,MAAM;QACP;QACAK,YAAY;YACXN,aAAa;YACbC,MAAM;QACP;QACAM,mBAAmB;YAClBP,aAAa;YACbC,MAAM;YACNC,SAASV,aAAae,iBAAiB;QACxC;QACAC,QAAQ;YACPJ,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAQ,MAAM;YACLL,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;QACAS,SAAS;YACRN,WAAW;YACXJ,aAAa;YACbC,MAAM;QACP;IACD;IACAU,YAAY;QACXC,OAAO;YACNZ,aAAa;QACd;IACD;IACAa,cAAc;QACb;YACCC,MAAM;YACNC,SAAS;YACTC,MAAM,SAANA,KAAOC,QAAeN;uBACrBO,OAAOC,IAAI,CAACR,cAAc,CAAC,GAAGS,MAAM,KAAK;;QAC3C;QACA;YACCN,MAAM;YACNC,SAAS;YACTC,MAAM,SAANA,KAAOlB,OAAca;uBACpBb,MAAMO,MAAM,KAAK,QACjBM,cACAO,OAAOC,IAAI,CAACR,YAAYS,MAAM,GAAG;;QACnC;KACA;IACDC,OAAO;AACR,GAAG,CACH,kBAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-cli/comments",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"description": "CLI tool to reflow and normalize JSDoc and line comments in source files",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"watch": "swc --strip-leading-paths --watch --out-dir dist src"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@node-cli/logger": "1.3.
|
|
32
|
-
"@node-cli/parser": "2.4.
|
|
33
|
-
"@node-cli/utilities": "1.0.
|
|
31
|
+
"@node-cli/logger": "1.3.7",
|
|
32
|
+
"@node-cli/parser": "2.4.8",
|
|
33
|
+
"@node-cli/utilities": "1.0.8",
|
|
34
34
|
"micromatch": "4.0.8"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@vitest/coverage-v8": "4.
|
|
41
|
-
"vitest": "4.
|
|
40
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
41
|
+
"vitest": "4.1.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "5c00636c8f21d45d874855c522fcfdda96c2ba82"
|
|
44
44
|
}
|