testeranto 0.100.0 → 0.110.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/README.md +1 -0
- package/bundle.js +80 -30
- package/dist/common/{dist/module/src/Init.js → Init.js} +28 -0
- package/dist/common/{src/PM → PM}/main.js +138 -95
- package/dist/common/ReportServer.js +22 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/index.js +0 -12
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +1 -1
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +41 -30
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +18 -14
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +17 -7
- package/dist/common/build.js +222 -0
- package/dist/common/{src/defaultConfig.js → defaultConfig.js} +1 -0
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
- package/dist/common/{src/init-docs.js → init-docs.js} +20 -10
- package/dist/common/{src/lib → lib}/abstractBase.js +6 -1
- package/dist/common/{src/lib → lib}/basebuilder.js +23 -10
- package/dist/common/{src/lib → lib}/classBuilder.js +1 -3
- package/dist/common/{src/lib → lib}/core.js +26 -10
- package/dist/common/{src/lib → lib}/index.js +0 -1
- package/dist/common/{src/lib → lib}/types.js +0 -1
- package/dist/common/run.js +297 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +43 -0
- package/dist/module/Footer.js +4 -0
- package/dist/module/Init.js +63 -0
- package/dist/module/{src/PM → PM}/main.js +119 -86
- package/dist/module/ReportClient.js +97 -0
- package/dist/module/ReportServer.js +17 -0
- package/dist/module/SubPackages/react/jsx/index.js +15 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +3 -3
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +24 -23
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +1 -7
- package/dist/module/TestReport.js +91 -0
- package/dist/module/build.js +184 -0
- package/dist/module/{src/defaultConfig.js → defaultConfig.js} +1 -0
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
- package/dist/module/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
- package/dist/module/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
- package/dist/module/{src/init-docs.js → init-docs.js} +1 -1
- package/dist/module/{src/lib → lib}/abstractBase.js +6 -1
- package/dist/module/{src/lib → lib}/basebuilder.js +23 -10
- package/dist/module/{src/lib → lib}/classBuilder.js +1 -3
- package/dist/module/{src/lib → lib}/core.js +26 -10
- package/dist/module/{src/lib → lib}/index.js +0 -1
- package/dist/module/run.js +259 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +29 -0
- package/dist/prebuild/ReportClient.css +11367 -0
- package/dist/prebuild/ReportClient.js +23641 -0
- package/dist/prebuild/ReportServer.mjs +16 -0
- package/dist/prebuild/TestReport.css +11367 -0
- package/dist/prebuild/TestReport.js +27484 -0
- package/dist/prebuild/build.mjs +376 -0
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
- package/dist/prebuild/init-docs.mjs +64 -8
- package/dist/prebuild/{cli2.mjs → run.mjs} +353 -81
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Node.d.ts +12 -0
- package/dist/types/{src/PM → PM}/index.d.ts +1 -1
- package/dist/types/{src/PM → PM}/main.d.ts +12 -9
- package/dist/types/{src/PM → PM}/node.d.ts +2 -4
- package/dist/types/{src/PM → PM}/web.d.ts +2 -4
- package/dist/types/SubPackages/react/component/node.d.ts +7 -0
- package/dist/types/SubPackages/react/component/web.d.ts +7 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
- package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
- package/dist/types/Types.d.ts +61 -0
- package/dist/types/Web.d.ts +9 -0
- package/dist/types/defaultConfig.d.ts +3 -0
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +1 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +1 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +1 -1
- package/dist/types/init-docs.d.ts +1 -0
- package/dist/types/lib/abstractBase.d.ts +110 -0
- package/dist/types/lib/basebuilder.d.ts +27 -0
- package/dist/types/lib/classBuilder.d.ts +7 -0
- package/dist/types/lib/core.d.ts +7 -0
- package/dist/types/lib/index.d.ts +83 -0
- package/dist/types/lib/types.d.ts +14 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +9 -0
- package/package.json +40 -32
- package/src/Footer.tsx +4 -0
- package/src/Init.ts +48 -0
- package/src/Node.ts +23 -17
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +143 -101
- package/src/PM/node.ts +2 -2
- package/src/PM/web.ts +1 -1
- package/src/ReportClient.tsx +155 -0
- package/src/ReportServer.ts +21 -0
- package/src/SubPackages/react/component/node.ts +68 -24
- package/src/SubPackages/react/component/web.ts +68 -25
- package/src/SubPackages/react/jsx/index.ts +39 -18
- package/src/SubPackages/react/jsx/node.ts +12 -10
- package/src/SubPackages/react/jsx/web.ts +27 -14
- package/src/SubPackages/react-dom/component/node.ts +42 -50
- package/src/SubPackages/react-dom/component/web.ts +28 -10
- package/src/SubPackages/react-dom/jsx/node.ts +54 -56
- package/src/SubPackages/react-dom/jsx/web.ts +55 -42
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
- package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
- package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
- package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
- package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
- package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
- package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
- package/src/SubPackages/react-test-renderer/jsx/node.ts +8 -6
- package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
- package/src/TestReport.tsx +176 -0
- package/src/Types.ts +63 -309
- package/src/Web.ts +24 -18
- package/src/build.ts +240 -0
- package/src/defaultConfig.ts +2 -1
- package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
- package/src/esbuildConfigs/featuresPlugin.ts +0 -1
- package/src/esbuildConfigs/index.ts +1 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +2 -135
- package/src/esbuildConfigs/node.ts +4 -13
- package/src/esbuildConfigs/web.ts +3 -19
- package/src/init-docs.ts +2 -1
- package/src/lib/abstractBase.ts +82 -80
- package/src/lib/basebuilder.ts +57 -45
- package/src/lib/classBuilder.ts +15 -15
- package/src/lib/core.ts +44 -35
- package/src/lib/index.ts +47 -98
- package/src/lib/readme.md +12 -0
- package/src/lib/types.ts +53 -70
- package/src/run.ts +398 -0
- package/src/style.css +8 -0
- package/src/utils.ts +74 -2
- package/tsc.log +106 -0
- package/Bundle.Dockerfile +0 -52
- package/bin/init-docs.js +0 -24
- package/dist/common/src/Init.js +0 -40
- package/dist/common/src/SubPackages/puppeteer.js +0 -21
- package/dist/common/src/cli.js +0 -439
- package/dist/common/src/cli2.js +0 -144
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -99
- package/dist/common/src/utils.js +0 -16
- package/dist/common/testeranto.js +0 -15
- package/dist/module/src/Init.js +0 -35
- package/dist/module/src/SubPackages/puppeteer.js +0 -16
- package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
- package/dist/module/src/cli.js +0 -411
- package/dist/module/src/cli2.js +0 -116
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -94
- package/dist/module/src/lib/types.js +0 -2
- package/dist/module/src/utils.js +0 -9
- package/dist/module/testeranto.js +0 -13
- package/dist/prebuild/cli.mjs +0 -1491
- package/dist/types/dist/module/src/Init.d.ts +0 -2
- package/dist/types/src/Node.d.ts +0 -13
- package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
- package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
- package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
- package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
- package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
- package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
- package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
- package/dist/types/src/Types.d.ts +0 -90
- package/dist/types/src/Web.d.ts +0 -10
- package/dist/types/src/defaultConfig.d.ts +0 -3
- package/dist/types/src/lib/abstractBase.d.ts +0 -110
- package/dist/types/src/lib/basebuilder.d.ts +0 -27
- package/dist/types/src/lib/classBuilder.d.ts +0 -7
- package/dist/types/src/lib/core.d.ts +0 -8
- package/dist/types/src/lib/index.d.ts +0 -60
- package/dist/types/src/lib/types.d.ts +0 -40
- package/dist/types/src/utils.d.ts +0 -2
- package/dist/types/testeranto.d.ts +0 -16
- package/docker-compose.yml +0 -37
- package/src/SubPackages/puppeteer.ts +0 -51
- package/src/cli.ts +0 -535
- package/src/cli2.ts +0 -157
- package/testeranto.ts +0 -13
- package/dist/common/{src/Node.js → Node.js} +0 -0
- package/dist/common/{src/PM → PM}/index.js +0 -0
- package/dist/common/{src/PM → PM}/node.js +0 -0
- package/dist/common/{src/PM → PM}/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- package/dist/common/{src/Types.js → Types.js} +0 -0
- package/dist/common/{src/Web.js → Web.js} +0 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
- package/dist/common/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
- package/dist/common/{src/web.html.js → web.html.js} +0 -0
- package/dist/module/{src/Node.js → Node.js} +0 -0
- package/dist/module/{src/PM → PM}/index.js +0 -0
- package/dist/module/{src/PM → PM}/node.js +0 -0
- package/dist/module/{src/PM → PM}/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
- /package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/module/{src/Types.js → Types.js} +0 -0
- /package/dist/module/{src/Web.js → Web.js} +0 -0
- /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
- /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
- /package/dist/{types/src/cli.d.ts → module/lib/types.js} +0 -0
- /package/dist/module/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
- /package/dist/module/{src/web.html.js → web.html.js} +0 -0
- /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
- /package/dist/types/{src/cli2.d.ts → ReportServer.d.ts} +0 -0
- /package/dist/types/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
- /package/dist/types/{src/init-docs.d.ts → build.d.ts} +0 -0
- /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
- /package/dist/types/{src/puppeteerConfiger.d.ts → puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{src/web.html.d.ts → web.html.d.ts} +0 -0
|
@@ -16,18 +16,9 @@ exports.default = (config, entryPoints) => {
|
|
|
16
16
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
17
17
|
}, absWorkingDir: process.cwd(), banner: {
|
|
18
18
|
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
19
|
-
}, platform: "node", external: [
|
|
20
|
-
// "testeranto.json",
|
|
21
|
-
// "features.test.js",
|
|
22
|
-
"react",
|
|
23
|
-
// "events",
|
|
24
|
-
// "ganache"
|
|
25
|
-
...config.externals,
|
|
26
|
-
], entryPoints: [...entryPoints], plugins: [
|
|
19
|
+
}, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
|
|
27
20
|
featuresPlugin_1.default,
|
|
28
|
-
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
29
21
|
inputFilesPluginFactory,
|
|
30
|
-
// inputFilesPlugin("node", entryPoints),
|
|
31
22
|
{
|
|
32
23
|
name: "rebuild-notify",
|
|
33
24
|
setup(build) {
|
|
@@ -41,5 +32,6 @@ exports.default = (config, entryPoints) => {
|
|
|
41
32
|
});
|
|
42
33
|
},
|
|
43
34
|
},
|
|
35
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
44
36
|
] });
|
|
45
37
|
};
|
|
@@ -9,19 +9,9 @@ const inputFilesPlugin_js_1 = __importDefault(require("./inputFilesPlugin.js"));
|
|
|
9
9
|
const featuresPlugin_js_1 = __importDefault(require("./featuresPlugin.js"));
|
|
10
10
|
exports.default = (config, entryPoints) => {
|
|
11
11
|
const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("web", entryPoints);
|
|
12
|
-
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), {
|
|
13
|
-
// inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
|
|
14
|
-
// banner: {
|
|
15
|
-
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
16
|
-
// },
|
|
17
|
-
// splitting: true,
|
|
18
|
-
outdir: config.outdir + "/web", alias: {
|
|
12
|
+
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { outdir: config.outdir + "/web", alias: {
|
|
19
13
|
react: path_1.default.resolve("./node_modules/react"),
|
|
20
14
|
}, metafile: true, external: [
|
|
21
|
-
// "testeranto.json",
|
|
22
|
-
// "features.test.ts",
|
|
23
|
-
// "url",
|
|
24
|
-
// "react",
|
|
25
15
|
"path",
|
|
26
16
|
"fs",
|
|
27
17
|
"stream",
|
|
@@ -41,8 +31,6 @@ exports.default = (config, entryPoints) => {
|
|
|
41
31
|
"dns",
|
|
42
32
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
43
33
|
featuresPlugin_js_1.default,
|
|
44
|
-
// markdownPlugin({}),
|
|
45
|
-
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
46
34
|
inputFilesPluginFactory,
|
|
47
35
|
{
|
|
48
36
|
name: "rebuild-notify",
|
|
@@ -57,5 +45,6 @@ exports.default = (config, entryPoints) => {
|
|
|
57
45
|
});
|
|
58
46
|
},
|
|
59
47
|
},
|
|
48
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
60
49
|
] });
|
|
61
50
|
};
|
|
@@ -15,29 +15,39 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
const fs_1 = __importDefault(require("fs"));
|
|
30
|
-
const Init_1 = __importDefault(require("
|
|
40
|
+
const Init_1 = __importDefault(require("./Init"));
|
|
31
41
|
console.log("Initializing a testeranto project");
|
|
32
42
|
if (!process.argv[2]) {
|
|
33
43
|
console.log("You didn't pass a config file, so I will create one for you.");
|
|
34
44
|
fs_1.default.writeFileSync("testeranto.mts", fs_1.default.readFileSync("node_modules/testeranto/src/defaultConfig.ts"));
|
|
35
|
-
Promise.resolve(
|
|
45
|
+
Promise.resolve(`${process.cwd() + "/" + "testeranto.mts"}`).then(s => __importStar(require(s))).then((module) => {
|
|
36
46
|
(0, Init_1.default)(module.default);
|
|
37
47
|
});
|
|
38
48
|
}
|
|
39
49
|
else {
|
|
40
|
-
Promise.resolve(
|
|
50
|
+
Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then((module) => {
|
|
41
51
|
(0, Init_1.default)(module.default);
|
|
42
52
|
});
|
|
43
53
|
}
|
|
@@ -60,6 +60,7 @@ class BaseSuite {
|
|
|
60
60
|
if (prop === "writeFileSync") {
|
|
61
61
|
return (fp, contents) => target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
|
|
62
62
|
}
|
|
63
|
+
/* @ts-ignore:next-line */
|
|
63
64
|
return Reflect.get(...arguments);
|
|
64
65
|
},
|
|
65
66
|
});
|
|
@@ -160,6 +161,7 @@ class BaseGiven {
|
|
|
160
161
|
if (prop === "screencast") {
|
|
161
162
|
return (opts, p) => target.screencast(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}` }), p);
|
|
162
163
|
}
|
|
164
|
+
/* @ts-ignore:next-line */
|
|
163
165
|
return Reflect.get(...arguments);
|
|
164
166
|
},
|
|
165
167
|
});
|
|
@@ -194,6 +196,7 @@ class BaseGiven {
|
|
|
194
196
|
if (prop === "writeFileSync") {
|
|
195
197
|
return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterEach/${fp}`, contents);
|
|
196
198
|
}
|
|
199
|
+
/* @ts-ignore:next-line */
|
|
197
200
|
return Reflect.get(...arguments);
|
|
198
201
|
},
|
|
199
202
|
});
|
|
@@ -231,6 +234,7 @@ class BaseWhen {
|
|
|
231
234
|
if (prop === "writeFileSync") {
|
|
232
235
|
return (fp, contents) => target[prop](`${filepath}/andWhen/${fp}`, contents);
|
|
233
236
|
}
|
|
237
|
+
/* @ts-ignore:next-line */
|
|
234
238
|
return Reflect.get(...arguments);
|
|
235
239
|
},
|
|
236
240
|
});
|
|
@@ -275,6 +279,7 @@ class BaseThen {
|
|
|
275
279
|
if (prop === "writeFileSync") {
|
|
276
280
|
return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
|
|
277
281
|
}
|
|
282
|
+
/* @ts-ignore:next-line */
|
|
278
283
|
return Reflect.get(...arguments);
|
|
279
284
|
},
|
|
280
285
|
});
|
|
@@ -304,7 +309,7 @@ class BaseCheck {
|
|
|
304
309
|
}
|
|
305
310
|
async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
|
|
306
311
|
tLog(`\n Check: ${this.name}`);
|
|
307
|
-
const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
|
|
312
|
+
const store = await this.checkThat(subject, testResourceConfiguration, artifactory, pm);
|
|
308
313
|
await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
|
|
309
314
|
a[key] = async (payload) => {
|
|
310
315
|
return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm, "x");
|
|
@@ -42,17 +42,30 @@ class BaseBuilder {
|
|
|
42
42
|
const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
|
|
43
43
|
return suiteDone.givens[k].error;
|
|
44
44
|
}).length;
|
|
45
|
-
puppetMaster.writeFileSync(`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
puppetMaster.writeFileSync(`bdd_errors.txt`, numberOfFailures.toString());
|
|
46
|
+
const o = this.toObj();
|
|
47
|
+
puppetMaster.writeFileSync(`littleBoard.html`, `
|
|
48
|
+
<!DOCTYPE html>
|
|
49
|
+
<html lang="en">
|
|
50
|
+
|
|
51
|
+
<head>
|
|
52
|
+
<meta name="description" content="Webpage description goes here" />
|
|
53
|
+
<meta charset="utf-8" />
|
|
54
|
+
<title>kokomoBay - testeranto</title>
|
|
55
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
56
|
+
<meta name="author" content="" />
|
|
57
|
+
|
|
58
|
+
<link rel="stylesheet" href="/kokomoBay/docs/TestReport.css" />
|
|
59
|
+
<script src="/kokomoBay/docs/TestReport.js"></script>
|
|
60
|
+
|
|
61
|
+
</head>
|
|
62
|
+
|
|
63
|
+
<body>
|
|
64
|
+
<h1>Test report</h1>
|
|
65
|
+
<div id="root"/>
|
|
66
|
+
</body>
|
|
67
|
+
`);
|
|
54
68
|
puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
|
|
55
|
-
// console.log(`exiting gracefully with ${numberOfFailures} failures.`);
|
|
56
69
|
return {
|
|
57
70
|
failed: numberOfFailures,
|
|
58
71
|
artifacts: this.artifacts || [],
|
|
@@ -34,9 +34,7 @@ class ClassBuilder extends basebuilder_js_1.BaseBuilder {
|
|
|
34
34
|
};
|
|
35
35
|
return a;
|
|
36
36
|
}, {});
|
|
37
|
-
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification
|
|
38
|
-
// puppetMaster
|
|
39
|
-
);
|
|
37
|
+
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
exports.ClassBuilder = ClassBuilder;
|
|
@@ -8,16 +8,22 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
|
|
|
8
8
|
const fullTestInterface = (0, index_js_1.DefaultTestInterface)(testInterface);
|
|
9
9
|
super(testImplementation, testSpecification, input, class extends abstractBase_js_1.BaseSuite {
|
|
10
10
|
afterAll(store, artifactory, pm) {
|
|
11
|
-
return fullTestInterface.afterAll(store,
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return fullTestInterface.afterAll(store,
|
|
12
|
+
// (fPath: string, value: unknown) =>
|
|
13
|
+
// // TODO does not work?
|
|
14
|
+
// {
|
|
15
|
+
// artifactory(`afterAll4-${this.name}/${fPath}`, value);
|
|
16
|
+
// },
|
|
17
|
+
pm);
|
|
14
18
|
}
|
|
15
19
|
assertThat(t) {
|
|
16
20
|
fullTestInterface.assertThis(t);
|
|
17
21
|
}
|
|
18
22
|
async setup(s, artifactory, tr, pm) {
|
|
19
23
|
return (fullTestInterface.beforeAll ||
|
|
20
|
-
(async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration,
|
|
24
|
+
(async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration,
|
|
25
|
+
// artifactory,
|
|
26
|
+
pm);
|
|
21
27
|
}
|
|
22
28
|
}, class Given extends abstractBase_js_1.BaseGiven {
|
|
23
29
|
constructor() {
|
|
@@ -25,10 +31,15 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
|
|
|
25
31
|
this.uberCatcher = uberCatcher;
|
|
26
32
|
}
|
|
27
33
|
async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
|
|
28
|
-
return fullTestInterface.beforeEach(subject, initializer,
|
|
34
|
+
return fullTestInterface.beforeEach(subject, initializer,
|
|
35
|
+
// artifactory,
|
|
36
|
+
testResource, initialValues, pm);
|
|
29
37
|
}
|
|
30
38
|
afterEach(store, key, artifactory, pm) {
|
|
31
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
39
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
40
|
+
// (fPath: string, value: unknown) =>
|
|
41
|
+
// artifactory(`after/${fPath}`, value),
|
|
42
|
+
pm)));
|
|
32
43
|
}
|
|
33
44
|
}, class When extends abstractBase_js_1.BaseWhen {
|
|
34
45
|
async andWhen(store, whenCB, testResource, pm) {
|
|
@@ -88,12 +99,17 @@ class Testeranto extends classBuilder_js_1.ClassBuilder {
|
|
|
88
99
|
this.initialValues = initialValues;
|
|
89
100
|
}
|
|
90
101
|
async checkThat(subject, testResourceConfiguration, artifactory, pm) {
|
|
91
|
-
return fullTestInterface.beforeEach(subject, this.initialValues,
|
|
102
|
+
return fullTestInterface.beforeEach(subject, this.initialValues,
|
|
103
|
+
// (fPath: string, value: unknown) =>
|
|
104
|
+
// artifactory(`before/${fPath}`, value),
|
|
105
|
+
testResourceConfiguration, this.initialValues, pm);
|
|
92
106
|
}
|
|
93
107
|
afterEach(store, key, artifactory, pm) {
|
|
94
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
95
|
-
//
|
|
96
|
-
|
|
108
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
109
|
+
// (fPath: string, value: unknown) =>
|
|
110
|
+
// // TODO does not work?
|
|
111
|
+
// artifactory(`afterEach2-${this.name}/${fPath}`, value),
|
|
112
|
+
pm)));
|
|
97
113
|
}
|
|
98
114
|
}, testResourceRequirement);
|
|
99
115
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultTestResourceRequirement = exports.DefaultTestInterface = exports.BaseTestInterface = void 0;
|
|
4
|
-
// import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
|
|
5
4
|
exports.BaseTestInterface = {
|
|
6
5
|
beforeAll: async (s) => s,
|
|
7
6
|
beforeEach: async function (subject, initialValues, x, testResource, pm) {
|
|
@@ -0,0 +1,297 @@
|
|
|
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
|
+
});
|