@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 @@
|
|
|
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 };<% } %>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Router, Route, IndexRoute } from 'react-router';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The React Router client and server side routing definitions.
|
|
6
|
+
* @namespace Common.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) ? <PublicRoutes history={history}/> : <PublicRoutes history={history}/>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export default Routes;
|
|
@@ -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 and server side routing definitions.
|
|
6
|
+
* @namespace Common.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) ? <PublicRoutes history={history}/> : <PublicRoutes history={history}/>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export default Routes;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** @namespace Server */
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { WebAppInternals } from "meteor/webapp";
|
|
2
|
+
Meteor.startup(() => {
|
|
3
|
+
WebAppInternals.setInlineScriptsAllowed(false);
|
|
4
|
+
});
|
|
5
|
+
<% if (config.engines.graphql === 'apollo') { %>
|
|
6
|
+
import { ApolloServer } from 'apollo-server-express';
|
|
7
|
+
import { WebApp } from 'meteor/webapp';
|
|
8
|
+
import { getUser } from 'meteor/apollo';
|
|
9
|
+
import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge';
|
|
10
|
+
import {
|
|
11
|
+
ApolloServerPluginLandingPageGraphQLPlayground
|
|
12
|
+
} from "apollo-server-core";
|
|
13
|
+
|
|
14
|
+
const typeList = [];
|
|
15
|
+
const resolverList = [];
|
|
16
|
+
if (typeList.length > 0 && resolverList.length > 0) {
|
|
17
|
+
const typeDefs = mergeTypeDefs(typeList);
|
|
18
|
+
const resolvers = mergeResolvers(resolverList);
|
|
19
|
+
const server = new ApolloServer({
|
|
20
|
+
typeDefs,
|
|
21
|
+
resolvers,
|
|
22
|
+
cacheControl: {
|
|
23
|
+
defaultMaxAge: 60, //seconds
|
|
24
|
+
},
|
|
25
|
+
context: async ({ req }) => ({
|
|
26
|
+
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
27
|
+
}),
|
|
28
|
+
formatError: (err) => {
|
|
29
|
+
// Don't give specific errors to the client
|
|
30
|
+
console.error(err);
|
|
31
|
+
return err.message ;
|
|
32
|
+
},
|
|
33
|
+
plugins: [
|
|
34
|
+
ApolloServerPluginLandingPageGraphQLPlayground()
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const startApolloServer = async(server) => {
|
|
39
|
+
await server.start();
|
|
40
|
+
|
|
41
|
+
server.applyMiddleware({
|
|
42
|
+
app: WebApp.connectHandlers,
|
|
43
|
+
path: '/graphql',
|
|
44
|
+
cors: true
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
startApolloServer(server);
|
|
49
|
+
}<% } %>
|
|
50
|
+
<% if (config.engines.ssr === 'true') { %>
|
|
51
|
+
/************* SSR Code ********************/
|
|
52
|
+
import Routes from '../lib/routes';
|
|
53
|
+
import React from 'react';
|
|
54
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
55
|
+
import { onPageLoad } from 'meteor/server-render';
|
|
56
|
+
import { StaticRouter } from 'react-router-dom';
|
|
57
|
+
import { createMemoryHistory } from 'history';
|
|
58
|
+
<% if (config.engines.graphql === 'apollo') { %>
|
|
59
|
+
import { createMeteorNetworkInterface, meteorClientConfig } from 'meteor/apollo';
|
|
60
|
+
import { ApolloClient, ApolloProvider, renderToStringWithData } from '@apollo/client';
|
|
61
|
+
import 'isomorphic-fetch';
|
|
62
|
+
|
|
63
|
+
const networkInterface = createMeteorNetworkInterface({
|
|
64
|
+
opts: { credentials: 'same-origin' },
|
|
65
|
+
uri: Meteor.absoluteUrl('graphql'),
|
|
66
|
+
useMeteorAccounts: true,
|
|
67
|
+
batchingInterface: true,
|
|
68
|
+
batchInterval: 10,
|
|
69
|
+
});
|
|
70
|
+
const client = new ApolloClient(meteorClientConfig({ networkInterface, ssrMode: true }));<% } %>
|
|
71
|
+
<% if (config.engines.theme === 'material') { %>
|
|
72
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
73
|
+
import { theme } from '../lib/index';<% } %>
|
|
74
|
+
// css bundler
|
|
75
|
+
import createEmotionServer from '@emotion/server/create-instance';
|
|
76
|
+
import createCache from '@emotion/cache';
|
|
77
|
+
|
|
78
|
+
function createEmotionCache() {
|
|
79
|
+
return createCache({ key: 'css' });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
onPageLoad((sink) => {
|
|
83
|
+
const history = createMemoryHistory(sink.request.url.pathname);
|
|
84
|
+
// Create a sheets instance.
|
|
85
|
+
const cache = createEmotionCache();
|
|
86
|
+
const { extractCriticalToChunks, constructStyleTagsFromChunks } =
|
|
87
|
+
createEmotionServer(cache);
|
|
88
|
+
|
|
89
|
+
const App = (props) => (
|
|
90
|
+
<StaticRouter
|
|
91
|
+
location={props.location}
|
|
92
|
+
context={{}}>
|
|
93
|
+
<Routes history={history}/>
|
|
94
|
+
</StaticRouter>
|
|
95
|
+
);<% if (config.engines.theme === 'material') { if (config.engines.graphql === 'apollo') { %>
|
|
96
|
+
renderToStringWithData(
|
|
97
|
+
<ApolloProvider client={client}>
|
|
98
|
+
<ThemeProvider theme={theme}>
|
|
99
|
+
<App location={sink.request.url} />
|
|
100
|
+
</ThemeProvider>
|
|
101
|
+
</ApolloProvider>
|
|
102
|
+
).then((content) => {
|
|
103
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
104
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
105
|
+
|
|
106
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
107
|
+
sink.renderIntoElementById('app', content);
|
|
108
|
+
});<% } else { %>
|
|
109
|
+
const html = renderToStaticMarkup(
|
|
110
|
+
<ThemeProvider theme={theme}>
|
|
111
|
+
<App location={sink.request.url} />
|
|
112
|
+
</ThemeProvider>
|
|
113
|
+
);
|
|
114
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
115
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
116
|
+
|
|
117
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
118
|
+
sink.renderIntoElementById('app', html);
|
|
119
|
+
<% } } else { if (config.engines.graphql === 'apollo') { %>
|
|
120
|
+
renderToStringWithData(
|
|
121
|
+
<ApolloProvider client={client}>
|
|
122
|
+
<App location={sink.request.url} />
|
|
123
|
+
</ApolloProvider>
|
|
124
|
+
).then((content) => {
|
|
125
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
126
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
127
|
+
|
|
128
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
129
|
+
sink.renderIntoElementById('app', content);
|
|
130
|
+
});<% } else { %>
|
|
131
|
+
const html = renderToStaticMarkup(
|
|
132
|
+
<App location={sink.request.url} />
|
|
133
|
+
);
|
|
134
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
135
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
136
|
+
|
|
137
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
138
|
+
sink.renderIntoElementById('app', html);<% }} %>
|
|
139
|
+
});<% } %>
|
|
File without changes
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { WebAppInternals } from "meteor/webapp";
|
|
2
|
+
Meteor.startup(() => {
|
|
3
|
+
WebAppInternals.setInlineScriptsAllowed(false);
|
|
4
|
+
});
|
|
5
|
+
<% if (config.engines.graphql === 'apollo') { %>
|
|
6
|
+
import { ApolloServer } from 'apollo-server-express';
|
|
7
|
+
import { WebApp } from 'meteor/webapp';
|
|
8
|
+
import { getUser } from 'meteor/apollo';
|
|
9
|
+
import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge';
|
|
10
|
+
import {
|
|
11
|
+
ApolloServerPluginLandingPageGraphQLPlayground
|
|
12
|
+
} from "apollo-server-core";
|
|
13
|
+
|
|
14
|
+
const typeList = [];
|
|
15
|
+
const resolverList = [];
|
|
16
|
+
if (typeList.length > 0 && resolverList.length > 0) {
|
|
17
|
+
const typeDefs = mergeTypeDefs(typeList);
|
|
18
|
+
const resolvers = mergeResolvers(resolverList);
|
|
19
|
+
const server = new ApolloServer({
|
|
20
|
+
typeDefs,
|
|
21
|
+
resolvers,
|
|
22
|
+
cacheControl: {
|
|
23
|
+
defaultMaxAge: 60, //seconds
|
|
24
|
+
},
|
|
25
|
+
context: async ({ req }) => ({
|
|
26
|
+
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
27
|
+
}),
|
|
28
|
+
formatError: (err) => {
|
|
29
|
+
// Don't give specific errors to the client
|
|
30
|
+
return err.message;
|
|
31
|
+
},
|
|
32
|
+
plugins: [
|
|
33
|
+
ApolloServerPluginLandingPageGraphQLPlayground()
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const startApolloServer = async(server) => {
|
|
38
|
+
await server.start();
|
|
39
|
+
|
|
40
|
+
server.applyMiddleware({
|
|
41
|
+
app: WebApp.connectHandlers,
|
|
42
|
+
path: '/graphql',
|
|
43
|
+
cors: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
startApolloServer(server);
|
|
48
|
+
}<% } %>
|
|
49
|
+
<% if (config.engines.ssr === 'true') { %>
|
|
50
|
+
/************* SSR Code ********************/
|
|
51
|
+
import Routes from '../lib/routes';
|
|
52
|
+
import * as React from 'react';
|
|
53
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
54
|
+
import { onPageLoad } from 'meteor/server-render';
|
|
55
|
+
import { StaticRouter } from 'react-router-dom';
|
|
56
|
+
import { createMemoryHistory } from 'history';
|
|
57
|
+
<% if (config.engines.graphql === 'apollo') { %>
|
|
58
|
+
import { createMeteorNetworkInterface, meteorClientConfig } from 'meteor/apollo';
|
|
59
|
+
import { ApolloClient, ApolloProvider, renderToStringWithData } from '@apollo/client';
|
|
60
|
+
import 'isomorphic-fetch';
|
|
61
|
+
|
|
62
|
+
const networkInterface = createMeteorNetworkInterface({
|
|
63
|
+
opts: { credentials: 'same-origin' },
|
|
64
|
+
uri: Meteor.absoluteUrl('graphql'),
|
|
65
|
+
useMeteorAccounts: true,
|
|
66
|
+
batchingInterface: true,
|
|
67
|
+
batchInterval: 10,
|
|
68
|
+
});
|
|
69
|
+
const client = new ApolloClient(meteorClientConfig({ networkInterface, ssrMode: true }));<% } %>
|
|
70
|
+
<% if (config.engines.theme === 'material') { %>
|
|
71
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
72
|
+
import { theme } from '../lib/index';<% } %>
|
|
73
|
+
// css bundler
|
|
74
|
+
import createEmotionServer from '@emotion/server/create-instance';
|
|
75
|
+
import createCache from '@emotion/cache';
|
|
76
|
+
|
|
77
|
+
function createEmotionCache() {
|
|
78
|
+
return createCache({ key: 'css' });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
onPageLoad((sink) => {
|
|
82
|
+
const history = createMemoryHistory(sink.request.url.pathname);
|
|
83
|
+
// Create a sheets instance.
|
|
84
|
+
const cache = createEmotionCache();
|
|
85
|
+
const { extractCriticalToChunks, constructStyleTagsFromChunks } =
|
|
86
|
+
createEmotionServer(cache);
|
|
87
|
+
|
|
88
|
+
const App = (props) => (
|
|
89
|
+
<StaticRouter
|
|
90
|
+
location={props.location}
|
|
91
|
+
context={{}}>
|
|
92
|
+
<Routes history={history}/>
|
|
93
|
+
</StaticRouter>
|
|
94
|
+
);<% if (config.engines.theme === 'material') { if (config.engines.graphql === 'apollo') { %>
|
|
95
|
+
renderToStringWithData(
|
|
96
|
+
<ApolloProvider client={client}>
|
|
97
|
+
<ThemeProvider theme={theme}>
|
|
98
|
+
<App location={sink.request.url} />
|
|
99
|
+
</ThemeProvider>
|
|
100
|
+
</ApolloProvider>
|
|
101
|
+
).then((content) => {
|
|
102
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
103
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
104
|
+
|
|
105
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
106
|
+
sink.renderIntoElementById('app', content);
|
|
107
|
+
});<% } else { %>
|
|
108
|
+
const html = renderToStaticMarkup(
|
|
109
|
+
<ThemeProvider theme={theme}>
|
|
110
|
+
<App location={sink.request.url} />
|
|
111
|
+
</ThemeProvider>
|
|
112
|
+
);
|
|
113
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
114
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
115
|
+
|
|
116
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
117
|
+
sink.renderIntoElementById('app', html);
|
|
118
|
+
<% } } else { if (config.engines.graphql === 'apollo') { %>
|
|
119
|
+
renderToStringWithData(
|
|
120
|
+
<ApolloProvider client={client}>
|
|
121
|
+
<App location={sink.request.url} />
|
|
122
|
+
</ApolloProvider>
|
|
123
|
+
).then((content) => {
|
|
124
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
125
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
126
|
+
|
|
127
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
128
|
+
sink.renderIntoElementById('app', content);
|
|
129
|
+
});<% } else { %>
|
|
130
|
+
const html = renderToStaticMarkup(
|
|
131
|
+
<App location={sink.request.url} />
|
|
132
|
+
);
|
|
133
|
+
const emotionChunks = extractCriticalToChunks(html);
|
|
134
|
+
const emotionCss = constructStyleTagsFromChunks(emotionChunks);
|
|
135
|
+
|
|
136
|
+
sink.appendToHead(`<style id="jss-server-side">${emotionCss}</style>`);
|
|
137
|
+
sink.renderIntoElementById('app', html);<% }} %>
|
|
138
|
+
});<% } %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
if (config.engines.client === 'blaze') {
|
|
2
|
+
import { Template } from 'meteor/templating';
|
|
3
|
+
import { Blaze } from 'meteor/blaze';
|
|
4
|
+
import { Tracker } from 'meteor/tracker';
|
|
5
|
+
|
|
6
|
+
const withDiv = function withDiv(callback) {
|
|
7
|
+
const el = document.createElement('div');
|
|
8
|
+
document.body.appendChild(el);
|
|
9
|
+
try {
|
|
10
|
+
callback(el);
|
|
11
|
+
} finally {
|
|
12
|
+
document.body.removeChild(el);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const withRenderedTemplate = function withRenderedTemplate(template, data, callback) {
|
|
17
|
+
withDiv((el) => {
|
|
18
|
+
const ourTemplate = (template && typeof template.valueOf() === "string") ? Template[template] : template;
|
|
19
|
+
Blaze.renderWithData(ourTemplate, data, el);
|
|
20
|
+
Tracker.flush();
|
|
21
|
+
callback(el);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
if (config.engines.client !== 'react') {
|
|
2
|
+
import { Template } from 'meteor/templating';
|
|
3
|
+
import { Blaze } from 'meteor/blaze';
|
|
4
|
+
import { Tracker } from 'meteor/tracker';
|
|
5
|
+
|
|
6
|
+
const withDiv = function withDiv(callback) {
|
|
7
|
+
const el = document.createElement('div');
|
|
8
|
+
document.body.appendChild(el);
|
|
9
|
+
try {
|
|
10
|
+
callback(el);
|
|
11
|
+
} finally {
|
|
12
|
+
document.body.removeChild(el);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const withRenderedTemplate = function withRenderedTemplate(template, data, callback) {
|
|
17
|
+
withDiv((el) => {
|
|
18
|
+
const ourTemplate = (template && typeof template.valueOf() === "string") ? Template[template] : template;
|
|
19
|
+
Blaze.renderWithData(ourTemplate, data, el);
|
|
20
|
+
Tracker.flush();
|
|
21
|
+
callback(el);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '/imports/startup/lib';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '/imports/startup/lib/index.jsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '/imports/startup/lib';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '/imports/startup/lib/index';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
interface Window { cordova: any; }
|
|
2
|
+
|
|
3
|
+
declare module "react" {
|
|
4
|
+
interface React {
|
|
5
|
+
let Component:TODO;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module "react-router-dom" {
|
|
10
|
+
export let BrowserRouter: any;
|
|
11
|
+
export let StaticRouter: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module "react-router" {
|
|
15
|
+
export let Router: any;
|
|
16
|
+
export let Route: any;
|
|
17
|
+
export let IndexRoute: any;
|
|
18
|
+
export let browserHistory: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "react-dom" {
|
|
22
|
+
export let render: any;
|
|
23
|
+
export let hydrate: any;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module "react-dom/server" {
|
|
27
|
+
export let renderToStaticMarkup: any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare module "history" {
|
|
31
|
+
export let createMemoryHistory: any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module "styled-components" {
|
|
35
|
+
export let ServerStyleSheet: any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare module "winston" {
|
|
39
|
+
export let winston: any;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module "winston-transport" {
|
|
43
|
+
export let index: any;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type Props {
|
|
47
|
+
children: any;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type UpdateModifier {
|
|
51
|
+
$set: object;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare namespace JSX {
|
|
55
|
+
interface IntrinsicElements {
|
|
56
|
+
a: any;
|
|
57
|
+
abbr: any;
|
|
58
|
+
address: any;
|
|
59
|
+
area: any;
|
|
60
|
+
article: any;
|
|
61
|
+
aside: any;
|
|
62
|
+
audio: any;
|
|
63
|
+
base: any;
|
|
64
|
+
bdi: any;
|
|
65
|
+
bdo: any;
|
|
66
|
+
blockquote: any;
|
|
67
|
+
body: any;
|
|
68
|
+
button: any;
|
|
69
|
+
canvas: any;
|
|
70
|
+
caption: any;
|
|
71
|
+
cite: any;
|
|
72
|
+
code: any;
|
|
73
|
+
col: any;
|
|
74
|
+
colgroup: any;
|
|
75
|
+
data: any;
|
|
76
|
+
datalist: any;
|
|
77
|
+
dd: any;
|
|
78
|
+
del: any;
|
|
79
|
+
details: any;
|
|
80
|
+
dfn: any;
|
|
81
|
+
dialog: any;
|
|
82
|
+
div: any;
|
|
83
|
+
dl: any;
|
|
84
|
+
dt: any;
|
|
85
|
+
em: any;
|
|
86
|
+
embed: any;
|
|
87
|
+
fieldset: any;
|
|
88
|
+
figcaption: any;
|
|
89
|
+
figure: any;
|
|
90
|
+
footer: any;
|
|
91
|
+
form: any;
|
|
92
|
+
h1: any;
|
|
93
|
+
h2: any;
|
|
94
|
+
h3: any;
|
|
95
|
+
h4: any;
|
|
96
|
+
h5: any;
|
|
97
|
+
h6: any;
|
|
98
|
+
head: any;
|
|
99
|
+
header: any;
|
|
100
|
+
hr: any;
|
|
101
|
+
html: any;
|
|
102
|
+
i: any;
|
|
103
|
+
img: any;
|
|
104
|
+
input: any;
|
|
105
|
+
ins: any;
|
|
106
|
+
kbd: any;
|
|
107
|
+
label: any;
|
|
108
|
+
legend: any;
|
|
109
|
+
li: any;
|
|
110
|
+
link: any;
|
|
111
|
+
main: any;
|
|
112
|
+
map: any;
|
|
113
|
+
mark: any;
|
|
114
|
+
meta: any;
|
|
115
|
+
meter: any;
|
|
116
|
+
nav: any;
|
|
117
|
+
object: any;
|
|
118
|
+
ol: any;
|
|
119
|
+
optgroup: any;
|
|
120
|
+
option: any;
|
|
121
|
+
output: any;
|
|
122
|
+
p: any;
|
|
123
|
+
param: any;
|
|
124
|
+
picture: any;
|
|
125
|
+
pre: any;
|
|
126
|
+
progress: any;
|
|
127
|
+
q: any;
|
|
128
|
+
rp: any;
|
|
129
|
+
ruby: any;
|
|
130
|
+
s: any;
|
|
131
|
+
samp: any;
|
|
132
|
+
section: any;
|
|
133
|
+
select: any;
|
|
134
|
+
small: any;
|
|
135
|
+
source: any;
|
|
136
|
+
span: any;
|
|
137
|
+
strong: any;
|
|
138
|
+
style: any;
|
|
139
|
+
sub: any;
|
|
140
|
+
summary: any;
|
|
141
|
+
sup: any;
|
|
142
|
+
svg: any;
|
|
143
|
+
table: any;
|
|
144
|
+
tbody: any;
|
|
145
|
+
td: any;
|
|
146
|
+
template: any;
|
|
147
|
+
textarea: any;
|
|
148
|
+
tfoot: any;
|
|
149
|
+
th: any;
|
|
150
|
+
thead: any;
|
|
151
|
+
time: any;
|
|
152
|
+
tr: any;
|
|
153
|
+
track: any;
|
|
154
|
+
u: any;
|
|
155
|
+
ul: any;
|
|
156
|
+
var: any;
|
|
157
|
+
video: any;
|
|
158
|
+
wbr: any;
|
|
159
|
+
}
|
|
160
|
+
}
|