diff --git a/.github/workflows/publish-releases.yml b/.github/workflows/publish-releases.yml index 53a719f..79db0fd 100644 --- a/.github/workflows/publish-releases.yml +++ b/.github/workflows/publish-releases.yml @@ -28,4 +28,4 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - pnpm exec changelogen gh release + pnpm version:publish-gh-releases diff --git a/.husky/pre-commit b/.husky/pre-commit index a5a29d9..ce36ad2 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm lint-staged +pnpm hooks:pre-commit diff --git a/.husky/pre-push b/.husky/pre-push index cc1844a..5612962 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,9 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm prettier-check -pnpm type-check -pnpm lint -pnpm publint -pnpm build -pnpm test:ci +pnpm hooks:pre-push diff --git a/.prettierignore b/.prettierignore index b8f6959..502c99a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ pnpm-lock.yaml pnpm-workspace.yaml build/ +.next dist/ .next/* coverage/ diff --git a/.scripts/tag-release-gh.sh b/.scripts/tag-release-gh.sh new file mode 100755 index 0000000..089d5c2 --- /dev/null +++ b/.scripts/tag-release-gh.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +# docs: https://cli.github.com/manual/gh_release_create + +# CURR_VERSION=$(node .scripts/get-semver.cjs current) +# gh release create v${CURR_VERSION} --generate-notes --verify-tag --title "v${CURR_VERSION}" --draft + +pnpm exec changelogen gh release diff --git a/.scripts/tag-version.sh b/.scripts/tag-version.sh index c6a2815..eb13a98 100755 --- a/.scripts/tag-version.sh +++ b/.scripts/tag-version.sh @@ -19,5 +19,5 @@ echo "${new_CHANGELOG}\n${existing_CHANGELOG}" > CHANGELOG.md # Create a new commit and tag with the current version git add CHANGELOG.md package.json **/package.json pnpm-lock.yaml -git commit -m "chore(release): bump version to v${CURRENT_VERSION}" || exit 1 +git commit -m "chore(releases): bump version to v${CURRENT_VERSION}" || exit 1 git tag -a "v${CURRENT_VERSION}" -m "v${CURRENT_VERSION}" || exit 1 diff --git a/.scripts/update-changelog-gh.sh b/.scripts/update-changelog-gh.sh new file mode 100755 index 0000000..9c81c86 --- /dev/null +++ b/.scripts/update-changelog-gh.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +# docs: https://cli.github.com/manual/gh_release_view + +CURR_VERSION=$(node .scripts/get-semver.cjs current) +gh release view v${CURR_VERSION} --jq .body --json body >> CHANGELOG.md diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d7df89c..dbfeccb 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,10 @@ { - "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] + "recommendations": [ + "vsls-contrib.codetour", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "yoavbls.pretty-ts-errors", + "orta.vscode-jest", + "github.vscode-github-actions" + ] } diff --git a/commitlint.config.js b/commitlint.config.js index b5eb019..ac95ab5 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -35,7 +35,7 @@ module.exports = { 'always', [ 'general', - 'release', + 'releases', 'deps', 'config', 'setup', diff --git a/package.json b/package.json index f05f823..14bd3ce 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,12 @@ "scripts": { "build": "turbo build", "clear-cache": "rm -rf packages/*/.turbo && rm -rf packages/*/.next && jest --clearCache", - "dev": "turbo run build && turbo run dev --no-deps --no-cache --parallel --concurrency 20", + "dev": "turbo run build && sleep 2 && turbo run dev --no-deps --no-cache --parallel --concurrency 20", "format": "pnpm lint-fix && pnpm prettier-fix", - "postinstall": "pnpm lint-staged && pnpm build", - "lint": "turbo lint", + "hooks:pre-commit": "pnpm lint-staged", + "hooks:pre-push": "pnpm run quality-checks", + "postinstall": "pnpm lint-staged", + "lint": "turbo lint -- --max-warnings=0", "lint-fix": "turbo lint-fix", "prepare": "husky install", "prettier-check": "prettier --check .", @@ -22,19 +24,19 @@ "pretty": "pnpm run format", "preview": "pnpm build && npx -y http-server ./packages/examples/react/dist", "publint": "turbo publint-check", - "quality-check-all": "pnpm prettier-check && pnpm lint && pnpm publint && pnpm type-check && pnpm build && pnpm test", - "test": "jest --passWithNoTests", - "test:ci": "jest --ci --passWithNoTests --coverage", - "test:coverage": "jest --passWithNoTests --coverage", + "quality-checks": "pnpm prettier-check && pnpm type-check && pnpm lint && pnpm build && pnpm publint && pnpm test:ci", + "test": "jest", + "test:ci": "jest --ci --coverage", + "test:coverage": "jest --coverage", "type-check": "turbo type-check", "version:bump": ".scripts/bump-version.sh patch && .scripts/tag-version.sh", "version:bump-major": ".scripts/bump-version.sh major && .scripts/tag-version.sh", "version:bump-minor": ".scripts/bump-version.sh minor && .scripts/tag-version.sh", "version:bump-patch": "pnpm ws:version", "version:publish": "pnpm run version:publish-gh-refs && pnpm run version:publish-npm", - "version:publish-gh-refs": "git push && git push --tags", - "version:publish-gh-releases": "pnpm exec changelogen gh release", - "version:publish-npm": "pnpm -r --filter='@storylite/*' exec pnpm publish" + "version:publish-gh-refs": "git push && git push -n --tags", + "version:publish-gh-releases": ".scripts/tag-release-gh.sh", + "version:publish-npm": "pnpm -r exec pnpm publish" }, "lint-staged": { "*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}": [