New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(doc-core): support extendPageData
hook & last updated time
#3480
Conversation
🦋 Changeset detectedLatest commit: f801e54 The changes in this PR will be included in the next version bump. This PR includes changesets to release 216 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
295e5fe
to
f801e54
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3480 +/- ##
==========================================
+ Coverage 57.59% 58.20% +0.60%
==========================================
Files 672 667 -5
Lines 17794 17669 -125
Branches 3876 3833 -43
==========================================
+ Hits 10249 10284 +35
+ Misses 6934 6780 -154
+ Partials 611 605 -6
... and 94 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Summary
extendPageData
钩子实现lastUpdated
相关的主题配置🤖 Generated by Copilot at 010d696
This pull request introduces several improvements and new features to the
doc-core
package, which is responsible for generating and rendering documentation pages. It simplifies and refactors the plugin handling, the data structures, and the components, making the code more concise, consistent, and reusable. It also adds the last updated time feature, which shows the modification date of each page, and enhances the search feature, which generates language-specific index files. Additionally, it updates the type definitions, the dependencies, and the changelog for the package.Details
🤖 Generated by Copilot at 010d696
.changeset
directory for changelog and version updates (link)@modern-js/doc-plugin-last-updated
package in thedoc-core
package for the last updated time feature (link)build
anddev
functions in thedoc-core
package by removing thedocPlugins
parameter and using thegetPlugins
function instead (link, link, link, link, link)hooks
module in thedoc-core
package to import the@modern-js/doc-plugin-last-updated
package and thePageIndexInfo
type, define thegetPlugins
function, and add theextendPageData
hook for each plugin (link, link, link, link, link)BuilderPlugin
type from@modern-js/builder-webpack-provider
to@modern-js/builder
in theruntimeModule
module in thedoc-core
package (link)siteData
module in thedoc-core
package to categorize the pages by language, generate the search index files for each language, run theextendPageData
hook for each page data object, and simplify thesiteData
object that is exported as a virtual module (link, link, link, link, link, link, link, link)pageData
object that is returned by theinitPageData
function in theApp
component in thedoc-core
package, and remove some redundant or unused properties (link)data.lang
property to thedata.page.lang
property in theuseLang
hook in thedoc-core
package (link)isEqualPath
function from the@runtime
module in thedoc-core
package, and use it to check if two paths are equivalent in the documentation context (link, link, link)DefaultThemeConfig
andLocaleConfig
interfaces in thedoc-core
package, which is thelastUpdated
property, a boolean value that indicates whether to show the last updated time for each page in the documentation (link, link)PageData
andSiteData
interfaces in thedoc-core
package, and add a new type alias, which is theBaseRuntimePageInfo
type, a subset of thePageIndexInfo
type that omits theid
,content
, anddomain
properties (link, link, link)DocPlugin
interface in thedoc-core
package, which is theextendPageData
hook, a function that can modify or add properties to thePageIndexInfo
object (link, link)DocFooter
component in thedoc-core
package to import theusePageData
hook and get the last updated time of the current page (link)HomeFeature
andHomeHero
components in thedoc-core
package to get thefrontmatter
data from a prop instead of theusePageData
hook, to make them more reusable and decoupled from the runtime context (link, link, link, link)Nav
component in thedoc-core
package to change the source of the language value and remove the unnecessary!
operator (link, link)Overview
component in thedoc-core
package to change the source of theroutePath
value, remove the unnecessary type assertion, and import theisEqualPath
function from the@runtime
module (link, link, link)Search
component in thedoc-core
package to change the source of the language value (link)Related Issue
Checklist
pnpm run change
.