Skip to content

Commit 725b1a6

Browse files
committed
package: set repository.directory
Ref: npm/rfcs#19 PR-URL: #110
1 parent 9ab5eec commit 725b1a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/set-meta.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ for (const pkgName of pkgNames) {
2626
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
2727

2828
for (const field of COMMON_META) {
29-
pkg[field] = topPkg[field];
29+
pkg[field] = JSON.parse(JSON.stringify(topPkg[field]));
3030
}
3131

32+
// https://github.com/npm/rfcs/pull/19
33+
pkg.repository.directory = path.relative(topPkgDir, pkgDir);
34+
3235
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, ' ') + '\n', 'utf8');
3336
}

0 commit comments

Comments
 (0)