Skip to content

Commit ebaec15

Browse files
committed
Setting up a new project skeleton for @microsoft/ts-command-line
1 parent 6be4a09 commit ebaec15

File tree

10 files changed

+175
-0
lines changed

10 files changed

+175
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.vscode
2+
coverage
3+
node_modules
4+
typings
5+
gulpfile.js
6+
tsconfig.json
7+
lib/test
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Launch",
6+
"type": "node",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
9+
"stopOnEntry": false,
10+
"args": [
11+
],
12+
"cwd": "${workspaceRoot}",
13+
"runtimeExecutable": null,
14+
"runtimeArgs": [
15+
"--nolazy"
16+
],
17+
"env": {
18+
"NODE_ENV": "development"
19+
},
20+
"externalConsole": false,
21+
"sourceMaps": false,
22+
"outDir": null
23+
}
24+
]
25+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## ts-command-line
2+
3+
An object-oriented command-line parser for TypeScript.
4+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
const build = require('@microsoft/sp-build-node');
4+
5+
build.initialize(require('gulp'));
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@microsoft/ts-command-line",
3+
"version": "1.0.0",
4+
"description": "An object-oriented command-line parser for TypeScript",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://onedrive.visualstudio.com/DefaultCollection/SPPPlat/_git/sp-next"
8+
},
9+
"main": "lib/index.js",
10+
"typings": "lib/index.d.ts",
11+
"scripts": {
12+
"build": "gulp",
13+
"test": "gulp",
14+
"clean": "gulp nuke"
15+
},
16+
"license": "UNLICENSED",
17+
"dependencies": {
18+
"argparse": "~1.0.7",
19+
"colors": "~1.1.2"
20+
},
21+
"devDependencies": {
22+
"chai": "~3.5.0",
23+
"gulp": "~3.9.1",
24+
"mocha": "~2.5.3",
25+
"@microsoft/sp-build-node": "~0.1.0"
26+
}
27+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var context = require.context('.', true, /.+\.test\.js?$/);
2+
3+
context.keys().forEach(context);
4+
5+
module.exports = context;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs",
5+
"jsx": "react",
6+
"declaration": true,
7+
"sourceMap": true
8+
},
9+
"files": ["typings/tsd.d.ts"]
10+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Type definitions for argparse v1.0.3
2+
// Project: https://github.com/nodeca/argparse
3+
// Definitions by: Andrew Schurman <http://github.com/arcticwaters>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
declare module "argparse" {
7+
export class ArgumentParser extends ArgumentGroup {
8+
constructor(options? : ArgumentParserOptions);
9+
10+
addSubparsers(options? : SubparserOptions) : SubParser;
11+
parseArgs(args? : string[], ns? : Namespace|Object) : any;
12+
printUsage() : void;
13+
printHelp() : void;
14+
formatUsage() : string;
15+
formatHelp() : string;
16+
parseKnownArgs(args? : string[], ns? : Namespace|Object) : any[];
17+
convertArgLineToArg(argLine : string) : string[];
18+
exit(status : number, message : string) : void;
19+
error(err : string|Error) : void;
20+
}
21+
22+
interface Namespace {}
23+
24+
class SubParser {
25+
addParser(name : string, options? : SubArgumentParserOptions) : ArgumentParser;
26+
}
27+
28+
class ArgumentGroup {
29+
addArgument(args : string[], options? : ArgumentOptions) : void;
30+
addArgumentGroup(options? : ArgumentGroupOptions) : ArgumentGroup;
31+
addMutuallyExclusiveGroup(options? : {required : boolean}) : ArgumentGroup;
32+
setDefaults(options? : {}) : void;
33+
getDefault(dest : string) : any;
34+
}
35+
36+
interface SubparserOptions {
37+
title? : string;
38+
description? : string;
39+
prog? : string;
40+
parserClass? : {new() : any};
41+
action? : string;
42+
dest? : string;
43+
help? : string;
44+
metavar? : string;
45+
}
46+
47+
interface SubArgumentParserOptions extends ArgumentParserOptions {
48+
aliases? : string[];
49+
help? : string;
50+
}
51+
52+
interface ArgumentParserOptions {
53+
description? : string;
54+
epilog? : string;
55+
addHelp? : boolean;
56+
argumentDefault? : any;
57+
parents? : ArgumentParser[];
58+
prefixChars? : string;
59+
formatterClass? : {new() : HelpFormatter|ArgumentDefaultsHelpFormatter|RawDescriptionHelpFormatter|RawTextHelpFormatter};
60+
prog? : string;
61+
usage? : string;
62+
version? : string;
63+
}
64+
65+
interface ArgumentGroupOptions {
66+
prefixChars? : string;
67+
argumentDefault? : any;
68+
title? : string;
69+
description? : string;
70+
}
71+
72+
export class HelpFormatter {}
73+
export class ArgumentDefaultsHelpFormatter {}
74+
export class RawDescriptionHelpFormatter {}
75+
export class RawTextHelpFormatter {}
76+
77+
interface ArgumentOptions {
78+
action? : string;
79+
optionStrings? : string[];
80+
dest? : string;
81+
nargs? : string|number;
82+
constant? : any;
83+
defaultValue? : any;
84+
type? : string|Function;
85+
choices? : string|string[];
86+
required? : boolean;
87+
help? : string;
88+
metavar? : string;
89+
}
90+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="argparse/argparse.d.ts" />

0 commit comments

Comments
 (0)