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.
@@ -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 })
@@ -91,14 +81,16 @@ export class ITProject {
91
81
  // });
92
82
  // });
93
83
  // });
94
- glob(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then((chunks) => {
84
+ glob(`./${this.config.outdir}/chunk-*.mjs`, {
85
+ ignore: "node_modules/**",
86
+ }).then((chunks) => {
95
87
  chunks.forEach((chunk) => {
96
88
  fs.unlinkSync(chunk);
97
89
  });
98
90
  });
99
91
  Promise.all([
100
92
  esbuild
101
- .context(esbuildNodeConfiger(config, nodeEntryPoints))
93
+ .context(esbuildNodeConfiger(this.config, nodeEntryPoints))
102
94
  .then(async (nodeContext) => {
103
95
  if (mode == "DEV") {
104
96
  await nodeContext.watch().then((v) => {
@@ -113,7 +105,7 @@ export class ITProject {
113
105
  return nodeContext;
114
106
  }),
115
107
  esbuild
116
- .context(esbuildWebConfiger(config, webEntryPoints))
108
+ .context(esbuildWebConfiger(this.config, webEntryPoints))
117
109
  .then(async (webContext) => {
118
110
  if (mode == "DEV") {
119
111
  await webContext.watch().then((v) => {