testeranto 0.111.0 → 0.112.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/dist/common/Init.js +68 -0
- package/dist/common/Node.js +27 -0
- package/dist/common/PM/index.js +7 -0
- package/dist/common/PM/main.js +1176 -0
- package/dist/common/PM/node.js +128 -0
- package/dist/common/PM/web.js +121 -0
- package/dist/common/ReportServer.js +22 -0
- package/dist/common/SubPackages/react/component/node.js +19 -0
- package/dist/common/SubPackages/react/component/web.js +19 -0
- package/dist/common/SubPackages/react/jsx/index.js +21 -0
- package/dist/common/SubPackages/react/jsx/node.js +10 -0
- package/dist/common/SubPackages/react/jsx/web.js +10 -0
- package/dist/common/SubPackages/react-dom/component/node.js +88 -0
- package/dist/common/SubPackages/react-dom/component/web.js +67 -0
- package/dist/common/SubPackages/react-dom/jsx/index.js +2 -0
- package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
- package/dist/common/SubPackages/react-dom/jsx/web.js +128 -0
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +54 -0
- package/dist/common/SubPackages/react-test-renderer/component/index.js +2 -0
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +70 -0
- package/dist/common/SubPackages/react-test-renderer/component/node.js +8 -0
- package/dist/common/SubPackages/react-test-renderer/component/web.js +8 -0
- package/dist/common/SubPackages/react-test-renderer/fc/node.js +60 -0
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +60 -0
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +67 -0
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +52 -0
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +10 -0
- package/dist/common/Types.js +2 -0
- package/dist/common/Web.js +49 -0
- package/dist/common/build.js +222 -0
- package/dist/common/defaultConfig.js +20 -0
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
- package/dist/common/esbuildConfigs/featuresPlugin.js +39 -0
- package/dist/common/esbuildConfigs/index.js +21 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
- package/dist/common/esbuildConfigs/node.js +37 -0
- package/dist/common/esbuildConfigs/web.js +50 -0
- package/dist/common/init-docs.js +53 -0
- package/dist/common/lib/abstractBase.js +329 -0
- package/dist/common/lib/basebuilder.js +98 -0
- package/dist/common/lib/classBuilder.js +40 -0
- package/dist/common/lib/core.js +117 -0
- package/dist/common/lib/index.js +21 -0
- package/dist/common/lib/types.js +2 -0
- package/dist/common/package.json +3 -0
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/run.js +62 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -0
- package/dist/common/utils.js +43 -0
- package/dist/common/web.html.js +22 -0
- package/dist/module/Footer.js +4 -0
- package/dist/module/Init.js +63 -0
- package/dist/module/Node.js +20 -0
- package/dist/module/PM/index.js +3 -0
- package/dist/module/PM/main.js +1136 -0
- package/dist/module/PM/node.js +121 -0
- package/dist/module/PM/web.js +117 -0
- package/dist/module/ReportClient.js +97 -0
- package/dist/module/ReportServer.js +17 -0
- package/dist/module/SubPackages/react/component/node.js +14 -0
- package/dist/module/SubPackages/react/component/web.js +14 -0
- package/dist/module/SubPackages/react/jsx/index.js +15 -0
- package/dist/module/SubPackages/react/jsx/node.js +5 -0
- package/dist/module/SubPackages/react/jsx/web.js +5 -0
- package/dist/module/SubPackages/react-dom/component/node.js +80 -0
- package/dist/module/SubPackages/react-dom/component/web.js +62 -0
- package/dist/module/SubPackages/react-dom/jsx/index.js +1 -0
- package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
- package/dist/module/SubPackages/react-dom/jsx/web.js +90 -0
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
- package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -0
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +31 -0
- package/dist/module/SubPackages/react-test-renderer/component/node.js +3 -0
- package/dist/module/SubPackages/react-test-renderer/component/web.js +3 -0
- package/dist/module/SubPackages/react-test-renderer/fc/node.js +22 -0
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +22 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +28 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +16 -0
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +5 -0
- package/dist/module/TestReport.js +91 -0
- package/dist/module/Types.js +1 -0
- package/dist/module/Web.js +42 -0
- package/dist/module/build.js +184 -0
- package/dist/module/defaultConfig.js +18 -0
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
- package/dist/module/esbuildConfigs/featuresPlugin.js +34 -0
- package/dist/module/esbuildConfigs/index.js +19 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
- package/dist/module/esbuildConfigs/node.js +32 -0
- package/dist/module/esbuildConfigs/web.js +45 -0
- package/dist/module/init-docs.js +15 -0
- package/dist/module/lib/abstractBase.js +321 -0
- package/dist/module/lib/basebuilder.js +94 -0
- package/dist/module/lib/classBuilder.js +36 -0
- package/dist/module/lib/core.js +114 -0
- package/dist/module/lib/index.js +17 -0
- package/dist/module/lib/types.js +1 -0
- package/dist/module/package.json +3 -0
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/run.js +24 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -0
- package/dist/module/utils.js +29 -0
- package/dist/module/web.html.js +20 -0
- package/dist/prebuild/ReportClient.css +11367 -0
- package/dist/prebuild/ReportClient.js +24641 -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 +104 -0
- package/dist/prebuild/run.mjs +1153 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Init.d.ts +2 -0
- package/dist/types/Node.d.ts +12 -0
- package/dist/types/PM/index.d.ts +34 -0
- package/dist/types/PM/main.d.ts +66 -0
- package/dist/types/PM/node.d.ts +40 -0
- package/dist/types/PM/web.d.ts +38 -0
- package/dist/types/ReportServer.d.ts +1 -0
- 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/interface.d.ts +9 -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/build.d.ts +1 -0
- package/dist/types/defaultConfig.d.ts +3 -0
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
- package/dist/types/esbuildConfigs/featuresPlugin.d.ts +5 -0
- package/dist/types/esbuildConfigs/index.d.ts +4 -0
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +6 -0
- package/dist/types/esbuildConfigs/node.d.ts +4 -0
- package/dist/types/esbuildConfigs/web.d.ts +4 -0
- 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/puppeteerConfiger.d.ts +4 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/utils.d.ts +15 -0
- package/dist/types/web.html.d.ts +2 -0
- package/package.json +1 -1
- package/src/PM/main.ts +25 -57
- package/src/ReportClient.tsx +43 -41
- package/src/run.ts +8 -5
- package/src/utils.ts +10 -0
- package/tsc.log +8 -8
|
@@ -0,0 +1,222 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const readline_1 = __importDefault(require("readline"));
|
|
42
|
+
const glob_1 = require("glob");
|
|
43
|
+
const esbuild_1 = __importDefault(require("esbuild"));
|
|
44
|
+
const node_js_1 = __importDefault(require("./esbuildConfigs/node.js"));
|
|
45
|
+
const web_js_1 = __importDefault(require("./esbuildConfigs/web.js"));
|
|
46
|
+
const web_html_js_1 = __importDefault(require("./web.html.js"));
|
|
47
|
+
readline_1.default.emitKeypressEvents(process.stdin);
|
|
48
|
+
if (process.stdin.isTTY)
|
|
49
|
+
process.stdin.setRawMode(true);
|
|
50
|
+
const getRunnables = (tests, payload = {
|
|
51
|
+
nodeEntryPoints: {},
|
|
52
|
+
webEntryPoints: {},
|
|
53
|
+
}) => {
|
|
54
|
+
return tests.reduce((pt, cv, cndx, cry) => {
|
|
55
|
+
if (cv[1] === "node") {
|
|
56
|
+
pt.nodeEntryPoints[cv[0]] = path_1.default.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
57
|
+
}
|
|
58
|
+
else if (cv[1] === "web") {
|
|
59
|
+
pt.webEntryPoints[cv[0]] = path_1.default.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
60
|
+
}
|
|
61
|
+
if (cv[3].length) {
|
|
62
|
+
getRunnables(cv[3], payload);
|
|
63
|
+
}
|
|
64
|
+
return pt;
|
|
65
|
+
}, payload);
|
|
66
|
+
};
|
|
67
|
+
Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then(async (module) => {
|
|
68
|
+
const rawConfig = module.default;
|
|
69
|
+
const getSecondaryEndpointsPoints = (runtime) => {
|
|
70
|
+
const meta = (ts, st) => {
|
|
71
|
+
ts.forEach((t) => {
|
|
72
|
+
if (t[1] === runtime) {
|
|
73
|
+
st.add(t[0]);
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(t[3])) {
|
|
76
|
+
meta(t[3], st);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return st;
|
|
80
|
+
};
|
|
81
|
+
return Array.from(meta(config.tests, new Set()));
|
|
82
|
+
};
|
|
83
|
+
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
|
|
84
|
+
let nodeDone = false;
|
|
85
|
+
let webDone = false;
|
|
86
|
+
let mode = config.devMode ? "DEV" : "PROD";
|
|
87
|
+
let status = "build";
|
|
88
|
+
// let pm: PM_Main | undefined = new PM_Main(config);
|
|
89
|
+
// const fileHashes = {};
|
|
90
|
+
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
91
|
+
const onNodeDone = () => {
|
|
92
|
+
nodeDone = true;
|
|
93
|
+
onDone();
|
|
94
|
+
};
|
|
95
|
+
const onWebDone = () => {
|
|
96
|
+
webDone = true;
|
|
97
|
+
onDone();
|
|
98
|
+
};
|
|
99
|
+
const onDone = async () => {
|
|
100
|
+
if (nodeDone && webDone) {
|
|
101
|
+
status = "built";
|
|
102
|
+
}
|
|
103
|
+
if (nodeDone && webDone && status === "built") {
|
|
104
|
+
// Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
105
|
+
// console.log("watching", outputFile);
|
|
106
|
+
// try {
|
|
107
|
+
// watch(outputFile, async (filename) => {
|
|
108
|
+
// const hash = await fileHash(outputFile);
|
|
109
|
+
// if (fileHashes[k] !== hash) {
|
|
110
|
+
// fileHashes[k] = hash;
|
|
111
|
+
// console.log(`< ${filename} `);
|
|
112
|
+
// pm.launchNode(k, outputFile);
|
|
113
|
+
// }
|
|
114
|
+
// });
|
|
115
|
+
// } catch (e) {
|
|
116
|
+
// console.error(e);
|
|
117
|
+
// }
|
|
118
|
+
// });
|
|
119
|
+
// Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
120
|
+
// console.log("watching", outputFile);
|
|
121
|
+
// watch(outputFile, async (filename) => {
|
|
122
|
+
// const hash = await fileHash(outputFile);
|
|
123
|
+
// console.log(`< ${filename} ${hash}`);
|
|
124
|
+
// if (fileHashes[k] !== hash) {
|
|
125
|
+
// fileHashes[k] = hash;
|
|
126
|
+
// pm.launchWeb(k, outputFile);
|
|
127
|
+
// }
|
|
128
|
+
// });
|
|
129
|
+
// });
|
|
130
|
+
}
|
|
131
|
+
if (nodeDone && webDone && mode === "PROD") {
|
|
132
|
+
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
133
|
+
process.exit();
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
if (mode === "PROD") {
|
|
137
|
+
console.log("waiting for tests to finish");
|
|
138
|
+
console.log(JSON.stringify({
|
|
139
|
+
nodeDone: nodeDone,
|
|
140
|
+
webDone: webDone,
|
|
141
|
+
mode: mode,
|
|
142
|
+
}, null, 2));
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.log("waiting for tests to change");
|
|
146
|
+
}
|
|
147
|
+
if (config.devMode) {
|
|
148
|
+
console.log("ready and watching for changes...");
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// pm.shutDown();
|
|
152
|
+
}
|
|
153
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
|
|
157
|
+
process.stdin.on("keypress", (str, key) => {
|
|
158
|
+
if (key.name === "q") {
|
|
159
|
+
console.log("Testeranto-Build is shutting down...");
|
|
160
|
+
mode = "PROD";
|
|
161
|
+
onDone();
|
|
162
|
+
}
|
|
163
|
+
if (key.name === "x") {
|
|
164
|
+
console.log("Testeranto-Build is shutting down forcefully...");
|
|
165
|
+
process.exit(-1);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(config, null, 2));
|
|
169
|
+
Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
170
|
+
const sourceFileSplit = sourceFilePath.split("/");
|
|
171
|
+
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
172
|
+
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
173
|
+
const sourceFileNameMinusJs = sourceFileName
|
|
174
|
+
.split(".")
|
|
175
|
+
.slice(0, -1)
|
|
176
|
+
.join(".");
|
|
177
|
+
const htmlFilePath = path_1.default.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
178
|
+
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
179
|
+
return fs_1.default.promises
|
|
180
|
+
.mkdir(path_1.default.dirname(htmlFilePath), { recursive: true })
|
|
181
|
+
.then((x) => fs_1.default.writeFileSync(htmlFilePath, (0, web_html_js_1.default)(jsfilePath, htmlFilePath)));
|
|
182
|
+
})));
|
|
183
|
+
(0, glob_1.glob)(`./${config.outdir}/chunk-*.mjs`, {
|
|
184
|
+
ignore: "node_modules/**",
|
|
185
|
+
}).then((chunks) => {
|
|
186
|
+
chunks.forEach((chunk) => {
|
|
187
|
+
fs_1.default.unlinkSync(chunk);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
await Promise.all([
|
|
191
|
+
esbuild_1.default
|
|
192
|
+
.context((0, node_js_1.default)(config, Object.keys(nodeEntryPoints)))
|
|
193
|
+
.then(async (nodeContext) => {
|
|
194
|
+
if (config.devMode) {
|
|
195
|
+
await nodeContext.watch().then((v) => {
|
|
196
|
+
onNodeDone();
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
nodeContext.rebuild().then((v) => {
|
|
201
|
+
onNodeDone();
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return nodeContext;
|
|
205
|
+
}),
|
|
206
|
+
esbuild_1.default
|
|
207
|
+
.context((0, web_js_1.default)(config, Object.keys(webEntryPoints)))
|
|
208
|
+
.then(async (webContext) => {
|
|
209
|
+
if (config.devMode) {
|
|
210
|
+
await webContext.watch().then((v) => {
|
|
211
|
+
onWebDone();
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
webContext.rebuild().then((v) => {
|
|
216
|
+
onWebDone();
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return webContext;
|
|
220
|
+
}),
|
|
221
|
+
]);
|
|
222
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config = {
|
|
4
|
+
src: "src",
|
|
5
|
+
outdir: "docs",
|
|
6
|
+
tests: [],
|
|
7
|
+
debugger: true,
|
|
8
|
+
clearScreen: false,
|
|
9
|
+
devMode: true,
|
|
10
|
+
minify: false,
|
|
11
|
+
outbase: ".",
|
|
12
|
+
ports: ["3001"],
|
|
13
|
+
externals: [],
|
|
14
|
+
nodePlugins: [],
|
|
15
|
+
webPlugins: [],
|
|
16
|
+
featureIngestor: function (s) {
|
|
17
|
+
throw new Error("Function not implemented.");
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
exports.default = config;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
exports.default = {
|
|
8
|
+
name: "feature-markdown",
|
|
9
|
+
setup(build) {
|
|
10
|
+
build.onResolve({ filter: /\.md$/ }, (args) => {
|
|
11
|
+
if (args.resolveDir === "")
|
|
12
|
+
return;
|
|
13
|
+
return {
|
|
14
|
+
path: path_1.default.isAbsolute(args.path)
|
|
15
|
+
? args.path
|
|
16
|
+
: path_1.default.join(args.resolveDir, args.path),
|
|
17
|
+
namespace: "feature-markdown",
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
build.onLoad({ filter: /.*/, namespace: "feature-markdown" }, async (args) => {
|
|
21
|
+
// const markdownContent = new TextDecoder().decode(
|
|
22
|
+
// await fs.readFileSync(args.path)
|
|
23
|
+
// );
|
|
24
|
+
// markdownHTML = marked(markdownContent, options?.markedOptions);
|
|
25
|
+
return {
|
|
26
|
+
contents: `file://${args.path}`,
|
|
27
|
+
loader: "text",
|
|
28
|
+
// contents: JSON.stringify({ path: args.path }),
|
|
29
|
+
// loader: "json",
|
|
30
|
+
// contents: JSON.stringify({
|
|
31
|
+
// // html: markdownHTML,
|
|
32
|
+
// raw: markdownContent,
|
|
33
|
+
// filename: args.path, //path.basename(args.path),
|
|
34
|
+
// }),
|
|
35
|
+
// loader: "json",
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = (config) => {
|
|
4
|
+
return {
|
|
5
|
+
// packages: "external",
|
|
6
|
+
target: "esnext",
|
|
7
|
+
format: "esm",
|
|
8
|
+
splitting: true,
|
|
9
|
+
outExtension: { ".js": ".mjs" },
|
|
10
|
+
outbase: config.outbase,
|
|
11
|
+
jsx: "transform",
|
|
12
|
+
bundle: true,
|
|
13
|
+
minify: config.minify === true,
|
|
14
|
+
write: true,
|
|
15
|
+
loader: {
|
|
16
|
+
".js": "jsx",
|
|
17
|
+
".png": "binary",
|
|
18
|
+
".jpg": "binary",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const otherInputs = {};
|
|
8
|
+
const register = (entrypoint, sources) => {
|
|
9
|
+
if (!otherInputs[entrypoint]) {
|
|
10
|
+
otherInputs[entrypoint] = new Set();
|
|
11
|
+
}
|
|
12
|
+
sources.forEach((s) => otherInputs[entrypoint].add(s));
|
|
13
|
+
};
|
|
14
|
+
exports.default = (platform, entryPoints) => {
|
|
15
|
+
return {
|
|
16
|
+
register,
|
|
17
|
+
inputFilesPluginFactory: {
|
|
18
|
+
name: "metafileWriter",
|
|
19
|
+
setup(build) {
|
|
20
|
+
build.onEnd((result) => {
|
|
21
|
+
// console.log("build.onEnd", entryPoints);
|
|
22
|
+
fs_1.default.writeFileSync(`docs/${platform}/metafile.json`, JSON.stringify(result, null, 2));
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const index_js_1 = __importDefault(require("./index.js"));
|
|
7
|
+
const inputFilesPlugin_js_1 = __importDefault(require("./inputFilesPlugin.js"));
|
|
8
|
+
const featuresPlugin_1 = __importDefault(require("./featuresPlugin"));
|
|
9
|
+
exports.default = (config, entryPoints) => {
|
|
10
|
+
const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("node", entryPoints);
|
|
11
|
+
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { splitting: true, outdir: config.outdir + "/node",
|
|
12
|
+
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
13
|
+
metafile: true, supported: {
|
|
14
|
+
"dynamic-import": true,
|
|
15
|
+
}, define: {
|
|
16
|
+
"process.env.FLUENTFFMPEG_COV": "0",
|
|
17
|
+
}, absWorkingDir: process.cwd(), banner: {
|
|
18
|
+
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
19
|
+
}, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
|
|
20
|
+
featuresPlugin_1.default,
|
|
21
|
+
inputFilesPluginFactory,
|
|
22
|
+
{
|
|
23
|
+
name: "rebuild-notify",
|
|
24
|
+
setup(build) {
|
|
25
|
+
build.onEnd((result) => {
|
|
26
|
+
console.log(`> node build ended with ${result.errors.length} errors`);
|
|
27
|
+
if (result.errors.length > 0) {
|
|
28
|
+
console.log(result);
|
|
29
|
+
}
|
|
30
|
+
// console.log(result);
|
|
31
|
+
// result.errors.length !== 0 && process.exit(-1);
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const index_js_1 = __importDefault(require("./index.js"));
|
|
8
|
+
const inputFilesPlugin_js_1 = __importDefault(require("./inputFilesPlugin.js"));
|
|
9
|
+
const featuresPlugin_js_1 = __importDefault(require("./featuresPlugin.js"));
|
|
10
|
+
exports.default = (config, entryPoints) => {
|
|
11
|
+
const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("web", entryPoints);
|
|
12
|
+
return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { outdir: config.outdir + "/web", alias: {
|
|
13
|
+
react: path_1.default.resolve("./node_modules/react"),
|
|
14
|
+
}, metafile: true, external: [
|
|
15
|
+
"path",
|
|
16
|
+
"fs",
|
|
17
|
+
"stream",
|
|
18
|
+
"http",
|
|
19
|
+
"constants",
|
|
20
|
+
"net",
|
|
21
|
+
"assert",
|
|
22
|
+
"tls",
|
|
23
|
+
"os",
|
|
24
|
+
"child_process",
|
|
25
|
+
"readline",
|
|
26
|
+
"zlib",
|
|
27
|
+
"crypto",
|
|
28
|
+
"https",
|
|
29
|
+
"util",
|
|
30
|
+
"process",
|
|
31
|
+
"dns",
|
|
32
|
+
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
33
|
+
featuresPlugin_js_1.default,
|
|
34
|
+
inputFilesPluginFactory,
|
|
35
|
+
{
|
|
36
|
+
name: "rebuild-notify",
|
|
37
|
+
setup(build) {
|
|
38
|
+
build.onEnd((result) => {
|
|
39
|
+
console.log(`> web build ended with ${result.errors.length} errors`);
|
|
40
|
+
if (result.errors.length > 0) {
|
|
41
|
+
console.log(result);
|
|
42
|
+
}
|
|
43
|
+
// console.log(result);
|
|
44
|
+
// result.errors.length !== 0 && process.exit(-1);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
40
|
+
const Init_1 = __importDefault(require("./Init"));
|
|
41
|
+
console.log("Initializing a testeranto project");
|
|
42
|
+
if (!process.argv[2]) {
|
|
43
|
+
console.log("You didn't pass a config file, so I will create one for you.");
|
|
44
|
+
fs_1.default.writeFileSync("testeranto.mts", fs_1.default.readFileSync("node_modules/testeranto/src/defaultConfig.ts"));
|
|
45
|
+
Promise.resolve(`${process.cwd() + "/" + "testeranto.mts"}`).then(s => __importStar(require(s))).then((module) => {
|
|
46
|
+
(0, Init_1.default)(module.default);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
Promise.resolve(`${process.cwd() + "/" + process.argv[2]}`).then(s => __importStar(require(s))).then((module) => {
|
|
51
|
+
(0, Init_1.default)(module.default);
|
|
52
|
+
});
|
|
53
|
+
}
|