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/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.34",
|
|
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
|
@@ -74,6 +74,18 @@ export class ITProject {
|
|
|
74
74
|
constructor(config: IBaseConfig) {
|
|
75
75
|
this.config = config;
|
|
76
76
|
|
|
77
|
+
fs.writeFileSync(
|
|
78
|
+
`${config.outdir}/testeranto.json`,
|
|
79
|
+
JSON.stringify(
|
|
80
|
+
{
|
|
81
|
+
...config,
|
|
82
|
+
buildDir: process.cwd() + "/" + config.outdir,
|
|
83
|
+
},
|
|
84
|
+
null,
|
|
85
|
+
2
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
|
|
77
89
|
Promise.resolve(
|
|
78
90
|
Promise.all(
|
|
79
91
|
[...this.getSecondaryEndpointsPoints("web")].map(
|
|
@@ -143,31 +155,6 @@ export class ITProject {
|
|
|
143
155
|
);
|
|
144
156
|
|
|
145
157
|
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
158
|
esbuild
|
|
172
159
|
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
173
160
|
.then(async (nodeContext) => {
|
package/src/TaskManBackEnd.ts
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
channelsFeature,
|
|
18
18
|
chatCatMessageSchema,
|
|
19
19
|
} from "./mongooseSchemas";
|
|
20
|
+
import { ITProject } from "./Project";
|
|
21
|
+
import { IBaseConfig } from "./lib/types";
|
|
20
22
|
|
|
21
23
|
// export const chatChannel = new mongoose.Schema<IChatChannel>({
|
|
22
24
|
// // name: { type: String, required: true },
|
|
@@ -29,7 +31,6 @@ import {
|
|
|
29
31
|
// ],
|
|
30
32
|
// });
|
|
31
33
|
|
|
32
|
-
const app = express();
|
|
33
34
|
const port = 3000;
|
|
34
35
|
|
|
35
36
|
function findTextFiles(dir: string, fileList: string[] = []) {
|
|
@@ -72,58 +73,77 @@ function listToTree(fileList) {
|
|
|
72
73
|
return root.children;
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
export default (config: IBaseConfig) => {
|
|
77
|
+
fs.writeFileSync(
|
|
78
|
+
`${config.outdir}/testeranto.json`,
|
|
79
|
+
JSON.stringify(
|
|
80
|
+
{
|
|
81
|
+
...config,
|
|
82
|
+
buildDir: process.cwd() + "/" + config.outdir,
|
|
83
|
+
},
|
|
84
|
+
null,
|
|
85
|
+
2
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const app = express();
|
|
90
|
+
|
|
91
|
+
new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
92
|
+
.connect()
|
|
93
|
+
.then(async (conn) => {
|
|
94
|
+
const db = conn.db("taskman");
|
|
95
|
+
await mongoose.connect(
|
|
96
|
+
`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const usersModel = mongoose.model<IUser>("User", userSchema);
|
|
100
|
+
const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
|
|
101
|
+
const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
|
|
102
|
+
const featuresModel = mongoose.model<any>("Features", featuresSchema);
|
|
103
|
+
// const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
|
|
104
|
+
// const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
|
|
105
|
+
|
|
106
|
+
const MessagesModel = mongoose.model<any>(
|
|
107
|
+
"Messages",
|
|
108
|
+
chatCatMessageSchema
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
|
|
112
|
+
const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
|
|
113
|
+
const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
|
|
114
|
+
|
|
115
|
+
app.get("/TaskManFrontend.js", (req, res) => {
|
|
116
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
|
|
117
|
+
});
|
|
99
118
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
120
|
+
res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
|
|
121
|
+
});
|
|
103
122
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
// app.get(`/preMergeCheck`, async (req, res) => {
|
|
124
|
+
// const commit = req.params["commit"];
|
|
125
|
+
// // res.json(await keyedModels[key].find({}));
|
|
126
|
+
// });
|
|
127
|
+
|
|
128
|
+
// app.get("/TaskManFrontend.js", (req, res) => {
|
|
129
|
+
// res.sendFile(
|
|
130
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
|
|
131
|
+
// );
|
|
132
|
+
// });
|
|
133
|
+
|
|
134
|
+
// app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
135
|
+
// res.sendFile(
|
|
136
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
|
|
137
|
+
// );
|
|
138
|
+
// });
|
|
139
|
+
|
|
140
|
+
app.get("/testeranto.json", (req, res) => {
|
|
141
|
+
res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
142
|
+
// res.json(config);
|
|
143
|
+
});
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
145
|
+
app.get("/", (req, res) => {
|
|
146
|
+
res.send(`<!DOCTYPE html>
|
|
127
147
|
<html lang="en">
|
|
128
148
|
|
|
129
149
|
<head>
|
|
@@ -141,78 +161,79 @@ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
|
|
|
141
161
|
<body><div id="root">react is loading</div></body>
|
|
142
162
|
|
|
143
163
|
</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
164
|
});
|
|
167
165
|
|
|
168
|
-
app.
|
|
169
|
-
|
|
170
|
-
await keyedModels[key]
|
|
171
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
172
|
-
.toArray()
|
|
173
|
-
);
|
|
166
|
+
app.listen(port, () => {
|
|
167
|
+
console.log(`Example app listening on port ${port}`);
|
|
174
168
|
});
|
|
175
169
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
170
|
+
///////////////////////////////////////////////
|
|
171
|
+
|
|
172
|
+
const keyedModels = {
|
|
173
|
+
users: usersModel,
|
|
174
|
+
kanbans: kanbanModel,
|
|
175
|
+
features: featuresModel,
|
|
176
|
+
gantts: ganttModel,
|
|
177
|
+
rooms: roomsModel,
|
|
178
|
+
huddles: huddleModdle,
|
|
179
|
+
messages: MessagesModel,
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
Object.keys(keyedModels).forEach((key) => {
|
|
183
|
+
app.get(`/${key}.json`, async (req, res) => {
|
|
184
|
+
console.log("GET", key, keyedModels[key]);
|
|
185
|
+
res.json(await keyedModels[key].find({}));
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
app.get(`/${key}/:id.json`, async (req, res) => {
|
|
189
|
+
res.json(
|
|
190
|
+
await keyedModels[key]
|
|
191
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
192
|
+
.toArray()
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
app.post(`/${key}/:id.json`, async (req, res) => {
|
|
197
|
+
res.json(
|
|
198
|
+
await keyedModels[key]
|
|
199
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
200
|
+
.toArray()
|
|
201
|
+
);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
app.post(`/${key}.json`, async (req, res) => {
|
|
205
|
+
res.json(
|
|
206
|
+
await keyedModels[key]
|
|
207
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
208
|
+
.toArray()
|
|
209
|
+
);
|
|
210
|
+
});
|
|
182
211
|
});
|
|
183
212
|
|
|
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")));
|
|
213
|
+
app.use("/docs", express.static(path.join(process.cwd(), "docs")));
|
|
194
214
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
215
|
+
app.get("/docGal/fs.json", (req, res) => {
|
|
216
|
+
const directoryPath = "./"; // Replace with the desired directory path
|
|
217
|
+
// const textFiles = findTextFiles(directoryPath);
|
|
218
|
+
res.json(listToTree(findTextFiles(directoryPath)));
|
|
219
|
+
// res.send(`<!DOCTYPE html>
|
|
220
|
+
// <html lang="en">
|
|
201
221
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
222
|
+
// <head>
|
|
223
|
+
// <meta name="description" content="Webpage description goes here" />
|
|
224
|
+
// <meta charset="utf-8" />
|
|
225
|
+
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
226
|
+
// <meta name="author" content="" />
|
|
207
227
|
|
|
208
|
-
|
|
228
|
+
// <title>TaskMan</title>
|
|
209
229
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
230
|
+
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
231
|
+
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
232
|
+
// </head>
|
|
213
233
|
|
|
214
|
-
|
|
234
|
+
// <body><div id="root">react is loading</div></body>
|
|
215
235
|
|
|
216
|
-
|
|
236
|
+
// </html>`);
|
|
237
|
+
});
|
|
217
238
|
});
|
|
218
|
-
|
|
239
|
+
};
|