@@ -6,6 +6,13 @@ const PLACEHOLDER_VERSION = '0.0.0-dev.0';
6
6
const PROJECT_ROOT = path . resolve ( __dirname , '..' , '..' , '..' ) ;
7
7
const LERNA_BIN = path . resolve ( PROJECT_ROOT , 'node_modules' , '.bin' , 'lerna' ) ;
8
8
9
+ export interface LernaPackageDescription {
10
+ name : string ;
11
+ version : string ;
12
+ private : boolean ;
13
+ location : string ;
14
+ }
15
+
9
16
export function spawnSync ( command : string , args : string [ ] , options : SpawnSyncOptionsWithStringEncoding ) : SpawnSyncReturns < string > {
10
17
const result = spawn . sync ( command , args , options ) ;
11
18
if ( result . error ) {
@@ -46,6 +53,11 @@ export function bumpNpmPackages(
46
53
cwd : PROJECT_ROOT ,
47
54
encoding : 'utf8'
48
55
} ) ;
56
+ spawnSyncFn ( 'git' , [ 'status' , '--porcelain' ] , {
57
+ stdio : 'inherit' ,
58
+ cwd : PROJECT_ROOT ,
59
+ encoding : 'utf8'
60
+ } ) ;
49
61
}
50
62
51
63
export function publishNpmPackages (
@@ -88,11 +100,12 @@ export function publishNpmPackages(
88
100
}
89
101
}
90
102
91
- export function listNpmPackages ( ) : { name : string ; version : string } [ ] {
103
+ export function listNpmPackages ( ) : LernaPackageDescription [ ] {
92
104
const lernaListOutput = spawnSync (
93
105
LERNA_BIN , [
94
106
'list' ,
95
107
'--json' ,
108
+ '--all'
96
109
] ,
97
110
{
98
111
cwd : PROJECT_ROOT ,
@@ -104,15 +117,16 @@ export function listNpmPackages(): { name: string; version: string }[] {
104
117
}
105
118
106
119
export function markBumpedFilesAsAssumeUnchanged (
107
- packages : { name : string } [ ] , assumeUnchanged : boolean ,
120
+ packages : LernaPackageDescription [ ] ,
121
+ assumeUnchanged : boolean ,
108
122
spawnSyncFn : typeof spawnSync = spawnSync
109
123
) : void {
110
124
const filesToAssume = [
111
- 'lerna.json'
125
+ path . resolve ( PROJECT_ROOT , 'lerna.json' )
112
126
] ;
113
- packages . forEach ( ( { name } ) => {
114
- filesToAssume . push ( `packages/ ${ name } / package.json` ) ;
115
- filesToAssume . push ( `packages/ ${ name } / package-lock.json` ) ;
127
+ packages . forEach ( ( { location } ) => {
128
+ filesToAssume . push ( path . resolve ( location , ' package.json' ) ) ;
129
+ filesToAssume . push ( path . resolve ( location , ' package-lock.json' ) ) ;
116
130
} ) ;
117
131
118
132
filesToAssume . forEach ( f => {
0 commit comments