cleanup, remove gulp
This commit is contained in:
parent
a616aabd92
commit
681efad286
7 changed files with 394 additions and 2466 deletions
12
.eslintrc
12
.eslintrc
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-cond-assign": 0,
|
||||
"no-unused-vars": 1
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
|
@ -3,14 +3,12 @@ typings/
|
|||
test
|
||||
out/test/
|
||||
.gitignore
|
||||
gulpfile.js
|
||||
jsconfig.json
|
||||
tsconfig.json
|
||||
tsd.json
|
||||
*.js.map
|
||||
yarn.lock
|
||||
typings.json
|
||||
tslint.json
|
||||
.eslintrc
|
||||
.travis.yml
|
||||
.vscode/
|
||||
out/**/*.d.ts
|
||||
!out/api.d.ts
|
63
gulpfile.js
63
gulpfile.js
|
@ -1,63 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const gulp = require('gulp');
|
||||
const gts = require('gulp-typescript');
|
||||
const sm = require('gulp-sourcemaps');
|
||||
const filter = require('gulp-filter');
|
||||
const tslint = require('gulp-tslint');
|
||||
const rimraf = require('rimraf');
|
||||
const es = require('event-stream');
|
||||
const cp = require('child_process');
|
||||
|
||||
const project = gts.createProject('tsconfig.json');
|
||||
|
||||
function compile() {
|
||||
const tsd = filter(['**', '!**/*.d.ts'], { restore: true });
|
||||
|
||||
const ts = project.src()
|
||||
.pipe(tsd)
|
||||
.pipe(tslint())
|
||||
.pipe(tslint.report({ summarizeFailureOutput: true, emitError: false }))
|
||||
.pipe(tsd.restore)
|
||||
.pipe(sm.init())
|
||||
.pipe(project());
|
||||
|
||||
const js = ts.js
|
||||
.pipe(sm.write('.', {
|
||||
includeContent: false, sourceRoot: file => {
|
||||
const dirname = path.dirname(file.relative);
|
||||
return dirname === '.' ? '../src' : ('../src/' + dirname);
|
||||
}
|
||||
}));
|
||||
|
||||
const api = ts.dts
|
||||
.pipe(filter('**/api.d.ts'));
|
||||
|
||||
const resources = gulp.src('src/**', { dot: true })
|
||||
.pipe(filter(['**', '!**/*.ts'], { dot: true }));
|
||||
|
||||
return es.merge(js, api, resources)
|
||||
.pipe(gulp.dest('out'));
|
||||
}
|
||||
|
||||
gulp.task('clean', cb => rimraf('out', cb));
|
||||
gulp.task('compile', ['clean'], compile);
|
||||
gulp.task('just-compile', compile);
|
||||
|
||||
function test(cb) {
|
||||
const child = cp.spawn('mocha', ['--reporter=dot'], { stdio: 'inherit' });
|
||||
child.on('exit', () => cb());
|
||||
}
|
||||
|
||||
gulp.task('test', ['compile'], test);
|
||||
gulp.task('just-test', ['just-compile'], test);
|
||||
|
||||
function watch(task) {
|
||||
return cb => gulp.watch(['src/**', 'typings/**'], [task]);
|
||||
}
|
||||
|
||||
gulp.task('watch', ['compile'], watch('just-compile'));
|
||||
gulp.task('watch-test', ['compile'], watch('just-test'));
|
||||
|
||||
gulp.task('default', ['watch']);
|
21
package.json
21
package.json
|
@ -24,10 +24,11 @@
|
|||
"vsce": "out/vsce"
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "gulp watch",
|
||||
"watch-test": "gulp watch-test",
|
||||
"test": "gulp compile && mocha",
|
||||
"prepublishOnly": "gulp compile && mocha"
|
||||
"compile": "tsc",
|
||||
"watch": "tsc --watch",
|
||||
"watch-test": "concurrently \"tsc --watch\" \"mocha --watch\"",
|
||||
"test": "mocha",
|
||||
"prepublishOnly": "tsc && mocha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
|
@ -56,19 +57,11 @@
|
|||
"@types/cheerio": "^0.22.1",
|
||||
"@types/markdown-it": "0.0.2",
|
||||
"@types/node": "^8",
|
||||
"eslint": "^3.17.1",
|
||||
"event-stream": "3.3.4",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-filter": "^4.0.0",
|
||||
"gulp-sourcemaps": "^2.4.1",
|
||||
"concurrently": "^4.1.0",
|
||||
"gulp-tsb": "^1.6.0",
|
||||
"gulp-tslint": "^6.1.1",
|
||||
"gulp-typescript": "^3.1.5",
|
||||
"mocha": "^5.2.0",
|
||||
"rimraf": "^2.4.3",
|
||||
"source-map-support": "^0.4.2",
|
||||
"tslint": "^3.15.1",
|
||||
"typescript": "^2.2.1",
|
||||
"xml2js": "^0.4.12"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,10 +2,11 @@
|
|||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"declaration": true
|
||||
"declaration": true,
|
||||
"outDir": "out"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"out"
|
||||
"include": [
|
||||
"src",
|
||||
"typings"
|
||||
]
|
||||
}
|
16
tslint.json
16
tslint.json
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-unused-expression": true,
|
||||
"no-unreachable": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-unused-variable": true,
|
||||
"curly": true,
|
||||
"class-name": true,
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
],
|
||||
"triple-equals": true
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue