testeranto 0.79.31 → 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.
- package/TaskMan1.Dockerfile +4 -3
- package/dist/common/Project.js +0 -14
- package/dist/common/TaskManBackEnd.js +92 -90
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +0 -14
- package/dist/module/TaskManBackEnd.js +92 -90
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/TaskManBackEnd.mjs +67 -59
- package/dist/types/TaskManBackEnd.d.ts +2 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Project.ts +0 -25
- package/src/TaskManBackEnd.ts +116 -111
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testeranto",
|
|
3
3
|
"description": "teeny tiny tightly-typed typescript tests",
|
|
4
|
-
"version": "0.79.
|
|
4
|
+
"version": "0.79.33",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
"import": "./src/Node.ts",
|
|
134
134
|
"require": "./src/Node.ts"
|
|
135
135
|
},
|
|
136
|
-
"./src/
|
|
137
|
-
"import": "./dist/module/
|
|
138
|
-
"require": "./dist/common/
|
|
136
|
+
"./src/TaskManBackEnd": {
|
|
137
|
+
"import": "./dist/module/TaskManBackEnd.js",
|
|
138
|
+
"require": "./dist/common/TaskManBackEnd.js"
|
|
139
139
|
},
|
|
140
140
|
"./src/preload": {
|
|
141
141
|
"import": "./dist/module/preload.js",
|
|
@@ -179,8 +179,7 @@
|
|
|
179
179
|
"dev": "cp ./src/cjs-shim.js ./dist/cjs-shim.js && tsc -p tsconfig.module.json --watch & tsc -p tsconfig.common.json --watch & tsc -p tsconfig.types.json --watch & yarn esbuild src/TaskManFrontEnd.tsx --outfile=dist/prebuild/TaskManFrontEnd.js --bundle --watch & yarn esbuild src/TaskManBackEnd.ts --platform=node --outfile=dist/prebuild/TaskManBackEnd.mjs --bundle --watch --format=esm --packages=external",
|
|
180
180
|
"build-module": "tsc -p tsconfig.module.json",
|
|
181
181
|
"build-common": "tsc -p tsconfig.common.json",
|
|
182
|
-
"build-types": "tsc -p tsconfig.types.json"
|
|
183
|
-
"build-electron": "ts-node-esm electronBuild.ts"
|
|
182
|
+
"build-types": "tsc -p tsconfig.types.json"
|
|
184
183
|
},
|
|
185
184
|
"peerDependencies": {
|
|
186
185
|
"@hello-pangea/dnd": ">=16",
|
|
@@ -246,4 +245,4 @@
|
|
|
246
245
|
"uuid": "^10.0.0",
|
|
247
246
|
"ws": "^8.16.0"
|
|
248
247
|
}
|
|
249
|
-
}
|
|
248
|
+
}
|
package/src/Project.ts
CHANGED
|
@@ -143,31 +143,6 @@ export class ITProject {
|
|
|
143
143
|
);
|
|
144
144
|
|
|
145
145
|
Promise.all([
|
|
146
|
-
fs.promises.writeFile(
|
|
147
|
-
`${config.outdir}/testeranto.json`,
|
|
148
|
-
JSON.stringify(
|
|
149
|
-
{
|
|
150
|
-
...config,
|
|
151
|
-
buildDir: process.cwd() + "/" + config.outdir,
|
|
152
|
-
},
|
|
153
|
-
null,
|
|
154
|
-
2
|
|
155
|
-
)
|
|
156
|
-
),
|
|
157
|
-
// esbuild
|
|
158
|
-
// .context(esbuildFeaturesConfiger(config))
|
|
159
|
-
// .then(async (featuresContext) => {
|
|
160
|
-
// if (mode == "DEV") {
|
|
161
|
-
// await featuresContext.watch();
|
|
162
|
-
// onFeaturesDone();
|
|
163
|
-
// } else {
|
|
164
|
-
// featuresContext.rebuild().then((v) => {
|
|
165
|
-
// onFeaturesDone();
|
|
166
|
-
// });
|
|
167
|
-
// }
|
|
168
|
-
|
|
169
|
-
// return featuresContext;
|
|
170
|
-
// }),
|
|
171
146
|
esbuild
|
|
172
147
|
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
173
148
|
.then(async (nodeContext) => {
|
package/src/TaskManBackEnd.ts
CHANGED
|
@@ -72,58 +72,62 @@ function listToTree(fileList) {
|
|
|
72
72
|
return root.children;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
export default () => {
|
|
76
|
+
new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
77
|
+
.connect()
|
|
78
|
+
.then(async (conn) => {
|
|
79
|
+
const db = conn.db("taskman");
|
|
80
|
+
await mongoose.connect(
|
|
81
|
+
`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const usersModel = mongoose.model<IUser>("User", userSchema);
|
|
85
|
+
const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
|
|
86
|
+
const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
|
|
87
|
+
const featuresModel = mongoose.model<any>("Features", featuresSchema);
|
|
88
|
+
// const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
|
|
89
|
+
// const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
|
|
90
|
+
|
|
91
|
+
const MessagesModel = mongoose.model<any>(
|
|
92
|
+
"Messages",
|
|
93
|
+
chatCatMessageSchema
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
|
|
97
|
+
const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
|
|
98
|
+
const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
|
|
99
|
+
|
|
100
|
+
app.get("/TaskManFrontend.js", (req, res) => {
|
|
101
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
|
|
102
|
+
});
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
105
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
|
|
106
|
+
});
|
|
103
107
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
// app.get(`/preMergeCheck`, async (req, res) => {
|
|
109
|
+
// const commit = req.params["commit"];
|
|
110
|
+
// // res.json(await keyedModels[key].find({}));
|
|
111
|
+
// });
|
|
112
|
+
|
|
113
|
+
// app.get("/TaskManFrontend.js", (req, res) => {
|
|
114
|
+
// res.sendFile(
|
|
115
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
|
|
116
|
+
// );
|
|
117
|
+
// });
|
|
118
|
+
|
|
119
|
+
// app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
120
|
+
// res.sendFile(
|
|
121
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
|
|
122
|
+
// );
|
|
123
|
+
// });
|
|
124
|
+
|
|
125
|
+
app.get("/testeranto.json", (req, res) => {
|
|
126
|
+
res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
127
|
+
});
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
app.get("/", (req, res) => {
|
|
130
|
+
res.send(`<!DOCTYPE html>
|
|
127
131
|
<html lang="en">
|
|
128
132
|
|
|
129
133
|
<head>
|
|
@@ -141,78 +145,79 @@ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
|
141
145
|
<body><div id="root">react is loading</div></body>
|
|
142
146
|
|
|
143
147
|
</html>`);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
app.listen(port, () => {
|
|
147
|
-
console.log(`Example app listening on port ${port}`);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
///////////////////////////////////////////////
|
|
151
|
-
|
|
152
|
-
const keyedModels = {
|
|
153
|
-
users: usersModel,
|
|
154
|
-
kanbans: kanbanModel,
|
|
155
|
-
features: featuresModel,
|
|
156
|
-
gantts: ganttModel,
|
|
157
|
-
rooms: roomsModel,
|
|
158
|
-
huddles: huddleModdle,
|
|
159
|
-
messages: MessagesModel,
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
Object.keys(keyedModels).forEach((key) => {
|
|
163
|
-
app.get(`/${key}.json`, async (req, res) => {
|
|
164
|
-
console.log("GET", key, keyedModels[key]);
|
|
165
|
-
res.json(await keyedModels[key].find({}));
|
|
166
148
|
});
|
|
167
149
|
|
|
168
|
-
app.
|
|
169
|
-
|
|
170
|
-
await keyedModels[key]
|
|
171
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
172
|
-
.toArray()
|
|
173
|
-
);
|
|
150
|
+
app.listen(port, () => {
|
|
151
|
+
console.log(`Example app listening on port ${port}`);
|
|
174
152
|
});
|
|
175
153
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
154
|
+
///////////////////////////////////////////////
|
|
155
|
+
|
|
156
|
+
const keyedModels = {
|
|
157
|
+
users: usersModel,
|
|
158
|
+
kanbans: kanbanModel,
|
|
159
|
+
features: featuresModel,
|
|
160
|
+
gantts: ganttModel,
|
|
161
|
+
rooms: roomsModel,
|
|
162
|
+
huddles: huddleModdle,
|
|
163
|
+
messages: MessagesModel,
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
Object.keys(keyedModels).forEach((key) => {
|
|
167
|
+
app.get(`/${key}.json`, async (req, res) => {
|
|
168
|
+
console.log("GET", key, keyedModels[key]);
|
|
169
|
+
res.json(await keyedModels[key].find({}));
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
app.get(`/${key}/:id.json`, async (req, res) => {
|
|
173
|
+
res.json(
|
|
174
|
+
await keyedModels[key]
|
|
175
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
176
|
+
.toArray()
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
app.post(`/${key}/:id.json`, async (req, res) => {
|
|
181
|
+
res.json(
|
|
182
|
+
await keyedModels[key]
|
|
183
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
184
|
+
.toArray()
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
app.post(`/${key}.json`, async (req, res) => {
|
|
189
|
+
res.json(
|
|
190
|
+
await keyedModels[key]
|
|
191
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
192
|
+
.toArray()
|
|
193
|
+
);
|
|
194
|
+
});
|
|
182
195
|
});
|
|
183
196
|
|
|
184
|
-
app.
|
|
185
|
-
res.json(
|
|
186
|
-
await keyedModels[key]
|
|
187
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
188
|
-
.toArray()
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
app.use("/docs", express.static(path.join(process.cwd(), "docs")));
|
|
197
|
+
app.use("/docs", express.static(path.join(process.cwd(), "docs")));
|
|
194
198
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
app.get("/docGal/fs.json", (req, res) => {
|
|
200
|
+
const directoryPath = "./"; // Replace with the desired directory path
|
|
201
|
+
// const textFiles = findTextFiles(directoryPath);
|
|
202
|
+
res.json(listToTree(findTextFiles(directoryPath)));
|
|
203
|
+
// res.send(`<!DOCTYPE html>
|
|
204
|
+
// <html lang="en">
|
|
201
205
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
// <head>
|
|
207
|
+
// <meta name="description" content="Webpage description goes here" />
|
|
208
|
+
// <meta charset="utf-8" />
|
|
209
|
+
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
210
|
+
// <meta name="author" content="" />
|
|
207
211
|
|
|
208
|
-
|
|
212
|
+
// <title>TaskMan</title>
|
|
209
213
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
214
|
+
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
215
|
+
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
216
|
+
// </head>
|
|
213
217
|
|
|
214
|
-
|
|
218
|
+
// <body><div id="root">react is loading</div></body>
|
|
215
219
|
|
|
216
|
-
|
|
220
|
+
// </html>`);
|
|
221
|
+
});
|
|
217
222
|
});
|
|
218
|
-
|
|
223
|
+
};
|