Skip to content

Commit 1ae8236

Browse files
docs: copy & use main package version in docs on release (#16252)
* docs: update docs package ver from main on release fixes #16212 * docs: read docs package ver instead of main fixes #16212 * docs: add newline to updated docs package json Co-authored-by: Milos Djermanovic <[email protected]> * docs: update docs package json version Co-authored-by: Milos Djermanovic <[email protected]>
1 parent 42bfbd7 commit 1ae8236

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Makefile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ function generateRelease() {
287287
generateBlogPost(releaseInfo);
288288
commitSiteToGit(`v${releaseInfo.version}`);
289289

290+
echo("Updating version in docs package");
291+
const docsPackagePath = path.join(__dirname, "docs", "package.json");
292+
const docsPackage = require(docsPackagePath);
293+
294+
docsPackage.version = releaseInfo.version;
295+
fs.writeFileSync(docsPackagePath, `${JSON.stringify(docsPackage, null, 4)}\n`);
296+
290297
echo("Updating commit with docs data");
291298
exec("git add docs/ && git commit --amend --no-edit");
292299
exec(`git tag -a -f v${releaseInfo.version} -m ${releaseInfo.version}`);

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "docs-eslint",
33
"private": true,
4-
"version": "1.0.0",
4+
"version": "8.23.0",
55
"description": "",
66
"main": "index.js",
77
"keywords": [],

docs/src/_data/eslintVersion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const path = require("path");
1414
// Initialization
1515
//-----------------------------------------------------------------------------
1616

17-
const pkgPath = path.resolve(__dirname, "../../../package.json");
17+
const pkgPath = path.resolve(__dirname, "../../package.json");
1818
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
1919
const { ESLINT_VERSION } = process.env;
2020

@@ -23,7 +23,7 @@ const { ESLINT_VERSION } = process.env;
2323
//-----------------------------------------------------------------------------
2424

2525
/*
26-
* Because we want to differentiate between the development branch and the
26+
* Because we want to differentiate between the development branch and the
2727
* most recent release, we need a way to override the version. The
2828
* ESLINT_VERSION environment variable allows us to set this to override
2929
* the value displayed on the website. The most common case is we will set

0 commit comments

Comments
 (0)