Add test files for dev tsconfig.
This commit is contained in:
parent
fffc1153ca
commit
8f333b57ac
@ -11,13 +11,18 @@ const through = require('through2');
|
|||||||
const File = require('vinyl');
|
const File = require('vinyl');
|
||||||
|
|
||||||
const paths = {
|
const paths = {
|
||||||
ts: [
|
ts: {
|
||||||
"lib/**.{ts,tsx}",
|
release: [
|
||||||
"background/*.{ts,tsx}",
|
"lib/**.{ts,tsx}",
|
||||||
"content_scripts/*.{ts,tsx}",
|
"background/*.{ts,tsx}",
|
||||||
"popup/*.{ts,tsx}",
|
"content_scripts/*.{ts,tsx}",
|
||||||
"pages/*.{ts,tsx}",
|
"popup/*.{ts,tsx}",
|
||||||
],
|
"pages/*.{ts,tsx}",
|
||||||
|
],
|
||||||
|
dev: [
|
||||||
|
"test/tests/*.{ts,tsx}"
|
||||||
|
],
|
||||||
|
},
|
||||||
dist: [
|
dist: [
|
||||||
"manifest.json",
|
"manifest.json",
|
||||||
"img/*",
|
"img/*",
|
||||||
@ -44,8 +49,6 @@ let manifest;
|
|||||||
manifest = JSON.parse(f);
|
manifest = JSON.parse(f);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
console.log("version:", manifest.version);
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task("clean", function() {
|
gulp.task("clean", function() {
|
||||||
del("_build/ext");
|
del("_build/ext");
|
||||||
@ -53,17 +56,14 @@ gulp.task("clean", function() {
|
|||||||
|
|
||||||
// Package the extension
|
// Package the extension
|
||||||
gulp.task("build-prod", ["clean"], function() {
|
gulp.task("build-prod", ["clean"], function() {
|
||||||
console.log("hello");
|
|
||||||
const tsArgs = {};
|
const tsArgs = {};
|
||||||
Object.assign(tsArgs, tsBaseArgs);
|
Object.assign(tsArgs, tsBaseArgs);
|
||||||
console.log("args", JSON.stringify(tsArgs));
|
|
||||||
tsArgs.typescript = require("typescript");
|
tsArgs.typescript = require("typescript");
|
||||||
// relative to the gulp.dest
|
// relative to the gulp.dest
|
||||||
tsArgs.outDir = ".";
|
tsArgs.outDir = ".";
|
||||||
// We don't want source maps for production
|
// We don't want source maps for production
|
||||||
tsArgs.sourceMap = undefined;
|
tsArgs.sourceMap = undefined;
|
||||||
gulp.src(paths.ts)
|
gulp.src(paths.ts.release)
|
||||||
.pipe(map((f,cb) => { console.log(f.path); cb(null, f); }))
|
|
||||||
.pipe(ts(tsArgs))
|
.pipe(ts(tsArgs))
|
||||||
.pipe(gulp.dest("_build/ext/"));
|
.pipe(gulp.dest("_build/ext/"));
|
||||||
gulp.src(paths.dist, {base: ".", stripBOM: false})
|
gulp.src(paths.dist, {base: ".", stripBOM: false})
|
||||||
@ -72,7 +72,6 @@ gulp.task("build-prod", ["clean"], function() {
|
|||||||
|
|
||||||
|
|
||||||
gulp.task("package", ["build-prod"], function() {
|
gulp.task("package", ["build-prod"], function() {
|
||||||
console.log("hello, packaging");
|
|
||||||
let zipname = String.prototype.concat("taler-wallet-", manifest.version, ".zip");
|
let zipname = String.prototype.concat("taler-wallet-", manifest.version, ".zip");
|
||||||
gulp.src("_build/ext/*", {buffer: false, stripBOM: false})
|
gulp.src("_build/ext/*", {buffer: false, stripBOM: false})
|
||||||
.pipe(zip(zipname))
|
.pipe(zip(zipname))
|
||||||
@ -86,11 +85,9 @@ function tsconfig(confBase) {
|
|||||||
};
|
};
|
||||||
Object.assign(conf.compilerOptions, confBase);
|
Object.assign(conf.compilerOptions, confBase);
|
||||||
return through.obj(function(file, enc, cb) {
|
return through.obj(function(file, enc, cb) {
|
||||||
console.log("file", file.relative);
|
|
||||||
conf.files.push(file.relative);
|
conf.files.push(file.relative);
|
||||||
cb();
|
cb();
|
||||||
}, function(cb) {
|
}, function(cb) {
|
||||||
console.log("done");
|
|
||||||
let x = JSON.stringify(conf, null, 2);
|
let x = JSON.stringify(conf, null, 2);
|
||||||
let f = new File({
|
let f = new File({
|
||||||
path: "tsconfig.json",
|
path: "tsconfig.json",
|
||||||
@ -105,7 +102,7 @@ function tsconfig(confBase) {
|
|||||||
// Generate the tsconfig file
|
// Generate the tsconfig file
|
||||||
// that should be used during development.
|
// that should be used during development.
|
||||||
gulp.task("tsconfig", function() {
|
gulp.task("tsconfig", function() {
|
||||||
gulp.src(paths.ts, {base: "."})
|
gulp.src(Array.prototype.concat(paths.ts.release, paths.ts.dev), {base: "."})
|
||||||
.pipe(tsconfig(tsBaseArgs))
|
.pipe(tsconfig(tsBaseArgs))
|
||||||
.pipe(gulp.dest("."));
|
.pipe(gulp.dest("."));
|
||||||
});
|
});
|
||||||
|
@ -1,30 +1,22 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"module": "system",
|
"module": "system",
|
||||||
"noLib": true,
|
"sourceMap": true,
|
||||||
"sourceMap": true
|
"noLib": true
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib/refs.ts",
|
"lib/commonHelpers.ts",
|
||||||
"lib/wallet/wallet.ts",
|
"lib/polyfill-react.ts",
|
||||||
"lib/wallet/emscriptif.ts",
|
"lib/refs.ts",
|
||||||
"lib/wallet/db.ts",
|
"background/main.ts",
|
||||||
"lib/wallet/query.ts",
|
"content_scripts/notify.ts",
|
||||||
"lib/wallet/http.ts",
|
"popup/balance-overview.tsx",
|
||||||
"lib/wallet/checkable.ts",
|
"popup/history.tsx",
|
||||||
"lib/wallet/wxmessaging.ts",
|
"pages/confirm-contract.tsx",
|
||||||
"lib/wallet/types.ts",
|
"pages/confirm-create-reserve.tsx",
|
||||||
"lib/commonHelpers.ts",
|
"test/tests/taler.ts"
|
||||||
"lib/polyfill-react.ts",
|
]
|
||||||
"content_scripts/notify.ts",
|
|
||||||
"background/main.ts",
|
|
||||||
"popup/balance-overview.tsx",
|
|
||||||
"popup/history.tsx",
|
|
||||||
"pages/confirm-contract.tsx",
|
|
||||||
"pages/confirm-create-reserve.tsx",
|
|
||||||
"test/tests/taler.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user