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