From 8dfd99440b8666e81cc6865f68697ab272dfe83d Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Fri, 23 Feb 2024 10:26:32 -0500 Subject: [PATCH] Publish watcher from sub-directory so binding.gyp is excluded #156 --- .github/workflows/release.yml | 2 -- package.json | 5 +++-- scripts/build-npm.js | 8 +++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0a47ae..dee546b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,5 +149,3 @@ jobs: npm publish; cd ../..; done - echo "Publishing @parcel/watcher..." - npm publish diff --git a/package.json b/package.json index 5de07e5..4a9d95e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/watcher", - "version": "2.4.0", + "version": "2.4.1", "main": "index.js", "types": "index.d.ts", "repository": { @@ -22,7 +22,8 @@ "index.d.ts", "wrapper.js", "package.json", - "README.md" + "README.md", + "LICENSE" ], "scripts": { "prebuild": "prebuildify --napi --strip --tag-libc", diff --git a/scripts/build-npm.js b/scripts/build-npm.js index 5389925..4ee2091 100644 --- a/scripts/build-npm.js +++ b/scripts/build-npm.js @@ -76,8 +76,14 @@ for (let triple of triples) { buildNode(triple, t); } +try { + fs.mkdirSync(dir + '/npm/watcher'); +} catch (err) { } +for (let file of pkg.files) { + fs.copyFileSync(`${dir}/${file}`, `npm/watcher/${file}`); +} pkg.optionalDependencies = optionalDependencies; -fs.writeFileSync(`${dir}/package.json`, JSON.stringify(pkg, false, 2) + '\n'); +fs.writeFileSync(`${dir}/npm/watcher/package.json`, JSON.stringify(pkg, false, 2) + '\n'); function buildNode(triple, t) { let pkg2 = { ...pkg };