@maka/maka-cli 3.3.68 → 4.0.75

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 (274) hide show
  1. package/.eslintrc.json +19 -0
  2. package/.mocharc.json +3 -0
  3. package/README.md +4 -10
  4. package/dist/README.md +27 -0
  5. package/dist/command.js +1 -0
  6. package/dist/commands/_index.js +1 -0
  7. package/dist/commands/aws/_index.js +1 -0
  8. package/dist/commands/aws/aws.command.js +1 -0
  9. package/dist/commands/aws/ci.sub.cmd.js +1 -0
  10. package/dist/commands/aws/ckp.sub.cmd.js +1 -0
  11. package/dist/commands/aws/csg.sub.cmd.js +1 -0
  12. package/dist/commands/aws/di.sub.cmd.js +1 -0
  13. package/dist/commands/aws/dks.sub.cmd.js +1 -0
  14. package/dist/commands/aws/rbi.sub.cmd.js +1 -0
  15. package/dist/commands/aws/sth.sub.cmd.js +1 -0
  16. package/dist/commands/aws/ti.sub.cmd.js +1 -0
  17. package/dist/commands/build/_index.js +1 -0
  18. package/dist/commands/build/build.js +1 -0
  19. package/dist/commands/build/docker.sub.cmd.js +1 -0
  20. package/dist/commands/create.js +1 -0
  21. package/dist/commands/debug.js +1 -0
  22. package/dist/commands/deploy.js +1 -0
  23. package/dist/commands/game/_index.js +1 -0
  24. package/dist/commands/game/battleship.sub.cmd.js +1 -0
  25. package/dist/commands/game/play.command.js +1 -0
  26. package/dist/commands/game/pong.sub.cmd.js +1 -0
  27. package/dist/commands/game/snake.sub.cmd.js +1 -0
  28. package/dist/commands/game/tetris.sub.cmd.js +1 -0
  29. package/dist/commands/generate.js +1 -0
  30. package/dist/commands/get/_index.js +1 -0
  31. package/dist/commands/get/get.command.js +1 -0
  32. package/dist/commands/get/global.sub.cmd.js +1 -0
  33. package/dist/commands/get/local.sub.cmd.js +1 -0
  34. package/dist/commands/help.js +1 -0
  35. package/dist/commands/install.js +1 -0
  36. package/dist/commands/jsdoc.js +1 -0
  37. package/dist/commands/login.js +1 -0
  38. package/dist/commands/logout.js +1 -0
  39. package/dist/commands/logs.js +1 -0
  40. package/dist/commands/maka.cmd.js +1 -0
  41. package/dist/commands/murder.js +1 -0
  42. package/dist/commands/reconfig.js +1 -0
  43. package/dist/commands/run.js +1 -0
  44. package/dist/commands/set/_index.js +1 -0
  45. package/dist/commands/set/global.sub.cmd.js +1 -0
  46. package/dist/commands/set/local.sub.cmd.js +1 -0
  47. package/dist/commands/set/set.command.js +1 -0
  48. package/dist/commands/ssh.js +1 -0
  49. package/dist/commands/ssl.js +1 -0
  50. package/dist/commands/test.js +1 -0
  51. package/dist/commands/version.js +1 -0
  52. package/dist/error.js +1 -0
  53. package/dist/generator.js +1 -0
  54. package/dist/generators/_index.js +1 -0
  55. package/dist/generators/api.js +1 -0
  56. package/dist/generators/collection.js +1 -0
  57. package/dist/generators/component.js +1 -0
  58. package/dist/generators/config.js +1 -0
  59. package/dist/generators/dbc.js +1 -0
  60. package/dist/generators/dockerfile.js +1 -0
  61. package/dist/generators/hook.js +1 -0
  62. package/dist/generators/kit.js +1 -0
  63. package/dist/generators/layout.js +1 -0
  64. package/dist/generators/maka.gen.js +1 -0
  65. package/dist/generators/methods.js +1 -0
  66. package/dist/generators/package.js +1 -0
  67. package/dist/generators/page.js +1 -0
  68. package/dist/generators/publish.js +1 -0
  69. package/dist/generators/route.js +1 -0
  70. package/dist/generators/scaffold.js +1 -0
  71. package/dist/generators/service.js +1 -0
  72. package/dist/maka.js +2 -0
  73. package/dist/templates/meteor/api/api.js +11 -0
  74. package/dist/templates/meteor/api/api.js.ts +11 -0
  75. package/dist/templates/meteor/api/collection.js +86 -0
  76. package/dist/templates/meteor/api/collection.js.ts +94 -0
  77. package/dist/templates/meteor/api/fixtures.js +23 -0
  78. package/dist/templates/meteor/api/fixtures.js.ts +23 -0
  79. package/dist/templates/meteor/api/methods.js +136 -0
  80. package/dist/templates/meteor/api/methods.js.ts +137 -0
  81. package/dist/templates/meteor/api/publications.js +31 -0
  82. package/dist/templates/meteor/api/publications.js.ts +31 -0
  83. package/dist/templates/meteor/api/register-api.js +15 -0
  84. package/dist/templates/meteor/api/register-api.js.ts +15 -0
  85. package/dist/templates/meteor/api/resolvers.js +9 -0
  86. package/dist/templates/meteor/api/resolvers.js.ts +9 -0
  87. package/dist/templates/meteor/api/tests.js +1 -0
  88. package/dist/templates/meteor/api/tests.js.ts +1 -0
  89. package/dist/templates/meteor/api/typeDefs.js +5 -0
  90. package/dist/templates/meteor/api/typeDefs.js.ts +5 -0
  91. package/dist/templates/meteor/app/client/.gitkeep +0 -0
  92. package/dist/templates/meteor/app/client/body.html +3 -0
  93. package/dist/templates/meteor/app/client/head.html +25 -0
  94. package/dist/templates/meteor/app/client/main.app-tests.js +9 -0
  95. package/dist/templates/meteor/app/client/main.app-tests.js.jsx +9 -0
  96. package/dist/templates/meteor/app/client/main.app-tests.js.ts +9 -0
  97. package/dist/templates/meteor/app/client/main.app-tests.js.tsx +9 -0
  98. package/dist/templates/meteor/app/client/main.js +1 -0
  99. package/dist/templates/meteor/app/client/main.js.jsx +1 -0
  100. package/dist/templates/meteor/app/client/main.js.ts +1 -0
  101. package/dist/templates/meteor/app/client/main.js.tsx +1 -0
  102. package/dist/templates/meteor/app/imports/api/.gitkeep +0 -0
  103. package/dist/templates/meteor/app/imports/startup/client/index.js +19 -0
  104. package/dist/templates/meteor/app/imports/startup/client/index.js.jsx +100 -0
  105. package/dist/templates/meteor/app/imports/startup/client/index.js.ts +19 -0
  106. package/dist/templates/meteor/app/imports/startup/client/index.js.tsx +101 -0
  107. package/dist/templates/meteor/app/imports/startup/client/routes.js +39 -0
  108. package/dist/templates/meteor/app/imports/startup/client/routes.js.jsx +48 -0
  109. package/dist/templates/meteor/app/imports/startup/client/routes.js.ts +24 -0
  110. package/dist/templates/meteor/app/imports/startup/client/routes.js.tsx +48 -0
  111. package/dist/templates/meteor/app/imports/startup/client/templates.js +9 -0
  112. package/dist/templates/meteor/app/imports/startup/client/templates.js.jsx +9 -0
  113. package/dist/templates/meteor/app/imports/startup/client/templates.js.ts +9 -0
  114. package/dist/templates/meteor/app/imports/startup/client/templates.js.tsx +9 -0
  115. package/dist/templates/meteor/app/imports/startup/lib/index.js +1 -0
  116. package/dist/templates/meteor/app/imports/startup/lib/index.js.jsx +10 -0
  117. package/dist/templates/meteor/app/imports/startup/lib/index.js.ts +1 -0
  118. package/dist/templates/meteor/app/imports/startup/lib/index.js.tsx +10 -0
  119. package/dist/templates/meteor/app/imports/startup/lib/routes.js.jsx +48 -0
  120. package/dist/templates/meteor/app/imports/startup/lib/routes.js.tsx +48 -0
  121. package/dist/templates/meteor/app/imports/startup/lib/templates.js.jsx +0 -0
  122. package/dist/templates/meteor/app/imports/startup/lib/templates.js.tsx +0 -0
  123. package/dist/templates/meteor/app/imports/startup/server/index.js +1 -0
  124. package/dist/templates/meteor/app/imports/startup/server/index.js.jsx +139 -0
  125. package/dist/templates/meteor/app/imports/startup/server/index.js.ts +0 -0
  126. package/dist/templates/meteor/app/imports/startup/server/index.js.tsx +138 -0
  127. package/dist/templates/meteor/app/imports/ui/test-helpers.js +24 -0
  128. package/dist/templates/meteor/app/imports/ui/test-helpers.js.ts +24 -0
  129. package/dist/templates/meteor/app/lib/.gitkeep +0 -0
  130. package/dist/templates/meteor/app/lib/main.js +1 -0
  131. package/dist/templates/meteor/app/lib/main.js.jsx +1 -0
  132. package/dist/templates/meteor/app/lib/main.js.ts +1 -0
  133. package/dist/templates/meteor/app/lib/main.js.tsx +1 -0
  134. package/dist/templates/meteor/app/maka.d.ts +160 -0
  135. package/dist/templates/meteor/app/meteor.d.ts +955 -0
  136. package/dist/templates/meteor/app/packages/.gitkeep +0 -0
  137. package/dist/templates/meteor/app/private/.gitkeep +0 -0
  138. package/dist/templates/meteor/app/public/.gitkeep +0 -0
  139. package/dist/templates/meteor/app/public/favicon.ico +0 -0
  140. package/dist/templates/meteor/app/public/manifest.json +9 -0
  141. package/dist/templates/meteor/app/public/sw.js +30 -0
  142. package/dist/templates/meteor/app/public/sw.js.jsx +30 -0
  143. package/dist/templates/meteor/app/public/sw.js.ts +30 -0
  144. package/dist/templates/meteor/app/public/sw.js.tsx +30 -0
  145. package/dist/templates/meteor/app/server/.gitkeep +0 -0
  146. package/dist/templates/meteor/app/server/main.app-tests.js +9 -0
  147. package/dist/templates/meteor/app/server/main.app-tests.js.jsx +9 -0
  148. package/dist/templates/meteor/app/server/main.app-tests.js.ts +9 -0
  149. package/dist/templates/meteor/app/server/main.app-tests.js.tsx +9 -0
  150. package/dist/templates/meteor/app/server/main.js +3 -0
  151. package/dist/templates/meteor/app/server/main.js.jsx +3 -0
  152. package/dist/templates/meteor/app/server/main.js.ts +3 -0
  153. package/dist/templates/meteor/app/server/main.js.tsx +3 -0
  154. package/dist/templates/meteor/app/tsconfig.json +26 -0
  155. package/dist/templates/meteor/collection/collection.js +85 -0
  156. package/dist/templates/meteor/collection/collection.js.ts +97 -0
  157. package/dist/templates/meteor/collection/tests.js +27 -0
  158. package/dist/templates/meteor/collection/tests.js.ts +27 -0
  159. package/dist/templates/meteor/config/docker-compose.yaml +17 -0
  160. package/dist/templates/meteor/config/pm2.config.js +25 -0
  161. package/dist/templates/meteor/config/process.env +5 -0
  162. package/dist/templates/meteor/config/settings.json +8 -0
  163. package/dist/templates/meteor/config/ssh.json +6 -0
  164. package/dist/templates/meteor/dbc/config.js +70 -0
  165. package/dist/templates/meteor/dbc/config.js.ts +70 -0
  166. package/dist/templates/meteor/dbc/conn.js +37 -0
  167. package/dist/templates/meteor/dbc/conn.js.ts +37 -0
  168. package/dist/templates/meteor/dbc/register-dbc.js +3 -0
  169. package/dist/templates/meteor/dbc/register-dbc.js.ts +3 -0
  170. package/dist/templates/meteor/method/method.js +48 -0
  171. package/dist/templates/meteor/method/method.js.ts +48 -0
  172. package/dist/templates/meteor/package/client/package.js +0 -0
  173. package/dist/templates/meteor/package/client/package.js.jsx +0 -0
  174. package/dist/templates/meteor/package/client/package.js.ts +0 -0
  175. package/dist/templates/meteor/package/client/package.js.tsx +0 -0
  176. package/dist/templates/meteor/package/lib/package.js +0 -0
  177. package/dist/templates/meteor/package/lib/package.js.jsx +0 -0
  178. package/dist/templates/meteor/package/lib/package.js.ts +0 -0
  179. package/dist/templates/meteor/package/lib/package.js.tsx +0 -0
  180. package/dist/templates/meteor/package/package.js +37 -0
  181. package/dist/templates/meteor/package/package.js.jsx +37 -0
  182. package/dist/templates/meteor/package/package.js.ts +36 -0
  183. package/dist/templates/meteor/package/package.js.tsx +37 -0
  184. package/dist/templates/meteor/package/server/package.js +0 -0
  185. package/dist/templates/meteor/package/server/package.js.jsx +0 -0
  186. package/dist/templates/meteor/package/server/package.js.ts +0 -0
  187. package/dist/templates/meteor/package/server/package.js.tsx +0 -0
  188. package/dist/templates/meteor/package/tests/client/package.js +5 -0
  189. package/dist/templates/meteor/package/tests/client/package.js.jsx +5 -0
  190. package/dist/templates/meteor/package/tests/client/package.js.ts +5 -0
  191. package/dist/templates/meteor/package/tests/client/package.js.tsx +5 -0
  192. package/dist/templates/meteor/package/tests/server/package.js +5 -0
  193. package/dist/templates/meteor/package/tests/server/package.js.jsx +5 -0
  194. package/dist/templates/meteor/package/tests/server/package.js.ts +5 -0
  195. package/dist/templates/meteor/package/tests/server/package.js.tsx +5 -0
  196. package/dist/templates/meteor/project/.maka/config.json +29 -0
  197. package/dist/templates/meteor/project/README.md +1 -0
  198. package/dist/templates/meteor/project/build/.gitkeep +0 -0
  199. package/dist/templates/meteor/project/build/README +4 -0
  200. package/dist/templates/meteor/project/gitignore +6 -0
  201. package/dist/templates/meteor/publish/publish.js +3 -0
  202. package/dist/templates/meteor/publish/publish.js.jsx +3 -0
  203. package/dist/templates/meteor/publish/publish.js.tsx +3 -0
  204. package/dist/templates/meteor/publish/publish.ts +3 -0
  205. package/dist/templates/meteor/service/logger/logger.js +17 -0
  206. package/dist/templates/meteor/service/logger/logger.js.ts +17 -0
  207. package/dist/templates/meteor/service/logger/transports.js +31 -0
  208. package/dist/templates/meteor/service/logger/transports.js.ts +31 -0
  209. package/dist/templates/meteor/stylesheet/stylesheet.css +5 -0
  210. package/dist/templates/meteor/stylesheet/stylesheet.css.less +5 -0
  211. package/dist/templates/meteor/template/template-tests.js +1 -0
  212. package/dist/templates/meteor/template/template-tests.js.jsx +55 -0
  213. package/dist/templates/meteor/template/template-tests.js.ts +1 -0
  214. package/dist/templates/meteor/template/template-tests.js.tsx +55 -0
  215. package/dist/templates/meteor/template/template.css +6 -0
  216. package/dist/templates/meteor/template/template.css.less +6 -0
  217. package/dist/templates/meteor/template/template.html +5 -0
  218. package/dist/templates/meteor/template/template.js +20 -0
  219. package/dist/templates/meteor/template/template.js.jsx +77 -0
  220. package/dist/templates/meteor/template/template.js.ts +1 -0
  221. package/dist/templates/meteor/template/template.js.tsx +89 -0
  222. package/dist/templates/react/component/component.css +6 -0
  223. package/dist/templates/react/component/component.css.less +6 -0
  224. package/dist/templates/react/component/component.js +0 -0
  225. package/dist/templates/react/component/component.js.jsx +64 -0
  226. package/dist/templates/react/component/component.js.ts +0 -0
  227. package/dist/templates/react/component/component.js.tsx +68 -0
  228. package/dist/templates/react/hook/hook.js +1 -0
  229. package/dist/templates/react/hook/hook.js.jsx +25 -0
  230. package/dist/templates/react/hook/hook.js.ts +0 -0
  231. package/dist/templates/react/hook/hook.js.tsx +25 -0
  232. package/dist/templates/react/route/route.js +8 -0
  233. package/dist/templates/react/route/route.js.jsx +8 -0
  234. package/dist/templates/react/route/route.js.ts +8 -0
  235. package/dist/templates/react/route/route.js.tsx +8 -0
  236. package/dist/templates/react/test/test.js +1 -0
  237. package/dist/templates/react/test/test.js.jsx +56 -0
  238. package/dist/templates/react/test/test.js.ts +1 -0
  239. package/dist/templates/react/test/test.js.tsx +55 -0
  240. package/dist/templates/service/docker/Dockerfile +54 -0
  241. package/dist/tool.js +1 -0
  242. package/dist/tools/actions/actions.class.js +1 -0
  243. package/dist/tools/actions/actions.test.js +1 -0
  244. package/dist/tools/aws/aws.class.js +1 -0
  245. package/dist/tools/aws/aws.interfaces.js +1 -0
  246. package/dist/tools/aws/aws.test.js +0 -0
  247. package/dist/tools/docker/docker.class.js +1 -0
  248. package/dist/tools/docker/docker.interfaces.js +1 -0
  249. package/dist/tools/docker/docker.test.js +0 -0
  250. package/dist/tools/fsi/fsi.class.js +1 -0
  251. package/dist/tools/fsi/fsi.interfaces.js +1 -0
  252. package/dist/tools/https/https.class.js +1 -0
  253. package/dist/tools/https/https.interface.js +1 -0
  254. package/dist/tools/log/log.class.js +1 -0
  255. package/dist/tools/log/log.interfaces.js +1 -0
  256. package/dist/tools/log/log.test.js +0 -0
  257. package/dist/tools/spawn-async/spawn-async.class.js +1 -0
  258. package/dist/tools/spawn-async/spawn-async.interfaces.js +1 -0
  259. package/dist/tools/spawn-async/spawn-async.test.js +0 -0
  260. package/dist/tools/ssh/ssh.class.js +1 -0
  261. package/dist/tools/ssh/ssh.interfaces.js +1 -0
  262. package/dist/tools/ssh/ssh.test.js +0 -0
  263. package/dist/tools/ssl/ssl.class.js +1 -0
  264. package/dist/tools/ssl/ssl.interfaces.js +0 -0
  265. package/dist/tools/ssl/ssl.test.js +0 -0
  266. package/obfuscator.json +29 -0
  267. package/package.json +86 -27
  268. package/tsconfig.json +23 -0
  269. package/AUTHORS +0 -19
  270. package/LICENSE +0 -1
  271. package/compiled/linux/maka +0 -0
  272. package/compiled/macos/maka +0 -0
  273. package/compiled/win/maka.exe +0 -0
  274. package/maka +0 -23
