optikit 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/USAGE.md +24 -0
- package/dist/cli.js +4 -1
- package/dist/commands/version/bump.js +41 -1
- package/package.json +1 -1
- package/src/cli.ts +9 -0
- package/src/commands/version/bump.ts +51 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,70 @@ We follow Semantic Versioning (SemVer) to indicate the nature of changes:
|
|
|
10
10
|
|
|
11
11
|
Each section lists the changes in chronological order, with the most recent release at the top. We also include links to relevant discussions or issues when appropriate.
|
|
12
12
|
|
|
13
|
+
## [1.2.5]
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Simultaneous Build Number Bump:** New `bump-build` command that increments both Android and iOS build numbers simultaneously without changing the version number
|
|
18
|
+
- **Comprehensive Documentation:** Updated USAGE.md with detailed section for the new bump-build command
|
|
19
|
+
|
|
20
|
+
### Improved
|
|
21
|
+
|
|
22
|
+
- **Build Number Management:** Enhanced flexibility for managing builds across both platforms with a single command
|
|
23
|
+
|
|
24
|
+
## [1.2.4]
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **iOS Build Number Tracking:** Fixed `bump-ios` command to increment the actual iOS build number from `project.pbxproj` instead of deriving from Android build number
|
|
29
|
+
- **Independent Platform Builds:** iOS and Android build numbers now tracked independently as intended
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **iOS Build Number Reader:** New `getCurrentIosBuildNumber()` function to read actual iOS build number from `ios/Runner.xcodeproj/project.pbxproj`
|
|
34
|
+
- **Enhanced Version Display:** `version` command now shows both Android and iOS build numbers separately
|
|
35
|
+
|
|
36
|
+
### Improved
|
|
37
|
+
|
|
38
|
+
- **Version Management Accuracy:** iOS build numbers now accurately reflect the actual project state
|
|
39
|
+
|
|
40
|
+
## [1.2.3]
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **Silent Validation:** Removed unwanted version number output during command execution by implementing silent validation checks
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **Silent Command Execution:** New `execCommandSilent()` function for validation operations that don't need output logging
|
|
49
|
+
|
|
50
|
+
### Improved
|
|
51
|
+
|
|
52
|
+
- **User Experience:** Cleaner command output without version information appearing during validation
|
|
53
|
+
|
|
54
|
+
## [1.2.2]
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **Command Naming Conflicts:** Resolved yargs command conflicts that prevented version bump commands from working correctly
|
|
59
|
+
- **Version Bump Accuracy:** Fixed issue where major/minor/patch bumps were only incrementing Android build numbers
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- **Simplified Command Names:**
|
|
64
|
+
- `version bump <type>` renamed to `bump <type>` for major/minor/patch version bumps
|
|
65
|
+
- `version bump-ios` renamed to `bump-ios`
|
|
66
|
+
- `version bump-android` renamed to `bump-android`
|
|
67
|
+
- `version` command renamed to `version` for displaying current version
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- **FVM Default Configuration:** Changed default `useFvmByDefault` setting to `true` in `init` command configuration
|
|
72
|
+
|
|
73
|
+
### Improved
|
|
74
|
+
|
|
75
|
+
- **Documentation:** Updated all documentation files (USAGE.md, VERSION_MANAGEMENT.md, README.md) with new command names and workflows
|
|
76
|
+
|
|
13
77
|
## [1.2.1]
|
|
14
78
|
|
|
15
79
|
### Added
|
package/USAGE.md
CHANGED
|
@@ -188,6 +188,30 @@ After: 1.0.2+46 (iOS: 1 unchanged)
|
|
|
188
188
|
|
|
189
189
|
---
|
|
190
190
|
|
|
191
|
+
### Bump Both Build Numbers
|
|
192
|
+
|
|
193
|
+
Increment both Android and iOS build numbers:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
optikit bump-build
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**What it does:**
|
|
200
|
+
|
|
201
|
+
- Keeps version unchanged
|
|
202
|
+
- Increments Android build number
|
|
203
|
+
- Increments iOS build number
|
|
204
|
+
- Perfect for simultaneous Android and iOS releases
|
|
205
|
+
|
|
206
|
+
**Example:**
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
Before: 1.0.2+45 (iOS: 3)
|
|
210
|
+
After: 1.0.2+46 (iOS: 4)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
191
215
|
## Build Commands
|
|
192
216
|
|
|
193
217
|
All build commands support FVM and create automatic backups.
|
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import { createRequire } from "module";
|
|
|
14
14
|
import { createVscodeSettings } from "./commands/project/setup.js";
|
|
15
15
|
import { initializeProject } from "./commands/config/init.js";
|
|
16
16
|
import { rollbackFiles, rollbackRestore } from "./commands/config/rollback.js";
|
|
17
|
-
import { bumpVersion, bumpIosBuildOnly, bumpAndroidBuildOnly, showCurrentVersion } from "./commands/version/bump.js";
|
|
17
|
+
import { bumpVersion, bumpIosBuildOnly, bumpAndroidBuildOnly, bumpBothBuilds, showCurrentVersion } from "./commands/version/bump.js";
|
|
18
18
|
import { listDevices, runApp, runAppInteractive } from "./commands/project/devices.js";
|
|
19
19
|
const require = createRequire(import.meta.url);
|
|
20
20
|
const packageInfo = require("../package.json");
|
|
@@ -175,6 +175,9 @@ const options = yargs(hideBin(process.argv))
|
|
|
175
175
|
})
|
|
176
176
|
.command("bump-android", "Increment Android build number only", () => { }, async () => {
|
|
177
177
|
await bumpAndroidBuildOnly();
|
|
178
|
+
})
|
|
179
|
+
.command("bump-build", "Increment both Android and iOS build numbers", () => { }, async () => {
|
|
180
|
+
await bumpBothBuilds();
|
|
178
181
|
})
|
|
179
182
|
.command("version", "Show current version information", () => { }, async () => {
|
|
180
183
|
await showCurrentVersion();
|
|
@@ -3,7 +3,7 @@ import { LoggerHelpers } from "../../utils/services/logger.js";
|
|
|
3
3
|
import { getCurrentVersion, incrementVersion, formatVersion, getCurrentIosBuildNumber } from "../../utils/helpers/version.js";
|
|
4
4
|
import { updateFlutterVersion } from "./update.js";
|
|
5
5
|
import chalk from "chalk";
|
|
6
|
-
export { bumpVersion, bumpIosBuildOnly, bumpAndroidBuildOnly, showCurrentVersion };
|
|
6
|
+
export { bumpVersion, bumpIosBuildOnly, bumpAndroidBuildOnly, bumpBothBuilds, showCurrentVersion };
|
|
7
7
|
/**
|
|
8
8
|
* Bumps version with semantic versioning (major, minor, patch)
|
|
9
9
|
* Android build number increments with version
|
|
@@ -124,6 +124,46 @@ async function bumpAndroidBuildOnly() {
|
|
|
124
124
|
process.exit(1);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Increments BOTH Android and iOS build numbers
|
|
129
|
+
* Keeps version unchanged
|
|
130
|
+
* Perfect for updating both platforms simultaneously
|
|
131
|
+
*/
|
|
132
|
+
async function bumpBothBuilds() {
|
|
133
|
+
// Pre-flight validation
|
|
134
|
+
if (!validateFlutterProject()) {
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
const current = getCurrentVersion();
|
|
139
|
+
const currentVersionString = `${current.major}.${current.minor}.${current.patch}`;
|
|
140
|
+
// Read actual iOS build number from project.pbxproj
|
|
141
|
+
const currentIosBuild = getCurrentIosBuildNumber();
|
|
142
|
+
const nextAndroidBuild = current.buildNumber + 1;
|
|
143
|
+
const nextIosBuild = currentIosBuild + 1;
|
|
144
|
+
LoggerHelpers.info(`Current version: ${formatVersion(current)}`);
|
|
145
|
+
LoggerHelpers.info("Incrementing both Android and iOS build numbers...");
|
|
146
|
+
console.log(chalk.cyan("\nBuild number changes:"));
|
|
147
|
+
console.log(chalk.gray(" Version:"), chalk.white(`${currentVersionString} (unchanged)`));
|
|
148
|
+
console.log(chalk.gray(" Android:"), chalk.white(`${current.buildNumber} → ${nextAndroidBuild}`), chalk.green("(incremented)"));
|
|
149
|
+
console.log(chalk.gray(" iOS:"), chalk.white(`${currentIosBuild} → ${nextIosBuild}`), chalk.green("(incremented)"));
|
|
150
|
+
console.log();
|
|
151
|
+
// Update both Android and iOS build numbers
|
|
152
|
+
await updateFlutterVersion(currentVersionString, nextAndroidBuild.toString(), nextIosBuild.toString());
|
|
153
|
+
LoggerHelpers.success(`Both build numbers incremented successfully`);
|
|
154
|
+
console.log(chalk.gray("\nResult:"), chalk.white(`${currentVersionString}+${nextAndroidBuild} (iOS: ${nextIosBuild})`));
|
|
155
|
+
console.log(chalk.gray("Use this for:"), chalk.white("Simultaneous Android and iOS releases"));
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (error instanceof Error) {
|
|
159
|
+
LoggerHelpers.error(`Error incrementing build numbers: ${error.message}`);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
LoggerHelpers.error(`Error incrementing build numbers: ${error}`);
|
|
163
|
+
}
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
127
167
|
/**
|
|
128
168
|
* Shows current version information
|
|
129
169
|
*/
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
bumpVersion,
|
|
25
25
|
bumpIosBuildOnly,
|
|
26
26
|
bumpAndroidBuildOnly,
|
|
27
|
+
bumpBothBuilds,
|
|
27
28
|
showCurrentVersion
|
|
28
29
|
} from "./commands/version/bump.js";
|
|
29
30
|
import { listDevices, runApp, runAppInteractive } from "./commands/project/devices.js";
|
|
@@ -283,6 +284,14 @@ const options = yargs(hideBin(process.argv))
|
|
|
283
284
|
await bumpAndroidBuildOnly();
|
|
284
285
|
}
|
|
285
286
|
)
|
|
287
|
+
.command(
|
|
288
|
+
"bump-build",
|
|
289
|
+
"Increment both Android and iOS build numbers",
|
|
290
|
+
() => {},
|
|
291
|
+
async () => {
|
|
292
|
+
await bumpBothBuilds();
|
|
293
|
+
}
|
|
294
|
+
)
|
|
286
295
|
.command(
|
|
287
296
|
"version",
|
|
288
297
|
"Show current version information",
|
|
@@ -14,6 +14,7 @@ export {
|
|
|
14
14
|
bumpVersion,
|
|
15
15
|
bumpIosBuildOnly,
|
|
16
16
|
bumpAndroidBuildOnly,
|
|
17
|
+
bumpBothBuilds,
|
|
17
18
|
showCurrentVersion
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -165,6 +166,56 @@ async function bumpAndroidBuildOnly(): Promise<void> {
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Increments BOTH Android and iOS build numbers
|
|
171
|
+
* Keeps version unchanged
|
|
172
|
+
* Perfect for updating both platforms simultaneously
|
|
173
|
+
*/
|
|
174
|
+
async function bumpBothBuilds(): Promise<void> {
|
|
175
|
+
// Pre-flight validation
|
|
176
|
+
if (!validateFlutterProject()) {
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
const current = getCurrentVersion();
|
|
182
|
+
const currentVersionString = `${current.major}.${current.minor}.${current.patch}`;
|
|
183
|
+
|
|
184
|
+
// Read actual iOS build number from project.pbxproj
|
|
185
|
+
const currentIosBuild = getCurrentIosBuildNumber();
|
|
186
|
+
const nextAndroidBuild = current.buildNumber + 1;
|
|
187
|
+
const nextIosBuild = currentIosBuild + 1;
|
|
188
|
+
|
|
189
|
+
LoggerHelpers.info(`Current version: ${formatVersion(current)}`);
|
|
190
|
+
LoggerHelpers.info("Incrementing both Android and iOS build numbers...");
|
|
191
|
+
|
|
192
|
+
console.log(chalk.cyan("\nBuild number changes:"));
|
|
193
|
+
console.log(chalk.gray(" Version:"), chalk.white(`${currentVersionString} (unchanged)`));
|
|
194
|
+
console.log(chalk.gray(" Android:"), chalk.white(`${current.buildNumber} → ${nextAndroidBuild}`), chalk.green("(incremented)"));
|
|
195
|
+
console.log(chalk.gray(" iOS:"), chalk.white(`${currentIosBuild} → ${nextIosBuild}`), chalk.green("(incremented)"));
|
|
196
|
+
console.log();
|
|
197
|
+
|
|
198
|
+
// Update both Android and iOS build numbers
|
|
199
|
+
await updateFlutterVersion(
|
|
200
|
+
currentVersionString,
|
|
201
|
+
nextAndroidBuild.toString(),
|
|
202
|
+
nextIosBuild.toString()
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
LoggerHelpers.success(`Both build numbers incremented successfully`);
|
|
206
|
+
console.log(chalk.gray("\nResult:"), chalk.white(`${currentVersionString}+${nextAndroidBuild} (iOS: ${nextIosBuild})`));
|
|
207
|
+
console.log(chalk.gray("Use this for:"), chalk.white("Simultaneous Android and iOS releases"));
|
|
208
|
+
|
|
209
|
+
} catch (error) {
|
|
210
|
+
if (error instanceof Error) {
|
|
211
|
+
LoggerHelpers.error(`Error incrementing build numbers: ${error.message}`);
|
|
212
|
+
} else {
|
|
213
|
+
LoggerHelpers.error(`Error incrementing build numbers: ${error}`);
|
|
214
|
+
}
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
168
219
|
/**
|
|
169
220
|
* Shows current version information
|
|
170
221
|
*/
|