@@ -7,13 +7,11 @@ import globby from "globby";
77import pLimit from "p-limit" ;
88import fs from "fs-extra" ;
99import { resolve , join } from "path" ;
10+ import { Consola } from "consola" ;
1011import get from "lodash.get" ;
1112
1213import { createCommand } from "../command" ;
13- import { Consola } from "consola" ;
14-
15- // TODO: validate tsconfig.json (outDir, paths etc)
16- // TODO: validate package.json and main/module etc
14+ import { BobConfig } from "../config" ;
1715
1816interface BuildOptions {
1917 external ?: string [ ] ;
@@ -57,7 +55,7 @@ export const buildCommand = createCommand<
5755
5856 await Promise . all (
5957 packages . map ( ( packagePath ) =>
60- limit ( ( ) => build ( packagePath , config . scope , reporter ) )
58+ limit ( ( ) => build ( packagePath , config , reporter ) )
6159 )
6260 ) ;
6361 } ,
@@ -143,10 +141,22 @@ async function buildSingle() {
143141 ) ;
144142}
145143
146- async function build ( packagePath : string , scope : string , reporter : Consola ) {
144+ async function build (
145+ packagePath : string ,
146+ config : BobConfig ,
147+ reporter : Consola
148+ ) {
149+ const scope = config . scope ;
147150 const cwd = packagePath . replace ( "/package.json" , "" ) ;
148151 const pkg = await readPackageJson ( cwd ) ;
149- const name = pkg . name . replace ( `${ scope } /` , "" ) ;
152+ const fullName : string = pkg . name ;
153+
154+ if ( ( config . ignore || [ ] ) . includes ( fullName ) ) {
155+ reporter . warn ( `Ignored ${ fullName } ` ) ;
156+ return ;
157+ }
158+
159+ const name = fullName . replace ( `${ scope } /` , "" ) ;
150160
151161 validatePackageJson ( pkg ) ;
152162
@@ -316,7 +326,7 @@ function rewritePackageJson(pkg: Record<string, any>) {
316326 ] ;
317327
318328 fields . forEach ( ( field ) => {
319- if ( typeof pkg [ field ] !== ' undefined' ) {
329+ if ( typeof pkg [ field ] !== " undefined" ) {
320330 newPkg [ field ] = pkg [ field ] ;
321331 }
322332 } ) ;
0 commit comments