@@ -28,15 +28,14 @@ import {
28
28
cloneRepository ,
29
29
} from './common' ;
30
30
import TEXT from './text' ;
31
- import type { VersionsToRelease } from './types' ;
31
+ import type {
32
+ VersionsToRelease ,
33
+ BeforeClientGenerationCommand ,
34
+ BeforeClientCommitCommand ,
35
+ } from './types' ;
32
36
33
37
dotenv . config ( { path : ROOT_ENV_PATH } ) ;
34
38
35
- type BeforeClientGenerationCommand = ( params : {
36
- releaseType : ReleaseType ;
37
- dir : string ;
38
- } ) => Promise < void > ;
39
-
40
39
const BEFORE_CLIENT_GENERATION : {
41
40
[ lang : string ] : BeforeClientGenerationCommand ;
42
41
} = {
@@ -45,6 +44,13 @@ const BEFORE_CLIENT_GENERATION: {
45
44
} ,
46
45
} ;
47
46
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
+
48
54
function getIssueBody ( ) : string {
49
55
return JSON . parse (
50
56
execa . sync ( 'curl' , [
@@ -224,6 +230,9 @@ async function processRelease(): Promise<void> {
224
230
const { current, releaseType } = versionsToRelease [ lang ] ;
225
231
const next = semver . inc ( current , releaseType ) ;
226
232
233
+ await BEFORE_CLIENT_COMMIT [ lang ] ?.( {
234
+ dir : tempGitDir ,
235
+ } ) ;
227
236
await gitCommit ( {
228
237
message : `chore: release v${ next } ` ,
229
238
cwd : tempGitDir ,
0 commit comments