diff --git a/Makefile b/Makefile index 288dc9c8..24c438e5 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,22 @@ package-format-check: package-format-fix: yarn run format:write + +.PHONY: version-patch version-minor version-major version-alpha + +# Create a patch version of packages +version-patch: + yarn run versionup:patch + +# Create a minor version of packages +version-minor: + yarn run versionup:minor + +# Create a major versio of packages +version-major: + yarn run versionup:major + +# Create beta version of the next minor version +# For example: 0.12.0 => 0.13.0-alpha.0 +version-alpha: + yarn run version:alpha diff --git a/package.json b/package.json index 1cfa847e..b66835f3 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,13 @@ "format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc", "postinstall": "husky install", "lint": "eslint .", - "prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"" + "prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"", + "publish:ci": "lerna publish --from-git --no-private --yes", + "publish:official": "lerna publish --from-package", + "version:alpha": "yarn lerna version --no-private --conventional-commits --conventional-prerelease --include-merged-tags --no-git-tag-version --sync-dist-version", + "versionup:major": "yarn lerna version major --no-private --conventional-commits --include-merged-tags --no-git-tag-version --sync-dist-version", + "versionup:minor": "yarn lerna version minor --no-private --conventional-commits --include-merged-tags --no-git-tag-version --sync-dist-version", + "versionup:patch": "yarn lerna version patch --no-private --conventional-commits --include-merged-tags --no-git-tag-version --sync-dist-version" }, "husky": { "hooks": { diff --git a/packages/components/package.json b/packages/components/package.json index 33307545..c6609105 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -21,7 +21,8 @@ "build": "NODE_ENV=production tsup", "dev": "NODE_ENV=development tsup", "lint": "eslint .", - "lint:fix": "eslint --fix" + "lint:fix": "eslint --fix", + "prepublish": "yarn build" }, "dependencies": { "@layer5/sistent-svg": "^0.14.1" diff --git a/packages/svg/package.json b/packages/svg/package.json index 03ba1558..80bbc5f8 100644 --- a/packages/svg/package.json +++ b/packages/svg/package.json @@ -13,7 +13,8 @@ "dev": "NODE_ENV=development tsup", "coverage": "jest --coverage", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", - "test": "jest" + "test": "jest", + "prepublish": "yarn build" }, "devDependencies": { "@testing-library/react": "^14.0.0",