Update package-builder to TS 2.0 and @types

This commit is contained in:
SteveSandersonMS
2016-10-11 17:15:13 +01:00
parent 0289f73a96
commit ae0ffd4d11
14 changed files with 11 additions and 22215 deletions

View File

@@ -18,6 +18,13 @@
"rimraf": "^2.5.2"
},
"devDependencies": {
"typescript": "^1.8.10"
"@types/glob": "^5.0.30",
"@types/lodash": "^4.14.37",
"@types/mkdirp": "^0.3.29",
"@types/node": "^6.0.45",
"@types/node-uuid": "0.0.28",
"@types/rimraf": "0.0.28",
"@types/yeoman-generator": "0.0.30",
"typescript": "^2.0.0"
}
}

View File

@@ -3,10 +3,11 @@
"moduleResolution": "node",
"target": "es5",
"outDir": "tmp",
"sourceMap": false
"sourceMap": false,
"lib": ["es6"]
},
"exclude": [
"node_modules",
"**/node_modules",
"dist"
]
}

View File

@@ -1,39 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"yeoman-generator/yeoman-generator.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"node/node.d.ts": {
"commit": "08ed4e9f1869e37e29514d862e0158b40e550232"
},
"glob/glob.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"minimatch/minimatch.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"lodash/lodash.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"mkdirp/mkdirp.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"rimraf/rimraf.d.ts": {
"commit": "544a35a10866b32afda9c7f029c0764558563f4f"
},
"node-uuid/node-uuid.d.ts": {
"commit": "08ed4e9f1869e37e29514d862e0158b40e550232"
},
"node-uuid/node-uuid-base.d.ts": {
"commit": "08ed4e9f1869e37e29514d862e0158b40e550232"
},
"node-uuid/node-uuid-cjs.d.ts": {
"commit": "08ed4e9f1869e37e29514d862e0158b40e550232"
}
}
}

View File

