From 354995b0a4040cbb74f07b42a0fbc279fb5a1ea0 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 18 Jan 2024 14:19:40 -0700 Subject: [PATCH] Fix 'yarn pack' (#238) The `yarn pack` command is run by the `npm-publish` action prior to publishing the package. Unfortunately, this command does not work as the `prepack` lifecycle script is overridden to run `yarn build:clean`, which was removed when this repo was converted to use `tsup` for building. `tsup` already has a way of clearing `dist` via a `--clean` flag, so this commit modifies the `build` script to use it and modifies the prepack script to run `yarn build` instead of `yarn build:clean`. --- package.json | 2 +- scripts/prepack.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 04853eb..070de9e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dist" ], "scripts": { - "build": "tsup && yarn build:types", + "build": "tsup --clean && yarn build:types", "build:docs": "typedoc", "build:types": "tsc --project tsconfig.build.json", "lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog", diff --git a/scripts/prepack.sh b/scripts/prepack.sh index d14605d..ad99af5 100755 --- a/scripts/prepack.sh +++ b/scripts/prepack.sh @@ -8,4 +8,4 @@ if [[ -n $SKIP_PREPACK ]]; then exit 0 fi -yarn build:clean +yarn build