|
6 | 6 | |
7 | 7 | * Homepage: https://github.com/taj54/universal-version-bump#readme |
8 | 8 | * License: MIT |
9 | | - * Generated on Fri, 29 Aug 2025 12:57:13 GMT |
| 9 | + * Generated on Fri, 29 Aug 2025 17:28:44 GMT |
10 | 10 | */ |
11 | 11 | require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap |
12 | 12 | /******/ var __webpack_modules__ = ({ |
@@ -32667,13 +32667,12 @@ var __importStar = (this && this.__importStar) || (function () { |
32667 | 32667 | }; |
32668 | 32668 | })(); |
32669 | 32669 | Object.defineProperty(exports, "__esModule", ({ value: true })); |
32670 | | -exports.BUMP_TARGETS = exports.TARGET_PATH = exports.GIT_TAG = exports.TARGET_PLATFORM = exports.RELEASE_TYPE = void 0; |
| 32670 | +exports.TARGET_PATH = exports.GIT_TAG = exports.TARGET_PLATFORM = exports.RELEASE_TYPE = void 0; |
32671 | 32671 | const core = __importStar(__nccwpck_require__(9999)); |
32672 | 32672 | exports.RELEASE_TYPE = (core.getInput('release_type') || 'patch'); |
32673 | 32673 | exports.TARGET_PLATFORM = core.getInput('target_platform'); |
32674 | 32674 | exports.GIT_TAG = core.getInput('git_tag') === 'true'; |
32675 | 32675 | exports.TARGET_PATH = core.getInput('target_path') || '.'; |
32676 | | -exports.BUMP_TARGETS = JSON.parse(core.getInput('bump_targets') || '[]'); |
32677 | 32676 |
|
32678 | 32677 |
|
32679 | 32678 | /***/ }), |
@@ -32802,8 +32801,7 @@ async function run() { |
32802 | 32801 | const { updaterService, gitService, changelogService } = await initializeServices(); |
32803 | 32802 | const platform = updaterService.getPlatform(targetPlatform); |
32804 | 32803 | core.info(`Detected platform: ${platform}`); |
32805 | | - const bumpTargets = JSON.parse(config_1.BUMP_TARGETS); |
32806 | | - const version = updaterService.updateVersion(platform, releaseType, bumpTargets); |
| 32804 | + const version = updaterService.updateVersion(platform, releaseType); |
32807 | 32805 | core.setOutput('new_version', version); |
32808 | 32806 | // Generate and update changelog |
32809 | 32807 | const latestTag = await gitService.getLatestTag(); |
@@ -33268,7 +33266,6 @@ __exportStar(__nccwpck_require__(5417), exports); |
33268 | 33266 | Object.defineProperty(exports, "__esModule", ({ value: true })); |
33269 | 33267 | exports.UpdaterService = void 0; |
33270 | 33268 | const errors_1 = __nccwpck_require__(4830); |
33271 | | -const customUpdater_1 = __nccwpck_require__(5432); |
33272 | 33269 | /** |
33273 | 33270 | * Service for managing version updates. |
33274 | 33271 | */ |
@@ -33305,124 +33302,17 @@ class UpdaterService { |
33305 | 33302 | * @param releaseType The type of release (major, minor, patch). |
33306 | 33303 | * @returns The new version string. |
33307 | 33304 | */ |
33308 | | - updateVersion(platform, releaseType, bumpTargets = []) { |
33309 | | - if (platform === 'custom') { |
33310 | | - if (bumpTargets.length === 0) { |
33311 | | - throw new errors_1.VersionBumpError('No bump_targets provided for custom platform.'); |
33312 | | - } |
33313 | | - let lastBumpedVersion = ''; |
33314 | | - for (const target of bumpTargets) { |
33315 | | - const customUpdater = new customUpdater_1.CustomUpdater(target.path, target.variable); |
33316 | | - lastBumpedVersion = customUpdater.bumpVersion(releaseType); |
33317 | | - } |
33318 | | - return lastBumpedVersion; |
33319 | | - } |
33320 | | - else { |
33321 | | - const updater = this.updaterRegistry.getUpdater(platform); |
33322 | | - if (!updater) { |
33323 | | - throw new errors_1.VersionBumpError(`No updater found for platform: ${platform}`); |
33324 | | - } |
33325 | | - return updater.bumpVersion(releaseType); |
| 33305 | + updateVersion(platform, releaseType) { |
| 33306 | + const updater = this.updaterRegistry.getUpdater(platform); |
| 33307 | + if (!updater) { |
| 33308 | + throw new errors_1.VersionBumpError(`No updater found for platform: ${platform}`); |
33326 | 33309 | } |
| 33310 | + return updater.bumpVersion(releaseType); |
33327 | 33311 | } |
33328 | 33312 | } |
33329 | 33313 | exports.UpdaterService = UpdaterService; |
33330 | 33314 |
|
33331 | 33315 |
|
33332 | | -/***/ }), |
33333 | | - |
33334 | | -/***/ 5432: |
33335 | | -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { |
33336 | | - |
33337 | | -"use strict"; |
33338 | | - |
33339 | | -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
33340 | | - if (k2 === undefined) k2 = k; |
33341 | | - var desc = Object.getOwnPropertyDescriptor(m, k); |
33342 | | - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { |
33343 | | - desc = { enumerable: true, get: function() { return m[k]; } }; |
33344 | | - } |
33345 | | - Object.defineProperty(o, k2, desc); |
33346 | | -}) : (function(o, m, k, k2) { |
33347 | | - if (k2 === undefined) k2 = k; |
33348 | | - o[k2] = m[k]; |
33349 | | -})); |
33350 | | -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { |
33351 | | - Object.defineProperty(o, "default", { enumerable: true, value: v }); |
33352 | | -}) : function(o, v) { |
33353 | | - o["default"] = v; |
33354 | | -}); |
33355 | | -var __importStar = (this && this.__importStar) || (function () { |
33356 | | - var ownKeys = function(o) { |
33357 | | - ownKeys = Object.getOwnPropertyNames || function (o) { |
33358 | | - var ar = []; |
33359 | | - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; |
33360 | | - return ar; |
33361 | | - }; |
33362 | | - return ownKeys(o); |
33363 | | - }; |
33364 | | - return function (mod) { |
33365 | | - if (mod && mod.__esModule) return mod; |
33366 | | - var result = {}; |
33367 | | - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); |
33368 | | - __setModuleDefault(result, mod); |
33369 | | - return result; |
33370 | | - }; |
33371 | | -})(); |
33372 | | -Object.defineProperty(exports, "__esModule", ({ value: true })); |
33373 | | -exports.CustomUpdater = void 0; |
33374 | | -const core = __importStar(__nccwpck_require__(9999)); |
33375 | | -const versionUtil_1 = __nccwpck_require__(2431); |
33376 | | -const fileHandler_1 = __nccwpck_require__(1013); |
33377 | | -const manifestParser_1 = __nccwpck_require__(2521); |
33378 | | -class CustomUpdater { |
33379 | | - constructor(filePath, variableName) { |
33380 | | - this.platform = 'custom'; |
33381 | | - this.currentVersion = null; |
33382 | | - this.filePath = filePath; |
33383 | | - this.variableName = variableName; |
33384 | | - this.fileHandler = new fileHandler_1.FileHandler(); |
33385 | | - this.manifestParser = new manifestParser_1.ManifestParser(this.fileHandler); |
33386 | | - } |
33387 | | - canHandle() { |
33388 | | - // This updater is explicitly called, so it can always handle if constructed. |
33389 | | - return true; |
33390 | | - } |
33391 | | - getCurrentVersion() { |
33392 | | - if (this.currentVersion) { |
33393 | | - return this.currentVersion; |
33394 | | - } |
33395 | | - try { |
33396 | | - // eslint-disable-next-line no-useless-escape |
33397 | | - const regex = new RegExp(`(${this.variableName}\s*=\s*['"]?)([\\d.]+)(['"]?)`); |
33398 | | - this.currentVersion = this.manifestParser.getVersion(this.filePath, 'regex', { |
33399 | | - regex: regex, |
33400 | | - }); |
33401 | | - return this.currentVersion; |
33402 | | - } |
33403 | | - catch (error) { |
33404 | | - core.debug(`Could not read or parse version from ${this.filePath}: ${error}`); |
33405 | | - } |
33406 | | - return null; |
33407 | | - } |
33408 | | - bumpVersion(releaseType) { |
33409 | | - const oldVersion = this.getCurrentVersion(); |
33410 | | - if (!oldVersion) { |
33411 | | - throw new Error(`Could not find current version for variable '${this.variableName}' in file '${this.filePath}'`); |
33412 | | - } |
33413 | | - const newVersion = (0, versionUtil_1.calculateNextVersion)(oldVersion, releaseType); |
33414 | | - // eslint-disable-next-line no-useless-escape |
33415 | | - const regexReplace = new RegExp(`(${this.variableName}\s*=\s*['"]?)${oldVersion}(['"]?)`); |
33416 | | - this.manifestParser.updateVersion(this.filePath, newVersion, 'regex', { |
33417 | | - regexReplace: regexReplace, |
33418 | | - }); |
33419 | | - core.info(`Bumped ${this.variableName} in ${this.filePath} from ${oldVersion} to ${newVersion}`); |
33420 | | - return newVersion; |
33421 | | - } |
33422 | | -} |
33423 | | -exports.CustomUpdater = CustomUpdater; |
33424 | | - |
33425 | | - |
33426 | 33316 | /***/ }), |
33427 | 33317 |
|
33428 | 33318 | /***/ 553: |
|
0 commit comments