@vuepress/shared 2.0.0-beta.7 → 2.0.0-rc.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 (105) hide show
  1. package/dist/index.d.ts +266 -0
  2. package/dist/index.js +128 -0
  3. package/package.json +32 -13
  4. package/CHANGELOG.md +0 -160
  5. package/lib/esm/index.d.ts +0 -2
  6. package/lib/esm/index.js +0 -2
  7. package/lib/esm/types/head.d.ts +0 -27
  8. package/lib/esm/types/head.js +0 -1
  9. package/lib/esm/types/index.d.ts +0 -5
  10. package/lib/esm/types/index.js +0 -5
  11. package/lib/esm/types/locale.d.ts +0 -13
  12. package/lib/esm/types/locale.js +0 -1
  13. package/lib/esm/types/page.d.ts +0 -70
  14. package/lib/esm/types/page.js +0 -1
  15. package/lib/esm/types/site.d.ts +0 -42
  16. package/lib/esm/types/site.js +0 -1
  17. package/lib/esm/types/ssr.d.ts +0 -8
  18. package/lib/esm/types/ssr.js +0 -1
  19. package/lib/esm/utils/dedupeHead.d.ts +0 -7
  20. package/lib/esm/utils/dedupeHead.js +0 -18
  21. package/lib/esm/utils/ensureEndingSlash.d.ts +0 -4
  22. package/lib/esm/utils/ensureEndingSlash.js +0 -4
  23. package/lib/esm/utils/ensureLeadingSlash.d.ts +0 -4
  24. package/lib/esm/utils/ensureLeadingSlash.js +0 -4
  25. package/lib/esm/utils/formatDateString.d.ts +0 -4
  26. package/lib/esm/utils/formatDateString.js +0 -14
  27. package/lib/esm/utils/htmlEscape.d.ts +0 -4
  28. package/lib/esm/utils/htmlEscape.js +0 -12
  29. package/lib/esm/utils/htmlUnescape.d.ts +0 -4
  30. package/lib/esm/utils/htmlUnescape.js +0 -17
  31. package/lib/esm/utils/index.d.ts +0 -18
  32. package/lib/esm/utils/index.js +0 -18
  33. package/lib/esm/utils/isLinkExternal.d.ts +0 -4
  34. package/lib/esm/utils/isLinkExternal.js +0 -15
  35. package/lib/esm/utils/isLinkHttp.d.ts +0 -8
  36. package/lib/esm/utils/isLinkHttp.js +0 -8
  37. package/lib/esm/utils/isLinkMailto.d.ts +0 -4
  38. package/lib/esm/utils/isLinkMailto.js +0 -4
  39. package/lib/esm/utils/isLinkTel.d.ts +0 -4
  40. package/lib/esm/utils/isLinkTel.js +0 -4
  41. package/lib/esm/utils/isPlainObject.d.ts +0 -4
  42. package/lib/esm/utils/isPlainObject.js +0 -4
  43. package/lib/esm/utils/normalizePackageName.d.ts +0 -4
  44. package/lib/esm/utils/normalizePackageName.js +0 -37
  45. package/lib/esm/utils/removeEndingSlash.d.ts +0 -4
  46. package/lib/esm/utils/removeEndingSlash.js +0 -4
  47. package/lib/esm/utils/removeLeadingSlash.d.ts +0 -4
  48. package/lib/esm/utils/removeLeadingSlash.js +0 -4
  49. package/lib/esm/utils/resolveHeadIdentifier.d.ts +0 -5
  50. package/lib/esm/utils/resolveHeadIdentifier.js +0 -18
  51. package/lib/esm/utils/resolveLocalePath.d.ts +0 -5
  52. package/lib/esm/utils/resolveLocalePath.js +0 -18
  53. package/lib/esm/utils/resolveRoutePathFromUrl.d.ts +0 -1
  54. package/lib/esm/utils/resolveRoutePathFromUrl.js +0 -5
  55. package/lib/index.d.ts +0 -2
  56. package/lib/index.js +0 -14
  57. package/lib/tsconfig.esm.tsbuildinfo +0 -2410
  58. package/lib/types/head.d.ts +0 -27
  59. package/lib/types/head.js +0 -2
  60. package/lib/types/index.d.ts +0 -5
  61. package/lib/types/index.js +0 -17
  62. package/lib/types/locale.d.ts +0 -13
  63. package/lib/types/locale.js +0 -2
  64. package/lib/types/page.d.ts +0 -70
  65. package/lib/types/page.js +0 -2
  66. package/lib/types/site.d.ts +0 -42
  67. package/lib/types/site.js +0 -2
  68. package/lib/types/ssr.d.ts +0 -8
  69. package/lib/types/ssr.js +0 -2
  70. package/lib/utils/dedupeHead.d.ts +0 -7
  71. package/lib/utils/dedupeHead.js +0 -22
  72. package/lib/utils/ensureEndingSlash.d.ts +0 -4
  73. package/lib/utils/ensureEndingSlash.js +0 -8
  74. package/lib/utils/ensureLeadingSlash.d.ts +0 -4
  75. package/lib/utils/ensureLeadingSlash.js +0 -8
  76. package/lib/utils/formatDateString.d.ts +0 -4
  77. package/lib/utils/formatDateString.js +0 -18
  78. package/lib/utils/htmlEscape.d.ts +0 -4
  79. package/lib/utils/htmlEscape.js +0 -16
  80. package/lib/utils/htmlUnescape.d.ts +0 -4
  81. package/lib/utils/htmlUnescape.js +0 -21
  82. package/lib/utils/index.d.ts +0 -18
  83. package/lib/utils/index.js +0 -35
  84. package/lib/utils/isLinkExternal.d.ts +0 -4
  85. package/lib/utils/isLinkExternal.js +0 -19
  86. package/lib/utils/isLinkHttp.d.ts +0 -8
  87. package/lib/utils/isLinkHttp.js +0 -12
  88. package/lib/utils/isLinkMailto.d.ts +0 -4
  89. package/lib/utils/isLinkMailto.js +0 -8
  90. package/lib/utils/isLinkTel.d.ts +0 -4
  91. package/lib/utils/isLinkTel.js +0 -8
  92. package/lib/utils/isPlainObject.d.ts +0 -4
  93. package/lib/utils/isPlainObject.js +0 -8
  94. package/lib/utils/normalizePackageName.d.ts +0 -4
  95. package/lib/utils/normalizePackageName.js +0 -41
  96. package/lib/utils/removeEndingSlash.d.ts +0 -4
  97. package/lib/utils/removeEndingSlash.js +0 -8
  98. package/lib/utils/removeLeadingSlash.d.ts +0 -4
  99. package/lib/utils/removeLeadingSlash.js +0 -8
  100. package/lib/utils/resolveHeadIdentifier.d.ts +0 -5
  101. package/lib/utils/resolveHeadIdentifier.js +0 -22
  102. package/lib/utils/resolveLocalePath.d.ts +0 -5
  103. package/lib/utils/resolveLocalePath.js +0 -22
  104. package/lib/utils/resolveRoutePathFromUrl.d.ts +0 -1
  105. package/lib/utils/resolveRoutePathFromUrl.js +0 -9
