@atlantjs/backend 11.0.14 ā 11.0.15
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/package.json +10 -3
- package/setup/index.js +43 -26
- package/setup/server/server.d.ts +0 -1
- package/setup/server/server.js +1 -22
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlantjs/backend",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.15",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"src": "src",
|
|
11
11
|
"test": "tests"
|
|
12
12
|
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "22.19.x"
|
|
15
|
+
},
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
|
15
18
|
"url": "git+ssh://git@github.com/movingapp/atlantjs-lib-backend.git"
|
|
@@ -29,10 +32,12 @@
|
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
34
|
"@atlantjs/arch": "15.4.2",
|
|
32
|
-
"@atlantjs/database": "2.1.
|
|
35
|
+
"@atlantjs/database": "2.1.9",
|
|
33
36
|
"@atlantjs/parchment": "1.0.28",
|
|
34
37
|
"@aws-sdk/client-ses": "3.1009.0",
|
|
38
|
+
"@types/signale": "^1.4.7",
|
|
35
39
|
"body-parser": "1.20.2",
|
|
40
|
+
"cfonts": "^3.3.1",
|
|
36
41
|
"class-transformer": "0.5.1",
|
|
37
42
|
"class-validator": "0.14.1",
|
|
38
43
|
"cookie-parser": "1.4.7",
|
|
@@ -41,12 +46,14 @@
|
|
|
41
46
|
"express": "4.19.2",
|
|
42
47
|
"helmet": "7.1.0",
|
|
43
48
|
"inversify": "6.0.2",
|
|
49
|
+
"listr2": "^10.2.1",
|
|
44
50
|
"lodash": "4.17.21",
|
|
45
51
|
"module-alias": "2.2.3",
|
|
46
52
|
"reflect-metadata": "0.2.2",
|
|
47
53
|
"resend": "6.9.3",
|
|
48
54
|
"routing-controllers": "0.10.4",
|
|
49
|
-
"routing-controllers-openapi": "4.0.0"
|
|
55
|
+
"routing-controllers-openapi": "4.0.0",
|
|
56
|
+
"signale": "^1.4.0"
|
|
50
57
|
},
|
|
51
58
|
"devDependencies": {
|
|
52
59
|
"@biomejs/biome": "1.9.4",
|
package/setup/index.js
CHANGED
|
@@ -1,27 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.initialize = initialize;
|
|
4
7
|
exports.synthesizePaths = synthesizePaths;
|
|
5
8
|
const arch_1 = require("@atlantjs/arch");
|
|
9
|
+
const cfonts_1 = __importDefault(require("cfonts"));
|
|
10
|
+
const listr2_1 = require("listr2");
|
|
11
|
+
const signale_1 = __importDefault(require("signale"));
|
|
6
12
|
const verses_1 = require("../backend/stitch/verses");
|
|
7
13
|
const dependency_injections_1 = require("./dependency-injections");
|
|
8
14
|
const server_1 = require("./server/server");
|
|
9
15
|
function initialize(props) {
|
|
16
|
+
cfonts_1.default.say("ATLANTJS", {
|
|
17
|
+
font: "chrome",
|
|
18
|
+
align: "left",
|
|
19
|
+
colors: ["#f00", "#f00", "#f00"],
|
|
20
|
+
letterSpacing: 1,
|
|
21
|
+
lineHeight: 1,
|
|
22
|
+
maxLength: 0,
|
|
23
|
+
});
|
|
24
|
+
const tasks = new listr2_1.Listr([
|
|
25
|
+
{
|
|
26
|
+
title: "Loading modules...",
|
|
27
|
+
task: (ctx, task) => {
|
|
28
|
+
for (const module of verses_1.LOAD_MODULES) {
|
|
29
|
+
require(`#/modules/${module}`);
|
|
30
|
+
}
|
|
31
|
+
task.title = `Modules loaded: ${verses_1.LOAD_MODULES.join(", ")}`;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Starting server...",
|
|
36
|
+
task: (ctx, task) => {
|
|
37
|
+
(0, dependency_injections_1.startContainer)();
|
|
38
|
+
if (arch_1._.isNotUndefined(props.databases)) {
|
|
39
|
+
Promise.all([
|
|
40
|
+
props.databases.map((database) => {
|
|
41
|
+
dependency_injections_1.diContainer.bind(database.token).toConstantValue(database.target);
|
|
42
|
+
database.target.connect(new database.configs());
|
|
43
|
+
}),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
server_1.Server.initialize();
|
|
47
|
+
task.title = `Server started on port ${verses_1.APP_PORT}`;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
]);
|
|
10
51
|
try {
|
|
11
|
-
|
|
12
|
-
(0, dependency_injections_1.startContainer)();
|
|
13
|
-
if (arch_1._.isNotUndefined(props.databases)) {
|
|
14
|
-
Promise.all([
|
|
15
|
-
props.databases.map((database) => {
|
|
16
|
-
dependency_injections_1.diContainer.bind(database.token).toConstantValue(database.target);
|
|
17
|
-
database.target.connect(new database.configs());
|
|
18
|
-
}),
|
|
19
|
-
]);
|
|
20
|
-
}
|
|
21
|
-
server_1.Server.initialize();
|
|
52
|
+
tasks.run();
|
|
22
53
|
}
|
|
23
54
|
catch (error) {
|
|
24
|
-
|
|
55
|
+
signale_1.default.error(`${error}`);
|
|
25
56
|
}
|
|
26
57
|
}
|
|
27
58
|
function synthesizePaths() {
|
|
@@ -30,17 +61,3 @@ function synthesizePaths() {
|
|
|
30
61
|
moduleAlias.addAlias("#", path.join(__dirname, "../../../../src"));
|
|
31
62
|
moduleAlias.addAlias("!tests", path.join(__dirname, "../../../../tests"));
|
|
32
63
|
}
|
|
33
|
-
function loadModules(modules = verses_1.LOAD_MODULES) {
|
|
34
|
-
let processedModules = modules;
|
|
35
|
-
if (typeof modules === "string") {
|
|
36
|
-
processedModules = modules
|
|
37
|
-
.split(",")
|
|
38
|
-
.map((x) => x.trim())
|
|
39
|
-
.filter((x) => x.isFilled());
|
|
40
|
-
}
|
|
41
|
-
console.log("\nš¦ Loading modules...");
|
|
42
|
-
for (const module of processedModules) {
|
|
43
|
-
require(`#/modules/${module}`);
|
|
44
|
-
}
|
|
45
|
-
console.log("āļø Load modules", processedModules);
|
|
46
|
-
}
|
package/setup/server/server.d.ts
CHANGED
package/setup/server/server.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Server = void 0;
|
|
7
|
-
const arch_1 = require("@atlantjs/arch");
|
|
8
7
|
const cookie_parser_1 = __importDefault(require("cookie-parser"));
|
|
9
8
|
const express_1 = __importDefault(require("express"));
|
|
10
9
|
const helmet_1 = __importDefault(require("helmet"));
|
|
@@ -13,14 +12,6 @@ const verses_1 = require("../../backend/stitch/verses");
|
|
|
13
12
|
const body_parser_theta_1 = require("./body-parser-theta");
|
|
14
13
|
const cors_theta_1 = require("./cors-theta");
|
|
15
14
|
const default_error_handler_theta_1 = require("./default-error-handler-theta");
|
|
16
|
-
var LogMessage;
|
|
17
|
-
(function (LogMessage) {
|
|
18
|
-
LogMessage["$start_server"] = "\n\uD83D\uDDA5\uFE0F Starting server...";
|
|
19
|
-
LogMessage["$started_server"] = "\u2714\uFE0F Server running on port ";
|
|
20
|
-
LogMessage["$break_line"] = "\n";
|
|
21
|
-
LogMessage["$line"] = "========================================";
|
|
22
|
-
LogMessage["$development_message"] = "\uD83D\uDE80 You are in the development environment\n Ready to code!";
|
|
23
|
-
})(LogMessage || (LogMessage = {}));
|
|
24
15
|
class Server {
|
|
25
16
|
static initialize() {
|
|
26
17
|
Server.instance.disable("x-powered-by");
|
|
@@ -31,19 +22,7 @@ class Server {
|
|
|
31
22
|
Server.instance.use(body_parser_theta_1.BodyParserTheta.create());
|
|
32
23
|
Server.instance.use(default_error_handler_theta_1.DefaultErrorHandlerTheta.create());
|
|
33
24
|
(0, routing_controllers_1.useExpressServer)(Server.instance, Server.routingOptions);
|
|
34
|
-
|
|
35
|
-
Server.instance.listen(verses_1.APP_PORT, () => {
|
|
36
|
-
console.info(LogMessage.$started_server + verses_1.APP_PORT);
|
|
37
|
-
if (arch_1._.isEqual(verses_1.ENVIRONMENT, arch_1.EnvironmentPoint.development)) {
|
|
38
|
-
Server.logFooterDevelopmentMessage();
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
static logFooterDevelopmentMessage() {
|
|
43
|
-
console.info(LogMessage.$break_line);
|
|
44
|
-
console.info(LogMessage.$line);
|
|
45
|
-
console.info(LogMessage.$development_message);
|
|
46
|
-
console.info(LogMessage.$line);
|
|
25
|
+
Server.instance.listen(verses_1.APP_PORT);
|
|
47
26
|
}
|
|
48
27
|
}
|
|
49
28
|
exports.Server = Server;
|