refactor(theme-classic): completely migrate package to TypeScript (#5459)

* Migrate

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Migrate prism as well

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix lock file

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix typing

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* refactor a bit CodeBlock

* simplify versionBanner typing => use null instead of "none" (apart plugin options for retrocompatibility)

* Remove return signatures

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Joshua Chen 2021-09-01 20:34:26 +08:00 committed by GitHub
parent 5f003bcabd
commit 78d84006bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 153 additions and 95 deletions

View file

@ -514,7 +514,7 @@ Object {
\\"pluginId\\": \\"default\\",
\\"version\\": \\"current\\",
\\"label\\": \\"Next\\",
\\"banner\\": \\"none\\",
\\"banner\\": null,
\\"badge\\": false,
\\"className\\": \\"docs-version-current\\",
\\"isLast\\": true,
@ -1025,7 +1025,7 @@ Object {
\\"pluginId\\": \\"community\\",
\\"version\\": \\"1.0.0\\",
\\"label\\": \\"1.0.0\\",
\\"banner\\": \\"none\\",
\\"banner\\": null,
\\"badge\\": true,
\\"className\\": \\"docs-version-1.0.0\\",
\\"isLast\\": true,
@ -1722,7 +1722,7 @@ Object {
\\"pluginId\\": \\"default\\",
\\"version\\": \\"1.0.1\\",
\\"label\\": \\"1.0.1\\",
\\"banner\\": \\"none\\",
\\"banner\\": null,
\\"badge\\": true,
\\"className\\": \\"docs-version-1.0.1\\",
\\"isLast\\": true,

View file

@ -81,7 +81,7 @@ describe('simple site', () => {
versionLabel: 'Next',
versionName: 'current',
versionPath: '/docs',
versionBanner: 'none',
versionBanner: null,
versionBadge: false,
versionClassName: 'docs-version-current',
};
@ -262,7 +262,7 @@ describe('versioned site, pluginId=default', () => {
versionLabel: '1.0.1',
versionName: '1.0.1',
versionPath: '/docs',
versionBanner: 'none',
versionBanner: null,
versionBadge: true,
versionClassName: 'docs-version-1.0.1',
};
@ -554,7 +554,7 @@ describe('versioned site, pluginId=default', () => {
routePriority: -1,
tagsPath: '/docs/tags',
versionPath: '/docs',
versionBanner: 'none',
versionBanner: null,
versionBadge: false,
},
]);
@ -702,7 +702,7 @@ describe('versioned site, pluginId=community', () => {
versionLabel: '1.0.0',
versionName: '1.0.0',
versionPath: '/communityBasePath',
versionBanner: 'none',
versionBanner: null,
versionBadge: true,
versionClassName: 'docs-version-1.0.0',
};
@ -750,7 +750,7 @@ describe('versioned site, pluginId=community', () => {
routePriority: -1,
tagsPath: '/communityBasePath/tags',
versionPath: '/communityBasePath',
versionBanner: 'none',
versionBanner: null,
versionBadge: false,
},
]);