@@ -0,0 +1,70 @@
1
+ /* Copy the following into respective settings.json files for each
2
+ * environment you wish to enable (dev, staging, prod, etc). */
3
+ <% if (type === 'pgsql') { %>
4
+ /*
5
+ "<%= camelCase %>PgConfig": {
6
+ "pgUser": "",
7
+ "pgDatabase": "",
8
+ "pgPassword": "",
9
+ "pgHost": "localhost",
10
+ "pgPort": 5432,
11
+ "pgMaxPoolClients": 10,
12
+ "pgTimeoutMilli": 5000
13
+ }
14
+ */
15
+ const pgConfig = Meteor.settings.<%= camelCase %>PgConfig;
16
+ const config = {
17
+ user: pgConfig?.pgUser,
18
+ database: pgConfig?.pgDatabase,
19
+ password: pgConfig?.pgPassword,
20
+ host: pgConfig?.pgHost,
21
+ port: pgConfig?.pgPort,
22
+ max: pgConfig?.pgMaxPoolClients,
23
+ idleTimeoutMillis: pgConfig?.pgTimeoutMilli
24
+ };
25
+
26
+ export default config;
27
+ <% } else if (type === 'mssql') { %>
28
+ /*
29
+ "<%= camelCase %>MsConfig": {
30
+ "msUser": "",
31
+ "msDatabase": "",
32
+ "msPassword": "",
33
+ "msHost": "localhost",
34
+ "msPort": 1433,
35
+ "msMaxPoolClients": 10,
36
+ "msPoolTimeoutMilli": 5000,
37
+ "trustedConnections": true
38
+ }
39
+ */
40
+ const msConfig = Meteor.settings.<%= camelCase %>MsConfig;
41
+ const config = {
42
+ user: msConfig?.msUser,
43
+ database: msConfig?.msDatabase,
44
+ password: msConfig?.msPassword,
45
+ server: msConfig?.msHost,
46
+ port: msConfig?.msPort,
47
+ pool: {
48
+ max: msConfig?.msMaxPoolClients,
49
+ idleTimeoutMillis: msConfig?.msPoolTimeoutMilli
50
+ },
51
+ options: {
52
+ trustedConnecton: msConfig?.trustedConnections
53
+ }
54
+ };
55
+
56
+ export default config;
57
+ <% } else if (type === 'sqlite') { %>
58
+ /*
59
+ "<%= camelCase %>LiteConfig": {
60
+ "readonly": false,
61
+ "fileMustExist": false
62
+ }
63
+ */
64
+ const sqliteConfig = Meteor.settings.<%= camelCase %>LiteConfig;
65
+ const config = {
66
+ readonly: sqliteConfig?.readonly,
67
+ fileMustExist: sqliteConfig?.fileMustExist
68
+ }
69
+ export default config;
70
+ <% } %>
@@ -0,0 +1,37 @@
1
+ <% if (type === 'pgsql') { %>
2
+ // https://node-postgres.com/features/pooling
3
+ import pg from 'pg';
4
+ import config from './config';
5
+
6
+ console.log(`Enabling <%= name %> PG SQL client pool ...`);
7
+ const <%= camelCase %>PgPool = new pg.Pool(config);
8
+ <%= camelCase %>PgPool.on('error', (err, client) => {
9
+ console.error(`Unexpected PostgreSQL error on idle client: ${err}`);
10
+ });
11
+
12
+ export default <%= camelCase %>PgPool;
13
+ <% } else if (type === 'mssql') { %>
14
+ // https://www.npmjs.com/package/mssql
15
+ import sql from 'mssql';
16
+ import config from './config';
17
+
18
+ console.log(`Enabling <%= name %> MS SQL client pool ...`);
19
+ const <%= camelCase %>MsPool = new sql.ConnectionPool(config, err => {
20
+ if (err) {
21
+ console.error(`<%= name %> connection NOT established. ${err}`);
22
+ console.error(`Check configuration /imports/startup/server/dbc/<%=fileName%>/config.<%=engine%>`);
23
+ } else {
24
+ console.log(`Connection to <%= name %> SQL Server established.`);
25
+ }
26
+ });
27
+
28
+ export default <%= camelCase %>MsPool;
29
+ <% } else if (type === 'sqlite') { %>
30
+ // https://github.com/JoshuaWise/better-sqlite
31
+ import Database from 'better-sqlite3';
32
+ import config from './config';
33
+
34
+ console.log(`Enabling <%= name %> SQL LITE3 database ...`);
35
+ const <%= camelCase %>SqlLiteDB = new Database(`${process.env['PWD']}/private/<%= camelCase %>.db`, config);
36
+ export default <%= camelCase %>SqlLiteDB;
37
+ <% } %>
@@ -0,0 +1,37 @@
1
+ <% if (type === 'pgsql') { %>
2
+ // https://node-postgres.com/features/pooling
3
+ import pg from 'pg';
4
+ import config from './config';
5
+
6
+ console.log(`[+] Enabling <%= name %> PG SQL client pool ...`);
7
+ const <%= camelCase %>PgPool = new pg.Pool(config);
8
+ <%= camelCase %>PgPool.on('error', (err, client) => {
9
+ console.log(`[!] Unexpected PostgreSQL error on idle client: ${err}`);
10
+ });
11
+
12
+ export default <%= camelCase %>PgPool;
13
+ <% } else if (type === 'mssql') { %>
14
+ // https://www.npmjs.com/package/mssql
15
+ import sql from 'mssql';
16
+ import config from './config';
17
+
18
+ console.log(`[+] Enabling <%= name %> MS SQL client pool ...`);
19
+ const <%= camelCase %>MsPool = new sql.ConnectionPool(config, err => {
20
+ if (err) {
21
+ console.log(`[-] <%= name %> connection NOT established. ${err}`);
22
+ console.log(`[!] Check configuration /imports/startup/server/dbc/<%=fileName%>/config.<%=engine%>`);
23
+ } else {
24
+ console.log(`[+] Connection to <%= name %> SQL Server established.`);
25
+ }
26
+ });
27
+
28
+ export default <%= camelCase %>MsPool;
29
+ <% } else if (type === 'sqlite') { %>
30
+ // https://github.com/JoshuaWise/better-sqlite
31
+ import Database from 'better-sqlite3';
32
+ import config from './config';
33
+
34
+ console.log(`[+] Enabling <%= name %> SQL LITE3 database ...`);
35
+ const <%= camelCase %>SqlLiteDB = new Database(`${process.env['PWD']}/private/<%= camelCase %>.db`, config);
36
+ export default <%= camelCase %>SqlLiteDB;
37
+ <% } %>
@@ -0,0 +1,3 @@
1
+ import './dbc/<%= fileName %>/config';
2
+ import './dbc/<%= fileName %>/conn';
3
+
@@ -0,0 +1,3 @@
1
+ import './dbc/<%= fileName %>/config';
2
+ import './dbc/<%= fileName %>/conn';
3
+
@@ -0,0 +1,48 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import { ValidatedMethod } from 'meteor/mdg:validated-method';
3
+ import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
4
+ import { check, Match } from 'meteor/check';
5
+
6
+ /**
7
+ * Using ValidatedMethod (maintained by MDG) is the best
8
+ * practice by Meteor Development Group (MDG),
9
+ * and as such is used here to validate that method
10
+ * calls from the client are properly handled.
11
+ *
12
+ */
13
+
14
+ /**
15
+ * @memberof Server.<%= name %>
16
+ * @method
17
+ * @property { string } name String that defines the method.
18
+ * @property { function } validate Is run before the main execution.
19
+ * @property { function } run The main action that is executed.
20
+ */
21
+ const <%= className %> = new ValidatedMethod({
22
+ name: '<%= fileName %>.server',
23
+ validate() {
24
+ //check(this.userId, String);
25
+ },
26
+ run() {
27
+ // insert code to run.
28
+ return false;
29
+ },
30
+ });
31
+
32
+ const RATE_LIMITED_METHODS = [
33
+ <%= className %>,
34
+ ].map(value => value['name']);
35
+
36
+ if (Meteor.isServer) {
37
+ const OPERATIONS = 5;
38
+ const PER_SECOND = 1 * 1000; // milliseconds
39
+ // Only allow 5 list operations per connection per second.
40
+ DDPRateLimiter.addRule({
41
+ name(name) {
42
+ return RATE_LIMITED_METHODS.includes(name);
43
+ },
44
+
45
+ // Rate limit per connection ID.
46
+ connectionId() { return true; },
47
+ }, OPERATIONS, PER_SECOND);
48
+ }
@@ -0,0 +1,48 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import { ValidatedMethod } from 'meteor/mdg:validated-method';
3
+ import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
4
+ import { check, Match } from 'meteor/check';
5
+
6
+ /**
7
+ * Using ValidatedMethod (maintained by MDG) is the best
8
+ * practice by Meteor Development Group (MDG),
9
+ * and as such is used here to validate that method
10
+ * calls from the client are properly handled.
11
+ *
12
+ */
13
+
14
+ /**
15
+ * @memberof Server.<%= name %>
16
+ * @method
17
+ * @property { string } name String that defines the method.
18
+ * @property { function } validate Is run before the main execution.
19
+ * @property { function } run The main action that is executed.
20
+ */
21
+ const <%= className %> = new ValidatedMethod({
22
+ name: '<%= fileName %>.server',
23
+ validate() {
24
+ //check(this.userId, String);
25
+ },
26
+ run() {
27
+ // insert code to run.
28
+ return false;
29
+ },
30
+ });
31
+
32
+ const RATE_LIMITED_METHODS = [
33
+ <%= className %>,
34
+ ].map(value => value['name']);
35
+
36
+ if (Meteor.isServer) {
37
+ const OPERATIONS = 5;
38
+ const PER_SECOND = 1 * 1000; // milliseconds
39
+ // Only allow 5 list operations per connection per second.
40
+ DDPRateLimiter.addRule({
41
+ name(name) {
42
+ return RATE_LIMITED_METHODS.includes(name);
43
+ },
44
+
45
+ // Rate limit per connection ID.
46
+ connectionId() { return true; },
47
+ }, OPERATIONS, PER_SECOND);
48
+ }
File without changes
@@ -0,0 +1,37 @@
1
+ Package.describe({
2
+ name: "<%= name %>",
3
+ summary: "What this does",
4
+ version: "0.0.1",
5
+ git: "https://github.com/<username>/<%= fileName %>.git",
6
+ });
7
+
8
+ //Npm.depends({});
9
+
10
+ Package.onUse(function(api) {
11
+ api.versionsFrom('1.8');
12
+
13
+ <% if (client === 'vanilla') { %>api.use(['ecmascript, jquery, static-html']);<% } else { %>
14
+ api.use(['ecmascript', 'templating', 'modules']);<% } %>
15
+
16
+ const packages = [
17
+ ];
18
+
19
+ api.use(packages);
20
+ api.imply(packages);
21
+
22
+ api.mainModule('server/<%= fileName %>.js', 'server');
23
+ api.mainModule('client/<%= fileName %>.js', 'client');
24
+
25
+ api.addFiles('lib/<%= fileName %>.js', ['client', 'server']);
26
+
27
+ api.export('<%= className %>');
28
+ });
29
+
30
+ Package.onTest(function(api) {
31
+ api.use('<%= name %>');
32
+ api.use('ecmascript');
33
+ api.use('sanjo:jasmine@1.0.0');
34
+ api.use('velocity:html-reporter@0.10.0');
35
+ api.addFiles('tests/server/<%= fileName %>.js', 'server');
36
+ api.addFiles('tests/client/<%= fileName %>.js', 'client');
37
+ });
@@ -0,0 +1,37 @@
1
+ Package.describe({
2
+ name: "<%= name %>",
3
+ summary: "What this does",
4
+ version: "0.0.1",
5
+ git: "https://github.com/<username>/<%= fileName %>.git",
6
+ });
7
+
8
+ Npm.depends({
9
+ });
10
+
11
+ Package.onUse(function(api) {
12
+ api.versionsFrom('1.8');
13
+
14
+ api.use(['ecmascript', 'templating', 'modules']);
15
+
16
+ var packages = [
17
+ ];
18
+
19
+ api.use(packages);
20
+ api.imply(packages);
21
+
22
+ api.mainModule('server/<%= fileName %>.jsx', 'server');
23
+ api.mainModule('client/<%= fileName %>.jsx', 'client');
24
+
25
+ api.addFiles('lib/<%= fileName %>.jsx', ['client', 'server']);
26
+
27
+ api.export('<%= className %>');
28
+ });
29
+
30
+ Package.onTest(function(api) {
31
+ api.use('<%= name %>');
32
+ api.use('ecmascript');
33
+ api.use('sanjo:jasmine@1.0.0');
34
+ api.use('velocity:html-reporter@0.10.0');
35
+ api.addFiles('tests/server/<%= fileName %>.jsx', 'server');
36
+ api.addFiles('tests/client/<%= fileName %>.jsx', 'client');
37
+ });
@@ -0,0 +1,36 @@
1
+ Package.describe({
2
+ name: "<%= name %>",
3
+ summary: "What this does",
4
+ version: "0.0.1",
5
+ git: "https://github.com/<username>/<%= fileName %>.git",
6
+ });
7
+
8
+ //Npm.depends({});
9
+
10
+ Package.onUse(function(api) {
11
+ api.versionsFrom('1.8');
12
+
13
+ api.use(['ecmascript', 'templating', 'modules']);
14
+
15
+ var packages = [
16
+ ];
17
+
18
+ api.use(packages);
19
+ api.imply(packages);
20
+
21
+ api.mainModule('server/<%= fileName %>.js', 'server');
22
+ api.mainModule('client/<%= fileName %>.js', 'client');
23
+
24
+ api.addFiles('lib/<%= fileName %>.js', ['client', 'server']);
25
+
26
+ api.export('<%= className %>');
27
+ });
28
+
29
+ Package.onTest(function(api) {
30
+ api.use('<%= name %>');
31
+ api.use('ecmascript');
32
+ api.use('sanjo:jasmine@1.0.0');
33
+ api.use('velocity:html-reporter@0.10.0');
34
+ api.addFiles('tests/server/<%= fileName %>.js', 'server');
35
+ api.addFiles('tests/client/<%= fileName %>.js', 'client');
36
+ });
@@ -0,0 +1,37 @@
1
+ Package.describe({
2
+ name: "<%= name %>",
3
+ summary: "What this does",
4
+ version: "0.0.1",
5
+ git: "https://github.com/<username>/<%= fileName %>.git",
6
+ });
7
+
8
+ Npm.depends({
9
+ });
10
+
11
+ Package.onUse(function(api) {
12
+ api.versionsFrom('1.8');
13
+
14
+ api.use(['ecmascript', 'templating', 'modules']);
15
+
16
+ var packages = [
17
+ ];
18
+
19
+ api.use(packages);
20
+ api.imply(packages);
21
+
22
+ api.mainModule('server/<%= fileName %>.jsx', 'server');
23
+ api.mainModule('client/<%= fileName %>.jsx', 'client');
24
+
25
+ api.addFiles('lib/<%= fileName %>.jsx', ['client', 'server']);
26
+
27
+ api.export('<%= className %>');
28
+ });
29
+
30
+ Package.onTest(function(api) {
31
+ api.use('<%= name %>');
32
+ api.use('ecmascript');
33
+ api.use('sanjo:jasmine@1.0.0');
34
+ api.use('velocity:html-reporter@0.10.0');
35
+ api.addFiles('tests/server/<%= fileName %>.jsx', 'server');
36
+ api.addFiles('tests/client/<%= fileName %>.jsx', 'client');
37
+ });
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on client', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on client', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on client', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on client', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on server', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on server', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on server', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,5 @@
1
+ describe('sanjo:jasmine on server', function () {
2
+ it('works', function () {
3
+ expect(it).toBeDefined();
4
+ })
5
+ })
@@ -0,0 +1,29 @@
1
+ {
2
+ "appName": "<%= config.appName %>",
3
+ "engines": {
4
+ "html": "<%= config.engines.html %>",
5
+ "js": "<%= config.engines.js %>",
6
+ "css": "<%= config.engines.css %>",
7
+ "api": "<%= config.engines.api %>",
8
+ "client": "<%= config.engines.client %>",
9
+ "test": "<%= config.engines.test %>",
10
+ "graphql": "<%= config.engines.graphql %>",
11
+ "ssr": "<%= config.engines.ssr %>"
12
+ },
13
+ "template": {
14
+ "html": "<%= config.template.html %>",
15
+ "js": "<%= config.template.js %>",
16
+ "css": "<%= config.template.css %>",
17
+ "test": "<%= config.template.test %>"
18
+ },
19
+ "route": {
20
+ "controller": "<%= config.route.controller %>",
21
+ "template": "<%= config.route.template %>"
22
+ },
23
+ "features": {
24
+ "withHooks": "<%= config.features.withHooks %>"
25
+ },
26
+ "generator": {
27
+ "comments": "<%= config.generator.comments %>"
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ Head on over to [www.maka-cli.com](https://www.maka-cli.com) on how to get started with Maka-CLI, as well as documentation and examples.
File without changes
@@ -0,0 +1,4 @@
1
+ Application production builds can go in this directory. To build your
2
+ application for staging or production run this command:
3
+
4
+ > maka build
@@ -0,0 +1,6 @@
1
+ .DS_Store
2
+ *.swp
3
+ *.swo
4
+ node_modules/
5
+ _keys/
6
+ build/
@@ -0,0 +1,3 @@
1
+ Meteor.publish('<%= name %>', () => {
2
+ return <%= collection %>.find();
3
+ });
@@ -0,0 +1,3 @@
1
+ Meteor.publish('<%= name %>', () => {
2
+ return <%= collection %>.find();
3
+ });
@@ -0,0 +1,3 @@
1
+ Meteor.publish('<%= name %>', () => {
2
+ return <%= collection %>.find();
3
+ });
@@ -0,0 +1,3 @@
1
+ Meteor.publish('<%= name %>', () => {
2
+ return <%= collection %>.find();
3
+ });
@@ -0,0 +1,17 @@
1
+ import winston from 'winston';
2
+
3
+ const Logger = winston.createLogger({
4
+ level: 'info',
5
+ format: winston.format.json(),
6
+ transports: [
7
+ new MongoTransport(),
8
+ ]
9
+ });
10
+
11
+ if (process.env.NODE_ENV !== 'production') {
12
+ Logger.add(new winston.transports.Console({
13
+ format: winston.format.simple()
14
+ }));
15
+ }
16
+
17
+ export default Logger;
@@ -0,0 +1,17 @@
1
+ import winston from 'winston';
2
+
3
+ const Logger = winston.createLogger({
4
+ level: 'info',
5
+ format: winston.format.json(),
6
+ transports: [
7
+ new MongoTransport(),
8
+ ]
9
+ });
10
+
11
+ if (process.env.NODE_ENV !== 'production') {
12
+ Logger.add(new winston.transports.Console({
13
+ format: winston.format.simple()
14
+ }));
15
+ }
16
+
17
+ export default Logger;
@@ -0,0 +1,31 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import Transport from 'winston-transport';
3
+ import 'setimmediate';
4
+
5
+ class MongoTransport extends Transport {
6
+ constructor(opts) {
7
+ super(opts);
8
+ }
9
+
10
+ log(info, callback) {
11
+ setImmediate(() => {
12
+ this.emit('logged', info);
13
+ });
14
+
15
+ let location;
16
+ if (Meteor.isServer) {
17
+ location = 'server';
18
+ } else if (Meteor.isClient) {
19
+ location = 'client';
20
+ } else {
21
+ location = 'common';
22
+ }
23
+
24
+ Logs.insert({time: new Date(), location, message: info.message, level: info.level});
25
+
26
+ callback();
27
+ }
28
+ };
29
+
30
+
31
+ export { MongoTransport }
@@ -0,0 +1,31 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import Transport from 'winston-transport';
3
+ import 'setimmediate';
4
+
5
+ class MongoTransport extends Transport {
6
+ constructor(opts) {
7
+ super(opts);
8
+ }
9
+
10
+ log(info, callback) {
11
+ setImmediate(() => {
12
+ this.emit('logged', info);
13
+ });
14
+
15
+ let location;
16
+ if (Meteor.isServer) {
17
+ location = 'server';
18
+ } else if (Meteor.isClient) {
19
+ location = 'client';
20
+ } else {
21
+ location = 'common';
22
+ }
23
+
24
+ Logs.insert({time: new Date(), location, message: info.message, level: info.level});
25
+
26
+ callback();
27
+ }
28
+ };
29
+
30
+
31
+ export { MongoTransport }