File tree Expand file tree Collapse file tree 5 files changed +91
-3
lines changed
Expand file tree Collapse file tree 5 files changed +91
-3
lines changed Original file line number Diff line number Diff line change 1818 },
1919 "author" : " Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" ,
2020 "contributors" : [
21- " Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
21+ " Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" ,
22+ " Christian Murphy <christian.murphy.42@gmail.com"
2223 ],
2324 "files" : [
2425 " index.js" ,
26+ " types/index.d.ts" ,
2527 " lib/"
2628 ],
29+ "types" : " types/index.d.ts" ,
2730 "dependencies" : {
2831 "camelcase" : " ^5.0.0" ,
2932 "chalk" : " ^3.0.0" ,
3639 },
3740 "devDependencies" : {
3841 "bail" : " ^1.0.0" ,
42+ "dtslint" : " ^3.0.0" ,
3943 "execa" : " ^4.0.0" ,
4044 "figures" : " ^3.0.0" ,
4145 "nyc" : " ^15.0.0" ,
4246 "prettier" : " ^2.0.0" ,
47+ "remark" : " ^11.0.0" ,
4348 "remark-cli" : " ^7.0.0" ,
4449 "remark-preset-wooorm" : " ^6.0.0" ,
4550 "strip-ansi" : " ^6.0.0" ,
5055 "xo" : " ^0.28.0"
5156 },
5257 "scripts" : {
53- "format" : " remark . -qfo && prettier --write \" **/*.js \" && xo --fix" ,
58+ "format" : " remark . -qfo && prettier --write \" **/*.{js,ts} \" && xo --fix --ignore types " ,
5459 "test-api" : " node test" ,
5560 "test-coverage" : " nyc --reporter lcov tape test/index.js" ,
56- "test" : " npm run format && npm run test-coverage"
61+ "test-types" : " dtslint types" ,
62+ "test" : " npm run format && npm run test-coverage && npm run test-types"
5763 },
5864 "prettier" : {
5965 "tabWidth" : 2 ,
Original file line number Diff line number Diff line change 1+ // TypeScript Version: 3.0
2+
3+ import { Options as EngineOptions } from 'unified-engine'
4+
5+ type RequiredEngineOptions = Required <
6+ Pick <
7+ EngineOptions ,
8+ | 'extensions'
9+ | 'ignoreName'
10+ | 'packageField'
11+ | 'pluginPrefix'
12+ | 'processor'
13+ | 'rcName'
14+ >
15+ >
16+
17+ declare namespace unifiedArgs {
18+ interface Options extends RequiredEngineOptions {
19+ /**
20+ * Name of executable
21+ */
22+ name : string
23+
24+ /**
25+ * Description of executable
26+ */
27+ description : string
28+
29+ /**
30+ * Version of executable
31+ */
32+ version : string
33+ }
34+ }
35+
36+ /**
37+ * Create a CLI for a unified processor
38+ */
39+ declare function unifiedArgs ( options : unifiedArgs . Options ) : void
40+
41+ export = unifiedArgs
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "lib" : [" es2015" ],
4+ "strict" : true ,
5+ "baseUrl" : " ." ,
6+ "paths" : {
7+ "unified-args" : [" index.d.ts" ]
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " dtslint/dtslint.json" ,
3+ "rules" : {
4+ "semicolon" : false ,
5+ "whitespace" : false
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ import * as start from 'unified-args'
2+ import * as remark from 'remark'
3+
4+ start ( {
5+ processor : remark ( ) ,
6+ name : 'remark' ,
7+ description : 'description' ,
8+ version : '1.0.0' ,
9+ pluginPrefix : 'remark' ,
10+ extensions : [ 'md' ] ,
11+ packageField : 'remarkConfig' ,
12+ rcName : '.remarkrc' ,
13+ ignoreName : '.remarkignore'
14+ } )
15+
16+ // $ExpectError
17+ start ( { } )
18+
19+ // $ExpectError
20+ start ( {
21+ name : 'remark' ,
22+ description : 'description' ,
23+ version : '1.0.0'
24+ } )
You can’t perform that action at this time.
0 commit comments