@maka/maka-cli 4.5.3 → 4.5.6
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/README.md +4 -0
- package/bundle/obf/package.json +1 -1
- package/bundle/obf/src/command.js +1 -1
- package/bundle/obf/src/commands/_index.js +1 -1
- package/bundle/obf/src/commands/aws/_index.js +1 -1
- package/bundle/obf/src/commands/aws/aws.command.js +1 -1
- package/bundle/obf/src/commands/aws/ci.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/ckp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/csg.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/di.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/dkp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/dsg.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/rbi.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/rkp.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/sth.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/aws/ti.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/build/_index.js +1 -1
- package/bundle/obf/src/commands/build/build.js +1 -1
- package/bundle/obf/src/commands/build/docker.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/create.js +1 -1
- package/bundle/obf/src/commands/debug.js +1 -1
- package/bundle/obf/src/commands/deploy.js +1 -1
- package/bundle/obf/src/commands/game/_index.js +1 -1
- package/bundle/obf/src/commands/game/battleship.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/play.command.js +1 -1
- package/bundle/obf/src/commands/game/pong.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/snake.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/game/tetris.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/generate.js +1 -1
- package/bundle/obf/src/commands/get/_index.js +1 -1
- package/bundle/obf/src/commands/get/get.command.js +1 -1
- package/bundle/obf/src/commands/get/global.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/get/local.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/get/whoami.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/help.js +1 -1
- package/bundle/obf/src/commands/install.js +1 -1
- package/bundle/obf/src/commands/jsdoc.js +1 -1
- package/bundle/obf/src/commands/lint.js +1 -1
- package/bundle/obf/src/commands/login.js +1 -1
- package/bundle/obf/src/commands/logout.js +1 -1
- package/bundle/obf/src/commands/logs.js +1 -1
- package/bundle/obf/src/commands/maka.cmd.js +1 -1
- package/bundle/obf/src/commands/murder.js +1 -1
- package/bundle/obf/src/commands/proxy.js +1 -1
- package/bundle/obf/src/commands/reconfig.js +1 -1
- package/bundle/obf/src/commands/run/_index.js +1 -1
- package/bundle/obf/src/commands/run/docker.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/run/run.command.js +1 -1
- package/bundle/obf/src/commands/set/_index.js +1 -1
- package/bundle/obf/src/commands/set/global.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/set/local.sub.cmd.js +1 -1
- package/bundle/obf/src/commands/set/set.command.js +1 -1
- package/bundle/obf/src/commands/ssh.js +1 -1
- package/bundle/obf/src/commands/ssl.js +1 -1
- package/bundle/obf/src/commands/test.js +1 -1
- package/bundle/obf/src/commands/version.js +1 -1
- package/bundle/obf/src/error.js +1 -1
- package/bundle/obf/src/generator.js +1 -1
- package/bundle/obf/src/generators/_index.js +1 -1
- package/bundle/obf/src/generators/api.js +1 -1
- package/bundle/obf/src/generators/collection.js +1 -1
- package/bundle/obf/src/generators/component.js +1 -1
- package/bundle/obf/src/generators/config.js +1 -1
- package/bundle/obf/src/generators/dbc.js +1 -1
- package/bundle/obf/src/generators/dockerfile.js +1 -1
- package/bundle/obf/src/generators/hook.js +1 -1
- package/bundle/obf/src/generators/kit.js +1 -1
- package/bundle/obf/src/generators/layout.js +1 -1
- package/bundle/obf/src/generators/maka.gen.js +1 -1
- package/bundle/obf/src/generators/methods.js +1 -1
- package/bundle/obf/src/generators/package.js +1 -1
- package/bundle/obf/src/generators/page.js +1 -1
- package/bundle/obf/src/generators/publish.js +1 -1
- package/bundle/obf/src/generators/route.js +1 -1
- package/bundle/obf/src/generators/service.js +1 -1
- package/bundle/obf/src/generators/services/_index.js +1 -1
- package/bundle/obf/src/generators/services/openssl.js +1 -1
- package/bundle/obf/src/generators/services/translation.js +1 -1
- package/bundle/obf/src/maka.js +1 -1
- package/bundle/obf/src/templates/meteor/app/imports/startup/client/index.js.jsx +20 -6
- package/bundle/obf/src/templates/meteor/app/imports/startup/client/index.js.tsx +21 -7
- package/bundle/obf/src/templates/meteor/app/imports/startup/lib/index.js.jsx +10 -0
- package/bundle/obf/src/templates/meteor/app/imports/startup/lib/index.js.tsx +10 -0
- package/bundle/obf/src/templates/meteor/app/imports/startup/server/index.js.jsx +25 -14
- package/bundle/obf/src/templates/meteor/app/imports/startup/server/index.js.tsx +25 -13
- package/bundle/obf/src/templates/meteor/template/template.js.jsx +1 -1
- package/bundle/obf/src/templates/meteor/template/template.js.tsx +1 -1
- package/bundle/obf/src/templates/react/component/component.js.jsx +2 -6
- package/bundle/obf/src/templates/react/component/component.js.tsx +2 -6
- package/bundle/obf/src/templates/react/hook/hook.js.jsx +1 -5
- package/bundle/obf/src/templates/react/hook/hook.js.tsx +1 -5
- package/bundle/obf/src/tool.js +1 -1
- package/bundle/obf/src/tools/actions/actions.class.js +1 -1
- package/bundle/obf/src/tools/actions/actions.test.js +1 -1
- package/bundle/obf/src/tools/aws/aws.class.js +1 -1
- package/bundle/obf/src/tools/aws/aws.interfaces.js +1 -1
- package/bundle/obf/src/tools/docker/docker.class.js +1 -1
- package/bundle/obf/src/tools/docker/docker.interfaces.js +1 -1
- package/bundle/obf/src/tools/fsi/fsi.class.js +1 -1
- package/bundle/obf/src/tools/fsi/fsi.interfaces.js +1 -1
- package/bundle/obf/src/tools/https/https.class.js +1 -1
- package/bundle/obf/src/tools/https/https.interface.js +1 -1
- package/bundle/obf/src/tools/log/log.class.js +1 -1
- package/bundle/obf/src/tools/log/log.interfaces.js +1 -1
- package/bundle/obf/src/tools/spawn-async/spawn-async.class.js +1 -1
- package/bundle/obf/src/tools/spawn-async/spawn-async.interfaces.js +1 -1
- package/bundle/obf/src/tools/ssh/ssh.class.js +1 -1
- package/bundle/obf/src/tools/ssh/ssh.interfaces.js +1 -1
- package/bundle/obf/src/tools/ssl/ssl.class.js +1 -1
- package/jest.config.js +11 -0
- package/package.json +5 -4
- package/tsconfig.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71y=a71d;(function(a,b){const v=a71d,c=a();while(!![]){try{const d=-parseInt(v(0xa0))/0x1+parseInt(v(0xcd))/0x2*(-parseInt(v(0xad))/0x3)+-parseInt(v(0xa9))/0x4*(parseInt(v(0xc8))/0x5)+parseInt(v(0xb0))/0x6+parseInt(v(0xb3))/0x7+parseInt(v(0xbf))/0x8+parseInt(v(0xbe))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a71c,0xb0543));function a71c(){const H=['pathFromApp','685002JqvnXG','indexOf','routes.js','maka\x20{generate,\x20g}:{route,\x20r}\x20[path/]<name>\x20[url]\x20[--private]','imports','includes','maka\x20g:route\x20todosEdit\x20todos/:id/edit','filter','</Router>','4jhGcBY','join','withHook','const\x20privateRoutes\x20=\x20(<>','1949592FSjwEi','constructor','map','551178mBoJAO','root','error','2883601ympfdk','toLowerCase','fsi','page','layout','private','length','withTranslations','warn','invoke','\x22*\x22','13291182AttLwR','10124632paxTNP','ssr','PrivateLayout','client','toString','lib','injectAfterLineNumber','url','config','5945370wOyClE','maka\x20g:route\x20usersShow\x20users/:id/show\x20--layout\x20userView','features','readFileLines','findGenerator','2PQlOMY','search','startup','engines','only','\x0a\x09\x09','templateContent','route/route.js','Could\x20not\x20find\x20a\x20suitable\x20location\x20to\x20enable\x20this\x20route.\x20\x20Please\x20inspect\x20','/imports/ui/pages','<Route','templateName','rewriteDestinationPathForEngine','maka\x20g:route\x20todosIndex\x20todos','getProjectConfig','newForm','import\x20*\x20as\x20Component\x20from\x20\x27./templates\x27;','withValue','apply','create','const\x20publicRoutes\x20=\x20(<>'];a71c=function(){return H;};return a71c();}function a71d(a,b){const c=a71c();return a71d=function(d,e){d=d-0x8d;let f=c[d];return f;},a71d(a,b);}const a71b=(function(){let a=!![];return function(b,c){const d=a?function(){const w=a71d;if(c){const e=c[w(0x9c)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a71a=a71b(this,function(){const x=a71d;return a71a[x(0xc3)]()[x(0xce)]('(((.+)+)+)+$')['toString']()[x(0xae)](a71a)[x(0xce)]('(((.+)+)+)+$');});a71a();import a71e from'path';import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';import a71f from'../generators/maka.gen.js';import{camelCase,paramCase,pascalCase}from'change-case';const aliases=['r'];Generator[a71y(0x9d)]({'name':'route','aliases':aliases,'validOpts':[a71y(0xb8),'layout',a71y(0x8e),'cwd',a71y(0xc7),a71y(0xb1),a71y(0xab),a71y(0xc6)],'usage':a71y(0xa3),'shortDesc':'Scaffolding\x20for\x20a\x20Route.','examples':[a71y(0x97),a71y(0xa6),a71y(0xc9),'maka\x20g:route\x20lists/listIndex\x20lists']},function(a,b){const z=a71y;try{const c=this[z(0xb5)][z(0x98)]();this[z(0xb5)][z(0x9b)](c,async()=>{const A=z,d=b[A(0xb8)]??![];let f=paramCase(a[0x0]),g='/'+f;a['length']>0x1&&(g='/'+a[A(0xa7)](function(l){return l!=='/';})[A(0xaa)]('/')[A(0xb4)]());f=camelCase(f);b[A(0xb7)]&&(b[A(0xb7)]=camelCase(b[A(0xb7)]));const h=a71e[A(0xaa)](A(0x93),f,f),i={'name':f,'fileCase':paramCase(f),'camelCaseName':camelCase(f),'url':g,'layout':b[A(0xb7)]||'MasterLayout','templatePath':h,'templateName':pascalCase(f),'client':c['engines'][A(0xc2)],'newForm':![],'withTranslations':c[A(0xca)][A(0xba)]};d&&(i[A(0xb7)]=A(0xc1));if(!b[A(0xb1)]){const l=a71f[A(0xcc)](A(0xb6));l&&await l[A(0xbc)](a,b);}let j,k;if(c['engines']['client']==='react'){if(c[A(0x8d)][A(0xc0)]==='true'){const p=this[A(0xb5)][A(0x9f)]({'pathParts':[A(0xa4),'startup',A(0xc4),A(0xa2)]});j=this['fsi'][A(0x96)]({'pathParts':[p],'config':c});}else{const q=this[A(0xb5)][A(0x9f)]({'pathParts':[A(0xa4),'startup',A(0xc2),A(0xa2)]});j=this['fsi'][A(0x96)]({'pathParts':[q],'config':c});}const m=this[A(0xb5)][A(0xcb)](j)[A(0xaf)]((r,s)=>{const B=A;return r[B(0xa5)](B(0x9a))?s+0x1:null;})['filter'](r=>r!==null);let n=this['fsi'][A(0xcb)](j)[A(0xaf)]((r,s)=>{const C=A;return r[C(0xa5)](C(0x9e))?s+0x1:null;})[A(0xa7)](r=>r!==null),o=this[A(0xb5)][A(0xcb)](j)[A(0xaf)]((r,s)=>{const D=A;return r[D(0xa5)](D(0xac))?s+0x1:null;})[A(0xa7)](r=>r!==null);n[A(0xb9)]>0x0&&o[A(0xb9)]>0x0&&(i[A(0x99)]=!![]);k=this['fsi']['templateContent']({'srcPath':'route/route.js','framework':'react','context':i,'config':c});if(n[A(0xb9)]>0x0||o['length']>0x0){this['fsi'][A(0xc5)]({'filePath':j,'content':k,'lineNumber':m[0x0]});if(d&&o[A(0xb9)]>0x0)o=this[A(0xb5)]['readFileLines'](j)['map']((r,s)=>{const E=A;return r[E(0xa5)](E(0xac))?s+0x1:null;})[A(0xa7)](r=>r!==null),this[A(0xb5)][A(0xc5)]({'filePath':j,'content':'\x09{'+i[A(0x95)]+'}','lineNumber':o[0x0]});else n[A(0xb9)]>0x0?(n=this[A(0xb5)][A(0xcb)](j)[A(0xaf)]((r,s)=>{const F=A;return r[F(0xa5)](F(0x9e))?s+0x1:null;})[A(0xa7)](r=>r!==null),this[A(0xb5)]['injectAfterLineNumber']({'filePath':j,'content':'\x09{'+i['templateName']+'}','lineNumber':n[0x0]})):Log[A(0xbb)](A(0x92)+j);}else{const r=this[A(0xb5)][A(0xcb)](j)[A(0xaf)](u=>{const G=A;return u[G(0xa5)](G(0xbd));}),s=r[A(0xa1)](!![])>-0x1,t=s?A(0x94):A(0xa8);this[A(0xb5)]['injectIntoFile']({'filePath':j,'content':A(0x8f)+k+A(0x8f),'begin':'<Router','end':t});}}else{if(c[A(0x8d)][A(0xc2)]==='vanilla'){const u=this[A(0xb5)]['pathFromApp']({'pathParts':[A(0xa4),A(0xcf),A(0xc2),'routes.js']});j=this[A(0xb5)][A(0x96)]({'pathParts':[u],'config':c}),k=this[A(0xb5)][A(0x90)]({'srcPath':A(0x91),'context':i}),this[A(0xb5)]['injectAtEndOfFile']({'filePath':j,'content':'\x0a'+k});}}});}catch(d){Log[z(0xb2)](d);}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a72d(a,b){const c=a72c();return a72d=function(d,e){d=d-0x19e;let f=c[d];return f;},a72d(a,b);}const a72l=a72d;(function(a,b){const j=a72d,c=a();while(!![]){try{const d=-parseInt(j(0x1b8))/0x1+parseInt(j(0x1a1))/0x2+parseInt(j(0x1aa))/0x3+-parseInt(j(0x1a3))/0x4*(parseInt(j(0x1b1))/0x5)+parseInt(j(0x1ad))/0x6*(-parseInt(j(0x1a2))/0x7)+-parseInt(j(0x1a0))/0x8+parseInt(j(0x19f))/0x9;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a72c,0xb4a20));const a72b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a72a=a72b(this,function(){const k=a72d;return a72a[k(0x1b4)]()[k(0x1a4)]('(((.+)+)+)+$')['toString']()['constructor'](a72a)[k(0x1a4)](k(0x1af));});a72a();import{camelCase,paramCase,pascalCase}from'change-case';function a72c(){const o=['8058280iwwYnk','804008ySxUTE','16219ephoiQ','4584700KUoIkx','search','tsx','svc','maka\x20{generate,\x20g}:{service}\x20[service-type]','template','service','778338khzrHz','engines','fsi','2256saMZrk','logger','(((.+)+)+)+$','error','5YlgvEf','checkNpmPackage','Installing\x20winston','toString','services','lib','Generate\x20a\x20service\x20to\x20run\x20within\x20your\x20meteor\x20application.','615695QNeILC','service/logger/logger.js','installNpmPackage','winston\x20setimmediate','resourceName','startup','create','33468921mPEhJv'];a72c=function(){return o;};return a72c();}import{Generator}from'../generator.js';import{Log}from'../tools/log/log.class.js';Generator[a72l(0x19e)]({'name':a72l(0x1a9),'aliases':[a72l(0x1a6)],'usage':a72l(0x1a7),'shortDesc':a72l(0x1b7),'validOpts':['type'],'validArgs':[a72l(0x1ae)],'maxArgLength':0x1,'minArgLength':0x1,'examples':['maka\x20g:svc\x20logger']},async function(a,b){const n=a72l;try{const c=this['fsi']['getProjectConfig']();this['fsi']['withValue'](c,async()=>{const m=a72d,d=this[m(0x1ac)]['pathFromApp']({}),f=paramCase(b['resourceName']),g={'name':pascalCase(b[m(0x1bc)]),'fileName':f,'camelCase':camelCase(b[m(0x1bc)]),'type':a[0x0],'engine':c['engines']['js'],'noRename':!![]};let h='js';c[m(0x1ab)]['js']===m(0x1a5)&&(h='ts');if(a[0x0]===m(0x1ae)){!this['fsi'][m(0x1b2)]('winston')&&await this['fsi'][m(0x1ba)](m(0x1bb),{'cwd':d,'msg':m(0x1b3)});const i=this['fsi']['pathFromApp']({'pathParts':['imports',m(0x1bd),m(0x1b6),m(0x1b5),f+'.'+h]});this['fsi'][m(0x1a8)]({'srcPath':m(0x1b9),'destPath':i,'context':g,'config':c});}});}catch(d){Log[n(0x1b0)](d);}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,b){var f=a73d,c=a();while(!![]){try{var d
|
|
1
|
+
function a73d(a,b){var c=a73c();return a73d=function(d,e){d=d-0x1c3;var f=c[d];return f;},a73d(a,b);}function a73c(){var i=['235sFzByM','12011160xQAMOD','apply','977601ovjzzY','100314cnxOBk','(((.+)+)+)+$','348456XxCOTs','toString','628410eHyObI','3512684lgPFuX','4753484pnKbct','constructor','search'];a73c=function(){return i;};return a73c();}(function(a,b){var f=a73d,c=a();while(!![]){try{var d=parseInt(f(0x1ca))/0x1+-parseInt(f(0x1cd))/0x2+-parseInt(f(0x1cf))/0x3+-parseInt(f(0x1c4))/0x4+-parseInt(f(0x1c7))/0x5*(parseInt(f(0x1cb))/0x6)+parseInt(f(0x1c3))/0x7+parseInt(f(0x1c8))/0x8;if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a73c,0x98162));var a73b=(function(){var a=!![];return function(b,c){var d=a?function(){var g=a73d;if(c){var e=c[g(0x1c9)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a73a=a73b(this,function(){var h=a73d;return a73a['toString']()[h(0x1c6)](h(0x1cc))[h(0x1ce)]()[h(0x1c5)](a73a)[h(0x1c6)](h(0x1cc));});a73a();import'./translation.js';import'./openssl.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a74k=a74d;(function(a,b){const i=a74d,c=a();while(!![]){try{const d=parseInt(i(0x113))/0x1*(parseInt(i(0x11a))/0x2)+-parseInt(i(0x116))/0x3+-parseInt(i(0x119))/0x4+-parseInt(i(0x100))/0x5*(-parseInt(i(0x112))/0x6)+-parseInt(i(0x111))/0x7+parseInt(i(0x101))/0x8+parseInt(i(0x10b))/0x9*(parseInt(i(0x107))/0xa);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a74c,0x637a1));const a74b=(function(){let a=!![];return function(b,c){const d=a?function(){if(c){const e=c['apply'](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a74a=a74b(this,function(){const j=a74d;return a74a[j(0x10f)]()[j(0x105)](j(0x106))['toString']()[j(0x11b)](a74a)[j(0x105)](j(0x106));});a74a();import{Generator}from'../../generator.js';import{Log}from'../../tools/log/log.class.js';function a74c(){const n=['template','861000aHIGMf','maka\x20g:sslconfig\x20--env\x20dev','getGlobalConfig','809960FnvzTv','192706bFTdRc','constructor','44095anHZYP','1864552nzPRuc','sslconfig','openssl/openssl.conf','create','search','(((.+)+)+)+$','694940TXupKT','join','Generate\x20a\x20new\x20openssl\x20config\x20file','error','108OadiQC','service','appName','fsi','toString','withValue','3346413VAaLUi','144cIWufG','1uDiRmY','env'];a74c=function(){return n;};return a74c();}import a74e from'path';function a74d(a,b){const c=a74c();return a74d=function(d,e){d=d-0x100;let f=c[d];return f;},a74d(a,b);}Generator[a74k(0x104)]({'name':a74k(0x102),'usage':'maka\x20{generate,\x20g}:sslconfig','shortDesc':a74k(0x109),'noResource':!![],'requiredOpts':[a74k(0x114)],'examples':[a74k(0x117)],'validOpts':[a74k(0x114)]},async function(a,b){const l=a74k;try{const c=await this[l(0x10e)]['getProjectConfig'](),d=await this['fsi'][l(0x118)](),f=this[l(0x10e)]['getConfigPath'](b['env']),g=a74e[l(0x108)](f,'_keys','openssl.conf');await this[l(0x10e)][l(0x110)](c,async()=>{const m=l,h={'app':d[m(0x10d)],'noRename':!![]};await this['fsi'][m(0x115)]({'srcPath':m(0x103),'destPath':g,'framework':m(0x10c),'context':h,'config':c});});}catch(h){Log[l(0x10a)](h);}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a75c(){const D=['\x20}\x20from\x20\x27./','isFile','injectAtBeginningOfFile','i18next\x20i18next-browser-languagedetector\x20react-i18next','setProjectConfig','warn','server','default\x20as\x20','index.','maka\x20g:translation\x20--lang=en\x20(default)','translations','maka\x20g:translation\x20--lang=fr','44592qWrBvl','maka\x20{generate,\x20g}:translation\x20--lang=<language>','fsi','constructor','Generate\x20a\x20new\x20locale\x20translation','startup','translation','rewriteDestinationPathForEngine','.js','import\x20\x27../lib/services/translations/i18n\x27;\x0a','locales','312543HvsuWp','10rnjMHJ','toString','18zzPiZZ','engines','exit','readFileSync','i18n/index.js','i18next','root','getProjectConfig','65RZlAPN','imports','template','injectAtEndOfFile','import\x20\x27../lib/services/translations/i18n\x27;','7PJhvLd','services','search','lang','service','apply','findAppDirectory','export\x20{\x20default\x20as\x20','180444TaVPUY','features.withTranslations','appName','12872684ljkHTg','Verifying\x20npm\x20package\x20requirements:\x20i18next\x20...','maka\x20g:translation\x20--lang=de','lib','grep','getGlobalConfig','client','2139072MpwAAS','i18n.js','installNpmPackage','index.js','i18n/i18n.js','(((.+)+)+)+$','1689942ijlyUD','Locale\x20already\x20exported:\x20','create','Locale\x20already\x20defined:\x20','1025955kgsXkD','ssr','pathFromApp'];a75c=function(){return D;};return a75c();}const a75A=a75d;(function(a,b){const x=a75d,c=a();while(!![]){try{const d=-parseInt(x(0x204))/0x1+parseInt(x(0x207))/0x2*(parseInt(x(0x1f9))/0x3)+parseInt(x(0x21c))/0x4*(-parseInt(x(0x20f))/0x5)+parseInt(x(0x22c))/0x6*(parseInt(x(0x214))/0x7)+-parseInt(x(0x226))/0x8+-parseInt(x(0x1ea))/0x9+parseInt(x(0x205))/0xa*(parseInt(x(0x21f))/0xb);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a75c,0x4a8a0));const a75b=(function(){let a=!![];return function(b,c){const d=a?function(){const y=a75d;if(c){const e=c[y(0x219)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a75a=a75b(this,function(){const z=a75d;return a75a[z(0x206)]()[z(0x216)](z(0x22b))[z(0x206)]()[z(0x1fc)](a75a)[z(0x216)](z(0x22b));});a75a();import{Generator}from'../../generator.js';function a75d(a,b){const c=a75c();return a75d=function(d,e){d=d-0x1e9;let f=c[d];return f;},a75d(a,b);}import{Log}from'../../tools/log/log.class.js';import a75e from'fs';Generator[a75A(0x22e)]({'name':a75A(0x1ff),'usage':a75A(0x1fa),'aliases':['i18n'],'shortDesc':a75A(0x1fd),'noResource':!![],'examples':[a75A(0x1f6),a75A(0x1f8),a75A(0x221)],'validOpts':[a75A(0x217)]},function(a,b){const B=a75A;try{const c=this['fsi'][B(0x20e)](),d=this[B(0x1fb)][B(0x224)](),f=this[B(0x1fb)][B(0x21a)]();this[B(0x1fb)]['withValue'](c,()=>{const C=B;try{!b[C(0x217)]&&(b[C(0x217)]='en');!b[C(0x20d)]&&!this[C(0x1fb)]['checkNpmPackage'](C(0x20c))&&(Log['warn'](C(0x220)),this[C(0x1fb)][C(0x228)](C(0x1f0),{'cwd':f}),this[C(0x1fb)][C(0x1f1)](C(0x21d),!![]));const g=this[C(0x1fb)]['pathFromApp']({'pathParts':[C(0x210),C(0x1fe),C(0x225),C(0x229)]}),h=this['fsi'][C(0x200)]({'pathParts':[g],'config':c}),i=this[C(0x1fb)][C(0x223)](a75e[C(0x20a)](h)[C(0x206)](),'import\x20\x27../lib/services/translations/i18n\x27;')[0x0]&&!![];if(c[C(0x208)][C(0x1eb)]==='true'){!i&&this[C(0x1fb)][C(0x1ef)]({'filePath':h,'content':C(0x202)});const t=this['fsi'][C(0x1ec)]({'pathParts':[C(0x210),C(0x1fe),C(0x1f3),C(0x229)]}),u=this['fsi'][C(0x200)]({'pathParts':[t],'config':c}),v=this[C(0x1fb)][C(0x223)](a75e[C(0x20a)](u)['toString'](),C(0x213))[0x0]&&!![];!v&&this[C(0x1fb)][C(0x1ef)]({'filePath':u,'content':C(0x202)});}else!i&&this[C(0x1fb)][C(0x1ef)]({'filePath':h,'content':C(0x202)});const j={'app':d[C(0x21e)],'config':c},k=this[C(0x1fb)]['pathFromApp']({'pathParts':[C(0x210),C(0x1fe),C(0x222),'services','translations',C(0x227)]}),l=this[C(0x1fb)][C(0x1ee)](this[C(0x1fb)][C(0x200)]({'pathParts':[k],'config':c}));!l&&this['fsi'][C(0x211)]({'srcPath':C(0x22a),'destPath':k,'framework':C(0x218),'context':j,'config':c});const m=this[C(0x1fb)][C(0x1ec)]({'pathParts':[C(0x210),C(0x1fe),'lib',C(0x215),C(0x1f7),C(0x203),b[C(0x217)]+C(0x201)]}),n=this[C(0x1fb)][C(0x200)]({'pathParts':[m],'config':c}),o=this[C(0x1fb)][C(0x1ee)](n);!o?this[C(0x1fb)][C(0x211)]({'srcPath':'i18n/locales.js','destPath':m,'framework':'service','context':j,'config':c}):Log['warn'](C(0x1e9)+n);const p=this[C(0x1fb)][C(0x1ec)]({'pathParts':[C(0x210),C(0x1fe),C(0x222),C(0x215),C(0x1f7),C(0x203),C(0x1f5)+c[C(0x208)]['js']]}),q=this[C(0x1fb)]['rewriteDestinationPathForEngine']({'pathParts':[p],'config':c}),r=this[C(0x1fb)][C(0x1ee)](q);!r&&this[C(0x1fb)][C(0x211)]({'srcPath':C(0x20b),'destPath':p,'framework':C(0x218),'context':j,'config':c});const s=this[C(0x1fb)][C(0x223)](a75e[C(0x20a)](p)[C(0x206)](),C(0x1f4)+b[C(0x217)])[0x0]&&!![];!s?this['fsi'][C(0x212)]({'filePath':p,'content':C(0x21b)+b[C(0x217)]+C(0x1ed)+b[C(0x217)]+'\x27;'}):Log[C(0x1f2)](C(0x22d)+p);}catch(w){Log['error'](w),process[C(0x209)](0x1);}});}catch(g){Log['error'](g),process[B(0x209)](0x1);}});
|
package/bundle/obf/src/maka.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --experimental-modules --no-warnings --experimental-json-modules
|
|
2
|
-
const
|
|
2
|
+
const a76m=a76d;(function(a,b){const j=a76d,c=a();while(!![]){try{const d=-parseInt(j(0xff))/0x1*(-parseInt(j(0x104))/0x2)+-parseInt(j(0x107))/0x3+-parseInt(j(0xf8))/0x4*(parseInt(j(0xf5))/0x5)+parseInt(j(0x102))/0x6+-parseInt(j(0xf7))/0x7*(-parseInt(j(0xef))/0x8)+parseInt(j(0xfc))/0x9*(-parseInt(j(0xf0))/0xa)+parseInt(j(0xfd))/0xb*(parseInt(j(0xf3))/0xc);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a76c,0x5571c));const a76b=(function(){let a=!![];return function(b,c){const d=a?function(){const k=a76d;if(c){const e=c[k(0xf4)](b,arguments);return c=null,e;}}:function(){};return a=![],d;};}()),a76a=a76b(this,function(){const l=a76d;return a76a['toString']()[l(0xf6)]('(((.+)+)+)+$')['toString']()[l(0xfe)](a76a)['search'](l(0x100));});a76a();import a76e from'minimist';import a76f from'os';import a76g from'path';import a76h from'humps';import a76i from'./commands/maka.cmd.js';import'./commands/_index.js';import'./generators/_index.js';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta[a76m(0x103)]),__dirname=a76g['dirname'](__filename);global['MAKA_COMMAND_PATH']=__dirname;function a76d(a,b){const c=a76c();return a76d=function(d,e){d=d-0xef;let f=c[d];return f;},a76d(a,b);}const total_memory=a76f[a76m(0xf2)](),total_mem_in_kb=total_memory/0x400;let total_mem_in_mb=total_mem_in_kb/0x400;total_mem_in_mb=Math['floor'](total_mem_in_mb),process[a76m(0xf9)][a76m(0xfb)]='--max-old-space-size='+total_mem_in_mb,process[a76m(0xf9)][a76m(0xf1)]='1';const argv=a76e(process[a76m(0x106)][a76m(0x101)](0x2)),args=argv['_'],deepCopyArgv=JSON['parse'](JSON[a76m(0xfa)](argv));delete deepCopyArgv['_'];function a76c(){const n=['108KlbbMM','apply','367655gZgQqU','search','945147BueWJv','4xapnma','env','stringify','TOOL_NODE_FLAGS','1512801qEOLmr','388487Krnswd','constructor','23589IOgqso','(((.+)+)+)+$','slice','226458NFAZrP','url','58oBjTTh','camelizeKeys','argv','740760DWYcNI','8DYCpHX','30WBJnwh','BROWSERSLIST_IGNORE_OLD_DATA','totalmem'];a76c=function(){return n;};return a76c();}const opts=a76h[a76m(0x105)](deepCopyArgv);a76i['run'](args,opts);
|
|
@@ -6,12 +6,14 @@ import { browserHistory } from 'react-router';
|
|
|
6
6
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
7
7
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
8
8
|
// Apollo Client configuration
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ApolloClient,
|
|
11
|
+
ApolloProvider,
|
|
12
|
+
createHttpLink,
|
|
13
|
+
InMemoryCache
|
|
14
|
+
} from '@apollo/client';
|
|
10
15
|
import { ApolloProvider as ApolloHooksProvider } from '@apollo/react-hooks';
|
|
11
|
-
import {
|
|
12
|
-
import { ApolloLink } from 'apollo-link';
|
|
13
|
-
import { HttpLink, createHttpLink } from 'apollo-link-http';
|
|
14
|
-
import { setContext } from "apollo-link-context";
|
|
16
|
+
import { setContext } from "@apollo/link-context";
|
|
15
17
|
|
|
16
18
|
const httpLink = createHttpLink({
|
|
17
19
|
uri: `/graphql`
|
|
@@ -38,14 +40,25 @@ const client = new ApolloClient({
|
|
|
38
40
|
});
|
|
39
41
|
<% } %><% if (config.engines.theme === 'material') { if (config.engines.ssr === 'true') { %>
|
|
40
42
|
import { ThemeProvider } from '@mui/material/styles';
|
|
43
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
41
44
|
import { theme } from '../lib/index';<% } else { %>
|
|
42
45
|
// Material UI Theme config using default mui.
|
|
43
46
|
import { ThemeProvider, createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
47
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
44
48
|
// https://mui.com/material-ui/customization/default-theme/
|
|
45
49
|
let theme = createTheme({
|
|
46
50
|
typography: {
|
|
47
51
|
useNextVariants: true,
|
|
48
52
|
},
|
|
53
|
+
components: {
|
|
54
|
+
MuiCssBaseline: {
|
|
55
|
+
styleOverrides: {
|
|
56
|
+
body: {
|
|
57
|
+
backgroundColor: '#fff', // sets default background
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
49
62
|
});
|
|
50
63
|
theme = responsiveFontSizes(theme);<% }} %>
|
|
51
64
|
<% if (config.engines.ssr === 'true') { %>
|
|
@@ -59,7 +72,8 @@ const App = ({ user }) => (<% if (config.engines.ssr === 'true') { %>
|
|
|
59
72
|
<BrowserRouter><% } %><% if (config.engines.graphql === 'apollo') { %>
|
|
60
73
|
<ApolloProvider client={client}>
|
|
61
74
|
<ApolloHooksProvider client={client}><% } %><% if (config.engines.theme === 'material') { %>
|
|
62
|
-
<ThemeProvider theme={theme}
|
|
75
|
+
<ThemeProvider theme={theme}>
|
|
76
|
+
<CssBaseline /><% } %>
|
|
63
77
|
<Routes user={user} history={browserHistory}/><% if (config.engines.theme === 'material') { %>
|
|
64
78
|
</ThemeProvider><% } %><% if (config.engines.graphql === 'apollo') { %>
|
|
65
79
|
</ApolloHooksProvider>
|
|
@@ -6,13 +6,14 @@ import { browserHistory } from 'react-router';
|
|
|
6
6
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
7
7
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
8
8
|
// Apollo Client configuration
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
ApolloClient,
|
|
11
|
+
ApolloProvider,
|
|
12
|
+
createHttpLink,
|
|
13
|
+
InMemoryCache
|
|
14
|
+
} from '@apollo/client';
|
|
11
15
|
import { ApolloProvider as ApolloHooksProvider } from '@apollo/react-hooks';
|
|
12
|
-
import {
|
|
13
|
-
import { ApolloLink } from 'apollo-link';
|
|
14
|
-
import { HttpLink, createHttpLink } from 'apollo-link-http';
|
|
15
|
-
import { setContext } from "apollo-link-context";
|
|
16
|
+
import { setContext } from "@apollo/link-context";
|
|
16
17
|
|
|
17
18
|
const httpLink = createHttpLink({
|
|
18
19
|
uri: `/graphql`
|
|
@@ -39,14 +40,26 @@ const client = new ApolloClient({
|
|
|
39
40
|
});
|
|
40
41
|
<% } %><% if (config.engines.theme === 'material') { if (config.engines.ssr === 'true') { %>
|
|
41
42
|
import { ThemeProvider } from '@mui/material/styles';
|
|
43
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
42
44
|
import { theme } from '../lib/index';<% } else { %>
|
|
43
45
|
// Material UI Theme config using default mui.
|
|
46
|
+
// https://mui.com/material-ui/customization/default-theme/
|
|
44
47
|
import { ThemeProvider, createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
48
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
45
49
|
// https://mui.com/material-ui/customization/default-theme/
|
|
46
50
|
let theme = createTheme({
|
|
47
51
|
typography: {
|
|
48
52
|
useNextVariants: true,
|
|
49
53
|
},
|
|
54
|
+
components: {
|
|
55
|
+
MuiCssBaseline: {
|
|
56
|
+
styleOverrides: {
|
|
57
|
+
body: {
|
|
58
|
+
backgroundColor: '#fff', // sets default background
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
50
63
|
});
|
|
51
64
|
theme = responsiveFontSizes(theme);<% }} %>
|
|
52
65
|
<% if (config.engines.ssr === 'true') { %>
|
|
@@ -60,7 +73,8 @@ const App = ({ user }) => (<% if (config.engines.ssr === 'true') { %>
|
|
|
60
73
|
<BrowserRouter><% } %><% if (config.engines.graphql === 'apollo') { %>
|
|
61
74
|
<ApolloProvider client={client}>
|
|
62
75
|
<ApolloHooksProvider client={client}><% } %><% if (config.engines.theme === 'material') { %>
|
|
63
|
-
<ThemeProvider theme={theme}
|
|
76
|
+
<ThemeProvider theme={theme}>
|
|
77
|
+
<CssBaseline /><% } %>
|
|
64
78
|
<Routes user={user} history={browserHistory}/><% if (config.engines.theme === 'material') { %>
|
|
65
79
|
</ThemeProvider><% } %><% if (config.engines.graphql === 'apollo') { %>
|
|
66
80
|
</ApolloHooksProvider>
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/** @namespace Common */<% if (config.engines.theme === 'material' && config.engines.ssr === 'true') { %>
|
|
2
2
|
// Material UI Theme config using roboto typefont and default mui.
|
|
3
3
|
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
4
5
|
// https://mui.com/material-ui/customization/default-theme/
|
|
5
6
|
let theme = createTheme({
|
|
6
7
|
typography: {
|
|
7
8
|
useNextVariants: true,
|
|
8
9
|
},
|
|
10
|
+
components: {
|
|
11
|
+
MuiCssBaseline: {
|
|
12
|
+
styleOverrides: {
|
|
13
|
+
body: {
|
|
14
|
+
backgroundColor: '#fff', // sets default background
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
9
19
|
});
|
|
10
20
|
theme = responsiveFontSizes(theme);
|
|
11
21
|
export { theme };<% } %>
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/** @namespace Common */<% if (config.engines.theme === 'material' && config.engines.ssr === 'true') { %>
|
|
2
2
|
// Material UI Theme config using roboto typefont and default mui.
|
|
3
3
|
import { createTheme, responsiveFontSizes } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
4
5
|
// https://mui.com/material-ui/customization/default-theme/
|
|
5
6
|
let theme = createTheme({
|
|
6
7
|
typography: {
|
|
7
8
|
useNextVariants: true,
|
|
8
9
|
},
|
|
10
|
+
components: {
|
|
11
|
+
MuiCssBaseline: {
|
|
12
|
+
styleOverrides: {
|
|
13
|
+
body: {
|
|
14
|
+
backgroundColor: '#fff', // sets default background
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
9
19
|
});
|
|
10
20
|
theme = responsiveFontSizes(theme);
|
|
11
21
|
export { theme };<% } %>
|
|
@@ -4,17 +4,20 @@ Meteor.startup(() => {
|
|
|
4
4
|
WebAppInternals.setInlineScriptsAllowed(false);
|
|
5
5
|
});
|
|
6
6
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
7
|
-
import { ApolloServer } from 'apollo
|
|
7
|
+
import { ApolloServer } from '@apollo/server';
|
|
8
8
|
import { WebApp } from 'meteor/webapp';
|
|
9
9
|
import { getUser } from 'meteor/apollo';
|
|
10
10
|
import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge';
|
|
11
11
|
import {
|
|
12
12
|
ApolloServerPluginLandingPageGraphQLPlayground
|
|
13
|
-
} from
|
|
13
|
+
} from '@apollo/server-plugin-landing-page-graphql-playground';
|
|
14
|
+
import { expressMiddleware } from '@apollo/server/express4';
|
|
15
|
+
import express from 'express';
|
|
14
16
|
|
|
15
17
|
const typeList = [];
|
|
16
18
|
const resolverList = [];
|
|
17
19
|
if (typeList.length > 0 && resolverList.length > 0) {
|
|
20
|
+
const expressApp = express();
|
|
18
21
|
const typeDefs = mergeTypeDefs(typeList);
|
|
19
22
|
const resolvers = mergeResolvers(resolverList);
|
|
20
23
|
const server = new ApolloServer({
|
|
@@ -24,13 +27,15 @@ if (typeList.length > 0 && resolverList.length > 0) {
|
|
|
24
27
|
defaultMaxAge: 60, //seconds
|
|
25
28
|
},
|
|
26
29
|
cache: 'bounded',
|
|
27
|
-
context: async ({ req }) => ({
|
|
28
|
-
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
29
|
-
}),
|
|
30
30
|
formatError: (err) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
if (Meteor.isProduction === 'production') {
|
|
32
|
+
// Don't give specific errors to the client
|
|
33
|
+
sysLogger.error(err);
|
|
34
|
+
err.message = err.extensions.code; // eslint-disable-line no-param-reassign
|
|
35
|
+
return err;
|
|
36
|
+
}
|
|
37
|
+
console.log(err);
|
|
38
|
+
return err;
|
|
34
39
|
},
|
|
35
40
|
plugins: [
|
|
36
41
|
ApolloServerPluginLandingPageGraphQLPlayground()
|
|
@@ -39,12 +44,15 @@ if (typeList.length > 0 && resolverList.length > 0) {
|
|
|
39
44
|
|
|
40
45
|
const startApolloServer = async(server) => {
|
|
41
46
|
await server.start();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
expressApp.use(
|
|
48
|
+
'/graphql',
|
|
49
|
+
expressMiddleware(server, {
|
|
50
|
+
context: async ({ req }) => ({
|
|
51
|
+
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
52
|
+
}),
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
WebApp.connectHandlers.use(expressApp);
|
|
48
56
|
};
|
|
49
57
|
|
|
50
58
|
startApolloServer(server);
|
|
@@ -72,6 +80,7 @@ const networkInterface = createMeteorNetworkInterface({
|
|
|
72
80
|
const client = new ApolloClient(meteorClientConfig({ networkInterface, ssrMode: true }));<% } %>
|
|
73
81
|
<% if (config.engines.theme === 'material') { %>
|
|
74
82
|
import { ThemeProvider } from '@mui/material/styles';
|
|
83
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
75
84
|
import { theme } from '../lib/index';<% } %>
|
|
76
85
|
// css bundler
|
|
77
86
|
import createEmotionServer from '@emotion/server/create-instance';
|
|
@@ -98,6 +107,7 @@ onPageLoad((sink) => {
|
|
|
98
107
|
renderToStringWithData(
|
|
99
108
|
<ApolloProvider client={client}>
|
|
100
109
|
<ThemeProvider theme={theme}>
|
|
110
|
+
<CssBaseline />
|
|
101
111
|
<App location={sink.request.url} />
|
|
102
112
|
</ThemeProvider>
|
|
103
113
|
</ApolloProvider>
|
|
@@ -110,6 +120,7 @@ onPageLoad((sink) => {
|
|
|
110
120
|
});<% } else { %>
|
|
111
121
|
const html = renderToStaticMarkup(
|
|
112
122
|
<ThemeProvider theme={theme}>
|
|
123
|
+
<CssBaseline />
|
|
113
124
|
<App location={sink.request.url} />
|
|
114
125
|
</ThemeProvider>
|
|
115
126
|
);
|
|
@@ -4,17 +4,20 @@ Meteor.startup(() => {
|
|
|
4
4
|
WebAppInternals.setInlineScriptsAllowed(false);
|
|
5
5
|
});
|
|
6
6
|
<% if (config.engines.graphql === 'apollo') { %>
|
|
7
|
-
import { ApolloServer } from 'apollo
|
|
7
|
+
import { ApolloServer } from '@apollo/server';
|
|
8
8
|
import { WebApp } from 'meteor/webapp';
|
|
9
9
|
import { getUser } from 'meteor/apollo';
|
|
10
10
|
import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge';
|
|
11
11
|
import {
|
|
12
12
|
ApolloServerPluginLandingPageGraphQLPlayground
|
|
13
|
-
} from
|
|
13
|
+
} from '@apollo/server-plugin-landing-page-graphql-playground';
|
|
14
|
+
import { expressMiddleware } from '@apollo/server/express4';
|
|
15
|
+
import express from 'express';
|
|
14
16
|
|
|
15
17
|
const typeList = [];
|
|
16
18
|
const resolverList = [];
|
|
17
19
|
if (typeList.length > 0 && resolverList.length > 0) {
|
|
20
|
+
const expressApp = express();
|
|
18
21
|
const typeDefs = mergeTypeDefs(typeList);
|
|
19
22
|
const resolvers = mergeResolvers(resolverList);
|
|
20
23
|
const server = new ApolloServer({
|
|
@@ -24,12 +27,15 @@ if (typeList.length > 0 && resolverList.length > 0) {
|
|
|
24
27
|
defaultMaxAge: 60, //seconds
|
|
25
28
|
},
|
|
26
29
|
cache: 'bounded',
|
|
27
|
-
context: async ({ req }) => ({
|
|
28
|
-
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
29
|
-
}),
|
|
30
30
|
formatError: (err) => {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (Meteor.isProduction === 'production') {
|
|
32
|
+
// Don't give specific errors to the client
|
|
33
|
+
sysLogger.error(err);
|
|
34
|
+
err.message = err.extensions.code; // eslint-disable-line no-param-reassign
|
|
35
|
+
return err;
|
|
36
|
+
}
|
|
37
|
+
console.log(err);
|
|
38
|
+
return err;
|
|
33
39
|
},
|
|
34
40
|
plugins: [
|
|
35
41
|
ApolloServerPluginLandingPageGraphQLPlayground()
|
|
@@ -38,12 +44,15 @@ if (typeList.length > 0 && resolverList.length > 0) {
|
|
|
38
44
|
|
|
39
45
|
const startApolloServer = async(server) => {
|
|
40
46
|
await server.start();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
expressApp.use(
|
|
48
|
+
'/graphql',
|
|
49
|
+
expressMiddleware(server, {
|
|
50
|
+
context: async ({ req }) => ({
|
|
51
|
+
user: await getUser(req.headers.authorization) || await getUser(req.headers['x-auth-token']) || {},
|
|
52
|
+
}),
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
WebApp.connectHandlers.use(expressApp);
|
|
47
56
|
};
|
|
48
57
|
|
|
49
58
|
startApolloServer(server);
|
|
@@ -71,6 +80,7 @@ const networkInterface = createMeteorNetworkInterface({
|
|
|
71
80
|
const client = new ApolloClient(meteorClientConfig({ networkInterface, ssrMode: true }));<% } %>
|
|
72
81
|
<% if (config.engines.theme === 'material') { %>
|
|
73
82
|
import { ThemeProvider } from '@mui/material/styles';
|
|
83
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
74
84
|
import { theme } from '../lib/index';<% } %>
|
|
75
85
|
// css bundler
|
|
76
86
|
import createEmotionServer from '@emotion/server/create-instance';
|
|
@@ -97,6 +107,7 @@ onPageLoad((sink) => {
|
|
|
97
107
|
renderToStringWithData(
|
|
98
108
|
<ApolloProvider client={client}>
|
|
99
109
|
<ThemeProvider theme={theme}>
|
|
110
|
+
<CssBaseline />
|
|
100
111
|
<App location={sink.request.url} />
|
|
101
112
|
</ThemeProvider>
|
|
102
113
|
</ApolloProvider>
|
|
@@ -109,6 +120,7 @@ onPageLoad((sink) => {
|
|
|
109
120
|
});<% } else { %>
|
|
110
121
|
const html = renderToStaticMarkup(
|
|
111
122
|
<ThemeProvider theme={theme}>
|
|
123
|
+
<CssBaseline />
|
|
112
124
|
<App location={sink.request.url} />
|
|
113
125
|
</ThemeProvider>
|
|
114
126
|
);
|
|
@@ -10,7 +10,7 @@ import { gql } from '@apollo/client';
|
|
|
10
10
|
// https://www.apollographql.com/docs/react/api/react/hoc/#graphqlquery-configcomponent
|
|
11
11
|
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (theme === 'material' ) { %>
|
|
12
12
|
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
13
|
-
import { withStyles } from '@mui/
|
|
13
|
+
import { withStyles } from '@mui/system';
|
|
14
14
|
|
|
15
15
|
const styles = (theme) => { };<% } %>
|
|
16
16
|
<% if (!isStore) { %>
|
|
@@ -10,7 +10,7 @@ import { gql } from '@apollo/client';
|
|
|
10
10
|
// https://www.apollographql.com/docs/react/api/react/hoc/#graphqlquery-configcomponent
|
|
11
11
|
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (theme === 'material' ) { %>
|
|
12
12
|
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
13
|
-
import { withStyles } from '@mui/
|
|
13
|
+
import { withStyles } from '@mui/system';
|
|
14
14
|
|
|
15
15
|
const styles = (theme) => { };<% } %>
|
|
16
16
|
<% if (!isStore && client === 'react') { %>
|
|
@@ -4,10 +4,7 @@ import React, { Component } from 'react';
|
|
|
4
4
|
import { withTracker } from 'meteor/react-meteor-data';<% if(graphql === 'apollo') { %>
|
|
5
5
|
import { gql } from '@apollo/client';
|
|
6
6
|
// https://www.apollographql.com/docs/react/api/react/hoc/#graphqlquery-configcomponent
|
|
7
|
-
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (
|
|
8
|
-
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
9
|
-
import { withStyles } from '@mui/styles';
|
|
10
|
-
const styles = (theme) => { };<% } %><% if (withTranslations) { %>
|
|
7
|
+
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (withTranslations) { %>
|
|
11
8
|
import { withTranslation } from 'react-i18next';<% } %>
|
|
12
9
|
|
|
13
10
|
class <%= className %>Component extends Component {
|
|
@@ -59,8 +56,7 @@ class <%= className %>Component extends Component {
|
|
|
59
56
|
|
|
60
57
|
const <%= className %> = compose(
|
|
61
58
|
withTracker(() => {}),<% if(graphql === 'apollo') { %>
|
|
62
|
-
//graphql(gql`query Todos { todos }`, { variables: {/* input */} }),<% } %><% if(
|
|
63
|
-
withStyles(styles),<% } %><% if (withTranslations) { %>
|
|
59
|
+
//graphql(gql`query Todos { todos }`, { variables: {/* input */} }),<% } %><% if (withTranslations) { %>
|
|
64
60
|
withTranslation(),<% } %>
|
|
65
61
|
)(<%= className %>Component);
|
|
66
62
|
|
|
@@ -4,10 +4,7 @@ import * as PropTypes from 'prop-types';// https://github.com/meteor/react-packa
|
|
|
4
4
|
import { withTracker } from 'meteor/react-meteor-data';<% if(graphql === 'apollo') { %>
|
|
5
5
|
import { gql } from '@apollo/client';
|
|
6
6
|
// https://www.apollographql.com/docs/react/api/react/hoc/#graphqlquery-configcomponent
|
|
7
|
-
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (
|
|
8
|
-
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
9
|
-
import { withStyles } from '@mui/styles';
|
|
10
|
-
const styles = (theme) => { };<% } %><% if (withTranslations) { %>
|
|
7
|
+
import { graphql } from '@apollo/client/react/hoc';<% } %><% if (withTranslations) { %>
|
|
11
8
|
import { withTranslation } from 'react-i18next';<% } %>
|
|
12
9
|
|
|
13
10
|
interface I<%= className %> {
|
|
@@ -64,8 +61,7 @@ class <%= className %>Component extends React.Component<I<%= className %>> {
|
|
|
64
61
|
|
|
65
62
|
const <%= className %> = compose(
|
|
66
63
|
withTracker(() => {}),<% if(graphql === 'apollo') { %>
|
|
67
|
-
//graphql(gql`query Todos { todos }`, { variables: {/* input */} }),<% } %><% if(
|
|
68
|
-
withStyles(styles),<% } %><% if (withTranslations) { %>
|
|
64
|
+
//graphql(gql`query Todos { todos }`, { variables: {/* input */} }),<% } %><% if (withTranslations) { %>
|
|
69
65
|
withTranslation(),<% } %>
|
|
70
66
|
)(<%= className %>Component);
|
|
71
67
|
|
|
@@ -2,10 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
// https://github.com/meteor/react-packages/tree/master/packages/react-meteor-data#usetrackerreactivefn-deps-hook
|
|
3
3
|
import { useTracker } from 'meteor/react-meteor-data';<% if(graphql === 'apollo') { %>
|
|
4
4
|
// https://www.apollographql.com/docs/react/api/react/hooks/#example-2
|
|
5
|
-
import { useQuery, gql } from '@apollo/client';<% } %><%
|
|
6
|
-
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
7
|
-
import { makeStyles } from '@mui/styles';
|
|
8
|
-
const useStyles = makeStyles((theme) => ({}));<% } %><%if (withTranslations) { %>
|
|
5
|
+
import { useQuery, gql } from '@apollo/client';<% } %><%if (withTranslations) { %>
|
|
9
6
|
import { useTranslation } from 'react-i18next';<% } %>
|
|
10
7
|
|
|
11
8
|
|
|
@@ -15,7 +12,6 @@ function <%= className %>(props) {
|
|
|
15
12
|
return { userId }
|
|
16
13
|
});*/<% if(graphql === 'apollo') { %>
|
|
17
14
|
//const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (theme === 'material') { %>
|
|
18
|
-
const classes = useStyles();<% } %><% if (withTranslations) { %>
|
|
19
15
|
const { t } = useTranslation();<% } %>
|
|
20
16
|
|
|
21
17
|
return (
|
|
@@ -2,10 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
// https://github.com/meteor/react-packages/tree/master/packages/react-meteor-data#usetrackerreactivefn-deps-hook
|
|
3
3
|
import { useTracker } from 'meteor/react-meteor-data';<% if(graphql === 'apollo') { %>
|
|
4
4
|
// https://www.apollographql.com/docs/react/api/react/hooks/#example-2
|
|
5
|
-
import { useQuery, gql } from '@apollo/client';<% } %><%
|
|
6
|
-
// https://material-ui.com/styles/basics/#higher-order-component-api
|
|
7
|
-
import { makeStyles } from '@mui/styles';
|
|
8
|
-
const useStyles = makeStyles((theme) => ({}));<% } %><%if (withTranslations) { %>
|
|
5
|
+
import { useQuery, gql } from '@apollo/client';<% } %><%if (withTranslations) { %>
|
|
9
6
|
import { useTranslation } from 'react-i18next';<% } %>
|
|
10
7
|
|
|
11
8
|
function <%= className %>(props) {
|
|
@@ -14,7 +11,6 @@ function <%= className %>(props) {
|
|
|
14
11
|
return { userId }
|
|
15
12
|
});*/<% if(graphql === 'apollo') { %>
|
|
16
13
|
// const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (theme === 'material') { %>
|
|
17
|
-
const classes = useStyles();<% } %><% if (withTranslations) { %>
|
|
18
14
|
const { t } = useTranslation();<% } %>
|
|
19
15
|
|
|
20
16
|
return (
|