@vc-shell/create-vc-app 2.0.0-alpha.15 → 2.0.0-alpha.17
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/CHANGELOG.md +22 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.test.d.ts +2 -0
- package/dist/commands/init.test.d.ts.map +1 -0
- package/dist/engine/codegen.d.ts.map +1 -1
- package/dist/engine/helpers.d.ts +1 -1
- package/dist/engine/helpers.d.ts.map +1 -1
- package/dist/engine/helpers.test.d.ts +2 -0
- package/dist/engine/helpers.test.d.ts.map +1 -0
- package/dist/engine/template.d.ts.map +1 -1
- package/dist/engine/template.test.d.ts +2 -0
- package/dist/engine/template.test.d.ts.map +1 -0
- package/dist/index.js +169 -165
- package/dist/output.d.ts.map +1 -1
- package/dist/templates/dynamic-module/_package.json.ejs +6 -6
- package/dist/templates/dynamic-module/src/modules/index.ts.ejs +8 -5
- package/dist/templates/dynamic-module/tsconfig.json +1 -1
- package/dist/templates/host-app/_package.json.ejs +7 -9
- package/dist/templates/host-app/src/main.ts.ejs +17 -15
- package/dist/templates/host-app/tsconfig.json +1 -0
- package/dist/templates/module/composables/useDetails.ts.ejs +41 -38
- package/dist/templates/module/index.ts.ejs +11 -8
- package/dist/templates/module/locales/en.json.ejs +33 -22
- package/dist/templates/module/pages/details.vue.ejs +10 -12
- package/dist/templates/module/pages/list.vue.ejs +11 -13
- package/dist/templates/sample-module/index.ts +11 -8
- package/dist/templates/sample-module/pages/details.vue +8 -4
- package/dist/templates/sample-module/pages/list.vue +103 -119
- package/dist/templates/standalone/_package.json.ejs +7 -9
- package/dist/templates/standalone/src/bootstrap.ts.ejs +5 -5
- package/dist/templates/standalone/src/main.ts.ejs +29 -23
- package/dist/templates/standalone/tsconfig.json +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/templates/host-app/src/shims-vue.d.ts +0 -27
- package/dist/templates/host-app/src/vue-i18n.d.ts +0 -10
- package/dist/templates/standalone/src/shims-vue.d.ts +0 -27
- package/dist/templates/standalone/src/vue-i18n.d.ts +0 -10
|
@@ -6,54 +6,92 @@
|
|
|
6
6
|
>
|
|
7
7
|
<!-- Blade contents -->
|
|
8
8
|
<!-- @vue-generic {MockedItem} -->
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<VcDataTable
|
|
10
|
+
v-model:search-value="searchValue"
|
|
11
|
+
v-model:active-item-id="selectedItemId"
|
|
12
|
+
v-model:selection="selectedItems"
|
|
12
13
|
:loading="loading"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
:
|
|
18
|
-
:
|
|
19
|
-
enable-item-actions
|
|
20
|
-
:item-action-builder="actionBuilder"
|
|
21
|
-
:empty="empty"
|
|
22
|
-
:notfound="notfound"
|
|
14
|
+
class="tw-grow tw-basis-0"
|
|
15
|
+
selection-mode="multiple"
|
|
16
|
+
:items="data ?? []"
|
|
17
|
+
:row-actions="actionBuilder"
|
|
18
|
+
:pagination="{ currentPage, pages }"
|
|
19
|
+
:searchable="true"
|
|
23
20
|
:search-placeholder="$t('SAMPLE_APP.PAGES.LIST.SEARCH.PLACEHOLDER')"
|
|
21
|
+
:empty-state="{
|
|
22
|
+
icon: 'lucide-file',
|
|
23
|
+
title: $t('SAMPLE_APP.PAGES.LIST.EMPTY.NO_ITEMS'),
|
|
24
|
+
actionLabel: $t('SAMPLE_APP.PAGES.LIST.EMPTY.ADD'),
|
|
25
|
+
actionHandler: addItem,
|
|
26
|
+
}"
|
|
27
|
+
:not-found-state="{
|
|
28
|
+
icon: 'lucide-file',
|
|
29
|
+
title: $t('SAMPLE_APP.PAGES.LIST.NOT_FOUND.EMPTY'),
|
|
30
|
+
actionLabel: $t('SAMPLE_APP.PAGES.LIST.NOT_FOUND.RESET'),
|
|
31
|
+
actionHandler: clearSearch,
|
|
32
|
+
}"
|
|
24
33
|
:total-label="$t('SAMPLE_APP.PAGES.LIST.TABLE.TOTALS')"
|
|
25
|
-
:
|
|
34
|
+
:total-count="totalCount"
|
|
26
35
|
state-key="SAMPLE_APP"
|
|
27
|
-
|
|
28
|
-
@
|
|
29
|
-
@header-click="onHeaderClick"
|
|
30
|
-
@selection-changed="onSelectionChanged"
|
|
31
|
-
@search:change="onSearchList"
|
|
36
|
+
@search="onSearchList"
|
|
37
|
+
@row-click="onItemClick"
|
|
32
38
|
@pagination-click="onPaginationClick"
|
|
33
39
|
>
|
|
34
|
-
|
|
40
|
+
<VcColumn
|
|
41
|
+
id="imgSrc"
|
|
42
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.IMAGE')"
|
|
43
|
+
type="image"
|
|
44
|
+
width="70px"
|
|
45
|
+
/>
|
|
46
|
+
<VcColumn
|
|
47
|
+
id="name"
|
|
48
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.PRODUCT_NAME')"
|
|
49
|
+
:sortable="true"
|
|
50
|
+
:always-visible="true"
|
|
51
|
+
/>
|
|
52
|
+
<VcColumn
|
|
53
|
+
id="description"
|
|
54
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.DESCRIPTION')"
|
|
55
|
+
/>
|
|
56
|
+
<VcColumn
|
|
57
|
+
id="price"
|
|
58
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.PRICE')"
|
|
59
|
+
type="money"
|
|
60
|
+
:sortable="true"
|
|
61
|
+
:always-visible="true"
|
|
62
|
+
/>
|
|
63
|
+
<VcColumn
|
|
64
|
+
id="salePrice"
|
|
65
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.SALE_PRICE')"
|
|
66
|
+
type="money"
|
|
67
|
+
/>
|
|
68
|
+
<VcColumn
|
|
69
|
+
id="currency.name"
|
|
70
|
+
:title="$t('SAMPLE_APP.PAGES.LIST.TABLE.HEADER.CURRENCY')"
|
|
71
|
+
/>
|
|
72
|
+
</VcDataTable>
|
|
35
73
|
</VcBlade>
|
|
36
74
|
</template>
|
|
37
75
|
|
|
38
76
|
<script lang="ts" setup>
|
|
39
|
-
import { computed, ref,
|
|
77
|
+
import { computed, ref, onMounted, watch } from "vue";
|
|
40
78
|
import {
|
|
41
|
-
IActionBuilderResult,
|
|
42
79
|
IBladeToolbar,
|
|
43
|
-
ITableColumns,
|
|
44
80
|
useBlade,
|
|
45
81
|
usePopup,
|
|
46
82
|
useTableSort,
|
|
47
83
|
useFunctions,
|
|
84
|
+
VcColumn,
|
|
85
|
+
VcDataTable,
|
|
48
86
|
} from "@vc-shell/framework";
|
|
87
|
+
import type { TableAction } from "@vc-shell/framework";
|
|
49
88
|
import { useI18n } from "vue-i18n";
|
|
50
89
|
import { useList } from "./../composables";
|
|
51
|
-
import Details from "./details.vue";
|
|
52
90
|
import { MockedItem } from "./../composables/useList";
|
|
53
91
|
|
|
54
|
-
|
|
55
|
-
url: "/sample-list",
|
|
92
|
+
defineBlade({
|
|
56
93
|
name: "SampleList",
|
|
94
|
+
url: "/sample-list",
|
|
57
95
|
isWorkspace: true,
|
|
58
96
|
menuItem: {
|
|
59
97
|
title: "SAMPLE_APP.MENU.TITLE",
|
|
@@ -67,9 +105,9 @@ const { param, openBlade, exposeToChildren } = useBlade();
|
|
|
67
105
|
const { showConfirmation } = usePopup();
|
|
68
106
|
const { debounce } = useFunctions();
|
|
69
107
|
|
|
70
|
-
const { sortExpression
|
|
71
|
-
initialDirection: "DESC",
|
|
108
|
+
const { sortExpression } = useTableSort({
|
|
72
109
|
initialProperty: "createdDate",
|
|
110
|
+
initialDirection: "DESC",
|
|
73
111
|
});
|
|
74
112
|
|
|
75
113
|
const { getItems, removeItems, data, loading, totalCount, pages, currentPage, searchQuery } = useList({
|
|
@@ -79,29 +117,9 @@ const { getItems, removeItems, data, loading, totalCount, pages, currentPage, se
|
|
|
79
117
|
|
|
80
118
|
const searchValue = ref();
|
|
81
119
|
const selectedItemId = ref<string>();
|
|
82
|
-
const
|
|
120
|
+
const selectedItems = ref<MockedItem[]>([]);
|
|
83
121
|
|
|
84
|
-
const
|
|
85
|
-
icon: "lucide-file",
|
|
86
|
-
text: computed(() => t("SAMPLE_APP.PAGES.LIST.EMPTY.NO_ITEMS")),
|
|
87
|
-
action: computed(() => t("SAMPLE_APP.PAGES.LIST.EMPTY.ADD")),
|
|
88
|
-
clickHandler: () => {
|
|
89
|
-
addItem();
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const notfound = {
|
|
94
|
-
icon: "lucide-file",
|
|
95
|
-
text: computed(() => t("SAMPLE_APP.PAGES.LIST.NOT_FOUND.EMPTY")),
|
|
96
|
-
action: computed(() => t("SAMPLE_APP.PAGES.LIST.NOT_FOUND.RESET")),
|
|
97
|
-
clickHandler: async () => {
|
|
98
|
-
searchValue.value = "";
|
|
99
|
-
await getItems({
|
|
100
|
-
...searchQuery.value,
|
|
101
|
-
keyword: "",
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
};
|
|
122
|
+
const selectedIds = computed(() => selectedItems.value.map((item) => item.id).filter(Boolean) as string[]);
|
|
105
123
|
|
|
106
124
|
watch(
|
|
107
125
|
param,
|
|
@@ -118,6 +136,13 @@ onMounted(async () => {
|
|
|
118
136
|
});
|
|
119
137
|
});
|
|
120
138
|
|
|
139
|
+
watch(sortExpression, async (value) => {
|
|
140
|
+
await getItems({
|
|
141
|
+
...searchQuery.value,
|
|
142
|
+
sort: value,
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
121
146
|
const onSearchList = debounce(async (keyword: string) => {
|
|
122
147
|
searchValue.value = keyword;
|
|
123
148
|
await getItems({
|
|
@@ -126,9 +151,17 @@ const onSearchList = debounce(async (keyword: string) => {
|
|
|
126
151
|
});
|
|
127
152
|
}, 1000);
|
|
128
153
|
|
|
154
|
+
const clearSearch = async () => {
|
|
155
|
+
searchValue.value = "";
|
|
156
|
+
await getItems({
|
|
157
|
+
...searchQuery.value,
|
|
158
|
+
keyword: "",
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
|
|
129
162
|
const addItem = () => {
|
|
130
163
|
openBlade({
|
|
131
|
-
|
|
164
|
+
name: "SampleDetails",
|
|
132
165
|
});
|
|
133
166
|
};
|
|
134
167
|
|
|
@@ -159,42 +192,10 @@ const bladeToolbar = ref<IBladeToolbar[]>([
|
|
|
159
192
|
},
|
|
160
193
|
]);
|
|
161
194
|
|
|
162
|
-
const columns = ref<ITableColumns[]>([
|
|
163
|
-
{
|
|
164
|
-
id: "imgSrc",
|
|
165
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.IMAGE")),
|
|
166
|
-
type: "image",
|
|
167
|
-
width: "70px",
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
id: "name",
|
|
171
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.PRODUCT_NAME")),
|
|
172
|
-
alwaysVisible: true,
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: "description",
|
|
176
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.DESCRIPTION")),
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
id: "price",
|
|
180
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.PRICE")),
|
|
181
|
-
type: "money",
|
|
182
|
-
alwaysVisible: true,
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
id: "salePrice",
|
|
186
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.SALE_PRICE")),
|
|
187
|
-
type: "money",
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
id: "currency.name",
|
|
191
|
-
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.HEADER.CURRENCY")),
|
|
192
|
-
},
|
|
193
|
-
]);
|
|
194
|
-
|
|
195
195
|
const title = computed(() => t("SAMPLE_APP.PAGES.LIST.TITLE"));
|
|
196
196
|
|
|
197
197
|
const reload = async () => {
|
|
198
|
+
selectedItems.value = [];
|
|
198
199
|
await getItems({
|
|
199
200
|
...searchQuery.value,
|
|
200
201
|
skip: (currentPage.value - 1) * (searchQuery.value.take ?? 10),
|
|
@@ -202,9 +203,10 @@ const reload = async () => {
|
|
|
202
203
|
});
|
|
203
204
|
};
|
|
204
205
|
|
|
205
|
-
const onItemClick = (
|
|
206
|
+
const onItemClick = (event: { data: MockedItem; index: number; originalEvent: Event }) => {
|
|
207
|
+
const item = event.data;
|
|
206
208
|
openBlade({
|
|
207
|
-
|
|
209
|
+
name: "SampleDetails",
|
|
208
210
|
param: item.id,
|
|
209
211
|
onOpen() {
|
|
210
212
|
selectedItemId.value = item.id;
|
|
@@ -215,32 +217,23 @@ const onItemClick = (item: { id: string }) => {
|
|
|
215
217
|
});
|
|
216
218
|
};
|
|
217
219
|
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
type: "danger",
|
|
232
|
-
async clickHandler(_item: MockedItem) {
|
|
233
|
-
if (_item.id) {
|
|
234
|
-
if (!selectedIds.value.includes(_item.id)) {
|
|
235
|
-
selectedIds.value.push(_item.id);
|
|
220
|
+
const actionBuilder = (item: MockedItem): TableAction[] => {
|
|
221
|
+
return [
|
|
222
|
+
{
|
|
223
|
+
icon: "lucide-trash-2",
|
|
224
|
+
title: computed(() => t("SAMPLE_APP.PAGES.LIST.TABLE.ACTIONS.DELETE")),
|
|
225
|
+
type: "danger",
|
|
226
|
+
async clickHandler() {
|
|
227
|
+
if (item.id) {
|
|
228
|
+
if (!selectedIds.value.includes(item.id)) {
|
|
229
|
+
selectedItems.value = [...selectedItems.value, item];
|
|
230
|
+
}
|
|
231
|
+
await remove(selectedIds.value);
|
|
232
|
+
selectedItems.value = [];
|
|
236
233
|
}
|
|
237
|
-
|
|
238
|
-
selectedIds.value = [];
|
|
239
|
-
}
|
|
234
|
+
},
|
|
240
235
|
},
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return result;
|
|
236
|
+
];
|
|
244
237
|
};
|
|
245
238
|
|
|
246
239
|
async function remove(ids: string[]) {
|
|
@@ -256,14 +249,5 @@ async function remove(ids: string[]) {
|
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
251
|
|
|
259
|
-
watch(
|
|
260
|
-
() => sortExpression.value,
|
|
261
|
-
async (newVal) => {
|
|
262
|
-
await getItems({
|
|
263
|
-
sort: newVal,
|
|
264
|
-
});
|
|
265
|
-
},
|
|
266
|
-
);
|
|
267
|
-
|
|
268
252
|
exposeToChildren({ reload });
|
|
269
253
|
</script>
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@types/node": "^20.10.5",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
24
24
|
"@typescript-eslint/parser": "^7.4.0",
|
|
25
|
-
"@vc-shell/api-client-generator": "^2.0.0-alpha.
|
|
26
|
-
"@vc-shell/ts-config": "^2.0.0-alpha.
|
|
25
|
+
"@vc-shell/api-client-generator": "^2.0.0-alpha.17",
|
|
26
|
+
"@vc-shell/ts-config": "^2.0.0-alpha.17",
|
|
27
27
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
28
28
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^13.0.0",
|
|
@@ -48,18 +48,16 @@
|
|
|
48
48
|
"vite-plugin-checker": "^0.9.1",
|
|
49
49
|
"vite-plugin-mkcert": "^1.17.1",
|
|
50
50
|
"vue-eslint-parser": "^9.3.2",
|
|
51
|
-
"vue-tsc": "^
|
|
51
|
+
"vue-tsc": "^3.2.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vc-shell/config-generator": "^2.0.0-alpha.
|
|
55
|
-
"@vc-shell/framework": "^2.0.0-alpha.
|
|
54
|
+
"@vc-shell/config-generator": "^2.0.0-alpha.17",
|
|
55
|
+
"@vc-shell/framework": "^2.0.0-alpha.17",
|
|
56
56
|
"@vueuse/core": "^10.7.1",
|
|
57
57
|
"@vueuse/integrations": "^10.7.1",
|
|
58
|
-
"cross-spawn": "^7.0.3",
|
|
59
|
-
"moment": "^2.30.1",
|
|
60
58
|
"vee-validate": "^4.12.4",
|
|
61
|
-
"vue": "^3.5.
|
|
62
|
-
"vue-router": "^
|
|
59
|
+
"vue": "^3.5.30",
|
|
60
|
+
"vue-router": "^5.0.3"
|
|
63
61
|
},
|
|
64
62
|
"lint-staged": {
|
|
65
63
|
"*.{js,ts,html,css}": "prettier --write '**/*.{ts,vue}'",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { App } from "vue";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
<% if (dashboard) { -%>
|
|
3
|
+
import { addMenuItem, registerDashboardWidget } from "@vc-shell/framework";
|
|
4
4
|
import { markRaw } from "vue";
|
|
5
5
|
import Welcome from "./components/dashboard-widgets/Welcome.vue";
|
|
6
|
-
<% }
|
|
6
|
+
<% } -%>
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
9
|
export function bootstrap(app: App) {
|
|
10
|
-
<% if (dashboard) {
|
|
10
|
+
<% if (dashboard) { -%>
|
|
11
11
|
addMenuItem({
|
|
12
12
|
title: "SHELL.MENU.DASHBOARD",
|
|
13
13
|
icon: "lucide-home",
|
|
@@ -22,5 +22,5 @@ export function bootstrap(app: App) {
|
|
|
22
22
|
size: { width: 6, height: 6 },
|
|
23
23
|
position: { x: 0, y: 0 },
|
|
24
24
|
});
|
|
25
|
-
<% }
|
|
25
|
+
<% } -%>
|
|
26
26
|
}
|
|
@@ -3,10 +3,12 @@ import { createApp } from "vue";
|
|
|
3
3
|
import { router } from "./router";
|
|
4
4
|
import * as locales from "./locales";
|
|
5
5
|
import { RouterView } from "vue-router";
|
|
6
|
+
<% if (hasModule) { -%>
|
|
6
7
|
import <%- ModuleNamePascalCase %> from "./modules/<%- ModuleName %>";
|
|
7
|
-
<%
|
|
8
|
+
<% } -%>
|
|
9
|
+
<% if (mocks) { -%>
|
|
8
10
|
import Sample from "./modules/sample";
|
|
9
|
-
<% }
|
|
11
|
+
<% } -%>
|
|
10
12
|
import { bootstrap } from "./bootstrap";
|
|
11
13
|
|
|
12
14
|
import "@vc-shell/framework/dist/index.css";
|
|
@@ -20,28 +22,32 @@ async function startApp() {
|
|
|
20
22
|
console.log(e);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
const { currentLocale, setLocale } = useLanguages();
|
|
26
|
+
|
|
27
|
+
const app = createApp(RouterView);
|
|
28
|
+
|
|
29
|
+
app.use(VirtoShellFramework, {
|
|
30
|
+
router,
|
|
31
|
+
i18n: {
|
|
32
|
+
locale: import.meta.env.APP_I18N_LOCALE,
|
|
33
|
+
fallbackLocale: import.meta.env.APP_I18N_FALLBACK_LOCALE,
|
|
34
|
+
},
|
|
35
|
+
<% if (aiAgent) { -%>
|
|
36
|
+
aiAgent: {
|
|
37
|
+
config: {
|
|
38
|
+
url: import.meta.env.APP_AI_AGENT_URL,
|
|
35
39
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<% if (mocks) { %>
|
|
40
|
-
.use(Sample, { router })
|
|
41
|
-
<% } %>
|
|
42
|
-
.use(router);
|
|
40
|
+
},
|
|
41
|
+
<% } -%>
|
|
42
|
+
});
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
<% if (hasModule) { -%>
|
|
45
|
+
app.use(<%- ModuleNamePascalCase %>);
|
|
46
|
+
<% } -%>
|
|
47
|
+
<% if (mocks) { -%>
|
|
48
|
+
app.use(Sample);
|
|
49
|
+
<% } -%>
|
|
50
|
+
app.use(router);
|
|
45
51
|
|
|
46
52
|
bootstrap(app);
|
|
47
53
|
|
|
@@ -51,7 +57,7 @@ async function startApp() {
|
|
|
51
57
|
|
|
52
58
|
setLocale(currentLocale.value);
|
|
53
59
|
|
|
54
|
-
app.config.errorHandler = (err) => {
|
|
60
|
+
app.config.errorHandler = (err: unknown) => {
|
|
55
61
|
notification.error((err as Error).toString(), {
|
|
56
62
|
timeout: 5000,
|
|
57
63
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type ProjectType = "standalone" | "dynamic-module"
|
|
1
|
+
export type ProjectType = "standalone" | "dynamic-module";
|
|
2
2
|
export interface ProjectOptions {
|
|
3
3
|
projectName: string;
|
|
4
4
|
packageName: string;
|
|
5
5
|
projectType: ProjectType;
|
|
6
|
-
moduleName
|
|
6
|
+
moduleName?: string;
|
|
7
7
|
basePath: string;
|
|
8
8
|
tenantRoutes: boolean;
|
|
9
9
|
aiAgent: boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.17",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "vite build && yarn postbuild",
|
|
12
|
+
"test": "vitest run --config vitest.config.ts",
|
|
12
13
|
"type-check": "vue-tsc --noEmit",
|
|
13
14
|
"postbuild": "shx cp -R src/templates dist/"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@types/ejs": "^3.1.5",
|
|
17
18
|
"@types/prompts": "^2.4.4",
|
|
18
|
-
"@vc-shell/ts-config": "2.0.0-alpha.
|
|
19
|
+
"@vc-shell/ts-config": "2.0.0-alpha.17",
|
|
19
20
|
"copyfiles": "^2.4.1",
|
|
20
21
|
"cross-env": "^7.0.3",
|
|
21
22
|
"shx": "^0.3.4",
|
|
@@ -1,27 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|