@vc-shell/create-vc-app 1.0.110 → 1.0.112

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 CHANGED
@@ -1,3 +1,16 @@
1
+ ## [1.0.112](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.111...v1.0.112) (2023-10-24)
2
+
3
+
4
+
5
+ ## [1.0.111](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.110...v1.0.111) (2023-10-17)
6
+
7
+
8
+ ### Features
9
+
10
+ * dynamic modules ([ed4af3a](https://github.com/VirtoCommerce/vc-shell/commit/ed4af3ad65e47b0d633d6e2eb23e9c90d73ff50d))
11
+
12
+
13
+
1
14
  ## [1.0.110](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.109...v1.0.110) (2023-10-16)
2
15
 
3
16
 
@@ -2,4 +2,5 @@ APP_LOG_ENABLED=true
2
2
  APP_LOG_LEVEL=debug
3
3
  APP_PLATFORM_URL=https://vcmp-dev.paas.govirto.com/
4
4
  APP_PLATFORM_MODULES=[]
5
+ APP_API_CLIENT_DIRECTORY=./src/api_client/
5
6
  APP_BASE_PATH=/apps/<%= appName %>/
@@ -15,6 +15,8 @@ module.exports = {
15
15
  ],
16
16
  parser: "vue-eslint-parser",
17
17
  parserOptions: {
18
+ parser: "@typescript-eslint/parser",
19
+ sourceType: "module",
18
20
  node: true,
19
21
  },
20
22
  settings: {
@@ -9,5 +9,6 @@
9
9
  ],
10
10
  "i18n-ally.localesPaths": [
11
11
  "src/locales",
12
- ]
12
+ ],
13
+ "typescript.preferences.importModuleSpecifier": "relative",
13
14
  }
@@ -13,7 +13,7 @@
13
13
  "lint-staged": "lint-staged",
14
14
  "generate-api-client": "cross-env api-client-generator --color",
15
15
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
16
- "bump": "cross-env-shell 'f() { yarn version --\"$@\" --no-commit-hooks --ignore-scripts --no-git-tag-version --yes && yarn changelog && git add . && yarn commit-release && yarn create:tag ; }; f'",
16
+ "bump": "cross-env-shell 'f() { yarn workspaces foreach --topological version --deferred \"$@\" && yarn version apply --all && yarn run changelog && yarn workspaces foreach -v exec git add . && yarn run commit-release && yarn create:tag ; }; f'",
17
17
  "commit-release": "cross-env-shell 'git commit -m v$npm_package_version'",
18
18
  "create:tag": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$PACKAGE_VERSION && git push --tags"
19
19
  },
@@ -49,9 +49,9 @@
49
49
  "vite": "^4.3.9",
50
50
  "vite-plugin-checker": "^0.6.0",
51
51
  "vite-plugin-mkcert": "^1.15.0",
52
- "vite-plugin-pwa": "^0.14.7",
52
+ "vite-plugin-pwa": "^0.16.5",
53
53
  "vue-eslint-parser": "^9.3.0",
54
- "vue-tsc": "~1.6.5"
54
+ "vue-tsc": "^1.8.19"
55
55
  },
