@simitgroup/simpleapp-generator 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +13 -10
  2. package/backend1/.env +5 -0
  3. package/backend1/.eslintrc.js +25 -0
  4. package/backend1/.prettierrc +4 -0
  5. package/backend1/README.md +73 -0
  6. package/backend1/nest-cli.json +8 -0
  7. package/backend1/package.json +75 -0
  8. package/backend1/pnpm-lock.yaml +5459 -0
  9. package/backend1/src/app.controller.js +71 -0
  10. package/backend1/src/app.controller.js.map +1 -0
  11. package/backend1/src/app.controller.spec.js +21 -0
  12. package/backend1/src/app.controller.spec.js.map +1 -0
  13. package/backend1/src/app.controller.spec.ts +22 -0
  14. package/backend1/src/app.controller.ts +12 -0
  15. package/backend1/src/app.module.js +67 -0
  16. package/backend1/src/app.module.js.map +1 -0
  17. package/backend1/src/app.module.ts +10 -0
  18. package/backend1/src/app.service.js +64 -0
  19. package/backend1/src/app.service.js.map +1 -0
  20. package/backend1/src/app.service.ts +8 -0
  21. package/backend1/src/class/SimpleAppController.js +38 -0
  22. package/backend1/src/class/SimpleAppController.js.map +1 -0
  23. package/backend1/src/class/SimpleAppController.ts +69 -0
  24. package/backend1/src/class/SimpleAppService.js +264 -0
  25. package/backend1/src/class/SimpleAppService.js.map +1 -0
  26. package/backend1/src/class/SimpleAppService.ts +213 -0
  27. package/backend1/src/main.js +22 -0
  28. package/backend1/src/main.js.map +1 -0
  29. package/backend1/src/main.ts +20 -0
  30. package/backend1/test/app.e2e-spec.js +45 -0
  31. package/backend1/test/app.e2e-spec.js.map +1 -0
  32. package/backend1/test/app.e2e-spec.ts +24 -0
  33. package/backend1/test/jest-e2e.json +9 -0
  34. package/backend1/tsconfig.build.json +4 -0
  35. package/backend1/tsconfig.json +1 -0
  36. package/dist/createproject.js +6 -1
  37. package/dist/createproject.js.map +1 -1
  38. package/dist/framework.js +161 -0
  39. package/dist/framework.js.map +1 -0
  40. package/dist/generate.js +2 -2
  41. package/dist/generate.js.map +1 -1
  42. package/dist/index.js +54 -58
  43. package/dist/index.js.map +1 -1
  44. package/dist/index2.js +118 -0
  45. package/dist/index2.js.map +1 -0
  46. package/dist/installdependency.js +20 -0
  47. package/dist/installdependency.js.map +1 -0
  48. package/dist/installnest.js +2 -0
  49. package/dist/installnest.js.map +1 -0
  50. package/dist/installnuxt.js +2 -0
  51. package/dist/installnuxt.js.map +1 -0
  52. package/dist/validation.js +2 -0
  53. package/dist/validation.js.map +1 -0
  54. package/frontend1/README.md +63 -0
  55. package/frontend1/app.vue +8 -0
  56. package/frontend1/assets/css/tailwind.css +28 -0
  57. package/frontend1/components/CrudSimple.vue +112 -0
  58. package/frontend1/components/DebugDocumentData.vue +20 -0
  59. package/frontend1/components/EventMonitor.vue +79 -0
  60. package/frontend1/components/Menus.vue +18 -0
  61. package/frontend1/layouts/default.vue +10 -0
  62. package/frontend1/nuxt.config.js +42 -0
  63. package/frontend1/nuxt.config.js.map +1 -0
  64. package/frontend1/nuxt.config.ts +42 -0
  65. package/frontend1/package-lock.json +11877 -0
  66. package/frontend1/package.json +38 -0
  67. package/frontend1/pages/index.vue +3 -0
  68. package/frontend1/plugins/simpleapp.js +73 -0
  69. package/frontend1/plugins/simpleapp.js.map +1 -0
  70. package/frontend1/plugins/simpleapp.ts +73 -0
  71. package/frontend1/pnpm-lock.yaml +8339 -0
  72. package/frontend1/public/favicon.ico +0 -0
  73. package/frontend1/server/api/[...].js +117 -0
  74. package/frontend1/server/api/[...].js.map +1 -0
  75. package/frontend1/server/api/[...].ts +131 -0
  76. package/frontend1/server/tsconfig.json +3 -0
  77. package/frontend1/tailwind.config.js +10 -0
  78. package/frontend1/tailwind.config.js.map +1 -0
  79. package/frontend1/tailwind.config.ts +9 -0
  80. package/frontend1/tsconfig.json +4 -0
  81. package/openapitools.json +0 -0
  82. package/package.json +2 -6
  83. package/sampleconfig.json +2 -2
  84. package/src/createproject.ts +5 -0
  85. package/src/framework.ts +133 -0
  86. package/src/generate.ts +2 -2
  87. package/src/index.ts +38 -69
  88. package/src/index2.ts +132 -0
  89. package/src/installdependency.sh +5 -0
  90. package/src/installdependency.ts +4 -0
  91. package/src/installnest.ts +0 -0
  92. package/src/installnuxt.ts +0 -0
  93. package/src/validation.ts +0 -0
  94. package/templates/basic/pageindex.vue.eta +9 -9
  95. package/templates/nuxt/plugins.simpleapp.ts.eta +3 -3
