@vc-shell/create-vc-app 1.2.4-beta.8 → 2.0.0-alpha.0

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 (165) hide show
  1. package/README.md +44 -74
  2. package/dist/commands/add-module.d.ts +2 -0
  3. package/dist/commands/add-module.d.ts.map +1 -0
  4. package/dist/commands/init.d.ts +2 -0
  5. package/dist/commands/init.d.ts.map +1 -0
  6. package/dist/engine/codegen.d.ts +9 -0
  7. package/dist/engine/codegen.d.ts.map +1 -0
  8. package/dist/engine/helpers.d.ts +19 -0
  9. package/dist/engine/helpers.d.ts.map +1 -0
  10. package/dist/engine/template.d.ts +21 -0
  11. package/dist/engine/template.d.ts.map +1 -0
  12. package/dist/index.js +355 -526
  13. package/dist/output.d.ts +4 -0
  14. package/dist/output.d.ts.map +1 -0
  15. package/dist/templates/dynamic-module/_gitignore +4 -0
  16. package/dist/templates/dynamic-module/_package.json.ejs +26 -0
  17. package/dist/templates/dynamic-module/src/modules/index.ts.ejs +5 -0
  18. package/dist/templates/dynamic-module/tsconfig.json +14 -0
  19. package/dist/templates/dynamic-module/vite.config.mts.ejs +3 -0
  20. package/dist/templates/{base/_env → host-app/_env.ejs} +1 -1
  21. package/dist/templates/{base/_package.json → host-app/_package.json.ejs} +7 -7
  22. package/dist/templates/{base/index.html → host-app/index.html.ejs} +1 -1
  23. package/dist/templates/{base/src/bootstrap.ts → host-app/src/bootstrap.ts.ejs} +6 -3
  24. package/dist/templates/{base/src/main.ts → host-app/src/main.ts.ejs} +7 -5
  25. package/dist/templates/{base/src/pages/App.vue → host-app/src/pages/App.vue.ejs} +1 -1
  26. package/dist/templates/host-app/src/pages/Platform.vue +19 -0
  27. package/dist/templates/host-app/src/router/routes.ts.ejs +107 -0
  28. package/dist/templates/host-app/vite.config.mts.ejs +7 -0
  29. package/dist/templates/module/composables/index.ts.ejs +2 -0
  30. package/dist/templates/module/composables/useDetails.ts.ejs +38 -0
  31. package/dist/templates/module/composables/useList.ts.ejs +43 -0
  32. package/dist/templates/module/locales/en.json.ejs +22 -0
  33. package/dist/templates/module/pages/details.vue.ejs +111 -0
  34. package/dist/templates/module/pages/index.ts.ejs +2 -0
  35. package/dist/templates/module/pages/list.vue.ejs +117 -0
  36. package/dist/templates/{sample/classic-module → sample-module}/pages/details.vue +2 -2
  37. package/dist/templates/{sample/classic-module → sample-module}/pages/list.vue +3 -3
  38. package/dist/templates/standalone/LICENSE +12 -0
  39. package/dist/templates/standalone/README.md +54 -0
  40. package/dist/templates/standalone/_browserslistrc +3 -0
  41. package/dist/templates/standalone/_commitlintrc.json +3 -0
  42. package/dist/templates/standalone/_editorconfig +22 -0
  43. package/dist/templates/standalone/_env.ejs +3 -0
  44. package/dist/templates/standalone/_env.local.ejs +1 -0
  45. package/dist/templates/standalone/_eslintignore +3 -0
  46. package/dist/templates/standalone/_eslintrc.js +41 -0
  47. package/dist/templates/standalone/_github/COMMIT_CONVENTION.md +91 -0
  48. package/dist/templates/standalone/_github/PULL_REQUEST_TEMPLATE.md +8 -0
  49. package/dist/templates/standalone/_gitignore +71 -0
  50. package/dist/templates/standalone/_package.json.ejs +70 -0
  51. package/dist/templates/standalone/_prettierignore +4 -0
  52. package/dist/templates/standalone/_prettierrc +4 -0
  53. package/dist/templates/standalone/_vscode/extensions.json +14 -0
  54. package/dist/templates/standalone/_vscode/settings.json +14 -0
  55. package/dist/templates/standalone/_yarn/releases/yarn-4.9.1.cjs +948 -0
  56. package/dist/templates/standalone/_yarnrc.yml +7 -0
  57. package/dist/templates/standalone/index.html.ejs +26 -0
  58. package/dist/templates/standalone/postcss.config.cjs +6 -0
  59. package/dist/templates/standalone/public/assets/1.jpeg +0 -0
  60. package/dist/templates/standalone/public/assets/2.jpg +0 -0
  61. package/dist/templates/standalone/public/assets/3.jpg +0 -0
  62. package/dist/templates/standalone/public/assets/app-select.svg +11 -0
  63. package/dist/templates/standalone/public/assets/avatar.jpg +0 -0
  64. package/dist/templates/standalone/public/assets/background.jpg +0 -0
  65. package/dist/templates/standalone/public/assets/empty.png +0 -0
  66. package/dist/templates/standalone/public/assets/logo-white.svg +21 -0
  67. package/dist/templates/standalone/public/assets/logo.svg +8 -0
  68. package/dist/templates/standalone/public/assets/welcome.png +0 -0
  69. package/dist/templates/standalone/public/img/icons/apple-touch-icon.png +0 -0
  70. package/dist/templates/standalone/public/img/icons/favicon-16x16.png +0 -0
  71. package/dist/templates/standalone/public/img/icons/favicon-32x32.png +0 -0
  72. package/dist/templates/standalone/public/img/icons/favicon.ico +0 -0
  73. package/dist/templates/standalone/public/img/icons/mstile-150x150.png +0 -0
  74. package/dist/templates/standalone/public/img/icons/safari-pinned-tab.svg +32 -0
  75. package/dist/templates/standalone/src/api_client/README.md +199 -0
  76. package/dist/templates/standalone/src/bootstrap.ts.ejs +26 -0
  77. package/dist/templates/standalone/src/components/dashboard-widgets/Welcome.vue +51 -0
  78. package/dist/templates/standalone/src/composables/index.ts +1 -0
  79. package/dist/templates/standalone/src/env.d.ts +9 -0
  80. package/dist/templates/standalone/src/locales/en.json +16 -0
  81. package/dist/templates/standalone/src/locales/index.ts +2 -0
  82. package/dist/templates/{sample/overrides/main.ts → standalone/src/main.ts.ejs} +22 -9
  83. package/dist/templates/standalone/src/pages/App.vue.ejs +38 -0
  84. package/dist/templates/standalone/src/pages/Dashboard.vue.ejs +7 -0
  85. package/dist/templates/standalone/src/router/index.ts +10 -0
  86. package/dist/templates/{base/src/router/routes.ts → standalone/src/router/routes.ts.ejs} +27 -7
  87. package/dist/templates/standalone/src/shims-vue.d.ts +27 -0
  88. package/dist/templates/standalone/src/styles/custom.scss +116 -0
  89. package/dist/templates/standalone/src/styles/index.scss +8 -0
  90. package/dist/templates/standalone/src/vue-i18n.d.ts +10 -0
  91. package/dist/templates/standalone/tailwind.config.ts +7 -0
  92. package/dist/templates/standalone/tsconfig.json +16 -0
  93. package/dist/templates/standalone/yarn.lock +0 -0
  94. package/dist/types.d.ts +23 -0
  95. package/dist/types.d.ts.map +1 -0
  96. package/package.json +7 -4
  97. package/dist/templates/modules/classic-module/composables/index.ts +0 -2
  98. package/dist/templates/modules/classic-module/composables/use{{ModuleNamePascalCase}}Details/index.ts +0 -24
  99. package/dist/templates/modules/classic-module/composables/use{{ModuleNamePascalCase}}List/index.ts +0 -47
  100. package/dist/templates/modules/classic-module/locales/en.json +0 -37
  101. package/dist/templates/modules/classic-module/pages/details.vue +0 -87
  102. package/dist/templates/modules/classic-module/pages/list.vue +0 -257
  103. package/dist/templates/sample/classic-module/pages/index.ts +0 -2
  104. /package/dist/templates/{base → host-app}/LICENSE +0 -0
  105. /package/dist/templates/{base → host-app}/README.md +0 -0
  106. /package/dist/templates/{base → host-app}/_browserslistrc +0 -0
  107. /package/dist/templates/{base → host-app}/_commitlintrc.json +0 -0
  108. /package/dist/templates/{base → host-app}/_editorconfig +0 -0
  109. /package/dist/templates/{base/_env.local → host-app/_env.local.ejs} +0 -0
  110. /package/dist/templates/{base → host-app}/_eslintignore +0 -0
  111. /package/dist/templates/{base → host-app}/_eslintrc.js +0 -0
  112. /package/dist/templates/{base → host-app}/_github/COMMIT_CONVENTION.md +0 -0
  113. /package/dist/templates/{base → host-app}/_github/PULL_REQUEST_TEMPLATE.md +0 -0
  114. /package/dist/templates/{base → host-app}/_gitignore +0 -0
  115. /package/dist/templates/{base → host-app}/_prettierignore +0 -0
  116. /package/dist/templates/{base → host-app}/_prettierrc +0 -0
  117. /package/dist/templates/{base → host-app}/_vscode/extensions.json +0 -0
  118. /package/dist/templates/{base → host-app}/_vscode/settings.json +0 -0
  119. /package/dist/templates/{base → host-app}/_yarn/releases/yarn-4.9.1.cjs +0 -0
  120. /package/dist/templates/{base → host-app}/_yarnrc.yml +0 -0
  121. /package/dist/templates/{base → host-app}/postcss.config.cjs +0 -0
  122. /package/dist/templates/{base → host-app}/public/assets/1.jpeg +0 -0
  123. /package/dist/templates/{base → host-app}/public/assets/2.jpg +0 -0
  124. /package/dist/templates/{base → host-app}/public/assets/3.jpg +0 -0
  125. /package/dist/templates/{base → host-app}/public/assets/app-select.svg +0 -0
  126. /package/dist/templates/{base → host-app}/public/assets/avatar.jpg +0 -0
  127. /package/dist/templates/{base → host-app}/public/assets/background.jpg +0 -0
  128. /package/dist/templates/{base → host-app}/public/assets/empty.png +0 -0
  129. /package/dist/templates/{base → host-app}/public/assets/logo-white.svg +0 -0
  130. /package/dist/templates/{base → host-app}/public/assets/logo.svg +0 -0
  131. /package/dist/templates/{base → host-app}/public/assets/welcome.png +0 -0
  132. /package/dist/templates/{base → host-app}/public/img/icons/apple-touch-icon.png +0 -0
  133. /package/dist/templates/{base → host-app}/public/img/icons/favicon-16x16.png +0 -0
  134. /package/dist/templates/{base → host-app}/public/img/icons/favicon-32x32.png +0 -0
  135. /package/dist/templates/{base → host-app}/public/img/icons/favicon.ico +0 -0
  136. /package/dist/templates/{base → host-app}/public/img/icons/mstile-150x150.png +0 -0
  137. /package/dist/templates/{base → host-app}/public/img/icons/safari-pinned-tab.svg +0 -0
  138. /package/dist/templates/{base → host-app}/src/api_client/README.md +0 -0
  139. /package/dist/templates/{base → host-app}/src/components/dashboard-widgets/Welcome.vue +0 -0
  140. /package/dist/templates/{base → host-app}/src/composables/index.ts +0 -0
  141. /package/dist/templates/{base → host-app}/src/env.d.ts +0 -0
  142. /package/dist/templates/{base → host-app}/src/locales/en.json +0 -0
  143. /package/dist/templates/{base → host-app}/src/locales/index.ts +0 -0
  144. /package/dist/templates/{base/src/pages/Dashboard.vue → host-app/src/pages/Dashboard.vue.ejs} +0 -0
  145. /package/dist/templates/{base → host-app}/src/router/index.ts +0 -0
  146. /package/dist/templates/{base → host-app}/src/shims-vue.d.ts +0 -0
  147. /package/dist/templates/{base → host-app}/src/styles/custom.scss +0 -0
  148. /package/dist/templates/{base → host-app}/src/styles/index.scss +0 -0
  149. /package/dist/templates/{base → host-app}/src/vue-i18n.d.ts +0 -0
  150. /package/dist/templates/{base → host-app}/tailwind.config.ts +0 -0
  151. /package/dist/templates/{base → host-app}/tsconfig.json +0 -0
  152. /package/dist/templates/{base → host-app}/yarn.lock +0 -0
  153. /package/dist/templates/{modules/classic-module/index.ts → module/index.ts.ejs} +0 -0
  154. /package/dist/templates/{modules/classic-module → module}/locales/index.ts +0 -0
  155. /package/dist/templates/{sample/classic-module → sample-module}/composables/index.ts +0 -0
  156. /package/dist/templates/{sample/classic-module → sample-module}/composables/useDetails/index.ts +0 -0
  157. /package/dist/templates/{sample/classic-module → sample-module}/composables/useList/index.ts +0 -0
  158. /package/dist/templates/{sample/classic-module → sample-module}/index.ts +0 -0
  159. /package/dist/templates/{sample/classic-module → sample-module}/locales/en.json +0 -0
  160. /package/dist/templates/{sample/classic-module → sample-module}/locales/index.ts +0 -0
  161. /package/dist/templates/{modules/classic-module → sample-module}/pages/index.ts +0 -0
  162. /package/dist/templates/{mocks → sample-module}/sample-data/constants.ts +0 -0
  163. /package/dist/templates/{mocks → sample-module}/sample-data/index.ts +0 -0
  164. /package/dist/templates/{mocks → sample-module}/sample-data/methods.ts +0 -0
  165. /package/dist/templates/{base/vite.config.mts → standalone/vite.config.mts.ejs} +0 -0
