@@ -3,6 +3,8 @@ import { getFiles } from '../util/get-files.mjs';
33import fs , { promises as fsp } from 'fs' ;
44import { toposort } from '../util/toposort.mjs' ;
55
6+ const p = ( path . posix ?? path ) ;
7+
68export async function listWorkspaces ( ) {
79 try {
810 const rootPackageJSON = JSON . parse ( await fsp . readFile ( 'package.json' ) ) ;
@@ -14,12 +16,12 @@ export async function listWorkspaces() {
1416 const packageDirs = await getFiles ( workspace . slice ( 0 , - 2 ) , false ) ;
1517 for ( const packageDir of packageDirs ) {
1618 packages . add (
17- path . resolve ( ( path . posix ?? path ) . join ( packageDir , 'package.json' ) )
19+ p . resolve ( p . join ( packageDir , 'package.json' ) )
1820 ) ;
1921 }
2022 } else {
2123 packages . add (
22- path . resolve ( ( path . posix ?? path ) . join ( workspace , 'package.json' ) )
24+ p . resolve ( p . join ( workspace , 'package.json' ) )
2325 ) ;
2426 }
2527 }
@@ -34,9 +36,7 @@ export async function listWorkspaces() {
3436
3537 for ( const packageJSONPath of Array . from ( packages ) ) {
3638 const packageJSON = JSON . parse ( await fsp . readFile ( packageJSONPath ) ) ;
37- const packagePath = path . relative ( process . cwd ( ) , path . dirname ( packageJSONPath ) ) ;
38-
39- console . error ( 'workspace' , packagePath ) ;
39+ const packagePath = p . relative ( process . cwd ( ) , p . dirname ( packageJSONPath ) ) ;
4040
4141 result . push ( {
4242 path : packagePath ,
0 commit comments