@@ -0,0 +1,63 @@
1
+ # Nuxt 3 Minimal Starter
2
+
3
+ Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4
+
5
+ ## Setup
6
+
7
+ Make sure to install the dependencies:
8
+
9
+ ```bash
10
+ # npm
11
+ npm install
12
+
13
+ # pnpm
14
+ pnpm install
15
+
16
+ # yarn
17
+ yarn install
18
+ ```
19
+
20
+ ## Development Server
21
+
22
+ Start the development server on `http://localhost:3000`:
23
+
24
+ ```bash
25
+ # npm
26
+ npm run dev
27
+
28
+ # pnpm
29
+ pnpm run dev
30
+
31
+ # yarn
32
+ yarn dev
33
+ ```
34
+
35
+ ## Production
36
+
37
+ Build the application for production:
38
+
39
+ ```bash
40
+ # npm
41
+ npm run build
42
+
43
+ # pnpm
44
+ pnpm run build
45
+
46
+ # yarn
47
+ yarn build
48
+ ```
49
+
50
+ Locally preview production build:
51
+
52
+ ```bash
53
+ # npm
54
+ npm run preview
55
+
56
+ # pnpm
57
+ pnpm run preview
58
+
59
+ # yarn
60
+ yarn preview
61
+ ```
62
+
63
+ Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <div>
3
+ <NuxtLayout>
4
+ <EventMonitor/>
5
+ <NuxtPage />
6
+ </NuxtLayout>
7
+ </div>
8
+ </template>
@@ -0,0 +1,28 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ button {
6
+ @apply p-2 border-2
7
+ }
8
+
9
+ .input-error{
10
+ @apply text-red-500
11
+ }
12
+ .simpleapp-tool-bar button{
13
+ margin-right: 1rem;
14
+ }
15
+
16
+ .bg-primary{
17
+ @apply bg-green-600 text-white
18
+
19
+ }
20
+ .bg-default{
21
+ @apply bg-white
22
+ }
23
+ .bg-danger{
24
+ @apply bg-red-500 text-white
25
+ }
26
+ .bg-warning{
27
+ @apply bg-orange-600 text-white
28
+ }
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div class="simpleapp-crudsimple">
3
+ <button class="bg-primary" type="reset" @click="newData">New</button>
4
+
5
+
6
+ <SimpleAppDatatable
7
+ @row-dblclick="editRecord"
8
+ v-model="recordlist"
9
+ :setting="{}"
10
+ :columns="listColumns"
11
+ ></SimpleAppDatatable>
12
+
13
+ <DebugDocumentData v-model="data"/>
14
+ </div>
15
+
16
+ <Dialog v-model:visible="visible" modal header="Header" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
17
+ <SimpleAppForm :document="obj" :title="title" #default="o">
18
+ <div class="simpleapp-tool-bar" >
19
+ <button class="bg-default" :disabled="disabled" @click="newData" type="reset">New</button>
20
+ <button class="bg-primary" :disabled="disabled" @click="saveData" type="submit">Save</button>
21
+ <button class="bg-danger" :disabled="disabled" @click="deleteData($event)">Delete</button>
22
+ <ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
23
+ <ConfirmPopup></ConfirmPopup>
24
+ </div>
25
+ <slot :data="o.data" :getField="o.getField" name="default"></slot>
26
+ </SimpleAppForm>
27
+ </Dialog>
28
+ </template>
29
+ <script setup lang="ts">
30
+
31
+ import { SimpleAppClient } from '@simitgroup//simpleapp-vue-component/src/SimpleAppClient';
32
+ import SimpleAppForm from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppForm.vue';
33
+ import SimpleAppDatatable from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppDatatable.vue';
34
+ import Dialog from 'primevue/dialog';
35
+ import axios from 'axios'
36
+ import ProgressSpinner from 'primevue/progressspinner';
37
+
38
+ import ConfirmPopup from 'primevue/confirmpopup';
39
+ import { useConfirm } from "primevue/useconfirm";
40
+
41
+ const confirm = useConfirm();
42
+ const props = defineProps<{
43
+ document:SimpleAppClient<any,any>
44
+ listColumns:string[]
45
+ title:string
46
+ }>()
47
+ const visible = ref(false)
48
+ const obj = props.document
49
+ const data = obj.getReactiveData()
50
+ const disabled=ref(false)
51
+ const recordlist = ref();
52
+ const setCsrf=()=>{
53
+ // const { csrf } = useCsrf()
54
+ // console.log('csrf',csrf)
55
+ // axios.defaults.headers.common = {
56
+ // "X-CSRF-TOKEN": csrf
57
+ // };
58
+ }
59
+
60
+ const refresh = () => {
61
+ obj.list().then((res:any) => {
62
+ recordlist.value = res;
63
+ disabled.value=false
64
+ });
65
+ };
66
+ const newData = () => {
67
+ obj.setNew()
68
+ setCsrf()
69
+ visible.value=true;
70
+ };
71
+
72
+ const editRecord = (event: any) => {
73
+ obj.getById(event.data._id);
74
+ setCsrf()
75
+ visible.value=true
76
+ };
77
+
78
+ const saveData = () => {
79
+ disabled.value=true
80
+ if (data.value._id == "") {
81
+ obj.create().then(()=>{visible.value=false}).catch(()=>setCsrf()).finally(() => refresh());
82
+ } else {
83
+ obj.update().then(()=>visible.value=false).catch(()=>setCsrf()).finally(() => refresh());
84
+ }
85
+ };
86
+ const deleteData = (event:Event) => {
87
+
88
+ confirm.require({
89
+ target: event.currentTarget as HTMLElement,
90
+ message:'Delete?',
91
+ icon: 'pi pi-exclamation-triangle',
92
+ acceptClass: 'p-button-danger',
93
+ accept: ()=>{
94
+ disabled.value=true
95
+ obj.delete(data.value._id ?? "").then(()=>visible.value=false).finally(() => {
96
+ refresh();
97
+ });
98
+ },
99
+ reject: () => {
100
+ setCsrf()
101
+ console.log("Cancel delete")
102
+ }
103
+ })
104
+
105
+ };
106
+ refresh();
107
+ </script>
108
+ <style scoped>
109
+ .crudsimple-dialog{
110
+ z-index: 100;
111
+ }
112
+ </style>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div class="floatright">
3
+ <h3>data in json</h3>
4
+ <pre>
5
+ {{ modelValue }}
6
+ </pre>
7
+ </div>
8
+ </template>
9
+ <script setup lang="ts">
10
+ const modelValue = defineModel()
11
+ </script>
12
+ <style scoped>
13
+ .floatright{
14
+ position: fixed;
15
+ right: 0;
16
+ background-color: antiquewhite;
17
+ font-size: large;
18
+ top: 0;
19
+ }
20
+ </style>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <Toast group="default"/>
3
+ <Toast group="list">
4
+ <template #message="p">
5
+ <ol>
6
+ <li v-for="(item,index) in p.message.detail" :key="index">{{item.instancePath}} {{ item.message }}</li>
7
+ </ol>
8
+ </template>
9
+ </Toast>
10
+ </template>
11
+ <script setup lang="ts">
12
+
13
+ import { useToast, } from 'primevue/usetoast';
14
+ import type { ToastMessageOptions } from 'primevue/toast';
15
+ import Toast from 'primevue/toast';
16
+ import { stringify } from 'ajv';
17
+ const toast = useToast();
18
+ const { $event,$listen } = useNuxtApp()
19
+ let resmsg:ToastMessageOptions = {} as ToastMessageOptions
20
+
21
+ $listen('*',(type:string,data:any)=>{
22
+
23
+
24
+ let duration = 3000
25
+ let severity:typeof resmsg['severity']
26
+ let isshow=true
27
+ let toastgroup='default'
28
+ if(type.indexOf('error')>=0){
29
+ duration = 0
30
+ severity='error'
31
+
32
+ }
33
+ else if(type.indexOf('warn')>=0){
34
+ duration = 10000
35
+ severity='warn'
36
+ }
37
+ else if(type.indexOf('info')>=0){
38
+ duration = 3000
39
+ severity='info'
40
+ isshow=false
41
+ }
42
+ else if(type.indexOf('success')>=0){
43
+ duration = 3000
44
+ severity='success'
45
+ }
46
+ if(Array.isArray(data)){
47
+ toastgroup='list'
48
+ }
49
+ // let msg:string=prepareMsg(data,severity?.toString()??'')
50
+
51
+ if(isshow){
52
+ toast.removeAllGroups()
53
+ resmsg = { severity: severity, summary: type, detail :data, life: duration, group:toastgroup}
54
+ toast.add(resmsg)
55
+ }
56
+
57
+
58
+ })
59
+ const prepareMsg=(data:any,msgtype:string):string=>{
60
+ let res : string =''
61
+
62
+ if(typeof data == 'string'){
63
+ res = data
64
+ }else if(Array.isArray(data)){
65
+ res+='<ul>'
66
+ for(let i=0;i<data.length;i++){
67
+ const d=data[i]
68
+ res+= '<li>'+d['instancePath']+':'+(d['message']?? JSON.stringify(d))+'</li>'
69
+ }
70
+ res+='</ul>'
71
+ }else if(typeof data =='object'){
72
+ res=JSON.stringify(data)
73
+ }
74
+ return res
75
+
76
+
77
+ }
78
+
79
+ </script>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <header>
3
+ <!-- <MegaMenu :model="getMenus()" orientation="horizontal" /> -->
4
+ <Menubar :model="getMenus()">
5
+ <template #start>
6
+ <h1>[Logo Container]</h1>
7
+ </template>
8
+ <template #end>
9
+ <InputText placeholder="Search" type="text" />
10
+ </template>
11
+ </Menubar>
12
+ </header>
13
+ </template>
14
+ <script setup lang="ts">
15
+ // import MegaMenu from 'primevue/megamenu';
16
+ import Menubar from 'primevue/menubar';
17
+
18
+ </script>
@@ -0,0 +1,10 @@
1
+
2
+ <template>
3
+ <div>
4
+ <Menus />
5
+ <slot></slot>
6
+ </div>
7
+ </template>
8
+ <script lang="ts" setup>
9
+ import Menus from '~/components/Menus.vue'
10
+ </script>
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = defineNuxtConfig({
4
+ // colorMode: {} ,
5
+ runtimeConfig: {
6
+ public: {
7
+ SIMPLEAPP_BACKEND_URL: process.env.SIMPLEAPP_BACKEND_URL,
8
+ APP_URL: process.env.APP_URL,
9
+ }
10
+ },
11
+ vite: {
12
+ vue: {
13
+ script: {
14
+ defineModel: true,
15
+ propsDestructure: true
16
+ }
17
+ }
18
+ },
19
+ tailwindcss: {
20
+ // Options
21
+ },
22
+ modules: [
23
+ // '@sidebase/nuxt-auth',
24
+ "nuxt-security",
25
+ '@nuxtjs/tailwindcss',
26
+ '@vueuse/nuxt',
27
+ // '@nuxtjs/color-mode'
28
+ ],
29
+ ssr: true,
30
+ security: {
31
+ csrf: true,
32
+ },
33
+ css: [
34
+ "primevue/resources/themes/lara-light-blue/theme.css",
35
+ 'primeicons/primeicons.css'
36
+ ],
37
+ devtools: { enabled: true },
38
+ build: {
39
+ transpile: ["primevue"]
40
+ },
41
+ });
42
+ //# sourceMappingURL=nuxt.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.config.js","sourceRoot":"","sources":["nuxt.config.ts"],"names":[],"mappings":";;AAAA,kBAAe,gBAAgB,CAAC;IAC9B,qBAAqB;IACrB,aAAa,EAAC;QACZ,MAAM,EAAC;YACL,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YACxD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO;SAC7B;KACF;IACD,IAAI,EAAE;QACJ,GAAG,EAAE;YACD,MAAM,EAAE;gBACJ,WAAW,EAAE,IAAI;gBACjB,gBAAgB,EAAE,IAAI;aACzB;SACJ;KACJ;IACD,WAAW,EAAE;IACT,UAAU;KACX;IACD,OAAO,EAAE;QACX,4BAA4B;QACxB,eAAe;QACf,qBAAqB;QACrB,cAAc;QACd,uBAAuB;KAExB;IACD,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI;KACX;IACD,GAAG,EAAE;QACH,qDAAqD;QACrD,2BAA2B;KAC5B;IACD,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC3B,KAAK,EAAE;QACO,SAAS,EAAE,CAAC,UAAU,CAAC;KAC9B;CAGR,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ export default defineNuxtConfig({
2
+ // colorMode: {} ,
3
+ runtimeConfig:{
4
+ public:{
5
+ SIMPLEAPP_BACKEND_URL: process.env.SIMPLEAPP_BACKEND_URL,
6
+ APP_URL: process.env.APP_URL,
7
+ }
8
+ },
9
+ vite: {
10
+ vue: {
11
+ script: {
12
+ defineModel: true,
13
+ propsDestructure: true
14
+ }
15
+ }
16
+ },
17
+ tailwindcss: {
18
+ // Options
19
+ },
20
+ modules: [
21
+ // '@sidebase/nuxt-auth',
22
+ "nuxt-security",
23
+ '@nuxtjs/tailwindcss',
24
+ '@vueuse/nuxt',
25
+ // '@nuxtjs/color-mode'
26
+
27
+ ],
28
+ ssr: true,
29
+ security: {
30
+ csrf: true,
31
+ },
32
+ css: [
33
+ "primevue/resources/themes/lara-light-blue/theme.css",
34
+ 'primeicons/primeicons.css'
35
+ ],
36
+ devtools: { enabled: true },
37
+ build: {
38
+ transpile: ["primevue"]
39
+ },
40
+
41
+
42
+ })