testeranto 0.79.35 → 0.79.37
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/Project.js +2 -2
- package/dist/common/Puppeteer.js +12 -14
- package/dist/common/TaskManBackEnd.js +8 -7
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +2 -2
- package/dist/module/Puppeteer.js +12 -14
- package/dist/module/TaskManBackEnd.js +8 -7
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/TaskManBackEnd.mjs +7 -13
- package/dist/types/Project.d.ts +1 -1
- package/dist/types/Puppeteer.d.ts +1 -1
- package/dist/types/TaskManBackEnd.d.ts +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/src/Project.ts +5 -2
- package/src/Puppeteer.ts +18 -16
- package/src/TaskManBackEnd.ts +12 -14
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.37",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -133,6 +133,10 @@
|
|
|
133
133
|
"import": "./src/Node.ts",
|
|
134
134
|
"require": "./src/Node.ts"
|
|
135
135
|
},
|
|
136
|
+
"./src/Puppeteer": {
|
|
137
|
+
"import": "./dist/module/Puppeteer.js",
|
|
138
|
+
"require": "./dist/common/Puppeteer.js"
|
|
139
|
+
},
|
|
136
140
|
"./src/TaskManBackEnd": {
|
|
137
141
|
"import": "./dist/module/TaskManBackEnd.js",
|
|
138
142
|
"require": "./dist/common/TaskManBackEnd.js"
|
package/src/Project.ts
CHANGED
|
@@ -71,8 +71,11 @@ export class ITProject {
|
|
|
71
71
|
config: IBaseConfig;
|
|
72
72
|
mode: `up` | `down` = `up`;
|
|
73
73
|
|
|
74
|
-
constructor(
|
|
75
|
-
|
|
74
|
+
constructor(configs: IBaseConfig) {
|
|
75
|
+
const config = {
|
|
76
|
+
...configs,
|
|
77
|
+
buildDir: process.cwd() + "/" + configs.outdir,
|
|
78
|
+
};
|
|
76
79
|
|
|
77
80
|
fs.writeFileSync(
|
|
78
81
|
`${config.outdir}/testeranto.json`,
|
package/src/Puppeteer.ts
CHANGED
|
@@ -25,23 +25,25 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
export default async (
|
|
28
|
+
export default async (partialConfig) => {
|
|
29
|
+
const config = {
|
|
30
|
+
...partialConfig,
|
|
31
|
+
buildDir: process.cwd() + "/" + partialConfig.outdir,
|
|
32
|
+
};
|
|
33
|
+
|
|
29
34
|
fs.writeFileSync(
|
|
30
|
-
`${
|
|
35
|
+
`${config.outdir}/testeranto.json`,
|
|
31
36
|
JSON.stringify(
|
|
32
37
|
{
|
|
33
|
-
...
|
|
34
|
-
buildDir: process.cwd() + "/" +
|
|
38
|
+
...config,
|
|
39
|
+
buildDir: process.cwd() + "/" + config.outdir,
|
|
35
40
|
},
|
|
36
41
|
null,
|
|
37
42
|
2
|
|
38
43
|
)
|
|
39
44
|
);
|
|
40
|
-
// const configs = jsonc.parse(
|
|
41
|
-
// (await fs.readFileSync("./docs/testeranto.json")).toString()
|
|
42
|
-
// ) as IBuiltConfig;
|
|
43
45
|
|
|
44
|
-
const pm = new PM_Main(
|
|
46
|
+
const pm = new PM_Main(config);
|
|
45
47
|
|
|
46
48
|
await pm.startPuppeteer(
|
|
47
49
|
{
|
|
@@ -84,25 +86,25 @@ export default async (configs) => {
|
|
|
84
86
|
"."
|
|
85
87
|
);
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
88
90
|
if (runtime === "node") {
|
|
89
|
-
pm.launchNode(test, destinationOfRuntime(test, "node",
|
|
91
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
90
92
|
} else if (runtime === "web") {
|
|
91
|
-
pm.launchWeb(test, destinationOfRuntime(test, "web",
|
|
93
|
+
pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
|
|
92
94
|
} else {
|
|
93
95
|
console.error("runtime makes no sense", runtime);
|
|
94
96
|
}
|
|
95
97
|
});
|
|
96
98
|
|
|
97
|
-
console.log("ready and watching for changes...",
|
|
99
|
+
console.log("ready and watching for changes...", config.buildDir);
|
|
98
100
|
fs.watch(
|
|
99
|
-
|
|
101
|
+
config.buildDir,
|
|
100
102
|
{
|
|
101
103
|
recursive: true,
|
|
102
104
|
},
|
|
103
105
|
(eventType, changedFile) => {
|
|
104
106
|
if (changedFile) {
|
|
105
|
-
|
|
107
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
106
108
|
if (eventType === "change" || eventType === "rename") {
|
|
107
109
|
if (
|
|
108
110
|
changedFile ===
|
|
@@ -113,7 +115,7 @@ export default async (configs) => {
|
|
|
113
115
|
.concat("mjs")
|
|
114
116
|
.join(".")
|
|
115
117
|
) {
|
|
116
|
-
pm.launchNode(test, destinationOfRuntime(test, "node",
|
|
118
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
if (
|
|
@@ -127,7 +129,7 @@ export default async (configs) => {
|
|
|
127
129
|
) {
|
|
128
130
|
pm.launchWeb(
|
|
129
131
|
test,
|
|
130
|
-
destinationOfRuntime(test, "web",
|
|
132
|
+
destinationOfRuntime(test, "web", config),
|
|
131
133
|
sidecars
|
|
132
134
|
);
|
|
133
135
|
}
|
package/src/TaskManBackEnd.ts
CHANGED
|
@@ -73,17 +73,15 @@ function listToTree(fileList) {
|
|
|
73
73
|
return root.children;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export default (
|
|
76
|
+
export default (partialConfig: IBaseConfig) => {
|
|
77
|
+
const config = {
|
|
78
|
+
...partialConfig,
|
|
79
|
+
buildDir: process.cwd() + "/" + partialConfig.outdir,
|
|
80
|
+
};
|
|
81
|
+
|
|
77
82
|
fs.writeFileSync(
|
|
78
83
|
`${config.outdir}/testeranto.json`,
|
|
79
|
-
JSON.stringify(
|
|
80
|
-
{
|
|
81
|
-
...config,
|
|
82
|
-
buildDir: process.cwd() + "/" + config.outdir,
|
|
83
|
-
},
|
|
84
|
-
null,
|
|
85
|
-
2
|
|
86
|
-
)
|
|
84
|
+
JSON.stringify(config, null, 2)
|
|
87
85
|
);
|
|
88
86
|
|
|
89
87
|
const app = express();
|
|
@@ -137,10 +135,10 @@ export default (config: IBaseConfig) => {
|
|
|
137
135
|
// );
|
|
138
136
|
// });
|
|
139
137
|
|
|
140
|
-
app.get("/testeranto.json", (req, res) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
138
|
+
// app.get("/testeranto.json", (req, res) => {
|
|
139
|
+
// // res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
140
|
+
// res.json(config);
|
|
141
|
+
// });
|
|
144
142
|
|
|
145
143
|
app.get("/", (req, res) => {
|
|
146
144
|
res.send(`<!DOCTYPE html>
|
|
@@ -210,7 +208,7 @@ export default (config: IBaseConfig) => {
|
|
|
210
208
|
});
|
|
211
209
|
});
|
|
212
210
|
|
|
213
|
-
app.use("/
|
|
211
|
+
app.use("/", express.static(path.join(process.cwd())));
|
|
214
212
|
|
|
215
213
|
app.get("/docGal/fs.json", (req, res) => {
|
|
216
214
|
const directoryPath = "./"; // Replace with the desired directory path
|