diff --git a/src/__tests__/globber.test.ts b/src/__tests__/globber.test.ts index 8da825a..8366d73 100644 --- a/src/__tests__/globber.test.ts +++ b/src/__tests__/globber.test.ts @@ -1,8 +1,8 @@ -import { join } from 'node:path' +import * as path from 'node:path' import { createGlobber } from '../globber' test('returns the current directory as a match', async () => { const result = await createGlobber().glob(process.cwd(), 'package.json') expect(result).toHaveLength(1) - expect(result[0]).toBe(join(process.cwd(), 'package.json')) + expect(result[0]).toBe(path.join(process.cwd(), 'package.json')) }) diff --git a/src/type-syncer.ts b/src/type-syncer.ts index 3689c32..dd11fa1 100644 --- a/src/type-syncer.ts +++ b/src/type-syncer.ts @@ -65,7 +65,9 @@ export function createTypeSyncer( const syncedFiles: Array = await Promise.all([ syncFile(filePath, file, syncOpts, dryRun), - ...subPackages.map((p) => syncFile(p, null, syncOpts, dryRun)), + ...subPackages.map((p) => + syncFile(path.join(p, 'package.json'), null, syncOpts, dryRun), + ), ]) return { diff --git a/src/workspace-resolver.ts b/src/workspace-resolver.ts index 1faafc9..9ec2532 100644 --- a/src/workspace-resolver.ts +++ b/src/workspace-resolver.ts @@ -1,4 +1,4 @@ -import path from 'node:path' +import * as path from 'node:path' import yaml from 'js-yaml' import type * as fsUtils from './fs-utils' import { IGlobber } from './globber' @@ -17,6 +17,7 @@ export interface IWorkspaceResolverService { * - `pnpm-workspace.yaml` `packages` field, as an array of globs. * * Path is relative to the current working directory. + * Note that this returns a list of directories, not paths to the manifests themselves. */ getWorkspaces( packageJson: IPackageFile,