@@ -1,112 +0,0 @@
// Type definitions for Glob 5.0.10
// Project: https://github.com/isaacs/node-glob
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../minimatch/minimatch.d.ts" />
declare module "glob" {
import events = require("events");
import fs = require('fs');
import minimatch = require("minimatch");
function G(pattern: string, cb: (err: Error, matches: string[]) => void): void;
function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void;
namespace G {
function sync(pattern: string, options?: IOptions): string[];
function hasMagic(pattern: string, options?: IOptions): boolean;
var Glob: IGlobStatic;
var GlobSync: IGlobSyncStatic;
interface IOptions extends minimatch.IOptions {
cwd?: string;
root?: string;
dot?: boolean;
nomount?: boolean;
mark?: boolean;
nosort?: boolean;
stat?: boolean;
silent?: boolean;
strict?: boolean;
cache?: { [path: string]: any /* boolean | string | string[] */ };
statCache?: { [path: string]: fs.Stats };
symlinks?: any;
sync?: boolean;
nounique?: boolean;
nonull?: boolean;
debug?: boolean;
nobrace?: boolean;
noglobstar?: boolean;
noext?: boolean;
nocase?: boolean;
matchBase?: any;
nodir?: boolean;
ignore?: any; /* string | string[] */
follow?: boolean;
realpath?: boolean;
nonegate?: boolean;
nocomment?: boolean;
/** Deprecated. */
globDebug?: boolean;
}
interface IGlobStatic extends events.EventEmitter {
new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob;
new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob;
prototype: IGlob;
}
interface IGlobSyncStatic {
new (pattern: string, options?: IOptions): IGlobBase
prototype: IGlobBase;
}
interface IGlobBase {
minimatch: minimatch.IMinimatch;
options: IOptions;
aborted: boolean;
cache: { [path: string]: any /* boolean | string | string[] */ };
statCache: { [path: string]: fs.Stats };
symlinks: { [path: string]: boolean };
realpathCache: { [path: string]: string };
found: string[];
}
interface IGlob extends IGlobBase, events.EventEmitter {
pause(): void;
resume(): void;
abort(): void;
/** Deprecated. */
EOF: any;
/** Deprecated. */
paused: boolean;
/** Deprecated. */
maxDepth: number;
/** Deprecated. */
maxLength: number;
/** Deprecated. */
changedCwd: boolean;
/** Deprecated. */
cwd: string;
/** Deprecated. */
root: string;
/** Deprecated. */
error: any;
/** Deprecated. */
matches: string[];
/** Deprecated. */
log(...args: any[]): void;
/** Deprecated. */
emitMatch(m: any): void;
}
}
export = G;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,64 +0,0 @@
// Type definitions for Minimatch 2.0.8
// Project: https://github.com/isaacs/minimatch
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "minimatch" {
function M(target: string, pattern: string, options?: M.IOptions): boolean;
namespace M {
function match(list: string[], pattern: string, options?: IOptions): string[];
function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean;
function makeRe(pattern: string, options?: IOptions): RegExp;
var Minimatch: IMinimatchStatic;
interface IOptions {
debug?: boolean;
nobrace?: boolean;
noglobstar?: boolean;
dot?: boolean;
noext?: boolean;
nocase?: boolean;
nonull?: boolean;
matchBase?: boolean;
nocomment?: boolean;
nonegate?: boolean;
flipNegate?: boolean;
}
interface IMinimatchStatic {
new (pattern: string, options?: IOptions): IMinimatch;
prototype: IMinimatch;
}
interface IMinimatch {
pattern: string;
options: IOptions;
/** 2-dimensional array of regexp or string expressions. */
set: any[][]; // (RegExp | string)[][]
regexp: RegExp;
negate: boolean;
comment: boolean;
empty: boolean;
makeRe(): RegExp; // regexp or boolean
match(fname: string): boolean;
matchOne(files: string[], pattern: string[], partial: boolean): boolean;
/** Deprecated. For internal use. */
debug(): void;
/** Deprecated. For internal use. */
make(): void;
/** Deprecated. For internal use. */
parseNegate(): void;
/** Deprecated. For internal use. */
braceExpand(pattern: string, options: IOptions): void;
/** Deprecated. For internal use. */
parse(pattern: string, isSub?: boolean): void;
}
}
export = M;
}

View File

@@ -1,15 +0,0 @@
// Type definitions for mkdirp 0.3.0
// Project: http://github.com/substack/node-mkdirp
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'mkdirp' {
function mkdirp(dir: string, cb: (err: any, made: string) => void): void;
function mkdirp(dir: string, flags: any, cb: (err: any, made: string) => void): void;
namespace mkdirp {
function sync(dir: string, flags?: any): string;
}
export = mkdirp;
}

View File

@@ -1,46 +0,0 @@
// Type definitions for node-uuid.js
// Project: https://github.com/broofa/node-uuid
// Definitions by: Jeff May <https://github.com/jeffmay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/** Common definitions for all environments */
declare namespace __NodeUUID {
interface UUIDOptions {
/**
* Node id as Array of 6 bytes (per 4.1.6).
* Default: Randomly generated ID. See note 1.
*/
node?: any[];
/**
* (Number between 0 - 0x3fff) RFC clock sequence.
* Default: An internally maintained clockseq is used.
*/
clockseq?: number;
/**
* (Number | Date) Time in milliseconds since unix Epoch.
* Default: The current time is used.
*/
msecs?: number|Date;
/**
* (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if msecs is unspecified.
* Default: internal uuid counter is used, as per 4.2.1.2.
*/
nsecs?: number;
}
interface UUID {
v1(options?: UUIDOptions): string;
v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v4(options?: UUIDOptions): string;
v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
parse(id: string, buffer?: number[], offset?: number): number[];
unparse(buffer: number[], offset?: number): string;
}
}

View File

@@ -1,15 +0,0 @@
// Type definitions for node-uuid.js
// Project: https://github.com/broofa/node-uuid
// Definitions by: Jeff May <https://github.com/jeffmay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="./node-uuid-base.d.ts" />
/**
* Expose as CommonJS module
* For use in node environment or browser environment (using webpack or other module loaders)
*/
declare module "node-uuid" {
var uuid: __NodeUUID.UUID;
export = uuid;
}

View File

@@ -1,36 +0,0 @@
// Type definitions for node-uuid.js
// Project: https://github.com/broofa/node-uuid
// Definitions by: Jeff May <https://github.com/jeffmay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="./node-uuid-base.d.ts" />
/// <reference path="./node-uuid-cjs.d.ts" />
/**
* Definitions for use in node environment
*
* !! For browser enviroments, use node-uuid-global or node-uuid-cjs
*/
declare module __NodeUUID {
/**
* Overloads for node environment
* We need to duplicate some declarations because
* interface merging doesn't work with overloads
*/
interface UUID {
v1(options?: UUIDOptions): string;
v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
v4(options?: UUIDOptions): string;
v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[];
v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer;
parse(id: string, buffer?: number[], offset?: number): number[];
parse(id: string, buffer?: Buffer, offset?: number): Buffer;
unparse(buffer: number[], offset?: number): string;
unparse(buffer: Buffer, offset?: number): string;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
// Type definitions for rimraf
// Project: https://github.com/isaacs/rimraf
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts
declare module "rimraf" {
function rimraf(path: string, callback: (error: Error) => void): void;
namespace rimraf {
export function sync(path: string): void;
export var EMFILE_MAX: number;
export var BUSYTRIES_MAX: number;
}
export = rimraf;
}

View File

@@ -1,10 +0,0 @@
/// <reference path="node/node.d.ts" />
/// <reference path="yeoman-generator/yeoman-generator.d.ts" />
/// <reference path="glob/glob.d.ts" />
/// <reference path="minimatch/minimatch.d.ts" />
/// <reference path="lodash/lodash.d.ts" />
/// <reference path="mkdirp/mkdirp.d.ts" />
/// <reference path="rimraf/rimraf.d.ts" />
/// <reference path="node-uuid/node-uuid-base.d.ts" />
/// <reference path="node-uuid/node-uuid-cjs.d.ts" />
/// <reference path="node-uuid/node-uuid.d.ts" />

View File

@@ -1,250 +0,0 @@
// Type definitions for yeoman-generator
// Project: https://github.com/yeoman/generator
// Definitions by: Kentaro Okuno <http://github.com/armorik83>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare namespace yo {
export interface IYeomanGenerator {
argument(name: string, config: IArgumentConfig): void;
composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator;
defaultFor(name: string): void;
destinationRoot(rootPath?: string): string;
destinationPath(...path: string[]): string;
determineAppname(): void;
getCollisionFilter(): (output: any) => void;
hookFor(name: string, config: IHookConfig): void;
option(name: string, config: IYeomanGeneratorOption): void;
rootGeneratorName(): string;
run(args?: any): void;
run(args: any, callback?: Function): void;
runHooks(callback?: Function): void;
sourceRoot(rootPath?: string): string;
templatePath(...path: string[]): string;
prompt(opt: IPromptOptions | IPromptOptions[], callback: (answers: any) => void): void;
npmInstall(packages?: string[] | string, options?: any, cb?: Function): void;
installDependencies(options?: IInstallDependencyOptions): void;
spawnCommand(name: string, args?: string[], options?: Object): void;
spawnCommandSync(name: string, args?: string[], options?: Object): void;
options: { [key: string]: any };
fs: IMemFsEditor;
}
export class YeomanGeneratorBase implements IYeomanGenerator, NodeJS.EventEmitter {
argument(name: string, config: IArgumentConfig): void;
composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator;
defaultFor(name: string): void;
destinationRoot(rootPath?: string): string;
destinationPath(...path: string[]): string;
determineAppname(): void;
getCollisionFilter(): (output: any) => void;
hookFor(name: string, config: IHookConfig): void;
option(name: string, config?: IYeomanGeneratorOption): void;
rootGeneratorName(): string;
run(args?: any): void;
run(args: any, callback?: Function): void;
runHooks(callback?: Function): void;
sourceRoot(rootPath?: string): string;
templatePath(...path: string[]): string;
addListener(event: string, listener: Function): this;
on(event: string, listener: Function): this;
once(event: string, listener: Function): this;
removeListener(event: string, listener: Function): this;
removeAllListeners(event?: string): this;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
listenerCount(type: string): number;
async(): any;
prompt(opt: IPromptOptions | IPromptOptions[], callback: (answers: any) => void): void;
log(message: string) : void;
npmInstall(packages: string[], options?: any, cb?: Function) :void;
installDependencies(options?: IInstallDependencyOptions): void;
spawnCommand(name: string, args?: string[], options?: Object): void;
spawnCommandSync(name: string, args?: string[], options?: Object): void;
appname: string;
gruntfile: IGruntFileStatic;
options: { [key: string]: any };
fs: IMemFsEditor;
}
export interface IMemFsEditor {
read(filepath: string, options?: Object): string;
readJSON(filepath: string, defaults?: Object): Object;
write(filepath: string, contents: string): void;
writeJSON(filepath: string, contents: Object, replacer?: Function, space?: number): void;
delete(filepath: string, options?: Object): void;
copy(from: string, to: string, options?: Object): void;
copyTpl(from: string, to: string, context: Object, options?: Object): void;
move(from: string, to: string, options?: Object): void;
exists(filepath: string): boolean;
commit(callback: Function): void;
commit(filters: any[], callback: Function): void;
}
export interface IInstallDependencyOptions {
npm?: boolean;
bower?: boolean;
skipMessage?: boolean;
callback?: Function;
}
export interface IChoice {
name: string;
value: string;
short?: string;
}
export interface IPromptOptions{
type?: string;
name: string;
message: string | ((answers: Object) => string);
choices?: any[] | ((answers: Object) => any);
default?: string | number | string[] | number[] | ((answers: Object) => (string | number | string[] | number[]));
validate?: ((input: any) => boolean | string);
filter?: ((input: any) => any);
when?: ((answers: Object) => boolean) | boolean;
store?: boolean;
}
export interface IGruntFileStatic {
loadNpmTasks(pluginName: string): void;
insertConfig(name:string, config:any):void;
registerTask(name:string, tasks:any):void;
insertVariable(name:string, value:any):void;
prependJavaScript(code:string):void;
}
export interface IArgumentConfig {
desc: string;
required?: boolean;
optional?: boolean;
type: any;
defaults?: any;
}
export interface IComposeSetting {
local?: string;
link?: string;
}
export interface IHookConfig {
as: string;
args: any;
options: any;
}
export interface IYeomanGeneratorOption {
alias?: string;
defaults?: any;
desc?: string;
hide?: boolean;
type?: any;
}
export interface IQueueProps {
initializing: () => void;
prompting?: () => void;
configuring?: () => void;
default?: () => void;
writing: {
[target: string]: () => void;
};
conflicts?: () => void;
install?: () => void;
end: () => void;
}
export interface INamedBase extends IYeomanGenerator {
}
export interface IBase extends INamedBase {
}
export interface IAssert {
file(path: string): void;
file(paths: string[]): void;
fileContent(file: string, reg: RegExp): void;
/** @param {[String, RegExp][]} pairs */
fileContent(pairs: any[][]): void;
/** @param {[String, RegExp][]|String[]} pairs */
files(pairs: any[]): void;
/**
* @param {Object} subject
* @param {Object|Array} methods
*/
implement(subject: any, methods: any): void;
noFile(file: string): void;
noFileContent(file: string, reg: RegExp): void;
/** @param {[String, RegExp][]} pairs */
noFileContent(pairs: any[][]): void;
/**
* @param {Object} subject
* @param {Object|Array} methods
*/
noImplement(subject: any, methods: any): void;
textEqual(value: string, expected: string): void;
}
export interface ITestHelper {
createDummyGenerator(): IYeomanGenerator;
createGenerator(name: string, dependencies: any[], args: any, options: any): IYeomanGenerator;
decorate(context: any, method: string, replacement: Function, options: any): void;
gruntfile(options: any, done: Function): void;
mockPrompt(generator: IYeomanGenerator, answers: any): void;
registerDependencies(dependencies: string[]): void;
restore(): void;
/** @param {String|Function} generator */
run(generator: any): IRunContext;
}
export interface IRunContext {
async(): Function;
inDir(dirPath: string): IRunContext;
/** @param {String|String[]} args */
withArguments(args: any): IRunContext;
withGenerators(dependencies: string[]): IRunContext;
withOptions(options: any): IRunContext;
withPrompts(answers: any): IRunContext;
}
/** @type file file-utils */
var file: any;
var assert: IAssert;
var test: ITestHelper;
// "generators" is deprecated
namespace generators {
export class NamedBase extends YeomanGeneratorBase implements INamedBase {
constructor(args: string | string[], options: any);
}
export class Base extends NamedBase implements IBase {
static extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator;
}
}
export class NamedBase extends YeomanGeneratorBase implements INamedBase {
constructor(args: string | string[], options: any);
}
export class Base extends NamedBase implements IBase {
static extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator;
}
}
declare module "yeoman-generator" {
export = yo;
}