testeranto 0.79.37 → 0.79.38
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/package.json
CHANGED
package/src/Project.ts
CHANGED
|
@@ -6,11 +6,7 @@ import { glob } from "glob";
|
|
|
6
6
|
|
|
7
7
|
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
8
8
|
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
9
|
-
// import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
|
|
10
|
-
|
|
11
9
|
import webHtmlFrame from "./web.html.js";
|
|
12
|
-
// import reportHtmlFrame from "./report.html.js";
|
|
13
|
-
|
|
14
10
|
import { ITestTypes, IBaseConfig, IRunTime } from "./lib/types.js";
|
|
15
11
|
|
|
16
12
|
var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
@@ -26,17 +22,9 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
26
22
|
}
|
|
27
23
|
});
|
|
28
24
|
|
|
29
|
-
// setInterval(() => {
|
|
30
|
-
// const memoryUsage = process.memoryUsage();
|
|
31
|
-
// console.log("Memory usage:", memoryUsage);
|
|
32
|
-
// }, 10000); // Check every 10 seconds
|
|
33
|
-
|
|
34
25
|
let nodeDone,
|
|
35
26
|
webDone = false;
|
|
36
|
-
|
|
37
|
-
// featuresDone = true;
|
|
38
|
-
onDone();
|
|
39
|
-
};
|
|
27
|
+
|
|
40
28
|
const onNodeDone = () => {
|
|
41
29
|
nodeDone = true;
|
|
42
30
|
onDone();
|
|
@@ -50,7 +38,6 @@ const onDone = () => {
|
|
|
50
38
|
console.log(
|
|
51
39
|
JSON.stringify(
|
|
52
40
|
{
|
|
53
|
-
// featuresDone,
|
|
54
41
|
nodeDone,
|
|
55
42
|
webDone,
|
|
56
43
|
mode,
|
|
@@ -72,17 +59,14 @@ export class ITProject {
|
|
|
72
59
|
mode: `up` | `down` = `up`;
|
|
73
60
|
|
|
74
61
|
constructor(configs: IBaseConfig) {
|
|
75
|
-
|
|
76
|
-
...configs,
|
|
77
|
-
buildDir: process.cwd() + "/" + configs.outdir,
|
|
78
|
-
};
|
|
62
|
+
this.config = configs;
|
|
79
63
|
|
|
80
64
|
fs.writeFileSync(
|
|
81
|
-
`${config.outdir}/testeranto.json`,
|
|
65
|
+
`${this.config.outdir}/testeranto.json`,
|
|
82
66
|
JSON.stringify(
|
|
83
67
|
{
|
|
84
|
-
...config,
|
|
85
|
-
buildDir: process.cwd() + "/" + config.outdir,
|
|
68
|
+
...this.config,
|
|
69
|
+
buildDir: process.cwd() + "/" + this.config.outdir,
|
|
86
70
|
},
|
|
87
71
|
null,
|
|
88
72
|
2
|
|
@@ -102,7 +86,7 @@ export class ITProject {
|
|
|
102
86
|
.join(".");
|
|
103
87
|
|
|
104
88
|
const htmlFilePath = path.normalize(
|
|
105
|
-
`${process.cwd()}/${config.outdir}/web/${sourceDir.join(
|
|
89
|
+
`${process.cwd()}/${this.config.outdir}/web/${sourceDir.join(
|
|
106
90
|
"/"
|
|
107
91
|
)}/${sourceFileNameMinusJs}.html`
|
|
108
92
|
);
|
|
@@ -149,17 +133,17 @@ export class ITProject {
|
|
|
149
133
|
// });
|
|
150
134
|
// });
|
|
151
135
|
|
|
152
|
-
glob(`./${config.outdir}/chunk-*.mjs`, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
);
|
|
136
|
+
glob(`./${this.config.outdir}/chunk-*.mjs`, {
|
|
137
|
+
ignore: "node_modules/**",
|
|
138
|
+
}).then((chunks) => {
|
|
139
|
+
chunks.forEach((chunk) => {
|
|
140
|
+
fs.unlinkSync(chunk);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
159
143
|
|
|
160
144
|
Promise.all([
|
|
161
145
|
esbuild
|
|
162
|
-
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
146
|
+
.context(esbuildNodeConfiger(this.config, nodeEntryPoints))
|
|
163
147
|
.then(async (nodeContext) => {
|
|
164
148
|
if (mode == "DEV") {
|
|
165
149
|
await nodeContext.watch().then((v) => {
|
|
@@ -174,7 +158,7 @@ export class ITProject {
|
|
|
174
158
|
return nodeContext;
|
|
175
159
|
}),
|
|
176
160
|
esbuild
|
|
177
|
-
.context(esbuildWebConfiger(config, webEntryPoints))
|
|
161
|
+
.context(esbuildWebConfiger(this.config, webEntryPoints))
|
|
178
162
|
.then(async (webContext) => {
|
|
179
163
|
if (mode == "DEV") {
|
|
180
164
|
await webContext.watch().then((v) => {
|