Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Update all dependencies and fix various issues
Browse files Browse the repository at this point in the history
  • Loading branch information
elisee committed Mar 6, 2019
1 parent 99a020e commit 6a7134c
Show file tree
Hide file tree
Showing 17 changed files with 3,919 additions and 3,027 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cache:
directories:
- node_modules
before_install:
- npm i -g npm@5.2.0
- sudo dpkg --add-architecture i386
- sudo apt-get -qq update
- sudo apt-get install wine1.6
Expand Down
32 changes: 13 additions & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"use strict";

const gulp = require("gulp");
const tasks = [];

// Jade
const jade = require("gulp-jade");
// Pug
const pugTasks = [];

const pug = require("gulp-pug");
const rename = require("gulp-rename");
const fs = require("fs");

Expand All @@ -14,41 +15,34 @@ languageCodes.push("none");

for (const languageCode of languageCodes) {
const locale = i18n.loadLocale(languageCode);

gulp.task(`jade-index-${languageCode}`, () => {
const result = gulp.src("./src/renderer/index.jade").pipe(jade({ locals: { t: i18n.makeT(locale) } }));
if (languageCode !== "en") result.pipe(rename({ extname: `.${languageCode}.html` }));
gulp.task(`pug-${languageCode}`, () => {
let result = gulp.src("./src/renderer/index.pug").pipe(pug({ locals: { t: i18n.makeT(locale) } }));
if (languageCode !== "en") result = result.pipe(rename({ extname: `.${languageCode}.html` }));
return result.pipe(gulp.dest("public/renderer"));
});

tasks.push(`jade-index-${languageCode}`);
pugTasks.push(`pug-${languageCode}`);
}

// Stylus
const stylus = require("gulp-stylus");

gulp.task("stylus-index", () => gulp.src("./src/renderer/index.styl").pipe(stylus({ compress: true })).pipe(gulp.dest("public/renderer")));
tasks.push("stylus-index");
gulp.task("stylus", () => gulp.src("./src/renderer/index.styl").pipe(stylus({ compress: true })).pipe(gulp.dest("public/renderer")));

// TypeScript
const ts = require("gulp-typescript");
const tslint = require("gulp-tslint");

// Node
const tsProject = ts.createProject("./src/tsconfig.json");
const tslint = require("gulp-tslint");

gulp.task("typescript", () => {
let failed = false;
const tsResult = tsProject.src()
.pipe(tslint())
.pipe(tslint.report("prose", { emitError: false }))
.pipe(tslint({ formatter: "prose" }))
.pipe(tslint.report({ emitError: true }))
.on("error", (err) => { throw err; })
.pipe(tsProject())
.on("error", () => { failed = true; })
.on("end", () => { if (failed) throw new Error("There were TypeScript errors."); });
return tsResult.js.pipe(gulp.dest("./public"));
});
tasks.push("typescript");

// All
gulp.task("default", tasks);
gulp.task("default", gulp.parallel(gulp.parallel(pugTasks), "stylus", "typescript"));
Loading

0 comments on commit 6a7134c

Please sign in to comment.