Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] TypeScript Vorpal #328

Open
wants to merge 3 commits into
base: 2.0-ts
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 25 additions & 16 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
const gulp = require('gulp');
const _gulp = require('load-plugins')('gulp-*');
const gulp = require('gulp')
const _gulp = require('load-plugins')('gulp-*')
var ts = require('gulp-typescript')
var tsProject = ts.createProject('tsconfig.json');

const paths = {};
paths.src = './lib/**/*.js';
paths.dist = './dist';
const paths = {}
paths.src = './lib/**/*.js'
paths.dist = './dist'

gulp.task('lint', () => {
return gulp.src(paths.src)
.pipe(_gulp.xo());
});
return gulp.src(paths.src)
.pipe(_gulp.xo())
})

gulp.task('build', () => {
return gulp.src(paths.src)
.pipe(_gulp.babel())
.pipe(gulp.dest(paths.dist));
});
gulp.task('build', ['build:ts', 'build:babel'])

gulp.task('build:ts', () => {
return tsProject.src().pipe(tsProject()).js
.pipe(gulp.dest(paths.dist))
})

gulp.task('build:babel', () => {
return gulp.src(paths.dist)
.pipe(_gulp.babel())
.pipe(gulp.dest(paths.dist))
})

gulp.task('watch', ['build'], () => {
gulp.watch(paths.src, ['build']);
});
gulp.watch(paths.src, ['build'])
})

gulp.task('default', ['watch']);
gulp.task('default', ['watch'])
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions lib/command.js → lib/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ var command = Command.prototype;

module.exports = exports = Command;

export interface Arg {
required: boolean
name: string
variadic: boolean
}

/**
* Initialize a new `Command` instance.
*
Expand All @@ -36,7 +42,7 @@ function Command(name, parent) {
}
this.commands = [];
this.options = [];
this._args = [];
this._args = [] as Arg[];
this._aliases = [];
this._name = name;
this._relay = false;
Expand Down Expand Up @@ -528,7 +534,7 @@ command._parseExpectedArgs = function (args) {
if (!args.length) {
return;
}
var self = this;
var self = this;
args.forEach(function (arg) {
var argDetails = {
required: false,
Expand Down
190 changes: 0 additions & 190 deletions lib/history.js

This file was deleted.