testeranto 0.81.3 → 0.84.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/src/Node.js +4 -2
- package/dist/common/src/PM/main.js +188 -61
- package/dist/common/src/PM/node.js +32 -7
- package/dist/common/src/PM/web.js +28 -54
- package/dist/common/src/Project.js +0 -3
- package/dist/common/src/Puppeteer.js +9 -51
- package/dist/common/src/SubPackages/react-dom/jsx/web.js +11 -11
- package/dist/common/src/Web.js +7 -1
- package/dist/common/src/esbuildConfigs/featuresPlugin.js +39 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +62 -64
- package/dist/common/src/esbuildConfigs/node.js +10 -3
- package/dist/common/src/esbuildConfigs/web.js +6 -2
- package/dist/common/src/lib/abstractBase.js +348 -337
- package/dist/common/src/lib/basebuilder.js +9 -4
- package/dist/common/src/lib/core.js +1 -1
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Node.js +3 -3
- package/dist/module/src/PM/main.js +188 -61
- package/dist/module/src/PM/node.js +32 -7
- package/dist/module/src/PM/web.js +28 -51
- package/dist/module/src/Project.js +0 -3
- package/dist/module/src/Puppeteer.js +9 -51
- package/dist/module/src/SubPackages/react-dom/jsx/web.js +10 -10
- package/dist/module/src/Web.js +6 -2
- package/dist/module/src/esbuildConfigs/featuresPlugin.js +34 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +62 -64
- package/dist/module/src/esbuildConfigs/node.js +10 -3
- package/dist/module/src/esbuildConfigs/web.js +6 -2
- package/dist/module/src/lib/abstractBase.js +348 -337
- package/dist/module/src/lib/basebuilder.js +9 -4
- package/dist/module/src/lib/core.js +1 -1
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Puppeteer.mjs +82033 -0
- package/dist/types/src/Node.d.ts +5 -1
- package/dist/types/src/PM/index.d.ts +10 -4
- package/dist/types/src/PM/main.d.ts +21 -9
- package/dist/types/src/PM/node.d.ts +11 -3
- package/dist/types/src/PM/web.d.ts +11 -2
- package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +1 -0
- package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +1 -0
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +1 -0
- package/dist/types/src/Types.d.ts +2 -2
- package/dist/types/src/Web.d.ts +5 -1
- package/dist/types/src/esbuildConfigs/featuresPlugin.d.ts +5 -0
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +4 -2
- package/dist/types/src/lib/abstractBase.d.ts +5 -4
- package/dist/types/src/lib/core.d.ts +1 -1
- package/dist/types/src/lib/index.d.ts +1 -0
- package/dist/types/src/lib/types.d.ts +7 -5
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +18 -45
- package/pupBuild.js +18 -0
- package/src/Node.ts +3 -5
- package/src/PM/index.ts +12 -3
- package/src/PM/main.ts +306 -140
- package/src/PM/node.ts +40 -7
- package/src/PM/web.ts +108 -58
- package/src/Project.ts +0 -8
- package/src/Puppeteer.ts +11 -57
- package/src/SubPackages/react-dom/jsx/web.ts +15 -10
- package/src/Types.ts +5 -2
- package/src/Web.ts +6 -2
- package/src/esbuildConfigs/featuresPlugin.ts +43 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +97 -90
- package/src/esbuildConfigs/node.ts +18 -3
- package/src/esbuildConfigs/web.ts +14 -2
- package/src/lib/abstractBase.ts +388 -366
- package/src/lib/basebuilder.ts +9 -9
- package/src/lib/core.ts +4 -2
- package/src/lib/index.ts +1 -0
- package/src/lib/types.ts +14 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { createElement } from "react";
|
|
3
|
-
import ReactDom from "react-dom
|
|
3
|
+
import ReactDom from "react-dom";
|
|
4
4
|
import Testeranto from "../../../Web.js";
|
|
5
5
|
const TesterantoComponent = ({ done, innerComp, }) => {
|
|
6
6
|
const myContainer = useRef(null);
|
|
@@ -56,17 +56,17 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
56
56
|
});
|
|
57
57
|
},
|
|
58
58
|
andWhen: function (s, whenCB, tr, utils) {
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
59
|
+
return whenCB(s, utils);
|
|
60
|
+
// return new Promise(async (resolve, rej) => {
|
|
61
|
+
// // resolve(await whenCB(s, utils));
|
|
62
|
+
// // process.nextTick(() => {
|
|
63
|
+
// // resolve(whenCB()(s));
|
|
64
|
+
// // });
|
|
65
|
+
// });
|
|
66
66
|
},
|
|
67
|
-
butThen: async function (s, thenCB) {
|
|
67
|
+
butThen: async function (s, thenCB, tr, utils) {
|
|
68
68
|
return new Promise((resolve, rej) => {
|
|
69
|
-
resolve(thenCB(s));
|
|
69
|
+
resolve(thenCB(s, utils));
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
72
|
afterEach: async function (store, ndx, artificer) {
|
package/dist/module/src/Web.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { PM_Web } from "./PM/web";
|
|
2
2
|
import Testeranto from "./lib/core.js";
|
|
3
3
|
import { defaultTestResourceRequirement, } from "./lib/index.js";
|
|
4
|
-
class WebTesteranto extends Testeranto {
|
|
4
|
+
export class WebTesteranto extends Testeranto {
|
|
5
5
|
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
6
6
|
super(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
7
7
|
}
|
|
8
8
|
async receiveTestResourceConfig(partialTestResource) {
|
|
9
9
|
const t = partialTestResource; //JSON.parse(partialTestResource);
|
|
10
10
|
const pm = new PM_Web(t);
|
|
11
|
-
const { failed, artifacts, logPromise } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
11
|
+
const { failed, artifacts, logPromise, features } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
12
12
|
pm.customclose();
|
|
13
|
+
return new Promise((res, rej) => {
|
|
14
|
+
res(features);
|
|
15
|
+
});
|
|
16
|
+
// return features;
|
|
13
17
|
// Promise.all([...artifacts, logPromise]).then(async () => {
|
|
14
18
|
// console.log("hello world");
|
|
15
19
|
// pm.customclose();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
export default {
|
|
3
|
+
name: "feature-markdown",
|
|
4
|
+
setup(build) {
|
|
5
|
+
build.onResolve({ filter: /\.md$/ }, (args) => {
|
|
6
|
+
if (args.resolveDir === "")
|
|
7
|
+
return;
|
|
8
|
+
return {
|
|
9
|
+
path: path.isAbsolute(args.path)
|
|
10
|
+
? args.path
|
|
11
|
+
: path.join(args.resolveDir, args.path),
|
|
12
|
+
namespace: "feature-markdown",
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
build.onLoad({ filter: /.*/, namespace: "feature-markdown" }, async (args) => {
|
|
16
|
+
// const markdownContent = new TextDecoder().decode(
|
|
17
|
+
// await fs.readFileSync(args.path)
|
|
18
|
+
// );
|
|
19
|
+
// markdownHTML = marked(markdownContent, options?.markedOptions);
|
|
20
|
+
return {
|
|
21
|
+
contents: `file://${args.path}`,
|
|
22
|
+
loader: "text",
|
|
23
|
+
// contents: JSON.stringify({ path: args.path }),
|
|
24
|
+
// loader: "json",
|
|
25
|
+
// contents: JSON.stringify({
|
|
26
|
+
// // html: markdownHTML,
|
|
27
|
+
// raw: markdownContent,
|
|
28
|
+
// filename: args.path, //path.basename(args.path),
|
|
29
|
+
// }),
|
|
30
|
+
// loader: "json",
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -1,74 +1,72 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
+
const otherInputs = {};
|
|
4
|
+
const register = (entrypoint, sources) => {
|
|
5
|
+
console.log("register", entrypoint, sources);
|
|
6
|
+
if (!otherInputs[entrypoint]) {
|
|
7
|
+
otherInputs[entrypoint] = new Set();
|
|
8
|
+
}
|
|
9
|
+
sources.forEach((s) => otherInputs[entrypoint].add(s));
|
|
10
|
+
};
|
|
11
|
+
function tree(meta, key) {
|
|
12
|
+
return [
|
|
13
|
+
key,
|
|
14
|
+
...meta.inputs[key].imports
|
|
15
|
+
.filter((x) => x.external !== true)
|
|
16
|
+
.filter((x) => x.path.split("/")[0] !== "node_modules")
|
|
17
|
+
.map((f) => f.path),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
3
20
|
export default (platform, entryPoints) => {
|
|
4
21
|
return {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
fs.
|
|
16
|
-
|
|
17
|
-
const j = Object.keys(Object.keys(result.metafile.outputs)
|
|
18
|
-
.filter((s) => {
|
|
19
|
-
if (!result.metafile.outputs[s].entryPoint) {
|
|
20
|
-
return false;
|
|
22
|
+
register,
|
|
23
|
+
inputFilesPluginFactory: {
|
|
24
|
+
name: "metafileWriter",
|
|
25
|
+
setup(build) {
|
|
26
|
+
build.onEnd((result) => {
|
|
27
|
+
fs.writeFileSync(`docs/${platform}/metafile.json`, JSON.stringify(result, null, 2));
|
|
28
|
+
if (result.errors.length === 0) {
|
|
29
|
+
entryPoints.forEach((entryPoint) => {
|
|
30
|
+
const filePath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `inputFiles.json`);
|
|
31
|
+
const dirName = path.dirname(filePath);
|
|
32
|
+
if (!fs.existsSync(dirName)) {
|
|
33
|
+
fs.mkdirSync(dirName, { recursive: true });
|
|
21
34
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const promptPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
|
|
36
|
+
const testPaths = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
|
|
37
|
+
const featuresPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`); // /read ${featuresPath}
|
|
38
|
+
if (result.metafile) {
|
|
39
|
+
const addableFiles = tree(result.metafile, entryPoint.split("/").slice(1).join("/"))
|
|
40
|
+
.map((y) => {
|
|
41
|
+
if (otherInputs[y]) {
|
|
42
|
+
return Array.from(otherInputs[y]);
|
|
43
|
+
}
|
|
44
|
+
return y;
|
|
45
|
+
})
|
|
46
|
+
.flat();
|
|
47
|
+
fs.writeFileSync(promptPath, `
|
|
48
|
+
${[...addableFiles]
|
|
49
|
+
.map((x) => {
|
|
50
|
+
return `/add ${x}`;
|
|
51
|
+
})
|
|
52
|
+
.join("\n")}
|
|
53
|
+
${[...addableFiles]
|
|
54
|
+
.map((x) => {
|
|
55
|
+
const f = `docs/ts/${x}.type_errors.txt`;
|
|
56
|
+
if (fs.existsSync(f)) {
|
|
57
|
+
return `/read ${f}`;
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
.join("\n")}
|
|
48
61
|
/read ${testPaths}
|
|
49
|
-
|
|
50
|
-
/code
|
|
62
|
+
/load ${featuresPath}
|
|
63
|
+
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors. Implement any method which throws "Function not implemented."
|
|
51
64
|
`);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// import os
|
|
58
|
-
// model = Model("deepseek")
|
|
59
|
-
// coder = Coder.create(main_model=model)
|
|
60
|
-
// coder.run("/read-only", "${testPaths}")
|
|
61
|
-
// ${j
|
|
62
|
-
// .map((x) => {
|
|
63
|
-
// return `coder.run("/add", "${x}")`;
|
|
64
|
-
// })
|
|
65
|
-
// .join("\n")}
|
|
66
|
-
// coder.run("fix the failing tests described in ${filePath}.")
|
|
67
|
-
// `
|
|
68
|
-
// );
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
},
|
|
72
70
|
},
|
|
73
71
|
};
|
|
74
72
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import baseEsBuildConfig from "./index.js";
|
|
2
2
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
3
|
+
import featuresPlugin from "./featuresPlugin";
|
|
3
4
|
export default (config, entryPoints) => {
|
|
5
|
+
const { inputFilesPluginFactory, register } = inputFilesPlugin("node", entryPoints);
|
|
6
|
+
// const inputFilesPluginFactory = inputFilesPlugin("node", entryPoints);
|
|
7
|
+
// const register = (x) => x;
|
|
4
8
|
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node",
|
|
5
9
|
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
6
10
|
metafile: true, supported: {
|
|
@@ -12,13 +16,16 @@ export default (config, entryPoints) => {
|
|
|
12
16
|
}, platform: "node", external: [
|
|
13
17
|
// "testeranto.json",
|
|
14
18
|
// "features.test.js",
|
|
15
|
-
|
|
19
|
+
"react",
|
|
16
20
|
// "events",
|
|
17
21
|
// "ganache"
|
|
18
22
|
...config.externals,
|
|
19
23
|
], entryPoints: [...entryPoints], plugins: [
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
featuresPlugin,
|
|
25
|
+
// markdownPlugin({}),
|
|
26
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
27
|
+
inputFilesPluginFactory,
|
|
28
|
+
// inputFilesPlugin("node", entryPoints),
|
|
22
29
|
{
|
|
23
30
|
name: "rebuild-notify",
|
|
24
31
|
setup(build) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import baseEsBuildConfig from "./index.js";
|
|
3
3
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
4
|
+
import featuresPlugin from "./featuresPlugin.js";
|
|
4
5
|
export default (config, entryPoints) => {
|
|
6
|
+
const { inputFilesPluginFactory, register } = inputFilesPlugin("web", entryPoints);
|
|
5
7
|
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), {
|
|
6
8
|
// inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
|
|
7
9
|
// banner: {
|
|
@@ -33,8 +35,10 @@ export default (config, entryPoints) => {
|
|
|
33
35
|
"process",
|
|
34
36
|
"dns",
|
|
35
37
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
featuresPlugin,
|
|
39
|
+
// markdownPlugin({}),
|
|
40
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
41
|
+
inputFilesPluginFactory,
|
|
38
42
|
{
|
|
39
43
|
name: "rebuild-notify",
|
|
40
44
|
setup(build) {
|