Skip to content
Permalink
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 <milos.djermanovic@gmail.com>

* docs: update docs package json version

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
jugalthakkar and mdjermanovic committed Sep 5, 2022
1 parent 42bfbd7 commit 1ae8236a2e71c9dead20ba9da60d8cc9e317859a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
@@ -287,6 +287,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}`);
@@ -1,7 +1,7 @@
{
"name": "docs-eslint",
"private": true,
"version": "1.0.0",
"version": "8.23.0",
"description": "",
"main": "index.js",
"keywords": [],
@@ -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;

@@ -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

0 comments on commit 1ae8236

Please sign in to comment.