testeranto 0.79.32 → 0.79.33

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.
@@ -96,20 +96,6 @@ export class ITProject {
96
96
  });
97
97
  });
98
98
  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
99
  esbuild
114
100
  .context(esbuildNodeConfiger(config, nodeEntryPoints))
115
101
  .then(async (nodeContext) => {
@@ -55,46 +55,47 @@ function listToTree(fileList) {
55
55
  }
56
56
  return root.children;
57
57
  }
58
- new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
59
- .connect()
60
- .then(async (conn) => {
61
- const db = conn.db("taskman");
62
- await mongoose.connect(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`);
63
- const usersModel = mongoose.model("User", userSchema);
64
- const kanbanModel = mongoose.model("Kanban", kanbanSchema);
65
- const ganttModel = mongoose.model("Gantt", ganttSchema);
66
- const featuresModel = mongoose.model("Features", featuresSchema);
67
- // const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
68
- // const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
69
- const MessagesModel = mongoose.model("Messages", chatCatMessageSchema);
70
- const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
71
- const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
72
- const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
73
- app.get("/TaskManFrontend.js", (req, res) => {
74
- res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
75
- });
76
- app.get("/TaskManFrontEnd.css", (req, res) => {
77
- res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
78
- });
79
- // app.get(`/preMergeCheck`, async (req, res) => {
80
- // const commit = req.params["commit"];
81
- // // res.json(await keyedModels[key].find({}));
82
- // });
83
- // app.get("/TaskManFrontend.js", (req, res) => {
84
- // res.sendFile(
85
- // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
86
- // );
87
- // });
88
- // app.get("/TaskManFrontEnd.css", (req, res) => {
89
- // res.sendFile(
90
- // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
91
- // );
92
- // });
93
- app.get("/testeranto.json", (req, res) => {
94
- res.sendFile(`${process.cwd()}/docs/testeranto.json`);
95
- });
96
- app.get("/", (req, res) => {
97
- res.send(`<!DOCTYPE html>
58
+ export default () => {
59
+ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
60
+ .connect()
61
+ .then(async (conn) => {
62
+ const db = conn.db("taskman");
63
+ await mongoose.connect(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`);
64
+ const usersModel = mongoose.model("User", userSchema);
65
+ const kanbanModel = mongoose.model("Kanban", kanbanSchema);
66
+ const ganttModel = mongoose.model("Gantt", ganttSchema);
67
+ const featuresModel = mongoose.model("Features", featuresSchema);
68
+ // const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
69
+ // const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
70
+ const MessagesModel = mongoose.model("Messages", chatCatMessageSchema);
71
+ const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
72
+ const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
73
+ const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
74
+ app.get("/TaskManFrontend.js", (req, res) => {
75
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
76
+ });
77
+ app.get("/TaskManFrontEnd.css", (req, res) => {
78
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
79
+ });
80
+ // app.get(`/preMergeCheck`, async (req, res) => {
81
+ // const commit = req.params["commit"];
82
+ // // res.json(await keyedModels[key].find({}));
83
+ // });
84
+ // app.get("/TaskManFrontend.js", (req, res) => {
85
+ // res.sendFile(
86
+ // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
87
+ // );
88
+ // });
89
+ // app.get("/TaskManFrontEnd.css", (req, res) => {
90
+ // res.sendFile(
91
+ // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
92
+ // );
93
+ // });
94
+ app.get("/testeranto.json", (req, res) => {
95
+ res.sendFile(`${process.cwd()}/docs/testeranto.json`);
96
+ });
97
+ app.get("/", (req, res) => {
98
+ res.send(`<!DOCTYPE html>
98
99
  <html lang="en">
99
100
 
100
101
  <head>
@@ -112,58 +113,59 @@ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
112
113
  <body><div id="root">react is loading</div></body>
113
114
 
114
115
  </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
116
  });
134
- app.get(`/${key}/:id.json`, async (req, res) => {
135
- res.json(await keyedModels[key]
136
- .find({ id: { $eq: req.params["id"] } })
137
- .toArray());
117
+ app.listen(port, () => {
118
+ console.log(`Example app listening on port ${port}`);
138
119
  });
139
- app.post(`/${key}/:id.json`, async (req, res) => {
140
- res.json(await keyedModels[key]
141
- .find({ id: { $eq: req.params["id"] } })
142
- .toArray());
120
+ ///////////////////////////////////////////////
121
+ const keyedModels = {
122
+ users: usersModel,
123
+ kanbans: kanbanModel,
124
+ features: featuresModel,
125
+ gantts: ganttModel,
126
+ rooms: roomsModel,
127
+ huddles: huddleModdle,
128
+ messages: MessagesModel,
129
+ };
130
+ Object.keys(keyedModels).forEach((key) => {
131
+ app.get(`/${key}.json`, async (req, res) => {
132
+ console.log("GET", key, keyedModels[key]);
133
+ res.json(await keyedModels[key].find({}));
134
+ });
135
+ app.get(`/${key}/:id.json`, async (req, res) => {
136
+ res.json(await keyedModels[key]
137
+ .find({ id: { $eq: req.params["id"] } })
138
+ .toArray());
139
+ });
140
+ app.post(`/${key}/:id.json`, async (req, res) => {
141
+ res.json(await keyedModels[key]
142
+ .find({ id: { $eq: req.params["id"] } })
143
+ .toArray());
144
+ });
145
+ app.post(`/${key}.json`, async (req, res) => {
146
+ res.json(await keyedModels[key]
147
+ .find({ id: { $eq: req.params["id"] } })
148
+ .toArray());
149
+ });
143
150
  });
144
- app.post(`/${key}.json`, async (req, res) => {
145
- res.json(await keyedModels[key]
146
- .find({ id: { $eq: req.params["id"] } })
147
- .toArray());
151
+ app.use("/docs", express.static(path.join(process.cwd(), "docs")));
152
+ app.get("/docGal/fs.json", (req, res) => {
153
+ const directoryPath = "./"; // Replace with the desired directory path
154
+ // const textFiles = findTextFiles(directoryPath);
155
+ res.json(listToTree(findTextFiles(directoryPath)));
156
+ // res.send(`<!DOCTYPE html>
157
+ // <html lang="en">
158
+ // <head>
159
+ // <meta name="description" content="Webpage description goes here" />
160
+ // <meta charset="utf-8" />
161
+ // <meta name="viewport" content="width=device-width, initial-scale=1" />
162
+ // <meta name="author" content="" />
163
+ // <title>TaskMan</title>
164
+ // <link rel="stylesheet" href="/TaskManFrontEnd.css" />
165
+ // <script type="module" src="/TaskManFrontEnd.js"></script>
166
+ // </head>
167
+ // <body><div id="root">react is loading</div></body>
168
+ // </html>`);
148
169
  });
149
170
  });
150
- app.use("/docs", express.static(path.join(process.cwd(), "docs")));
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
- });
171
+ };