зеркало из https://github.com/microsoft/jacdac-ts.git
moving files
This commit is contained in:
Родитель
10276eee5f
Коммит
c8b9476748
51
gulpfile.js
51
gulpfile.js
|
@ -1,48 +1,51 @@
|
|||
const fs = require("fs");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
|
||||
const gulp = require('gulp');
|
||||
const watchify = require('watchify');
|
||||
const fancy_log = require('fancy-log');
|
||||
const ts = require('gulp-typescript');
|
||||
const tsReporter = ts.reporter.longReporter();
|
||||
const merge = require("merge-stream");
|
||||
const browserify = require('browserify');
|
||||
const source = require('vinyl-source-stream');
|
||||
const tsify = require('tsify');
|
||||
const _rimraf = require("rimraf")
|
||||
const tsProject = ts.createProject("tsconfig.json");
|
||||
|
||||
const DIST = 'dist'
|
||||
const tsProject = ts.createProject('tsconfig.json');
|
||||
|
||||
const rimraf = (dirname) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
_rimraf(dirname, (err) => {
|
||||
if (err) reject(err);
|
||||
else resolve();
|
||||
});
|
||||
_rimraf(dirname, (err) => {
|
||||
if (err) reject(err);
|
||||
else resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const clean = () => rimraf(DIST)
|
||||
|
||||
const tscNode = () => {
|
||||
return tsProject.src()
|
||||
.pipe(tsProject())
|
||||
.js.pipe(gulp.dest(DIST));
|
||||
}
|
||||
const tsResult = tsProject.src()
|
||||
.pipe(tsProject());
|
||||
|
||||
const watchedBrowserify = watchify(browserify({
|
||||
basedir: '.',
|
||||
debug: true,
|
||||
entries: tsProject.src(),
|
||||
return merge(
|
||||
tsResult.js.pipe(gulp.dest(DIST)),
|
||||
tsResult.dts.pipe(gulp.dest(DIST))
|
||||
);
|
||||
}
|
||||
const tscWeb = () => browserify({
|
||||
basedir: 'dist',
|
||||
debug: false,
|
||||
entries: gulp.src("dist/**.js"),
|
||||
cache: {},
|
||||
packageCache: {}
|
||||
}).plugin(tsify));
|
||||
const tscWeb = () => watchedBrowserify
|
||||
.bundle()
|
||||
.on('error', fancy_log)
|
||||
.pipe(source('bundle.js'))
|
||||
.pipe(gulp.dest(DIST));
|
||||
watchedBrowserify.on('update', tscWeb);
|
||||
watchedBrowserify.on('log', fancy_log);
|
||||
|
||||
const buildAll = gulp.parallel(tscNode);
|
||||
}).bundle()
|
||||
.on('error', fancy_log)
|
||||
.pipe(source('bundle.js'))
|
||||
.pipe(gulp.dest(DIST));
|
||||
const buildAll = gulp.series(tscNode, tscWeb);
|
||||
|
||||
exports.clean = clean;
|
||||
exports.tscNode = tscNode;
|
||||
|
|
|
@ -10,6 +10,7 @@ const controlTransferInReport = 0x100;
|
|||
export const HF2_CMD_BININFO = 0x0001 // no arguments
|
||||
export const HF2_MODE_BOOTLOADER = 0x01
|
||||
export const HF2_MODE_USERSPACE = 0x02
|
||||
|
||||
/*
|
||||
struct HF2_BININFO_Result {
|
||||
uint32_t mode;
|
|
@ -2527,6 +2527,12 @@
|
|||
"safe-buffer": "^5.1.2"
|
||||
}
|
||||
},
|
||||
"merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
|
||||
"dev": true
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
"fancy-log": "^1.3.3",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-typescript": "^5.0.1",
|
||||
"merge-stream": "^2.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"tsify": "^4.0.2",
|
||||
"typescript": "^3.8.3",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
"lib/**.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
|
@ -15,6 +15,6 @@
|
|||
"newLine": "LF",
|
||||
"outDir": "dist",
|
||||
"rootDir": ".",
|
||||
"incremental": true
|
||||
"incremental": false
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче