@vuepress/core 2.0.0-beta.6 → 2.0.0-beta.61

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 (152) hide show
  1. package/dist/index.d.ts +830 -0
  2. package/dist/index.js +1035 -0
  3. package/package.json +34 -17
  4. package/CHANGELOG.md +0 -279
  5. package/lib/app/appInit.d.ts +0 -7
  6. package/lib/app/appInit.js +0 -37
  7. package/lib/app/appPrepare.d.ts +0 -10
  8. package/lib/app/appPrepare.js +0 -46
  9. package/lib/app/appUse.d.ts +0 -2
  10. package/lib/app/appUse.js +0 -26
  11. package/lib/app/appUseByConfig.d.ts +0 -2
  12. package/lib/app/appUseByConfig.js +0 -14
  13. package/lib/app/createApp.d.ts +0 -5
  14. package/lib/app/createApp.js +0 -44
  15. package/lib/app/createAppDir.d.ts +0 -9
  16. package/lib/app/createAppDir.js +0 -32
  17. package/lib/app/createAppEnv.d.ts +0 -5
  18. package/lib/app/createAppEnv.js +0 -14
  19. package/lib/app/createAppOptions.d.ts +0 -5
  20. package/lib/app/createAppOptions.js +0 -48
  21. package/lib/app/createAppPages.d.ts +0 -5
  22. package/lib/app/createAppPages.js +0 -36
  23. package/lib/app/createAppSiteData.d.ts +0 -7
  24. package/lib/app/createAppSiteData.js +0 -19
  25. package/lib/app/createAppVersion.d.ts +0 -4
  26. package/lib/app/createAppVersion.js +0 -11
  27. package/lib/app/createAppWriteTemp.d.ts +0 -5
  28. package/lib/app/createAppWriteTemp.js +0 -21
  29. package/lib/app/index.d.ts +0 -16
  30. package/lib/app/index.js +0 -28
  31. package/lib/app/normalizePlugin.d.ts +0 -2
  32. package/lib/app/normalizePlugin.js +0 -19
  33. package/lib/app/normalizePluginConfig.d.ts +0 -2
  34. package/lib/app/normalizePluginConfig.js +0 -18
  35. package/lib/app/prepare/index.d.ts +0 -12
  36. package/lib/app/prepare/index.js +0 -24
  37. package/lib/app/prepare/prepareClientAppEnhances.d.ts +0 -5
  38. package/lib/app/prepare/prepareClientAppEnhances.js +0 -24
  39. package/lib/app/prepare/prepareClientAppRootComponents.d.ts +0 -5
  40. package/lib/app/prepare/prepareClientAppRootComponents.js +0 -24
  41. package/lib/app/prepare/prepareClientAppSetups.d.ts +0 -5
  42. package/lib/app/prepare/prepareClientAppSetups.js +0 -24
  43. package/lib/app/prepare/prepareLayoutComponents.d.ts +0 -5
  44. package/lib/app/prepare/prepareLayoutComponents.js +0 -20
  45. package/lib/app/prepare/preparePageComponent.d.ts +0 -5
  46. package/lib/app/prepare/preparePageComponent.js +0 -10
  47. package/lib/app/prepare/preparePageData.d.ts +0 -5
  48. package/lib/app/prepare/preparePageData.js +0 -37
  49. package/lib/app/prepare/preparePageRoutes.d.ts +0 -5
  50. package/lib/app/prepare/preparePageRoutes.js +0 -57
  51. package/lib/app/prepare/preparePagesComponent.d.ts +0 -5
  52. package/lib/app/prepare/preparePagesComponent.js +0 -23
  53. package/lib/app/prepare/preparePagesData.d.ts +0 -5
  54. package/lib/app/prepare/preparePagesData.js +0 -19
  55. package/lib/app/prepare/preparePagesRoutes.d.ts +0 -5
  56. package/lib/app/prepare/preparePagesRoutes.js +0 -25
  57. package/lib/app/prepare/prepareSiteData.d.ts +0 -5
  58. package/lib/app/prepare/prepareSiteData.js +0 -31
  59. package/lib/app/prepare/resolvePageData.d.ts +0 -5
  60. package/lib/app/prepare/resolvePageData.js +0 -18
  61. package/lib/app/resolveBundler.d.ts +0 -2
  62. package/lib/app/resolveBundler.js +0 -10
  63. package/lib/app/resolvePlugin.d.ts +0 -5
  64. package/lib/app/resolvePlugin.js +0 -20
  65. package/lib/index.d.ts +0 -5
  66. package/lib/index.js +0 -17
  67. package/lib/page/createPage.d.ts +0 -2
  68. package/lib/page/createPage.js +0 -98
  69. package/lib/page/index.d.ts +0 -17
  70. package/lib/page/index.js +0 -29
  71. package/lib/page/inferPagePath.d.ts +0 -11
  72. package/lib/page/inferPagePath.js +0 -27
  73. package/lib/page/resolvePageComponentInfo.d.ts +0 -20
  74. package/lib/page/resolvePageComponentInfo.js +0 -41
  75. package/lib/page/resolvePageContent.d.ts +0 -11
  76. package/lib/page/resolvePageContent.js +0 -31
  77. package/lib/page/resolvePageDataInfo.d.ts +0 -12
  78. package/lib/page/resolvePageDataInfo.js +0 -18
  79. package/lib/page/resolvePageDate.d.ts +0 -10
  80. package/lib/page/resolvePageDate.js +0 -46
  81. package/lib/page/resolvePageExcerpt.d.ts +0 -9
  82. package/lib/page/resolvePageExcerpt.js +0 -15
  83. package/lib/page/resolvePageFileContent.d.ts +0 -8
  84. package/lib/page/resolvePageFileContent.js +0 -24
  85. package/lib/page/resolvePageFilePath.d.ts +0 -11
  86. package/lib/page/resolvePageFilePath.js +0 -29
  87. package/lib/page/resolvePageFrontmatter.d.ts +0 -8
  88. package/lib/page/resolvePageFrontmatter.js +0 -12
  89. package/lib/page/resolvePageKey.d.ts +0 -6
  90. package/lib/page/resolvePageKey.js +0 -9
  91. package/lib/page/resolvePageLang.d.ts +0 -9
  92. package/lib/page/resolvePageLang.js +0 -15
  93. package/lib/page/resolvePagePath.d.ts +0 -9
  94. package/lib/page/resolvePagePath.js +0 -8
  95. package/lib/page/resolvePagePermalink.d.ts +0 -11
  96. package/lib/page/resolvePagePermalink.js +0 -32
  97. package/lib/page/resolvePageRoutesInfo.d.ts +0 -11
  98. package/lib/page/resolvePageRoutesInfo.js +0 -16
  99. package/lib/page/resolvePageSlug.d.ts +0 -6
  100. package/lib/page/resolvePageSlug.js +0 -17
  101. package/lib/page/resolvePageTitle.d.ts +0 -9
  102. package/lib/page/resolvePageTitle.js +0 -26
  103. package/lib/pluginApi/createHookQueue.d.ts +0 -5
  104. package/lib/pluginApi/createHookQueue.js +0 -81
  105. package/lib/pluginApi/createPluginApi.d.ts +0 -2
  106. package/lib/pluginApi/createPluginApi.js +0 -16
  107. package/lib/pluginApi/createPluginApiHooks.d.ts +0 -2
  108. package/lib/pluginApi/createPluginApiHooks.js +0 -24
  109. package/lib/pluginApi/createPluginApiRegisterHooks.d.ts +0 -2
  110. package/lib/pluginApi/createPluginApiRegisterHooks.js +0 -54
  111. package/lib/pluginApi/index.d.ts +0 -6
  112. package/lib/pluginApi/index.js +0 -18
  113. package/lib/pluginApi/normalizeClientFilesHook.d.ts +0 -5
  114. package/lib/pluginApi/normalizeClientFilesHook.js +0 -25
  115. package/lib/pluginApi/normalizeReturnObjectHook.d.ts +0 -5
  116. package/lib/pluginApi/normalizeReturnObjectHook.js +0 -9
  117. package/lib/themeApi/createThemeApi.d.ts +0 -7
  118. package/lib/themeApi/createThemeApi.js +0 -30
  119. package/lib/themeApi/index.d.ts +0 -1
  120. package/lib/themeApi/index.js +0 -13
  121. package/lib/themeApi/resolveThemeInfo.d.ts +0 -2
  122. package/lib/themeApi/resolveThemeInfo.js +0 -34
  123. package/lib/themeApi/resolveThemeLayouts.d.ts +0 -5
  124. package/lib/themeApi/resolveThemeLayouts.js +0 -33
  125. package/lib/types/app/app.d.ts +0 -30
  126. package/lib/types/app/app.js +0 -2
  127. package/lib/types/app/index.d.ts +0 -3
  128. package/lib/types/app/index.js +0 -15
  129. package/lib/types/app/options.d.ts +0 -32
  130. package/lib/types/app/options.js +0 -2
  131. package/lib/types/app/utils.d.ts +0 -29
  132. package/lib/types/app/utils.js +0 -2
  133. package/lib/types/bundler.d.ts +0 -34
  134. package/lib/types/bundler.js +0 -2
  135. package/lib/types/index.d.ts +0 -9
  136. package/lib/types/index.js +0 -19
  137. package/lib/types/page.d.ts +0 -98
  138. package/lib/types/page.js +0 -2
  139. package/lib/types/plugin-api/hooks.d.ts +0 -75
  140. package/lib/types/plugin-api/hooks.js +0 -2
  141. package/lib/types/plugin-api/index.d.ts +0 -2
  142. package/lib/types/plugin-api/index.js +0 -14
  143. package/lib/types/plugin-api/pluginApi.d.ts +0 -23
  144. package/lib/types/plugin-api/pluginApi.js +0 -2
  145. package/lib/types/plugin.d.ts +0 -48
  146. package/lib/types/plugin.js +0 -2
  147. package/lib/types/theme-api/index.d.ts +0 -1
  148. package/lib/types/theme-api/index.js +0 -13
  149. package/lib/types/theme-api/themeApi.d.ts +0 -44
  150. package/lib/types/theme-api/themeApi.js +0 -2
  151. package/lib/types/theme.d.ts +0 -33
  152. package/lib/types/theme.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.61",
