@layr-labs/ecloud-cli 0.4.1 → 0.4.2
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/VERSION +2 -2
- package/dist/commands/compute/app/deploy.js +58 -4
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +1 -1
- package/dist/commands/compute/app/list.js +1 -1
- package/dist/commands/compute/app/logs.js +1 -1
- package/dist/commands/compute/app/profile/set.js +1 -1
- package/dist/commands/compute/app/releases.js +1 -1
- package/dist/commands/compute/app/start.js +1 -1
- package/dist/commands/compute/app/stop.js +1 -1
- package/dist/commands/compute/app/terminate.js +1 -1
- package/dist/commands/compute/app/upgrade.js +58 -4
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +1 -1
- package/dist/commands/compute/build/list.js +1 -1
- package/dist/commands/compute/build/logs.js +1 -1
- package/dist/commands/compute/build/status.js +1 -1
- package/dist/commands/compute/build/submit.js +1 -1
- package/dist/commands/compute/build/verify.js +1 -1
- package/dist/commands/compute/undelegate.js +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js +1 -1
- package/dist/hooks/init/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -199,7 +199,7 @@ function getAppName(environment, appID) {
|
|
|
199
199
|
|
|
200
200
|
// src/utils/version.ts
|
|
201
201
|
function getCliVersion() {
|
|
202
|
-
return true ? "0.4.
|
|
202
|
+
return true ? "0.4.2" : "0.0.0";
|
|
203
203
|
}
|
|
204
204
|
function getClientId() {
|
|
205
205
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -312,7 +312,7 @@ function listApps(environment) {
|
|
|
312
312
|
|
|
313
313
|
// src/utils/version.ts
|
|
314
314
|
function getCliVersion() {
|
|
315
|
-
return true ? "0.4.
|
|
315
|
+
return true ? "0.4.2" : "0.0.0";
|
|
316
316
|
}
|
|
317
317
|
function getClientId() {
|
|
318
318
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -1427,9 +1427,9 @@ function formatSourceLink(repoUrl, gitRef) {
|
|
|
1427
1427
|
const url = new URL(normalizedRepo);
|
|
1428
1428
|
const host = url.host.toLowerCase();
|
|
1429
1429
|
if (host === "github.com") {
|
|
1430
|
-
const
|
|
1431
|
-
if (
|
|
1432
|
-
return `https://github.com${
|
|
1430
|
+
const path5 = url.pathname.replace(/\/+$/, "");
|
|
1431
|
+
if (path5.split("/").filter(Boolean).length >= 2) {
|
|
1432
|
+
return `https://github.com${path5}/tree/${gitRef}`;
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
1435
|
} catch {
|
|
@@ -1598,6 +1598,52 @@ function isTlsEnabledFromEnvFile(envFilePath) {
|
|
|
1598
1598
|
return isTlsEnabledFromDomain(match[1]);
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
|
+
// src/utils/env.ts
|
|
1602
|
+
import * as fs5 from "fs";
|
|
1603
|
+
import * as os4 from "os";
|
|
1604
|
+
import * as path4 from "path";
|
|
1605
|
+
function parseInlineEnvVar(envVar) {
|
|
1606
|
+
const eqIndex = envVar.indexOf("=");
|
|
1607
|
+
if (eqIndex === -1) {
|
|
1608
|
+
throw new Error(`Invalid --env format: "${envVar}". Expected KEY=VALUE`);
|
|
1609
|
+
}
|
|
1610
|
+
const key = envVar.substring(0, eqIndex).trim();
|
|
1611
|
+
if (!key) {
|
|
1612
|
+
throw new Error(`Invalid --env format: "${envVar}". Key cannot be empty`);
|
|
1613
|
+
}
|
|
1614
|
+
const value = envVar.substring(eqIndex + 1);
|
|
1615
|
+
return [key, value];
|
|
1616
|
+
}
|
|
1617
|
+
function mergeInlineEnvVars(envFilePath, inlineEnvVars) {
|
|
1618
|
+
if (!inlineEnvVars || inlineEnvVars.length === 0) {
|
|
1619
|
+
return envFilePath;
|
|
1620
|
+
}
|
|
1621
|
+
const inlineEntries = inlineEnvVars.map(parseInlineEnvVar);
|
|
1622
|
+
let existingLines = [];
|
|
1623
|
+
if (envFilePath && fs5.existsSync(envFilePath)) {
|
|
1624
|
+
existingLines = fs5.readFileSync(envFilePath, "utf-8").split("\n");
|
|
1625
|
+
}
|
|
1626
|
+
const inlineKeys = new Set(inlineEntries.map(([key]) => key));
|
|
1627
|
+
const filteredLines = existingLines.filter((line) => {
|
|
1628
|
+
const trimmed = line.trim();
|
|
1629
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
1630
|
+
return true;
|
|
1631
|
+
}
|
|
1632
|
+
const eqIndex = trimmed.indexOf("=");
|
|
1633
|
+
if (eqIndex === -1) {
|
|
1634
|
+
return true;
|
|
1635
|
+
}
|
|
1636
|
+
const key = trimmed.substring(0, eqIndex).trim();
|
|
1637
|
+
return !inlineKeys.has(key);
|
|
1638
|
+
});
|
|
1639
|
+
const inlineLines = inlineEntries.map(([key, value]) => `${key}=${value}`);
|
|
1640
|
+
const merged = [...filteredLines, ...inlineLines].join("\n");
|
|
1641
|
+
const tmpDir = fs5.mkdtempSync(path4.join(os4.tmpdir(), "ecloud-env-"));
|
|
1642
|
+
const tmpFile = path4.join(tmpDir, ".env");
|
|
1643
|
+
fs5.writeFileSync(tmpFile, merged);
|
|
1644
|
+
return tmpFile;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1601
1647
|
// src/commands/compute/app/upgrade.ts
|
|
1602
1648
|
var AppUpgrade = class _AppUpgrade extends Command {
|
|
1603
1649
|
static description = "Upgrade existing deployment";
|
|
@@ -1625,6 +1671,11 @@ var AppUpgrade = class _AppUpgrade extends Command {
|
|
|
1625
1671
|
default: ".env",
|
|
1626
1672
|
env: "ECLOUD_ENVFILE_PATH"
|
|
1627
1673
|
}),
|
|
1674
|
+
env: Flags2.string({
|
|
1675
|
+
required: false,
|
|
1676
|
+
description: "Inline environment variable in KEY=VALUE format (can be specified multiple times)",
|
|
1677
|
+
multiple: true
|
|
1678
|
+
}),
|
|
1628
1679
|
"log-visibility": Flags2.string({
|
|
1629
1680
|
required: false,
|
|
1630
1681
|
description: "Log visibility setting: public, private, or off",
|
|
@@ -1809,6 +1860,9 @@ var AppUpgrade = class _AppUpgrade extends Command {
|
|
|
1809
1860
|
const buildFromDockerfile = dockerfilePath !== "";
|
|
1810
1861
|
const imageRef = verifiableImageUrl ? verifiableImageUrl : await getImageReferenceInteractive(flags["image-ref"], buildFromDockerfile);
|
|
1811
1862
|
envFilePath = envFilePath ?? await getEnvFileInteractive(flags["env-file"]);
|
|
1863
|
+
if (flags.env && flags.env.length > 0) {
|
|
1864
|
+
envFilePath = mergeInlineEnvVars(envFilePath, flags.env);
|
|
1865
|
+
}
|
|
1812
1866
|
const { publicClient, walletClient, address } = createViemClients({
|
|
1813
1867
|
privateKey,
|
|
1814
1868
|
rpcUrl,
|