From 6a89eab599c1fde9fd4196febe578be9f23e90b8 Mon Sep 17 00:00:00 2001 From: Jason Berry Date: Mon, 12 Aug 2024 21:09:24 +1000 Subject: [PATCH] chore: update shipjs config to use correct team name and bump version in requirejs docs (#549) --- ship.config.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ship.config.js b/ship.config.js index df3175df..8a323c92 100644 --- a/ship.config.js +++ b/ship.config.js @@ -1,3 +1,6 @@ +const fs = require("fs"); +const path = require("path"); + module.exports = { shouldPrepare: ({ releaseType, commitNumbersPerType }) => { const { fix = 0 } = commitNumbersPerType; @@ -7,5 +10,15 @@ module.exports = { return true; }, buildCommand: () => "yarn build && /bin/bash ./pre-deploy.sh", - pullRequestTeamReviewers: ["event-experiences"] + versionUpdated: ({ version, dir }) => { + // update version in `docs/requirejs.md` + const requirejsDocsPath = path.resolve(dir, "docs", "requirejs.md"); + const requirejsDocs = fs.readFileSync(requirejsDocsPath).toString(); + const updatedRequirejsDocs = requirejsDocs.replace( + /(\/search-insights@)([^\/]+)(\/dist)/, + `$1${version}$3` + ); + fs.writeFileSync(requirejsDocsPath, updatedRequirejsDocs); + }, + pullRequestTeamReviewers: ["events-platform"] };