@vc-shell/create-vc-app 2.4.0 → 2.5.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.
- package/dist/commands/add-module.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/engine/codegen.d.ts +5 -2
- package/dist/engine/codegen.d.ts.map +1 -1
- package/dist/engine/codegen.test.d.ts +2 -0
- package/dist/engine/codegen.test.d.ts.map +1 -0
- package/dist/engine/format.d.ts +13 -0
- package/dist/engine/format.d.ts.map +1 -0
- package/dist/index.js +330 -233
- package/dist/templates/dynamic-module/_package.json.ejs +3 -3
- package/dist/templates/dynamic-module/tsconfig.json +1 -5
- package/dist/templates/module/composables/useDetails.ts.ejs +1 -0
- package/dist/templates/module/composables/useList.ts.ejs +2 -1
- package/dist/templates/module/pages/list.vue.ejs +24 -4
- package/dist/templates/sample-module/composables/useList/index.ts +1 -1
- package/dist/templates/sample-module/pages/index.ts +1 -1
- package/dist/templates/sample-module/pages/list.vue +9 -1
- package/dist/templates/sample-module/sample-data/index.ts +2 -2
- package/dist/templates/standalone/_github/COMMIT_CONVENTION.md +12 -12
- package/dist/templates/standalone/_github/PULL_REQUEST_TEMPLATE.md +3 -0
- package/dist/templates/standalone/_package.json.ejs +4 -4
- package/dist/templates/standalone/_vscode/extensions.json +1 -3
- package/dist/templates/standalone/_vscode/settings.json +3 -8
- package/dist/templates/standalone/eslint.config.mjs +20 -0
- package/dist/templates/standalone/src/api_client/README.md +38 -37
- package/dist/templates/standalone/src/bootstrap.ts.ejs +1 -2
- package/dist/templates/standalone/src/components/dashboard-widgets/Welcome.vue +1 -2
- package/dist/templates/standalone/src/pages/App.vue.ejs +1 -0
- package/dist/templates/standalone/src/pages/Dashboard.vue.ejs +1 -1
- package/dist/templates/standalone/src/router/routes.ts.ejs +12 -15
- package/dist/templates/standalone/tsconfig.json +2 -9
- package/package.json +3 -3
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/node": "^20.10.5",
|
|
13
|
-
"@vc-shell/ts-config": "^2.
|
|
13
|
+
"@vc-shell/ts-config": "^2.5.0",
|
|
14
14
|
"cross-env": "^7.0.3",
|
|
15
15
|
"sass": "^1.87.0",
|
|
16
16
|
"typescript": "^5.8.3",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"vue-tsc": "^3.2.5"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@vc-shell/config-generator": "^2.
|
|
22
|
-
"@vc-shell/framework": "^2.
|
|
21
|
+
"@vc-shell/config-generator": "^2.5.0",
|
|
22
|
+
"@vc-shell/framework": "^2.5.0",
|
|
23
23
|
"vue": "^3.5.30",
|
|
24
24
|
"vue-router": "^5.0.3"
|
|
25
25
|
}
|
|
@@ -4,6 +4,7 @@ import { useAsync, useLoading } from "@vc-shell/framework";
|
|
|
4
4
|
export default function use<%- ModuleNamePascalCase %>Details() {
|
|
5
5
|
const item = ref<Record<string, any>>({});
|
|
6
6
|
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO API call below
|
|
7
8
|
const { loading: itemLoading, action: fetchItem } = useAsync(async (id?: string) => {
|
|
8
9
|
// TODO: Replace with real API call
|
|
9
10
|
// const result = await apiClient.getById(id);
|
|
@@ -8,11 +8,11 @@ export interface <%- ModuleNamePascalCase %>ListQuery {
|
|
|
8
8
|
take?: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
11
|
export default function use<%- ModuleNamePascalCase %>List() {
|
|
13
12
|
const data: Ref<Record<string, any>[]> = ref([]);
|
|
14
13
|
const totalCount = ref(0);
|
|
15
14
|
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO API call below
|
|
16
16
|
const { loading: itemsLoading, action: getItems } = useAsync<<%- ModuleNamePascalCase %>ListQuery>(async (query) => {
|
|
17
17
|
// TODO: Replace with real API call
|
|
18
18
|
// const result = await apiClient.search({
|
|
@@ -25,6 +25,7 @@ export default function use<%- ModuleNamePascalCase %>List() {
|
|
|
25
25
|
// totalCount.value = result.totalCount ?? 0;
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO API call below
|
|
28
29
|
const { loading: deleteLoading, action: removeItems } = useAsync(async (ids?: string[]) => {
|
|
29
30
|
// TODO: Replace with real API call
|
|
30
31
|
// await Promise.all((ids ?? []).map((id) => apiClient.delete(id)));
|
|
@@ -18,14 +18,30 @@
|
|
|
18
18
|
@pagination-click="pagination.goToPage"
|
|
19
19
|
>
|
|
20
20
|
<!-- Add your columns here -->
|
|
21
|
-
<VcColumn
|
|
22
|
-
|
|
21
|
+
<VcColumn
|
|
22
|
+
id="name"
|
|
23
|
+
:title="$t('<%- ModuleNameScreamingSnake %>.PAGES.LIST.COLUMNS.NAME')"
|
|
24
|
+
sortable
|
|
25
|
+
/>
|
|
26
|
+
<VcColumn
|
|
27
|
+
id="createdDate"
|
|
28
|
+
:title="$t('<%- ModuleNameScreamingSnake %>.PAGES.LIST.COLUMNS.CREATED_DATE')"
|
|
29
|
+
type="datetime"
|
|
30
|
+
sortable
|
|
31
|
+
/>
|
|
23
32
|
</VcDataTable>
|
|
24
33
|
</VcBlade>
|
|
25
34
|
</template>
|
|
26
35
|
|
|
27
36
|
<script setup lang="ts">
|
|
28
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
useBlade,
|
|
39
|
+
useDataTableSort,
|
|
40
|
+
useTableSearch,
|
|
41
|
+
useDataTablePagination,
|
|
42
|
+
useFunctions,
|
|
43
|
+
type IBladeToolbar,
|
|
44
|
+
} from "@vc-shell/framework";
|
|
29
45
|
import { VcBlade, VcDataTable, VcColumn } from "@vc-shell/framework/ui";
|
|
30
46
|
import { ref, watch } from "vue";
|
|
31
47
|
import use<%- ModuleNamePascalCase %>List from "../composables/useList";
|
|
@@ -57,7 +73,11 @@ const { sortField, sortOrder, sortExpression } = useDataTableSort({
|
|
|
57
73
|
const { data, loading, totalCount, getItems } = use<%- ModuleNamePascalCase %>List();
|
|
58
74
|
|
|
59
75
|
const { searchValue } = useTableSearch({ stateKey: "<%- ModuleNameScreamingSnake %>" });
|
|
60
|
-
const pagination = useDataTablePagination({
|
|
76
|
+
const pagination = useDataTablePagination({
|
|
77
|
+
stateKey: "<%- ModuleNameScreamingSnake %>",
|
|
78
|
+
pageSize: PAGE_SIZE,
|
|
79
|
+
totalCount,
|
|
80
|
+
});
|
|
61
81
|
|
|
62
82
|
function load() {
|
|
63
83
|
return getItems({
|
|
@@ -25,7 +25,7 @@ interface SearchResult {
|
|
|
25
25
|
|
|
26
26
|
export type { MockedItem };
|
|
27
27
|
|
|
28
|
-
export default (options?: { pageSize?: number
|
|
28
|
+
export default (options?: { pageSize?: number; sort?: string }): useClassicAppList => {
|
|
29
29
|
const pageSize = options?.pageSize || 20;
|
|
30
30
|
const searchResult = ref<SearchResult>();
|
|
31
31
|
const searchQuery = ref<SearchQuery>({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as List } from "./list.vue";
|
|
2
|
-
export {default as Details } from
|
|
2
|
+
export { default as Details } from "./details.vue";
|
|
@@ -75,7 +75,15 @@
|
|
|
75
75
|
|
|
76
76
|
<script lang="ts" setup>
|
|
77
77
|
import { ref, watch, computed } from "vue";
|
|
78
|
-
import {
|
|
78
|
+
import {
|
|
79
|
+
IBladeToolbar,
|
|
80
|
+
useBlade,
|
|
81
|
+
usePopup,
|
|
82
|
+
useDataTableSort,
|
|
83
|
+
useTableSearch,
|
|
84
|
+
useDataTablePagination,
|
|
85
|
+
useFunctions,
|
|
86
|
+
} from "@vc-shell/framework";
|
|
79
87
|
import type { TableAction } from "@vc-shell/framework";
|
|
80
88
|
import { VcColumn, VcDataTable, VcBlade } from "@vc-shell/framework/ui";
|
|
81
89
|
import { useI18n } from "vue-i18n";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * from "./methods";
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
Messages must be matched by the following regex:
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}
|
|
7
|
+
```js
|
|
8
|
+
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}/;
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
13
|
Appears under "Features" header, `ui-kit` subheader:
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```text
|
|
16
16
|
feat(ui-kit): add 'comments' option
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Appears under "Bug Fixes" header, `shell` subheader, with a link to issue #28:
|
|
20
20
|
|
|
21
|
-
```
|
|
21
|
+
```text
|
|
22
22
|
fix(shell): handle events on blur
|
|
23
23
|
|
|
24
24
|
close #28
|
|
@@ -26,7 +26,7 @@ close #28
|
|
|
26
26
|
|
|
27
27
|
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```text
|
|
30
30
|
perf(api-client): improve vdom diffing by removing 'foo' option
|
|
31
31
|
|
|
32
32
|
BREAKING CHANGE: The 'foo' option has been removed.
|
|
@@ -34,7 +34,7 @@ BREAKING CHANGE: The 'foo' option has been removed.
|
|
|
34
34
|
|
|
35
35
|
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
|
|
36
36
|
|
|
37
|
-
```
|
|
37
|
+
```text
|
|
38
38
|
revert: feat(ui-kit): add 'comments' option
|
|
39
39
|
|
|
40
40
|
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
|
@@ -42,9 +42,9 @@ This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
|
|
42
42
|
|
|
43
43
|
## Full Message Format
|
|
44
44
|
|
|
45
|
-
A commit message consists of a **header**, **body** and **footer**.
|
|
45
|
+
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
|
|
46
46
|
|
|
47
|
-
```
|
|
47
|
+
```text
|
|
48
48
|
<type>(<scope>): <subject>
|
|
49
49
|
<BLANK LINE>
|
|
50
50
|
<body>
|
|
@@ -68,15 +68,15 @@ Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`
|
|
|
68
68
|
|
|
69
69
|
### Scope
|
|
70
70
|
|
|
71
|
-
The scope could be any valid workspace package name. For example `shell`, `ui-kit`, `api-client`, etc...
|
|
71
|
+
The scope could be any valid workspace package name. For example `shell`, `ui-kit`, `api-client`, etc...
|
|
72
72
|
|
|
73
73
|
### Subject
|
|
74
74
|
|
|
75
75
|
The subject contains succinct description of the change:
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
- use the imperative, present tense: "change" not "changed" nor "changes"
|
|
78
|
+
- don't capitalize first letter
|
|
79
|
+
- no dot (.) at the end
|
|
80
80
|
|
|
81
81
|
### Body
|
|
82
82
|
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"@types/node": "^20.10.5",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
24
24
|
"@typescript-eslint/parser": "^8.43.0",
|
|
25
|
-
"@vc-shell/api-client-generator": "^2.
|
|
26
|
-
"@vc-shell/ts-config": "^2.
|
|
25
|
+
"@vc-shell/api-client-generator": "^2.5.0",
|
|
26
|
+
"@vc-shell/ts-config": "^2.5.0",
|
|
27
27
|
"@vitejs/plugin-vue": "^5.2.3",
|
|
28
28
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
29
29
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"vue-tsc": "^3.2.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vc-shell/config-generator": "^2.
|
|
55
|
-
"@vc-shell/framework": "^2.
|
|
54
|
+
"@vc-shell/config-generator": "^2.5.0",
|
|
55
|
+
"@vc-shell/framework": "^2.5.0",
|
|
56
56
|
"@vueuse/core": "^10.7.1",
|
|
57
57
|
"@vueuse/integrations": "^10.7.1",
|
|
58
58
|
"vee-validate": "^4.12.4",
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
"source.fixAll.eslint": true
|
|
4
4
|
},
|
|
5
5
|
"files.eol": "\r\n",
|
|
6
|
-
"eslint.validate": [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
"i18n-ally.localesPaths": [
|
|
11
|
-
"src/locales",
|
|
12
|
-
],
|
|
13
|
-
"typescript.preferences.importModuleSpecifier": "relative",
|
|
6
|
+
"eslint.validate": ["vue", "javascript"],
|
|
7
|
+
"i18n-ally.localesPaths": ["src/locales"],
|
|
8
|
+
"typescript.preferences.importModuleSpecifier": "relative"
|
|
14
9
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import pluginVue from "eslint-plugin-vue";
|
|
2
2
|
import vueTsEslintConfig from "@vue/eslint-config-typescript";
|
|
3
3
|
import vuePrettierConfig from "@vue/eslint-config-prettier";
|
|
4
|
+
import importPlugin from "eslint-plugin-import";
|
|
4
5
|
|
|
5
6
|
export default [
|
|
6
7
|
{
|
|
7
8
|
ignores: ["**/node_modules/**", "**/dist/**", "api-client.ts"],
|
|
8
9
|
},
|
|
9
10
|
|
|
11
|
+
importPlugin.flatConfigs.recommended,
|
|
12
|
+
|
|
13
|
+
importPlugin.flatConfigs.typescript,
|
|
14
|
+
|
|
10
15
|
...pluginVue.configs["flat/recommended"],
|
|
11
16
|
|
|
12
17
|
...vueTsEslintConfig(),
|
|
@@ -14,6 +19,14 @@ export default [
|
|
|
14
19
|
vuePrettierConfig,
|
|
15
20
|
|
|
16
21
|
{
|
|
22
|
+
settings: {
|
|
23
|
+
"import/resolver": {
|
|
24
|
+
typescript: {
|
|
25
|
+
alwaysTryTypes: true,
|
|
26
|
+
project: "./tsconfig.json",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
17
30
|
rules: {
|
|
18
31
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
19
32
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
@@ -26,6 +39,13 @@ export default [
|
|
|
26
39
|
"vue/require-default-prop": "off",
|
|
27
40
|
"vue/no-v-html": "off",
|
|
28
41
|
"vue/no-template-shadow": "off",
|
|
42
|
+
// Vite serves `public/` at the site root, so these are not module paths.
|
|
43
|
+
"import/no-unresolved": ["error", { ignore: ["^/assets/"] }],
|
|
44
|
+
// TypeScript already covers these, and the rules parse dependency
|
|
45
|
+
// sources with espree, which chokes on modern syntax in `dist` output.
|
|
46
|
+
"import/namespace": "off",
|
|
47
|
+
"import/default": "off",
|
|
48
|
+
"import/no-named-as-default-member": "off",
|
|
29
49
|
},
|
|
30
50
|
},
|
|
31
51
|
];
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
This guide describes the process of generating an API client to access the VC Platform API from your custom application.
|
|
6
6
|
|
|
7
7
|
!!! note
|
|
8
|
-
|
|
8
|
+
Platform Manager REST Client offers generated REST API methods that make it easy to interact with the existing VirtoCommerce Platform API.
|
|
9
9
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
- .NET Core 6.0, particularly if you are using MacOS or Linux.
|
|
13
13
|
|
|
14
14
|
## Generate TypeScript API clients
|
|
15
15
|
|
|
@@ -22,6 +22,7 @@ Using command
|
|
|
22
22
|
```bash
|
|
23
23
|
yarn add @vc-shell/api-client-generator cross-env
|
|
24
24
|
```
|
|
25
|
+
|
|
25
26
|
<br>
|
|
26
27
|
|
|
27
28
|
`cross-env` runs scripts that set and use environment variables across platforms.
|
|
@@ -44,44 +45,44 @@ Add the dependencies to your project's **package.json**:
|
|
|
44
45
|
|
|
45
46
|
2. Configure client generation in your project. Inside your project's **package.json** file, add a `"generate-api-client"` command to the list of scripts:
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
```title="vc-app-extend/package.json" linenums="1"
|
|
49
|
+
{
|
|
50
|
+
"scripts": {
|
|
51
|
+
...
|
|
52
|
+
"generate-api-client": cross-env api-client-generator --APP_PLATFORM_MODULES='[MarketplaceVendor,Catalog,Orders]' --APP_API_CLIENT_DIRECTORY=./src/api_client/
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The options are listed in the table below:
|
|
58
|
+
|
|
59
|
+
| Options | Description | Example |
|
|
60
|
+
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
61
|
+
| `--APP_PLATFORM_MODULES` | Platform modules to generate API client.<br>{==string[]==} <br> Customize the `--APP_PLATFORM_MODULES` list<br>to match your project's requirements. | `--APP_PLATFORM_MODULES='[MarketplaceVendor,Orders,Catalog]'` |
|
|
62
|
+
| `--APP_API_CLIENT_DIRECTORY` | Output directory for generated API clients. <br>{==string==} | `--APP_API_CLIENT_DIRECTORY=./src/api_client/` |
|
|
63
|
+
| `--APP_PLATFORM_URL` | Platform URL to obtain client API configs. <br>{==string==} | `--APP_PLATFORM_URL=https://vcmp-dev.govirto.com/` |
|
|
64
|
+
| `--APP_PACKAGE_NAME` | Package name for generated API clients. <br>{==string==} | `--APP_PACKAGE_NAME=vc-app-extend` |
|
|
65
|
+
| `--APP_PACKAGE_VERSION` | Package version for generated API clients. <br>{==string==} | `--APP_PACKAGE_VERSION=1.0.0` |
|
|
66
|
+
| `--APP_TYPE_STYLE` | Sets the type style for generated DTOs. Can be 'Class' or 'Interface'.<br>{==string==} | `--APP_TYPE_STYLE=Interface` |
|
|
67
|
+
| `--APP_OUT_DIR` | Output directory for generated API clients. <br>{==string==} | `--APP_OUT_DIR=./src/api_client/` |
|
|
68
|
+
| `--APP_BUILD_DIR` | Directory where TypeScript files will be compiled. <br>{==string==} | `--APP_BUILD_DIR=lib` (default is "dist") |
|
|
69
|
+
| `--SKIP_BUILD` | Skip build step. <br>{==boolean==} | `--SKIP_BUILD=true` |
|
|
70
|
+
| `--VERBOSE` | Enable verbose logging. <br>{==boolean==} | `--VERBOSE=true` |
|
|
70
71
|
|
|
71
72
|
3. Configure Platform URL to ensure your project can access the platform's API configurations. Add the platform URL to your project's **.env** file:
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
```title="vc-app-extend/.env"
|
|
75
|
+
APP_PLATFORM_URL=https://vcmp-dev.govirto.com/
|
|
76
|
+
```
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
!!! note
|
|
79
|
+
Alternatively, you can specify the Platform URL as a command option in the previous step when running the `"generate-api-client"` command.
|
|
79
80
|
|
|
80
81
|
4. Generate the API clients using the following command:
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
```
|
|
84
|
+
yarn generate-api-client
|
|
85
|
+
```
|
|
85
86
|
|
|
86
87
|
This command generates the required API clients for your custom application. Now you can effortlessly access the VC Platform API from your custom application using the generated API client.
|
|
87
88
|
|
|
@@ -112,7 +113,7 @@ API client now includes metadata to track the generation:
|
|
|
112
113
|
|
|
113
114
|
The generator handles multiple API clients effectively:
|
|
114
115
|
|
|
115
|
-
- Creates standardized exports with both short names (`./{moduleName}`) and full names (`./virtocommerce.{moduleName}`)
|
|
116
|
+
- Creates standardized exports with both short names (`./{moduleName}`) and full names (`./virtocommerce.{moduleName}`)
|
|
116
117
|
- Prevents duplicate module exports by intelligently merging with existing ones
|
|
117
118
|
- Automatically removes `module` and `types` fields that conflict with multiple exports
|
|
118
119
|
- Works properly with incremental generation (can add new APIs without breaking existing ones)
|
|
@@ -129,11 +130,11 @@ This enables both simple usage for single-API packages and proper subpath export
|
|
|
129
130
|
|
|
130
131
|
```js
|
|
131
132
|
// Single API package (using root export)
|
|
132
|
-
import { MyClient } from
|
|
133
|
+
import { MyClient } from "@myapp/api";
|
|
133
134
|
|
|
134
135
|
// Multi-API package (using subpath exports)
|
|
135
|
-
import { ClientA } from
|
|
136
|
-
import { ClientB } from
|
|
136
|
+
import { ClientA } from "@myapp/api/moduleA";
|
|
137
|
+
import { ClientB } from "@myapp/api/moduleB";
|
|
137
138
|
```
|
|
138
139
|
|
|
139
140
|
### Directory Creation
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { App } from "vue";
|
|
1
|
+
import { App<% if (dashboard) { %>, markRaw<% } %> } from "vue";
|
|
2
2
|
<% if (dashboard) { -%>
|
|
3
3
|
import { addMenuItem, registerDashboardWidget } from "@vc-shell/framework";
|
|
4
|
-
import { markRaw } from "vue";
|
|
5
4
|
import Welcome from "./components/dashboard-widgets/Welcome.vue";
|
|
6
5
|
<% } -%>
|
|
7
6
|
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
-
// eslint-disable-next-line import/no-unresolved
|
|
18
17
|
import Welcome from "/assets/welcome.png";
|
|
19
18
|
</script>
|
|
20
19
|
|
|
@@ -40,7 +39,7 @@ import Welcome from "/assets/welcome.png";
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
&__welcome-description {
|
|
43
|
-
@apply tw-whitespace-break-spaces tw-text-
|
|
42
|
+
@apply tw-whitespace-break-spaces tw-text-sm tw-max-w-[90%] tw-mx-auto tw-leading-5 tw-font-semibold;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
</style>
|
|
@@ -18,6 +18,7 @@ const isReady = ref(false);
|
|
|
18
18
|
const version = import.meta.env.PACKAGE_VERSION;
|
|
19
19
|
|
|
20
20
|
const { isAuthenticated } = useUser();
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO example below
|
|
21
22
|
const { setBroadcastFilter } = useBroadcastFilter();
|
|
22
23
|
|
|
23
24
|
onMounted(async () => {
|
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
import { RouteRecordRaw } from "vue-router";
|
|
2
2
|
import App from "../pages/App.vue";
|
|
3
|
-
<% if (dashboard) {
|
|
3
|
+
<%_ if (dashboard) { -%>
|
|
4
4
|
import Dashboard from "../pages/Dashboard.vue";
|
|
5
|
-
<% }
|
|
5
|
+
<%_ } -%>
|
|
6
6
|
import { Invite, Login, ResetPassword, ForgotPassword, ChangePasswordPage } from "@vc-shell/framework";
|
|
7
|
-
// eslint-disable-next-line import/no-unresolved
|
|
8
7
|
import whiteLogoImage from "/assets/logo-white.svg";
|
|
9
|
-
|
|
10
|
-
import bgImage from "/assets/background.jpg";
|
|
8
|
+
<%_ if (tenantRoutes) { -%>
|
|
11
9
|
|
|
12
|
-
<% if (tenantRoutes) { %>
|
|
13
10
|
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
|
-
<% }
|
|
11
|
+
<%_ } -%>
|
|
15
12
|
|
|
16
13
|
export const routes: RouteRecordRaw[] = [
|
|
17
14
|
{
|
|
18
|
-
<% if (tenantRoutes) {
|
|
15
|
+
<%_ if (tenantRoutes) { -%>
|
|
19
16
|
path: `/:tenantId(${tenantIdRegex})?`,
|
|
20
|
-
<% } else {
|
|
17
|
+
<%_ } else { -%>
|
|
21
18
|
path: "/",
|
|
22
|
-
<% }
|
|
19
|
+
<%_ } -%>
|
|
23
20
|
component: App,
|
|
24
21
|
name: "App",
|
|
25
22
|
meta: {
|
|
26
23
|
root: true,
|
|
27
24
|
},
|
|
28
25
|
children: [
|
|
29
|
-
<% if (dashboard) {
|
|
26
|
+
<%_ if (dashboard) { -%>
|
|
30
27
|
{
|
|
31
28
|
name: "Dashboard",
|
|
32
29
|
path: "",
|
|
33
|
-
<% if (tenantRoutes) {
|
|
30
|
+
<%_ if (tenantRoutes) { -%>
|
|
34
31
|
alias: `/:tenantId(${tenantIdRegex})?`,
|
|
35
|
-
<% } else {
|
|
32
|
+
<%_ } else { -%>
|
|
36
33
|
alias: "/",
|
|
37
|
-
<% }
|
|
34
|
+
<%_ } -%>
|
|
38
35
|
component: Dashboard,
|
|
39
36
|
},
|
|
40
|
-
<% }
|
|
37
|
+
<%_ } -%>
|
|
41
38
|
],
|
|
42
39
|
},
|
|
43
40
|
{
|
|
@@ -4,14 +4,7 @@
|
|
|
4
4
|
"baseUrl": ".",
|
|
5
5
|
"outDir": "dist",
|
|
6
6
|
"rootDir": "src",
|
|
7
|
-
"types": [
|
|
8
|
-
"vite/client",
|
|
9
|
-
"@vc-shell/framework/globals"
|
|
10
|
-
]
|
|
7
|
+
"types": ["vite/client", "@vc-shell/framework/globals"]
|
|
11
8
|
},
|
|
12
|
-
"include": [
|
|
13
|
-
"./src/**/*.ts",
|
|
14
|
-
"./src/**/*.vue",
|
|
15
|
-
"./src/**/*.json"
|
|
16
|
-
]
|
|
9
|
+
"include": ["./src/**/*.ts", "./src/**/*.vue", "./src/**/*.json"]
|
|
17
10
|
}
|
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.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/ejs": "^3.1.5",
|
|
18
18
|
"@types/prompts": "^2.4.4",
|
|
19
|
-
"@vc-shell/ts-config": "2.
|
|
19
|
+
"@vc-shell/ts-config": "2.5.0",
|
|
20
20
|
"copyfiles": "^2.4.1",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
22
|
"shx": "^0.3.4",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ejs": "^3.1.10",
|
|
27
|
-
"magicast": "^0.3.5",
|
|
28
27
|
"mri": "^1.2.0",
|
|
29
28
|
"picocolors": "^1.1.1",
|
|
29
|
+
"prettier": "^3.6.2",
|
|
30
30
|
"prompts": "^2.4.2",
|
|
31
31
|
"tslib": "^2.5.3",
|
|
32
32
|
"vite": "^6.3.3",
|