@uagents/syncenv-cli 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -13
  2. package/package.json +9 -6
package/dist/index.js CHANGED
@@ -38,6 +38,9 @@ import {
38
38
  // src/index.ts
39
39
  import chalk8 from "chalk";
40
40
  import { Command as Command7 } from "commander";
41
+ import { readFileSync } from "fs";
42
+ import { dirname as dirname2, join as join2 } from "path";
43
+ import { fileURLToPath } from "url";
41
44
 
42
45
  // src/commands/auth.ts
43
46
  import chalk2 from "chalk";
@@ -539,10 +542,10 @@ var StateManager = class {
539
542
  /**
540
543
  * Record a successful sync operation
541
544
  */
542
- async recordSync(projectId, envId, version, contentHash, source) {
545
+ async recordSync(projectId, envId, version2, contentHash, source) {
543
546
  await this.updateEnvironmentState(projectId, envId, (current) => ({
544
547
  lastSync: {
545
- version,
548
+ version: version2,
546
549
  contentHash,
547
550
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
548
551
  source
@@ -554,7 +557,7 @@ var StateManager = class {
554
557
  {
555
558
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
556
559
  action: source,
557
- version
560
+ version: version2
558
561
  }
559
562
  ].slice(-20)
560
563
  }));
@@ -991,11 +994,11 @@ envCommands.command("history").description("Show version history").option("-p, -
991
994
  }
992
995
  console.log(chalk4.bold("\nVERSION DATE AUTHOR MESSAGE"));
993
996
  console.log(chalk4.dim("\u2500".repeat(70)));
994
- for (const version of versions.slice(0, limit)) {
995
- const ver = String(version.versionNumber).padEnd(9);
996
- const date = formatRelativeTime(version.createdAt).padEnd(17);
997
- const author = (version.createdByUser?.slice(0, 12) || "unknown").padEnd(13);
998
- const message = version.changeSummary || "";
997
+ for (const version2 of versions.slice(0, limit)) {
998
+ const ver = String(version2.versionNumber).padEnd(9);
999
+ const date = formatRelativeTime(version2.createdAt).padEnd(17);
1000
+ const author = (version2.createdByUser?.slice(0, 12) || "unknown").padEnd(13);
1001
+ const message = version2.changeSummary || "";
999
1002
  console.log(`${ver} ${date} ${author} ${message}`);
1000
1003
  }
1001
1004
  console.log("");
@@ -1057,7 +1060,7 @@ Version ${version2}:`));
1057
1060
  process.exit(1);
1058
1061
  }
1059
1062
  });
1060
- envCommands.command("rollback <version>").description("Rollback to a specific version").option("-p, --project <id>", "project ID").option("-e, --env <name>", "environment name").option("-y, --yes", "skip confirmation").action(async (version, options) => {
1063
+ envCommands.command("rollback <version>").description("Rollback to a specific version").option("-p, --project <id>", "project ID").option("-e, --env <name>", "environment name").option("-y, --yes", "skip confirmation").action(async (version2, options) => {
1061
1064
  try {
1062
1065
  if (!isAuthenticated()) {
1063
1066
  error("Not authenticated. Run `syncenv auth login` first.");
@@ -1070,7 +1073,7 @@ envCommands.command("rollback <version>").description("Rollback to a specific ve
1070
1073
  process.exit(1);
1071
1074
  }
1072
1075
  const envName = options.env || config?.defaults.environment || "dev";
1073
- const targetVersion = parseInt(version);
1076
+ const targetVersion = parseInt(version2);
1074
1077
  if (!options.yes) {
1075
1078
  const { confirm } = await inquirer2.prompt([
1076
1079
  {
@@ -1159,11 +1162,11 @@ Environments for ${project.name}`));
1159
1162
  console.log(chalk4.dim("\u2500".repeat(70)));
1160
1163
  for (const env of environments) {
1161
1164
  const name = env.name.padEnd(11).slice(0, 11);
1162
- const version = `v${env.currentVersion || 1}`.padEnd(9);
1165
+ const version2 = `v${env.currentVersion || 1}`.padEnd(9);
1163
1166
  const size = formatBytes(env.contentSize || 0).padEnd(9);
1164
1167
  const modified = env.lastModifiedAt ? formatRelativeTime(env.lastModifiedAt).padEnd(17) : "--".padEnd(17);
1165
1168
  const description = env.description || "";
1166
- console.log(`${name} ${version} ${size} ${modified} ${description}`);
1169
+ console.log(`${name} ${version2} ${size} ${modified} ${description}`);
1167
1170
  }
1168
1171
  console.log("");
1169
1172
  } catch (err) {
@@ -2050,10 +2053,18 @@ userKeysCommands.command("rotate").description("Re-encrypt your keys with a new
2050
2053
  });
2051
2054
 
2052
2055
  // src/index.ts
2056
+ var version = "0.0.0";
2057
+ try {
2058
+ const __dirname = dirname2(fileURLToPath(import.meta.url));
2059
+ const pkg = JSON.parse(readFileSync(join2(__dirname, "../package.json"), "utf8"));
2060
+ version = pkg.version;
2061
+ } catch {
2062
+ version = process.env.SYNCENV_VERSION || "0.0.0";
2063
+ }
2053
2064
  async function main() {
2054
2065
  const program = new Command7();
2055
2066
  await loadConfig();
2056
- program.name("syncenv").description("CLI for SyncEnv - Secure environment variable synchronization").version("0.1.0").option("-v, --verbose", "enable verbose logging").option("--api-url <url>", "API base URL", process.env.SYNCENV_API_URL || "http://localhost:8787").hook("preAction", (thisCommand) => {
2067
+ program.name("syncenv").description("CLI for SyncEnv - Secure environment variable synchronization").version(version).option("-v, --verbose", "enable verbose logging").option("--api-url <url>", "API base URL", process.env.SYNCENV_API_URL || "http://localhost:8787").hook("preAction", (thisCommand) => {
2057
2068
  const opts = thisCommand.opts();
2058
2069
  if (opts.verbose) {
2059
2070
  process.env.SYNCENV_VERBOSE = "true";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uagents/syncenv-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "CLI for SyncEnv - Secure environment variable synchronization",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,8 +25,8 @@
25
25
  "open": "^11.0.0",
26
26
  "ora": "^8.0.0",
27
27
  "zod": "^3.23.0",
28
- "@uagents/syncenv-client": "0.1.0",
29
- "@uagents/syncenv-schemas": "1.0.0"
28
+ "@uagents/syncenv-schemas": "1.0.0",
29
+ "@uagents/syncenv-client": "0.1.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/js-yaml": "^4.0.9",
@@ -42,10 +42,13 @@
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsup src/index.ts --format esm --out-dir dist --clean",
45
- "build:sea-bundle": "node scripts/bundle-for-sea.js",
45
+ "sea:bundle": "node scripts/sea-bundle.js",
46
46
  "dev": "tsup src/index.ts --format esm --out-dir dist --watch --clean",
47
- "build:sea": "node scripts/build-sea.js",
48
- "build:sea:all": "node scripts/build-sea-all.js",
47
+ "sea:build": "node scripts/sea-build.js",
48
+ "sea:build:all": "node scripts/sea-build-all.js",
49
+ "publish:npm": "node scripts/publish-npm.js",
50
+ "publish:r2": "node scripts/publish-r2.js",
51
+ "release": "./scripts/release.sh",
49
52
  "typecheck": "tsc --noEmit",
50
53
  "lint": "eslint src --ext .ts",
51
54
  "test": "vitest run"