@@ -0,0 +1,266 @@
1
+ import { MarkdownItHeader } from '@mdit-vue/types';
2
+ export { isArray, isFunction, isString } from '@vue/shared';
3
+
4
+ /**
5
+ * Config for `<head>` tags
6
+ */
7
+ type HeadConfig = [HeadTagEmpty, HeadAttrsConfig] | [HeadTagNonEmpty, HeadAttrsConfig, string];
8
+ /**
9
+ * Allowed tags in `<head>`
10
+ *
11
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
12
+ */
13
+ type HeadTag = HeadTagNonEmpty | HeadTagEmpty;
14
+ /**
15
+ * Non-empty tags in `<head>`
16
+ */
17
+ type HeadTagNonEmpty = 'title' | 'style' | 'script' | 'noscript' | 'template';
18
+ /**
19
+ * Empty tags in `<head>`
20
+ */
21
+ type HeadTagEmpty = 'base' | 'link' | 'meta' | 'script';
22
+ /**
23
+ * Attributes to be set for tags in `<head>`
24
+ */
25
+ type HeadAttrsConfig = Record<string, string | boolean>;
26
+
27
+ /**
28
+ * Locales config, a key-value object
29
+ *
30
+ * - Key is the locale path (prefix)
31
+ * - Value is the locales data
32
+ *
33
+ * @remark suffix `Config` means this is for user config
34
+ */
35
+ type LocaleConfig<T extends LocaleData = LocaleData> = Record<string, Partial<T>>;
36
+ /**
37
+ * Locales data
38
+ */
39
+ type LocaleData = Record<never, never>;
40
+
41
+ /**
42
+ * Base type of vuepress page
43
+ */
44
+ interface PageBase<ExtraPageFrontmatter extends Record<any, any> = Record<string, unknown>> {
45
+ /**
46
+ * Identifier of the page
47
+ *
48
+ * Will also be used as the component name
49
+ *
50
+ * @example 'v-foobar'
51
+ */
52
+ key: string;
53
+ /**
54
+ * Route path of the page
55
+ *
56
+ * Firstly inferred from the file path
57
+ *
58
+ * Might be overridden by permalink
59
+ *
60
+ * @example '/guide/index.html'
61
+ * @example '/2020/02/02/hello-world.html'
62
+ */
63
+ path: string;
64
+ /**
65
+ * Title of the page
66
+ */
67
+ title: string;
68
+ /**
69
+ * Language of the page
70
+ */
71
+ lang: string;
72
+ /**
73
+ * Front matter of the page
74
+ */
75
+ frontmatter: PageFrontmatter<ExtraPageFrontmatter>;
76
+ /**
77
+ * Headers of the page
78
+ */
79
+ headers: PageHeader[];
80
+ }
81
+ /**
82
+ * Vuepress page data
83
+ */
84
+ type PageData<ExtraPageData extends Record<any, any> = Record<never, never>, ExtraPageFrontmatter extends Record<any, any> = Record<string, unknown>> = PageBase<ExtraPageFrontmatter> & ExtraPageData;
85
+ /**
86
+ * Vuepress page frontmatter
87
+ *
88
+ * Notice that frontmatter is parsed from yaml or other languages,
89
+ * so we cannot guarantee the type safety
90
+ */
91
+ type PageFrontmatter<T extends Record<any, any> = Record<string, unknown>> = Partial<T> & {
92
+ date?: string | Date;
93
+ description?: string;
94
+ head?: HeadConfig[];
95
+ lang?: string;
96
+ layout?: string;
97
+ permalink?: string;
98
+ permalinkPattern?: string | null;
99
+ routeMeta?: Record<string, unknown>;
100
+ title?: string;
101
+ };
102
+ /**
103
+ * Vuepress page header
104
+ */
105
+ type PageHeader = MarkdownItHeader;
106
+
107
+ /**
108
+ * Vuepress site data
109
+ */
110
+ interface SiteData extends SiteLocaleData {
111
+ /**
112
+ * The base URL the site will be deployed at
113
+ *
114
+ * It should always start and end with a slash
115
+ *
116
+ * @default '/'
117
+ */
118
+ base: '/' | `/${string}/`;
119
+ /**
120
+ * Specify locales for i18n support
121
+ *
122
+ * It will override the root-level site data in different subpath
123
+ *
124
+ * @example
125
+ * {
126
+ * '/en/': {
127
+ * lang: 'en-US',
128
+ * title: 'Hello',
129
+ * description: 'This will take effect under /en/ subpath',
130
+ * },
131
+ * '/zh/': {
132
+ * lang: 'zh-CN',
133
+ * title: '你好',
134
+ * description: '它将会在 /zh/ 子路径下生效',
135
+ * }
136
+ * }
137
+ */
138
+ locales: SiteLocaleConfig;
139
+ }
140
+ /**
141
+ * Locales data of vuepress site
142
+ *
143
+ * If they are set in the root of site data, they will be used
144
+ * as the default value
145
+ *
146
+ * If they are set in the `locales` of site data, they will be
147
+ * used for specific locale
148
+ */
149
+ interface SiteLocaleData {
150
+ /**
151
+ * Language for the site
152
+ *
153
+ * @default 'en-US'
154
+ */
155
+ lang: string;
156
+ /**
157
+ * Title for the site
158
+ *
159
+ * @default ''
160
+ */
161
+ title: string;
162
+ /**
163
+ * Description for the site
164
+ *
165
+ * @default ''
166
+ */
167
+ description: string;
168
+ /**
169
+ * Head config
170
+ *
171
+ * Descibe the tags to be appended into the `<head>` tag
172
+ *
173
+ * @default []
174
+ *
175
+ * @example ['link', { rel: 'icon', href: '/logo.png' }]
176
+ * @example ['style', { type: 'text/css' }, 'p { color: red; }']
177
+ */
178
+ head: HeadConfig[];
179
+ }
180
+ /**
181
+ * Site locale config
182
+ */
183
+ type SiteLocaleConfig = LocaleConfig<SiteLocaleData>;
184
+
185
+ /**
186
+ * Context for SSR
187
+ */
188
+ interface VuepressSSRContext {
189
+ lang: string;
190
+ head: HeadConfig[];
191
+ }
192
+
193
+ /**
194
+ * Dedupe head config with identifier
195
+ *
196
+ * Items that appear earlier have higher priority
197
+ */
198
+ declare const dedupeHead: (head: HeadConfig[]) => HeadConfig[];
199
+
200
+ /**
201
+ * Ensure a url string to have leading slash /
202
+ */
203
+ declare const ensureLeadingSlash: (str: string) => string;
204
+
205
+ /**
206
+ * Ensure a url string to have ending slash /
207
+ */
208
+ declare const ensureEndingSlash: (str: string) => string;
209
+
210
+ /**
211
+ * Format a date string to `yyyy-MM-dd`
212
+ */
213
+ declare const formatDateString: (str: string, defaultDateString?: string) => string;
214
+
215
+ /**
216
+ * Determine a link is external or not
217
+ */
218
+ declare const isLinkExternal: (link: string, base?: string) => boolean;
219
+
220
+ /**
221
+ * Determine a link is http link or not
222
+ *
223
+ * - http://github.com
224
+ * - https://github.com
225
+ * - //github.com
226
+ */
227
+ declare const isLinkHttp: (link: string) => boolean;
228
+
229
+ /**
230
+ * Determine a link has protocol or not
231
+ */
232
+ declare const isLinkWithProtocol: (link: string) => boolean;
233
+
234
+ /**
235
+ * Check if a value is plain object, with generic type support
236
+ */
237
+ declare const isPlainObject: <T extends Record<any, any> = Record<any, any>>(val: unknown) => val is T;
238
+
239
+ /**
240
+ * Omit properties from an object
241
+ */
242
+ declare const omit: <T extends Record<string, unknown>, U extends string[]>(obj: T, ...keys: U) => Omit<T, U[number]>;
243
+
244
+ /**
245
+ * Remove ending slash / from a string
246
+ */
247
+ declare const removeEndingSlash: (str: string) => string;
248
+
249
+ /**
250
+ * Remove leading slash / from a string
251
+ */
252
+ declare const removeLeadingSlash: (str: string) => string;
253
+
254
+ /**
255
+ * Resolve identifier of a tag, to avoid duplicated tags in `<head>`
256
+ */
257
+ declare const resolveHeadIdentifier: ([tag, attrs, content,]: HeadConfig) => string;
258
+
259
+ /**
260
+ * Resolve the matched locale path of route path
261
+ */
262
+ declare const resolveLocalePath: (locales: LocaleConfig, routePath: string) => string;
263
+
264
+ declare const resolveRoutePathFromUrl: (url: string, base?: string) => string;
265
+
266
+ export { HeadAttrsConfig, HeadConfig, HeadTag, HeadTagEmpty, HeadTagNonEmpty, LocaleConfig, LocaleData, PageBase, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleConfig, SiteLocaleData, VuepressSSRContext, dedupeHead, ensureEndingSlash, ensureLeadingSlash, formatDateString, isLinkExternal, isLinkHttp, isLinkWithProtocol, isPlainObject, omit, removeEndingSlash, removeLeadingSlash, resolveHeadIdentifier, resolveLocalePath, resolveRoutePathFromUrl };
package/dist/index.js ADDED
@@ -0,0 +1,128 @@
1
+ // src/utils/index.ts
2
+ import { isArray, isFunction, isString } from "@vue/shared";
3
+
4
+ // src/utils/resolveHeadIdentifier.ts
5
+ var resolveHeadIdentifier = ([
6
+ tag,
7
+ attrs,
8
+ content
9
+ ]) => {
10
+ if (tag === "meta" && attrs.name) {
11
+ return `${tag}.${attrs.name}`;
12
+ }
13
+ if (["title", "base"].includes(tag)) {
14
+ return tag;
15
+ }
16
+ if (tag === "template" && attrs.id) {
17
+ return `${tag}.${attrs.id}`;
18
+ }
19
+ return JSON.stringify([tag, attrs, content]);
20
+ };
21
+
22
+ // src/utils/dedupeHead.ts
23
+ var dedupeHead = (head) => {
24
+ const identifierSet = /* @__PURE__ */ new Set();
25
+ const result = [];
26
+ head.forEach((item) => {
27
+ const identifier = resolveHeadIdentifier(item);
28
+ if (!identifierSet.has(identifier)) {
29
+ identifierSet.add(identifier);
30
+ result.push(item);
31
+ }
32
+ });
33
+ return result;
34
+ };
35
+
36
+ // src/utils/ensureLeadingSlash.ts
37
+ var ensureLeadingSlash = (str) => str[0] === "/" ? str : `/${str}`;
38
+
39
+ // src/utils/ensureEndingSlash.ts
40
+ var ensureEndingSlash = (str) => str[str.length - 1] === "/" || str.endsWith(".html") ? str : `${str}/`;
41
+
42
+ // src/utils/formatDateString.ts
43
+ var formatDateString = (str, defaultDateString = "") => {
44
+ const dateMatch = str.match(/\b(\d{4})-(\d{1,2})-(\d{1,2})\b/);
45
+ if (dateMatch === null) {
46
+ return defaultDateString;
47
+ }
48
+ const [, yearStr, monthStr, dayStr] = dateMatch;
49
+ return [yearStr, monthStr.padStart(2, "0"), dayStr.padStart(2, "0")].join("-");
50
+ };
51
+
52
+ // src/utils/isLinkHttp.ts
53
+ var isLinkHttp = (link) => /^(https?:)?\/\//.test(link);
54
+
55
+ // src/utils/isLinkExternal.ts
56
+ var markdownLinkRegexp = /.md((\?|#).*)?$/;
57
+ var isLinkExternal = (link, base = "/") => {
58
+ if (isLinkHttp(link)) {
59
+ return true;
60
+ }
61
+ if (link.startsWith("/") && !link.startsWith(base) && !markdownLinkRegexp.test(link)) {
62
+ return true;
63
+ }
64
+ return false;
65
+ };
66
+
67
+ // src/utils/isLinkWithProtocol.ts
68
+ var isLinkWithProtocol = (link) => /^[a-z][a-z0-9+.-]*:/.test(link);
69
+
70
+ // src/utils/isPlainObject.ts
71
+ var isPlainObject = (val) => Object.prototype.toString.call(val) === "[object Object]";
72
+
73
+ // src/utils/omit.ts
74
+ var omit = (obj, ...keys) => {
75
+ const result = { ...obj };
76
+ for (const key of keys) {
77
+ delete result[key];
78
+ }
79
+ return result;
80
+ };
81
+
82
+ // src/utils/removeEndingSlash.ts
83
+ var removeEndingSlash = (str) => str[str.length - 1] === "/" ? str.slice(0, -1) : str;
84
+
85
+ // src/utils/removeLeadingSlash.ts
86
+ var removeLeadingSlash = (str) => str[0] === "/" ? str.slice(1) : str;
87
+
88
+ // src/utils/resolveLocalePath.ts
89
+ var resolveLocalePath = (locales, routePath) => {
90
+ const localePaths = Object.keys(locales).sort((a, b) => {
91
+ const levelDelta = b.split("/").length - a.split("/").length;
92
+ if (levelDelta !== 0) {
93
+ return levelDelta;
94
+ }
95
+ return b.length - a.length;
96
+ });
97
+ for (const localePath of localePaths) {
98
+ if (routePath.startsWith(localePath)) {
99
+ return localePath;
100
+ }
101
+ }
102
+ return "/";
103
+ };
104
+
105
+ // src/utils/resolveRoutePathFromUrl.ts
106
+ var resolveRoutePathFromUrl = (url, base = "/") => {
107
+ const pathname = url.replace(/^(https?:)?\/\/[^/]*/, "");
108
+ return pathname.startsWith(base) ? `/${pathname.slice(base.length)}` : pathname;
109
+ };
110
+ export {
111
+ dedupeHead,
112
+ ensureEndingSlash,
113
+ ensureLeadingSlash,
114
+ formatDateString,
115
+ isArray,
116
+ isFunction,
117
+ isLinkExternal,
118
+ isLinkHttp,
119
+ isLinkWithProtocol,
120
+ isPlainObject,
121
+ isString,
122
+ omit,
123
+ removeEndingSlash,
124
+ removeLeadingSlash,
125
+ resolveHeadIdentifier,
126
+ resolveLocalePath,
127
+ resolveRoutePathFromUrl
128
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/shared",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-rc.0",
4
4
  "description": "Utils that shared between VuePress node and client",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -16,22 +16,41 @@
16
16
  "url": "git+https://github.com/vuepress/vuepress-next.git"
17
17
  },
18
18
  "license": "MIT",
19
- "author": "Evan You",
20
- "main": "lib/index.js",
21
- "module": "lib/esm/index.js",
22
- "types": "lib/index.d.ts",
19
+ "author": "meteorlxy",
20
+ "type": "module",
21
+ "exports": {
22
+ ".": "./dist/index.js",
23
+ "./package.json": "./package.json"
24
+ },
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
23
28
  "files": [
24
- "lib"
29
+ "dist"
25
30
  ],
26
- "scripts": {
27
- "build": "tsc -b tsconfig.build.json",
28
- "clean": "rimraf lib *.tsbuildinfo"
29
- },
30
31
  "dependencies": {
31
- "@vue/shared": "^3.0.11"
32
+ "@mdit-vue/types": "^1.0.0",
33
+ "@vue/shared": "^3.3.8"
32
34
  },
33
35
  "publishConfig": {
34
36
  "access": "public"
35
37
  },
36
- "gitHead": "f798c4df7489d7fbf27bf430ea547413e8655af4"
37
- }
38
+ "tsup": {
39
+ "clean": true,
40
+ "dts": "./src/index.ts",
41
+ "entry": [
42
+ "./src/index.ts"
43
+ ],
44
+ "format": [
45
+ "esm"
46
+ ],
47
+ "outDir": "./dist",
48
+ "sourcemap": false,
49
+ "target": "es2022",
50
+ "tsconfig": "../tsconfig.dts.json"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "clean": "rimraf dist"
55
+ }
56
+ }
package/CHANGELOG.md DELETED
@@ -1,160 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0-beta.7](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.6...v2.0.0-beta.7) (2021-04-09)
7
-
8
- **Note:** Version bump only for package @vuepress/shared
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.4](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.3...v2.0.0-beta.4) (2021-03-20)
15
-
16
- **Note:** Version bump only for package @vuepress/shared
17
-
18
-
19
-
20
-
21
-
22
- # [2.0.0-beta.1](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.0...v2.0.0-beta.1) (2021-03-13)
23
-
24
- **Note:** Version bump only for package @vuepress/shared
25
-
26
-
27
-
28
-
29
-
30
- # [2.0.0-beta.0](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.26...v2.0.0-beta.0) (2021-03-13)
31
-
32
- **Note:** Version bump only for package @vuepress/shared
33
-
34
-
35
-
36
-
37
-
38
- # [2.0.0-alpha.25](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.24...v2.0.0-alpha.25) (2021-02-20)
39
-
40
-
41
- ### Code Refactoring
42
-
43
- * **core:** remove theme data from site data ([187aef3](https://github.com/vuepress/vuepress-next/commit/187aef36607efc62d7b2d5c773553f89685cf64c))
44
-
45
-
46
- ### BREAKING CHANGES
47
-
48
- * **core:** `themeConfig` is not available in site data any more
49
-
50
-
51
-
52
-
53
-
54
- # [2.0.0-alpha.24](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.23...v2.0.0-alpha.24) (2021-02-13)
55
-
56
-
57
- ### Code Refactoring
58
-
59
- * **core:** change page default date to 0000-00-00 ([1ce602e](https://github.com/vuepress/vuepress-next/commit/1ce602ef811f29f083a8d10695a7b212ed82cae5))
60
-
61
-
62
- ### BREAKING CHANGES
63
-
64
- * **core:** change page default date from 1970-01-01 to 0000-00-00
65
-
66
-
67
-
68
-
69
-
70
- # [2.0.0-alpha.20](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2021-02-04)
71
-
72
-
73
- ### Features
74
-
75
- * **core:** make language available in page data ([03bb09f](https://github.com/vuepress/vuepress-next/commit/03bb09fd51aeaff56d26820a1401b87ea8bdeb38))
76
-
77
-
78
-
79
-
80
-
81
- # [2.0.0-alpha.19](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2021-01-24)
82
-
83
- **Note:** Version bump only for package @vuepress/shared
84
-
85
-
86
-
87
-
88
-
89
- # [2.0.0-alpha.18](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2021-01-17)
90
-
91
-
92
- ### Features
93
-
94
- * **shared:** optimize frontmatter type and support generics ([8a7025f](https://github.com/vuepress/vuepress-next/commit/8a7025ff39b4656f98f9a35e93848373ce72ddbe))
95
-
96
-
97
-
98
-
99
-
100
- # [2.0.0-alpha.15](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.14...v2.0.0-alpha.15) (2021-01-04)
101
-
102
-
103
- ### Bug Fixes
104
-
105
- * **core:** fix site locale data type ([7898500](https://github.com/vuepress/vuepress-next/commit/7898500f8b611662777ca3bdeb89c5b3bb658595))
106
-
107
-
108
-
109
-
110
-
111
- # [2.0.0-alpha.13](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.12...v2.0.0-alpha.13) (2020-12-23)
112
-
113
- **Note:** Version bump only for package @vuepress/shared
114
-
115
-
116
-
117
-
118
-
119
- # [2.0.0-alpha.7](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2020-12-09)
120
-
121
- **Note:** Version bump only for package @vuepress/shared
122
-
123
-
124
-
125
-
126
-
127
- # [2.0.0-alpha.6](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2020-12-09)
128
-
129
-
130
- ### Features
131
-
132
- * **shared:** add esm build ([f8463e7](https://github.com/vuepress/vuepress-next/commit/f8463e791c909493e343d98468663c9d31bcbb5f))
133
-
134
-
135
-
136
-
137
-
138
- # 2.0.0-alpha.1 (2020-12-01)
139
-
140
-
141
- ### Bug Fixes
142
-
143
- * **shared:** missing type inference for resolveLocaleConfigItem ([3e230fd](https://github.com/vuepress/vuepress-next/commit/3e230fd72020ba2e2e9d9c0fef90f035410c184f))
144
- * **shared:** remove title from ssr context ([6eddf75](https://github.com/vuepress/vuepress-next/commit/6eddf75ea14cac471d93fcfbee2df03c1089ac58))
145
-
146
-
147
- ### Features
148
-
149
- * **shared:** add children field in page header ([6f29d05](https://github.com/vuepress/vuepress-next/commit/6f29d05e6103d172ffe9263ff964c45afd82a4c1))
150
- * **shared:** add head utils ([f020af0](https://github.com/vuepress/vuepress-next/commit/f020af0d6abcb5505692e9ecd3ae16d8b846008f))
151
- * **shared:** add htmlUnescape and htmlEscape utils ([5e55f95](https://github.com/vuepress/vuepress-next/commit/5e55f95bcfd0b039ca1f4398f8d064af9fe4223a))
152
- * **shared:** add isLinkAbsolute and isLinkHttp utils ([bbe8e99](https://github.com/vuepress/vuepress-next/commit/bbe8e995d2f93ff9d8919d699be81d429e0d6abd))
153
- * **shared:** add link utils ([59e8fd5](https://github.com/vuepress/vuepress-next/commit/59e8fd521a92dc5ed4e1ea5d313dac40b46e7a90))
154
- * **shared:** add resolveRoutePathFromUrl util ([460f39b](https://github.com/vuepress/vuepress-next/commit/460f39ba26cda4601b02fc8c0437a88a36d6dd59))
155
- * **shared:** add utils to resolve locale data ([4d5ccd5](https://github.com/vuepress/vuepress-next/commit/4d5ccd56cac166bd76260b3ba3aedac562deead2))
156
- * **shared:** expose isPlainObject util ([1558de3](https://github.com/vuepress/vuepress-next/commit/1558de3248f12f2a2508bfb5ebbe53ca26c466cb))
157
- * **shared:** extract locale path util ([54b747c](https://github.com/vuepress/vuepress-next/commit/54b747c96e6c81f1af289317e7b80c5daff6f517))
158
- * **shared:** make PageData type extendable ([aacbecc](https://github.com/vuepress/vuepress-next/commit/aacbeccb26ff7d58776678faffdc8fdabcaf36c3))
159
- * **shared:** migrate isPlainObject with generics support ([fb1f7c3](https://github.com/vuepress/vuepress-next/commit/fb1f7c301514759a63443b19b5d62362d098fde7))
160
- * **shared:** optimize type definitions and remove resolveSiteLocaleData ([e1d58f6](https://github.com/vuepress/vuepress-next/commit/e1d58f6f3e40458e03e660e15ffc10e7e3acc7f5))
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- export * from './utils';
package/lib/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './types';
2
- export * from './utils';
@@ -1,27 +0,0 @@
1
- /**
2
- * Config for `<head>` tags
3
- *
4
- * @example ['link', { rel: 'icon', href: '/logo.png' }]
5
- * @example ['style', { type: 'text/css' }, 'p { color: red; }']
6
- *
7
- * @remark suffix `Config` means this is for user config
8
- */
9
- export declare type HeadConfig = [HeadTagEmpty, HeadAttrsConfig] | [HeadTagNonEmpty, HeadAttrsConfig, string];
10
- /**
11
- * Allowed tags in `<head>`
12
- *
13
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
14
- */
15
- export declare type HeadTag = HeadTagNonEmpty | HeadTagEmpty;
16
- /**
17
- * Non-empty tags in `<head>`
18
- */
19
- export declare type HeadTagNonEmpty = 'title' | 'style' | 'script' | 'noscript' | 'template';
20
- /**
21
- * Empty tags in `<head>`
22
- */
23
- export declare type HeadTagEmpty = 'base' | 'link' | 'meta' | 'script';
24
- /**
25
- * Attributes to be set for tags in `<head>`
26
- */
27
- export declare type HeadAttrsConfig = Record<string, string | boolean>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export * from './head';
2
- export * from './locale';
3
- export * from './page';
4
- export * from './site';
5
- export * from './ssr';
@@ -1,5 +0,0 @@
1
- export * from './head';
2
- export * from './locale';
3
- export * from './page';
4
- export * from './site';
5
- export * from './ssr';
@@ -1,13 +0,0 @@
1
- /**
2
- * Locales config, a key-value object
3
- *
4
- * - Key is the locale path (prefix)
5
- * - Value is the locales data
6
- *
7
- * @remark suffix `Config` means this is for user config
8
- */
9
- export declare type LocaleConfig<T extends LocaleData = LocaleData> = Record<string, Partial<T>>;
10
- /**
11
- * Locales data
12
- */
13
- export declare type LocaleData = Record<string, any>;
@@ -1 +0,0 @@
1
- export {};