testeranto 0.79.37 → 0.79.39
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/dist/common/Init.js +26 -0
- package/dist/common/Project.js +8 -36
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Init.js +21 -0
- package/dist/module/Project.js +8 -36
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/Init.d.ts +2 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -2
- package/src/Init.ts +54 -0
- package/src/Project.ts +16 -53
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const readline_1 = __importDefault(require("readline"));
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
9
|
+
const node2web = {};
|
|
10
|
+
const web2node = {};
|
|
11
|
+
const childProcesses = {};
|
|
12
|
+
readline_1.default.emitKeypressEvents(process.stdin);
|
|
13
|
+
if (process.stdin.isTTY)
|
|
14
|
+
process.stdin.setRawMode(true);
|
|
15
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
16
|
+
process.stdin.on("keypress", (str, key) => {
|
|
17
|
+
if (key.name === "q") {
|
|
18
|
+
process.exit();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
exports.default = async (partialConfig) => {
|
|
22
|
+
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
23
|
+
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
24
|
+
fs_1.default.copyFileSync("./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js", "docs/TaskManFrontEnd.js");
|
|
25
|
+
fs_1.default.copyFileSync("./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css", "docs/TaskManFrontEnd.css");
|
|
26
|
+
};
|
package/dist/common/Project.js
CHANGED
|
@@ -11,7 +11,6 @@ const readline_1 = __importDefault(require("readline"));
|
|
|
11
11
|
const glob_1 = require("glob");
|
|
12
12
|
const node_js_1 = __importDefault(require("./esbuildConfigs/node.js"));
|
|
13
13
|
const web_js_1 = __importDefault(require("./esbuildConfigs/web.js"));
|
|
14
|
-
// import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
|
|
15
14
|
const web_html_js_1 = __importDefault(require("./web.html.js"));
|
|
16
15
|
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
17
16
|
readline_1.default.emitKeypressEvents(process.stdin);
|
|
@@ -24,15 +23,7 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
24
23
|
onDone();
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
|
-
// setInterval(() => {
|
|
28
|
-
// const memoryUsage = process.memoryUsage();
|
|
29
|
-
// console.log("Memory usage:", memoryUsage);
|
|
30
|
-
// }, 10000); // Check every 10 seconds
|
|
31
26
|
let nodeDone, webDone = false;
|
|
32
|
-
const onFeaturesDone = () => {
|
|
33
|
-
// featuresDone = true;
|
|
34
|
-
onDone();
|
|
35
|
-
};
|
|
36
27
|
const onNodeDone = () => {
|
|
37
28
|
nodeDone = true;
|
|
38
29
|
onDone();
|
|
@@ -43,7 +34,6 @@ const onWebDone = () => {
|
|
|
43
34
|
};
|
|
44
35
|
const onDone = () => {
|
|
45
36
|
console.log(JSON.stringify({
|
|
46
|
-
// featuresDone,
|
|
47
37
|
nodeDone,
|
|
48
38
|
webDone,
|
|
49
39
|
mode,
|
|
@@ -59,8 +49,8 @@ const onDone = () => {
|
|
|
59
49
|
class ITProject {
|
|
60
50
|
constructor(configs) {
|
|
61
51
|
this.mode = `up`;
|
|
62
|
-
|
|
63
|
-
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
52
|
+
this.config = configs;
|
|
53
|
+
fs_1.default.writeFileSync(`${this.config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, this.config), { buildDir: process.cwd() + "/" + this.config.outdir }), null, 2));
|
|
64
54
|
Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
65
55
|
const sourceFileSplit = sourceFilePath.split("/");
|
|
66
56
|
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
@@ -69,7 +59,7 @@ class ITProject {
|
|
|
69
59
|
.split(".")
|
|
70
60
|
.slice(0, -1)
|
|
71
61
|
.join(".");
|
|
72
|
-
const htmlFilePath = path_1.default.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
62
|
+
const htmlFilePath = path_1.default.normalize(`${process.cwd()}/${this.config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
73
63
|
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
74
64
|
return fs_1.default.promises
|
|
75
65
|
.mkdir(path_1.default.dirname(htmlFilePath), { recursive: true })
|
|
@@ -77,34 +67,16 @@ class ITProject {
|
|
|
77
67
|
})));
|
|
78
68
|
const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
|
|
79
69
|
console.log(`this.getSecondaryEndpointsPoints("web")`, this.getSecondaryEndpointsPoints("web"));
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// const f = `${process.cwd()}/${nep}`;
|
|
84
|
-
// console.log("nep", f);
|
|
85
|
-
// import(f).then((module) => {
|
|
86
|
-
// return module.default.then((defaultModule) => {
|
|
87
|
-
// console.log("defaultModule", defaultModule);
|
|
88
|
-
// // defaultModule
|
|
89
|
-
// // .receiveTestResourceConfig(argz)
|
|
90
|
-
// // .then((x) => {
|
|
91
|
-
// // console.log("then", x);
|
|
92
|
-
// // return x;
|
|
93
|
-
// // })
|
|
94
|
-
// // .catch((e) => {
|
|
95
|
-
// // console.log("catch", e);
|
|
96
|
-
// // });
|
|
97
|
-
// });
|
|
98
|
-
// });
|
|
99
|
-
// });
|
|
100
|
-
(0, glob_1.glob)(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then((chunks) => {
|
|
70
|
+
(0, glob_1.glob)(`./${this.config.outdir}/chunk-*.mjs`, {
|
|
71
|
+
ignore: "node_modules/**",
|
|
72
|
+
}).then((chunks) => {
|
|
101
73
|
chunks.forEach((chunk) => {
|
|
102
74
|
fs_1.default.unlinkSync(chunk);
|
|
103
75
|
});
|
|
104
76
|
});
|
|
105
77
|
Promise.all([
|
|
106
78
|
esbuild_1.default
|
|
107
|
-
.context((0, node_js_1.default)(config, nodeEntryPoints))
|
|
79
|
+
.context((0, node_js_1.default)(this.config, nodeEntryPoints))
|
|
108
80
|
.then(async (nodeContext) => {
|
|
109
81
|
if (mode == "DEV") {
|
|
110
82
|
await nodeContext.watch().then((v) => {
|
|
@@ -119,7 +91,7 @@ class ITProject {
|
|
|
119
91
|
return nodeContext;
|
|
120
92
|
}),
|
|
121
93
|
esbuild_1.default
|
|
122
|
-
.context((0, web_js_1.default)(config, webEntryPoints))
|
|
94
|
+
.context((0, web_js_1.default)(this.config, webEntryPoints))
|
|
123
95
|
.then(async (webContext) => {
|
|
124
96
|
if (mode == "DEV") {
|
|
125
97
|
await webContext.watch().then((v) => {
|