@@ -8,7 +8,7 @@ import {Descriptor, Locator} from './types';
8
8
9
9
export const CorePlugin : Plugin = {
10
10
hooks : {
11
- reduceDependency : ( dependency : Descriptor , project : Project , locator : Locator , initialDependency : Descriptor , { resolver, resolveOptions } : { resolver : Resolver , resolveOptions : ResolveOptions } ) => {
11
+ reduceDependency : ( { dependency, project , locator , initialDependency , resolver , resolveOptions } : { dependency : Descriptor , project : Project , locator : Locator , initialDependency : Descriptor , resolver : Resolver , resolveOptions : ResolveOptions } ) => {
12
12
for ( const { pattern, reference} of project . topLevelWorkspace . manifest . resolutions ) {
13
13
if ( pattern . from && pattern . from . fullName !== structUtils . stringifyIdent ( locator ) )
14
14
continue ;
@@ -32,26 +32,29 @@ export const CorePlugin: Plugin = {
32
32
return dependency ;
33
33
} ,
34
34
35
- validateProject : async ( project : Project , report : {
35
+ validateProject : async ( { project , report } : { project : Project , report : {
36
36
reportWarning : ( name : MessageName , text : string ) => void ;
37
37
reportError : ( name : MessageName , text : string ) => void ;
38
- } ) => {
38
+ } } ) => {
39
39
for ( const workspace of project . workspaces ) {
40
40
const workspaceName = structUtils . prettyWorkspace ( project . configuration , workspace ) ;
41
41
42
42
await project . configuration . triggerHook ( hooks => {
43
43
return hooks . validateWorkspace ;
44
- } , workspace , {
45
- reportWarning : ( name : MessageName , text : string ) => report . reportWarning ( name , `${ workspaceName } : ${ text } ` ) ,
46
- reportError : ( name : MessageName , text : string ) => report . reportError ( name , `${ workspaceName } : ${ text } ` ) ,
44
+ } , {
45
+ workspace,
46
+ report : {
47
+ reportWarning : ( name : MessageName , text : string ) => report . reportWarning ( name , `${ workspaceName } : ${ text } ` ) ,
48
+ reportError : ( name : MessageName , text : string ) => report . reportError ( name , `${ workspaceName } : ${ text } ` ) ,
49
+ } ,
47
50
} ) ;
48
51
}
49
52
} ,
50
53
51
- validateWorkspace : async ( workspace : Workspace , report : {
54
+ validateWorkspace : async ( { workspace , report } : { workspace : Workspace , report : {
52
55
reportWarning : ( name : MessageName , text : string ) => void ;
53
56
reportError : ( name : MessageName , text : string ) => void ;
54
- } ) => {
57
+ } } ) => {
55
58
// Validate manifest
56
59
const { manifest} = workspace ;
57
60
0 commit comments