Skip to content

Commit 07ed7b6

Browse files
Jasbir Singh ShergillJasbir Singh Shergill
authored andcommitted
chore: back merged main
2 parents 2dcc12f + e4985ae commit 07ed7b6

12 files changed

Lines changed: 452 additions & 108 deletions

CHANGELOG.md

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,124 @@
1-
# [2.4.0-alpha.1](https://github.com/stallion-tech/stallion-cli/compare/v2.3.0...v2.4.0-alpha.1) (2025-06-26)
1+
## [2.4.3](https://github.com/stallion-tech/stallion-cli/compare/v2.4.2...v2.4.3) (2026-02-13)
2+
3+
### Bug Fixes
24

5+
- added Custom Bundle Path Option ([#40](https://github.com/stallion-tech/stallion-cli/issues/40)) ([d0ece26](https://github.com/stallion-tech/stallion-cli/commit/d0ece2668284eb011379244382aa5159ec6f2e82))
6+
7+
## [2.4.2](https://github.com/stallion-tech/stallion-cli/compare/v2.4.1...v2.4.2) (2026-01-19)
8+
9+
### Bug Fixes
10+
11+
- download progress ([f5c7802](https://github.com/stallion-tech/stallion-cli/commit/f5c78024f442ae34a67a1c258b5aa30f0f928b48))
12+
13+
## [2.4.1](https://github.com/stallion-tech/stallion-cli/compare/v2.4.0...v2.4.1) (2026-01-13)
14+
15+
### Bug Fixes
16+
17+
- fixed Assets Issue ([#38](https://github.com/stallion-tech/stallion-cli/issues/38)) ([ce564a5](https://github.com/stallion-tech/stallion-cli/commit/ce564a5d00cdb151e8a577e012c685649f50ea3b))
18+
19+
# [2.4.0](https://github.com/stallion-tech/stallion-cli/compare/v2.3.1...v2.4.0) (2026-01-09)
320

421
### Features
522

6-
* refactor CLI and added support for bundle signing ([#27](https://github.com/stallion-tech/stallion-cli/issues/27)) ([f3ffcbd](https://github.com/stallion-tech/stallion-cli/commit/f3ffcbdb3800a9043250f625662c757667f4a8ea))
7-
* windows RN executable Fix ([#28](https://github.com/stallion-tech/stallion-cli/issues/28)) ([65f9760](https://github.com/stallion-tech/stallion-cli/commit/65f9760cebbf0c84fcbfeafac02997bbd671fee3))
23+
- refactor CLI and added support for bundle signing ([#27](https://github.com/stallion-tech/stallion-cli/issues/27)) ([f3ffcbd](https://github.com/stallion-tech/stallion-cli/commit/f3ffcbdb3800a9043250f625662c757667f4a8ea))
24+
- windows RN executable Fix ([#28](https://github.com/stallion-tech/stallion-cli/issues/28)) ([65f9760](https://github.com/stallion-tech/stallion-cli/commit/65f9760cebbf0c84fcbfeafac02997bbd671fee3))
25+
- sourcemaps export, hermes path fix ([b563b44](https://github.com/stallion-tech/stallion-cli/commit/b563b445e01cd6ff91ed02113e9c41028322112b))
826

9-
# [2.3.0](https://github.com/stallion-tech/stallion-cli/compare/v2.2.0...v2.3.0) (2025-06-22)
27+
# [2.4.0-alpha.1](https://github.com/stallion-tech/stallion-cli/compare/v2.3.0...v2.4.0-alpha.1) (2025-06-26)
28+
29+
## [2.3.1](https://github.com/stallion-tech/stallion-cli/compare/v2.3.0...v2.3.1) (2025-06-27)
30+
31+
### Bug Fixes
1032

33+
- skip user validation when CI token is provided ([#33](https://github.com/stallion-tech/stallion-cli/issues/33)) ([901eab9](https://github.com/stallion-tech/stallion-cli/commit/901eab97c08629d4c7aac8ec3e9f7ebba952ff4b))
34+
35+
# [2.3.0](https://github.com/stallion-tech/stallion-cli/compare/v2.2.0...v2.3.0) (2025-06-22)
1136

1237
### Features
1338

14-
* Stallion CI Support ([#30](https://github.com/stallion-tech/stallion-cli/issues/30)) ([f9a0523](https://github.com/stallion-tech/stallion-cli/commit/f9a0523c8082a82e662fe71c46c9c7bc75963cae))
39+
- Stallion CI Support ([#30](https://github.com/stallion-tech/stallion-cli/issues/30)) ([f9a0523](https://github.com/stallion-tech/stallion-cli/commit/f9a0523c8082a82e662fe71c46c9c7bc75963cae))
1540

1641
# [2.2.0](https://github.com/stallion-tech/stallion-cli/compare/v2.1.0...v2.2.0) (2025-06-19)
1742

18-
1943
### Features
2044

21-
* Alpha Release with windows bundle command fix ([1880d0e](https://github.com/stallion-tech/stallion-cli/commit/1880d0ef8c039a3a0b8710540a80b89667b2292a)), closes [#21](https://github.com/stallion-tech/stallion-cli/issues/21) [#26](https://github.com/stallion-tech/stallion-cli/issues/26) [#27](https://github.com/stallion-tech/stallion-cli/issues/27) [#28](https://github.com/stallion-tech/stallion-cli/issues/28)
45+
- Alpha Release with windows bundle command fix ([1880d0e](https://github.com/stallion-tech/stallion-cli/commit/1880d0ef8c039a3a0b8710540a80b89667b2292a)), closes [#21](https://github.com/stallion-tech/stallion-cli/issues/21) [#26](https://github.com/stallion-tech/stallion-cli/issues/26) [#27](https://github.com/stallion-tech/stallion-cli/issues/27) [#28](https://github.com/stallion-tech/stallion-cli/issues/28)
2246

2347
# [2.1.0-alpha.2](https://github.com/stallion-tech/stallion-cli/compare/v2.1.0-alpha.1...v2.1.0-alpha.2) (2025-06-11)
2448

25-
2649
### Features
2750

28-
* windows RN executable Fix ([#28](https://github.com/stallion-tech/stallion-cli/issues/28)) ([65f9760](https://github.com/stallion-tech/stallion-cli/commit/65f9760cebbf0c84fcbfeafac02997bbd671fee3))
51+
- windows RN executable Fix ([#28](https://github.com/stallion-tech/stallion-cli/issues/28)) ([65f9760](https://github.com/stallion-tech/stallion-cli/commit/65f9760cebbf0c84fcbfeafac02997bbd671fee3))
2952

3053
# [2.1.0-alpha.1](https://github.com/stallion-tech/stallion-cli/compare/v2.0.2...v2.1.0-alpha.1) (2025-05-23)
3154

32-
3355
### Features
3456

35-
* refactor CLI and added support for bundle signing ([#27](https://github.com/stallion-tech/stallion-cli/issues/27)) ([f3ffcbd](https://github.com/stallion-tech/stallion-cli/commit/f3ffcbdb3800a9043250f625662c757667f4a8ea))
57+
- refactor CLI and added support for bundle signing ([#27](https://github.com/stallion-tech/stallion-cli/issues/27)) ([f3ffcbd](https://github.com/stallion-tech/stallion-cli/commit/f3ffcbdb3800a9043250f625662c757667f4a8ea))
3658

3759
## [2.0.2](https://github.com/stallion-tech/stallion-cli/compare/v2.0.1...v2.0.2) (2025-02-11)
3860

39-
4061
### Bug Fixes
4162

42-
* improved hermes logging ([4094aa6](https://github.com/stallion-tech/stallion-cli/commit/4094aa6bbf927f1f87b2f51f57b17db0f3e5f7df))
63+
- improved hermes logging ([4094aa6](https://github.com/stallion-tech/stallion-cli/commit/4094aa6bbf927f1f87b2f51f57b17db0f3e5f7df))
4364

4465
## [2.0.1](https://github.com/stallion-tech/stallion-cli/compare/v2.0.0...v2.0.1) (2025-02-01)
4566

46-
4767
### Bug Fixes
4868

49-
* hermes enabled by default ([6770a74](https://github.com/stallion-tech/stallion-cli/commit/6770a746a190ca1778c9f59957a1c38ccdda0c44))
69+
- hermes enabled by default ([6770a74](https://github.com/stallion-tech/stallion-cli/commit/6770a746a190ca1778c9f59957a1c38ccdda0c44))
5070

5171
# [2.0.0](https://github.com/stallion-tech/stallion-cli/compare/v1.1.4...v2.0.0) (2024-11-04)
5272

53-
5473
### Features
5574

56-
* added Stallion 2.0 changes ([#17](https://github.com/stallion-tech/stallion-cli/issues/17)) ([6bfe630](https://github.com/stallion-tech/stallion-cli/commit/6bfe630483dd15073ae02c111748c4e8f85e6a38))
57-
75+
- added Stallion 2.0 changes ([#17](https://github.com/stallion-tech/stallion-cli/issues/17)) ([6bfe630](https://github.com/stallion-tech/stallion-cli/commit/6bfe630483dd15073ae02c111748c4e8f85e6a38))
5876

5977
### BREAKING CHANGES
6078

61-
* Stallion 2.0 update
79+
- Stallion 2.0 update
6280

6381
## [1.1.4](https://github.com/stallion-tech/stallion-cli/compare/v1.1.3...v1.1.4) (2024-11-04)
6482

65-
6683
### Reverts
6784

68-
* Revert "feat!: stallion 2.0 cli update (#15)" (#16) ([c685692](https://github.com/stallion-tech/stallion-cli/commit/c6856929ebd20da9af198b7cb819e11d60a212ff)), closes [#15](https://github.com/stallion-tech/stallion-cli/issues/15) [#16](https://github.com/stallion-tech/stallion-cli/issues/16)
85+
- Revert "feat!: stallion 2.0 cli update (#15)" (#16) ([c685692](https://github.com/stallion-tech/stallion-cli/commit/c6856929ebd20da9af198b7cb819e11d60a212ff)), closes [#15](https://github.com/stallion-tech/stallion-cli/issues/15) [#16](https://github.com/stallion-tech/stallion-cli/issues/16)
6986

7087
## [1.1.3](https://github.com/stallion-tech/stallion-cli/compare/v1.1.2...v1.1.3) (2024-04-11)
7188

72-
7389
### Bug Fixes
7490

75-
* removed check for stallion.config.js ([#14](https://github.com/stallion-tech/stallion-cli/issues/14)) ([08fa8bf](https://github.com/stallion-tech/stallion-cli/commit/08fa8bf480d098970ae3a388decc8ad38d19fa9c))
91+
- removed check for stallion.config.js ([#14](https://github.com/stallion-tech/stallion-cli/issues/14)) ([08fa8bf](https://github.com/stallion-tech/stallion-cli/commit/08fa8bf480d098970ae3a388decc8ad38d19fa9c))
7692

7793
## [1.1.2](https://github.com/stallion-tech/stallion-cli/compare/v1.1.1...v1.1.2) (2024-01-15)
7894

79-
8095
### Bug Fixes
8196

82-
* optimized upload and added ci token support ([caf665d](https://github.com/stallion-tech/stallion-cli/commit/caf665d1a5161e0474603ef80e208cfb2eb63b05))
97+
- optimized upload and added ci token support ([caf665d](https://github.com/stallion-tech/stallion-cli/commit/caf665d1a5161e0474603ef80e208cfb2eb63b05))
8398

8499
## [1.1.1](https://github.com/stallion-tech/stallion-cli/compare/v1.1.0...v1.1.1) (2023-09-13)
85100

86-
87101
### Bug Fixes
88102

89-
* updated domain redirect and errors ([#12](https://github.com/stallion-tech/stallion-cli/issues/12)) ([aa5c648](https://github.com/stallion-tech/stallion-cli/commit/aa5c648fefe105754ee1e3518a06cc2282301495))
103+
- updated domain redirect and errors ([#12](https://github.com/stallion-tech/stallion-cli/issues/12)) ([aa5c648](https://github.com/stallion-tech/stallion-cli/commit/aa5c648fefe105754ee1e3518a06cc2282301495))
90104

91105
# [1.1.0](https://github.com/redhorse-tech/stallion-cli/compare/v1.0.0...v1.1.0) (2023-09-08)
92106

93-
94107
### Bug Fixes
95108

96-
* updated node version to 14 ([cf9cef8](https://github.com/redhorse-tech/stallion-cli/commit/cf9cef8ff3e885b4e413f25f9a9853f189125f89))
97-
109+
- updated node version to 14 ([cf9cef8](https://github.com/redhorse-tech/stallion-cli/commit/cf9cef8ff3e885b4e413f25f9a9853f189125f89))
98110

99111
### Features
100112

101-
* updated min node version to 10 ([90718b9](https://github.com/redhorse-tech/stallion-cli/commit/90718b95bbbee084d94af7a931984fe97a424972))
113+
- updated min node version to 10 ([90718b9](https://github.com/redhorse-tech/stallion-cli/commit/90718b95bbbee084d94af7a931984fe97a424972))
102114

103115
# 1.0.0 (2023-09-08)
104116

105-
106117
### Bug Fixes
107118

108-
* exec and util function ([5da81dc](https://github.com/redhorse-tech/stallion-cli/commit/5da81dcacd724cd2052f5f1bea5b42a5b10f7734))
109-
* wrong base url ([408680f](https://github.com/redhorse-tech/stallion-cli/commit/408680f1a190d0ddc66e68644d4dc1ded2cf6b0f))
110-
119+
- exec and util function ([5da81dc](https://github.com/redhorse-tech/stallion-cli/commit/5da81dcacd724cd2052f5f1bea5b42a5b10f7734))
120+
- wrong base url ([408680f](https://github.com/redhorse-tech/stallion-cli/commit/408680f1a190d0ddc66e68644d4dc1ded2cf6b0f))
111121

112122
### Features
113123

114-
* added semantic release ([#7](https://github.com/redhorse-tech/stallion-cli/issues/7)) ([0b89da4](https://github.com/redhorse-tech/stallion-cli/commit/0b89da433060316502a033d604381957f65be201))
124+
- added semantic release ([#7](https://github.com/redhorse-tech/stallion-cli/issues/7)) ([0b89da4](https://github.com/redhorse-tech/stallion-cli/commit/0b89da433060316502a033d604381957f65be201))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stallion-cli",
3-
"version": "2.2.0",
3+
"version": "2.4.2",
44
"description": "A powerful CLI tool for managing your Stallion deployments",
55
"main": "index.js",
66
"bin": {

scripts/prep-release.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ async function prepRelease() {
3838
// Delete the dist directory
3939
rimraf.sync(distPath);
4040
// npm pack in rootPath
41+
// Link globally in development mode
4142
if (process.env.NODE_ENV === "development") {
42-
console.log("Linking globally...");
43-
exec(`cd ${rootPath} && pnpm link --global`);
43+
console.log(chalk.cyan(`Linking ${rootPath} globally...`));
44+
try {
45+
exec(`cd ${rootPath} && pnpm link --global`);
46+
console.log(chalk.bold.green("Global link created successfully."));
47+
} catch (linkError) {
48+
console.error(`${chalk.bold.red("Linking failed:")} ${linkError.message}`);
49+
}
4450
}
4551
console.log(chalk.bold.green("Success"));
4652
} catch (e) {

src/api/api-client.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import axios, { AxiosInstance, AxiosRequestConfig, AxiosError } from "axios";
2+
import fs from "fs";
3+
import https from "https";
24

35
export class ApiClient {
46
private client: AxiosInstance;
@@ -52,6 +54,47 @@ export class ApiClient {
5254
}
5355
}
5456

57+
// Upload file with progress tracking
58+
putWithProgress<T>(
59+
url: string,
60+
filePath: string,
61+
contentType: string,
62+
onProgress?: (percentage: number) => void,
63+
): Promise<T> {
64+
const { hostname, pathname, search } = new URL(url);
65+
const fileSize = fs.statSync(filePath).size;
66+
let uploaded = 0;
67+
68+
return new Promise<T>((resolve, reject) => {
69+
const req = https.request({ hostname, path: pathname + search, method: "PUT" }, (res) => {
70+
let body = "";
71+
res.on("data", (chunk) => (body += chunk));
72+
res.on("end", () => {
73+
const status = res.statusCode || 0;
74+
status >= 200 && status < 300
75+
? resolve(body as T)
76+
: reject(this.handleError(new Error(`HTTP ${status}: ${body || "Upload failed"}`)));
77+
});
78+
});
79+
80+
req.setHeader("Content-Type", contentType);
81+
req.setHeader("Content-Length", fileSize);
82+
req.on("error", (err: Error) => reject(this.handleError(err)));
83+
84+
const stream = fs.createReadStream(filePath);
85+
stream.on("data", (chunk) => {
86+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
87+
// Track progress on network data writes, handle backpressure
88+
if (!req.write(buffer, () => onProgress?.((uploaded += buffer.length) / fileSize * 100))) {
89+
stream.pause();
90+
req.once("drain", () => stream.resume());
91+
}
92+
});
93+
stream.on("end", () => req.end());
94+
stream.on("error", (err: Error) => reject(this.handleError(err)));
95+
});
96+
}
97+
5598
// DELETE request
5699
async delete<T>(url: string, config?: AxiosRequestConfig): Promise<T> {
57100
try {

src/command-line/base.command.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,37 @@ export abstract class BaseCommand {
2727
return false;
2828
}
2929

30+
// If a command supports custom bundle upload, disallow bundling-related flags.
31+
const supportsCustomBundlePath = expected.some(
32+
(opt) => opt.name === "custom-bundle-path"
33+
);
34+
const hasCustomBundlePath =
35+
supportsCustomBundlePath && options.customBundlePath !== undefined;
36+
37+
if (hasCustomBundlePath) {
38+
const disallowedWhenCustomBundlePath = [
39+
"hermes-disabled",
40+
"entry-file",
41+
"hermes-logs",
42+
"hermesc-path",
43+
"sourcemap",
44+
"keep-artifacts",
45+
];
46+
47+
const providedDisallowed = disallowedWhenCustomBundlePath.filter(
48+
(name) => options[camelCase(name)] !== undefined
49+
);
50+
51+
if (providedDisallowed.length) {
52+
logger.error(
53+
`When --custom-bundle-path is provided, these options are not allowed: ${providedDisallowed
54+
.map((n) => `--${n}`)
55+
.join(", ")}`
56+
);
57+
return false;
58+
}
59+
}
60+
3061
return true;
3162
}
3263

@@ -51,7 +82,7 @@ export abstract class BaseCommand {
5182
id: null,
5283
token: token.trim(),
5384
});
54-
await progress("Verifying login", this.verifyLogin());
85+
await progress("Verifying login", () => this.verifyLogin());
5586

5687
logger.success("Token saved successfully. Login successful.");
5788
return true;

src/command-line/command.registry.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export class CommandRegistry {
3434
}
3535
}
3636

37+
private shouldSkipValidationForCIToken(command: BaseCommand, options: Record<string, any>): boolean {
38+
const commandName = command.constructor.name;
39+
const supportsCIToken = ['PublishBundleCommand', 'ReleaseBundleCommand', 'UpdateReleaseCommand'];
40+
return supportsCIToken.includes(commandName) && Boolean(options.ciToken);
41+
}
42+
3743
public async executeCommand(
3844
name: string,
3945
options: Record<string, any>
@@ -45,16 +51,20 @@ export class CommandRegistry {
4551
return;
4652
}
4753

48-
if (requiresValidation(command.constructor)) {
54+
const needsValidation = requiresValidation(command.constructor);
55+
const skipForCIToken = this.shouldSkipValidationForCIToken(command, options);
56+
if (needsValidation && !skipForCIToken) {
4957
try {
5058
logger.info("Validating user");
5159
await this.validateUser(command);
5260
} catch {
5361
logger.info("User validation failed");
5462
return;
5563
}
64+
} else if (needsValidation && skipForCIToken) {
65+
logger.info("CI token provided, skipping user validation");
5666
}
5767

5868
await command.execute(options);
5969
}
60-
}
70+
}

0 commit comments

Comments
 (0)