@vuepress/client 2.0.0-beta.62 → 2.0.0-beta.64

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/app.js CHANGED
@@ -57,8 +57,21 @@ var createRoutes = () => pagesRoutes.reduce(
57
57
  component: Vuepress,
58
58
  meta
59
59
  },
60
+ {
61
+ path: path.endsWith("/") ? (
62
+ // redirect from `/index.html` to `/`
63
+ path + "index.html"
64
+ ) : (
65
+ // redirect from `/foo` to `/foo.html`
66
+ path.substring(0, path.length - 5)
67
+ ),
68
+ redirect: path
69
+ },
60
70
  ...redirects.map((item) => ({
61
- path: item,
71
+ path: item === ":md" ? (
72
+ // redirect from `/foo.md` to `/foo.html`
73
+ path.substring(0, path.length - 5) + ".md"
74
+ ) : item,
62
75
  redirect: path
63
76
  }))
64
77
  );
@@ -107,15 +120,12 @@ var setupGlobalComponents = (app) => {
107
120
  };
108
121
 
109
122
  // src/setupGlobalComputed.ts
110
- import { computed, ref, watch } from "vue";
123
+ import { computedEager } from "@vueuse/core";
124
+ import { computed } from "vue";
111
125
  var setupGlobalComputed = (app, router, clientConfigs2) => {
112
- const routePath = ref(router.currentRoute.value.path);
113
- watch(
114
- () => router.currentRoute.value.path,
115
- (value) => routePath.value = value
116
- );
117
126
  const layouts = computed(() => resolvers.resolveLayouts(clientConfigs2));
118
- const routeLocale = computed(
127
+ const routePath = computedEager(() => router.currentRoute.value.path);
128
+ const routeLocale = computedEager(
119
129
  () => resolvers.resolveRouteLocale(siteData.value.locales, routePath.value)
120
130
  );
121
131
  const siteLocaleData = computed(
@@ -173,7 +183,7 @@ var setupGlobalComputed = (app, router, clientConfigs2) => {
173
183
 
174
184
  // src/setupUpdateHead.ts
175
185
  import { isPlainObject, isString } from "@vuepress/shared";
176
- import { onMounted, provide, ref as ref2, useSSRContext, watch as watch2 } from "vue";
186
+ import { onMounted, provide, ref, useSSRContext, watch } from "vue";
177
187
  var setupUpdateHead = () => {
178
188
  const head = usePageHead();
179
189
  const lang = usePageLang();
@@ -185,7 +195,7 @@ var setupUpdateHead = () => {
185
195
  }
186
196
  return;
187
197
  }
188
- const headTags = ref2([]);
198
+ const headTags = ref([]);
189
199
  const loadHead = () => {
190
200
  head.value.forEach((item) => {
191
201
  const tag = queryHeadTag(item);
@@ -214,10 +224,7 @@ var setupUpdateHead = () => {
214
224
  onMounted(() => {
215
225
  loadHead();
216
226
  updateHead();
217
- watch2(
218
- () => head.value,
219
- () => updateHead()
220
- );
227
+ watch(() => head.value, updateHead);
221
228
  });
222
229
  };
223
230
  var queryHeadTag = ([
package/dist/index.d.ts CHANGED
@@ -204,7 +204,7 @@ type RouteLocale = string;
204
204
  /**
205
205
  * Ref wrapper of `RouteLocale`
206
206
  */
207
- type RouteLocaleRef = ComputedRef<RouteLocale>;
207
+ type RouteLocaleRef = Readonly<Ref<RouteLocale>>;
208
208
  /**
209
209
  * Injection key for page route locale path
210
210
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/client",
3
- "version": "2.0.0-beta.62",
3
+ "version": "2.0.0-beta.64",
4
4
  "description": "Client package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -34,9 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@vue/devtools-api": "^6.5.0",
37
- "vue": "^3.3.1",
38
- "vue-router": "^4.2.0",
39
- "@vuepress/shared": "2.0.0-beta.62"
37
+ "@vueuse/core": "^10.2.1",
38
+ "vue": "^3.3.4",
39
+ "vue-router": "^4.2.2",
40
+ "@vuepress/shared": "2.0.0-beta.64"
40
41
  },
41
42
  "publishConfig": {
42
43
  "access": "public"