56
56
  "dependencies": {
57
57
  "@fortawesome/fontawesome-free": "^5.15.3",
@@ -1,4 +1,4 @@
1
- import VirtoShellFramework, { notification } from "@vc-shell/framework";
1
+ import VirtoShellFramework, { notification, useUser } from "@vc-shell/framework";
2
2
  import { createApp } from "vue";
3
3
  import { router } from "./router";
4
4
  import * as locales from "./locales";
@@ -16,26 +16,33 @@ import "@fortawesome/fontawesome-free/css/all.min.css";
16
16
  import "roboto-fontface/css/roboto/roboto-fontface.css";
17
17
  import "@vc-shell/framework/dist/index.css";
18
18
 
19
- const app = createApp(RouterView)
20
- .use(VirtoShellFramework<% if(commonPages === true) { -%>, {
21
- useLogin,
22
- }<% } -%>)
23
- <% if(bladeModuleStarter === true) { -%>
24
- .use(Default, { router })
25
- <% } -%>
19
+ async function startApp() {
20
+ const { loadUser } = useUser();
26
21
 
27
- .use(router)
22
+ await loadUser();
28
23
 
29
- Object.entries(locales).forEach(([key, message]) => {
30
- app.config.globalProperties.$mergeLocaleMessage(key, message);
31
- });
24
+ const app = createApp(RouterView)
25
+ .use(VirtoShellFramework)
26
+ <% if(bladeModuleStarter === true) { -%>
27
+ .use(Default, { router })
28
+ <% } -%>
29
+ .use(router)
32
30
 
33
- app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
34
-
35
- app.config.errorHandler = (err) => {
36
- notification.error(err.toString(), {
37
- timeout: 5000,
31
+ Object.entries(locales).forEach(([key, message]) => {
32
+ app.config.globalProperties.$mergeLocaleMessage(key, message);
38
33
  });
39
- };
40
34
 
41
- app.mount("#app");
35
+ app.provide("platformUrl", import.meta.env.APP_PLATFORM_URL);
36
+
37
+ app.config.errorHandler = (err) => {
38
+ notification.error(err.toString(), {
39
+ timeout: 5000,
40
+ });
41
+ };
42
+
43
+ await router.isReady();
44
+
45
+ app.mount("#app");
46
+ }
47
+
48
+ startApp()
@@ -1,6 +1,7 @@
1
1
  import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
2
2
  <% if(commonPages === true || bladeModuleStarter === true) { -%>
3
3
  import { inject } from "vue";
4
+ import { useLogin } from "../composables";
4
5
  <% } -%>
5
6
  import {
6
7
  usePermissions,
@@ -13,7 +14,6 @@ import {
13
14
  ResetPassword,
14
15
  Invite,
15
16
  <% } -%>} from "@vc-shell/framework";
16
- import { useCookies } from "@vueuse/integrations/useCookies";
17
17
 
18
18
  /**
19
19
  * Pages
@@ -53,6 +53,7 @@ const routes: RouteRecordRaw[] = [
53
53
  name: "Login",
54
54
  component: Login,
55
55
  props: () => ({
56
+ composable: useLogin,
56
57
  logo: whiteLogoImage,
57
58
  background: bgImage,
58
59
  title: "<%= appName %>",
@@ -97,7 +98,7 @@ export const router = createRouter({
97
98
 
98
99
  <% if(commonPages === true || bladeModuleStarter === true) { -%>
99
100
  router.beforeEach(async (to, from) => {
100
- const { fetchUserPermissions, checkPermission } = usePermissions();
101
+ const { hasAccess } = usePermissions();
101
102
  const { resolveBlades } = useBladeNavigation();
102
103
  const { isAuthenticated } = useUser();
103
104
  const pages = inject<BladePageComponent[]>("pages");
@@ -105,16 +106,13 @@ router.beforeEach(async (to, from) => {
105
106
  <% if(commonPages === true) { -%>
106
107
  if (to.name !== "Login" && to.name !== "ResetPassword" && to.name !== "Invite") {
107
108
  try {
108
- // Fetch permissions if not any
109
- await fetchUserPermissions();
110
-
111
109
  const component = pages.find((blade) => blade?.url === to.path);
112
110
 
113
- const hasAccess = checkPermission(component?.permissions);
111
+ const _hasAccess = hasAccess(component?.permissions);
114
112
 
115
113
  if (!(await isAuthenticated()) && to.name !== "Login") {
116
114
  return { name: "Login" };
117
- } else if (hasAccess && to.name !== "Login") {
115
+ } else if (_hasAccess && to.name !== "Login") {
118
116
  const resolvedBladeUrl = resolveBlades(to);
119
117
  return resolvedBladeUrl ? resolvedBladeUrl : true;
120
118
  } else if (!hasAccess) {
@@ -42,6 +42,6 @@ export default getApplicationConfiguration({
42
42
  splitVendorChunkPlugin(),
43
43
  ],
44
44
  optimizeDeps: {
45
- include: mode === "development" ? ["ace-builds", "client-oauth2", "quill-delta", "quill", "url-pattern"] : [],
45
+ include: mode === "development" ? ["ace-builds", "client-oauth2", "quill-delta", "quill", "url-pattern", "vee-validate"] : [],
46
46
  },
47
47
  });
@@ -6,4 +6,4 @@ export default createAppModule(pages, locales);
6
6
 
7
7
  export * from "./pages";
8
8
  export * from "./composables";
9
- //export * from "./components";
9
+ // export * from "./components";
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.0.110",
4
+ "version": "1.0.112",
5
5
  "bin": "./dist/index.js",
6
6
  "files": [
7
7
  "src/template",