@layr-labs/ecloud-cli 0.4.1 → 0.4.2-dev

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.
Files changed (40) hide show
  1. package/VERSION +2 -2
  2. package/dist/commands/compute/app/deploy.js +58 -4
  3. package/dist/commands/compute/app/deploy.js.map +1 -1
  4. package/dist/commands/compute/app/info.js +1 -1
  5. package/dist/commands/compute/app/info.js.map +1 -1
  6. package/dist/commands/compute/app/list.js +1 -1
  7. package/dist/commands/compute/app/list.js.map +1 -1
  8. package/dist/commands/compute/app/logs.js +1 -1
  9. package/dist/commands/compute/app/logs.js.map +1 -1
  10. package/dist/commands/compute/app/profile/set.js +1 -1
  11. package/dist/commands/compute/app/profile/set.js.map +1 -1
  12. package/dist/commands/compute/app/releases.js +1 -1
  13. package/dist/commands/compute/app/releases.js.map +1 -1
  14. package/dist/commands/compute/app/start.js +1 -1
  15. package/dist/commands/compute/app/start.js.map +1 -1
  16. package/dist/commands/compute/app/stop.js +1 -1
  17. package/dist/commands/compute/app/stop.js.map +1 -1
  18. package/dist/commands/compute/app/terminate.js +1 -1
  19. package/dist/commands/compute/app/terminate.js.map +1 -1
  20. package/dist/commands/compute/app/upgrade.js +58 -4
  21. package/dist/commands/compute/app/upgrade.js.map +1 -1
  22. package/dist/commands/compute/build/info.js +1 -1
  23. package/dist/commands/compute/build/info.js.map +1 -1
  24. package/dist/commands/compute/build/list.js +1 -1
  25. package/dist/commands/compute/build/list.js.map +1 -1
  26. package/dist/commands/compute/build/logs.js +1 -1
  27. package/dist/commands/compute/build/logs.js.map +1 -1
  28. package/dist/commands/compute/build/status.js +1 -1
  29. package/dist/commands/compute/build/status.js.map +1 -1
  30. package/dist/commands/compute/build/submit.js +1 -1
  31. package/dist/commands/compute/build/submit.js.map +1 -1
  32. package/dist/commands/compute/build/verify.js +1 -1
  33. package/dist/commands/compute/build/verify.js.map +1 -1
  34. package/dist/commands/compute/undelegate.js +1 -1
  35. package/dist/commands/compute/undelegate.js.map +1 -1
  36. package/dist/hooks/init/__tests__/version-check.test.js +1 -1
  37. package/dist/hooks/init/__tests__/version-check.test.js.map +1 -1
  38. package/dist/hooks/init/version-check.js +1 -1
  39. package/dist/hooks/init/version-check.js.map +1 -1
  40. package/package.json +2 -2
