@sealcode/sealgen 0.1.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/.arcconfig +12 -0
- package/.arclint +18 -0
- package/.eslintrc.js +37 -0
- package/.log/ti-10372.log +479 -0
- package/.log/ti-10727.log +479 -0
- package/.log/tsserver.log +3811 -0
- package/.prettierrc +14 -0
- package/@types/add-collection.d.ts +1 -0
- package/@types/add-route.d.ts +1 -0
- package/@types/back/collections/delete-me.d.ts +7 -0
- package/@types/generate-collections.d.ts +1 -0
- package/@types/generate-routes.d.ts +1 -0
- package/@types/index.d.ts +2 -0
- package/@types/templates/collection.d.ts +1 -0
- package/@types/templates/form.d.ts +1 -0
- package/@types/templates/page.d.ts +1 -0
- package/@types/templates/route-test.d.ts +1 -0
- package/@types/utils/escape-url-params.d.ts +2 -0
- package/@types/utils/exec.d.ts +5 -0
- package/@types/utils/import-path.d.ts +2 -0
- package/@types/utils/question.d.ts +1 -0
- package/@types/utils/walk.d.ts +1 -0
- package/jenkins.sanity.sh +3 -0
- package/lib/add-collection.js +41 -0
- package/lib/add-collection.js.map +1 -0
- package/lib/add-route.js +52 -0
- package/lib/add-route.js.map +1 -0
- package/lib/back/collections/delete-me.js +14 -0
- package/lib/back/collections/delete-me.js.map +1 -0
- package/lib/generate-collections.js +67 -0
- package/lib/generate-collections.js.map +1 -0
- package/lib/generate-routes.js +71 -0
- package/lib/generate-routes.js.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/templates/collection.js +16 -0
- package/lib/templates/collection.js.map +1 -0
- package/lib/templates/form.js +46 -0
- package/lib/templates/form.js.map +1 -0
- package/lib/templates/page.js +24 -0
- package/lib/templates/page.js.map +1 -0
- package/lib/templates/route-test.js +27 -0
- package/lib/templates/route-test.js.map +1 -0
- package/lib/utils/escape-url-params.js +18 -0
- package/lib/utils/escape-url-params.js.map +1 -0
- package/lib/utils/exec.js +37 -0
- package/lib/utils/exec.js.map +1 -0
- package/lib/utils/import-path.js +24 -0
- package/lib/utils/import-path.js.map +1 -0
- package/lib/utils/question.js +34 -0
- package/lib/utils/question.js.map +1 -0
- package/lib/utils/walk.js +35 -0
- package/lib/utils/walk.js.map +1 -0
- package/package.json +38 -0
- package/src/add-collection.ts +30 -0
- package/src/add-route.ts +49 -0
- package/src/example.test.ts +11 -0
- package/src/generate-collections.ts +72 -0
- package/src/generate-routes.ts +78 -0
- package/src/index.ts +28 -0
- package/src/templates/collection.ts +11 -0
- package/src/templates/form.ts +42 -0
- package/src/templates/page.ts +23 -0
- package/src/templates/route-test.ts +23 -0
- package/src/tsconfig.json +18 -0
- package/src/utils/escape-url-params.ts +13 -0
- package/src/utils/exec.ts +24 -0
- package/src/utils/import-path.ts +25 -0
- package/src/utils/question.ts +20 -0
- package/src/utils/walk.ts +20 -0
- package/test.js +68 -0
- package/tsconfig.json +26 -0
package/test.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const mri = require("mri");
|
|
2
|
+
const { spawn } = require("child_process");
|
|
3
|
+
|
|
4
|
+
const argv = process.argv.slice(2);
|
|
5
|
+
const args = mri(argv);
|
|
6
|
+
|
|
7
|
+
const bin_dir = "./node_modules/.bin/";
|
|
8
|
+
|
|
9
|
+
const mocha = bin_dir + "mocha";
|
|
10
|
+
|
|
11
|
+
let mocha_options = [
|
|
12
|
+
"--recursive",
|
|
13
|
+
"--timeout=10000",
|
|
14
|
+
"--require",
|
|
15
|
+
"source-map-support/register",
|
|
16
|
+
"-r",
|
|
17
|
+
" ts-node/register"
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
if (args["test-report"]) {
|
|
21
|
+
mocha_options = [
|
|
22
|
+
...mocha_options,
|
|
23
|
+
"--reporter",
|
|
24
|
+
"xunit",
|
|
25
|
+
"--reporter-option",
|
|
26
|
+
"output=.xunit",
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const mocha_files = ["src/**/*.test.ts"];
|
|
31
|
+
|
|
32
|
+
let command = [mocha, ...mocha_options, ...mocha_files];
|
|
33
|
+
|
|
34
|
+
if (args.cover) {
|
|
35
|
+
const nyc = [
|
|
36
|
+
bin_dir + "nyc",
|
|
37
|
+
"-all",
|
|
38
|
+
"--exclude",
|
|
39
|
+
"lib",
|
|
40
|
+
"--source-map",
|
|
41
|
+
"false",
|
|
42
|
+
];
|
|
43
|
+
if (args["cover-html"]) {
|
|
44
|
+
nyc.push("--reporter", "lcov");
|
|
45
|
+
} else {
|
|
46
|
+
nyc.push("--reporter", "clover");
|
|
47
|
+
}
|
|
48
|
+
command = [...nyc, ...command];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (args.debug) {
|
|
52
|
+
command = ["node", "inspect", ...command];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log("spawning mocha...", command);
|
|
56
|
+
|
|
57
|
+
const proc = spawn(command[0], command.slice(1), {
|
|
58
|
+
stdio: "inherit",
|
|
59
|
+
env: process.env,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
proc.on("exit", function (code) {
|
|
63
|
+
if (args["test-report"]) {
|
|
64
|
+
process.exit(0);
|
|
65
|
+
} else {
|
|
66
|
+
process.exit(code);
|
|
67
|
+
}
|
|
68
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"target": "ES6",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"lib": [
|
|
12
|
+
"ES6",
|
|
13
|
+
"ESNext"
|
|
14
|
+
],
|
|
15
|
+
"outDir": "lib",
|
|
16
|
+
"checkJs": true,
|
|
17
|
+
"allowJs": true,
|
|
18
|
+
"declarationDir": "@types",
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"sourceMap": true
|
|
21
|
+
},
|
|
22
|
+
"include":[
|
|
23
|
+
"src/**/*"
|
|
24
|
+
],
|
|
25
|
+
"exclude": ["src/**/*.test.ts"]
|
|
26
|
+
}
|