-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v2): docs versioning ❄️🔥 (#1983)
* wip: versioning * wip again * nits lint * refactor metadata code so that we can have inobject properties optimization, fix typing * remove buggy permalink code * modify versioned docs fixture such that foo/baz only exists in v1.0.0 * refactor metadata.ts so that there is less transformon object * more refactoring * reduce test fixtures, refactoring * refactoring readability * finish metadata part * refactor with readdir * first pass of implementation * fix mdx laoder * split generated routes by version for performance & smaller bundle * test data for demo * refactor with set * more tests * typo * fix typo * better temporary ui * stronger typing & docsVersion command * add 100% test coverage for docsVersion command * more test and delete manual docs cut * cut 2.0.0-alpha.35 docs * cut alpha.36 instead * copyright * delete versioned docs * stronger test on metadata * update typo
- Loading branch information
Showing
45 changed files
with
1,841 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...saurus-plugin-content-docs/src/__tests__/__fixtures__/simple-site/docs/lorem.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
custom_edit_url: https://github.com/customUrl/docs/lorem.md | ||
unrelated_frontmatter: won't be part of metadata | ||
--- | ||
|
||
Lorem ipsum. |
7 changes: 0 additions & 7 deletions
7
...us-plugin-content-docs/src/__tests__/__fixtures__/simple-site/docs/permalink.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s-plugin-content-docs/src/__tests__/__fixtures__/versioned-site/docs/foo/bar.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is `next` version of bar. |
1 change: 1 addition & 0 deletions
1
...rus-plugin-content-docs/src/__tests__/__fixtures__/versioned-site/docs/hello.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello `next` ! |
14 changes: 14 additions & 0 deletions
14
...saurus-plugin-content-docs/src/__tests__/__fixtures__/versioned-site/docusaurus.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
module.exports = { | ||
title: 'Versioned Site', | ||
tagline: 'The tagline of my site', | ||
url: 'https://your-docusaurus-test-site.com', | ||
baseUrl: '/', | ||
favicon: 'img/favicon.ico', | ||
}; |
10 changes: 10 additions & 0 deletions
10
...es/docusaurus-plugin-content-docs/src/__tests__/__fixtures__/versioned-site/sidebars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"docs": { | ||
"Test": [ | ||
"foo/bar" | ||
], | ||
"Guides": [ | ||
"hello" | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...c/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/foo/bar.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Bar `1.0.0` ! |
1 change: 1 addition & 0 deletions
1
...c/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/foo/baz.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Baz `1.0.0` ! This will be deleted in next subsequent versions. |
1 change: 1 addition & 0 deletions
1
...src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/hello.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello `1.0.0` ! |
1 change: 1 addition & 0 deletions
1
...c/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/foo/bar.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Bar `1.0.1` ! |
1 change: 1 addition & 0 deletions
1
...src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/hello.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello `1.0.1` ! |
11 changes: 11 additions & 0 deletions
11
.../src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.0-sidebars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version-1.0.0/docs": { | ||
"Test": [ | ||
"version-1.0.0/foo/bar", | ||
"version-1.0.0/foo/baz" | ||
], | ||
"Guides": [ | ||
"version-1.0.0/hello" | ||
] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.1-sidebars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"version-1.0.1/docs": { | ||
"Test": [ | ||
"version-1.0.1/foo/bar" | ||
], | ||
"Guides": [ | ||
"version-1.0.1/hello" | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...es/docusaurus-plugin-content-docs/src/__tests__/__fixtures__/versioned-site/versions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ | ||
"1.0.1", | ||
"1.0.0" | ||
] |
Oops, something went wrong.