package/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- version=0.4.1
2
- commit=720969aa6002b32d775e72494d1fa8884019b0e4
1
+ version=0.4.2-dev
2
+ commit=9ce3e64075eeaa0d5998fa1c2e53c2b065f0572e
@@ -305,7 +305,7 @@ function findAvailableName(environment, baseName) {
305
305
 
306
306
  // src/utils/version.ts
307
307
  function getCliVersion() {
308
- return true ? "0.4.1" : "0.0.0";
308
+ return true ? "0.4.2-dev" : "0.0.0";
309
309
  }
310
310
  function getClientId() {
311
311
  return `ecloud-cli/v${getCliVersion()}`;
@@ -1369,9 +1369,9 @@ function formatSourceLink(repoUrl, gitRef) {
1369
1369
  const url = new URL(normalizedRepo);
1370
1370
  const host = url.host.toLowerCase();
1371
1371
  if (host === "github.com") {
1372
- const path4 = url.pathname.replace(/\/+$/, "");
1373
- if (path4.split("/").filter(Boolean).length >= 2) {
1374
- return `https://github.com${path4}/tree/${gitRef}`;
1372
+ const path5 = url.pathname.replace(/\/+$/, "");
1373
+ if (path5.split("/").filter(Boolean).length >= 2) {
1374
+ return `https://github.com${path5}/tree/${gitRef}`;
1375
1375
  }
1376
1376
  }
1377
1377
  } catch {
@@ -1540,6 +1540,52 @@ function isTlsEnabledFromEnvFile(envFilePath) {
1540
1540
  return isTlsEnabledFromDomain(match[1]);
1541
1541
  }
1542
1542
 
1543
+ // src/utils/env.ts
1544
+ import * as fs5 from "fs";
1545
+ import * as os4 from "os";
1546
+ import * as path4 from "path";
1547
+ function parseInlineEnvVar(envVar) {
1548
+ const eqIndex = envVar.indexOf("=");
1549
+ if (eqIndex === -1) {
1550
+ throw new Error(`Invalid --env format: "${envVar}". Expected KEY=VALUE`);
1551
+ }
1552
+ const key = envVar.substring(0, eqIndex).trim();
1553
+ if (!key) {
1554
+ throw new Error(`Invalid --env format: "${envVar}". Key cannot be empty`);
1555
+ }
1556
+ const value = envVar.substring(eqIndex + 1);
1557
+ return [key, value];
1558
+ }
1559
+ function mergeInlineEnvVars(envFilePath, inlineEnvVars) {
1560
+ if (!inlineEnvVars || inlineEnvVars.length === 0) {
1561
+ return envFilePath;
1562
+ }
1563
+ const inlineEntries = inlineEnvVars.map(parseInlineEnvVar);
1564
+ let existingLines = [];
1565
+ if (envFilePath && fs5.existsSync(envFilePath)) {
1566
+ existingLines = fs5.readFileSync(envFilePath, "utf-8").split("\n");
1567
+ }
1568
+ const inlineKeys = new Set(inlineEntries.map(([key]) => key));
1569
+ const filteredLines = existingLines.filter((line) => {
1570
+ const trimmed = line.trim();
1571
+ if (!trimmed || trimmed.startsWith("#")) {
1572
+ return true;
1573
+ }
1574
+ const eqIndex = trimmed.indexOf("=");
1575
+ if (eqIndex === -1) {
1576
+ return true;
1577
+ }
1578
+ const key = trimmed.substring(0, eqIndex).trim();
1579
+ return !inlineKeys.has(key);
1580
+ });
1581
+ const inlineLines = inlineEntries.map(([key, value]) => `${key}=${value}`);
1582
+ const merged = [...filteredLines, ...inlineLines].join("\n");
1583
+ const tmpDir = fs5.mkdtempSync(path4.join(os4.tmpdir(), "ecloud-env-"));
1584
+ const tmpFile = path4.join(tmpDir, ".env");
1585
+ fs5.writeFileSync(tmpFile, merged);
1586
+ return tmpFile;
1587
+ }
1588
+
1543
1589
  // src/commands/compute/app/deploy.ts
1544
1590
  var AppDeploy = class _AppDeploy extends Command {
1545
1591
  static description = "Deploy new app";
@@ -1566,6 +1612,11 @@ var AppDeploy = class _AppDeploy extends Command {
1566
1612
  default: ".env",
1567
1613
  env: "ECLOUD_ENVFILE_PATH"
1568
1614
  }),
1615
+ env: Flags2.string({
1616
+ required: false,
1617
+ description: "Inline environment variable in KEY=VALUE format (can be specified multiple times)",
1618
+ multiple: true
1619
+ }),
1569
1620
  "log-visibility": Flags2.string({
1570
1621
  required: false,
1571
1622
  description: "Log visibility setting: public, private, or off",
@@ -1815,6 +1866,9 @@ Warning: Wallet ${chalk2.bold(address)} has zero balance on ${environment}.`)
1815
1866
  skipDefaultAppName
1816
1867
  );
1817
1868
  envFilePath = envFilePath ?? await getEnvFileInteractive(flags["env-file"]);
1869
+ if (flags.env && flags.env.length > 0) {
1870
+ envFilePath = mergeInlineEnvVars(envFilePath, flags.env);
1871
+ }
1818
1872
  const availableTypes = await fetchAvailableInstanceTypes(
1819
1873
  environment,
1820
1874
  environmentConfig,