@flink-app/flink 0.4.2 → 0.4.4
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/cli/build.ts +18 -22
- package/cli/run.ts +12 -2
- package/dist/cli/build.js +1 -5
- package/dist/cli/run.js +8 -1
- package/package.json +2 -2
package/cli/build.ts
CHANGED
|
@@ -3,10 +3,10 @@ import TypeScriptCompiler from "../src/TypeScriptCompiler";
|
|
|
3
3
|
import { getOption } from "./cli-utils";
|
|
4
4
|
|
|
5
5
|
module.exports = async function run(args: string[]) {
|
|
6
|
-
|
|
6
|
+
const startTime = Date.now();
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
if (args.includes("--help")) {
|
|
9
|
+
console.log(`
|
|
10
10
|
Description
|
|
11
11
|
Builds the application.
|
|
12
12
|
Will generate intermediates files in .flink and compile/transpile
|
|
@@ -22,31 +22,27 @@ module.exports = async function run(args: string[]) {
|
|
|
22
22
|
--help Displays this message
|
|
23
23
|
`);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
let dir = "./";
|
|
29
|
+
if (args[0] && !args[0].startsWith("--")) {
|
|
30
|
+
dir = args[0];
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const exclude = getOption(args, "exclude", "/spec") as string;
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
await TypeScriptCompiler.clean(dir);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
const compiler = new TypeScriptCompiler(dir);
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
if (!compiler.getPreEmitDiagnostics()) {
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
compiler.parseRepos(),
|
|
45
|
-
compiler.parseHandlers(exclude.split(",")),
|
|
46
|
-
compiler.generateStartScript(),
|
|
47
|
-
]);
|
|
43
|
+
await Promise.all([compiler.parseRepos(), compiler.parseHandlers(exclude.split(",")), compiler.parseJobs(), compiler.generateStartScript()]);
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
console.log(`Compilation done, took ${Date.now() - startTime}ms`);
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
compiler.emit();
|
|
52
48
|
};
|
package/cli/run.ts
CHANGED
|
@@ -16,8 +16,9 @@ module.exports = async function run(args: string[]) {
|
|
|
16
16
|
If no directory is provided, the current directory will be used.
|
|
17
17
|
|
|
18
18
|
Options
|
|
19
|
-
--entry
|
|
20
|
-
--help
|
|
19
|
+
--entry Entry script for app, default "/src/index.ts"
|
|
20
|
+
--help Displays this message
|
|
21
|
+
--precompiled Will run a precompiled app, default false
|
|
21
22
|
`);
|
|
22
23
|
|
|
23
24
|
process.exit(0);
|
|
@@ -34,6 +35,15 @@ module.exports = async function run(args: string[]) {
|
|
|
34
35
|
entry = entry.startsWith("/") ? entry : "/" + entry;
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
if (args.includes("--precompiled")) {
|
|
39
|
+
if (args.includes("--entry")) {
|
|
40
|
+
console.warn("WARNING: --entry is ignored when using --precompiled");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
require("child_process").fork(dir + "/dist/.flink/start.js");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
await TypeScriptCompiler.clean(dir);
|
|
38
48
|
|
|
39
49
|
const compiler = new TypeScriptCompiler(dir);
|
package/dist/cli/build.js
CHANGED
|
@@ -65,11 +65,7 @@ module.exports = function run(args) {
|
|
|
65
65
|
if (!compiler.getPreEmitDiagnostics()) {
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
|
-
return [4 /*yield*/, Promise.all([
|
|
69
|
-
compiler.parseRepos(),
|
|
70
|
-
compiler.parseHandlers(exclude.split(",")),
|
|
71
|
-
compiler.generateStartScript(),
|
|
72
|
-
])];
|
|
68
|
+
return [4 /*yield*/, Promise.all([compiler.parseRepos(), compiler.parseHandlers(exclude.split(",")), compiler.parseJobs(), compiler.generateStartScript()])];
|
|
73
69
|
case 2:
|
|
74
70
|
_a.sent();
|
|
75
71
|
console.log("Compilation done, took ".concat(Date.now() - startTime, "ms"));
|
package/dist/cli/run.js
CHANGED
|
@@ -49,7 +49,7 @@ module.exports = function run(args) {
|
|
|
49
49
|
case 0:
|
|
50
50
|
startTime = Date.now();
|
|
51
51
|
if (args.includes("--help")) {
|
|
52
|
-
console.log("\n Description\n Compiles and starts the application.\n\n Usage\n $ flink run <dir>\n\n <dir> represents the directory of the Flink application.\n If no directory is provided, the current directory will be used.\n \n Options \n --entry
|
|
52
|
+
console.log("\n Description\n Compiles and starts the application.\n\n Usage\n $ flink run <dir>\n\n <dir> represents the directory of the Flink application.\n If no directory is provided, the current directory will be used.\n \n Options \n --entry Entry script for app, default \"/src/index.ts\"\n --help Displays this message\n --precompiled Will run a precompiled app, default false\n ");
|
|
53
53
|
process.exit(0);
|
|
54
54
|
}
|
|
55
55
|
dir = "./";
|
|
@@ -61,6 +61,13 @@ module.exports = function run(args) {
|
|
|
61
61
|
entry = args[args.indexOf("--entry") + 1];
|
|
62
62
|
entry = entry.startsWith("/") ? entry : "/" + entry;
|
|
63
63
|
}
|
|
64
|
+
if (args.includes("--precompiled")) {
|
|
65
|
+
if (args.includes("--entry")) {
|
|
66
|
+
console.warn("WARNING: --entry is ignored when using --precompiled");
|
|
67
|
+
}
|
|
68
|
+
require("child_process").fork(dir + "/dist/.flink/start.js");
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
64
71
|
return [4 /*yield*/, TypeScriptCompiler_1.default.clean(dir)];
|
|
65
72
|
case 1:
|
|
66
73
|
_a.sent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/flink",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Typescript only framework for creating REST-like APIs on top of Express and mongodb",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"rimraf": "^3.0.2",
|
|
66
66
|
"ts-node": "^9.1.1"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "f7b39bc69a69b51311352b1368093bc4c5d05a39"
|
|
69
69
|
}
|