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
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "esbuild";
|
|
2
|
-
import { IGivens, BaseCheck, BaseSuite, BaseGiven, BaseWhen, BaseThen } from "./abstractBase";
|
|
3
|
-
import { IBaseTest } from "../Types";
|
|
4
|
-
export declare type IFinalResults = {
|
|
5
|
-
features: string[];
|
|
6
|
-
failed: number;
|
|
7
|
-
};
|
|
8
|
-
export declare type IRunTime = `node` | `web`;
|
|
9
|
-
export declare type ITestTypes = [string, IRunTime, {
|
|
10
|
-
ports: number;
|
|
11
|
-
}, ITestTypes[]];
|
|
12
|
-
export declare type IJsonConfig = {
|
|
13
|
-
outdir: string;
|
|
14
|
-
tests: ITestTypes[];
|
|
15
|
-
botEmail: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type IPlugin = (register: (entrypoint: any, sources: any) => any, entrypoints: any) => Plugin;
|
|
18
|
-
export declare type IBaseConfig = {
|
|
19
|
-
src: string;
|
|
20
|
-
clearScreen: boolean;
|
|
21
|
-
debugger: boolean;
|
|
22
|
-
devMode: boolean;
|
|
23
|
-
externals: string[];
|
|
24
|
-
minify: boolean;
|
|
25
|
-
outbase: string;
|
|
26
|
-
outdir: string;
|
|
27
|
-
ports: string[];
|
|
28
|
-
tests: ITestTypes[];
|
|
29
|
-
nodePlugins: IPlugin[];
|
|
30
|
-
webPlugins: IPlugin[];
|
|
31
|
-
featureIngestor: (s: string) => Promise<string>;
|
|
32
|
-
};
|
|
33
|
-
export declare type IBuiltConfig = {
|
|
34
|
-
buildDir: string;
|
|
35
|
-
} & IBaseConfig;
|
|
36
|
-
export declare type ISuiteKlasser<ITestShape extends IBaseTest<unknown, unknown, unknown, unknown, unknown, unknown, unknown, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>> = (name: string, index: number, givens: IGivens<ITestShape>, checks: BaseCheck<ITestShape>[]) => BaseSuite<ITestShape>;
|
|
37
|
-
export declare type IGivenKlasser<ITestShape extends IBaseTest<unknown, unknown, unknown, unknown, unknown, unknown, unknown, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>> = (name: any, features: any, whens: any, thens: any, givenCB: any) => BaseGiven<ITestShape>;
|
|
38
|
-
export declare type IWhenKlasser<ITestShape extends IBaseTest<unknown, unknown, unknown, unknown, unknown, unknown, unknown, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>> = (s: any, o: any) => BaseWhen<ITestShape>;
|
|
39
|
-
export declare type IThenKlasser<ITestShape extends IBaseTest<unknown, unknown, unknown, unknown, unknown, unknown, unknown, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>> = (s: any, o: any) => BaseThen<ITestShape>;
|
|
40
|
-
export declare type ICheckKlasser<ITestShape extends IBaseTest<unknown, unknown, unknown, unknown, unknown, unknown, unknown, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>> = (n: any, f: any, cb: any, w: any, t: any) => BaseCheck<ITestShape>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
botEmail: string;
|
|
3
|
-
taskman: string;
|
|
4
|
-
outdir: string;
|
|
5
|
-
tests: (string | never[] | {
|
|
6
|
-
ports: number;
|
|
7
|
-
})[][];
|
|
8
|
-
debugger: boolean;
|
|
9
|
-
clearScreen: boolean;
|
|
10
|
-
devMode: boolean;
|
|
11
|
-
minify: boolean;
|
|
12
|
-
outbase: string;
|
|
13
|
-
ports: never[];
|
|
14
|
-
externals: never[];
|
|
15
|
-
};
|
|
16
|
-
export default _default;
|
package/docker-compose.yml
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
version: "0.1"
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
report:
|
|
5
|
-
image: us-west1-docker.pkg.dev/dev-trail-450920-p2/testeranto-docker/report:latest
|
|
6
|
-
container_name: report
|
|
7
|
-
ports:
|
|
8
|
-
- 8080:8080
|
|
9
|
-
|
|
10
|
-
mongodb:
|
|
11
|
-
image: mongo
|
|
12
|
-
container_name: mongodb
|
|
13
|
-
environment:
|
|
14
|
-
- PUID=1000
|
|
15
|
-
- PGID=1000
|
|
16
|
-
volumes:
|
|
17
|
-
- /home/barry/mongodb/database:/data/db
|
|
18
|
-
ports:
|
|
19
|
-
- 27017:27017
|
|
20
|
-
restart: unless-stopped
|
|
21
|
-
# services:
|
|
22
|
-
|
|
23
|
-
# counter:
|
|
24
|
-
# image: gcr.io/${PROJECT_ID}/gcb-docker-compose:latest
|
|
25
|
-
# container_name: counter
|
|
26
|
-
# depends_on:
|
|
27
|
-
# - redis
|
|
28
|
-
# ports:
|
|
29
|
-
# - "50051:50051"
|
|
30
|
-
# environment:
|
|
31
|
-
# - REDIS_HOST=redis
|
|
32
|
-
# - REDIS_PORT=6379
|
|
33
|
-
|
|
34
|
-
# redis:
|
|
35
|
-
# image: redis
|
|
36
|
-
# ports:
|
|
37
|
-
# - "6379:6379"
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import Testeranto from "../Node.js";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
IBaseTest,
|
|
7
|
-
IPartialNodeInterface,
|
|
8
|
-
ITestImplementation,
|
|
9
|
-
ITestSpecification,
|
|
10
|
-
} from "../Types";
|
|
11
|
-
|
|
12
|
-
type IInput = string;
|
|
13
|
-
type ISelection = any;
|
|
14
|
-
type IStore = any;
|
|
15
|
-
type ISubject = any;
|
|
16
|
-
|
|
17
|
-
export type IImpl<ISpec extends IBaseTest> = ITestImplementation<ISpec>;
|
|
18
|
-
|
|
19
|
-
export type ISpec<T extends IBaseTest> = ITestSpecification<T>;
|
|
20
|
-
|
|
21
|
-
export default <ITestShape extends IBaseTest>(
|
|
22
|
-
testInput: IInput,
|
|
23
|
-
testSpecifications: ISpec<ITestShape>,
|
|
24
|
-
testImplementations: ITestImplementation<ITestShape>,
|
|
25
|
-
testInterface?: IPartialNodeInterface<ITestShape>
|
|
26
|
-
) => {
|
|
27
|
-
return Testeranto<ITestShape>(
|
|
28
|
-
testInput,
|
|
29
|
-
testSpecifications,
|
|
30
|
-
testImplementations,
|
|
31
|
-
{
|
|
32
|
-
beforeAll: (x) => {
|
|
33
|
-
// process.parentPort.postMessage(
|
|
34
|
-
// `/docs/web/src/ClassicalComponent/test.html`
|
|
35
|
-
// );
|
|
36
|
-
|
|
37
|
-
return x;
|
|
38
|
-
},
|
|
39
|
-
beforeEach: async (): Promise<IStore> => {
|
|
40
|
-
return new Promise((resolve, rej) => {
|
|
41
|
-
resolve(React.createElement(testInput, {}, []));
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
andWhen: function (s: IStore, whenCB): Promise<ISelection> {
|
|
45
|
-
return whenCB()(s);
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
...testInterface,
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
};
|
package/src/cli.ts
DELETED
|
@@ -1,535 +0,0 @@
|
|
|
1
|
-
import { spawn } from "child_process";
|
|
2
|
-
import fs, { watch } from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import readline from "readline";
|
|
5
|
-
import { glob } from "glob";
|
|
6
|
-
import crypto from "node:crypto";
|
|
7
|
-
|
|
8
|
-
import { debounceWatch } from "@bscotch/debounce-watch";
|
|
9
|
-
import type { DebouncedEventsProcessor } from "@bscotch/debounce-watch";
|
|
10
|
-
|
|
11
|
-
import esbuild from "esbuild";
|
|
12
|
-
import tseslint from "typescript-eslint";
|
|
13
|
-
import { ESLint } from "eslint";
|
|
14
|
-
|
|
15
|
-
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
16
|
-
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
17
|
-
import webHtmlFrame from "./web.html.js";
|
|
18
|
-
import {
|
|
19
|
-
ITestTypes,
|
|
20
|
-
IBaseConfig,
|
|
21
|
-
IRunTime,
|
|
22
|
-
IBuiltConfig,
|
|
23
|
-
} from "./lib/types.js";
|
|
24
|
-
import { PM_Main } from "./PM/main.js";
|
|
25
|
-
|
|
26
|
-
readline.emitKeypressEvents(process.stdin);
|
|
27
|
-
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
28
|
-
|
|
29
|
-
function parseTsErrors(logContent): void {
|
|
30
|
-
fs.writeFileSync("docs/types/log.txt", logContent.join("\n"));
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
const regex = /(^src(.*?))\(\d*,\d*\): error/gm;
|
|
34
|
-
const brokenFilesToLines: Record<string, Set<number>> = {};
|
|
35
|
-
|
|
36
|
-
for (let i = 0; i < logContent.length - 1; i++) {
|
|
37
|
-
let m;
|
|
38
|
-
|
|
39
|
-
while ((m = regex.exec(logContent[i])) !== null) {
|
|
40
|
-
// This is necessary to avoid infinite loops with zero-width matches
|
|
41
|
-
if (m.index === regex.lastIndex) {
|
|
42
|
-
regex.lastIndex++;
|
|
43
|
-
}
|
|
44
|
-
if (!brokenFilesToLines[m[1]]) {
|
|
45
|
-
brokenFilesToLines[m[1]] = new Set<number>();
|
|
46
|
-
}
|
|
47
|
-
brokenFilesToLines[m[1]].add(i);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
|
|
52
|
-
mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
|
|
53
|
-
const a = Array.from(brokenFilesToLines[lm]);
|
|
54
|
-
|
|
55
|
-
return Object.keys(a).reduce((mm2, lm2, ndx2) => {
|
|
56
|
-
const acc: string[] = [];
|
|
57
|
-
|
|
58
|
-
let j = a[lm2] + 1;
|
|
59
|
-
|
|
60
|
-
let working = true;
|
|
61
|
-
while (j < logContent.length - 1 && working) {
|
|
62
|
-
if (
|
|
63
|
-
!logContent[j].match(regex) &&
|
|
64
|
-
working &&
|
|
65
|
-
!logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)
|
|
66
|
-
) {
|
|
67
|
-
acc.push(logContent[j]);
|
|
68
|
-
} else {
|
|
69
|
-
working = false;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
j++;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
mm2[lm] = [logContent[l], ...acc];
|
|
76
|
-
|
|
77
|
-
return mm2;
|
|
78
|
-
}, {} as any)[lm];
|
|
79
|
-
});
|
|
80
|
-
return mm;
|
|
81
|
-
}, {});
|
|
82
|
-
|
|
83
|
-
Object.keys(final).forEach((k) => {
|
|
84
|
-
fs.mkdirSync(`./docs/types/${k.split("/").slice(0, -1).join("/")}`, {
|
|
85
|
-
recursive: true,
|
|
86
|
-
});
|
|
87
|
-
fs.writeFileSync(
|
|
88
|
-
`./docs/types/${k}.type_errors.txt`,
|
|
89
|
-
final[k].flat().flat().join("\r\n")
|
|
90
|
-
);
|
|
91
|
-
});
|
|
92
|
-
} catch (error) {
|
|
93
|
-
console.error("Error reading or parsing the log file:", error);
|
|
94
|
-
process.exit(1);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function parseLintErrors(logContent): void {
|
|
99
|
-
fs.writeFileSync("docs/eslint/log.txt", logContent.join("\n"));
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
const regex = new RegExp(`^${process.cwd()}/(.*?)`, "gm");
|
|
103
|
-
const brokenFilesToLines: Record<string, Set<number>> = {};
|
|
104
|
-
|
|
105
|
-
for (let i = 0; i < logContent.length - 1; i++) {
|
|
106
|
-
let m;
|
|
107
|
-
|
|
108
|
-
while ((m = regex.exec(logContent[i])) !== null) {
|
|
109
|
-
// This is necessary to avoid infinite loops with zero-width matches
|
|
110
|
-
if (m.index === regex.lastIndex) {
|
|
111
|
-
regex.lastIndex++;
|
|
112
|
-
}
|
|
113
|
-
if (!brokenFilesToLines[m[1]]) {
|
|
114
|
-
brokenFilesToLines[m[1]] = new Set<number>();
|
|
115
|
-
}
|
|
116
|
-
brokenFilesToLines[m[1]].add(i);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
|
|
121
|
-
mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
|
|
122
|
-
const a = Array.from(brokenFilesToLines[lm]);
|
|
123
|
-
|
|
124
|
-
return Object.keys(a).reduce((mm2, lm2, ndx2) => {
|
|
125
|
-
const acc: string[] = [];
|
|
126
|
-
|
|
127
|
-
let j = a[lm2] + 1;
|
|
128
|
-
|
|
129
|
-
let working = true;
|
|
130
|
-
while (j < logContent.length - 1 && working) {
|
|
131
|
-
if (
|
|
132
|
-
!logContent[j].match(regex) &&
|
|
133
|
-
working
|
|
134
|
-
// &&
|
|
135
|
-
// !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)
|
|
136
|
-
) {
|
|
137
|
-
acc.push(logContent[j]);
|
|
138
|
-
} else {
|
|
139
|
-
working = false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
j++;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
mm2[lm] = [logContent[l], ...acc];
|
|
146
|
-
|
|
147
|
-
return mm2;
|
|
148
|
-
}, {} as any)[lm];
|
|
149
|
-
});
|
|
150
|
-
return mm;
|
|
151
|
-
}, {});
|
|
152
|
-
|
|
153
|
-
Object.keys(final).forEach((k) => {
|
|
154
|
-
fs.mkdirSync(`./docs/eslint/${k.split("/").slice(0, -1).join("/")}`, {
|
|
155
|
-
recursive: true,
|
|
156
|
-
});
|
|
157
|
-
fs.writeFileSync(
|
|
158
|
-
`./docs/eslint/${k}.lint_errors.txt`,
|
|
159
|
-
final[k].flat().flat().join("\r\n")
|
|
160
|
-
);
|
|
161
|
-
});
|
|
162
|
-
} catch (error) {
|
|
163
|
-
console.error("Error reading or parsing the log file:", error);
|
|
164
|
-
process.exit(1);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const typecheck = () => {
|
|
169
|
-
const logContent: string[] = [];
|
|
170
|
-
fs.rmSync("docs/types", { force: true, recursive: true });
|
|
171
|
-
fs.mkdirSync("docs/types");
|
|
172
|
-
|
|
173
|
-
const tsc = spawn("tsc", ["-noEmit"]);
|
|
174
|
-
|
|
175
|
-
tsc.stdout.on("data", (data) => {
|
|
176
|
-
const lines = data.toString().split("\n");
|
|
177
|
-
logContent.push(...lines);
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
tsc.stderr.on("data", (data) => {
|
|
181
|
-
console.error(`stderr: ${data}`);
|
|
182
|
-
process.exit(-1);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
tsc.on("close", (code) => {
|
|
186
|
-
parseTsErrors(logContent);
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const eslint = () => {
|
|
191
|
-
const logContent: string[] = [];
|
|
192
|
-
fs.rmSync("docs/eslint", { force: true, recursive: true });
|
|
193
|
-
fs.mkdirSync("docs/eslint");
|
|
194
|
-
|
|
195
|
-
const tsc = spawn("eslint", ["./src"]);
|
|
196
|
-
|
|
197
|
-
tsc.stdout.on("data", (data) => {
|
|
198
|
-
const lines = data.toString().split("\n");
|
|
199
|
-
logContent.push(...lines);
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
tsc.stderr.on("data", (data) => {
|
|
203
|
-
console.error(`stderr: ${data}`);
|
|
204
|
-
process.exit(-1);
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
tsc.on("close", (code) => {
|
|
208
|
-
parseLintErrors(logContent);
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
type IRunnables = {
|
|
213
|
-
nodeEntryPoints: Record<string, string>;
|
|
214
|
-
webEntryPoints: Record<string, string>;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const getRunnables = (
|
|
218
|
-
tests: ITestTypes[],
|
|
219
|
-
payload = {
|
|
220
|
-
nodeEntryPoints: {},
|
|
221
|
-
webEntryPoints: {},
|
|
222
|
-
}
|
|
223
|
-
): IRunnables => {
|
|
224
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
225
|
-
if (cv[1] === "node") {
|
|
226
|
-
pt.nodeEntryPoints[cv[0]] = path.resolve(
|
|
227
|
-
`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
228
|
-
);
|
|
229
|
-
} else if (cv[1] === "web") {
|
|
230
|
-
pt.webEntryPoints[cv[0]] = path.resolve(
|
|
231
|
-
`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (cv[3].length) {
|
|
236
|
-
getRunnables(cv[3], payload);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return pt;
|
|
240
|
-
}, payload as IRunnables);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
244
|
-
const rawConfig: IBaseConfig = module.default;
|
|
245
|
-
|
|
246
|
-
const getSecondaryEndpointsPoints = (runtime?: IRunTime): string[] => {
|
|
247
|
-
const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
|
|
248
|
-
ts.forEach((t) => {
|
|
249
|
-
if (t[1] === runtime) {
|
|
250
|
-
st.add(t[0]);
|
|
251
|
-
}
|
|
252
|
-
if (Array.isArray(t[3])) {
|
|
253
|
-
meta(t[3], st);
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
return st;
|
|
257
|
-
};
|
|
258
|
-
return Array.from(meta(config.tests, new Set()));
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
const config: IBuiltConfig = {
|
|
262
|
-
...rawConfig,
|
|
263
|
-
buildDir: process.cwd() + "/" + rawConfig.outdir,
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
let nodeDone: boolean = false;
|
|
267
|
-
let webDone: boolean = false;
|
|
268
|
-
let mode = config.devMode ? "DEV" : "PROD";
|
|
269
|
-
let status: "build" | "built" = "build";
|
|
270
|
-
let pm: PM_Main | undefined = new PM_Main(config);
|
|
271
|
-
const fileHashes = {};
|
|
272
|
-
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
273
|
-
|
|
274
|
-
const onNodeDone = () => {
|
|
275
|
-
nodeDone = true;
|
|
276
|
-
onDone();
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
const onWebDone = () => {
|
|
280
|
-
webDone = true;
|
|
281
|
-
onDone();
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// async function fileHash(filePath, algorithm = "md5") {
|
|
285
|
-
// return new Promise((resolve, reject) => {
|
|
286
|
-
// const hash = crypto.createHash(algorithm);
|
|
287
|
-
// const fileStream = fs.createReadStream(filePath);
|
|
288
|
-
|
|
289
|
-
// fileStream.on("data", (data) => {
|
|
290
|
-
// hash.update(data);
|
|
291
|
-
// });
|
|
292
|
-
|
|
293
|
-
// fileStream.on("end", () => {
|
|
294
|
-
// const fileHash = hash.digest("hex");
|
|
295
|
-
// resolve(fileHash);
|
|
296
|
-
// });
|
|
297
|
-
|
|
298
|
-
// fileStream.on("error", (error) => {
|
|
299
|
-
// reject(`Error reading file: ${error.message}`);
|
|
300
|
-
// });
|
|
301
|
-
// });
|
|
302
|
-
// }
|
|
303
|
-
|
|
304
|
-
const onDone = async () => {
|
|
305
|
-
if (nodeDone && webDone) {
|
|
306
|
-
status = "built";
|
|
307
|
-
}
|
|
308
|
-
if (nodeDone && webDone && status === "built") {
|
|
309
|
-
// Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
310
|
-
// console.log("watching", outputFile);
|
|
311
|
-
// try {
|
|
312
|
-
// watch(outputFile, async (filename) => {
|
|
313
|
-
// const hash = await fileHash(outputFile);
|
|
314
|
-
// if (fileHashes[k] !== hash) {
|
|
315
|
-
// fileHashes[k] = hash;
|
|
316
|
-
// console.log(`< ${filename} `);
|
|
317
|
-
// pm.launchNode(k, outputFile);
|
|
318
|
-
// }
|
|
319
|
-
// });
|
|
320
|
-
// } catch (e) {
|
|
321
|
-
// console.error(e);
|
|
322
|
-
// }
|
|
323
|
-
// });
|
|
324
|
-
// Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
325
|
-
// console.log("watching", outputFile);
|
|
326
|
-
// watch(outputFile, async (filename) => {
|
|
327
|
-
// const hash = await fileHash(outputFile);
|
|
328
|
-
// console.log(`< ${filename} ${hash}`);
|
|
329
|
-
// if (fileHashes[k] !== hash) {
|
|
330
|
-
// fileHashes[k] = hash;
|
|
331
|
-
// pm.launchWeb(k, outputFile);
|
|
332
|
-
// }
|
|
333
|
-
// });
|
|
334
|
-
// });
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
if (nodeDone && webDone && mode === "PROD") {
|
|
338
|
-
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
339
|
-
process.exit();
|
|
340
|
-
} else {
|
|
341
|
-
if (mode === "PROD") {
|
|
342
|
-
console.log("waiting for tests to finish");
|
|
343
|
-
console.log(
|
|
344
|
-
JSON.stringify(
|
|
345
|
-
{
|
|
346
|
-
nodeDone: nodeDone,
|
|
347
|
-
webDone: webDone,
|
|
348
|
-
mode: mode,
|
|
349
|
-
},
|
|
350
|
-
null,
|
|
351
|
-
2
|
|
352
|
-
)
|
|
353
|
-
);
|
|
354
|
-
} else {
|
|
355
|
-
console.log("waiting for tests to change");
|
|
356
|
-
}
|
|
357
|
-
console.log("press 'q' to quit");
|
|
358
|
-
|
|
359
|
-
if (config.devMode) {
|
|
360
|
-
console.log("ready and watching for changes...");
|
|
361
|
-
} else {
|
|
362
|
-
pm.shutDown();
|
|
363
|
-
}
|
|
364
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
console.log(
|
|
369
|
-
`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
|
|
370
|
-
);
|
|
371
|
-
process.stdin.on("keypress", (str, key) => {
|
|
372
|
-
if (key.name === "q") {
|
|
373
|
-
console.log("Testeranto-EsBuild is shutting down...");
|
|
374
|
-
mode = "PROD";
|
|
375
|
-
onDone();
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
// const eslint = new ESLint();
|
|
380
|
-
// const configEslint = await eslint.calculateConfigForFile(
|
|
381
|
-
// "./src/eslint.config.mjs"
|
|
382
|
-
// );
|
|
383
|
-
// // console.log(`configEslint`, configEslint);
|
|
384
|
-
// fs.watch("src", { recursive: true }, async (eventType, filename) => {
|
|
385
|
-
// if (eventType === "change") {
|
|
386
|
-
// console.log(`File ${filename} has been modified.`);
|
|
387
|
-
// const x = await eslint.lintFiles([`./src/${filename}`]);
|
|
388
|
-
// console.log(x[0].messages);
|
|
389
|
-
// } else if (eventType === "rename") {
|
|
390
|
-
// console.log(`File ${filename} has been created or deleted.`);
|
|
391
|
-
// }
|
|
392
|
-
// });
|
|
393
|
-
|
|
394
|
-
fs.writeFileSync(
|
|
395
|
-
`${config.outdir}/testeranto.json`,
|
|
396
|
-
JSON.stringify(config, null, 2)
|
|
397
|
-
);
|
|
398
|
-
|
|
399
|
-
Promise.resolve(
|
|
400
|
-
Promise.all(
|
|
401
|
-
[...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
402
|
-
const sourceFileSplit = sourceFilePath.split("/");
|
|
403
|
-
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
404
|
-
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
405
|
-
const sourceFileNameMinusJs = sourceFileName
|
|
406
|
-
.split(".")
|
|
407
|
-
.slice(0, -1)
|
|
408
|
-
.join(".");
|
|
409
|
-
|
|
410
|
-
const htmlFilePath = path.normalize(
|
|
411
|
-
`${process.cwd()}/${config.outdir}/web/${sourceDir.join(
|
|
412
|
-
"/"
|
|
413
|
-
)}/${sourceFileNameMinusJs}.html`
|
|
414
|
-
);
|
|
415
|
-
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
416
|
-
|
|
417
|
-
return fs.promises
|
|
418
|
-
.mkdir(path.dirname(htmlFilePath), { recursive: true })
|
|
419
|
-
.then((x) =>
|
|
420
|
-
fs.writeFileSync(
|
|
421
|
-
htmlFilePath,
|
|
422
|
-
webHtmlFrame(jsfilePath, htmlFilePath)
|
|
423
|
-
)
|
|
424
|
-
);
|
|
425
|
-
})
|
|
426
|
-
)
|
|
427
|
-
);
|
|
428
|
-
|
|
429
|
-
glob(`./${config.outdir}/chunk-*.mjs`, {
|
|
430
|
-
ignore: "node_modules/**",
|
|
431
|
-
}).then((chunks) => {
|
|
432
|
-
chunks.forEach((chunk) => {
|
|
433
|
-
fs.unlinkSync(chunk);
|
|
434
|
-
});
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
// const processDebouncedEvents: DebouncedEventsProcessor = (events) => {
|
|
438
|
-
// typecheck();
|
|
439
|
-
// };
|
|
440
|
-
|
|
441
|
-
debounceWatch(
|
|
442
|
-
(events) => {
|
|
443
|
-
typecheck();
|
|
444
|
-
eslint();
|
|
445
|
-
},
|
|
446
|
-
"./src",
|
|
447
|
-
{
|
|
448
|
-
onlyFileExtensions: ["ts", "tsx", "mts"],
|
|
449
|
-
debounceWaitSeconds: 0.2,
|
|
450
|
-
allowOverlappingRuns: false,
|
|
451
|
-
}
|
|
452
|
-
);
|
|
453
|
-
|
|
454
|
-
await pm.startPuppeteer(
|
|
455
|
-
{
|
|
456
|
-
slowMo: 1,
|
|
457
|
-
// timeout: 1,
|
|
458
|
-
waitForInitialPage: false,
|
|
459
|
-
executablePath:
|
|
460
|
-
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
461
|
-
"/opt/homebrew/bin/chromium",
|
|
462
|
-
headless: true,
|
|
463
|
-
dumpio: true,
|
|
464
|
-
// timeout: 0,
|
|
465
|
-
devtools: true,
|
|
466
|
-
|
|
467
|
-
args: [
|
|
468
|
-
"--auto-open-devtools-for-tabs",
|
|
469
|
-
`--remote-debugging-port=3234`,
|
|
470
|
-
|
|
471
|
-
// "--disable-features=IsolateOrigins,site-per-process",
|
|
472
|
-
"--disable-site-isolation-trials",
|
|
473
|
-
"--allow-insecure-localhost",
|
|
474
|
-
"--allow-file-access-from-files",
|
|
475
|
-
"--allow-running-insecure-content",
|
|
476
|
-
|
|
477
|
-
"--disable-dev-shm-usage",
|
|
478
|
-
"--disable-extensions",
|
|
479
|
-
"--disable-gpu",
|
|
480
|
-
"--disable-setuid-sandbox",
|
|
481
|
-
"--disable-site-isolation-trials",
|
|
482
|
-
"--disable-web-security",
|
|
483
|
-
"--no-first-run",
|
|
484
|
-
"--no-sandbox",
|
|
485
|
-
"--no-startup-window",
|
|
486
|
-
// "--no-zygote",
|
|
487
|
-
"--reduce-security-for-testing",
|
|
488
|
-
"--remote-allow-origins=*",
|
|
489
|
-
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
490
|
-
// "--disable-features=IsolateOrigins",
|
|
491
|
-
// "--remote-allow-origins=ws://localhost:3234",
|
|
492
|
-
// "--single-process",
|
|
493
|
-
// "--unsafely-treat-insecure-origin-as-secure",
|
|
494
|
-
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
495
|
-
|
|
496
|
-
// "--disk-cache-dir=/dev/null",
|
|
497
|
-
// "--disk-cache-size=1",
|
|
498
|
-
// "--start-maximized",
|
|
499
|
-
],
|
|
500
|
-
},
|
|
501
|
-
"."
|
|
502
|
-
);
|
|
503
|
-
|
|
504
|
-
await Promise.all([
|
|
505
|
-
esbuild
|
|
506
|
-
.context(esbuildNodeConfiger(config, Object.keys(nodeEntryPoints)))
|
|
507
|
-
.then(async (nodeContext) => {
|
|
508
|
-
if (config.devMode) {
|
|
509
|
-
await nodeContext.watch().then((v) => {
|
|
510
|
-
onNodeDone();
|
|
511
|
-
});
|
|
512
|
-
} else {
|
|
513
|
-
nodeContext.rebuild().then((v) => {
|
|
514
|
-
onNodeDone();
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
return nodeContext;
|
|
519
|
-
}),
|
|
520
|
-
esbuild
|
|
521
|
-
.context(esbuildWebConfiger(config, Object.keys(webEntryPoints)))
|
|
522
|
-
.then(async (webContext) => {
|
|
523
|
-
if (config.devMode) {
|
|
524
|
-
await webContext.watch().then((v) => {
|
|
525
|
-
onWebDone();
|
|
526
|
-
});
|
|
527
|
-
} else {
|
|
528
|
-
webContext.rebuild().then((v) => {
|
|
529
|
-
onWebDone();
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
return webContext;
|
|
533
|
-
}),
|
|
534
|
-
]);
|
|
535
|
-
});
|