@@ -1,28 +1,53 @@
1
1
  import { RouteRecordRaw } from "vue-router";
2
2
  import App from "../pages/App.vue";
3
+ <% if (dashboard) { %>
3
4
  import Dashboard from "../pages/Dashboard.vue";
5
+ <% } %>
4
6
  import { Invite, Login, ResetPassword, ForgotPassword, ChangePasswordPage } from "@vc-shell/framework";
5
7
  // eslint-disable-next-line import/no-unresolved
6
8
  import whiteLogoImage from "/assets/logo-white.svg";
7
9
  // eslint-disable-next-line import/no-unresolved
8
10
  import bgImage from "/assets/background.jpg";
9
11
 
12
+ <% if (tenantRoutes) { %>
13
+ const tenantIdRegex = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
14
+ <% } %>
15
+
10
16
  export const routes: RouteRecordRaw[] = [
11
17
  {
18
+ <% if (tenantRoutes) { %>
19
+ path: `/:tenantId(${tenantIdRegex})?`,
20
+ <% } else { %>
12
21
  path: "/",
22
+ <% } %>
13
23
  component: App,
14
24
  name: "App",
15
25
  meta: {
16
26
  root: true,
17
27
  },
18
28
  children: [
29
+ <% if (dashboard) { %>
19
30
  {
20
31
  name: "Dashboard",
21
32
  path: "",
22
- alias: `/`,
33
+ <% if (tenantRoutes) { %>
34
+ alias: `/:tenantId(${tenantIdRegex})?`,
35
+ <% } else { %>
36
+ alias: "/",
37
+ <% } %>
23
38
  component: Dashboard,
24
39
  },
40
+ <% } %>
25
41
  ],
42
+ <% if (tenantRoutes) { %>
43
+ beforeEnter: (to) => {
44
+ const { tenantId } = to.params;
45
+ if (!tenantId || new RegExp(tenantIdRegex).test(tenantId as string)) {
46
+ return true;
47
+ }
48
+ return { path: "/" };
49
+ },
50
+ <% } %>
26
51
  },
27
52
  {
28
53
  name: "Login",
@@ -30,8 +55,7 @@ export const routes: RouteRecordRaw[] = [
30
55
  component: Login,
31
56
  props: () => ({
32
57
  logo: whiteLogoImage,
33
- // background: bgImage,
34
- title: "{{AppNameSentenceCase}}",
58
+ title: "<%- AppNameSentenceCase %>",
35
59
  }),
36
60
  },
37
61
  {
@@ -43,7 +67,6 @@ export const routes: RouteRecordRaw[] = [
43
67
  token: _route.query.token,
44
68
  userName: _route.query.userName,
45
69
  logo: whiteLogoImage,
46
- // background: bgImage,
47
70
  }),
48
71
  },
49
72
  {
@@ -55,7 +78,6 @@ export const routes: RouteRecordRaw[] = [
55
78
  token: _route.query.token,
56
79
  userName: _route.query.userName,
57
80
  logo: whiteLogoImage,
58
- // background: bgImage,
59
81
  }),
60
82
  },
