testeranto 0.110.0 → 0.111.0
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 +1 -1
- package/src/PM/main.ts +418 -92
- package/src/ReportClient.tsx +38 -30
- package/src/run.ts +4 -371
- package/tsc.log +8 -6
- package/dist/common/Init.js +0 -68
- package/dist/common/Node.js +0 -27
- package/dist/common/PM/index.js +0 -7
- package/dist/common/PM/main.js +0 -984
- package/dist/common/PM/node.js +0 -128
- package/dist/common/PM/web.js +0 -121
- package/dist/common/ReportServer.js +0 -22
- package/dist/common/SubPackages/react/component/node.js +0 -19
- package/dist/common/SubPackages/react/component/web.js +0 -19
- package/dist/common/SubPackages/react/jsx/index.js +0 -21
- package/dist/common/SubPackages/react/jsx/node.js +0 -10
- package/dist/common/SubPackages/react/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-dom/component/node.js +0 -88
- package/dist/common/SubPackages/react-dom/component/web.js +0 -67
- package/dist/common/SubPackages/react-dom/jsx/index.js +0 -2
- package/dist/common/SubPackages/react-dom/jsx/node.js +0 -39
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -128
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -2
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +0 -70
- package/dist/common/SubPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/SubPackages/react-test-renderer/component/web.js +0 -8
- package/dist/common/SubPackages/react-test-renderer/fc/node.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +0 -60
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -67
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
- package/dist/common/Types.js +0 -2
- package/dist/common/Web.js +0 -49
- package/dist/common/build.js +0 -222
- package/dist/common/defaultConfig.js +0 -20
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +0 -6
- package/dist/common/esbuildConfigs/featuresPlugin.js +0 -39
- package/dist/common/esbuildConfigs/index.js +0 -21
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -27
- package/dist/common/esbuildConfigs/node.js +0 -37
- package/dist/common/esbuildConfigs/web.js +0 -50
- package/dist/common/init-docs.js +0 -53
- package/dist/common/lib/abstractBase.js +0 -329
- package/dist/common/lib/basebuilder.js +0 -98
- package/dist/common/lib/classBuilder.js +0 -40
- package/dist/common/lib/core.js +0 -117
- package/dist/common/lib/index.js +0 -21
- package/dist/common/lib/types.js +0 -2
- package/dist/common/package.json +0 -3
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/common/run.js +0 -297
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/common/utils.js +0 -43
- package/dist/common/web.html.js +0 -22
- package/dist/module/Footer.js +0 -4
- package/dist/module/Init.js +0 -63
- package/dist/module/Node.js +0 -20
- package/dist/module/PM/index.js +0 -3
- package/dist/module/PM/main.js +0 -944
- package/dist/module/PM/node.js +0 -121
- package/dist/module/PM/web.js +0 -117
- package/dist/module/ReportClient.js +0 -97
- package/dist/module/ReportServer.js +0 -17
- package/dist/module/SubPackages/react/component/node.js +0 -14
- package/dist/module/SubPackages/react/component/web.js +0 -14
- package/dist/module/SubPackages/react/jsx/index.js +0 -15
- package/dist/module/SubPackages/react/jsx/node.js +0 -5
- package/dist/module/SubPackages/react/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-dom/component/node.js +0 -80
- package/dist/module/SubPackages/react-dom/component/web.js +0 -62
- package/dist/module/SubPackages/react-dom/jsx/index.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/node.js +0 -31
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -90
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +0 -31
- package/dist/module/SubPackages/react-test-renderer/component/node.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/component/web.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/fc/node.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -28
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
- package/dist/module/TestReport.js +0 -91
- package/dist/module/Types.js +0 -1
- package/dist/module/Web.js +0 -42
- package/dist/module/build.js +0 -184
- package/dist/module/defaultConfig.js +0 -18
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +0 -3
- package/dist/module/esbuildConfigs/featuresPlugin.js +0 -34
- package/dist/module/esbuildConfigs/index.js +0 -19
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -22
- package/dist/module/esbuildConfigs/node.js +0 -32
- package/dist/module/esbuildConfigs/web.js +0 -45
- package/dist/module/init-docs.js +0 -15
- package/dist/module/lib/abstractBase.js +0 -321
- package/dist/module/lib/basebuilder.js +0 -94
- package/dist/module/lib/classBuilder.js +0 -36
- package/dist/module/lib/core.js +0 -114
- package/dist/module/lib/index.js +0 -17
- package/dist/module/lib/types.js +0 -1
- package/dist/module/package.json +0 -3
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/module/run.js +0 -259
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/module/utils.js +0 -29
- package/dist/module/web.html.js +0 -20
- package/dist/prebuild/ReportClient.css +0 -11367
- package/dist/prebuild/ReportClient.js +0 -23641
- package/dist/prebuild/ReportServer.mjs +0 -16
- package/dist/prebuild/TestReport.css +0 -11367
- package/dist/prebuild/TestReport.js +0 -27484
- package/dist/prebuild/build.mjs +0 -376
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +0 -9
- package/dist/prebuild/init-docs.mjs +0 -104
- package/dist/prebuild/run.mjs +0 -1190
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/Init.d.ts +0 -2
- package/dist/types/Node.d.ts +0 -12
- package/dist/types/PM/index.d.ts +0 -34
- package/dist/types/PM/main.d.ts +0 -59
- package/dist/types/PM/node.d.ts +0 -40
- package/dist/types/PM/web.d.ts +0 -38
- package/dist/types/ReportServer.d.ts +0 -1
- package/dist/types/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/SubPackages/react/jsx/index.d.ts +0 -12
- package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/SubPackages/react-dom/component/node.d.ts +0 -11
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -20
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -7
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -6
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +0 -13
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +0 -16
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -61
- package/dist/types/Web.d.ts +0 -9
- package/dist/types/build.d.ts +0 -1
- package/dist/types/defaultConfig.d.ts +0 -3
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
- package/dist/types/esbuildConfigs/featuresPlugin.d.ts +0 -5
- package/dist/types/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +0 -6
- package/dist/types/esbuildConfigs/node.d.ts +0 -4
- package/dist/types/esbuildConfigs/web.d.ts +0 -4
- package/dist/types/init-docs.d.ts +0 -1
- package/dist/types/lib/abstractBase.d.ts +0 -110
- package/dist/types/lib/basebuilder.d.ts +0 -27
- package/dist/types/lib/classBuilder.d.ts +0 -7
- package/dist/types/lib/core.d.ts +0 -7
- package/dist/types/lib/index.d.ts +0 -83
- package/dist/types/lib/types.d.ts +0 -14
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/dist/types/run.d.ts +0 -1
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/utils.d.ts +0 -9
- package/dist/types/web.html.d.ts +0 -2
package/dist/common/run.js
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const ansi_colors_1 = __importDefault(require("ansi-colors"));
|
|
40
|
-
const fs_1 = require("fs");
|
|
41
|
-
const path_1 = __importDefault(require("path"));
|
|
42
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
43
|
-
const fs_2 = __importDefault(require("fs"));
|
|
44
|
-
const tsc_prog_1 = __importDefault(require("tsc-prog"));
|
|
45
|
-
const eslint_1 = require("eslint");
|
|
46
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
47
|
-
const readline_1 = __importDefault(require("readline"));
|
|
48
|
-
const main_1 = require("./PM/main");
|
|
49
|
-
const utils_1 = require("./utils");
|
|
50
|
-
console.log(ansi_colors_1.default.inverse("Press 'x' to shutdown forcefully."));
|
|
51
|
-
readline_1.default.emitKeypressEvents(process.stdin);
|
|
52
|
-
if (process.stdin.isTTY)
|
|
53
|
-
process.stdin.setRawMode(true);
|
|
54
|
-
process.stdin.on("keypress", (str, key) => {
|
|
55
|
-
if (key.name === "x") {
|
|
56
|
-
console.log(ansi_colors_1.default.inverse("Shutting down forcefully..."));
|
|
57
|
-
process.exit(-1);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
async function fileHash(filePath, algorithm = "md5") {
|
|
61
|
-
return new Promise((resolve, reject) => {
|
|
62
|
-
const hash = node_crypto_1.default.createHash(algorithm);
|
|
63
|
-
const fileStream = fs_2.default.createReadStream(filePath);
|
|
64
|
-
fileStream.on("data", (data) => {
|
|
65
|
-
hash.update(data);
|
|
66
|
-
});
|
|
67
|
-
fileStream.on("end", () => {
|
|
68
|
-
const fileHash = hash.digest("hex");
|
|
69
|
-
resolve(fileHash);
|
|
70
|
-
});
|
|
71
|
-
fileStream.on("error", (error) => {
|
|
72
|
-
reject(`Error reading file: ${error.message}`);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
async function filesHash(files, algorithm = "md5") {
|
|
77
|
-
return new Promise((resolve, reject) => {
|
|
78
|
-
resolve(files.reduce(async (mm, f) => {
|
|
79
|
-
return (await mm) + (await fileHash(f));
|
|
80
|
-
}, Promise.resolve("")));
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
const getRunnables = (tests, payload = {
|
|
84
|
-
nodeEntryPoints: {},
|
|
85
|
-
webEntryPoints: {},
|
|
86
|
-
}) => {
|
|
87
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
88
|
-
if (cv[1] === "node") {
|
|
89
|
-
pt.nodeEntryPoints[cv[0]] = path_1.default.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
90
|
-
}
|
|
91
|
-
else if (cv[1] === "web") {
|
|
92
|
-
pt.webEntryPoints[cv[0]] = path_1.default.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
93
|
-
}
|
|
94
|
-
if (cv[3].length) {
|
|
95
|
-
getRunnables(cv[3], payload);
|
|
96
|
-
}
|
|
97
|
-
return pt;
|
|
98
|
-
}, payload);
|
|
99
|
-
};
|
|
100
|
-
const changes = {};
|
|
101
|
-
const tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
|
|
102
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`tsc < ${entrypoint}`)));
|
|
103
|
-
const program = tsc_prog_1.default.createProgramFromConfig({
|
|
104
|
-
basePath: process.cwd(), // always required, used for relative paths
|
|
105
|
-
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
106
|
-
compilerOptions: {
|
|
107
|
-
rootDir: "src",
|
|
108
|
-
outDir: (0, utils_1.tscPather)(entrypoint, platform),
|
|
109
|
-
// declaration: true,
|
|
110
|
-
// skipLibCheck: true,
|
|
111
|
-
noEmit: true,
|
|
112
|
-
},
|
|
113
|
-
include: addableFiles, //["src/**/*"],
|
|
114
|
-
// exclude: ["**/*.test.ts", "**/*.spec.ts"],
|
|
115
|
-
});
|
|
116
|
-
const tscPath = (0, utils_1.tscPather)(entrypoint, platform);
|
|
117
|
-
let allDiagnostics = program.getSemanticDiagnostics();
|
|
118
|
-
const d = [];
|
|
119
|
-
allDiagnostics.forEach((diagnostic) => {
|
|
120
|
-
if (diagnostic.file) {
|
|
121
|
-
let { line, character } = typescript_1.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
122
|
-
let message = typescript_1.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
123
|
-
d.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
d.push(typescript_1.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
fs_2.default.writeFileSync(tscPath, d.join("\n"));
|
|
130
|
-
fs_2.default.writeFileSync((0, utils_1.tscExitCodePather)(entrypoint, platform), d.length.toString());
|
|
131
|
-
};
|
|
132
|
-
const eslint = new eslint_1.ESLint();
|
|
133
|
-
const formatter = await eslint.loadFormatter("./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs");
|
|
134
|
-
const eslintCheck = async (entrypoint, platform, addableFiles) => {
|
|
135
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`eslint < ${entrypoint}`)));
|
|
136
|
-
const results = (await eslint.lintFiles(addableFiles))
|
|
137
|
-
.filter((r) => r.messages.length)
|
|
138
|
-
.filter((r) => {
|
|
139
|
-
return r.messages[0].ruleId !== null;
|
|
140
|
-
})
|
|
141
|
-
.map((r) => {
|
|
142
|
-
delete r.source;
|
|
143
|
-
return r;
|
|
144
|
-
});
|
|
145
|
-
fs_2.default.writeFileSync((0, utils_1.lintPather)(entrypoint, platform), await formatter.format(results));
|
|
146
|
-
fs_2.default.writeFileSync((0, utils_1.lintExitCodePather)(entrypoint, platform), results.length.toString());
|
|
147
|
-
};
|
|
148
|
-
const makePrompt = async (entryPoint, addableFiles, platform) => {
|
|
149
|
-
const promptPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
|
|
150
|
-
const testPaths = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
|
|
151
|
-
const featuresPath = path_1.default.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
|
|
152
|
-
fs_2.default.writeFileSync(promptPath, `
|
|
153
|
-
${addableFiles
|
|
154
|
-
.map((x) => {
|
|
155
|
-
return `/add ${x}`;
|
|
156
|
-
})
|
|
157
|
-
.join("\n")}
|
|
158
|
-
|
|
159
|
-
/read ${(0, utils_1.lintPather)(entryPoint, platform)}
|
|
160
|
-
/read ${(0, utils_1.tscPather)(entryPoint, platform)}
|
|
161
|
-
/read ${testPaths}
|
|
162
|
-
|
|
163
|
-
/load ${featuresPath}
|
|
164
|
-
|
|
165
|
-
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files ${(0, utils_1.tscPather)(entryPoint, platform)}. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${(0, utils_1.lintPather)(entryPoint, platform)}"
|
|
166
|
-
`);
|
|
167
|
-
};
|
|
168
|
-
const metafileOutputs = async (platform) => {
|
|
169
|
-
const metafile = JSON.parse(fs_2.default.readFileSync(`docs/${platform}/metafile.json`).toString()).metafile;
|
|
170
|
-
if (!metafile)
|
|
171
|
-
return;
|
|
172
|
-
const outputs = metafile.outputs;
|
|
173
|
-
Object.keys(outputs).forEach(async (k) => {
|
|
174
|
-
const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
|
|
175
|
-
if (!fs_2.default.existsSync(i))
|
|
176
|
-
return false;
|
|
177
|
-
if (i.startsWith("node_modules"))
|
|
178
|
-
return false;
|
|
179
|
-
return true;
|
|
180
|
-
});
|
|
181
|
-
const f = `${k.split(".").slice(0, -1).join(".")}/`;
|
|
182
|
-
if (!fs_2.default.existsSync(f)) {
|
|
183
|
-
fs_2.default.mkdirSync(f);
|
|
184
|
-
}
|
|
185
|
-
const entrypoint = outputs[k].entryPoint;
|
|
186
|
-
if (entrypoint) {
|
|
187
|
-
const changeDigest = await filesHash(addableFiles);
|
|
188
|
-
if (changeDigest === changes[entrypoint]) {
|
|
189
|
-
// skip
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
changes[entrypoint] = changeDigest;
|
|
193
|
-
tscCheck({ platform, addableFiles, entrypoint });
|
|
194
|
-
eslintCheck(entrypoint, platform, addableFiles);
|
|
195
|
-
makePrompt(entrypoint, addableFiles, platform);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then(async (module) => {
|
|
201
|
-
const rawConfig = module.default;
|
|
202
|
-
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
|
|
203
|
-
let mode = config.devMode ? "DEV" : "PROD";
|
|
204
|
-
const fileHashes = {};
|
|
205
|
-
let pm = new main_1.PM_Main(config);
|
|
206
|
-
console.log(ansi_colors_1.default.inverse(`Press 'q' to shutdown gracefully`));
|
|
207
|
-
process.stdin.on("keypress", (str, key) => {
|
|
208
|
-
if (key.name === "q") {
|
|
209
|
-
console.log(ansi_colors_1.default.inverse("Testeranto-Run is shutting down gracefully..."));
|
|
210
|
-
mode = "PROD";
|
|
211
|
-
// onDone();
|
|
212
|
-
nodeMetafileWatcher.close();
|
|
213
|
-
webMetafileWatcher.close();
|
|
214
|
-
pm.shutDown();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
metafileOutputs("node");
|
|
218
|
-
const nodeMetafileWatcher = (0, fs_1.watch)("docs/node/metafile.json", async (e, filename) => {
|
|
219
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename} (node)`)));
|
|
220
|
-
metafileOutputs("node");
|
|
221
|
-
});
|
|
222
|
-
metafileOutputs("web");
|
|
223
|
-
const webMetafileWatcher = (0, fs_1.watch)("docs/web/metafile.json", async (e, filename) => {
|
|
224
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename} (web)`)));
|
|
225
|
-
metafileOutputs("web");
|
|
226
|
-
});
|
|
227
|
-
await pm.startPuppeteer({
|
|
228
|
-
slowMo: 1,
|
|
229
|
-
// timeout: 1,
|
|
230
|
-
waitForInitialPage: false,
|
|
231
|
-
executablePath:
|
|
232
|
-
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
233
|
-
"/opt/homebrew/bin/chromium",
|
|
234
|
-
headless: true,
|
|
235
|
-
dumpio: true,
|
|
236
|
-
// timeout: 0,
|
|
237
|
-
devtools: true,
|
|
238
|
-
args: [
|
|
239
|
-
"--auto-open-devtools-for-tabs",
|
|
240
|
-
`--remote-debugging-port=3234`,
|
|
241
|
-
// "--disable-features=IsolateOrigins,site-per-process",
|
|
242
|
-
"--disable-site-isolation-trials",
|
|
243
|
-
"--allow-insecure-localhost",
|
|
244
|
-
"--allow-file-access-from-files",
|
|
245
|
-
"--allow-running-insecure-content",
|
|
246
|
-
"--disable-dev-shm-usage",
|
|
247
|
-
"--disable-extensions",
|
|
248
|
-
"--disable-gpu",
|
|
249
|
-
"--disable-setuid-sandbox",
|
|
250
|
-
"--disable-site-isolation-trials",
|
|
251
|
-
"--disable-web-security",
|
|
252
|
-
"--no-first-run",
|
|
253
|
-
"--no-sandbox",
|
|
254
|
-
"--no-startup-window",
|
|
255
|
-
// "--no-zygote",
|
|
256
|
-
"--reduce-security-for-testing",
|
|
257
|
-
"--remote-allow-origins=*",
|
|
258
|
-
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
259
|
-
// "--disable-features=IsolateOrigins",
|
|
260
|
-
// "--remote-allow-origins=ws://localhost:3234",
|
|
261
|
-
// "--single-process",
|
|
262
|
-
// "--unsafely-treat-insecure-origin-as-secure",
|
|
263
|
-
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
264
|
-
// "--disk-cache-dir=/dev/null",
|
|
265
|
-
// "--disk-cache-size=1",
|
|
266
|
-
// "--start-maximized",
|
|
267
|
-
],
|
|
268
|
-
}, ".");
|
|
269
|
-
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
270
|
-
Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
271
|
-
pm.launchNode(k, outputFile);
|
|
272
|
-
try {
|
|
273
|
-
(0, fs_1.watch)(outputFile, async (e, filename) => {
|
|
274
|
-
const hash = await fileHash(outputFile);
|
|
275
|
-
if (fileHashes[k] !== hash) {
|
|
276
|
-
fileHashes[k] = hash;
|
|
277
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename}`)));
|
|
278
|
-
pm.launchNode(k, outputFile);
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
catch (e) {
|
|
283
|
-
console.error(e);
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
287
|
-
pm.launchWeb(k, outputFile);
|
|
288
|
-
(0, fs_1.watch)(outputFile, async (e, filename) => {
|
|
289
|
-
const hash = await fileHash(outputFile);
|
|
290
|
-
if (fileHashes[k] !== hash) {
|
|
291
|
-
fileHashes[k] = hash;
|
|
292
|
-
console.log(ansi_colors_1.default.green(ansi_colors_1.default.inverse(`< ${e} ${filename}`)));
|
|
293
|
-
pm.launchWeb(k, outputFile);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
});
|