diff --git a/.changeset/test-correct-versioning.md b/.changeset/test-correct-versioning.md new file mode 100644 index 0000000..016ba4b --- /dev/null +++ b/.changeset/test-correct-versioning.md @@ -0,0 +1,16 @@ +--- +"vue-pivottable": patch +"@vue-pivottable/plotly-renderer": patch +--- + +test: 올바른 베타 버전 증가 테스트 + +**수정된 로직 테스트:** +- changeset version의 버전 증가를 보존 +- 선택적 베타 타임스탬프 적용 (변경된 패키지만) +- lazy-table-renderer는 changeset 없으므로 변경되지 않아야 함 + +**기대 결과:** +- vue-pivottable: 1.1.6-beta.old → 1.1.7-beta.new (버전 증가 + 새 타임스탬프) +- plotly-renderer: 2.0.7-beta.old → 2.0.8-beta.new (버전 증가 + 새 타임스탬프) +- lazy-table-renderer: 1.1.7-beta.old → 1.1.7-beta.old (변경 없음) \ No newline at end of file diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 7742617..8d33bf9 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -75,42 +75,58 @@ jobs: TIMESTAMP=$(date +%s) CHANGED_PACKAGES="" - # Function to ensure beta version with timestamp replacement - ensure_beta_version() { + # Function to update beta timestamp (preserving version increments) + update_beta_timestamp() { local current_version=$1 local timestamp=$2 - # If already has beta suffix, replace the timestamp + # If already has beta suffix, replace only the timestamp if [[ "$current_version" == *"-beta."* ]]; then - # Extract base version before first -beta - local base_version=$(echo "$current_version" | sed 's/-beta\..*//') - echo "${base_version}-beta.${timestamp}" + echo "$current_version" | sed "s/-beta\.[0-9]*$/-beta.${timestamp}/" else - # Add beta suffix + # Add beta suffix to non-beta versions echo "${current_version}-beta.${timestamp}" fi } - # Check main package - always ensure beta on develop - CURRENT_MAIN=$(node -p "require('./package.json').version") - BETA_MAIN=$(ensure_beta_version "$CURRENT_MAIN" "$TIMESTAMP") + # Check which packages were changed by changeset version + # Only apply beta timestamps to packages that were actually modified + echo "Checking which packages were modified by changeset..." - if [ "$CURRENT_MAIN" != "$BETA_MAIN" ]; then - npm version $BETA_MAIN --no-git-tag-version - CHANGED_PACKAGES="vue-pivottable" + # Check main package + NEW_MAIN=$(node -p "require('./package.json').version") + if [ "$ORIGINAL_MAIN" != "$NEW_MAIN" ] || [[ "$NEW_MAIN" != *"-beta."* ]]; then + BETA_MAIN=$(update_beta_timestamp "$NEW_MAIN" "$TIMESTAMP") + if [ "$NEW_MAIN" != "$BETA_MAIN" ]; then + npm version $BETA_MAIN --no-git-tag-version + CHANGED_PACKAGES="vue-pivottable" + echo "✓ Updated vue-pivottable: $NEW_MAIN → $BETA_MAIN" + else + echo "✓ vue-pivottable already has correct beta version: $NEW_MAIN" + fi + else + echo "✓ vue-pivottable unchanged: $NEW_MAIN" fi - # Check sub-packages - always ensure beta on develop + # Check sub-packages for pkg in packages/*/; do if [ -d "$pkg" ] && [ -f "$pkg/package.json" ]; then cd "$pkg" PKG_NAME=$(basename "$pkg") - CURRENT_VERSION=$(node -p "require('./package.json').version") - BETA_VERSION=$(ensure_beta_version "$CURRENT_VERSION" "$TIMESTAMP") + NEW_VERSION=$(node -p "require('./package.json').version") - if [ "$CURRENT_VERSION" != "$BETA_VERSION" ]; then - npm version $BETA_VERSION --no-git-tag-version - CHANGED_PACKAGES="$CHANGED_PACKAGES $PKG_NAME" + # Only update if package was changed by changeset OR doesn't have beta suffix + if [ "${ORIGINAL_VERSIONS[$PKG_NAME]}" != "$NEW_VERSION" ] || [[ "$NEW_VERSION" != *"-beta."* ]]; then + BETA_VERSION=$(update_beta_timestamp "$NEW_VERSION" "$TIMESTAMP") + if [ "$NEW_VERSION" != "$BETA_VERSION" ]; then + npm version $BETA_VERSION --no-git-tag-version + CHANGED_PACKAGES="$CHANGED_PACKAGES $PKG_NAME" + echo "✓ Updated $PKG_NAME: $NEW_VERSION → $BETA_VERSION" + else + echo "✓ $PKG_NAME already has correct beta version: $NEW_VERSION" + fi + else + echo "✓ $PKG_NAME unchanged: $NEW_VERSION" fi cd - fi diff --git a/packages/lazy-table-renderer/package.json.backup b/packages/lazy-table-renderer/package.json.backup deleted file mode 100644 index 1932187..0000000 --- a/packages/lazy-table-renderer/package.json.backup +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@vue-pivottable/lazy-table-renderer", - "version": "1.1.7-beta.1750400990", - "type": "module", - "description": "", - "exports": { - ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/lazy-table-renderer.es.js", - "require": "./dist/lazy-table-renderer.umd.js" - }, - "./dist/": "./dist/", - "./package.json": "./package.json" - }, - "main": "./dist/lazy-table-renderer.umd.js", - "module": "./dist/lazy-table-renderer.es.js", - "types": "./dist/types/index.d.ts", - "files": [ - "dist", - "LICENSE", - "README.md" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/vue-pivottable/vue3-pivottable.git", - "directory": "packages/lazy-table-renderer" - }, - "keywords": [ - "vue", - "vue3", - "pivot", - "pivottable", - "vue-pivottable", - "vue3-pivottable", - "@vue-pivottable/lazy-table-renderer" - ], - "sideEffects": [ - "*.css", - "*.vue" - ], - "homepage": "https://github.com/vue-pivottable/vue3-pivottable/tree/main/packages/lazy-table-renderer/README.md", - "author": "Seungwoo, Lee ", - "license": "MIT", - "scripts": { - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --scope lazy-table-renderer", - "clean": "rimraf dist", - "build": "vite build", - "lint": "eslint ." - }, - "peerDependencies": { - "vue": "^3.2.0", - "vue-pivottable": "^1.1.4" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^5.2.1", - "@vue/tsconfig": "^0.7.0", - "typescript": "^5.8.3", - "vite": "^6.3.4", - "vue-tsc": "^2.2.10" - } -} diff --git a/packages/plotly-renderer/package.json.backup b/packages/plotly-renderer/package.json.backup deleted file mode 100644 index d8529f3..0000000 --- a/packages/plotly-renderer/package.json.backup +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@vue-pivottable/plotly-renderer", - "version": "2.0.7-beta.1750400990", - "type": "module", - "exports": { - ".": { - "types": "./dist/types/index.d.ts", - "import": "./dist/plotly-renderer.es.js", - "require": "./dist/plotly-renderer.umd.js" - }, - "./dist/": "./dist/", - "./package.json": "./package.json" - }, - "main": "./dist/plotly-renderer.umd.js", - "module": "./dist/plotly-renderer.es.js", - "types": "./dist/types/index.d.ts", - "files": [ - "dist", - "LICENSE", - "README.md" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/vue-pivottable/vue3-pivottable.git", - "directory": "packages/plotly-renderer" - }, - "keywords": [ - "vue", - "vue3", - "pivot", - "pivottable", - "vue-pivottable", - "vue3-pivottable", - "@vue-pivottable/plotly-renderer" - ], - "homepage": "https://github.com/vue-pivottable/vue3-pivottable/tree/main/packages/plotly-renderer/README.md", - "author": "Sumin, Lee ", - "license": "MIT", - "scripts": { - "clean": "rimraf dist", - "build": "vite build" - }, - "dependencies": { - "@clalarco/vue3-plotly": "^0.1.5", - "plotly.js-basic-dist": "^3.0.1" - }, - "peerDependencies": { - "vue": "^3.2.0", - "vue-pivottable": "^1.1.4" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^5.2.1", - "@vue/tsconfig": "^0.7.0", - "typescript": "^5.8.3", - "vite": "^6.3.4", - "vue-tsc": "^2.2.10" - } -}