From 9ab5eecf7f1f5ab9248932f1b55b1491af9c6914 Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Tue, 19 Feb 2019 22:10:00 -0500 Subject: [PATCH 1/2] chore: rename copy-meta PR-URL: https://github.com/Brightspace/node-auth/pull/110 --- bin/do-release.sh | 2 +- bin/{copy-meta.js => set-meta.js} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename bin/{copy-meta.js => set-meta.js} (100%) diff --git a/bin/do-release.sh b/bin/do-release.sh index 6a29182..271d481 100755 --- a/bin/do-release.sh +++ b/bin/do-release.sh @@ -14,7 +14,7 @@ if [ -z "${TRAVIS_TAG}" ]; then exit 0 fi -./bin/copy-meta.js +./bin/set-meta.js ./bin/set-dependencies.js for package in $(get_packages); do diff --git a/bin/copy-meta.js b/bin/set-meta.js similarity index 100% rename from bin/copy-meta.js rename to bin/set-meta.js From 725b1a66661b840b9be1544a70f47bf22cdae6ed Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Tue, 19 Feb 2019 22:15:53 -0500 Subject: [PATCH 2/2] package: set repository.directory Ref: https://github.com/npm/rfcs/pull/19 PR-URL: https://github.com/Brightspace/node-auth/pull/110 --- bin/set-meta.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/set-meta.js b/bin/set-meta.js index f5d2238..409c4e2 100755 --- a/bin/set-meta.js +++ b/bin/set-meta.js @@ -26,8 +26,11 @@ for (const pkgName of pkgNames) { const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); for (const field of COMMON_META) { - pkg[field] = topPkg[field]; + pkg[field] = JSON.parse(JSON.stringify(topPkg[field])); } + // https://github.com/npm/rfcs/pull/19 + pkg.repository.directory = path.relative(topPkgDir, pkgDir); + fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, ' ') + '\n', 'utf8'); }