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

Commit e14fd45

Browse files
committed
Update for latest changes in Superpowers Core, upgrade from Jade to Pug
1 parent a529204 commit e14fd45

File tree

37 files changed

+748
-86
lines changed

37 files changed

+748
-86
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Make static websites in live collaboration with [Superpowers](http://superpowers-html5.com/).
66

7-
The Superpowers Web system uses [Jade](http://jade-lang.com/) for HTML and [Stylus](http://stylus-lang.com/) for stylesheets.
7+
The Superpowers Web system uses [Pug](https://pugjs.org/) for HTML and [Stylus](http://stylus-lang.com/) for stylesheets.
88

99
## How to install
1010

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "superpowers-web",
33
"description": "Static website system for Superpowers, the HTML5 app for real-time collaborative projects",
4-
"version": "3.0.1",
4+
"version": "4.0.0",
55
"license": "ISC",
66
"repository": {
77
"type": "git",
@@ -11,4 +11,4 @@
1111
"systemId": "web",
1212
"publishedPluginBundles": []
1313
}
14-
}
14+
}

player/gulpfile.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
var gulp = require("gulp");
1+
"use strict";
2+
3+
const gulp = require("gulp");
24

35
// TypeScript
4-
var ts = require("gulp-typescript");
5-
var tsProject = ts.createProject("tsconfig.json");
6-
var tslint = require("gulp-tslint");
6+
const ts = require("gulp-typescript");
7+
const tsProject = ts.createProject("./tsconfig.json");
8+
const tslint = require("gulp-tslint");
79

8-
gulp.task("typescript", function() {
9-
var failed = false;
10-
var tsResult = tsProject.src()
11-
.pipe(tslint())
12-
.pipe(tslint.report("prose", { emitError: true }))
10+
gulp.task("typescript", () => {
11+
let failed = false;
12+
const tsResult = tsProject.src()
13+
.pipe(tslint({ formatter: "prose" }))
14+
.pipe(tslint.report({ emitError: true }))
1315
.on("error", (err) => { throw err; })
1416
.pipe(tsProject())
1517
.on("error", () => { failed = true; })
@@ -18,13 +20,13 @@ gulp.task("typescript", function() {
1820
});
1921

2022
// Browserify
21-
var browserify = require("browserify");
22-
var source = require("vinyl-source-stream");
23-
gulp.task("browserify", [ "typescript" ],function() {
24-
var bundler = browserify("./index.js");
23+
const browserify = require("browserify");
24+
const source = require("vinyl-source-stream");
25+
gulp.task("browserify", () => {
26+
const bundler = browserify("./index.js");
2527
function bundle() { return bundler.bundle().pipe(source("index.js")).pipe(gulp.dest("../public")); }
2628
return bundle();
2729
});
2830

2931
// All
30-
gulp.task("default", [ "typescript", "browserify" ]);
32+
gulp.task("default", gulp.series("typescript", "browserify"));

player/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="../../../SupClient/typings/SupApp.d.ts" />
22

33
import * as querystring from "querystring";
4-
const qs: { project: string; build: string; } = querystring.parse(window.location.search.slice(1));
4+
const qs: { project: string; build: string; } = querystring.parse(window.location.search.slice(1)) as any;
55

66
const indexPath = `/builds/${qs.project}/${qs.build}/files/index.html`;
77

player/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es5",
4+
"target": "es6",
55
"noImplicitAny": true,
66
"typeRoots": [ "../../../node_modules/@types" ]
77
}
File renamed without changes.

plugins/default/blob/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es5",
4+
"target": "es6",
55
"noImplicitAny": true,
66
"rootDir": "./",
77
"typeRoots": [ "../../../../../node_modules/@types" ]

plugins/default/export/build/buildWeb.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import * as path from "path";
66
const qs = querystring.parse(window.location.search.slice(1));
77

88
let settings: WebBuildSettings;
9+
let projectWindowId: number;
910

1011
const progress = { index: 0, total: 0, errors: 0 };
1112
const statusElt = document.querySelector(".status");
1213
const progressElt = document.querySelector("progress") as HTMLProgressElement;
1314
const detailsListElt = document.querySelector(".details ol") as HTMLOListElement;
1415

15-
export default function build(socket: SocketIOClient.Socket, theSettings: WebBuildSettings, buildPort: number) {
16+
export default function build(socket: SocketIOClient.Socket, theSettings: WebBuildSettings, theProjectWindowId: number, buildPort: number) {
1617
settings = theSettings;
18+
projectWindowId = theProjectWindowId;
1719

1820
socket.emit("build:project", (err: string, buildId: string) => {
1921
const buildPath = `${window.location.protocol}//${window.location.hostname}:${buildPort}/builds/${qs.project}/${buildId}/`;
@@ -51,14 +53,16 @@ function updateProgress() {
5153

5254
if (progress.index < progress.total) {
5355
statusElt.textContent = SupClient.i18n.t("builds:web.progress", { path: settings.outputFolder, index: progress.index, total: progress.total });
54-
} else if (progress.errors > 0) {
55-
statusElt.textContent = SupClient.i18n.t("builds:web.doneWithErrors", { path: settings.outputFolder, total: progress.total, errors: progress.errors });
5656
} else {
57-
statusElt.textContent = SupClient.i18n.t("builds:web.done", { path: settings.outputFolder, total: progress.total });
57+
statusElt.textContent = progress.errors > 0 ?
58+
SupClient.i18n.t("builds:web.doneWithErrors", { path: settings.outputFolder, total: progress.total, errors: progress.errors }) :
59+
SupClient.i18n.t("builds:web.done", { path: settings.outputFolder, total: progress.total });
60+
61+
SupApp.sendMessage(projectWindowId, "build-finished");
5862
}
5963
}
6064

61-
function downloadFile(buildPath: string, filePath: string, callback: ErrorCallback) {
65+
function downloadFile(buildPath: string, filePath: string, callback: (err: Error) => void) {
6266
const inputPath = `${buildPath}files/${filePath}`;
6367
const outputPath = path.join(settings.outputFolder, filePath);
6468

plugins/default/export/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es5",
4+
"target": "es6",
55
"noImplicitAny": true,
66
"rootDir": "./",
77
"typeRoots": [ "../../../../../node_modules/@types" ]

0 commit comments

Comments
 (0)