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.
@@ -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
- const config = Object.assign(Object.assign({}, configs), { buildDir: process.cwd() + "/" + configs.outdir });
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 })
@@ -97,14 +87,16 @@ class ITProject {
97
87
  // });
98
88
  // });
99
89
  // });
100
- (0, glob_1.glob)(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then((chunks) => {
90
+ (0, glob_1.glob)(`./${this.config.outdir}/chunk-*.mjs`, {
91
+ ignore: "node_modules/**",
92
+ }).then((chunks) => {
101
93
  chunks.forEach((chunk) => {
102
94
  fs_1.default.unlinkSync(chunk);
103
95
  });
104
96
  });
105
97
  Promise.all([
106
98
  esbuild_1.default
107
- .context((0, node_js_1.default)(config, nodeEntryPoints))
99
+ .context((0, node_js_1.default)(this.config, nodeEntryPoints))
108
100
  .then(async (nodeContext) => {
109
101
  if (mode == "DEV") {
110
102
  await nodeContext.watch().then((v) => {
@@ -119,7 +111,7 @@ class ITProject {
119
111
  return nodeContext;
120
112
  }),
121
113
  esbuild_1.default
122
- .context((0, web_js_1.default)(config, webEntryPoints))
114
+ .context((0, web_js_1.default)(this.config, webEntryPoints))
123
115
  .then(async (webContext) => {
124
116
  if (mode == "DEV") {
125
117
  await webContext.watch().then((v) => {