@vuepress/core 2.0.0-beta.5 → 2.0.0-beta.50-pre

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 (150) hide show
  1. package/package.json +34 -17
  2. package/CHANGELOG.md +0 -271
  3. package/lib/app/appInit.d.ts +0 -7
  4. package/lib/app/appInit.js +0 -37
  5. package/lib/app/appPrepare.d.ts +0 -10
  6. package/lib/app/appPrepare.js +0 -46
  7. package/lib/app/appUse.d.ts +0 -2
  8. package/lib/app/appUse.js +0 -26
  9. package/lib/app/appUseByConfig.d.ts +0 -2
  10. package/lib/app/appUseByConfig.js +0 -14
  11. package/lib/app/createApp.d.ts +0 -5
  12. package/lib/app/createApp.js +0 -44
  13. package/lib/app/createAppDir.d.ts +0 -9
  14. package/lib/app/createAppDir.js +0 -32
  15. package/lib/app/createAppEnv.d.ts +0 -5
  16. package/lib/app/createAppEnv.js +0 -14
  17. package/lib/app/createAppOptions.d.ts +0 -5
  18. package/lib/app/createAppOptions.js +0 -48
  19. package/lib/app/createAppPages.d.ts +0 -5
  20. package/lib/app/createAppPages.js +0 -36
  21. package/lib/app/createAppSiteData.d.ts +0 -7
  22. package/lib/app/createAppSiteData.js +0 -19
  23. package/lib/app/createAppVersion.d.ts +0 -4
  24. package/lib/app/createAppVersion.js +0 -11
  25. package/lib/app/createAppWriteTemp.d.ts +0 -5
  26. package/lib/app/createAppWriteTemp.js +0 -21
  27. package/lib/app/index.d.ts +0 -16
  28. package/lib/app/index.js +0 -28
  29. package/lib/app/normalizePlugin.d.ts +0 -2
  30. package/lib/app/normalizePlugin.js +0 -19
  31. package/lib/app/normalizePluginConfig.d.ts +0 -2
  32. package/lib/app/normalizePluginConfig.js +0 -18
  33. package/lib/app/prepare/index.d.ts +0 -12
  34. package/lib/app/prepare/index.js +0 -24
  35. package/lib/app/prepare/prepareClientAppEnhances.d.ts +0 -5
  36. package/lib/app/prepare/prepareClientAppEnhances.js +0 -24
  37. package/lib/app/prepare/prepareClientAppRootComponents.d.ts +0 -5
  38. package/lib/app/prepare/prepareClientAppRootComponents.js +0 -24
  39. package/lib/app/prepare/prepareClientAppSetups.d.ts +0 -5
  40. package/lib/app/prepare/prepareClientAppSetups.js +0 -24
  41. package/lib/app/prepare/prepareLayoutComponents.d.ts +0 -5
  42. package/lib/app/prepare/prepareLayoutComponents.js +0 -20
  43. package/lib/app/prepare/preparePageComponent.d.ts +0 -5
  44. package/lib/app/prepare/preparePageComponent.js +0 -10
  45. package/lib/app/prepare/preparePageData.d.ts +0 -5
  46. package/lib/app/prepare/preparePageData.js +0 -37
  47. package/lib/app/prepare/preparePageRoutes.d.ts +0 -5
  48. package/lib/app/prepare/preparePageRoutes.js +0 -57
  49. package/lib/app/prepare/preparePagesComponent.d.ts +0 -5
  50. package/lib/app/prepare/preparePagesComponent.js +0 -23
  51. package/lib/app/prepare/preparePagesData.d.ts +0 -5
  52. package/lib/app/prepare/preparePagesData.js +0 -19
  53. package/lib/app/prepare/preparePagesRoutes.d.ts +0 -5
  54. package/lib/app/prepare/preparePagesRoutes.js +0 -25
  55. package/lib/app/prepare/prepareSiteData.d.ts +0 -5
  56. package/lib/app/prepare/prepareSiteData.js +0 -31
  57. package/lib/app/prepare/resolvePageData.d.ts +0 -5
  58. package/lib/app/prepare/resolvePageData.js +0 -18
  59. package/lib/app/resolveBundler.d.ts +0 -2
  60. package/lib/app/resolveBundler.js +0 -10
  61. package/lib/app/resolvePlugin.d.ts +0 -5
  62. package/lib/app/resolvePlugin.js +0 -20
  63. package/lib/index.d.ts +0 -5
  64. package/lib/index.js +0 -17
  65. package/lib/page/createPage.d.ts +0 -2
  66. package/lib/page/createPage.js +0 -98
  67. package/lib/page/index.d.ts +0 -17
  68. package/lib/page/index.js +0 -29
  69. package/lib/page/inferPagePath.d.ts +0 -11
  70. package/lib/page/inferPagePath.js +0 -27
  71. package/lib/page/resolvePageComponentInfo.d.ts +0 -20
  72. package/lib/page/resolvePageComponentInfo.js +0 -41
  73. package/lib/page/resolvePageContent.d.ts +0 -11
  74. package/lib/page/resolvePageContent.js +0 -31
  75. package/lib/page/resolvePageDataInfo.d.ts +0 -12
  76. package/lib/page/resolvePageDataInfo.js +0 -18
  77. package/lib/page/resolvePageDate.d.ts +0 -10
  78. package/lib/page/resolvePageDate.js +0 -46
  79. package/lib/page/resolvePageExcerpt.d.ts +0 -9
  80. package/lib/page/resolvePageExcerpt.js +0 -15
  81. package/lib/page/resolvePageFileContent.d.ts +0 -8
  82. package/lib/page/resolvePageFileContent.js +0 -24
  83. package/lib/page/resolvePageFilePath.d.ts +0 -11
  84. package/lib/page/resolvePageFilePath.js +0 -29
  85. package/lib/page/resolvePageFrontmatter.d.ts +0 -8
  86. package/lib/page/resolvePageFrontmatter.js +0 -12
  87. package/lib/page/resolvePageKey.d.ts +0 -6
  88. package/lib/page/resolvePageKey.js +0 -9
  89. package/lib/page/resolvePageLang.d.ts +0 -9
  90. package/lib/page/resolvePageLang.js +0 -15
  91. package/lib/page/resolvePagePath.d.ts +0 -9
  92. package/lib/page/resolvePagePath.js +0 -8
  93. package/lib/page/resolvePagePermalink.d.ts +0 -11
  94. package/lib/page/resolvePagePermalink.js +0 -32
  95. package/lib/page/resolvePageRoutesInfo.d.ts +0 -11
  96. package/lib/page/resolvePageRoutesInfo.js +0 -16
  97. package/lib/page/resolvePageSlug.d.ts +0 -6
  98. package/lib/page/resolvePageSlug.js +0 -17
  99. package/lib/page/resolvePageTitle.d.ts +0 -9
  100. package/lib/page/resolvePageTitle.js +0 -26
  101. package/lib/pluginApi/createHookQueue.d.ts +0 -5
  102. package/lib/pluginApi/createHookQueue.js +0 -81
  103. package/lib/pluginApi/createPluginApi.d.ts +0 -2
  104. package/lib/pluginApi/createPluginApi.js +0 -16
  105. package/lib/pluginApi/createPluginApiHooks.d.ts +0 -2
  106. package/lib/pluginApi/createPluginApiHooks.js +0 -24
  107. package/lib/pluginApi/createPluginApiRegisterHooks.d.ts +0 -2
  108. package/lib/pluginApi/createPluginApiRegisterHooks.js +0 -54
  109. package/lib/pluginApi/index.d.ts +0 -6
  110. package/lib/pluginApi/index.js +0 -18
  111. package/lib/pluginApi/normalizeClientFilesHook.d.ts +0 -5
  112. package/lib/pluginApi/normalizeClientFilesHook.js +0 -25
  113. package/lib/pluginApi/normalizeReturnObjectHook.d.ts +0 -5
  114. package/lib/pluginApi/normalizeReturnObjectHook.js +0 -9
  115. package/lib/themeApi/createThemeApi.d.ts +0 -7
  116. package/lib/themeApi/createThemeApi.js +0 -30
  117. package/lib/themeApi/index.d.ts +0 -1
  118. package/lib/themeApi/index.js +0 -13
  119. package/lib/themeApi/resolveThemeInfo.d.ts +0 -2
  120. package/lib/themeApi/resolveThemeInfo.js +0 -34
  121. package/lib/themeApi/resolveThemeLayouts.d.ts +0 -5
  122. package/lib/themeApi/resolveThemeLayouts.js +0 -33
  123. package/lib/types/app/app.d.ts +0 -30
  124. package/lib/types/app/app.js +0 -2
  125. package/lib/types/app/index.d.ts +0 -3
  126. package/lib/types/app/index.js +0 -15
  127. package/lib/types/app/options.d.ts +0 -32
  128. package/lib/types/app/options.js +0 -2
  129. package/lib/types/app/utils.d.ts +0 -29
  130. package/lib/types/app/utils.js +0 -2
  131. package/lib/types/bundler.d.ts +0 -34
  132. package/lib/types/bundler.js +0 -2
  133. package/lib/types/index.d.ts +0 -9
  134. package/lib/types/index.js +0 -19
  135. package/lib/types/page.d.ts +0 -98
  136. package/lib/types/page.js +0 -2
  137. package/lib/types/plugin-api/hooks.d.ts +0 -75
  138. package/lib/types/plugin-api/hooks.js +0 -2
  139. package/lib/types/plugin-api/index.d.ts +0 -2
  140. package/lib/types/plugin-api/index.js +0 -14
  141. package/lib/types/plugin-api/pluginApi.d.ts +0 -23
  142. package/lib/types/plugin-api/pluginApi.js +0 -2
  143. package/lib/types/plugin.d.ts +0 -48
  144. package/lib/types/plugin.js +0 -2
  145. package/lib/types/theme-api/index.d.ts +0 -1
  146. package/lib/types/theme-api/index.js +0 -13
  147. package/lib/types/theme-api/themeApi.d.ts +0 -44
  148. package/lib/types/theme-api/themeApi.js +0 -2
  149. package/lib/types/theme.d.ts +0 -33
  150. 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.5",
