Skip to content

Commit

Permalink
chore: various internal fixes (#6761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Feb 25, 2022
1 parent 124511f commit e101acd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 105 deletions.
4 changes: 4 additions & 0 deletions jest/snapshotPathNormalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

const _ = require('lodash');
const {escapePath} = require('@docusaurus/utils');
const {version} = require('@docusaurus/core/package.json');
const os = require('os');
const path = require('path');
const fs = require('fs');
Expand Down Expand Up @@ -131,6 +132,9 @@ function normalizePaths(value) {
.split(`<TEMP_DIR>${path.sep + homeRealRelativeToTemp}`)
.join('<HOME_DIR>'), // untested

// Replace the Docusaurus version with a stub
(val) => val.split(version).join('<CURRENT_VERSION>'),

// In case the CWD is escaped
(val) => val.split(escapePath(cwd)).join('<PROJECT_ROOT>'),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ Array [
\\"docusaurus\\": \\"docusaurus\\"
},
\\"dependencies\\": {
\\"@docusaurus/core\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/preset-classic\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/core\\": \\"<CURRENT_VERSION>\\",
\\"@docusaurus/preset-classic\\": \\"<CURRENT_VERSION>\\",
\\"clsx\\": \\"^1.1.1\\",
\\"react\\": \\"^17.0.2\\",
\\"react-dom\\": \\"^17.0.2\\"
Expand Down Expand Up @@ -350,8 +350,8 @@ Array [
\\"docusaurus\\": \\"docusaurus\\"
},
\\"dependencies\\": {
\\"@docusaurus/core\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/preset-classic\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/core\\": \\"<CURRENT_VERSION>\\",
\\"@docusaurus/preset-classic\\": \\"<CURRENT_VERSION>\\",
\\"clsx\\": \\"^1.1.1\\",
\\"react\\": \\"^17.0.2\\",
\\"react-dom\\": \\"^17.0.2\\"
Expand Down Expand Up @@ -539,8 +539,8 @@ Array [
\\"docusaurus\\": \\"docusaurus\\"
},
\\"dependencies\\": {
\\"@docusaurus/core\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/preset-classic\\": \\"2.0.0-beta.15\\",
\\"@docusaurus/core\\": \\"<CURRENT_VERSION>\\",
\\"@docusaurus/preset-classic\\": \\"<CURRENT_VERSION>\\",
\\"clsx\\": \\"^1.1.1\\",
\\"react\\": \\"^17.0.2\\",
\\"react-dom\\": \\"^17.0.2\\"
Expand Down
1 change: 0 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@docusaurus/utils": "2.0.0-beta.16",
"@docusaurus/utils-common": "2.0.0-beta.16",
"@popperjs/core": "^2.11.2",
"axios": "^0.26.0",
"clsx": "^1.1.1",
"color": "^4.2.1",
"esbuild-loader": "2.18.0",
Expand Down
6 changes: 3 additions & 3 deletions website/src/plugins/changelog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const path = require('path');
const fs = require('fs-extra');
const pluginContentBlog = require('@docusaurus/plugin-content-blog');
const {aliasedSitePath, docuHash, normalizeUrl} = require('@docusaurus/utils');
const syncAvatars = require('./syncAvatars');

/**
* Multiple versions may be published on the same day, causing the order to be
Expand Down Expand Up @@ -51,7 +50,7 @@ function processSection(section) {
.map((author) => ({
...author,
name: author.name ?? author.alias,
imageURL: `./img/${author.alias}.png`,
imageURL: `https://github.com/${author.alias}.png`,
}))
.sort((a, b) => a.url.localeCompare(b.url));

Expand Down Expand Up @@ -117,7 +116,8 @@ async function ChangelogPlugin(context, options) {
),
),
);
await syncAvatars(authorsMap, generateDir);
const authorsPath = path.join(generateDir, 'authors.json');
await fs.outputFile(authorsPath, JSON.stringify(authorsMap, null, 2));
const content = await blogPlugin.loadContent();
content.blogPosts.forEach((post, index) => {
const pageIndex = Math.floor(index / options.postsPerPage);
Expand Down
87 changes: 0 additions & 87 deletions website/src/plugins/changelog/syncAvatars.js

This file was deleted.

9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5326,13 +5326,6 @@ axios@^0.25.0:
dependencies:
follow-redirects "^1.14.7"

axios@^0.26.0:
version "0.26.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.0.tgz#9a318f1c69ec108f8cd5f3c3d390366635e13928"
integrity sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==
dependencies:
follow-redirects "^1.14.8"

axobject-query@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
Expand Down Expand Up @@ -9351,7 +9344,7 @@ folder-walker@^3.2.0:
dependencies:
from2 "^2.1.0"

follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.14.8:
follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.7:
version "1.14.9"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
Expand Down

0 comments on commit e101acd

Please sign in to comment.