Skip to content

Commit 07b18f3

Browse files
committed
chore(javascript): add yarn.lock on release process
1 parent 7a7164a commit 07b18f3

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

scripts/release/process-release.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ import {
2828
cloneRepository,
2929
} from './common';
3030
import TEXT from './text';
31-
import type { VersionsToRelease } from './types';
31+
import type {
32+
VersionsToRelease,
33+
BeforeClientGenerationCommand,
34+
BeforeClientCommitCommand,
35+
} from './types';
3236

3337
dotenv.config({ path: ROOT_ENV_PATH });
3438

35-
type BeforeClientGenerationCommand = (params: {
36-
releaseType: ReleaseType;
37-
dir: string;
38-
}) => Promise<void>;
39-
4039
const BEFORE_CLIENT_GENERATION: {
4140
[lang: string]: BeforeClientGenerationCommand;
4241
} = {
@@ -45,6 +44,13 @@ const BEFORE_CLIENT_GENERATION: {
4544
},
4645
};
4746

47+
const BEFORE_CLIENT_COMMIT: { [lang: string]: BeforeClientCommitCommand } = {
48+
javascript: async ({ dir }) => {
49+
await run(`yarn`, { cwd: dir }); // generate `yarn.lock` file
50+
await run(`git add yarn.lock`, { cwd: dir });
51+
},
52+
};
53+
4854
function getIssueBody(): string {
4955
return JSON.parse(
5056
execa.sync('curl', [
@@ -224,6 +230,9 @@ async function processRelease(): Promise<void> {
224230
const { current, releaseType } = versionsToRelease[lang];
225231
const next = semver.inc(current, releaseType);
226232

233+
await BEFORE_CLIENT_COMMIT[lang]?.({
234+
dir: tempGitDir,
235+
});
227236
await gitCommit({
228237
message: `chore: release v${next}`,
229238
cwd: tempGitDir,

scripts/release/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,12 @@ export type VersionsToRelease = {
3636
releaseType: ReleaseType;
3737
};
3838
};
39+
40+
export type BeforeClientGenerationCommand = (params: {
41+
releaseType: ReleaseType;
42+
dir: string;
43+
}) => Promise<void>;
44+
45+
export type BeforeClientCommitCommand = (params: {
46+
dir: string;
47+
}) => Promise<void>;

0 commit comments

Comments
 (0)