@layr-labs/ecloud-cli 0.4.0-dev.1 → 0.4.0-dev.3
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 -0
- package/bin/dev.js +0 -0
- package/dist/commands/auth/generate.js +0 -0
- package/dist/commands/auth/login.js +0 -0
- package/dist/commands/auth/logout.js +0 -0
- package/dist/commands/auth/migrate.js +0 -0
- package/dist/commands/auth/whoami.js +1 -0
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +89 -22
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +88 -20
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +139 -201
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +88 -19
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +89 -21
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +88 -19
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +102 -91
- package/dist/commands/billing/top-up.js.map +1 -1
- package/dist/commands/compute/app/configure/tls.js +0 -0
- package/dist/commands/compute/app/create.js +1 -0
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +38 -24
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +2 -1
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +2 -1
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +5 -8
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +5 -8
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +2 -1
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +5 -8
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +5 -8
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +5 -8
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +36 -14
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +9 -12
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +9 -12
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +9 -12
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +9 -12
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +32 -10
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +9 -12
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/list.js +0 -0
- package/dist/commands/compute/environment/set.js +1 -0
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/environment/show.js +0 -0
- package/dist/commands/compute/undelegate.js +5 -8
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/commands/telemetry/disable.js +0 -0
- package/dist/commands/telemetry/enable.js +0 -0
- package/dist/commands/telemetry/status.js +0 -0
- package/dist/commands/upgrade.js +0 -0
- package/dist/commands/version.js +0 -0
- package/package.json +15 -14
- package/LICENSE +0 -7
|
@@ -157,17 +157,43 @@ var APPS_DIR = path2.join(CONFIG_DIR, "apps");
|
|
|
157
157
|
|
|
158
158
|
// src/utils/version.ts
|
|
159
159
|
function getCliVersion() {
|
|
160
|
-
return true ? "0.4.0-dev.
|
|
160
|
+
return true ? "0.4.0-dev.3" : "0.0.0";
|
|
161
161
|
}
|
|
162
162
|
function getClientId() {
|
|
163
163
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// src/utils/prompts.ts
|
|
167
|
+
import { execSync } from "child_process";
|
|
168
|
+
function detectGitRepoInfo() {
|
|
169
|
+
const git = (cmd) => execSync(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
170
|
+
const detectRepoUrl = () => {
|
|
171
|
+
try {
|
|
172
|
+
const remote = git("git remote get-url origin").replace(/^git@github\.com:(.+?)(?:\.git)?$/, "https://github.com/$1").replace(/\.git$/, "");
|
|
173
|
+
if (/^https:\/\/github\.com\/[^/]+\/[^/]+/.test(remote)) return remote;
|
|
174
|
+
} catch {
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const detectCommitSha = () => {
|
|
178
|
+
try {
|
|
179
|
+
const branch = git("git rev-parse --abbrev-ref HEAD");
|
|
180
|
+
if (!branch || branch === "HEAD") return;
|
|
181
|
+
const lsRemote = git(`git ls-remote origin refs/heads/${branch}`);
|
|
182
|
+
return lsRemote.match(/^([0-9a-f]{40})\s/i)?.[1];
|
|
183
|
+
} catch {
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
try {
|
|
187
|
+
return { repoUrl: detectRepoUrl(), commitSha: detectCommitSha() };
|
|
188
|
+
} catch {
|
|
189
|
+
return {};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
167
192
|
async function promptVerifiableGitSourceInputs() {
|
|
193
|
+
const detected = detectGitRepoInfo();
|
|
168
194
|
const repoUrl = (await input({
|
|
169
195
|
message: "Enter public git repository URL:",
|
|
170
|
-
default: "",
|
|
196
|
+
default: detected.repoUrl ?? "",
|
|
171
197
|
validate: (value) => {
|
|
172
198
|
if (!value.trim()) return "Repository URL is required";
|
|
173
199
|
try {
|
|
@@ -190,7 +216,7 @@ async function promptVerifiableGitSourceInputs() {
|
|
|
190
216
|
})).trim();
|
|
191
217
|
const gitRef = (await input({
|
|
192
218
|
message: "Enter git commit SHA (40 hex chars):",
|
|
193
|
-
default: "",
|
|
219
|
+
default: repoUrl === detected.repoUrl ? detected.commitSha ?? "" : "",
|
|
194
220
|
validate: (value) => {
|
|
195
221
|
const trimmed = value.trim();
|
|
196
222
|
if (!trimmed) return "Commit SHA is required";
|
|
@@ -251,8 +277,8 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
251
277
|
}
|
|
252
278
|
return privateKey;
|
|
253
279
|
}
|
|
254
|
-
const { getPrivateKeyWithSource
|
|
255
|
-
const result = await
|
|
280
|
+
const { getPrivateKeyWithSource } = await import("@layr-labs/ecloud-sdk");
|
|
281
|
+
const result = await getPrivateKeyWithSource({ privateKey: void 0 });
|
|
256
282
|
if (result) {
|
|
257
283
|
return result.key;
|
|
258
284
|
}
|
|
@@ -355,12 +381,8 @@ import {
|
|
|
355
381
|
createBillingModule,
|
|
356
382
|
createBuildModule,
|
|
357
383
|
getEnvironmentConfig as getEnvironmentConfig3,
|
|
358
|
-
requirePrivateKey
|
|
359
|
-
getPrivateKeyWithSource,
|
|
360
|
-
addHexPrefix as addHexPrefix2
|
|
384
|
+
requirePrivateKey
|
|
361
385
|
} from "@layr-labs/ecloud-sdk";
|
|
362
|
-
import { createWalletClient, custom } from "viem";
|
|
363
|
-
import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
|
|
364
386
|
async function createBuildClient(flags) {
|
|
365
387
|
flags = await validateCommonFlags(flags, { requirePrivateKey: false });
|
|
366
388
|
const environment = flags.environment;
|