File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,7 @@ tree in the following places:
310310 or ` .syncpackrc.cjs ` file
311311- a ` syncpack.config.js ` or ` syncpack.config.cjs ` CommonJS module exporting an
312312 object
313+ - a ` config.syncpack ` property in ` package.json `
313314
314315If you want to specify a path to a configuration file, overriding the discovered
315316configuration file (if present), you can use the ` --config ` option.
Original file line number Diff line number Diff line change 11import { cosmiconfigSync } from 'cosmiconfig' ;
2- import { readFileSync , removeSync , writeFileSync } from 'fs-extra' ;
2+ import { isNonEmptyObject , isObject } from 'expect-more' ;
3+ import {
4+ readFileSync ,
5+ removeSync ,
6+ writeFileSync ,
7+ readJsonSync ,
8+ } from 'fs-extra' ;
39import { sync as globSync } from 'glob' ;
10+ import { join } from 'path' ;
411import { sync as readYamlSync } from 'read-yaml-file' ;
512import type { SyncpackConfig } from '../constants' ;
613import { CWD } from '../constants' ;
@@ -30,6 +37,11 @@ export const disk = {
3037 try {
3138 const result = configPath ? client . load ( configPath ) : client . search ( ) ;
3239 if ( result === null ) {
40+ const rcPath = join ( CWD , 'package.json' ) ;
41+ const pjson = readJsonSync ( rcPath , { throws : false } ) ;
42+ const rcConfig = pjson ?. config ?. syncpack ;
43+ console . log ( rcConfig ) ;
44+ if ( isNonEmptyObject ( rcConfig ) ) return rcConfig ;
3345 verbose ( 'no config file found' ) ;
3446 return { } ;
3547 }
You can’t perform that action at this time.
0 commit comments