diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index f60a3cf..1c2872f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -16,7 +16,6 @@ jobs: with: node-version: 16 - run: yarn run ci - - run: yarn run build - run: yarn test publish-npm: diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..bfc028b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn test diff --git a/package.json b/package.json index cb442f2..b699ba6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@twilio-labs/docusaurus-plugin-segment", - "version": "0.1.0", + "version": "0.1.0-pre1", "description": "Segment plugin for Docusaurus.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -10,7 +10,11 @@ "scripts": { "build": "tsc --build", "watch": "tsc --build --watch", - "test": "jest" + "test": "jest", + "prepack": "rimraf lib && yarn run build && rimraf lib/src/tests", + "preci": "rm -rf node_modules", + "ci": "yarn install --frozen-lockfile", + "prepare": "husky install" }, "repository": "https://github.com/twilio-labs/docusaurus-plugin-segment", "license": "MIT", @@ -24,6 +28,7 @@ "@docusaurus/types": "2.0.0-beta.21", "@types/jest": "^28.1.1", "@types/segment-analytics": "^0.0.34", + "husky": "^8.0.1", "jest": "^28.1.1", "ts-jest": "^28.0.4", "typescript": "^4.7.3" diff --git a/yarn.lock b/yarn.lock index 1449dab..076dcf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4319,6 +4319,11 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +husky@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.1.tgz#511cb3e57de3e3190514ae49ed50f6bc3f50b3e9" + integrity sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw== + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"