From 612473a0ac15c3b807d799be7c52c14994a0e5f2 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 16 Dec 2024 15:06:31 +0100 Subject: [PATCH] fix: proper fix to pass on nextVersionCommand I missed a location in the previous PR. Added a test to confirm. --- src/yarn/typescript-workspace.ts | 1 + test/cdklabs-monorepo.test.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/yarn/typescript-workspace.ts b/src/yarn/typescript-workspace.ts index 4eeb90c..d5765f3 100644 --- a/src/yarn/typescript-workspace.ts +++ b/src/yarn/typescript-workspace.ts @@ -110,6 +110,7 @@ export class TypeScriptWorkspace extends typescript.TypeScriptProject { private: this.isPrivatePackage, workflowNodeVersion: this.nodeVersion, releasableCommits: options.releasableCommits, + nextVersionCommand: options.nextVersionCommand, }); // jest config diff --git a/test/cdklabs-monorepo.test.ts b/test/cdklabs-monorepo.test.ts index 7283e47..6da9d1a 100644 --- a/test/cdklabs-monorepo.test.ts +++ b/test/cdklabs-monorepo.test.ts @@ -92,4 +92,23 @@ describe('CdkLabsMonorepo', () => { expect(releaseWorkflow.jobs['cdklabs-one_release_github'].needs).toStrictEqual(['release', 'cdklabs-one_release_npm']); expect(outdir).toMatchSnapshot(); }); + + test('monorepo release with nextVersionCommand', () => { + const parent = new yarn.CdkLabsMonorepo({ + name: 'monorepo', + defaultReleaseBranch: 'main', + release: true, + }); + + new yarn.TypeScriptWorkspace({ + parent, + name: '@cdklabs/one', + nextVersionCommand: 'asdf', + }); + + const outdir = Testing.synth(parent); + const tasks = outdir['packages/@cdklabs/one/.projen/tasks.json']; + + expect(tasks.tasks.bump.env.NEXT_VERSION_COMMAND).toStrictEqual('asdf'); + }); });