testeranto 0.79.32 → 0.79.34
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/TaskMan1.Dockerfile +1 -0
- package/dist/common/Project.js +1 -14
- package/dist/common/TaskManBackEnd.js +95 -91
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +1 -14
- package/dist/module/TaskManBackEnd.js +95 -91
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/TaskManBackEnd.mjs +78 -59
- package/dist/types/TaskManBackEnd.d.ts +3 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Project.ts +12 -25
- package/src/TaskManBackEnd.ts +133 -112
package/dist/module/Project.js
CHANGED
|
@@ -54,6 +54,7 @@ export class ITProject {
|
|
|
54
54
|
constructor(config) {
|
|
55
55
|
this.mode = `up`;
|
|
56
56
|
this.config = config;
|
|
57
|
+
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
57
58
|
Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
58
59
|
const sourceFileSplit = sourceFilePath.split("/");
|
|
59
60
|
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
@@ -96,20 +97,6 @@ export class ITProject {
|
|
|
96
97
|
});
|
|
97
98
|
});
|
|
98
99
|
Promise.all([
|
|
99
|
-
fs.promises.writeFile(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2)),
|
|
100
|
-
// esbuild
|
|
101
|
-
// .context(esbuildFeaturesConfiger(config))
|
|
102
|
-
// .then(async (featuresContext) => {
|
|
103
|
-
// if (mode == "DEV") {
|
|
104
|
-
// await featuresContext.watch();
|
|
105
|
-
// onFeaturesDone();
|
|
106
|
-
// } else {
|
|
107
|
-
// featuresContext.rebuild().then((v) => {
|
|
108
|
-
// onFeaturesDone();
|
|
109
|
-
// });
|
|
110
|
-
// }
|
|
111
|
-
// return featuresContext;
|
|
112
|
-
// }),
|
|
113
100
|
esbuild
|
|
114
101
|
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
115
102
|
.then(async (nodeContext) => {
|
|
@@ -14,7 +14,6 @@ import { ganttSchema, kanbanSchema, userSchema, featuresSchema, RoomSchema, Hudd
|
|
|
14
14
|
// },
|
|
15
15
|
// ],
|
|
16
16
|
// });
|
|
17
|
-
const app = express();
|
|
18
17
|
const port = 3000;
|
|
19
18
|
function findTextFiles(dir, fileList = []) {
|
|
20
19
|
const files = fs.readdirSync(dir);
|
|
@@ -55,46 +54,50 @@ function listToTree(fileList) {
|
|
|
55
54
|
}
|
|
56
55
|
return root.children;
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
57
|
+
export default (config) => {
|
|
58
|
+
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
59
|
+
const app = express();
|
|
60
|
+
new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
61
|
+
.connect()
|
|
62
|
+
.then(async (conn) => {
|
|
63
|
+
const db = conn.db("taskman");
|
|
64
|
+
await mongoose.connect(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`);
|
|
65
|
+
const usersModel = mongoose.model("User", userSchema);
|
|
66
|
+
const kanbanModel = mongoose.model("Kanban", kanbanSchema);
|
|
67
|
+
const ganttModel = mongoose.model("Gantt", ganttSchema);
|
|
68
|
+
const featuresModel = mongoose.model("Features", featuresSchema);
|
|
69
|
+
// const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
|
|
70
|
+
// const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
|
|
71
|
+
const MessagesModel = mongoose.model("Messages", chatCatMessageSchema);
|
|
72
|
+
const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
|
|
73
|
+
const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
|
|
74
|
+
const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
|
|
75
|
+
app.get("/TaskManFrontend.js", (req, res) => {
|
|
76
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
|
|
77
|
+
});
|
|
78
|
+
app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
79
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
|
|
80
|
+
});
|
|
81
|
+
// app.get(`/preMergeCheck`, async (req, res) => {
|
|
82
|
+
// const commit = req.params["commit"];
|
|
83
|
+
// // res.json(await keyedModels[key].find({}));
|
|
84
|
+
// });
|
|
85
|
+
// app.get("/TaskManFrontend.js", (req, res) => {
|
|
86
|
+
// res.sendFile(
|
|
87
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
|
|
88
|
+
// );
|
|
89
|
+
// });
|
|
90
|
+
// app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
91
|
+
// res.sendFile(
|
|
92
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
|
|
93
|
+
// );
|
|
94
|
+
// });
|
|
95
|
+
app.get("/testeranto.json", (req, res) => {
|
|
96
|
+
res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
97
|
+
// res.json(config);
|
|
98
|
+
});
|
|
99
|
+
app.get("/", (req, res) => {
|
|
100
|
+
res.send(`<!DOCTYPE html>
|
|
98
101
|
<html lang="en">
|
|
99
102
|
|
|
100
103
|
<head>
|
|
@@ -112,58 +115,59 @@ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
|
112
115
|
<body><div id="root">react is loading</div></body>
|
|
113
116
|
|
|
114
117
|
</html>`);
|
|
115
|
-
});
|
|
116
|
-
app.listen(port, () => {
|
|
117
|
-
console.log(`Example app listening on port ${port}`);
|
|
118
|
-
});
|
|
119
|
-
///////////////////////////////////////////////
|
|
120
|
-
const keyedModels = {
|
|
121
|
-
users: usersModel,
|
|
122
|
-
kanbans: kanbanModel,
|
|
123
|
-
features: featuresModel,
|
|
124
|
-
gantts: ganttModel,
|
|
125
|
-
rooms: roomsModel,
|
|
126
|
-
huddles: huddleModdle,
|
|
127
|
-
messages: MessagesModel,
|
|
128
|
-
};
|
|
129
|
-
Object.keys(keyedModels).forEach((key) => {
|
|
130
|
-
app.get(`/${key}.json`, async (req, res) => {
|
|
131
|
-
console.log("GET", key, keyedModels[key]);
|
|
132
|
-
res.json(await keyedModels[key].find({}));
|
|
133
118
|
});
|
|
134
|
-
app.
|
|
135
|
-
|
|
136
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
137
|
-
.toArray());
|
|
119
|
+
app.listen(port, () => {
|
|
120
|
+
console.log(`Example app listening on port ${port}`);
|
|
138
121
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
122
|
+
///////////////////////////////////////////////
|
|
123
|
+
const keyedModels = {
|
|
124
|
+
users: usersModel,
|
|
125
|
+
kanbans: kanbanModel,
|
|
126
|
+
features: featuresModel,
|
|
127
|
+
gantts: ganttModel,
|
|
128
|
+
rooms: roomsModel,
|
|
129
|
+
huddles: huddleModdle,
|
|
130
|
+
messages: MessagesModel,
|
|
131
|
+
};
|
|
132
|
+
Object.keys(keyedModels).forEach((key) => {
|
|
133
|
+
app.get(`/${key}.json`, async (req, res) => {
|
|
134
|
+
console.log("GET", key, keyedModels[key]);
|
|
135
|
+
res.json(await keyedModels[key].find({}));
|
|
136
|
+
});
|
|
137
|
+
app.get(`/${key}/:id.json`, async (req, res) => {
|
|
138
|
+
res.json(await keyedModels[key]
|
|
139
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
140
|
+
.toArray());
|
|
141
|
+
});
|
|
142
|
+
app.post(`/${key}/:id.json`, async (req, res) => {
|
|
143
|
+
res.json(await keyedModels[key]
|
|
144
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
145
|
+
.toArray());
|
|
146
|
+
});
|
|
147
|
+
app.post(`/${key}.json`, async (req, res) => {
|
|
148
|
+
res.json(await keyedModels[key]
|
|
149
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
150
|
+
.toArray());
|
|
151
|
+
});
|
|
143
152
|
});
|
|
144
|
-
app.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
app.use("/docs", express.static(path.join(process.cwd(), "docs")));
|
|
154
|
+
app.get("/docGal/fs.json", (req, res) => {
|
|
155
|
+
const directoryPath = "./"; // Replace with the desired directory path
|
|
156
|
+
// const textFiles = findTextFiles(directoryPath);
|
|
157
|
+
res.json(listToTree(findTextFiles(directoryPath)));
|
|
158
|
+
// res.send(`<!DOCTYPE html>
|
|
159
|
+
// <html lang="en">
|
|
160
|
+
// <head>
|
|
161
|
+
// <meta name="description" content="Webpage description goes here" />
|
|
162
|
+
// <meta charset="utf-8" />
|
|
163
|
+
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
164
|
+
// <meta name="author" content="" />
|
|
165
|
+
// <title>TaskMan</title>
|
|
166
|
+
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
167
|
+
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
168
|
+
// </head>
|
|
169
|
+
// <body><div id="root">react is loading</div></body>
|
|
170
|
+
// </html>`);
|
|
148
171
|
});
|
|
149
172
|
});
|
|
150
|
-
|
|
151
|
-
app.get("/docGal/fs.json", (req, res) => {
|
|
152
|
-
const directoryPath = "./"; // Replace with the desired directory path
|
|
153
|
-
// const textFiles = findTextFiles(directoryPath);
|
|
154
|
-
res.json(listToTree(findTextFiles(directoryPath)));
|
|
155
|
-
// res.send(`<!DOCTYPE html>
|
|
156
|
-
// <html lang="en">
|
|
157
|
-
// <head>
|
|
158
|
-
// <meta name="description" content="Webpage description goes here" />
|
|
159
|
-
// <meta charset="utf-8" />
|
|
160
|
-
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
161
|
-
// <meta name="author" content="" />
|
|
162
|
-
// <title>TaskMan</title>
|
|
163
|
-
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
164
|
-
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
165
|
-
// </head>
|
|
166
|
-
// <body><div id="root">react is loading</div></body>
|
|
167
|
-
// </html>`);
|
|
168
|
-
});
|
|
169
|
-
});
|
|
173
|
+
};
|