@@ -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,12 @@ 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
+ } ,
51
+ } ;
52
+
48
53
function getIssueBody ( ) : string {
49
54
return JSON . parse (
50
55
execa . sync ( 'curl' , [
@@ -219,11 +224,13 @@ async function processRelease(): Promise<void> {
219
224
await copy ( clientPath , tempGitDir , { preserveTimestamps : true } ) ;
220
225
221
226
await configureGitHubAuthor ( tempGitDir ) ;
227
+ await BEFORE_CLIENT_COMMIT [ lang ] ?.( {
228
+ dir : tempGitDir ,
229
+ } ) ;
222
230
await run ( `git add .` , { cwd : tempGitDir } ) ;
223
231
224
232
const { current, releaseType } = versionsToRelease [ lang ] ;
225
233
const next = semver . inc ( current , releaseType ) ;
226
-
227
234
await gitCommit ( {
228
235
message : `chore: release v${ next } ` ,
229
236
cwd : tempGitDir ,
0 commit comments