Skip to content

Commit

Permalink
chore(build): migrate publish process to dedicated script
Browse files Browse the repository at this point in the history
  • Loading branch information
nktknshn committed Sep 24, 2024
1 parent 4a4d9cf commit 45cd976
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yargs-command-wrapper",
"version": "1.0.7",
"version": "1.0.7-1",
"description": "enables the parsing of commands and subcommands into a unified set of types",
"main": "index.js",
"types": "index.d.ts",
Expand All @@ -9,14 +9,10 @@
"test": "./node_modules/.bin/vitest",
"coverage": "./node_modules/.bin/vitest run --coverage",
"build": "./node_modules/.bin/tsc",
"build-publish": "rm -rf dist/ && ./node_modules/.bin/tsc -p tsconfig.publish.json && cp package.json dist/ && cp README.md dist/",
"prepublishOnly": "npm run build-publish",
"prepublishOnly": "echo 'use scripts/publish.sh instead' && exit 1",
"clean": "rm -rf dist/"
},
"homepage": "https://github.com/nktknshn/yargs-command-wrapper",
"files": [
"/dist"
],
"author": {
"name": "Nikita Kanashin",
"email": "nikita@kanash.in"
Expand Down Expand Up @@ -46,6 +42,8 @@
"parser",
"parsing",
"cli",
"command"
"command",
"fp-ts",
"fp"
]
}
11 changes: 11 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e
set -x

rm -rf dist/
./node_modules/.bin/tsc -p tsconfig.publish.json
cat package.json | jq 'del(.scripts)' | jq 'del(.devDependencies)' > dist/package.json
cp README.md dist/
cd dist
npm publish "$@"

0 comments on commit 45cd976

Please sign in to comment.