@maka/maka-cli 3.3.67 → 4.0.72
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/.eslintrc.json +19 -0
- package/.mocharc.json +3 -0
- package/README.md +4 -10
- package/dist/README.md +27 -0
- package/dist/command.js +1 -0
- package/dist/commands/_index.js +1 -0
- package/dist/commands/aws/_index.js +1 -0
- package/dist/commands/aws/aws.command.js +1 -0
- package/dist/commands/aws/ci.sub.cmd.js +1 -0
- package/dist/commands/aws/ckp.sub.cmd.js +1 -0
- package/dist/commands/aws/csg.sub.cmd.js +1 -0
- package/dist/commands/aws/di.sub.cmd.js +1 -0
- package/dist/commands/aws/dks.sub.cmd.js +1 -0
- package/dist/commands/aws/rbi.sub.cmd.js +1 -0
- package/dist/commands/aws/sth.sub.cmd.js +1 -0
- package/dist/commands/aws/ti.sub.cmd.js +1 -0
- package/dist/commands/build/_index.js +1 -0
- package/dist/commands/build/build.js +1 -0
- package/dist/commands/build/docker.sub.cmd.js +1 -0
- package/dist/commands/create.js +1 -0
- package/dist/commands/debug.js +1 -0
- package/dist/commands/deploy.js +1 -0
- package/dist/commands/game/_index.js +1 -0
- package/dist/commands/game/battleship.sub.cmd.js +1 -0
- package/dist/commands/game/game.command.js +1 -0
- package/dist/commands/game/pong.sub.cmd.js +1 -0
- package/dist/commands/game/snake.sub.cmd.js +1 -0
- package/dist/commands/game/tetris.sub.cmd.js +1 -0
- package/dist/commands/generate.js +1 -0
- package/dist/commands/get/_index.js +1 -0
- package/dist/commands/get/get.command.js +1 -0
- package/dist/commands/get/global.sub.cmd.js +1 -0
- package/dist/commands/get/local.sub.cmd.js +1 -0
- package/dist/commands/help.js +1 -0
- package/dist/commands/install.js +1 -0
- package/dist/commands/jsdoc.js +1 -0
- package/dist/commands/login.js +1 -0
- package/dist/commands/logout.js +1 -0
- package/dist/commands/logs.js +1 -0
- package/dist/commands/maka.cmd.js +1 -0
- package/dist/commands/murder.js +1 -0
- package/dist/commands/reconfig.js +1 -0
- package/dist/commands/run.js +1 -0
- package/dist/commands/set/_index.js +1 -0
- package/dist/commands/set/global.sub.cmd.js +1 -0
- package/dist/commands/set/local.sub.cmd.js +1 -0
- package/dist/commands/set/set.command.js +1 -0
- package/dist/commands/ssh.js +1 -0
- package/dist/commands/ssl.js +1 -0
- package/dist/commands/test.js +1 -0
- package/dist/commands/version.js +1 -0
- package/dist/error.js +1 -0
- package/dist/generator.js +1 -0
- package/dist/generators/_index.js +1 -0
- package/dist/generators/api.js +1 -0
- package/dist/generators/collection.js +1 -0
- package/dist/generators/component.js +1 -0
- package/dist/generators/config.js +1 -0
- package/dist/generators/dbc.js +1 -0
- package/dist/generators/dockerfile.js +1 -0
- package/dist/generators/hook.js +1 -0
- package/dist/generators/kit.js +1 -0
- package/dist/generators/layout.js +1 -0
- package/dist/generators/maka.gen.js +1 -0
- package/dist/generators/methods.js +1 -0
- package/dist/generators/package.js +1 -0
- package/dist/generators/page.js +1 -0
- package/dist/generators/publish.js +1 -0
- package/dist/generators/route.js +1 -0
- package/dist/generators/scaffold.js +1 -0
- package/dist/generators/service.js +1 -0
- package/dist/maka.js +2 -0
- package/dist/templates/meteor/api/api.js +11 -0
- package/dist/templates/meteor/api/api.js.ts +11 -0
- package/dist/templates/meteor/api/collection.js +86 -0
- package/dist/templates/meteor/api/collection.js.ts +94 -0
- package/dist/templates/meteor/api/fixtures.js +23 -0
- package/dist/templates/meteor/api/fixtures.js.ts +23 -0
- package/dist/templates/meteor/api/methods.js +136 -0
- package/dist/templates/meteor/api/methods.js.ts +137 -0
- package/dist/templates/meteor/api/publications.js +31 -0
- package/dist/templates/meteor/api/publications.js.ts +31 -0
- package/dist/templates/meteor/api/register-api.js +15 -0
- package/dist/templates/meteor/api/register-api.js.ts +15 -0
- package/dist/templates/meteor/api/resolvers.js +9 -0
- package/dist/templates/meteor/api/resolvers.js.ts +9 -0
- package/dist/templates/meteor/api/tests.js +1 -0
- package/dist/templates/meteor/api/tests.js.ts +1 -0
- package/dist/templates/meteor/api/typeDefs.js +5 -0
- package/dist/templates/meteor/api/typeDefs.js.ts +5 -0
- package/dist/templates/meteor/app/client/.gitkeep +0 -0
- package/dist/templates/meteor/app/client/body.html +3 -0
- package/dist/templates/meteor/app/client/head.html +25 -0
- package/dist/templates/meteor/app/client/main.app-tests.js +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.jsx +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.ts +9 -0
- package/dist/templates/meteor/app/client/main.app-tests.js.tsx +9 -0
- package/dist/templates/meteor/app/client/main.js +1 -0
- package/dist/templates/meteor/app/client/main.js.jsx +1 -0
- package/dist/templates/meteor/app/client/main.js.ts +1 -0
- package/dist/templates/meteor/app/client/main.js.tsx +1 -0
- package/dist/templates/meteor/app/imports/api/.gitkeep +0 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js +19 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.jsx +100 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.ts +19 -0
- package/dist/templates/meteor/app/imports/startup/client/index.js.tsx +101 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js +39 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.jsx +48 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.ts +24 -0
- package/dist/templates/meteor/app/imports/startup/client/routes.js.tsx +48 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.jsx +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.ts +9 -0
- package/dist/templates/meteor/app/imports/startup/client/templates.js.tsx +9 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js +1 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.jsx +10 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.ts +1 -0
- package/dist/templates/meteor/app/imports/startup/lib/index.js.tsx +10 -0
- package/dist/templates/meteor/app/imports/startup/lib/routes.js.jsx +48 -0
- package/dist/templates/meteor/app/imports/startup/lib/routes.js.tsx +48 -0
- package/dist/templates/meteor/app/imports/startup/lib/templates.js.jsx +0 -0
- package/dist/templates/meteor/app/imports/startup/lib/templates.js.tsx +0 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js +1 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.jsx +139 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.ts +0 -0
- package/dist/templates/meteor/app/imports/startup/server/index.js.tsx +138 -0
- package/dist/templates/meteor/app/imports/ui/test-helpers.js +24 -0
- package/dist/templates/meteor/app/imports/ui/test-helpers.js.ts +24 -0
- package/dist/templates/meteor/app/lib/.gitkeep +0 -0
- package/dist/templates/meteor/app/lib/main.js +1 -0
- package/dist/templates/meteor/app/lib/main.js.jsx +1 -0
- package/dist/templates/meteor/app/lib/main.js.ts +1 -0
- package/dist/templates/meteor/app/lib/main.js.tsx +1 -0
- package/dist/templates/meteor/app/maka.d.ts +160 -0
- package/dist/templates/meteor/app/meteor.d.ts +955 -0
- package/dist/templates/meteor/app/packages/.gitkeep +0 -0
- package/dist/templates/meteor/app/private/.gitkeep +0 -0
- package/dist/templates/meteor/app/public/.gitkeep +0 -0
- package/dist/templates/meteor/app/public/favicon.ico +0 -0
- package/dist/templates/meteor/app/public/manifest.json +9 -0
- package/dist/templates/meteor/app/public/sw.js +30 -0
- package/dist/templates/meteor/app/public/sw.js.jsx +30 -0
- package/dist/templates/meteor/app/public/sw.js.ts +30 -0
- package/dist/templates/meteor/app/public/sw.js.tsx +30 -0
- package/dist/templates/meteor/app/server/.gitkeep +0 -0
- package/dist/templates/meteor/app/server/main.app-tests.js +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.jsx +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.ts +9 -0
- package/dist/templates/meteor/app/server/main.app-tests.js.tsx +9 -0
- package/dist/templates/meteor/app/server/main.js +3 -0
- package/dist/templates/meteor/app/server/main.js.jsx +3 -0
- package/dist/templates/meteor/app/server/main.js.ts +3 -0
- package/dist/templates/meteor/app/server/main.js.tsx +3 -0
- package/dist/templates/meteor/app/tsconfig.json +26 -0
- package/dist/templates/meteor/collection/collection.js +85 -0
- package/dist/templates/meteor/collection/collection.js.ts +97 -0
- package/dist/templates/meteor/collection/tests.js +27 -0
- package/dist/templates/meteor/collection/tests.js.ts +27 -0
- package/dist/templates/meteor/config/docker-compose.yaml +17 -0
- package/dist/templates/meteor/config/pm2.config.js +25 -0
- package/dist/templates/meteor/config/process.env +5 -0
- package/dist/templates/meteor/config/settings.json +8 -0
- package/dist/templates/meteor/config/ssh.json +6 -0
- package/dist/templates/meteor/dbc/config.js +70 -0
- package/dist/templates/meteor/dbc/config.js.ts +70 -0
- package/dist/templates/meteor/dbc/conn.js +37 -0
- package/dist/templates/meteor/dbc/conn.js.ts +37 -0
- package/dist/templates/meteor/dbc/register-dbc.js +3 -0
- package/dist/templates/meteor/dbc/register-dbc.js.ts +3 -0
- package/dist/templates/meteor/method/method.js +48 -0
- package/dist/templates/meteor/method/method.js.ts +48 -0
- package/dist/templates/meteor/package/client/package.js +0 -0
- package/dist/templates/meteor/package/client/package.js.jsx +0 -0
- package/dist/templates/meteor/package/client/package.js.ts +0 -0
- package/dist/templates/meteor/package/client/package.js.tsx +0 -0
- package/dist/templates/meteor/package/lib/package.js +0 -0
- package/dist/templates/meteor/package/lib/package.js.jsx +0 -0
- package/dist/templates/meteor/package/lib/package.js.ts +0 -0
- package/dist/templates/meteor/package/lib/package.js.tsx +0 -0
- package/dist/templates/meteor/package/package.js +37 -0
- package/dist/templates/meteor/package/package.js.jsx +37 -0
- package/dist/templates/meteor/package/package.js.ts +36 -0
- package/dist/templates/meteor/package/package.js.tsx +37 -0
- package/dist/templates/meteor/package/server/package.js +0 -0
- package/dist/templates/meteor/package/server/package.js.jsx +0 -0
- package/dist/templates/meteor/package/server/package.js.ts +0 -0
- package/dist/templates/meteor/package/server/package.js.tsx +0 -0
- package/dist/templates/meteor/package/tests/client/package.js +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.jsx +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.ts +5 -0
- package/dist/templates/meteor/package/tests/client/package.js.tsx +5 -0
- package/dist/templates/meteor/package/tests/server/package.js +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.jsx +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.ts +5 -0
- package/dist/templates/meteor/package/tests/server/package.js.tsx +5 -0
- package/dist/templates/meteor/project/.maka/config.json +29 -0
- package/dist/templates/meteor/project/README.md +1 -0
- package/dist/templates/meteor/project/build/.gitkeep +0 -0
- package/dist/templates/meteor/project/build/README +4 -0
- package/dist/templates/meteor/project/gitignore +6 -0
- package/dist/templates/meteor/publish/publish.js +3 -0
- package/dist/templates/meteor/publish/publish.js.jsx +3 -0
- package/dist/templates/meteor/publish/publish.js.tsx +3 -0
- package/dist/templates/meteor/publish/publish.ts +3 -0
- package/dist/templates/meteor/service/logger/logger.js +17 -0
- package/dist/templates/meteor/service/logger/logger.js.ts +17 -0
- package/dist/templates/meteor/service/logger/transports.js +31 -0
- package/dist/templates/meteor/service/logger/transports.js.ts +31 -0
- package/dist/templates/meteor/stylesheet/stylesheet.css +5 -0
- package/dist/templates/meteor/stylesheet/stylesheet.css.less +5 -0
- package/dist/templates/meteor/template/template-tests.js +1 -0
- package/dist/templates/meteor/template/template-tests.js.jsx +55 -0
- package/dist/templates/meteor/template/template-tests.js.ts +1 -0
- package/dist/templates/meteor/template/template-tests.js.tsx +55 -0
- package/dist/templates/meteor/template/template.css +6 -0
- package/dist/templates/meteor/template/template.css.less +6 -0
- package/dist/templates/meteor/template/template.html +5 -0
- package/dist/templates/meteor/template/template.js +20 -0
- package/dist/templates/meteor/template/template.js.jsx +77 -0
- package/dist/templates/meteor/template/template.js.ts +1 -0
- package/dist/templates/meteor/template/template.js.tsx +89 -0
- package/dist/templates/react/component/component.css +6 -0
- package/dist/templates/react/component/component.css.less +6 -0
- package/dist/templates/react/component/component.js +0 -0
- package/dist/templates/react/component/component.js.jsx +64 -0
- package/dist/templates/react/component/component.js.ts +0 -0
- package/dist/templates/react/component/component.js.tsx +68 -0
- package/dist/templates/react/hook/hook.js +1 -0
- package/dist/templates/react/hook/hook.js.jsx +25 -0
- package/dist/templates/react/hook/hook.js.ts +0 -0
- package/dist/templates/react/hook/hook.js.tsx +25 -0
- package/dist/templates/react/route/route.js +8 -0
- package/dist/templates/react/route/route.js.jsx +8 -0
- package/dist/templates/react/route/route.js.ts +8 -0
- package/dist/templates/react/route/route.js.tsx +8 -0
- package/dist/templates/react/test/test.js +1 -0
- package/dist/templates/react/test/test.js.jsx +56 -0
- package/dist/templates/react/test/test.js.ts +1 -0
- package/dist/templates/react/test/test.js.tsx +55 -0
- package/dist/templates/service/docker/Dockerfile +54 -0
- package/dist/tool.js +1 -0
- package/dist/tools/actions/actions.class.js +1 -0
- package/dist/tools/actions/actions.test.js +1 -0
- package/dist/tools/aws/aws.class.js +1 -0
- package/dist/tools/aws/aws.interfaces.js +1 -0
- package/dist/tools/aws/aws.test.js +0 -0
- package/dist/tools/docker/docker.class.js +1 -0
- package/dist/tools/docker/docker.interfaces.js +1 -0
- package/dist/tools/docker/docker.test.js +0 -0
- package/dist/tools/fsi/fsi.class.js +1 -0
- package/dist/tools/fsi/fsi.interfaces.js +1 -0
- package/dist/tools/https/https.class.js +1 -0
- package/dist/tools/https/https.interface.js +1 -0
- package/dist/tools/log/log.class.js +1 -0
- package/dist/tools/log/log.interfaces.js +1 -0
- package/dist/tools/log/log.test.js +0 -0
- package/dist/tools/spawn-async/spawn-async.class.js +1 -0
- package/dist/tools/spawn-async/spawn-async.interfaces.js +1 -0
- package/dist/tools/spawn-async/spawn-async.test.js +0 -0
- package/dist/tools/ssh/ssh.class.js +1 -0
- package/dist/tools/ssh/ssh.interfaces.js +1 -0
- package/dist/tools/ssh/ssh.test.js +0 -0
- package/dist/tools/ssl/ssl.class.js +1 -0
- package/dist/tools/ssl/ssl.interfaces.js +0 -0
- package/dist/tools/ssl/ssl.test.js +0 -0
- package/maka-maka-telnet-2.0.2.tgz +0 -0
- package/obfuscator.json +29 -0
- package/package.json +86 -27
- package/tsconfig.json +23 -0
- package/AUTHORS +0 -19
- package/LICENSE +0 -1
- package/compiled/linux/maka +0 -0
- package/compiled/macos/maka +0 -0
- package/compiled/win/maka.exe +0 -0
- 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,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 @@
|
|
|
1
|
+
/* eslint-env jasmine */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* eslint-env jasmine */
|
|
File without changes
|
|
@@ -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 @@
|
|
|
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
|
+
*/
|
|
@@ -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-TypeScript 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 @@
|
|
|
1
|
+
/** @namespace Common */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @namespace Common */<% if (config.engines.theme === 'material' && config.engines.ssr === 'true') { %>
|
|
2
|
+
// Material UI Theme config using roboto typefont and default mui.
|
|
3
|
+
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
4
|
+
let theme = createTheme({
|
|
5
|
+
typography: {
|
|
6
|
+
useNextVariants: true,
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
theme = responsiveFontSizes(theme);
|
|
10
|
+
export { theme };<% } %>
|