diff --git a/packages/click-ui/.changeset/config.json b/.changeset/config.json similarity index 67% rename from packages/click-ui/.changeset/config.json rename to .changeset/config.json index ad6f18a14..ba0f1777f 100644 --- a/packages/click-ui/.changeset/config.json +++ b/.changeset/config.json @@ -1,10 +1,10 @@ { - "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", + "$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index cb78ecac3..2dc9901b8 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -114,8 +114,8 @@ jobs: CURRENT_TAG="N/A" IS_PRERELEASE="false" - if [[ -f packages/click-ui/.changeset/pre.json ]]; then - CURRENT_TAG=$(node -p "require('./packages/click-ui/.changeset/pre.json').tag") + if [[ -f .changeset/pre.json ]]; then + CURRENT_TAG=$(node -p "require('./.changeset/pre.json').tag") IS_PRERELEASE="true" echo "prerelease=true" >> $GITHUB_OUTPUT echo "current_tag=$CURRENT_TAG" >> $GITHUB_OUTPUT @@ -131,7 +131,7 @@ jobs: - name: Prevent promotion without changes if: steps.check-prerelease.outputs.prerelease == 'true' && steps.check-prerelease.outputs.current_tag != inputs.release_type run: | - CHANGESET_COUNT=$(find packages/click-ui/.changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ') + CHANGESET_COUNT=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ') echo "🔍 Debug: changeset_count=$CHANGESET_COUNT" if [[ "$CHANGESET_COUNT" -eq 0 ]]; then @@ -145,7 +145,7 @@ jobs: run: | echo "Must exit pre-release mode..." - if ! yarn workspace @clickhouse/click-ui changeset pre exit; then + if ! yarn changeset pre exit; then echo "👹 Oops! Failed to exit pre-release mode for some reason..." exit 1 else @@ -156,7 +156,7 @@ jobs: if: steps.check-prerelease.outputs.prerelease == 'true' && steps.check-prerelease.outputs.current_tag != inputs.release_type && inputs.release_type != 'latest' && inputs.release_type != 'stable' run: | echo "🔄 Switching from ${{ steps.check-prerelease.outputs.current_tag }} to ${{ inputs.release_type }} prerelease mode" - if ! yarn workspace @clickhouse/click-ui changeset pre exit; then + if ! yarn changeset pre exit; then echo "👹 Oops! Failed to exit current prerelease mode for some reason..." exit 1 else @@ -167,7 +167,7 @@ jobs: if: inputs.release_type != 'latest' && inputs.release_type != 'stable' && (steps.check-prerelease.outputs.prerelease != 'true' || steps.check-prerelease.outputs.current_tag != inputs.release_type) run: | echo "🤖 Entering ${{ inputs.release_type }} prerelease mode" - yarn workspace @clickhouse/click-ui changeset pre enter ${{ inputs.release_type }} + yarn changeset pre enter ${{ inputs.release_type }} - name: Validate latest release eligibility if: (inputs.release_type == 'latest' || inputs.release_type == 'stable') && steps.check-prerelease.outputs.prerelease != 'true' @@ -187,7 +187,7 @@ jobs: id: version-package run: | echo "📦 Versioning packages..." - if ! yarn workspace @clickhouse/click-ui changeset:version; then + if ! yarn changeset:version; then echo "👹 Oops! Failed to do changeset versioning for some reason..." exit 1 else @@ -249,7 +249,7 @@ jobs: run: | # WARNING: This is coupled with a verify release commit # if you need to modify, apply the changes accordingly - COMMIT_TITLE=$(packages/click-ui/.scripts/bash/generate-release-commit-message "${{ steps.version-package.outputs.version }}" "${{ inputs.release_type }}") + COMMIT_TITLE=$(.scripts/bash/generate-release-commit-message "${{ steps.version-package.outputs.version }}" "${{ inputs.release_type }}") echo "title=$COMMIT_TITLE" >> $GITHUB_OUTPUT echo "branch=changeset-release/v${{ steps.version-package.outputs.version }}-${{ inputs.release_type }}" >> $GITHUB_OUTPUT diff --git a/packages/click-ui/.scripts/bash/changeset-add b/.scripts/bash/changeset-add similarity index 87% rename from packages/click-ui/.scripts/bash/changeset-add rename to .scripts/bash/changeset-add index 1cd165b20..478ff67de 100755 --- a/packages/click-ui/.scripts/bash/changeset-add +++ b/.scripts/bash/changeset-add @@ -11,7 +11,7 @@ fi changeset_path=".changeset/${filename}.md" if ! yarn changeset; then - echo "👹 Oops! Failed to create changest" + echo "👹 Oops! Failed to create changeset" exit 1 fi @@ -25,7 +25,7 @@ fi new_changeset=$(echo "$untracked_changesets" | head -1) if [[ ! -n "$new_changeset" ]]; then - echo "👹 Oops! This is embarassing but couldn't locate the expeccted generated changeset file..." + echo "👹 Oops! This is embarrassing but couldn't locate the expected generated changeset file..." exit 1 fi diff --git a/packages/click-ui/.scripts/bash/changeset-verification b/.scripts/bash/changeset-verification similarity index 100% rename from packages/click-ui/.scripts/bash/changeset-verification rename to .scripts/bash/changeset-verification diff --git a/packages/click-ui/.scripts/bash/generate-release-commit-message b/.scripts/bash/generate-release-commit-message similarity index 100% rename from packages/click-ui/.scripts/bash/generate-release-commit-message rename to .scripts/bash/generate-release-commit-message diff --git a/packages/click-ui/.scripts/bash/verify-release-commit b/.scripts/bash/verify-release-commit similarity index 100% rename from packages/click-ui/.scripts/bash/verify-release-commit rename to .scripts/bash/verify-release-commit diff --git a/README.md b/README.md new file mode 100644 index 000000000..6b0d6239b --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +## Changeset + +We use [Changesets](https://github.com/changesets/changesets) to manage versioning and changelogs. + +### Add a new changeset + +When contributing, declare an intent or describe the changes you're making by executing the `changeset:add` command. + +The wizard will ask a few questions and generate a changelog entry for you: + +```sh +yarn changeset:add +``` + +The changesets tool keeps track of all declared changes in the `.changeset` directory. + +Once completed, you must commit the changeset! + +### Checking the changeset status + +To check if your branch contains a changeset: + +```sh +yarn changeset:status +``` + +### Create a new version and changelogs + +To consume all changesets, and update to the most appropriate semver version and write a friendly changelog based on those changes: + +> [!IMPORTANT] +> Consuming changesets is done automatically in the CI/CD environment. For this reason, you don't have to execute the command, as a contributor your single concern should be adding changesets to any relevant changes. + +```sh +yarn changeset:version +``` + +## Release + +See [Package Release](./packages/click-ui/docs/package-release.md) for detailed release instructions. diff --git a/package.json b/package.json index c242c1452..f358e57e8 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,14 @@ "format": "yarn workspaces foreach -A --topological run format", "format:fix": "yarn workspaces foreach -A --topological run format:fix", "typecheck": "yarn workspaces foreach -A --topological run typecheck", - "prepare": "husky" + "prepare": "husky", + "changeset:add": ".scripts/bash/changeset-add", + "changeset:status": "yarn changeset status", + "changeset:verify": ".scripts/bash/changeset-verification", + "changeset:version": "yarn changeset version" }, "devDependencies": { + "@changesets/cli": "^2.30.0", "husky": "^9.1.7" }, "resolutions": { diff --git a/packages/click-ui/.changeset/pre.json b/packages/click-ui/.changeset/pre.json deleted file mode 100644 index bae73e032..000000000 --- a/packages/click-ui/.changeset/pre.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "mode": "pre", - "tag": "test", - "initialVersions": { - "@clickhouse/click-ui": "0.1.0" - }, - "changesets": [ - "add-biglake-metastore-logo", - "fix-missing-focus-token-found-in-ts-but-not-dictionary", - "fix-textcolor-warning" - ] -} diff --git a/packages/click-ui/README.md b/packages/click-ui/README.md index 685c9d6a6..8ccecdb81 100644 --- a/packages/click-ui/README.md +++ b/packages/click-ui/README.md @@ -41,10 +41,6 @@ You can find the official docs for the Click UI design system and component libr - [Custom styling with CSS](#custom-styling-with-css) * [Assets Management](#assets-management) - [Convert SVG to React Component](#convert-svg-to-react-component) -* [Changesets](#changesets) - - [Add a new changeset](#add-a-new-changeset) - - [Checking the changeset status](#checking-the-changeset-status) - - [Create a new version and changelogs](#create-a-new-version-and-changelogs) * [Release](#release) * [Contributing](#contributing) - [Component RFC](#component-rfc) @@ -220,52 +216,6 @@ The latest static version's built and deployed automatically when contributing t Once deployed it's available publicly at [clickhouse.design/click-ui](https://clickhouse.design/click-ui). -## Changeset - -Learn to manage the versioning of changelog entries. - -The following is a brief description of available commands to allow a person making a contribution make key decisions about their changes. - -It'll generate a changeset, which is effectively two key bits of information: - -- A version type which follows [semver](https://semver.org/) -- Change information placed in a changelog - -Make good use of this simple workflow to help us release new package versions more confidently. - -### Add a new changeset - -When contributing, declare an intent or describe the changes you're making or adding to a release by executing the `changeset:add` command. - -The wizard will ask a few questions and generate a changelog entry for you: - -```sh -yarn changeset:add -``` - -The changesets tool keeps track of all declared changes in the `.changeset` directory. - -Once completed, you must commit the changeset! - -### Checking the changeset status - -To check if your branch contains a changeset: - -```sh -yarn changeset:status -``` - -### Create a new version and changelogs - -To consume all changesets, and update to the most appropriate semver version and write a friendly changelog based on those changesets, the following command is available: - -> [!IMPORTANT] -> Consuming changesets is done automatically in the CI/CD environment. For this reason, you don't have to execute the command, as a contributor your single concern should be adding changesets to any relevant changes. - -```sh -yarn changeset:version -``` - ## Distribution The package is distributed as ESM. diff --git a/packages/click-ui/package.json b/packages/click-ui/package.json index e97138595..51765e23b 100644 --- a/packages/click-ui/package.json +++ b/packages/click-ui/package.json @@ -360,11 +360,7 @@ "build:health_check": ".scripts/bash/build_output_health_check", "build-storybook": "storybook build", "build:watch": "watch 'yarn build' ./src", - "changeset:add": ".scripts/bash/changeset-add", - "changeset:status": "yarn changeset status", - "changeset:verify": ".scripts/bash/changeset-verification", "circular-dependency:check": ".scripts/bash/circular-dependency-check", - "changeset:version": "yarn changeset version", "convert:logo": ".scripts/js/convert-svg-to-react-component --type=logos", "convert:icon": ".scripts/js/convert-svg-to-react-component --type=icons", "convert:flag": ".scripts/js/convert-svg-to-react-component --type=flags", @@ -419,7 +415,6 @@ "styled-components": "^6.1.11" }, "devDependencies": { - "@changesets/cli": "^2.29.8", "@playwright/test": "^1.57.0", "@storybook/addon-a11y": "^10.1.10", "@storybook/addon-docs": "^10.1.10", diff --git a/yarn.lock b/yarn.lock index d69e5fb8e..4760071ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -525,11 +525,11 @@ __metadata: languageName: node linkType: hard -"@changesets/apply-release-plan@npm:^7.0.14": - version: 7.0.14 - resolution: "@changesets/apply-release-plan@npm:7.0.14" +"@changesets/apply-release-plan@npm:^7.1.0": + version: 7.1.0 + resolution: "@changesets/apply-release-plan@npm:7.1.0" dependencies: - "@changesets/config": "npm:^3.1.2" + "@changesets/config": "npm:^3.1.3" "@changesets/get-version-range-type": "npm:^0.4.0" "@changesets/git": "npm:^3.0.4" "@changesets/should-skip-package": "npm:^0.1.2" @@ -542,7 +542,7 @@ __metadata: prettier: "npm:^2.7.1" resolve-from: "npm:^5.0.0" semver: "npm:^7.5.3" - checksum: 10c0/097c7ebcec758966b6728696498d59cfac23271aba2a56824ee307be1eefb2d0c6974aef1be4841e20b3458546ffacfd108c1afbf3acc512d6c3a4e30fa28622 + checksum: 10c0/c8b4fa55f204a0c343c450ca44ae32a892752eaa81b594fb8941e9d1eb8675aba6245c8d80e5e9726e915d2643c542d22cba40d430c76a71ff438ad368d91f5c languageName: node linkType: hard @@ -569,32 +569,30 @@ __metadata: languageName: node linkType: hard -"@changesets/cli@npm:^2.29.8": - version: 2.29.8 - resolution: "@changesets/cli@npm:2.29.8" +"@changesets/cli@npm:^2.30.0": + version: 2.30.0 + resolution: "@changesets/cli@npm:2.30.0" dependencies: - "@changesets/apply-release-plan": "npm:^7.0.14" + "@changesets/apply-release-plan": "npm:^7.1.0" "@changesets/assemble-release-plan": "npm:^6.0.9" "@changesets/changelog-git": "npm:^0.2.1" - "@changesets/config": "npm:^3.1.2" + "@changesets/config": "npm:^3.1.3" "@changesets/errors": "npm:^0.2.0" "@changesets/get-dependents-graph": "npm:^2.1.3" - "@changesets/get-release-plan": "npm:^4.0.14" + "@changesets/get-release-plan": "npm:^4.0.15" "@changesets/git": "npm:^3.0.4" "@changesets/logger": "npm:^0.1.1" "@changesets/pre": "npm:^2.0.2" - "@changesets/read": "npm:^0.6.6" + "@changesets/read": "npm:^0.6.7" "@changesets/should-skip-package": "npm:^0.1.2" "@changesets/types": "npm:^6.1.0" "@changesets/write": "npm:^0.4.0" "@inquirer/external-editor": "npm:^1.0.2" "@manypkg/get-packages": "npm:^1.1.3" ansi-colors: "npm:^4.1.3" - ci-info: "npm:^3.7.0" enquirer: "npm:^2.4.1" fs-extra: "npm:^7.0.1" mri: "npm:^1.2.0" - p-limit: "npm:^2.2.0" package-manager-detector: "npm:^0.2.0" picocolors: "npm:^1.1.0" resolve-from: "npm:^5.0.0" @@ -603,22 +601,23 @@ __metadata: term-size: "npm:^2.1.0" bin: changeset: bin.js - checksum: 10c0/85c32814698403f1634b649d96b8b32f04fa7f2065e455df672c0b39e9a2dc3a05538b82496536ac00aabf7810dfa68ff8049fa4f618e50ed00a29ceb302a7b5 + checksum: 10c0/2b06343ae6df20b627ee89027f4078c074bdd758f82bb5dbf16ef7c4900138f733b59ceeb1c960fca1e9e59cf6973bb4d5984e4c7dd6d50a3949b39c490f31e0 languageName: node linkType: hard -"@changesets/config@npm:^3.1.2": - version: 3.1.2 - resolution: "@changesets/config@npm:3.1.2" +"@changesets/config@npm:^3.1.3": + version: 3.1.3 + resolution: "@changesets/config@npm:3.1.3" dependencies: "@changesets/errors": "npm:^0.2.0" "@changesets/get-dependents-graph": "npm:^2.1.3" "@changesets/logger": "npm:^0.1.1" + "@changesets/should-skip-package": "npm:^0.1.2" "@changesets/types": "npm:^6.1.0" "@manypkg/get-packages": "npm:^1.1.3" fs-extra: "npm:^7.0.1" micromatch: "npm:^4.0.8" - checksum: 10c0/76065383cd5b7595f95ad7dc4aacfa74dd4ebb2ef956c30ea97e6f09b87b2e73b870676e7b294290b6cf9b1777983526bc8d3bb58dedd37dfa8a5ddbb02ebe1a + checksum: 10c0/68764135cbd014aca24b20429ffaf6f90e440286c7d233c33ddc968f0ab54b9e6e5dd5015a619dd0e0dd2eb172f028064a229fa610c260b779ff5315a840be1e languageName: node linkType: hard @@ -643,17 +642,17 @@ __metadata: languageName: node linkType: hard -"@changesets/get-release-plan@npm:^4.0.14": - version: 4.0.14 - resolution: "@changesets/get-release-plan@npm:4.0.14" +"@changesets/get-release-plan@npm:^4.0.15": + version: 4.0.15 + resolution: "@changesets/get-release-plan@npm:4.0.15" dependencies: "@changesets/assemble-release-plan": "npm:^6.0.9" - "@changesets/config": "npm:^3.1.2" + "@changesets/config": "npm:^3.1.3" "@changesets/pre": "npm:^2.0.2" - "@changesets/read": "npm:^0.6.6" + "@changesets/read": "npm:^0.6.7" "@changesets/types": "npm:^6.1.0" "@manypkg/get-packages": "npm:^1.1.3" - checksum: 10c0/24a15056955fc3967e023f058fa6c1e7550f3aad5c299264307a09b6d312868715684595bdb45a79c3f25fc809a70582be39861f3ae958d392b89a234f65b670 + checksum: 10c0/d059c18ef5aab1c1aa1dd4f68d74e2fc351d965e28a76ab7f7c63c3290787d645f887d89c50b92f9f6bb63148a5d17329cfbb9cdea8e02c669a47768ec3456bc languageName: node linkType: hard @@ -686,13 +685,13 @@ __metadata: languageName: node linkType: hard -"@changesets/parse@npm:^0.4.2": - version: 0.4.2 - resolution: "@changesets/parse@npm:0.4.2" +"@changesets/parse@npm:^0.4.3": + version: 0.4.3 + resolution: "@changesets/parse@npm:0.4.3" dependencies: "@changesets/types": "npm:^6.1.0" js-yaml: "npm:^4.1.1" - checksum: 10c0/fdc1c99e01257e194a5ff59213993158deae9f84a66f5444a636645ff2655f67b6031589bab796a8c3ed653220d3c55fd62a6af2504a7c54bb541ac573119c5d + checksum: 10c0/4d8488eaf224974ae335fec964dc1dc486abcfa9f96856cf4267c2765b02ed6af1778375ec03d38252ebab9e191aa4a11c5f37a6ad42e907e08290fed2b9690c languageName: node linkType: hard @@ -708,18 +707,18 @@ __metadata: languageName: node linkType: hard -"@changesets/read@npm:^0.6.6": - version: 0.6.6 - resolution: "@changesets/read@npm:0.6.6" +"@changesets/read@npm:^0.6.7": + version: 0.6.7 + resolution: "@changesets/read@npm:0.6.7" dependencies: "@changesets/git": "npm:^3.0.4" "@changesets/logger": "npm:^0.1.1" - "@changesets/parse": "npm:^0.4.2" + "@changesets/parse": "npm:^0.4.3" "@changesets/types": "npm:^6.1.0" fs-extra: "npm:^7.0.1" p-filter: "npm:^2.1.0" picocolors: "npm:^1.1.0" - checksum: 10c0/a0a503061764bb391e00a37df1251c90356cf46519663dd517e58bc170c290f591abc1cff44569c88c87083360a36e2d756afcf7537b8725f4decfd915f838d3 + checksum: 10c0/eebda5f5cea8684b9cb470e74cd5e67043a62ca54452ac88bb1a998bebeee1a2e3a642dc76818155a145863551c65f10f9c4ff85378b0419179fc60049edbbc6 languageName: node linkType: hard @@ -763,7 +762,6 @@ __metadata: version: 0.0.0-use.local resolution: "@clickhouse/click-ui@workspace:packages/click-ui" dependencies: - "@changesets/cli": "npm:^2.29.8" "@h6s/calendar": "npm:2.0.1" "@playwright/test": "npm:^1.57.0" "@radix-ui/react-accordion": "npm:1.2.12" @@ -5653,13 +5651,6 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.7.0": - version: 3.9.0 - resolution: "ci-info@npm:3.9.0" - checksum: 10c0/6f0109e36e111684291d46123d491bc4e7b7a1934c3a20dea28cba89f1d4a03acd892f5f6a81ed3855c38647e285a150e3c9ba062e38943bef57fee6c1554c3a - languageName: node - linkType: hard - "classnames@npm:2.3.1": version: 2.3.1 resolution: "classnames@npm:2.3.1" @@ -5671,6 +5662,7 @@ __metadata: version: 0.0.0-use.local resolution: "click-ui-monorepo@workspace:." dependencies: + "@changesets/cli": "npm:^2.30.0" husky: "npm:^9.1.7" languageName: unknown linkType: soft