Skip to content

Commit f389efc

Browse files
authored
Split projects, version docs, prep for 1.19 (#63)
* Refactor for multiple does plugin instances * fix issue from merge * split dev and admin docs * remove getting help sidebar links * wiki -> docs * common -> misc * enable debug plugin * relocate misc category to misc base path * add current required redirects currently in cloudflare pages/netlify format. may change depending on eventual deployment decision * Add category indexes to landing pages and resolve naming issues * swizzle DropdownNavbarItem * mark desktop dropdown as active when has active children * better implement same idea * only show dropdown when page not active * cache assets * update dependencies, node_modules * greatly improve development scripts * clean up custom tags plugin, partially prepare for cloudflare pages/netlify * prepare for versioning * initial versioning, split 1.18 * fix build * fix nondeterministic resolution by fully qualifying plugin name * clean up versioned directory structure * relock * move versioned content to docs folder * disable automatic deployment * remove redundancy in config docs naming * configure vercel
1 parent 796c72f commit f389efc

File tree

103 files changed

+4498
-2778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4498
-2778
lines changed

.github/workflows/build-artifact.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/build-pr.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/preview.yaml

Lines changed: 0 additions & 107 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ yarn-error.log*
1515
!.yarn/releases
1616
!.yarn/sdks
1717
!.yarn/versions
18-
/config/*.js
19-
/*.js
20-
/*.js.map
18+
/.meta

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/*.js
88
/*.js.map
99
/config/*.js
10+
/.meta
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
diff --git a/lib/constants.js b/lib/constants.js
2+
index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75ba14c894 100644
3+
--- a/lib/constants.js
4+
+++ b/lib/constants.js
5+
@@ -10,8 +10,8 @@ exports.VERSIONS_JSON_FILE = exports.VERSIONED_SIDEBARS_DIR = exports.VERSIONED_
6+
/** The name of the version that's actively worked on (e.g. `website/docs`) */
7+
exports.CURRENT_VERSION_NAME = 'current';
8+
/** All doc versions are stored here by version names */
9+
-exports.VERSIONED_DOCS_DIR = 'versioned_docs';
10+
+exports.VERSIONED_DOCS_DIR = 'content';
11+
/** All doc versioned sidebars are stored here by version names */
12+
-exports.VERSIONED_SIDEBARS_DIR = 'versioned_sidebars';
13+
+exports.VERSIONED_SIDEBARS_DIR = 'sidebars';
14+
/** The version names. Should 1-1 map to the content of versioned docs dir. */
15+
-exports.VERSIONS_JSON_FILE = 'versions.json';
16+
+exports.VERSIONED_BASE_DIR = 'docs/versioned';
17+
diff --git a/lib/versions/files.js b/lib/versions/files.js
18+
index 5a3efcb0b3dec47120fe32b8824e0c4ca7987df8..5295a02a6fe5829d7621a37a14d456947a75c6de 100644
19+
--- a/lib/versions/files.js
20+
+++ b/lib/versions/files.js
21+
@@ -13,20 +13,14 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
22+
const utils_1 = require("@docusaurus/utils");
23+
const constants_1 = require("../constants");
24+
const validation_1 = require("./validation");
25+
-/** Add a prefix like `community_version-1.0.0`. No-op for default instance. */
26+
-function addPluginIdPrefix(fileOrDir, pluginId) {
27+
- return pluginId === utils_1.DEFAULT_PLUGIN_ID
28+
- ? fileOrDir
29+
- : `${pluginId}_${fileOrDir}`;
30+
-}
31+
-/** `[siteDir]/community_versioned_docs/version-1.0.0` */
32+
+/** `[siteDir]/docs/versioned/paper/content/1.0.0` */
33+
function getVersionDocsDirPath(siteDir, pluginId, versionName) {
34+
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_DOCS_DIR, pluginId), `version-${versionName}`);
35+
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_DOCS_DIR, versionName);
36+
}
37+
exports.getVersionDocsDirPath = getVersionDocsDirPath;
38+
-/** `[siteDir]/community_versioned_sidebars/version-1.0.0-sidebars.json` */
39+
+/** `[siteDir]/docs/versioned/paper/sidebars/1.0.0.json` */
40+
function getVersionSidebarsPath(siteDir, pluginId, versionName) {
41+
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONED_SIDEBARS_DIR, pluginId), `version-${versionName}-sidebars.json`);
42+
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, pluginId, constants_1.VERSIONED_SIDEBARS_DIR, `${versionName}.json`);
43+
}
44+
exports.getVersionSidebarsPath = getVersionSidebarsPath;
45+
function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) {
46+
@@ -43,9 +37,9 @@ function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) {
47+
});
48+
}
49+
exports.getDocsDirPathLocalized = getDocsDirPathLocalized;
50+
-/** `community` => `[siteDir]/community_versions.json` */
51+
+/** `community` => `[siteDir]/docs/versioned/paper.json` */
52+
function getVersionsFilePath(siteDir, pluginId) {
53+
- return path_1.default.join(siteDir, addPluginIdPrefix(constants_1.VERSIONS_JSON_FILE, pluginId));
54+
+ return path_1.default.join(siteDir, constants_1.VERSIONED_BASE_DIR, `${pluginId}.json`);
55+
}
56+
exports.getVersionsFilePath = getVersionsFilePath;
57+
/**

.yarnrc.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
nodeLinker: pnp
1+
nodeLinker: pnpm
22

33
plugins:
44
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
55
spec: "@yarnpkg/plugin-interactive-tools"
66
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
77
spec: "@yarnpkg/plugin-typescript"
88

9+
packageExtensions:
10+
esbuild-loader@*:
11+
dependencies:
12+
webpack: ^5.72.1
13+
14+
defaultSemverRangePrefix: ""
15+
916
yarnPath: .yarn/releases/yarn-3.2.0.cjs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $ yarn
2929
3. Start the development server
3030

3131
```bash
32-
$ yarn start
32+
$ yarn dev
3333
```
3434

3535
This will start a local development server and open a browser window. The majority of changes will

config/.swcrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)