@dbcube/core 1.0.30 → 1.0.34

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/dist/index.d.mts CHANGED
@@ -74,6 +74,7 @@ declare class Binary {
74
74
  static ensureBinariesExist(): Promise<void>;
75
75
  private static downloadBinaries;
76
76
  private static getBinDir;
77
+ private static ensureGitIgnore;
77
78
  static get(): Promise<BinaryType>;
78
79
  }
79
80
 
package/dist/index.d.ts CHANGED
@@ -74,6 +74,7 @@ declare class Binary {
74
74
  static ensureBinariesExist(): Promise<void>;
75
75
  private static downloadBinaries;
76
76
  private static getBinDir;
77
+ private static ensureGitIgnore;
77
78
  static get(): Promise<BinaryType>;
78
79
  }
79
80
 
package/dist/index.js CHANGED
@@ -233,7 +233,7 @@ var Downloader = class {
233
233
  extracting: chalk.yellow("extrayendo"),
234
234
  completed: chalk.green("completado"),
235
235
  exists: chalk.gray("existe"),
236
- retrying: chalk.orange(`reintentando (${attempt}/${3})`)
236
+ retrying: chalk.yellow(`reintentando (${attempt}/${3})`)
237
237
  };
238
238
  const emoji = statusEmojis[status] || "\u{1F4E5}";
239
239
  const message = statusMessages[status] || status;
@@ -351,7 +351,7 @@ var Downloader = class {
351
351
  }
352
352
  static getDefaultBinDir() {
353
353
  const possibleDirs = [
354
- path.resolve(process.cwd(), "bin"),
354
+ path.resolve(process.cwd(), ".dbcube", "bin"),
355
355
  path.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
356
356
  path.resolve(__dirname, "..", "bin")
357
357
  ];
@@ -368,7 +368,7 @@ var Downloader = class {
368
368
  continue;
369
369
  }
370
370
  }
371
- const tempDir = path.join(os2.tmpdir(), "dbcube-bin");
371
+ const tempDir = path.join(os2.tmpdir(), ".dbcube", "bin");
372
372
  fs.mkdirSync(tempDir, { recursive: true });
373
373
  return tempDir;
374
374
  }
@@ -377,6 +377,7 @@ var Downloader = class {
377
377
  // src/lib/Binary.ts
378
378
  import * as fs2 from "fs";
379
379
  import * as path2 from "path";
380
+ import * as os3 from "os";
380
381
  var Binary = class {
381
382
  static isDownloading = false;
382
383
  static downloadPromise = null;
@@ -418,7 +419,7 @@ var Binary = class {
418
419
  }
419
420
  static getBinDir() {
420
421
  const possibleDirs = [
421
- path2.resolve(process.cwd(), "bin"),
422
+ path2.resolve(process.cwd(), ".dbcube", "bin"),
422
423
  path2.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
423
424
  path2.resolve(__dirname, "..", "bin")
424
425
  ];
@@ -427,12 +428,32 @@ var Binary = class {
427
428
  if (!fs2.existsSync(dir)) {
428
429
  fs2.mkdirSync(dir, { recursive: true });
429
430
  }
431
+ if (dir.includes(path2.resolve(process.cwd(), ".dbcube"))) {
432
+ this.ensureGitIgnore(path2.resolve(process.cwd(), ".dbcube"));
433
+ }
430
434
  return dir;
431
435
  } catch {
432
436
  continue;
433
437
  }
434
438
  }
435
- return process.cwd();
439
+ const tempDir = path2.join(os3.tmpdir(), ".dbcube", "bin");
440
+ fs2.mkdirSync(tempDir, { recursive: true });
441
+ return tempDir;
442
+ }
443
+ static ensureGitIgnore(dbcubeDir) {
444
+ try {
445
+ const gitignorePath = path2.join(dbcubeDir, ".gitignore");
446
+ if (!fs2.existsSync(gitignorePath)) {
447
+ const gitignoreContent = `# DBCube binaries
448
+ bin/
449
+ *.exe
450
+ *.log
451
+ *.tmp
452
+ `;
453
+ fs2.writeFileSync(gitignorePath, gitignoreContent);
454
+ }
455
+ } catch {
456
+ }
436
457
  }
437
458
  static async get() {
438
459
  await this.ensureBinariesExist();