61
83
  {
@@ -64,7 +86,6 @@ export const routes: RouteRecordRaw[] = [
64
86
  component: ForgotPassword,
65
87
  props: () => ({
66
88
  logo: whiteLogoImage,
67
- // background: bgImage,
68
89
  }),
69
90
  },
70
91
  {
@@ -77,7 +98,6 @@ export const routes: RouteRecordRaw[] = [
77
98
  props: (_route) => ({
78
99
  forced: _route.meta.forced,
79
100
  logo: whiteLogoImage,
80
- // background: bgImage,
81
101
  }),
82
102
  },
83
103
  ];
@@ -0,0 +1,27 @@
1
+ /* eslint-disable */
2
+
3
+ import { CoreBladeAdditionalSettings } from "@vc-shell/framework";
4
+ import type { Ref } from "vue";
5
+ import type { Composer } from "vue-i18n";
6
+
7
+ declare module "*.vue" {
8
+ import type { DefineComponent } from "vue";
9
+ const component: DefineComponent<{}, {}, any>;
10
+ export default component;
11
+ }
12
+
13
+ declare module "@vue/runtime-core" {
14
+ interface ComponentCustomProperties extends _ComponentCustomProperties {
15
+ $mergeLocaleMessage: Composer<{}, {}, {}, string, never, string>["mergeLocaleMessage"];
16
+ $hasAccess: (permissions: string | string[] | undefined) => boolean;
17
+ $isPhone: Ref<boolean>;
18
+ $isTablet: Ref<boolean>;
19
+ $isMobile: Ref<boolean>;
20
+ $isDesktop: Ref<boolean>;
21
+ $isTouch: boolean;
22
+ }
23
+
24
+ interface ComponentOptionsBase extends CoreBladeAdditionalSettings {}
25
+ }
26
+
27
+ export {};
@@ -0,0 +1,116 @@
1
+ /* Custom styles.
2
+ */
3
+
4
+ /* Apply color scheme example
5
+ You also need to register color theme in startApp() using the 'register(['my-theme'])' method of the useTheme composable. */
6
+ /* :root[data-theme="your-theme-key"] {
7
+ // Primary
8
+ --primary-50: #1F2D3A;
9
+ --primary-100: #2B3D4A;
10
+ --primary-200: #3A4E5D;
11
+ --primary-300: #4A5F70;
12
+ --primary-400: #5B6F82;
13
+ --primary-500: #6C7F94;
14
+ --primary-600: #7A8F9E;
15
+ --primary-700: #8A9FA8;
16
+ --primary-800: #9AAEB2;
17
+ --primary-900: #AABFC0;
18
+ --primary-950: #BCCDD0;
19
+
20
+ // Secondary
21
+ --secondary-50: #1F2D3A;
22
+ --secondary-100: #2B3D4A;
23
+ --secondary-200: #3A4E5D;
24
+ --secondary-300: #4A5F70;
25
+ --secondary-400: #5B6F82;
26
+ --secondary-500: #6C7F94;
27
+ --secondary-600: #7A8F9E;
28
+ --secondary-700: #8A9FA8;
29
+ --secondary-800: #9AAEB2;
30
+ --secondary-900: #AABFC0;
31
+ --secondary-950: #BCCDD0;
32
+
33
+ // Accent
34
+ --accent-50: #1F2D3A;
35
+ --accent-100: #2B3D4A;
36
+ --accent-200: #3A4E5D;
37
+ --accent-300: #4A5F70;
38
+ --accent-400: #5B6F82;
39
+ --accent-500: #6C7F94;
40
+ --accent-600: #7A8F9E;
41
+ --accent-700: #8A9FA8;
42
+ --accent-800: #9AAEB2;
43
+ --accent-900: #AABFC0;
44
+ --accent-950: #BCCDD0;
45
+
46
+ // Neutrals
47
+ --neutrals-50: #2E2E2E;
48
+ --neutrals-100: #3D3D3D;
49
+ --neutrals-200: #4D4D4D;
50
+ --neutrals-300: #6D6D6D;
51
+ --neutrals-400: #8A8A8A;
52
+ --neutrals-500: #B3B3B3;
53
+ --neutrals-600: #D4D4D4;
54
+ --neutrals-700: #E4E4E4;
55
+ --neutrals-800: #F4F4F4;
56
+ --neutrals-900: #FAFAFA;
57
+ --neutrals-950: #FFFFFF;
58
+
59
+ // Additional
60
+ --additional-50: #2E2E2E;
61
+ --additional-950: #FFFFFF;
62
+
63
+ // States
64
+
65
+ // Warning
66
+ --warning-50: #3A2D00;
67
+ --warning-100: #5A4D00;
68
+ --warning-200: #7A6D00;
69
+ --warning-300: #9A8D00;
70
+ --warning-400: #B9AB00;
71
+ --warning-500: #D8C600;
72
+ --warning-600: #D8D100;
73
+ --warning-700: #B8A800;
74
+ --warning-800: #9A8B00;
75
+ --warning-900: #7A6E00;
76
+ --warning-950: #5A5000;
77
+
78
+ // Danger
79
+ --danger-50: #3F0D0D;
80
+ --danger-100: #5E1E1E;
81
+ --danger-200: #7E2F2F;
82
+ --danger-300: #9E3F3F;
83
+ --danger-400: #BF4F4F;
84
+ --danger-500: #DF5F5F;
85
+ --danger-600: #DF4D4D;
86
+ --danger-700: #BF3D3D;
87
+ --danger-800: #9E2D2D;
88
+ --danger-900: #7E1D1D;
89
+ --danger-950: #5E0D0D;
90
+
91
+ // Success
92
+ --success-50: #1D3A1D;
93
+ --success-100: #2D5A2D;
94
+ --success-200: #3A7A3A;
95
+ --success-300: #4A9A4A;
96
+ --success-400: #5AB05A;
97
+ --success-500: #6AC56A;
98
+ --success-600: #5A9A5A;
99
+ --success-700: #4A7F4A;
100
+ --success-800: #3A664A;
101
+ --success-900: #1D4C1D;
102
+ --success-950: #0A3A0A;
103
+
104
+ // Info
105
+ --info-50: #1F2D3A;
106
+ --info-100: #2B3D4A;
107
+ --info-200: #3A4E5D;
108
+ --info-300: #4A5F70;
109
+ --info-400: #5B6F82;
110
+ --info-500: #6C7F94;
111
+ --info-600: #7A8F9E;
112
+ --info-700: #8A9FA8;
113
+ --info-800: #9AAEB2;
114
+ --info-900: #AABFC0;
115
+ --info-950: #BCCDD0;
116
+ } */
@@ -0,0 +1,8 @@
1
+ @use 'custom';
2
+
3
+ @tailwind base;
4
+
5
+ @tailwind components;
6
+
7
+
8
+ @tailwind utilities;
@@ -0,0 +1,10 @@
1
+ import type { ComponentCustomProperties } from '@vue/runtime-core';
2
+
3
+ declare module "@vue/runtime-core" {
4
+ interface ComponentCustomProperties {
5
+ $t: (key: string, ...args: any[]) => string;
6
+ $d: (key: string, ...args: any[]) => string;
7
+ $tm: (key: string, ...args: any[]) => string;
8
+ $rt: (key: string, ...args: any[]) => string;
9
+ }
10
+ }
@@ -0,0 +1,7 @@
1
+ import defaultConfig, { content } from "@vc-shell/framework/tailwind.config";
2
+
3
+ export default {
4
+ prefix: "tw-",
5
+ content: [...content, "./src/**/*.{vue,js,ts,jsx,tsx}"],
6
+ theme: defaultConfig.theme,
7
+ };
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "@vc-shell/ts-config/tsconfig.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "outDir": "dist",
6
+ "rootDir": "src",
7
+ "types": [
8
+ "vite/client",
9
+ ]
10
+ },
11
+ "include": [
12
+ "./src/**/*.ts",
13
+ "./src/**/*.vue",
14
+ "./src/**/*.json"
15
+ ]
16
+ }
File without changes
@@ -0,0 +1,23 @@
1
+ export type ProjectType = "standalone" | "dynamic-module" | "host-app";
2
+ export interface ProjectOptions {
3
+ projectName: string;
4
+ packageName: string;
5
+ projectType: ProjectType;
6
+ moduleName: string;
7
+ basePath: string;
8
+ tenantRoutes: boolean;
9
+ aiAgent: boolean;
10
+ dashboard: boolean;
11
+ mocks: boolean;
12
+ }
13
+ export interface ModuleOptions {
14
+ moduleName: string;
15
+ targetDir: string;
16
+ }
17
+ export interface GeneratorContext {
18
+ targetDir: string;
19
+ options: ProjectOptions;
20
+ renderTemplate: (templatePath: string, outputPath: string, data?: Record<string, unknown>) => void;
21
+ renderDir: (templateDir: string, outputDir: string, data?: Record<string, unknown>) => void;
22
+ }
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAEvE,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnG,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7F"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vc-shell/create-vc-app",
3
3
  "description": "Application scaffolding",
