@temps-sdk/cli 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -11
  2. package/package.json +3 -4
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
2
  // @bun
3
3
  import { createRequire } from "node:module";
4
4
  var __create = Object.create;
@@ -17731,6 +17731,9 @@ class Conf {
17731
17731
 
17732
17732
  // src/config/store.ts
17733
17733
  init_output();
17734
+ import { readFile, writeFile, mkdir } from "node:fs/promises";
17735
+ import { existsSync } from "node:fs";
17736
+ import { dirname } from "node:path";
17734
17737
  var DEFAULT_CONFIG = {
17735
17738
  apiUrl: "http://localhost:3000",
17736
17739
  outputFormat: "table",
@@ -17764,9 +17767,8 @@ function getSecretsPath() {
17764
17767
  async function loadSecrets() {
17765
17768
  const secretsPath = getSecretsPath();
17766
17769
  try {
17767
- const file = Bun.file(secretsPath);
17768
- if (await file.exists()) {
17769
- const content = await file.text();
17770
+ if (existsSync(secretsPath)) {
17771
+ const content = await readFile(secretsPath, "utf-8");
17770
17772
  const secrets = {};
17771
17773
  for (const line of content.split(`
17772
17774
  `)) {
@@ -17790,17 +17792,15 @@ async function loadSecrets() {
17790
17792
  }
17791
17793
  async function saveSecrets(secrets) {
17792
17794
  const secretsPath = getSecretsPath();
17793
- const dir = secretsPath.substring(0, secretsPath.lastIndexOf("/"));
17794
- await Bun.write(`${dir}/.keep`, "");
17795
+ const dir = dirname(secretsPath);
17796
+ await mkdir(dir, { recursive: true });
17795
17797
  const lines = ["# Temps CLI secrets - DO NOT SHARE THIS FILE"];
17796
17798
  for (const [key, value] of Object.entries(secrets)) {
17797
17799
  lines.push(`${key}="${value}"`);
17798
17800
  }
17799
- await Bun.write(secretsPath, lines.join(`
17801
+ await writeFile(secretsPath, lines.join(`
17800
17802
  `) + `
17801
- `);
17802
- const { chmod } = await import("node:fs/promises");
17803
- await chmod(secretsPath, 384);
17803
+ `, { mode: 384 });
17804
17804
  }
17805
17805
  var config = {
17806
17806
  get(key) {
@@ -21137,6 +21137,7 @@ async function listRepos(provider) {
21137
21137
  }
21138
21138
 
21139
21139
  // src/commands/backups/index.ts
21140
+ import { writeFile as writeFile2 } from "node:fs/promises";
21140
21141
  init_spinner();
21141
21142
  init_output();
21142
21143
  function registerBackupsCommands(program2) {
@@ -21276,7 +21277,7 @@ async function downloadBackup(backupId, options) {
21276
21277
  });
21277
21278
  if (response.data) {
21278
21279
  const buffer = Buffer.from(await response.data.arrayBuffer());
21279
- await Bun.write(outputPath, buffer);
21280
+ await writeFile2(outputPath, buffer);
21280
21281
  }
21281
21282
  });
21282
21283
  success(`Backup downloaded to ${outputPath}`);
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@temps-sdk/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for Temps deployment platform",
5
- "module": "src/index.ts",
6
5
  "type": "module",
7
6
  "bin": {
8
- "temps": "./bin/index.js"
7
+ "temps": "./dist/index.js"
9
8
  },
10
9
  "files": [
11
10
  "dist"
@@ -14,7 +13,7 @@
14
13
  "dev": "bun run src/index.ts",
15
14
  "clean": "rm -rf dist",
16
15
  "prepublishOnly": "bun run clean && bun run build",
17
- "build": "bun build src/index.ts --outdir dist --target node",
16
+ "build": "bun build src/index.ts --outdir dist --target node && sed -i '' '1s|#!/usr/bin/env bun|#!/usr/bin/env node|' dist/index.js && chmod +x dist/index.js",
18
17
  "build:bin": "bun build src/index.ts --compile --outfile bin/temps",
19
18
  "generate:api": "bun openapi-ts",
20
19
  "typecheck": "tsc --noEmit",