Skip to content

Commit 378aa82

Browse files
committed
Updated dependencies, everuthing is broken.
Some minor fixes to the code to bring it up to speed.
1 parent c153c66 commit 378aa82

14 files changed

+8549
-115
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = crlf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.vs/
1+
.vs/
22
node_modules/
33
build/
4-
Snapp.njsproj
4+
*.njsproj
55
tsconfig.json

package-lock.json

+8,460
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+53-81
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,100 @@
11
{
22
"name": "snapp",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"description": "Snapp!",
5-
65
"author": {
76
"name": "Adrian Hintze",
87
"email": "hintze.adrian@gmail.com",
98
"url": "https://github.com/Rydion/"
109
},
11-
1210
"private": true,
13-
1411
"scripts": {
1512
"run": "node build/snapp/Snapp.js",
16-
1713
"prebuild": "rimraf build/logs && rimraf build/upload",
1814
"build": "npm run build-server && npm run build-client && npm run copy-resources && npm run create-conf-file",
1915
"prebuild-server": "rimraf build/snapp",
2016
"build-server": "tsc -p server-tsconfig.json",
2117
"prebuild-client": "rimraf build/WebContent",
2218
"build-client": "webpack --progress --profile",
23-
2419
"copy-resources": "npm run copy-snap && npm run copy-nw && npm run copy-icons && npm run copy-conf",
25-
2620
"copy-snap": "npm run copy-snap-full && npm run copy-snap-reduced",
2721
"precopy-snap-full": "rimraf build/resources/snap/full",
2822
"copy-snap-full": "copyfiles -u 2 \"node_modules/snap-4-snapp-full/**/*\" \"build/resources/snap/full/files\" && copyfiles -u 2 \"node_modules/snap-4-snapp-full/gui.js\" \"build/resources/snap/full/gui\"",
2923
"postcopy-snap-full": "rimraf build/resources/snap/full/files/gui.js && rimraf build/resources/snap/full/files/package.json",
3024
"precopy-snap-reduced": "rimraf build/resources/snap/reduced",
3125
"copy-snap-reduced": "rimraf build/resources/snap/reduced && copyfiles -u 2 \"node_modules/snap-4-snapp-reduced/**/*\" \"build/resources/snap/reduced/files\" && copyfiles -u 2 \"node_modules/snap-4-snapp-reduced/gui.js\" \"build/resources/snap/reduced/gui\"",
3226
"postcopy-snap-reduced": "rimraf build/resources/snap/reduced/files/gui.js && rimraf build/resources/snap/reduced/files/package.json",
33-
3427
"precopy-nw": "rimraf build/resources/nw",
3528
"copy-nw": "copyfiles -u 1 \"nw/**/*\" \"build/resources/nw\"",
36-
3729
"precopy-icons": "rimraf build/resources/icons",
3830
"copy-icons": "copyfiles -u 1 \"icons/**/*\" \"build/resources/icons\"",
39-
4031
"precopy-conf": "rimraf build/resources/conf",
4132
"copy-conf": "copyfiles -u 1 \"binary_conf/**/*\" \"build/resources/conf\"",
42-
4333
"precreate-conf-file": "rimraf build/snapp_conf.json",
4434
"create-conf-file": "echo { \"port\": 80, \"uploadFileSizeLimit\": 100000000, \"compressStaticFiles\": true } >> build/snapp_conf.json"
4535
},
46-
4736
"engines": {
48-
"node": ">=7.9.0",
49-
"npm": ">=4.5.0"
37+
"node": ">=10.4.1",
38+
"npm": ">=6.1.0"
5039
},
51-
5240
"dependencies": {
53-
"express": "4.15.2",
54-
"body-parser": "1.17.1",
55-
"multer": "1.3.0",
56-
"compression": "1.6.2",
57-
58-
"sax": "1.2.2",
59-
60-
"archiver": "1.3.0",
61-
62-
"winston": "2.3.1",
63-
"winston-daily-rotate-file": "1.4.6",
64-
41+
"archiver": "2.1.1",
42+
"body-parser": "1.18.3",
43+
"compression": "1.7.2",
44+
"express": "4.16.3",
6545
"mkdirp": "0.5.1",
66-
67-
"stream-to-array": "2.3.0"
46+
"multer": "1.3.0",
47+
"sax": "1.2.4",
48+
"stream-to-array": "2.3.0",
49+
"winston": "3.0.0",
50+
"winston-daily-rotate-file": "3.2.1"
6851
},
69-
7052
"devDependencies": {
71-
"typescript": "2.3.2",
72-
73-
"@types/body-parser": "1.16.3",
74-
"@types/compression": "0.0.33",
75-
"@types/express": "4.0.35",
76-
"@types/file-saver": "0.0.1",
77-
"@types/mime": "0.0.29",
78-
"@types/mkdirp": "0.3.29",
79-
"@types/multer": "0.0.33",
80-
"@types/node": "7.0.16",
53+
"@angular/animations": "6.0.5",
54+
"@angular/common": "6.0.5",
55+
"@angular/compiler": "6.0.5",
56+
"@angular/core": "6.0.5",
57+
"@angular/forms": "6.0.5",
58+
"@angular/http": "6.0.5",
59+
"@angular/platform-browser": "6.0.5",
60+
"@angular/platform-browser-dynamic": "6.0.5",
61+
"@angular/router": "6.0.5",
62+
"@types/body-parser": "1.17.0",
63+
"@types/compression": "0.0.36",
64+
"@types/express": "4.16.0",
65+
"@types/file-saver": "1.3.0",
66+
"@types/mime": "2.0.0",
67+
"@types/mkdirp": "0.5.2",
68+
"@types/multer": "1.3.7",
69+
"@types/node": "10.3.3",
8170
"@types/sax": "1.0.0",
82-
"@types/stream-to-array": "0.0.28",
83-
84-
"concurrently": "3.4.0",
85-
"rimraf": "2.6.1",
86-
"copyfiles": "1.2.0",
87-
88-
"webpack": "2.5.0",
89-
"webpack-merge": "4.1.0",
90-
71+
"@types/stream-to-array": "2.3.0",
72+
"angular2-busy": "2.0.4",
9173
"angular2-template-loader": "0.6.2",
92-
"awesome-typescript-loader": "3.1.3",
93-
"css-loader": "0.28.1",
94-
"file-loader": "0.11.1",
95-
"html-loader": "0.4.5",
74+
"awesome-typescript-loader": "5.1.0",
75+
"bootstrap": "4.1.1",
76+
"concurrently": "3.5.1",
77+
"copyfiles": "2.0.0",
78+
"core-js": "2.5.7",
79+
"css-loader": "0.28.11",
80+
"extract-text-webpack-plugin": "3.0.2",
81+
"file-loader": "1.1.11",
82+
"file-saver": "1.3.8",
83+
"html-loader": "0.5.5",
84+
"html-webpack-plugin": "3.2.0",
85+
"ngx-modialog": "5.0.1",
9686
"null-loader": "0.1.1",
9787
"raw-loader": "0.5.1",
98-
"style-loader": "0.17.0",
99-
"to-string-loader": "1.1.5",
100-
101-
"extract-text-webpack-plugin": "2.1.0",
102-
"html-webpack-plugin": "2.28.0",
103-
104-
"@angular/animations": "4.1.1",
105-
"@angular/common": "4.1.1",
106-
"@angular/compiler": "4.1.1",
107-
"@angular/core": "4.1.1",
108-
"@angular/forms": "4.1.1",
109-
"@angular/http": "4.1.1",
110-
"@angular/platform-browser": "4.1.1",
111-
"@angular/platform-browser-dynamic": "4.1.1",
112-
"@angular/router": "4.1.1",
113-
114-
"core-js": "2.4.1",
115-
"rxjs": "5.3.1",
116-
"zone.js": "0.8.10",
117-
118-
"angular2-busy": "2.0.4",
119-
"angular2-modal": "2.0.3",
120-
121-
"file-saver": "1.3.3",
122-
123-
"bootstrap": "3.3.7",
124-
88+
"rimraf": "2.6.2",
89+
"rxjs": "6.2.1",
12590
"snap-4-snapp-full": "git+https://git@github.com/Rydion/Snap-4-Snapp.git#full-v2.0.0",
126-
"snap-4-snapp-reduced": "git+https://git@github.com/Rydion/Snap-4-Snapp.git#reduced-v2.0.0"
91+
"snap-4-snapp-reduced": "git+https://git@github.com/Rydion/Snap-4-Snapp.git#reduced-v2.0.0",
92+
"style-loader": "0.21.0",
93+
"to-string-loader": "1.1.5",
94+
"typescript": "2.9.2",
95+
"webpack": "4.12.0",
96+
"webpack-cli": "3.0.8",
97+
"webpack-merge": "4.1.3",
98+
"zone.js": "0.8.26"
12799
}
128100
}

