@maka/maka-cli 3.3.67 → 4.0.71

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/game.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,31 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
3
+
4
+ /**
5
+ * Collection publications to the client. Publications must
6
+ * return a cursor object.
7
+ *
8
+ * @memberof Server.<%= name %>
9
+ * @member Publications
10
+ */
11
+ Meteor.publish('<%= fileName %>.public', function <%= camelCase %>Public() {
12
+ const cursor = <%= name %>.find({}, {
13
+ fields: <%= name %>.publicFields,
14
+ });
15
+
16
+ return cursor;
17
+ });
18
+
19
+ Meteor.publish('<%= fileName %>.private', function <%= camelCase %>Private() {
20
+ if (!this.userId) {
21
+ return this.ready();
22
+ }
23
+
24
+ const cursor = <%= name %>.find({
25
+ userId: this.userId,
26
+ }, {
27
+ fields: <%= name %>.privateFields,
28
+ });
29
+
30
+ return cursor;
31
+ });
@@ -0,0 +1,31 @@
1
+ import { Meteor } from 'meteor/meteor';
2
+ import <%= name %> from '/imports/startup/server/collections/<%= fileName %>';
3
+
4
+ /**
5
+ * Collection publications to the client. Publications must
6
+ * return a cursor object.
7
+ *
8
+ * @memberof Server.<%= name %>
9
+ * @member Publications
10
+ */
11
+ Meteor.publish('<%= fileName %>.public', function <%= camelCase %>Public() {
12
+ const cursor = <%= name %>.find({}, {
13
+ fields: <%= name %>.publicFields,
14
+ });
15
+
16
+ return cursor;
17
+ });
18
+
19
+ Meteor.publish('<%= fileName %>.private', function <%= camelCase %>Private() {
20
+ if (!this.userId) {
21
+ return this.ready();
22
+ }
23
+
24
+ const cursor = <%= name %>.find({
25
+ userId: this.userId,
26
+ }, {
27
+ fields: <%= name %>.privateFields,
28
+ });
29
+
30
+ return cursor;
31
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registration of the following files for the
3
+ * <%= name %> API into the Server namespace.
4
+ * ```
5
+ * './api<%= optsDir %><%= fileName %>/methods.js'
6
+ * './api<%= optsDir %><%= fileName %>/api.js'
7
+ * './api<%= optsDir %><%= fileName %>/fixtures.js'
8
+ * './api<%= optsDir %><%= fileName %>/publications.js'
9
+ * ```
10
+ * @namespace Server.<%= name %>
11
+ */
12
+ <% if( withMethods ) { %>import '../../api<%= optsDir %><%= fileName %>/rpc-methods';<% } %>
13
+ <% if( withFixtures ) { %>import '../../api<%= optsDir %><%= fileName %>/fixtures';<% } %>
14
+ <% if( withPubs ) { %>import '../../api<%= optsDir %><%= fileName %>/publications';<% } %>
15
+ <% if( api === 'rest' && withRest ) { %>import '../../api<%= optsDir %><%= fileName %>/rest-api';<% } %>
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registration of the following files for the
3
+ * <%= name %> API into the Server namespace.
4
+ * ```
5
+ * './api<%= optsDir %><%= fileName %>/methods.js'
6
+ * './api<%= optsDir %><%= fileName %>/api.js'
7
+ * './api<%= optsDir %><%= fileName %>/fixtures.js'
8
+ * './api<%= optsDir %><%= fileName %>/publications.js'
9
+ * ```
10
+ * @namespace Server.<%= name %>
11
+ */
12
+ <% if( withMethods ) { %>import '../../api<%= optsDir %><%= fileName %>/rpc-methods';<% } %>
13
+ <% if( withFixtures ) { %>import '../../api<%= optsDir %><%= fileName %>/fixtures';<% } %>
14
+ <% if( withPubs ) { %>import '../../api<%= optsDir %><%= fileName %>/publications';<% } %>
15
+ <% if( api === 'rest' && withRest ) { %>import '../../api<%= optsDir %><%= fileName %>/rest-api';<% } %>
@@ -0,0 +1,9 @@
1
+ export const resolvers = {
2
+ Query: {
3
+ async <%= camelCase %>(root, args, context) {
4
+ // How to enable authentication
5
+ // if (!context.user._id && !Meteor.isDevelopment) throw 'UNAUTHORIZED';
6
+ return 'hello <%= camelCase %>';
7
+ }
8
+ }
9
+ };
@@ -0,0 +1,9 @@
1
+ export const resolvers = {
2
+ Query: {
3
+ async <%= camelCase %>(root, args, context) {
4
+ // How to enable authentication
5
+ // if (!context.user._id && !Meteor.isDevelopment) throw 'UNAUTHORIZED';
6
+ return 'hello <%= camelCase %>';
7
+ }
8
+ }
9
+ };
@@ -0,0 +1 @@
1
+ /* eslint-env jasmine */
@@ -0,0 +1 @@
1
+ /* eslint-env jasmine */
@@ -0,0 +1,5 @@
1
+ export const typeDefs = `
2
+ type Query {
3
+ <%= camelCase %>: String
4
+ }
5
+ `;
@@ -0,0 +1,5 @@
1
+ export const typeDefs = `
2
+ type Query {
3
+ <%= camelCase %>: String
4
+ }
5
+ `;
File without changes
@@ -0,0 +1,3 @@
1
+ <body><% if (config.engines.client === 'react' || config.engines.client === 'reflux' || config.engines.client === 'vanilla') { %>
2
+ <div id="app"></div><% } %>
3
+ </body>
@@ -0,0 +1,25 @@
1
+ <head>
2
+ <meta charset="utf-8">
3
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
6
+ <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
7
+ <meta name="description" content="<%= app %>">
8
+ <meta name="theme-color" content="#FFF"/>
9
+ <link rel="manifest" href="/manifest.json">
10
+ <title><%= app %></title>
11
+ <noscript>
12
+ Please enable JavaScript
13
+ </noscript>
14
+ <script type="text/javascript">
15
+ window.onbeforeunload = closingCode;
16
+ function closingCode(){
17
+ if (Meteor.settings.public.logoutOnClose === true) Meteor.logout();
18
+ return null;
19
+ }
20
+ // stop ios bounce and zoom
21
+ document.ontouchmove = event => {
22
+ event.preventDefault();
23
+ };
24
+ </script>
25
+ </head>
@@ -0,0 +1,9 @@
1
+ import assert from "assert";
2
+
3
+ describe("<%= app %>", function () {
4
+ if (Meteor.isClient) {
5
+ it("client is not server", function () {
6
+ assert.strictEqual(Meteor.isServer, false);
7
+ });
8
+ }
9
+ });
@@ -0,0 +1,9 @@
1
+ import assert from "assert";
2
+
3
+ describe("<%= app %>", function () {
4
+ if (Meteor.isClient) {
5
+ it("client is not server", function () {
6
+ assert.strictEqual(Meteor.isServer, false);
7
+ });
8
+ }
9
+ });
@@ -0,0 +1,9 @@
1
+ import assert from "assert";
2
+
3
+ describe("<%= app %>", function () {
4
+ if (Meteor.isClient) {
5
+ it("client is not server", function () {
6
+ assert.strictEqual(Meteor.isServer, false);
7
+ });
8
+ }
9
+ });
@@ -0,0 +1,9 @@
1
+ import assert from "assert";
2
+
3
+ describe("<%= app %>", function () {
4
+ if (Meteor.isClient) {
5
+ it("client is not server", function () {
6
+ assert.strictEqual(Meteor.isServer, false);
7
+ });
8
+ }
9
+ });
@@ -0,0 +1 @@
1
+ import '/imports/startup/client';
@@ -0,0 +1 @@
1
+ import '/imports/startup/client/index.jsx';
@@ -0,0 +1 @@
1
+ import '/imports/startup/client';
@@ -0,0 +1 @@
1
+ import '/imports/startup/client/index';
File without changes
@@ -0,0 +1,19 @@
1
+ /** @namespace Client */
2
+ // This defines the routes that the application will respond to
3
+ import './routes.js';
4
+
5
+ if (!Meteor.isDevelopment && Meteor.isClient) {
6
+ if ('serviceWorker' in navigator) {
7
+ window.addEventListener('load', function() {
8
+ navigator.serviceWorker.register('sw.js')
9
+ .then(reg => {
10
+ console.log('Service worker registered! 😎', reg);
11
+ })
12
+ .catch(err => {
13
+ console.log('😥 Service worker registration failed: ', err);
14
+ });
15
+ });
16
+ } else {
17
+ console.warn('Service worker registration failed. Likely you are not serving content over HTTPS');
18
+ }
19
+ }
@@ -0,0 +1,100 @@
1
+ /** @namespace Client */
2
+ import React from 'react';
3
+ import ReactDOM from 'react-dom';
4
+ import { browserHistory } from 'react-router';
5
+ import { withTracker } from 'meteor/react-meteor-data';
6
+ <% if (config.engines.graphql === 'apollo') { %>
7
+ // Apollo Client configuration
8
+ import { ApolloClient, ApolloProvider } from '@apollo/client';
9
+ import { ApolloProvider as ApolloHooksProvider } from '@apollo/react-hooks';
10
+ import { InMemoryCache } from 'apollo-cache-inmemory';
11
+ import { ApolloLink } from 'apollo-link';
12
+ import { HttpLink, createHttpLink } from 'apollo-link-http';
13
+ import { setContext } from "apollo-link-context";
14
+
15
+ const httpLink = createHttpLink({
16
+ uri: `/graphql`
17
+ });
18
+
19
+ const authLink = setContext((_, { headers }) => {
20
+ // get the authentication token from local storage if it exists
21
+ const token = localStorage.getItem('Meteor.loginToken');
22
+ // return the headers to the context so httpLink can read them
23
+ return {
24
+ headers: {
25
+ ...headers,
26
+ 'x-auth-token': token,
27
+ }
28
+ }
29
+ });
30
+
31
+ const client = new ApolloClient({
32
+ link: authLink.concat(httpLink),
33
+ // This solves a cache error.
34
+ cache: new InMemoryCache({
35
+ dataIdFromObject: o => {o.id ? `${o.__typename}-${o.id}`: `${o.__typename}-${o.cursor}`},
36
+ })
37
+ });
38
+ <% } %><% if (config.engines.theme === 'material') { if (config.engines.ssr === 'true') { %>
39
+ import { ThemeProvider } from '@mui/material/styles';
40
+ import { theme } from '../lib/index';<% } else { %>
41
+ // Material UI Theme config using default mui.
42
+ import { ThemeProvider, createTheme, responsiveFontSizes } from '@mui/material/styles';
43
+ let theme = createTheme({
44
+ typography: {
45
+ useNextVariants: true,
46
+ },
47
+ });
48
+ theme = responsiveFontSizes(theme);<% }} %>
49
+ <% if (config.engines.ssr === 'true') { %>
50
+ // Server Side Rendering sink and router classifier.
51
+ import { BrowserRouter } from 'react-router-dom'
52
+ import { onPageLoad } from "meteor/server-render";
53
+ <% } %>
54
+ <% if (config.engines.ssr === 'true') { %>import Routes from '../lib/routes';<% } else { %>import Routes from './routes';<% } %>
55
+
56
+ const App = ({ user }) => (<% if (config.engines.ssr === 'true') { %>
57
+ <BrowserRouter><% } %><% if (config.engines.graphql === 'apollo') { %>
58
+ <ApolloProvider client={client}>
59
+ <ApolloHooksProvider client={client}><% } %><% if (config.engines.theme === 'material') { %>
60
+ <ThemeProvider theme={theme}><% } %>
61
+ <Routes user={user} history={browserHistory}/><% if (config.engines.theme === 'material') { %>
62
+ </ThemeProvider><% } %><% if (config.engines.graphql === 'apollo') { %>
63
+ </ApolloHooksProvider>
64
+ </ApolloProvider><% } %><% if (config.engines.ssr === 'true') { %>
65
+ </BrowserRouter><% } %>
66
+ );
67
+
68
+ const AppContainer = withTracker(props => {
69
+ return (Meteor.isClient && Meteor.user) ? { user: (Meteor.user()) ? Meteor.user() : {} } : { user: false };
70
+ })(App);
71
+
72
+ const startApp = () => {<% if (config.engines.ssr === 'true') { %>
73
+ onPageLoad(sink => {
74
+ ReactDOM.hydrate(<App />,document.getElementById('app'));
75
+ });<% } else { %>
76
+ ReactDOM.render(<AppContainer />, document.getElementById('app'));<% } %>
77
+ }
78
+
79
+ const enableServiceWorker = Meteor.settings.public.enableServiceWorker;
80
+ if (!Meteor.isDevelopment && Meteor.isClient && enableServiceWorker) {
81
+ if ('serviceWorker' in navigator) {
82
+ window.addEventListener('load', function() {
83
+ navigator.serviceWorker.register('sw.js')
84
+ .then(reg => {
85
+ console.log('Service worker registered! 😎', reg);
86
+ })
87
+ .catch(err => {
88
+ console.log('😥 Service worker registration failed: ', err);
89
+ });
90
+ });
91
+ } else {
92
+ console.warn('Service worker registration failed. Likely you are not serving content over HTTPS');
93
+ }
94
+ }
95
+
96
+ if(window.cordova) {
97
+ document.addEventListener('deviceready', startApp, false);
98
+ } else {
99
+ startApp();
100
+ }
@@ -0,0 +1,19 @@
1
+ /** @namespace Client */
2
+ // This defines the routes that the application will respond to
3
+ import './routes.ts';
4
+
5
+ if (!Meteor.isDevelopment && Meteor.isClient) {
6
+ if ('serviceWorker' in navigator) {
7
+ window.addEventListener('load', function() {
8
+ navigator.serviceWorker.register('sw.js')
9
+ .then(reg => {
10
+ console.log('Service worker registered! 😎', reg);
11
+ })
12
+ .catch(err => {
13
+ console.log('😥 Service worker registration failed: ', err);
14
+ });
15
+ });
16
+ } else {
17
+ console.warn('Service worker registration failed. Likely you are not serving content over HTTPS');
18
+ }
19
+ }
@@ -0,0 +1,101 @@
1
+ /** @namespace Client */
2
+ import * as React from 'react';
3
+ import * as ReactDOM from 'react-dom';
4
+ import { browserHistory } from 'react-router';
5
+ import { withTracker } from 'meteor/react-meteor-data';
6
+ <% if (config.engines.graphql === 'apollo') { %>
7
+ // Apollo Client configuration
8
+ import { ApolloClient } from '@apollo/client';
9
+ import { ApolloClient, ApolloProvider } from '@apollo/client';
10
+ import { ApolloProvider as ApolloHooksProvider } from '@apollo/react-hooks';
11
+ import { InMemoryCache } from 'apollo-cache-inmemory';
12
+ import { ApolloLink } from 'apollo-link';
13
+ import { HttpLink, createHttpLink } from 'apollo-link-http';
14
+ import { setContext } from "apollo-link-context";
15
+
16
+ const httpLink = createHttpLink({
17
+ uri: `/graphql`
18
+ });
19
+
20
+ const authLink = setContext((_, { headers }) => {
21
+ // get the authentication token from local storage if it exists
22
+ const token = localStorage.getItem('Meteor.loginToken');
23
+ // return the headers to the context so httpLink can read them
24
+ return {
25
+ headers: {
26
+ ...headers,
27
+ 'x-auth-token': token,
28
+ }
29
+ }
30
+ });
31
+
32
+ const client = new ApolloClient({
33
+ link: authLink.concat(httpLink),
34
+ // This solves a cache error.
35
+ cache: new InMemoryCache({
36
+ dataIdFromObject: o => {o.id ? `${o.__typename}-${o.id}`: `${o.__typename}-${o.cursor}`},
37
+ })
38
+ });
39
+ <% } %><% if (config.engines.theme === 'material') { if (config.engines.ssr === 'true') { %>
40
+ import { ThemeProvider } from '@mui/material/styles';
41
+ import { theme } from '../lib/index';<% } else { %>
42
+ // Material UI Theme config using default mui.
43
+ import { ThemeProvider, createTheme, responsiveFontSizes } from '@mui/material/styles';
44
+ let theme = createTheme({
45
+ typography: {
46
+ useNextVariants: true,
47
+ },
48
+ });
49
+ theme = responsiveFontSizes(theme);<% }} %>
50
+ <% if (config.engines.ssr === 'true') { %>
51
+ // Server Side Rendering sink and router classifier.
52
+ import { BrowserRouter } from 'react-router-dom'
53
+ import { onPageLoad } from "meteor/server-render";
54
+ <% } %>
55
+ <% if (config.engines.ssr === 'true') { %>import Routes from '../lib/routes';<% } else { %>import Routes from './routes';<% } %>
56
+
57
+ const App = ({ user }) => (<% if (config.engines.ssr === 'true') { %>
58
+ <BrowserRouter><% } %><% if (config.engines.graphql === 'apollo') { %>
59
+ <ApolloProvider client={client}>
60
+ <ApolloHooksProvider client={client}><% } %><% if (config.engines.theme === 'material') { %>
61
+ <ThemeProvider theme={theme}><% } %>
62
+ <Routes user={user} history={browserHistory}/><% if (config.engines.theme === 'material') { %>
63
+ </ThemeProvider><% } %><% if (config.engines.graphql === 'apollo') { %>
64
+ </ApolloHooksProvider>
65
+ </ApolloProvider><% } %><% if (config.engines.ssr === 'true') { %>
66
+ </BrowserRouter><% } %>
67
+ );
68
+
69
+ const AppContainer = withTracker(props => {
70
+ return (Meteor.isClient && Meteor.user) ? { user: (Meteor.user()) ? Meteor.user() : {} } : { user: false };
71
+ })(App);
72
+
73
+ const startApp = () => {<% if (config.engines.ssr === 'true') { %>
74
+ onPageLoad(() => {
75
+ ReactDOM.hydrate(<AppContainer />,document.getElementById('app'));
76
+ });<% } else { %>
77
+ ReactDOM.render(<AppContainer />, document.getElementById('app'));<% } %>
78
+ }
79
+
80
+ const enableServiceWorker = Meteor.settings.public.enableServiceWorker;
81
+ if (!Meteor.isDevelopment && Meteor.isClient && enableServiceWorker) {
82
+ if ('serviceWorker' in navigator) {
83
+ window.addEventListener('load', function() {
84
+ navigator.serviceWorker.register('sw.js')
85
+ .then(reg => {
86
+ console.log('Service worker registered! 😎', reg);
87
+ })
88
+ .catch(err => {
89
+ console.log('😥 Service worker registration failed: ', err);
90
+ });
91
+ });
92
+ } else {
93
+ console.warn('Service worker registration failed. Likely you are not serving content over HTTPS');
94
+ }
95
+ }
96
+
97
+ if(window.cordova) {
98
+ document.addEventListener('deviceready', startApp, false);
99
+ } else {
100
+ startApp();
101
+ }
@@ -0,0 +1,39 @@
1
+ <% if (config.engines.client === 'vanilla') { } else { %>import { FlowRouter } from 'meteor/kadira:flow-router';
2
+ import { BlazeLayout } from 'meteor/kadira:blaze-layout';
3
+
4
+ /**
5
+ * The FlowRouter client side routing definitions.
6
+ * @namespace Client.Routes
7
+ */
8
+
9
+ import './templates';<% } %>
10
+
11
+ /**
12
+ * * Name: Root
13
+ * * URL: /
14
+ * * Layout: MasterLayout
15
+ * * Template: Home
16
+ * @memberof Client.Routes
17
+ * @member Home
18
+ */
19
+ FlowRouter.route('/', {
20
+ name: 'Root',
21
+ action() {
22
+ BlazeLayout.render('MasterLayout', {yield: "Home"});
23
+ }
24
+ });
25
+
26
+ /**
27
+ * * Name: Not Found
28
+ * * URL: *
29
+ * * Layout: MasterLayout
30
+ * * Template: NotFound
31
+ * @memberof Client.Routes
32
+ * @member Home
33
+ */
34
+ FlowRouter.route('/*', {
35
+ name: 'NotFound',
36
+ action() {
37
+ BlazeLayout.render('MasterLayout', {yield: "NotFound"});
38
+ }
39
+ });
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { Router, Route, IndexRoute } from 'react-router';
3
+
4
+ /**
5
+ * The React Router client side routing definitions.
6
+ * @namespace Client.Routes
7
+ * @desc This is the main definition for the react router.
8
+ */
9
+
10
+ import * as Component from './templates';
11
+
12
+ const Root = (
13
+ <Route path="/" component={ Component.MasterLayout }>
14
+ <IndexRoute component={ Component.Home }/>
15
+ </Route>
16
+ );
17
+
18
+ const CatchAll = (
19
+ <Route path="*" component={ Component.MasterLayout }>
20
+ <IndexRoute component={ Component.NotFound }/>
21
+ </Route>
22
+ );
23
+
24
+ const privateRoutes = (<>
25
+ {Root}
26
+ {CatchAll}
27
+ </>);
28
+
29
+ const publicRoutes = (<>
30
+ {Root}
31
+ {CatchAll}
32
+ </>);
33
+
34
+ const PrivateRoutes = ({ history }) => (
35
+ <Router history={ history }>
36
+ {privateRoutes}
37
+ </Router>
38
+ );
39
+ const PublicRoutes = ({ history }) => (
40
+ <Router history={ history }>
41
+ {publicRoutes}
42
+ </Router>
43
+ );
44
+ const Routes = ({ user = {}, history }) => (
45
+ (user._id) ? <PrivateRoutes history={history}/> : <PublicRoutes history={history}/>
46
+ );
47
+
48
+ export default Routes;
@@ -0,0 +1,24 @@
1
+ import { FlowRouter } from 'meteor/kadira:flow-router';
2
+ import { BlazeLayout } from 'meteor/kadira:blaze-layout';
3
+
4
+ /**
5
+ * The FlowRouter client side routing definitions.
6
+ * @namespace Client.Routes
7
+ */
8
+
9
+ import './templates';
10
+
11
+ /**
12
+ * * Name: Root
13
+ * * URL: /
14
+ * * Layout: MasterLayout
15
+ * * Template: Home
16
+ * @memberof Client.Routes
17
+ * @member Home
18
+ */
19
+ FlowRouter.route('/', {
20
+ name: 'Root',
21
+ action() {
22
+ BlazeLayout.render('MasterLayout', {yield: "Home"});
23
+ }
24
+ });
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import { Router, Route, IndexRoute } from 'react-router';
3
+
4
+ /**
5
+ * The React Router client side routing definitions.
6
+ * @namespace Client.Routes
7
+ * @desc This is the main definition for the react router.
8
+ */
9
+
10
+ import * as Component from './templates';
11
+
12
+ const Root = (
13
+ <Route path="/" component={ Component.MasterLayout }>
14
+ <IndexRoute component={ Component.Home }/>
15
+ </Route>
16
+ );
17
+
18
+ const CatchAll = (
19
+ <Route path="*" component={ Component.MasterLayout }>
20
+ <IndexRoute component={ Component.NotFound }/>
21
+ </Route>
22
+ );
23
+
24
+ const privateRoutes = (<>
25
+ {Root}
26
+ {CatchAll}
27
+ </>);
28
+
29
+ const publicRoutes = (<>
30
+ {Root}
31
+ {CatchAll}
32
+ </>);
33
+
34
+ const PrivateRoutes = ({ history }) => (
35
+ <Router history={ history }>
36
+ {privateRoutes}
37
+ </Router>
38
+ );
39
+ const PublicRoutes = ({ history }) => (
40
+ <Router history={ history }>
41
+ {publicRoutes}
42
+ </Router>
43
+ );
44
+ const Routes = ({ user = {}, history }) => (
45
+ (user._id) ? <PrivateRoutes history={history}/> : <PublicRoutes history={history}/>
46
+ );
47
+
48
+ export default Routes;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Blaze templates.
3
+ * * Layouts: Top level UI concept, pages are rendered within.
4
+ * * Pages: Main content UI concept, contains page context and UI components.
5
+ * * Components: Modular UI concept.
6
+ *
7
+ * @namespace Client.Templates
8
+ * @memberof Client
9
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * React Templates
3
+ * * Layouts: Top level UI concept, pages are rendered within.
4
+ * * Pages: Main content UI concept, contains page context and UI components.
5
+ * * Components: Modular UI concept.
6
+ *
7
+ * @namespace Client.Templates
8
+ * @memberof Client
9
+ */