@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.
Files changed (72) hide show
  1. package/.arcconfig +12 -0
  2. package/.arclint +18 -0
  3. package/.eslintrc.js +37 -0
  4. package/.log/ti-10372.log +479 -0
  5. package/.log/ti-10727.log +479 -0
  6. package/.log/tsserver.log +3811 -0
  7. package/.prettierrc +14 -0
  8. package/@types/add-collection.d.ts +1 -0
  9. package/@types/add-route.d.ts +1 -0
  10. package/@types/back/collections/delete-me.d.ts +7 -0
  11. package/@types/generate-collections.d.ts +1 -0
  12. package/@types/generate-routes.d.ts +1 -0
  13. package/@types/index.d.ts +2 -0
  14. package/@types/templates/collection.d.ts +1 -0
  15. package/@types/templates/form.d.ts +1 -0
  16. package/@types/templates/page.d.ts +1 -0
  17. package/@types/templates/route-test.d.ts +1 -0
  18. package/@types/utils/escape-url-params.d.ts +2 -0
  19. package/@types/utils/exec.d.ts +5 -0
  20. package/@types/utils/import-path.d.ts +2 -0
  21. package/@types/utils/question.d.ts +1 -0
  22. package/@types/utils/walk.d.ts +1 -0
  23. package/jenkins.sanity.sh +3 -0
  24. package/lib/add-collection.js +41 -0
  25. package/lib/add-collection.js.map +1 -0
  26. package/lib/add-route.js +52 -0
  27. package/lib/add-route.js.map +1 -0
  28. package/lib/back/collections/delete-me.js +14 -0
  29. package/lib/back/collections/delete-me.js.map +1 -0
  30. package/lib/generate-collections.js +67 -0
  31. package/lib/generate-collections.js.map +1 -0
  32. package/lib/generate-routes.js +71 -0
  33. package/lib/generate-routes.js.map +1 -0
  34. package/lib/index.js +39 -0
  35. package/lib/index.js.map +1 -0
  36. package/lib/templates/collection.js +16 -0
  37. package/lib/templates/collection.js.map +1 -0
  38. package/lib/templates/form.js +46 -0
  39. package/lib/templates/form.js.map +1 -0
  40. package/lib/templates/page.js +24 -0
  41. package/lib/templates/page.js.map +1 -0
  42. package/lib/templates/route-test.js +27 -0
  43. package/lib/templates/route-test.js.map +1 -0
  44. package/lib/utils/escape-url-params.js +18 -0
  45. package/lib/utils/escape-url-params.js.map +1 -0
  46. package/lib/utils/exec.js +37 -0
  47. package/lib/utils/exec.js.map +1 -0
  48. package/lib/utils/import-path.js +24 -0
  49. package/lib/utils/import-path.js.map +1 -0
  50. package/lib/utils/question.js +34 -0
  51. package/lib/utils/question.js.map +1 -0
  52. package/lib/utils/walk.js +35 -0
  53. package/lib/utils/walk.js.map +1 -0
  54. package/package.json +38 -0
  55. package/src/add-collection.ts +30 -0
  56. package/src/add-route.ts +49 -0
  57. package/src/example.test.ts +11 -0
  58. package/src/generate-collections.ts +72 -0
  59. package/src/generate-routes.ts +78 -0
  60. package/src/index.ts +28 -0
  61. package/src/templates/collection.ts +11 -0
  62. package/src/templates/form.ts +42 -0
  63. package/src/templates/page.ts +23 -0
  64. package/src/templates/route-test.ts +23 -0
  65. package/src/tsconfig.json +18 -0
  66. package/src/utils/escape-url-params.ts +13 -0
  67. package/src/utils/exec.ts +24 -0
  68. package/src/utils/import-path.ts +25 -0
  69. package/src/utils/question.ts +20 -0
  70. package/src/utils/walk.ts +20 -0
  71. package/test.js +68 -0
  72. 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
+ }