Skip to content

Commit

Permalink
Use resolve-package-path
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Feb 16, 2023
1 parent 8db5d54 commit 0188aca
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
10 changes: 5 additions & 5 deletions internal/sync-pnpm/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { join } from 'node:path';
import { join, dirname } from 'node:path';
import { createRequire } from 'node:module';

import { getPackages } from '@manypkg/get-packages';
import { findRoot } from '@manypkg/find-root';
import { readJson, pathExists } from 'fs-extra/esm';
import { hardLinkDir } from '@pnpm/fs.hard-link-dir';
import resolvePkg from 'resolve-pkg';
import resolvePackagePath from 'resolve-package-path';

const require = createRequire(import.meta.url);

Expand All @@ -29,9 +29,9 @@ export default async function syncPnpm(dir = process.cwd()) {

for (const pkg of packagesToSync) {
const syncFrom = join(pkg.dir, syncDir);
const resolvedPackagePath = resolvePkg(pkg.packageJson.name, {
cwd: dir,
});
const resolvedPackagePath = dirname(
resolvePackagePath(pkg.packageJson.name, dir)
);
const syncTo = join(resolvedPackagePath, syncDir);

if (await pathExists(syncFrom)) {
Expand Down
2 changes: 1 addition & 1 deletion internal/sync-pnpm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@manypkg/get-packages": "^2.1.0",
"@pnpm/fs.hard-link-dir": "^1.0.3",
"fs-extra": "^11.1.0",
"resolve-pkg": "^2.0.0"
"resolve-package-path": "^4.0.3"
}
}
3 changes: 1 addition & 2 deletions packages/changeset-validations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.cjs",
"./package.json": "./package.json"
"./addon-main.js": "./addon-main.cjs"
},
"typesVersions": {
"*": {
Expand Down
3 changes: 1 addition & 2 deletions packages/ember-headless-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.js",
"./-private/*": null,
"./package.json": "./package.json"
"./-private/*": null
},
"typesVersions": {
"*": {
Expand Down
3 changes: 1 addition & 2 deletions packages/yup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.cjs",
"./package.json": "./package.json"
"./addon-main.js": "./addon-main.cjs"
},
"typesVersions": {
"*": {
Expand Down
12 changes: 3 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0188aca

Please sign in to comment.