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.
@@ -0,0 +1,21 @@
1
+ import readline from "readline";
2
+ import fs from "fs";
3
+ var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
4
+ const node2web = {};
5
+ const web2node = {};
6
+ const childProcesses = {};
7
+ readline.emitKeypressEvents(process.stdin);
8
+ if (process.stdin.isTTY)
9
+ process.stdin.setRawMode(true);
10
+ console.log("\n Puppeteer is running. Press 'q' to quit\n");
11
+ process.stdin.on("keypress", (str, key) => {
12
+ if (key.name === "q") {
13
+ process.exit();
14
+ }
15
+ });
16
+ export default async (partialConfig) => {
17
+ const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
18
+ fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
19
+ fs.copyFileSync("./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js", "docs/TaskManFrontEnd.js");
20
+ fs.copyFileSync("./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css", "docs/TaskManFrontEnd.css");
21
+ };
@@ -5,7 +5,6 @@ import readline from "readline";
5
5
  import { glob } from "glob";
6
6
  import esbuildNodeConfiger from "./esbuildConfigs/node.js";
7
7
  import esbuildWebConfiger from "./esbuildConfigs/web.js";
8
- // import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
9
8
  import webHtmlFrame from "./web.html.js";
10
9
  var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
11
10
  readline.emitKeypressEvents(process.stdin);
@@ -18,15 +17,7 @@ process.stdin.on("keypress", (str, key) => {
18
17
  onDone();
19
18
  }
20
19
  });
21
- // setInterval(() => {
22
- // const memoryUsage = process.memoryUsage();
23
- // console.log("Memory usage:", memoryUsage);
24
- // }, 10000); // Check every 10 seconds
25
20
  let nodeDone, webDone = false;
26
- const onFeaturesDone = () => {
27
- // featuresDone = true;
28
- onDone();
29
- };
30
21
  const onNodeDone = () => {
31
22
  nodeDone = true;
32
23
  onDone();
@@ -37,7 +28,6 @@ const onWebDone = () => {
37
28
  };
38
29
  const onDone = () => {
39
30
  console.log(JSON.stringify({
40
- // featuresDone,
41
31
  nodeDone,
42
32
  webDone,
43
33
  mode,
@@ -53,8 +43,8 @@ const onDone = () => {
53
43
  export class ITProject {
54
44
  constructor(configs) {
55
45
  this.mode = `up`;
56
- const config = Object.assign(Object.assign({}, configs), { buildDir: process.cwd() + "/" + configs.outdir });
57
- fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
46
+ this.config = configs;
47
+ fs.writeFileSync(`${this.config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, this.config), { buildDir: process.cwd() + "/" + this.config.outdir }), null, 2));
58
48
  Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
59
49
  const sourceFileSplit = sourceFilePath.split("/");
60
50
  const sourceDir = sourceFileSplit.slice(0, -1);
@@ -63,7 +53,7 @@ export class ITProject {
63
53
  .split(".")
64
54
  .slice(0, -1)
65
55
  .join(".");
66
- const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
56
+ const htmlFilePath = path.normalize(`${process.cwd()}/${this.config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
67
57
  const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
68
58
  return fs.promises
69
59
  .mkdir(path.dirname(htmlFilePath), { recursive: true })
@@ -71,34 +61,16 @@ export class ITProject {
71
61
  })));
72
62
  const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
73
63
  console.log(`this.getSecondaryEndpointsPoints("web")`, this.getSecondaryEndpointsPoints("web"));
74
- // console.log("nodeEntryPoints", nodeEntryPoints);
75
- // console.log("webEntryPoints", webEntryPoints);
76
- // nodeEntryPoints.forEach((nep) => {
77
- // const f = `${process.cwd()}/${nep}`;
78
- // console.log("nep", f);
79
- // import(f).then((module) => {
80
- // return module.default.then((defaultModule) => {
81
- // console.log("defaultModule", defaultModule);
82
- // // defaultModule
83
- // // .receiveTestResourceConfig(argz)
84
- // // .then((x) => {
85
- // // console.log("then", x);
86
- // // return x;
87
- // // })
88
- // // .catch((e) => {
89
- // // console.log("catch", e);
90
- // // });
91
- // });
92
- // });
93
- // });
94
- glob(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then((chunks) => {
64
+ glob(`./${this.config.outdir}/chunk-*.mjs`, {
65
+ ignore: "node_modules/**",
66
+ }).then((chunks) => {
95
67
  chunks.forEach((chunk) => {
96
68
  fs.unlinkSync(chunk);
97
69
  });
98
70
  });
99
71
  Promise.all([
100
72
  esbuild
101
- .context(esbuildNodeConfiger(config, nodeEntryPoints))
73
+ .context(esbuildNodeConfiger(this.config, nodeEntryPoints))
102
74
  .then(async (nodeContext) => {
103
75
  if (mode == "DEV") {
104
76
  await nodeContext.watch().then((v) => {
@@ -113,7 +85,7 @@ export class ITProject {
113
85
  return nodeContext;
114
86
  }),
115
87
  esbuild
116
- .context(esbuildWebConfiger(config, webEntryPoints))
88
+ .context(esbuildWebConfiger(this.config, webEntryPoints))
117
89
  .then(async (webContext) => {
118
90
  if (mode == "DEV") {
119
91
  await webContext.watch().then((v) => {