4
4
  "description": "Core package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -15,26 +15,43 @@
15
15
  "url": "git+https://github.com/vuepress/vuepress-next.git"
16
16
  },
17
17
  "license": "MIT",
18
- "author": "Evan You",
19
- "main": "lib/index.js",
20
- "types": "lib/index.d.ts",
18
+ "author": "meteorlxy",
19
+ "type": "module",
20
+ "exports": {
21
+ ".": "./dist/index.js",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
21
26
  "files": [
22
- "lib"
27
+ "dist"
23
28
  ],
24
- "scripts": {
25
- "build": "tsc -b tsconfig.build.json",
26
- "clean": "rimraf lib *.tsbuildinfo"
27
- },
28
29
  "dependencies": {
29
- "@vuepress/client": "2.0.0-beta.6",
30
- "@vuepress/markdown": "2.0.0-beta.5",
31
- "@vuepress/shared": "2.0.0-beta.4",
32
- "@vuepress/utils": "2.0.0-beta.5",
33
- "gray-matter": "^4.0.2",
34
- "toml": "^3.0.0"
30
+ "vue": "^3.2.47",
31
+ "@vuepress/client": "2.0.0-beta.61",
32
+ "@vuepress/markdown": "2.0.0-beta.61",
33
+ "@vuepress/utils": "2.0.0-beta.61",
34
+ "@vuepress/shared": "2.0.0-beta.61"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "f8cd4a37d251e64ded2f1d7e8ca51afd81fd72d9"
40
- }
39
+ "tsup": {
40
+ "clean": true,
41
+ "dts": "./src/index.ts",
42
+ "entry": [
43
+ "./src/index.ts"
44
+ ],
45
+ "format": [
46
+ "esm"
47
+ ],
48
+ "outDir": "./dist",
49
+ "sourcemap": false,
50
+ "target": "es2020",
51
+ "tsconfig": "../tsconfig.dts.json"
52
+ },
53
+ "scripts": {
54
+ "build": "tsup",
55
+ "clean": "rimraf dist"
56
+ }
57
+ }
package/CHANGELOG.md DELETED
@@ -1,279 +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.6](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.5...v2.0.0-beta.6) (2021-03-26)
7
-
8
- **Note:** Version bump only for package @vuepress/core
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.5](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.4...v2.0.0-beta.5) (2021-03-26)
15
-
16
-
17
- ### Performance Improvements
18
-
19
- * improve HMR support ([38f0073](https://github.com/vuepress/vuepress-next/commit/38f007335864db4c9125ea5905ca91850fb7103b))
20
-
21
-
22
-
23
-
24
-
25
- # [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)
26
-
27
- **Note:** Version bump only for package @vuepress/core
28
-
29
-
30
-
31
-
32
-
33
- # [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)
34
-
35
- **Note:** Version bump only for package @vuepress/core
36
-
37
-
38
-
39
-
40
-
41
- # [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)
42
-
43
-
44
- ### Features
45
-
46
- * implement vite hmr ([525c18d](https://github.com/vuepress/vuepress-next/commit/525c18d5a64fbdbdeb5ce1348ec1e1ead3dbd8f9))
47
-
48
-
49
-
50
-
51
-
52
- # [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)
53
-
54
-
55
- ### Code Refactoring
56
-
57
- * **core:** remove theme data from site data ([187aef3](https://github.com/vuepress/vuepress-next/commit/187aef36607efc62d7b2d5c773553f89685cf64c))
58
-
59
-
60
- ### BREAKING CHANGES
61
-
62
- * **core:** `themeConfig` is not available in site data any more
63
-
64
-
65
-
66
-
67
-
68
- # [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)
69
-
70
-
71
- ### Code Refactoring
72
-
73
- * **core:** change page default date to 0000-00-00 ([1ce602e](https://github.com/vuepress/vuepress-next/commit/1ce602ef811f29f083a8d10695a7b212ed82cae5))
74
- * **core:** remove permalink and pattern from page options ([9534989](https://github.com/vuepress/vuepress-next/commit/9534989a82e620b1c09b4a09d4cfee1e99d145fc))
75
-
76
-
77
- ### Features
78
-
79
- * **core:** add extendsPageOptions hook ([19b7e83](https://github.com/vuepress/vuepress-next/commit/19b7e83cb25ec523857d34c415782d595a05d0ff))
80
- * **core:** add watchers parameter to onWatched hook ([0bcd594](https://github.com/vuepress/vuepress-next/commit/0bcd594d1645fe9994d1456e86803e5619057bfb))
81
-
82
-
83
- ### BREAKING CHANGES
84
-
85
- * **core:** remove permalink and pattern from page options
86
- * **core:** change page default date from 1970-01-01 to 0000-00-00
87
-
88
-
89
-
90
-
91
-
92
- # [2.0.0-alpha.23](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.22...v2.0.0-alpha.23) (2021-02-10)
93
-
94
- **Note:** Version bump only for package @vuepress/core
95
-
96
-
97
-
98
-
99
-
100
- # [2.0.0-alpha.22](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.21...v2.0.0-alpha.22) (2021-02-10)
101
-
102
- **Note:** Version bump only for package @vuepress/core
103
-
104
-
105
-
106
-
107
-
108
- # [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)
109
-
110
-
111
- ### Features
112
-
113
- * **core:** create siteData in vuepress app ([05b87dd](https://github.com/vuepress/vuepress-next/commit/05b87ddf32f32c94cc131e0074365aeba70f85f2))
114
- * **core:** make language available in page data ([03bb09f](https://github.com/vuepress/vuepress-next/commit/03bb09fd51aeaff56d26820a1401b87ea8bdeb38))
115
-
116
-
117
-
118
-
119
-
120
- # [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)
121
-
122
-
123
- ### Features
124
-
125
- * **core:** add onWatched hook ([9725a10](https://github.com/vuepress/vuepress-next/commit/9725a101599363094a85916317109b67d365dff4))
126
-
127
-
128
-
129
-
130
-
131
- # [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)
132
-
133
- **Note:** Version bump only for package @vuepress/core
134
-
135
-
136
-
137
-
138
-
139
- # [2.0.0-alpha.17](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.16...v2.0.0-alpha.17) (2021-01-13)
140
-
141
- **Note:** Version bump only for package @vuepress/core
142
-
143
-
144
-
145
-
146
-
147
- # [2.0.0-alpha.16](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.15...v2.0.0-alpha.16) (2021-01-11)
148
-
149
-
150
- ### Bug Fixes
151
-
152
- * **core:** support special characters in filename and permalink ([c3e68ef](https://github.com/vuepress/vuepress-next/commit/c3e68ef6a4aa3f6722d5bc4079bafe5d3b176e5e))
153
-
154
-
155
-
156
-
157
-
158
- # [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)
159
-
160
-
161
- ### Features
162
-
163
- * **core:** provide app in all plugin hooks ([21cc3a6](https://github.com/vuepress/vuepress-next/commit/21cc3a608e54d38de8de8f453b5e88031b4cedb1))
164
-
165
-
166
-
167
-
168
-
169
- # [2.0.0-alpha.14](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.13...v2.0.0-alpha.14) (2021-01-03)
170
-
171
-
172
- ### Bug Fixes
173
-
174
- * **core:** fix page date resolving ([de6c5c8](https://github.com/vuepress/vuepress-next/commit/de6c5c8ca89347bea4ba2925e283a7b710a5b5d3))
175
-
176
-
177
-
178
-
179
-
180
- # [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)
181
-
182
- **Note:** Version bump only for package @vuepress/core
183
-
184
-
185
-
186
-
187
-
188
- # [2.0.0-alpha.12](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2020-12-19)
189
-
190
- **Note:** Version bump only for package @vuepress/core
191
-
192
-
193
-
194
-
195
-
196
- # [2.0.0-alpha.8](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2020-12-11)
197
-
198
- **Note:** Version bump only for package @vuepress/core
199
-
200
-
201
-
202
-
203
-
204
- # [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)
205
-
206
- **Note:** Version bump only for package @vuepress/core
207
-
208
-
209
-
210
-
211
-
212
- # [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)
213
-
214
- **Note:** Version bump only for package @vuepress/core
215
-
216
-
217
-
218
-
219
-
220
- # [2.0.0-alpha.5](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2020-12-03)
221
-
222
- **Note:** Version bump only for package @vuepress/core
223
-
224
-
225
-
226
-
227
-
228
- # [2.0.0-alpha.4](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2020-12-02)
229
-
230
-
231
- ### Bug Fixes
232
-
233
- * **core:** failed to resolve local theme ([4d836e2](https://github.com/vuepress/vuepress-next/commit/4d836e2bc3e7affe17f63df1c4ce40c464a7e6fb))
234
- * **core:** warn if layout directory does not exist ([3d2d414](https://github.com/vuepress/vuepress-next/commit/3d2d4148024963521b9e1ebbc29aa19697ac3452))
235
-
236
-
237
-
238
-
239
-
240
- # [2.0.0-alpha.3](https://github.com/vuepress/vuepress-next/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2020-12-01)
241
-
242
-
243
- ### Bug Fixes
244
-
245
- * **core:** avoid runtime warning for empty template (close [#10](https://github.com/vuepress/vuepress-next/issues/10)) ([bcbf703](https://github.com/vuepress/vuepress-next/commit/bcbf703e6e449f7753697b7dfc503bd643bfd240))
246
-
247
-
248
-
249
-
250
-
251
- # 2.0.0-alpha.1 (2020-12-01)
252
-
253
-
254
- ### Bug Fixes
255
-
256
- * **core:** default value of base and lang ([5a5df27](https://github.com/vuepress/vuepress-next/commit/5a5df274de4691315e567e932a6cffe4a04d88c1))
257
- * **core:** infer page locale path correctly ([8f2b10b](https://github.com/vuepress/vuepress-next/commit/8f2b10bc8c9fa58ee4181bbfc50ade3e45e382ff))
258
- * **core:** resolve page date ([bd627d7](https://github.com/vuepress/vuepress-next/commit/bd627d79482e77c573654db699ff58f93e8d8dd5))
259
- * **core:** resolve page excerpt with correct markdown env ([e0f4066](https://github.com/vuepress/vuepress-next/commit/e0f406625baf085ced29ea88328069fb0a1d0cf4))
260
- * **core:** resolve page title from markdown content as fallback ([b216012](https://github.com/vuepress/vuepress-next/commit/b2160129b175013518b9fb7d82d034694509ae86))
261
- * **core:** resolve plugin and theme by name ([3031324](https://github.com/vuepress/vuepress-next/commit/30313247958f9e1d4a7214a18ce6e17bc582bc3e))
262
- * **core:** respect page options ([d8dbbb7](https://github.com/vuepress/vuepress-next/commit/d8dbbb777161130634fe5cadf0be571ed830a7ab))
263
-
264
-
265
- ### Features
266
-
267
- * **core:** add 404 page if not exist ([0297a9e](https://github.com/vuepress/vuepress-next/commit/0297a9ed96acb0b792dac44f72f4d549a5930841))
268
- * **core:** add clientAppRootComponentFiles hook ([7f640c8](https://github.com/vuepress/vuepress-next/commit/7f640c879f53b5dff67a2c6d374360f3e19aa679))
269
- * **core:** add extendsPageData hook ([5a10994](https://github.com/vuepress/vuepress-next/commit/5a109943ed1beb3ddfd07c018e0cba33cb46fdb2))
270
- * **core:** add pagePatterns option ([9a8855d](https://github.com/vuepress/vuepress-next/commit/9a8855d86683e95e2dae33493d0321fa14bfee9d))
271
- * **core:** add public directory config ([1b52ffe](https://github.com/vuepress/vuepress-next/commit/1b52ffe89a7f87d3c6822d07b6b75f2675b8745f))
272
- * **core:** add theme layouts option ([bf96cc3](https://github.com/vuepress/vuepress-next/commit/bf96cc3a2ab9133d3606231e3f9d0c46b2a2103c))
273
- * **core:** allow disable prefetch and preload links ([2991b6a](https://github.com/vuepress/vuepress-next/commit/2991b6a7025eefac21846eb520aa5ca2ea2dc594))
274
- * **core:** allow plugins and themes use export default ([874979d](https://github.com/vuepress/vuepress-next/commit/874979d6d86e308469488c8405e6f7bbc80d1391))
275
- * **core:** enable evergreen option by default ([fa67dbb](https://github.com/vuepress/vuepress-next/commit/fa67dbb9474c27ff10e4061ac15171bc4936d274))
276
- * **core:** export LocaleConfig type from shared ([04de925](https://github.com/vuepress/vuepress-next/commit/04de925326ad1101702e57fd9903de808a72bb97))
277
- * **core:** inject page title into route meta ([0d9e7e3](https://github.com/vuepress/vuepress-next/commit/0d9e7e3b3a0a78504fc586887cf1a777ae434846))
278
- * **core:** remove plugins from app options ([fe411e7](https://github.com/vuepress/vuepress-next/commit/fe411e7ef8a5802876f55246a9937825e802f538))
279
- * **core:** remove webpack related hooks ([9613f69](https://github.com/vuepress/vuepress-next/commit/9613f69ace1413b3776a6012319cf7c6fe1d3469))
@@ -1,7 +0,0 @@
1
- import type { App } from '../types';
2
- /**
3
- * Initialize a vuepress app
4
- *
5
- * Plugins should be used before initialization.
6
- */
7
- export declare const appInit: (app: App) => Promise<void>;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appInit = void 0;
4
- const utils_1 = require("@vuepress/utils");
5
- const themeApi_1 = require("../themeApi");
6
- const createAppPages_1 = require("./createAppPages");
7
- const createAppWriteTemp_1 = require("./createAppWriteTemp");
8
- const log = utils_1.debug('vuepress:core/app');
9
- /**
10
- * Initialize a vuepress app
11
- *
12
- * Plugins should be used before initialization.
13
- */
14
- const appInit = async (app) => {
15
- log('init start');
16
- // create write temp util
17
- app.writeTemp = await createAppWriteTemp_1.createAppWriteTemp(app);
18
- // create theme api, resolve themes and layouts
19
- app.themeApi = await themeApi_1.createThemeApi(app);
20
- // use theme plugin
21
- if (app.themeApi.parentTheme) {
22
- app.use(app.themeApi.parentTheme.plugin);
23
- }
24
- app.use(app.themeApi.theme.plugin);
25
- // register all hooks of plugins that have been used
26
- // plugins should be used before `registerHooks()`
27
- // hooks in plugins will take effect after `registerHooks()`
28
- app.pluginApi.registerHooks();
29
- // plugin hook: extendsMarkdown
30
- await app.pluginApi.hooks.extendsMarkdown.process(app.markdown, app);
31
- // create pages
32
- app.pages = await createAppPages_1.createAppPages(app);
33
- // plugin hook: onInitialized
34
- await app.pluginApi.hooks.onInitialized.process(app);
35
- log('init finish');
36
- };
37
- exports.appInit = appInit;
@@ -1,10 +0,0 @@
1
- import type { App } from '../types';
2
- /**
3
- * Prepare files for development or build
4
- *
5
- * - page components
6
- * - routes
7
- * - site data
8
- * - other files that generated by plugins
9
- */
10
- export declare const appPrepare: (app: App) => Promise<void>;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appPrepare = void 0;
4
- const utils_1 = require("@vuepress/utils");
5
- const prepare_1 = require("./prepare");
6
- const log = utils_1.debug('vuepress:core/app');
7
- /**
8
- * Prepare files for development or build
9
- *
10
- * - page components
11
- * - routes
12
- * - site data
13
- * - other files that generated by plugins
14
- */
15
- const appPrepare = async (app) => {
16
- log('prepare start');
17
- // generate page component files
18
- for (const page of app.pages) {
19
- await prepare_1.preparePageComponent(app, page);
20
- }
21
- await prepare_1.preparePagesComponent(app);
22
- // generate page data files
23
- for (const page of app.pages) {
24
- await prepare_1.preparePageData(app, page);
25
- }
26
- await prepare_1.preparePagesData(app);
27
- // generate layout components map file
28
- await prepare_1.prepareLayoutComponents(app);
29
- // generate routes file
30
- for (const page of app.pages) {
31
- await prepare_1.preparePageRoutes(app, page);
32
- }
33
- await prepare_1.preparePagesRoutes(app);
34
- // generate site data file
35
- await prepare_1.prepareSiteData(app);
36
- // generate client app enhances file
37
- await prepare_1.prepareClientAppEnhances(app);
38
- // generate client app root components file
39
- await prepare_1.prepareClientAppRootComponents(app);
40
- // generate client app setups file
41
- await prepare_1.prepareClientAppSetups(app);
42
- // plugin hook: onPrepared
43
- await app.pluginApi.hooks.onPrepared.process(app);
44
- log('prepare finish');
45
- };
46
- exports.appPrepare = appPrepare;
@@ -1,2 +0,0 @@
1
- import type { App, Plugin, PluginOptions } from '../types';
2
- export declare const appUse: <T extends PluginOptions>(app: App, rawPlugin: string | Plugin<T, import("../types").PluginObject>, config?: Partial<T> | undefined) => void;
package/lib/app/appUse.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appUse = void 0;
4
- const utils_1 = require("@vuepress/utils");
5
- const normalizePlugin_1 = require("./normalizePlugin");
6
- const log = utils_1.debug('vuepress:core/app');
7
- const appUse = (app, rawPlugin, config) => {
8
- // normalize plugin
9
- const plugin = normalizePlugin_1.normalizePlugin(app, rawPlugin, config);
10
- log(`use plugin ${utils_1.chalk.magenta(plugin.name)}`);
11
- if (plugin.multiple !== true) {
12
- // remove duplicated plugin
13
- const duplicateIndex = app.pluginApi.plugins.findIndex(({ name }) => name === plugin.name);
14
- if (duplicateIndex !== -1) {
15
- app.pluginApi.plugins.splice(duplicateIndex, 1);
16
- }
17
- }
18
- // use plugin
19
- app.pluginApi.plugins.push(plugin);
20
- // TODO: nested plugins with `multiple` may cause potential problems
21
- // if the plugin uses other plugins
22
- if (plugin.plugins) {
23
- plugin.plugins.forEach(app.useByConfig);
24
- }
25
- };
26
- exports.appUse = appUse;
@@ -1,2 +0,0 @@
1
- import type { App, PluginOptions, PluginConfig } from '../types';
2
- export declare const appUseByConfig: <T extends PluginOptions>(app: App, pluginConfig: PluginConfig<T>) => void;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appUseByConfig = void 0;
4
- const normalizePluginConfig_1 = require("./normalizePluginConfig");
5
- const appUseByConfig = (app, pluginConfig) => {
6
- const normalizedPluginConfig = normalizePluginConfig_1.normalizePluginConfig(pluginConfig);
7
- if (normalizedPluginConfig === false)
8
- return;
9
- const [plugin, config] = normalizedPluginConfig;
10
- if (config === false)
11
- return;
12
- return app.use(plugin, config === true ? {} : config);
13
- };
14
- exports.appUseByConfig = appUseByConfig;
@@ -1,5 +0,0 @@
1
- import type { App, AppConfig } from '../types';
2
- /**
3
- * Create vuepress app
4
- */
5
- export declare const createApp: (config: AppConfig) => App;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createApp = void 0;
4
- const markdown_1 = require("@vuepress/markdown");
5
- const pluginApi_1 = require("../pluginApi");
6
- const appInit_1 = require("./appInit");
7
- const appPrepare_1 = require("./appPrepare");
8
- const appUse_1 = require("./appUse");
9
- const appUseByConfig_1 = require("./appUseByConfig");
10
- const createAppDir_1 = require("./createAppDir");
11
- const createAppEnv_1 = require("./createAppEnv");
12
- const createAppOptions_1 = require("./createAppOptions");
13
- const createAppSiteData_1 = require("./createAppSiteData");
14
- const createAppVersion_1 = require("./createAppVersion");
15
- const resolveBundler_1 = require("./resolveBundler");
16
- /**
17
- * Create vuepress app
18
- */
19
- const createApp = (config) => {
20
- const version = createAppVersion_1.createAppVersion();
21
- const options = createAppOptions_1.createAppOptions(config);
22
- const dir = createAppDir_1.createAppDir(options);
23
- const env = createAppEnv_1.createAppEnv(options);
24
- const siteData = createAppSiteData_1.createAppSiteData(options);
25
- const markdown = markdown_1.createMarkdown(options.markdown);
26
- const pluginApi = pluginApi_1.createPluginApi();
27
- const app = {
28
- version,
29
- options,
30
- dir,
31
- env,
32
- siteData,
33
- markdown,
34
- pluginApi,
35
- use: (...args) => appUse_1.appUse(app, ...args),
36
- useByConfig: (...args) => appUseByConfig_1.appUseByConfig(app, ...args),
37
- init: () => appInit_1.appInit(app),
38
- prepare: () => appPrepare_1.appPrepare(app),
39
- dev: () => resolveBundler_1.resolveBundler(options).dev(app),
40
- build: () => resolveBundler_1.resolveBundler(options).build(app),
41
- };
42
- return app;
43
- };
44
- exports.createApp = createApp;
@@ -1,9 +0,0 @@
1
- import type { AppDir, AppDirFunction, AppOptions } from '../types';
2
- /**
3
- * Create directory util function
4
- */
5
- export declare const createAppDirFunction: (baseDir: string) => AppDirFunction;
6
- /**
7
- * Create directory utils for vuepress app
8
- */
9
- export declare const createAppDir: (options: AppOptions) => AppDir;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAppDir = exports.createAppDirFunction = void 0;
4
- const utils_1 = require("@vuepress/utils");
5
- /**
6
- * Create directory util function
7
- */
8
- const createAppDirFunction = (baseDir) => {
9
- return (...args) => utils_1.path.resolve(baseDir, ...args);
10
- };
11
- exports.createAppDirFunction = createAppDirFunction;
12
- /**
13
- * Create directory utils for vuepress app
14
- */
15
- const createAppDir = (options) => {
16
- const cache = exports.createAppDirFunction(options.cache);
17
- const temp = exports.createAppDirFunction(options.temp);
18
- const source = exports.createAppDirFunction(options.source);
19
- const dest = exports.createAppDirFunction(options.dest);
20
- const publicDir = exports.createAppDirFunction(options.public);
21
- // @vuepress/client
22
- const client = exports.createAppDirFunction(utils_1.path.resolve(require.resolve('@vuepress/client/package.json'), '..'));
23
- return {
24
- cache,
25
- temp,
26
- source,
27
- dest,
28
- client,
29
- public: publicDir,
30
- };
31
- };
32
- exports.createAppDir = createAppDir;
@@ -1,5 +0,0 @@
1
- import type { AppEnv, AppOptions } from '../types';
2
- /**
3
- * Create environment flags for vuepress app
4
- */
5
- export declare const createAppEnv: (options: AppOptions) => AppEnv;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAppEnv = void 0;
4
- /**
5
- * Create environment flags for vuepress app
6
- */
7
- const createAppEnv = (options) => ({
8
- isProd: process.env.NODE_ENV === 'production',
9
- isTest: process.env.NODE_ENV === 'test',
10
- isDev: process.env.NODE_ENV === 'development',
11
- isDebug: options.debug,
12
- nodeEnv: process.env.NODE_ENV,
13
- });
14
- exports.createAppEnv = createAppEnv;
@@ -1,5 +0,0 @@
1
- import type { AppConfig, AppOptions } from '../types';
2
- /**
3
- * Create app options with default values
4
- */
5
- export declare const createAppOptions: ({ base, lang, title, description, head, locales, theme, themeConfig, bundler, bundlerConfig, source, dest, temp, cache, public: publicDir, markdown, host, port, debug, open, evergreen, pagePatterns, templateDev, templateSSR, shouldPreload, shouldPrefetch, }: AppConfig) => AppOptions;