Skip to content

Commit

Permalink
fix: manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Oct 25, 2024
1 parent 4435e49 commit 384f81d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/globber.test.ts
Original file line number Diff line number Diff line change
@@ -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'))
})
4 changes: 3 additions & 1 deletion src/type-syncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export function createTypeSyncer(

const syncedFiles: Array<ISyncedFile> = 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 {
Expand Down
3 changes: 2 additions & 1 deletion src/workspace-resolver.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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,
Expand Down

0 comments on commit 384f81d

Please sign in to comment.