4
- "version": "1.2.4-beta.8",
4
+ "version": "2.0.0-alpha.0",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
7
7
  "files": [
@@ -13,16 +13,19 @@
13
13
  "postbuild": "shx cp -R src/templates dist/"
14
14
  },
15
15
  "devDependencies": {
16
+ "@types/ejs": "^3.1.5",
16
17
  "@types/prompts": "^2.4.4",
17
- "@vc-shell/ts-config": "1.2.4-beta.8",
18
+ "@vc-shell/ts-config": "2.0.0-alpha.0",
18
19
  "copyfiles": "^2.4.1",
19
20
  "cross-env": "^7.0.3",
20
21
  "shx": "^0.3.4",
21
22
  "typescript": "^5.8.3"
22
23
  },
23
24
  "dependencies": {
24
- "chalk": "^2.4.2",
25
+ "ejs": "^3.1.10",
26
+ "magicast": "^0.3.5",
25
27
  "mri": "^1.2.0",
28
+ "picocolors": "^1.1.1",
26
29
  "prompts": "^2.4.2",
27
30
  "tslib": "^2.5.3",
28
31
  "vite": "^6.3.3",
@@ -32,5 +35,5 @@
32
35
  "access": "public",
33
36
  "registry": "https://registry.npmjs.org/"
34
37
  },
