Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: copy & use main package version in docs on release #16252

Merged
merged 4 commits into from Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile.js
Expand Up @@ -282,6 +282,13 @@ function generateRelease() {
generateBlogPost(releaseInfo);
commitSiteToGit(`v${releaseInfo.version}`);

echo("Updating version in docs package");
const docsPackagePath = path.join(__dirname, "docs", "package.json");
const docsPackage = require(docsPackagePath);

docsPackage.version = releaseInfo.version;
fs.writeFileSync(docsPackagePath, `${JSON.stringify(docsPackage, null, 4)}\n`);

echo("Updating commit with docs data");
exec("git add docs/ && git commit --amend --no-edit");
exec(`git tag -a -f v${releaseInfo.version} -m ${releaseInfo.version}`);
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
@@ -1,7 +1,7 @@
{
"name": "docs-eslint",
"private": true,
"version": "1.0.0",
"version": "8.23.0",
"description": "",
"main": "index.js",
"keywords": [],
Expand Down
4 changes: 2 additions & 2 deletions docs/src/_data/eslintVersion.js
Expand Up @@ -14,7 +14,7 @@ const path = require("path");
// Initialization
//-----------------------------------------------------------------------------

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

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

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