@scifeon/sdk 0.100.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-target.d.ts +6 -6
- package/dist/action-target.js +10 -10
- package/dist/app/app-generator.d.ts +34 -34
- package/dist/app/app-generator.js +460 -460
- package/dist/app/app-persist.d.ts +18 -18
- package/dist/app/app-persist.js +193 -193
- package/dist/app/app-validator.d.ts +8 -8
- package/dist/app/app-validator.js +145 -145
- package/dist/app/interfaces/app-json.interface.d.ts +4 -4
- package/dist/app/interfaces/app-json.interface.js +2 -2
- package/dist/app/interfaces/app-type.enum.d.ts +5 -5
- package/dist/app/interfaces/app-type.enum.js +9 -9
- package/dist/app/interfaces/contributions/contributions-json.interface.d.ts +55 -55
- package/dist/app/interfaces/contributions/contributions-json.interface.js +2 -2
- package/dist/app/interfaces/contributions/main-menu.interface.d.ts +12 -12
- package/dist/app/interfaces/contributions/main-menu.interface.js +2 -2
- package/dist/app/interfaces/contributions/menu-item.interface.d.ts +5 -5
- package/dist/app/interfaces/contributions/menu-item.interface.js +2 -2
- package/dist/app/interfaces/contributions/page-menu-item.interface.d.ts +10 -10
- package/dist/app/interfaces/contributions/page-menu-item.interface.js +2 -2
- package/dist/app/interfaces/contributions/page-menu.interface.d.ts +9 -9
- package/dist/app/interfaces/contributions/page-menu.interface.js +2 -2
- package/dist/app/interfaces/package-json.interface.d.ts +14 -14
- package/dist/app/interfaces/package-json.interface.js +2 -2
- package/dist/app/interfaces/webpack-config.interface.d.ts +5 -5
- package/dist/app/interfaces/webpack-config.interface.js +2 -2
- package/dist/cli/commands/app/build.d.ts +4 -4
- package/dist/cli/commands/app/build.js +43 -43
- package/dist/cli/commands/app/clean.d.ts +3 -3
- package/dist/cli/commands/app/clean.js +15 -15
- package/dist/cli/commands/app/debug.d.ts +3 -3
- package/dist/cli/commands/app/debug.js +22 -22
- package/dist/cli/commands/app/e2e-test.d.ts +3 -3
- package/dist/cli/commands/app/e2e-test.js +23 -23
- package/dist/cli/commands/app/new.d.ts +6 -6
- package/dist/cli/commands/app/new.js +190 -190
- package/dist/cli/commands/app/package.d.ts +3 -3
- package/dist/cli/commands/app/package.js +10 -10
- package/dist/cli/commands/app/post-process.d.ts +8 -8
- package/dist/cli/commands/app/post-process.js +122 -122
- package/dist/cli/commands/app/scaffold.d.ts +4 -4
- package/dist/cli/commands/app/scaffold.js +19 -19
- package/dist/cli/commands/app/unit-test.d.ts +3 -3
- package/dist/cli/commands/app/unit-test.js +11 -11
- package/dist/cli/commands/app/validate.d.ts +3 -3
- package/dist/cli/commands/app/validate.js +20 -20
- package/dist/cli/commands/app/version.d.ts +3 -3
- package/dist/cli/commands/app/version.js +17 -17
- package/dist/cli/commands/app/watch.d.ts +3 -3
- package/dist/cli/commands/app/watch.js +48 -48
- package/dist/cli/commands/scifeon/download.d.ts +3 -3
- package/dist/cli/commands/scifeon/download.js +48 -48
- package/dist/cli/commands/scifeon/run.d.ts +3 -3
- package/dist/cli/commands/scifeon/run.js +41 -41
- package/dist/cli/config.d.ts +11 -11
- package/dist/cli/config.js +23 -23
- package/dist/cli/index.d.ts +9 -9
- package/dist/cli/index.js +159 -159
- package/dist/cli/webpack-runner.d.ts +1 -1
- package/dist/cli/webpack-runner.js +26 -26
- package/dist/download-utils.d.ts +3 -3
- package/dist/download-utils.js +50 -50
- package/dist/file-utils.d.ts +5 -5
- package/dist/file-utils.js +41 -41
- package/dist/html-report.d.ts +15 -15
- package/dist/html-report.js +212 -212
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -23
- package/dist/logger.d.ts +14 -14
- package/dist/logger.js +52 -52
- package/dist/measurement-units.d.ts +5 -5
- package/dist/measurement-units.js +9 -9
- package/dist/page-types.d.ts +6 -6
- package/dist/page-types.js +10 -10
- package/dist/plugin-types.d.ts +43 -42
- package/dist/plugin-types.js +47 -46
- package/dist/unit-test-runner.d.ts +1 -1
- package/dist/unit-test-runner.js +82 -82
- package/dist/utils/test-helper.d.ts +4 -4
- package/dist/utils/test-helper.js +46 -46
- package/dist/webpack-app-config.d.ts +2 -2
- package/dist/webpack-app-config.js +248 -248
- package/dist/webpack-utils.d.ts +8 -8
- package/dist/webpack-utils.js +91 -91
- package/package.json +72 -72
- package/resources/new-app/README.md +12 -12
- package/resources/new-app/editor/.vscode/launch.json +40 -40
- package/resources/new-app/gitignore.txt +6 -6
- package/resources/new-app/typescript/src/index.html +14 -14
- package/resources/new-app/typescript/src/index.ts +32 -32
- package/resources/new-app/typescript/test/e2e/frontpage.test.ts +16 -16
- package/resources/new-app/typescript/test/e2e-config.ts +14 -14
- package/resources/new-app/typescript/test/unit/index.test.ts +7 -7
- package/resources/new-app/typescript/tsconfig.json +39 -39
- package/resources/scaffold-templates/scaffold-e2e-test.ts +19 -19
- package/resources/test/chai.js +10706 -10706
- package/resources/test/mocha.css +326 -326
- package/resources/test/mocha.js +16590 -16590
- package/resources/test/tests.html +26 -26
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PackageCommand = void 0;
|
|
4
|
-
const webpack_runner_1 = require("../../webpack-runner");
|
|
5
|
-
class PackageCommand {
|
|
6
|
-
execute() {
|
|
7
|
-
(0, webpack_runner_1.webpackRunner)("package");
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.PackageCommand = PackageCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PackageCommand = void 0;
|
|
4
|
+
const webpack_runner_1 = require("../../webpack-runner");
|
|
5
|
+
class PackageCommand {
|
|
6
|
+
execute() {
|
|
7
|
+
(0, webpack_runner_1.webpackRunner)("package");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PackageCommand = PackageCommand;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OptionValues } from "commander";
|
|
2
|
-
export declare class PostProcessCommand {
|
|
3
|
-
private updateTestFile;
|
|
4
|
-
private postProcessFiles;
|
|
5
|
-
private parseFile;
|
|
6
|
-
private findBlocks;
|
|
7
|
-
execute(options: OptionValues): Promise<void>;
|
|
8
|
-
}
|
|
1
|
+
import { OptionValues } from "commander";
|
|
2
|
+
export declare class PostProcessCommand {
|
|
3
|
+
private updateTestFile;
|
|
4
|
+
private postProcessFiles;
|
|
5
|
+
private parseFile;
|
|
6
|
+
private findBlocks;
|
|
7
|
+
execute(options: OptionValues): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
-
var m = o[Symbol.asyncIterator], i;
|
|
14
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PostProcessCommand = void 0;
|
|
20
|
-
const fs = require("fs");
|
|
21
|
-
const readline = require("readline");
|
|
22
|
-
const logger_1 = require("../../../logger");
|
|
23
|
-
class PostProcessCommand {
|
|
24
|
-
updateTestFile(testFile, recordingFile) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const lines = yield this.parseFile(testFile);
|
|
27
|
-
const newLines = [];
|
|
28
|
-
for (const line of lines) {
|
|
29
|
-
if (line.includes(`import { runChromeRecording } from`)) {
|
|
30
|
-
newLines.push(`import { runChromeRecording } from "./${recordingFile.replace(/\.js/, "")}";`);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
newLines.push(line);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
fs.writeFileSync(testFile, newLines.join("\n"), { flag: "w" });
|
|
37
|
-
logger_1.LOGGER.msg(`Updating test file: "${testFile}".`);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
postProcessFiles(recordingFile) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const recordingLines = yield this.parseFile(recordingFile);
|
|
43
|
-
const functionBlocks = this.findBlocks(recordingLines, " async function", " }");
|
|
44
|
-
const blocks = this.findBlocks(recordingLines, " {", " }");
|
|
45
|
-
blocks.splice(1, 1);
|
|
46
|
-
const functionLines = functionBlocks.reduce((ary, block) => ary.concat(block), []);
|
|
47
|
-
functionLines.unshift(`import { e2eConfig } from "@scifeon/e2e-test";`);
|
|
48
|
-
const blockLines = blocks.reduce((ary, block) => ary.concat(block), []);
|
|
49
|
-
blockLines.unshift("");
|
|
50
|
-
blockLines.unshift(" const timeout = e2eConfig.puppeteer.timeout;");
|
|
51
|
-
blockLines.unshift("async function runChromeRecording(page) {");
|
|
52
|
-
blockLines.push("};");
|
|
53
|
-
blockLines.push("");
|
|
54
|
-
blockLines.push("export { runChromeRecording };");
|
|
55
|
-
return [...functionLines, ...blockLines];
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
parseFile(filePath) {
|
|
59
|
-
var e_1, _a;
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const lines = [];
|
|
62
|
-
const fileInterface = readline.createInterface({
|
|
63
|
-
input: fs.createReadStream(filePath),
|
|
64
|
-
output: process.stdout,
|
|
65
|
-
terminal: false,
|
|
66
|
-
});
|
|
67
|
-
try {
|
|
68
|
-
for (var fileInterface_1 = __asyncValues(fileInterface), fileInterface_1_1; fileInterface_1_1 = yield fileInterface_1.next(), !fileInterface_1_1.done;) {
|
|
69
|
-
const line = fileInterface_1_1.value;
|
|
70
|
-
lines.push(line);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
|
-
finally {
|
|
75
|
-
try {
|
|
76
|
-
if (fileInterface_1_1 && !fileInterface_1_1.done && (_a = fileInterface_1.return)) yield _a.call(fileInterface_1);
|
|
77
|
-
}
|
|
78
|
-
finally { if (e_1) throw e_1.error; }
|
|
79
|
-
}
|
|
80
|
-
return lines;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
findBlocks(lines, startPattern, endPattern) {
|
|
84
|
-
const blocks = [];
|
|
85
|
-
let gotStart = false;
|
|
86
|
-
let gotEnd = false;
|
|
87
|
-
let block = [];
|
|
88
|
-
for (const line of lines) {
|
|
89
|
-
if (line.startsWith(startPattern)) {
|
|
90
|
-
gotStart = true;
|
|
91
|
-
gotEnd = false;
|
|
92
|
-
}
|
|
93
|
-
if (line.startsWith(endPattern)) {
|
|
94
|
-
gotEnd = true;
|
|
95
|
-
}
|
|
96
|
-
if (gotStart) {
|
|
97
|
-
block.push(line);
|
|
98
|
-
}
|
|
99
|
-
if (gotStart && gotEnd) {
|
|
100
|
-
blocks.push(block);
|
|
101
|
-
block = [];
|
|
102
|
-
gotStart = false;
|
|
103
|
-
gotEnd = false;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return blocks;
|
|
107
|
-
}
|
|
108
|
-
execute(options) {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
if (options.test && options.recording) {
|
|
111
|
-
const testFile = options.test;
|
|
112
|
-
const recordingFile = options.recording;
|
|
113
|
-
const outputFile = recordingFile.replace(/\.js$/, ".post-processed.js");
|
|
114
|
-
yield this.updateTestFile(testFile, outputFile);
|
|
115
|
-
const outputLines = yield this.postProcessFiles(recordingFile);
|
|
116
|
-
fs.writeFileSync(outputFile, outputLines.join("\n"));
|
|
117
|
-
logger_1.LOGGER.msg(`Writing post-processed file: "${outputFile}".`);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.PostProcessCommand = PostProcessCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.PostProcessCommand = void 0;
|
|
20
|
+
const fs = require("fs");
|
|
21
|
+
const readline = require("readline");
|
|
22
|
+
const logger_1 = require("../../../logger");
|
|
23
|
+
class PostProcessCommand {
|
|
24
|
+
updateTestFile(testFile, recordingFile) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const lines = yield this.parseFile(testFile);
|
|
27
|
+
const newLines = [];
|
|
28
|
+
for (const line of lines) {
|
|
29
|
+
if (line.includes(`import { runChromeRecording } from`)) {
|
|
30
|
+
newLines.push(`import { runChromeRecording } from "./${recordingFile.replace(/\.js/, "")}";`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
newLines.push(line);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
fs.writeFileSync(testFile, newLines.join("\n"), { flag: "w" });
|
|
37
|
+
logger_1.LOGGER.msg(`Updating test file: "${testFile}".`);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
postProcessFiles(recordingFile) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const recordingLines = yield this.parseFile(recordingFile);
|
|
43
|
+
const functionBlocks = this.findBlocks(recordingLines, " async function", " }");
|
|
44
|
+
const blocks = this.findBlocks(recordingLines, " {", " }");
|
|
45
|
+
blocks.splice(1, 1);
|
|
46
|
+
const functionLines = functionBlocks.reduce((ary, block) => ary.concat(block), []);
|
|
47
|
+
functionLines.unshift(`import { e2eConfig } from "@scifeon/e2e-test";`);
|
|
48
|
+
const blockLines = blocks.reduce((ary, block) => ary.concat(block), []);
|
|
49
|
+
blockLines.unshift("");
|
|
50
|
+
blockLines.unshift(" const timeout = e2eConfig.puppeteer.timeout;");
|
|
51
|
+
blockLines.unshift("async function runChromeRecording(page) {");
|
|
52
|
+
blockLines.push("};");
|
|
53
|
+
blockLines.push("");
|
|
54
|
+
blockLines.push("export { runChromeRecording };");
|
|
55
|
+
return [...functionLines, ...blockLines];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
parseFile(filePath) {
|
|
59
|
+
var e_1, _a;
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const lines = [];
|
|
62
|
+
const fileInterface = readline.createInterface({
|
|
63
|
+
input: fs.createReadStream(filePath),
|
|
64
|
+
output: process.stdout,
|
|
65
|
+
terminal: false,
|
|
66
|
+
});
|
|
67
|
+
try {
|
|
68
|
+
for (var fileInterface_1 = __asyncValues(fileInterface), fileInterface_1_1; fileInterface_1_1 = yield fileInterface_1.next(), !fileInterface_1_1.done;) {
|
|
69
|
+
const line = fileInterface_1_1.value;
|
|
70
|
+
lines.push(line);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
|
+
finally {
|
|
75
|
+
try {
|
|
76
|
+
if (fileInterface_1_1 && !fileInterface_1_1.done && (_a = fileInterface_1.return)) yield _a.call(fileInterface_1);
|
|
77
|
+
}
|
|
78
|
+
finally { if (e_1) throw e_1.error; }
|
|
79
|
+
}
|
|
80
|
+
return lines;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
findBlocks(lines, startPattern, endPattern) {
|
|
84
|
+
const blocks = [];
|
|
85
|
+
let gotStart = false;
|
|
86
|
+
let gotEnd = false;
|
|
87
|
+
let block = [];
|
|
88
|
+
for (const line of lines) {
|
|
89
|
+
if (line.startsWith(startPattern)) {
|
|
90
|
+
gotStart = true;
|
|
91
|
+
gotEnd = false;
|
|
92
|
+
}
|
|
93
|
+
if (line.startsWith(endPattern)) {
|
|
94
|
+
gotEnd = true;
|
|
95
|
+
}
|
|
96
|
+
if (gotStart) {
|
|
97
|
+
block.push(line);
|
|
98
|
+
}
|
|
99
|
+
if (gotStart && gotEnd) {
|
|
100
|
+
blocks.push(block);
|
|
101
|
+
block = [];
|
|
102
|
+
gotStart = false;
|
|
103
|
+
gotEnd = false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return blocks;
|
|
107
|
+
}
|
|
108
|
+
execute(options) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
if (options.test && options.recording) {
|
|
111
|
+
const testFile = options.test;
|
|
112
|
+
const recordingFile = options.recording;
|
|
113
|
+
const outputFile = recordingFile.replace(/\.js$/, ".post-processed.js");
|
|
114
|
+
yield this.updateTestFile(testFile, outputFile);
|
|
115
|
+
const outputLines = yield this.postProcessFiles(recordingFile);
|
|
116
|
+
fs.writeFileSync(outputFile, outputLines.join("\n"));
|
|
117
|
+
logger_1.LOGGER.msg(`Writing post-processed file: "${outputFile}".`);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.PostProcessCommand = PostProcessCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionValues } from "commander";
|
|
2
|
-
export declare class ScaffoldCommand {
|
|
3
|
-
execute(options: OptionValues): void;
|
|
4
|
-
}
|
|
1
|
+
import { OptionValues } from "commander";
|
|
2
|
+
export declare class ScaffoldCommand {
|
|
3
|
+
execute(options: OptionValues): void;
|
|
4
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScaffoldCommand = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const logger_1 = require("../../../logger");
|
|
7
|
-
class ScaffoldCommand {
|
|
8
|
-
execute(options) {
|
|
9
|
-
const basePath = path.resolve(__dirname, "..", "..", "..", "..", "resources", "scaffold-templates");
|
|
10
|
-
if (options.e2eTest) {
|
|
11
|
-
const fileName = options.e2eTest;
|
|
12
|
-
const template = path.resolve(basePath, "scaffold-e2e-test.ts");
|
|
13
|
-
const scaffold = fs.readFileSync(template);
|
|
14
|
-
fs.writeFileSync(fileName, scaffold);
|
|
15
|
-
logger_1.LOGGER.msg(`Writing scaffold file: "${fileName}".`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.ScaffoldCommand = ScaffoldCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScaffoldCommand = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const logger_1 = require("../../../logger");
|
|
7
|
+
class ScaffoldCommand {
|
|
8
|
+
execute(options) {
|
|
9
|
+
const basePath = path.resolve(__dirname, "..", "..", "..", "..", "resources", "scaffold-templates");
|
|
10
|
+
if (options.e2eTest) {
|
|
11
|
+
const fileName = options.e2eTest;
|
|
12
|
+
const template = path.resolve(basePath, "scaffold-e2e-test.ts");
|
|
13
|
+
const scaffold = fs.readFileSync(template);
|
|
14
|
+
fs.writeFileSync(fileName, scaffold);
|
|
15
|
+
logger_1.LOGGER.msg(`Writing scaffold file: "${fileName}".`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ScaffoldCommand = ScaffoldCommand;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class TestCommand {
|
|
2
|
-
execute(options: any): void;
|
|
3
|
-
}
|
|
1
|
+
export declare class TestCommand {
|
|
2
|
+
execute(options: any): void;
|
|
3
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TestCommand = void 0;
|
|
4
|
-
const unit_test_runner_1 = require("../../../unit-test-runner");
|
|
5
|
-
const config_1 = require("../../config");
|
|
6
|
-
class TestCommand {
|
|
7
|
-
execute(options) {
|
|
8
|
-
(0, unit_test_runner_1.unitTestRunner)(options, config_1.config);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.TestCommand = TestCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestCommand = void 0;
|
|
4
|
+
const unit_test_runner_1 = require("../../../unit-test-runner");
|
|
5
|
+
const config_1 = require("../../config");
|
|
6
|
+
class TestCommand {
|
|
7
|
+
execute(options) {
|
|
8
|
+
(0, unit_test_runner_1.unitTestRunner)(options, config_1.config);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TestCommand = TestCommand;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class ValidateCommand {
|
|
2
|
-
execute(): void;
|
|
3
|
-
}
|
|
1
|
+
export declare class ValidateCommand {
|
|
2
|
+
execute(): void;
|
|
3
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidateCommand = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const app_validator_1 = require("../../../app/app-validator");
|
|
6
|
-
const logger_1 = require("../../../logger");
|
|
7
|
-
class ValidateCommand {
|
|
8
|
-
execute() {
|
|
9
|
-
try {
|
|
10
|
-
const validator = new app_validator_1.AppValidator();
|
|
11
|
-
validator.validatePackageJson(JSON.parse(fs.readFileSync("package.json").toString()));
|
|
12
|
-
validator.validateContributionsJson(JSON.parse(fs.readFileSync("contributions.json").toString()));
|
|
13
|
-
logger_1.LOGGER.msg("The package.json and contributions.json was successfully validated.");
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
logger_1.LOGGER.error(err.message);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ValidateCommand = ValidateCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateCommand = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const app_validator_1 = require("../../../app/app-validator");
|
|
6
|
+
const logger_1 = require("../../../logger");
|
|
7
|
+
class ValidateCommand {
|
|
8
|
+
execute() {
|
|
9
|
+
try {
|
|
10
|
+
const validator = new app_validator_1.AppValidator();
|
|
11
|
+
validator.validatePackageJson(JSON.parse(fs.readFileSync("package.json").toString()));
|
|
12
|
+
validator.validateContributionsJson(JSON.parse(fs.readFileSync("contributions.json").toString()));
|
|
13
|
+
logger_1.LOGGER.msg("The package.json and contributions.json was successfully validated.");
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
logger_1.LOGGER.error(err.message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ValidateCommand = ValidateCommand;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class VersionCommand {
|
|
2
|
-
execute(mode: any): void;
|
|
3
|
-
}
|
|
1
|
+
export declare class VersionCommand {
|
|
2
|
+
execute(mode: any): void;
|
|
3
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VersionCommand = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const semver_1 = require("semver");
|
|
7
|
-
const logger_1 = require("../../../logger");
|
|
8
|
-
class VersionCommand {
|
|
9
|
-
execute(mode) {
|
|
10
|
-
const app = require(path.resolve("package.json"));
|
|
11
|
-
logger_1.LOGGER.msg("Old version: " + app.version);
|
|
12
|
-
app.version = semver_1.default.inc(app.version, mode);
|
|
13
|
-
logger_1.LOGGER.msg("New version: " + app.version);
|
|
14
|
-
fs.writeFileSync("package.json", JSON.stringify(app, null, 2));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.VersionCommand = VersionCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VersionCommand = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const semver_1 = require("semver");
|
|
7
|
+
const logger_1 = require("../../../logger");
|
|
8
|
+
class VersionCommand {
|
|
9
|
+
execute(mode) {
|
|
10
|
+
const app = require(path.resolve("package.json"));
|
|
11
|
+
logger_1.LOGGER.msg("Old version: " + app.version);
|
|
12
|
+
app.version = semver_1.default.inc(app.version, mode);
|
|
13
|
+
logger_1.LOGGER.msg("New version: " + app.version);
|
|
14
|
+
fs.writeFileSync("package.json", JSON.stringify(app, null, 2));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.VersionCommand = VersionCommand;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class WatchCommand {
|
|
2
|
-
execute(disableBrowserLaunch?: boolean, callback?: any): Promise<void>;
|
|
3
|
-
}
|
|
1
|
+
export declare class WatchCommand {
|
|
2
|
+
execute(disableBrowserLaunch?: boolean, callback?: any): Promise<void>;
|
|
3
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.WatchCommand = void 0;
|
|
13
|
-
const fs = require("fs");
|
|
14
|
-
const webpack = require("webpack");
|
|
15
|
-
const webpackDevServer = require("webpack-dev-server");
|
|
16
|
-
const webpack_app_config_1 = require("../../../webpack-app-config");
|
|
17
|
-
const config_1 = require("../../config");
|
|
18
|
-
const download_1 = require("../scifeon/download");
|
|
19
|
-
class WatchCommand {
|
|
20
|
-
execute(disableBrowserLaunch = false, callback = null) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (!fs.existsSync("./runtime")) {
|
|
23
|
-
yield new download_1.DownloadCommand().execute();
|
|
24
|
-
}
|
|
25
|
-
const webpackConfig = (0, webpack_app_config_1.webpackAppConfig)({ watch: true }, config_1.config);
|
|
26
|
-
webpackConfig.output.publicPath = "http://localhost:9090" + webpackConfig.output.publicPath;
|
|
27
|
-
webpackConfig.entry.app.unshift(require.resolve("webpack-dev-server/client") + "?http://localhost:9090", require.resolve("webpack/hot/dev-server"));
|
|
28
|
-
const compiler = webpack(webpackConfig);
|
|
29
|
-
const server = new webpackDevServer(compiler, {
|
|
30
|
-
headers: {
|
|
31
|
-
"Access-Control-Allow-Origin": "http://localhost:5000",
|
|
32
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
33
|
-
"Access-Control-Allow-Headers": "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, x-ms-request-id,x-ms-request-root-id",
|
|
34
|
-
"Access-Control-Allow-Credentials": "true",
|
|
35
|
-
},
|
|
36
|
-
inline: true,
|
|
37
|
-
hot: true,
|
|
38
|
-
publicPath: webpackConfig.output.publicPath,
|
|
39
|
-
stats: {
|
|
40
|
-
colors: true,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
server.listen(9090);
|
|
44
|
-
callback && callback(disableBrowserLaunch);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.WatchCommand = WatchCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WatchCommand = void 0;
|
|
13
|
+
const fs = require("fs");
|
|
14
|
+
const webpack = require("webpack");
|
|
15
|
+
const webpackDevServer = require("webpack-dev-server");
|
|
16
|
+
const webpack_app_config_1 = require("../../../webpack-app-config");
|
|
17
|
+
const config_1 = require("../../config");
|
|
18
|
+
const download_1 = require("../scifeon/download");
|
|
19
|
+
class WatchCommand {
|
|
20
|
+
execute(disableBrowserLaunch = false, callback = null) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
if (!fs.existsSync("./runtime")) {
|
|
23
|
+
yield new download_1.DownloadCommand().execute();
|
|
24
|
+
}
|
|
25
|
+
const webpackConfig = (0, webpack_app_config_1.webpackAppConfig)({ watch: true }, config_1.config);
|
|
26
|
+
webpackConfig.output.publicPath = "http://localhost:9090" + webpackConfig.output.publicPath;
|
|
27
|
+
webpackConfig.entry.app.unshift(require.resolve("webpack-dev-server/client") + "?http://localhost:9090", require.resolve("webpack/hot/dev-server"));
|
|
28
|
+
const compiler = webpack(webpackConfig);
|
|
29
|
+
const server = new webpackDevServer(compiler, {
|
|
30
|
+
headers: {
|
|
31
|
+
"Access-Control-Allow-Origin": "http://localhost:5000",
|
|
32
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
33
|
+
"Access-Control-Allow-Headers": "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, Authorization, x-ms-request-id,x-ms-request-root-id",
|
|
34
|
+
"Access-Control-Allow-Credentials": "true",
|
|
35
|
+
},
|
|
36
|
+
inline: true,
|
|
37
|
+
hot: true,
|
|
38
|
+
publicPath: webpackConfig.output.publicPath,
|
|
39
|
+
stats: {
|
|
40
|
+
colors: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
server.listen(9090);
|
|
44
|
+
callback && callback(disableBrowserLaunch);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.WatchCommand = WatchCommand;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class DownloadCommand {
|
|
2
|
-
execute(rootPath?: string): Promise<void>;
|
|
3
|
-
}
|
|
1
|
+
export declare class DownloadCommand {
|
|
2
|
+
execute(rootPath?: string): Promise<void>;
|
|
3
|
+
}
|