35
- "gitHead": "25aa3246d45b375af4fffcc256a447d05dfda64c"
38
+ "gitHead": "f028d9e1fe410a18fec4e127a65860cfb2309e36"
36
39
  }
@@ -1,2 +0,0 @@
1
- export { default as use{{ModuleNamePascalCase}}List } from "./use{{ModuleNamePascalCase}}List";
2
- export { default as use{{ModuleNamePascalCase}}Details } from "./use{{ModuleNamePascalCase}}Details";
@@ -1,24 +0,0 @@
1
- import { computed, ref } from "vue";
2
- import { useAsync, useLoading, useModificationTracker } from "@vc-shell/framework";
3
-
4
- export default () => {
5
- const item = ref({});
6
-
7
- const { isModified, currentValue, resetModificationState } = useModificationTracker(item);
8
-
9
- // Implement your own load function
10
- const { loading: itemLoading, action: getItem } = useAsync<{ id: string }>(async (payload) => {
11
- item.value = {};
12
-
13
- resetModificationState();
14
- });
15
-
16
- const loading = useLoading(itemLoading);
17
-
18
- return {
19
- item: currentValue,
20
- loading: computed(() => loading.value),
21
- getItem,
22
- isModified,
23
- };
24
- };
@@ -1,47 +0,0 @@
1
- import { computed, ref } from "vue";
2
- import { useAsync, useLoading } from "@vc-shell/framework";
3
-
4
- // Replace with the actual search query interface from the API client
5
- interface SearchQuery {
6
- take?: number;
7
- skip?: number;
8
- sort?: string;
9
- keyword?: string;
10
- }
11
-
12
- export default (options?: { pageSize?: number, sort?: string }) => {
13
- const pageSize = options?.pageSize || 20;
14
- const searchResult = ref();
15
- const searchQuery = ref<SearchQuery>({
16
- take: pageSize,
17
- skip: 0,
18
- sort: options?.sort || "createdDate:DESC",
19
- });
20
-
21
- // Implement your own load function
22
- const { loading: itemLoading, action: getItems } = useAsync<SearchQuery>(async (payload) => {
23
- searchQuery.value = { ...searchQuery.value, ...payload };
24
- searchResult.value = {
25
- totalCount: 0,
26
- items: [],
27
- };
28
- });
29
-
30
- // Implement your own remove function
31
- const { loading: removeLoading, action: removeItems } = useAsync<{ ids: string[] }>(async (payload) => {
32
- return;
33
- });
34
-
35
- const loading = useLoading(itemLoading, removeLoading);
36
-
37
- return {
38
- data: computed(() => searchResult.value?.items),
39
- loading: computed(() => loading.value),
40
- totalCount: computed(() => searchResult.value?.totalCount || 0),
41
- pages: computed(() => Math.ceil((searchResult.value?.totalCount || 1) / pageSize)),
42
- currentPage: computed(() => Math.ceil((searchQuery.value?.skip || 0) / Math.max(1, pageSize) + 1)),
43
- getItems,
44
- removeItems,
45
- searchQuery,
46
- };
47
- };
@@ -1,37 +0,0 @@
1
- {
2
- "{{ModuleNameUppercaseSnakeCase}}": {
3
- "MENU": {
4
- "TITLE": "{{ModuleNameSentenceCase}}"
5
- },
6
- "PAGES": {
7
- "LIST": {
8
- "TITLE": "{{ModuleNameSentenceCase}} list",
9
- "TOOLBAR": {
10
- "REFRESH": "Refresh",
11
- "ADD": "Add"
12
- },
13
- "SEARCH": {
14
- "PLACEHOLDER": "Search keywords"
15
- },
16
- "TABLE": {
17
- "TOTALS": "Count:",
18
- "HEADER": {}
19
- },
20
- "EMPTY": {
21
- "NO_ITEMS": "No items found",
22
- "ADD": "Add items"
23
- },
24
- "NOT_FOUND": {
25
- "EMPTY": "No items found",
26
- "RESET": "Reset"
27
- }
28
- },
29
- "DETAILS": {
30
- "TITLE": "{{ModuleNameSentenceCase}} details"
31
- },
32
- "ALERTS": {
33
- "CLOSE_CONFIRMATION": "You have unsaved changes. Close anyway?"
34
- }
35
- }
36
- }
37
- }
@@ -1,87 +0,0 @@
1
- <template>
2
- <VcBlade
3
- :loading="loading"
4
- :title="title"
5
- :expanded="expanded"
6
- :closable="closable"
7
- width="70%"
8
- :toolbar-items="bladeToolbar"
9
- @close="$emit('close:blade')"
10
- @expand="$emit('expand:blade')"
11
- @collapse="$emit('collapse:blade')"
12
- >
13
- <VcContainer class="tw-p-2">
14
- <VcForm>
15
- <!-- You can add form fields here -->
16
- </VcForm>
17
- </VcContainer>
18
- </VcBlade>
19
- </template>
20
-
21
- <script lang="ts" setup>
22
- import { IBladeToolbar, IParentCallArgs, useBladeNavigation, usePopup, useBeforeUnload } from "@vc-shell/framework";
23
- import { use{{ModuleNamePascalCase}}Details } from "./../composables";
24
- import { computed, onMounted, ref } from "vue";
25
- import { useI18n } from "vue-i18n";
26
- import { useForm } from "vee-validate";
27
-
28
- export interface Props {
29
- expanded?: boolean;
30
- closable?: boolean;
31
- param?: string;
32
- }
33
-
34
- export interface Emits {
35
- (event: "parent:call", args: IParentCallArgs): void;
36
- (event: "collapse:blade"): void;
37
- (event: "expand:blade"): void;
38
- (event: "close:blade"): void;
39
- }
40
-
41
- defineOptions({
42
- url: "/{{ModuleName}}-details",
43
- name: "{{ModuleNamePascalCase}}Details",
44
- });
45
-
46
- const props = withDefaults(defineProps<Props>(), {
47
- expanded: true,
48
- closable: true,
49
- param: undefined,
50
- });
51
-
52
- defineEmits<Emits>();
53
-
54
- const { loading, getItem, isModified } = use{{ModuleNamePascalCase}}Details();
55
- const { onBeforeClose } = useBladeNavigation();
56
- const { showConfirmation } = usePopup();
57
- const { t } = useI18n({ useScope: "global" });
58
-
59
- const { meta } = useForm({
60
- validateOnMount: false,
61
- });
62
-
63
- const isDisabled = computed(() => {
64
- return !meta.value.dirty || !meta.value.valid;
65
- });
66
-
67
- const bladeToolbar = ref<IBladeToolbar[]>([]);
68
- const title = computed(() => t("{{ModuleNameUppercaseSnakeCase}}.PAGES.DETAILS.TITLE"));
69
-
70
- onMounted(async () => {
71
- if (props.param) {
72
- await getItem({ id: props.param });
73
- }
74
- });
75
-
76
- onBeforeClose(async () => {
77
- if (!isDisabled.value && isModified.value) {
78
- return await showConfirmation(t("SAMPLE_APP.PAGES.ALERTS.CLOSE_CONFIRMATION"));
79
- }
80
- });
81
-
82
- useBeforeUnload(computed(() => !isDisabled.value && isModified.value));
83
-
84
- defineExpose({
85
- title,
86
- });
87
- </script>