testeranto 0.79.61 → 0.79.63

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "testeranto",
3
3
  "description": "teeny tiny tightly-typed typescript tests",
4
- "version": "0.79.61",
4
+ "version": "0.79.63",
5
5
  "engines": {
6
6
  "node": "18.18.0"
7
7
  },
@@ -248,6 +248,7 @@
248
248
  "react-router-dom": "6.29.0",
249
249
  "react-sigma": "^1.2.35",
250
250
  "react-test-renderer": "18.2.0",
251
+ "recursive-watch": "^1.1.4",
251
252
  "selenium-webdriver": "4.27.0",
252
253
  "url": "^0.11.4",
253
254
  "uuid": "^10.0.0",
package/src/Puppeteer.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  import readline from "readline";
2
2
  import fs from "fs";
3
- import path from "path";
4
- import { jsonc } from "jsonc";
5
- import { v4 as uuidv4 } from "uuid";
6
-
7
- import { IBuiltConfig, IRunTime } from "./lib/types";
3
+ import watch from "recursive-watch";
8
4
 
9
5
  import { PM_Main } from "./PM/main.js";
10
6
  import { destinationOfRuntime } from "./utils.js";
@@ -99,45 +95,83 @@ export default async (partialConfig) => {
99
95
  });
100
96
 
101
97
  console.log("ready and watching for changes...", config.buildDir);
102
- fs.watch(
103
- config.buildDir,
104
- {
105
- recursive: true,
106
- },
107
- (eventType, changedFile) => {
108
- if (changedFile) {
109
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
110
- if (eventType === "change" || eventType === "rename") {
111
- if (
112
- changedFile ===
113
- test
114
- .replace("./", "node/")
115
- .split(".")
116
- .slice(0, -1)
117
- .concat("mjs")
118
- .join(".")
119
- ) {
120
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
121
- }
122
-
123
- if (
124
- changedFile ===
125
- test
126
- .replace("./", "web/")
127
- .split(".")
128
- .slice(0, -1)
129
- .concat("mjs")
130
- .join(".")
131
- ) {
132
- pm.launchWeb(
133
- test,
134
- destinationOfRuntime(test, "web", config),
135
- sidecars
136
- );
137
- }
98
+
99
+ watch(config.buildDir, (eventType, changedFile) => {
100
+ if (changedFile) {
101
+ config.tests.forEach(([test, runtime, tr, sidecars]) => {
102
+ if (eventType === "change" || eventType === "rename") {
103
+ if (
104
+ changedFile ===
105
+ test
106
+ .replace("./", "node/")
107
+ .split(".")
108
+ .slice(0, -1)
109
+ .concat("mjs")
110
+ .join(".")
111
+ ) {
112
+ pm.launchNode(test, destinationOfRuntime(test, "node", config));
113
+ }
114
+
115
+ if (
116
+ changedFile ===
117
+ test
118
+ .replace("./", "web/")
119
+ .split(".")
120
+ .slice(0, -1)
121
+ .concat("mjs")
122
+ .join(".")
123
+ ) {
124
+ pm.launchWeb(
125
+ test,
126
+ destinationOfRuntime(test, "web", config),
127
+ sidecars
128
+ );
138
129
  }
139
- });
140
- }
130
+ }
131
+ });
141
132
  }
142
- );
133
+ });
134
+
135
+ // does not work on linux
136
+ // fs.watch(
137
+ // config.buildDir,
138
+ // {
139
+ // recursive: true,
140
+ // },
141
+ // (eventType, changedFile) => {
142
+ // if (changedFile) {
143
+ // config.tests.forEach(([test, runtime, tr, sidecars]) => {
144
+ // if (eventType === "change" || eventType === "rename") {
145
+ // if (
146
+ // changedFile ===
147
+ // test
148
+ // .replace("./", "node/")
149
+ // .split(".")
150
+ // .slice(0, -1)
151
+ // .concat("mjs")
152
+ // .join(".")
153
+ // ) {
154
+ // pm.launchNode(test, destinationOfRuntime(test, "node", config));
155
+ // }
156
+
157
+ // if (
158
+ // changedFile ===
159
+ // test
160
+ // .replace("./", "web/")
161
+ // .split(".")
162
+ // .slice(0, -1)
163
+ // .concat("mjs")
164
+ // .join(".")
165
+ // ) {
166
+ // pm.launchWeb(
167
+ // test,
168
+ // destinationOfRuntime(test, "web", config),
169
+ // sidecars
170
+ // );
171
+ // }
172
+ // }
173
+ // });
174
+ // }
175
+ // }
176
+ // );
143
177
  };
@@ -22,7 +22,7 @@ import { IBaseConfig } from "./lib/types";
22
22
 
23
23
  console.log("hello TaskMan Backend", process.env);
24
24
 
25
- const port = 3000;
25
+ const port = process.env.HTTPS_PORT || "3000";
26
26
 
27
27
  function findTextFiles(dir: string, fileList: string[] = []) {
28
28
  const files = fs.readdirSync(dir);