server-tsconfig.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"compilerOptions": {
3-
"target": "es2016",
3+
"target": "ES2016",
44
"module": "commonjs",
55
"moduleResolution": "node",
6+
67
"sourceMap": true,
78
"outDir": "./build/snapp",
89
"newLine": "LF",
9-
"removeComments": false,
1010

1111
"emitDecoratorMetadata": true,
1212
"experimentalDecorators": true,
1313
"lib": [ "es2016", "dom" ],
14+
1415
"strict": true,
1516
"suppressImplicitAnyIndexErrors": true,
1617
"noUnusedLocals": true,
@@ -31,4 +32,4 @@
3132
"exclude": [
3233
"./node_modules"
3334
]
34-
}
35+
}

src/server/GenerateExecutableHandler.ts

+9-11
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
'use strict';
10-
119
import * as path from 'path';
1210

1311
import streamToArray = require('stream-to-array');
@@ -88,15 +86,15 @@ interface ExecGenerationRequestParams {
8886
useCompleteSnap: boolean;
8987
}
9088

91-
function validateFilename(filename: string): Promise<undefined> {
89+
function validateFilename(filename: string): Promise<void> {
9290
if (validationUtils.validateString(filename, false)) {
9391
return Promise.reject({ message: 'validateFilename1' });
9492
}
9593

9694
return Promise.resolve();
9795
}
9896

99-
function validateFileContents(fileContents: string): Promise<undefined> {
97+
function validateFileContents(fileContents: string): Promise<void> {
10098
if (validationUtils.validateString(fileContents, false)) {
10199
return Promise.reject({ message: 'validateFileContents1' });
102100
}
@@ -136,7 +134,7 @@ function validateFileContents(fileContents: string): Promise<undefined> {
136134
return returnPromise;
137135
}
138136

139-
function validateOs(os: string): Promise<undefined> {
137+
function validateOs(os: string): Promise<void> {
140138
const validOsValues: Array<string> = ['mac32', 'mac64', 'lin32', 'lin64', 'win32', 'win64'];
141139
if (validationUtils.validateString(os, false, validOsValues)) {
142140
return Promise.reject({ message: 'validateOs1' });
@@ -145,7 +143,7 @@ function validateOs(os: string): Promise<undefined> {
145143
return Promise.resolve();
146144
}
147145

148-
function validateResolution(resolution: string): Promise<undefined> {
146+
function validateResolution(resolution: string): Promise<void> {
149147
if (validationUtils.validateString(resolution, false)) {
150148
return Promise.reject({ message: 'validateResolution1' });
151149
}
@@ -159,15 +157,15 @@ function validateResolution(resolution: string): Promise<undefined> {
159157
}
160158
}
161159

162-
function validateUseCompleteSnap(useCompleteSnap: boolean): Promise<undefined> {
160+
function validateUseCompleteSnap(useCompleteSnap: boolean): Promise<void> {
163161
if (validationUtils.validateBoolean(useCompleteSnap)) {
164162
return Promise.reject({ message: 'validateUseCompleteSnap1' });
165163
}
166164

167165
return Promise.resolve();
168166
}
169167

170-
function validateParams({ filename, project, os, resolution, useCompleteSnap }: ExecGenerationRequestParams): Promise<undefined> {
168+
function validateParams({ filename, project, os, resolution, useCompleteSnap }: ExecGenerationRequestParams): Promise<void> {
171169
const validationPromises = [
172170
validateFilename(filename),
173171
validateFileContents(project),
@@ -211,7 +209,7 @@ function buildGui(gui: string, project: string, os: string, projectName: string)
211209
return result + `IDE_Morph.prototype.snapproject = '${project}';`
212210
}
213211

214-
function buildProjectPackage(projectPackage: Zip, project: string, os: string, projectName: string, resolution: Resolution, useCompleteSnap: boolean): Promise<undefined> {
212+
function buildProjectPackage(projectPackage: Zip, project: string, os: string, projectName: string, resolution: Resolution, useCompleteSnap: boolean): Promise<void> {
215213
const version: string = useCompleteSnap ? 'full' : 'reduced';
216214

217215
projectPackage.append(buildPackageJson(os, projectName, resolution), { name: 'package.json' });
@@ -227,7 +225,7 @@ function buildProjectPackage(projectPackage: Zip, project: string, os: string, p
227225
});
228226
}
229227

230-
function buildFinalPackage(finalPackage: Zip, os: string, filename: string): Promise<undefined> {
228+
function buildFinalPackage(finalPackage: Zip, os: string, filename: string): Promise<void> {
231229
switch (os) {
232230
case 'mac64':
233231
case 'mac32': {
@@ -257,7 +255,7 @@ function buildFinalPackage(finalPackage: Zip, os: string, filename: string): Pro
257255
finalPackage.directory(path.join(resourcesDir, 'nw', os, 'lib'), rootDir);
258256
finalPackage.file(path.join(resourcesDir, 'icons', 'lambda.png'), { name: path.join(rootDir, 'lambda.png') });
259257

260-
const readFilesPromises: Array<Promise<undefined>> = [
258+
const readFilesPromises: Array<Promise<void>> = [
261259
fileSystemUtils.readTextFile(path.join(resourcesDir, 'conf', 'linux', 'launcher.sh'))
262260
.then((launcherTemplate: string) => {
263261
const launcher: string = launcherTemplate.replace('<filename>', filename);

src/server/Snapp.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
'use strict';
10-
119
global.rootDir = __dirname;
1210

1311
import * as path from 'path';
@@ -112,7 +110,7 @@ snapp
112110
generateExecutable(projectPath, body)
113111
.then((zip) => {
114112
const attachmentFilename = `${filename}.zip`;
115-
const mimeType = mime.lookup(attachmentFilename);
113+
const mimeType: string = <string>mime.getType(attachmentFilename);
116114

117115
response.setHeader('Content-disposition', `attachment; filename=${attachmentFilename}`);
118116
response.setHeader('Content-type', mimeType);

src/server/Xml.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
'use strict';
10-
119
import { parser as createSaxParser, SAXParser, Tag, QualifiedTag } from 'sax';
1210

1311
export default class SaxParser {

src/server/Zip.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
*
77
*/
88

9-
'use strict';
10-
119
import { create as getNewArchiver, Archiver } from 'archiver';
1210

1311
const defaultHighWaterMark = 100000000; // TODO -normal- Why does this value work and lower ones not?
1412

1513
export default class Zip {
16-
public constructor(onError: Function, onFinish: Function) {
14+
public constructor(onError: (...args: any[]) => void, onFinish: (...args: any[]) => void) {
1715
this.zip = getNewArchiver('zip', { highWaterMark: defaultHighWaterMark });
1816
this.zip.on('error', onError);
1917
this.zip.on('finish', onFinish);
@@ -39,7 +37,7 @@ export default class Zip {
3937
}
4038

4139
public getStream(): NodeJS.ReadableStream {
42-
return this.zip;
40+
return this.zip.;
4341
}
4442

4543
private zip: Archiver;

src/server/log/Log.ts

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
declare var winstonDailyRotator: any; // Ugly hack, make a d.ts file for winston-daily-rotate-file
1010

11-
'use strict';
12-
1311
import * as path from 'path';
1412

1513
import * as winston from 'winston';

src/server/utils/FileSystem.ts

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
*/
88

9-
'use strict';
10-
119
import * as fs from 'fs';
1210

1311
import * as mkdirp from 'mkdirp';

0 commit comments

Comments
 (0)