3
+ "version": "2.0.0-beta.50-pre",
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.5",
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
+ "@vuepress/client": "2.0.0-beta.50-pre",
31
+ "@vuepress/markdown": "2.0.0-beta.50-pre",
32
+ "@vuepress/shared": "2.0.0-beta.50-pre",
33
+ "@vuepress/utils": "2.0.0-beta.50-pre",
34
+ "vue": "^3.2.37"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "e7135a70d478ddfd4978e66265b269481c2cb299"
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,271 +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.5](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.4...v2.0.0-beta.5) (2021-03-26)
7
-
8
-
9
- ### Performance Improvements
10
-
11
- * improve HMR support ([38f0073](https://github.com/vuepress/vuepress-next/commit/38f007335864db4c9125ea5905ca91850fb7103b))
12
-
13
-
14
-
15
-
16
-
17
- # [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)
18
-
19
- **Note:** Version bump only for package @vuepress/core
20
-
21
-
22
-
23
-
24
-
25
- # [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)
26
-
27
- **Note:** Version bump only for package @vuepress/core
28
-
29
-
30
-
31
-
32
-
33
- # [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)
34
-
35
-
36
- ### Features
37
-
38
- * implement vite hmr ([525c18d](https://github.com/vuepress/vuepress-next/commit/525c18d5a64fbdbdeb5ce1348ec1e1ead3dbd8f9))
39
-
40
-
41
-
42
-
43
-
44
- # [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)
45
-
46
-
47
- ### Code Refactoring
48
-
49
- * **core:** remove theme data from site data ([187aef3](https://github.com/vuepress/vuepress-next/commit/187aef36607efc62d7b2d5c773553f89685cf64c))
50
-
51
-
52
- ### BREAKING CHANGES
53
-
54
- * **core:** `themeConfig` is not available in site data any more
55
-
56
-
57
-
58
-
59
-
60
- # [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)
61
-
62
-
63
- ### Code Refactoring
64
-
65
- * **core:** change page default date to 0000-00-00 ([1ce602e](https://github.com/vuepress/vuepress-next/commit/1ce602ef811f29f083a8d10695a7b212ed82cae5))
66
- * **core:** remove permalink and pattern from page options ([9534989](https://github.com/vuepress/vuepress-next/commit/9534989a82e620b1c09b4a09d4cfee1e99d145fc))
67
-
68
-
69
- ### Features
70
-
71
- * **core:** add extendsPageOptions hook ([19b7e83](https://github.com/vuepress/vuepress-next/commit/19b7e83cb25ec523857d34c415782d595a05d0ff))
72
- * **core:** add watchers parameter to onWatched hook ([0bcd594](https://github.com/vuepress/vuepress-next/commit/0bcd594d1645fe9994d1456e86803e5619057bfb))
73
-
74
-
75
- ### BREAKING CHANGES
76
-
77
- * **core:** remove permalink and pattern from page options
78
- * **core:** change page default date from 1970-01-01 to 0000-00-00
79
-
80
-
81
-
82
-
83
-
84
- # [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)
85
-
86
- **Note:** Version bump only for package @vuepress/core
87
-
88
-
89
-
90
-
91
-
92
- # [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)
93
-
94
- **Note:** Version bump only for package @vuepress/core
95
-
96
-
97
-
98
-
99
-
100
- # [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)
101
-
102
-
103
- ### Features
104
-
105
- * **core:** create siteData in vuepress app ([05b87dd](https://github.com/vuepress/vuepress-next/commit/05b87ddf32f32c94cc131e0074365aeba70f85f2))
106
- * **core:** make language available in page data ([03bb09f](https://github.com/vuepress/vuepress-next/commit/03bb09fd51aeaff56d26820a1401b87ea8bdeb38))
107
-
108
-
109
-
110
-
111
-
112
- # [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)
113
-
114
-
115
- ### Features
116
-
117
- * **core:** add onWatched hook ([9725a10](https://github.com/vuepress/vuepress-next/commit/9725a101599363094a85916317109b67d365dff4))
118
-
119
-
120
-
121
-
122
-
123
- # [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)
124
-
125
- **Note:** Version bump only for package @vuepress/core
126
-
127
-
128
-
129
-
130
-
131
- # [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)
132
-
133
- **Note:** Version bump only for package @vuepress/core
134
-
135
-
136
-
137
-
138
-
139
- # [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)
140
-
141
-
142
- ### Bug Fixes
143
-
144
- * **core:** support special characters in filename and permalink ([c3e68ef](https://github.com/vuepress/vuepress-next/commit/c3e68ef6a4aa3f6722d5bc4079bafe5d3b176e5e))
145
-
146
-
147
-
148
-
149
-
150
- # [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)
151
-
152
-
153
- ### Features
154
-
155
- * **core:** provide app in all plugin hooks ([21cc3a6](https://github.com/vuepress/vuepress-next/commit/21cc3a608e54d38de8de8f453b5e88031b4cedb1))
156
-
157
-
158
-
159
-
160
-
161
- # [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)
162
-
163
-
164
- ### Bug Fixes
165
-
166
- * **core:** fix page date resolving ([de6c5c8](https://github.com/vuepress/vuepress-next/commit/de6c5c8ca89347bea4ba2925e283a7b710a5b5d3))
167
-
168
-
169
-
170
-
171
-
172
- # [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)
173
-
174
- **Note:** Version bump only for package @vuepress/core
175
-
176
-
177
-
178
-
179
-
180
- # [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)
181
-
182
- **Note:** Version bump only for package @vuepress/core
183
-
184
-
185
-
186
-
187
-
188
- # [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)
189
-
190
- **Note:** Version bump only for package @vuepress/core
191
-
192
-
193
-
194
-
195
-
196
- # [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)
197
-
198
- **Note:** Version bump only for package @vuepress/core
199
-
200
-
201
-
202
-
203
-
204
- # [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)
205
-
206
- **Note:** Version bump only for package @vuepress/core
207
-
208
-
209
-
210
-
211
-
212
- # [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)
213
-
214
- **Note:** Version bump only for package @vuepress/core
215
-
216
-
217
-
218
-
219
-
220
- # [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)
221
-
222
-
223
- ### Bug Fixes
224
-
225
- * **core:** failed to resolve local theme ([4d836e2](https://github.com/vuepress/vuepress-next/commit/4d836e2bc3e7affe17f63df1c4ce40c464a7e6fb))
226
- * **core:** warn if layout directory does not exist ([3d2d414](https://github.com/vuepress/vuepress-next/commit/3d2d4148024963521b9e1ebbc29aa19697ac3452))
227
-
228
-
229
-
230
-
231
-
232
- # [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)
233
-
234
-
235
- ### Bug Fixes
236
-
237
- * **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))
238
-
239
-
240
-
241
-
242
-
243
- # 2.0.0-alpha.1 (2020-12-01)
244
-
245
-
246
- ### Bug Fixes
247
-
248
- * **core:** default value of base and lang ([5a5df27](https://github.com/vuepress/vuepress-next/commit/5a5df274de4691315e567e932a6cffe4a04d88c1))
249
- * **core:** infer page locale path correctly ([8f2b10b](https://github.com/vuepress/vuepress-next/commit/8f2b10bc8c9fa58ee4181bbfc50ade3e45e382ff))
250
- * **core:** resolve page date ([bd627d7](https://github.com/vuepress/vuepress-next/commit/bd627d79482e77c573654db699ff58f93e8d8dd5))
251
- * **core:** resolve page excerpt with correct markdown env ([e0f4066](https://github.com/vuepress/vuepress-next/commit/e0f406625baf085ced29ea88328069fb0a1d0cf4))
252
- * **core:** resolve page title from markdown content as fallback ([b216012](https://github.com/vuepress/vuepress-next/commit/b2160129b175013518b9fb7d82d034694509ae86))
253
- * **core:** resolve plugin and theme by name ([3031324](https://github.com/vuepress/vuepress-next/commit/30313247958f9e1d4a7214a18ce6e17bc582bc3e))
254
- * **core:** respect page options ([d8dbbb7](https://github.com/vuepress/vuepress-next/commit/d8dbbb777161130634fe5cadf0be571ed830a7ab))
255
-
256
-
257
- ### Features
258
-
259
- * **core:** add 404 page if not exist ([0297a9e](https://github.com/vuepress/vuepress-next/commit/0297a9ed96acb0b792dac44f72f4d549a5930841))
260
- * **core:** add clientAppRootComponentFiles hook ([7f640c8](https://github.com/vuepress/vuepress-next/commit/7f640c879f53b5dff67a2c6d374360f3e19aa679))
261
- * **core:** add extendsPageData hook ([5a10994](https://github.com/vuepress/vuepress-next/commit/5a109943ed1beb3ddfd07c018e0cba33cb46fdb2))
262
- * **core:** add pagePatterns option ([9a8855d](https://github.com/vuepress/vuepress-next/commit/9a8855d86683e95e2dae33493d0321fa14bfee9d))
263
- * **core:** add public directory config ([1b52ffe](https://github.com/vuepress/vuepress-next/commit/1b52ffe89a7f87d3c6822d07b6b75f2675b8745f))
264
- * **core:** add theme layouts option ([bf96cc3](https://github.com/vuepress/vuepress-next/commit/bf96cc3a2ab9133d3606231e3f9d0c46b2a2103c))
265
- * **core:** allow disable prefetch and preload links ([2991b6a](https://github.com/vuepress/vuepress-next/commit/2991b6a7025eefac21846eb520aa5ca2ea2dc594))
266
- * **core:** allow plugins and themes use export default ([874979d](https://github.com/vuepress/vuepress-next/commit/874979d6d86e308469488c8405e6f7bbc80d1391))
267
- * **core:** enable evergreen option by default ([fa67dbb](https://github.com/vuepress/vuepress-next/commit/fa67dbb9474c27ff10e4061ac15171bc4936d274))
268
- * **core:** export LocaleConfig type from shared ([04de925](https://github.com/vuepress/vuepress-next/commit/04de925326ad1101702e57fd9903de808a72bb97))
269
- * **core:** inject page title into route meta ([0d9e7e3](https://github.com/vuepress/vuepress-next/commit/0d9e7e3b3a0a78504fc586887cf1a777ae434846))
270
- * **core:** remove plugins from app options ([fe411e7](https://github.com/vuepress/vuepress-next/commit/fe411e7ef8a5802876f55246a9937825e802f538))
271
- * **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;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAppOptions = void 0;
4
- const utils_1 = require("@vuepress/utils");
5
- /**
6
- * Create app options with default values
7
- */
8
- const createAppOptions = ({
9
- // site config
10
- base = '/', lang = 'en-US', title = '', description = '', head = [], locales = {},
11
- // theme config
12
- theme = '@vuepress/default', themeConfig = {},
13
- // bundler config
14
- bundler = '@vuepress/webpack', bundlerConfig = {},
15
- // directory config
16
- source, dest = utils_1.path.resolve(source, '.vuepress/dist'), temp = utils_1.path.resolve(source, '.vuepress/.temp'), cache = utils_1.path.resolve(source, '.vuepress/.cache'), public: publicDir = utils_1.path.resolve(source, '.vuepress/public'),
17
- // markdown config
18
- markdown = {},
19
- // development config
20
- host = '0.0.0.0', port = 8080, debug = false, open = false, evergreen = true, pagePatterns = ['**/*.md', '!.vuepress', '!node_modules'], templateDev = utils_1.path.normalize(require.resolve('@vuepress/client/templates/index.dev.html')), templateSSR = utils_1.path.normalize(require.resolve('@vuepress/client/templates/index.ssr.html')), shouldPreload = true, shouldPrefetch = false, }) => ({
21
- base,
22
- lang,
23
- title,
24
- description,
25
- head,
26
- locales,
27
- theme,
28
- themeConfig,
29
- bundler,
30
- bundlerConfig,
31
- source,
32
- dest,
33
- temp,
34
- cache,
35
- public: publicDir,
36
- markdown,
37
- debug,
38
- host,
39
- port,
40
- open,
41
- evergreen,
42
- pagePatterns,
43
- templateDev,
44
- templateSSR,
45
- shouldPreload,
46
- shouldPrefetch,
47
- });
48
- exports.createAppOptions = createAppOptions;