@fleettools/db 0.2.0 → 0.2.1

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 +8 -8
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // @bun
1
+ import { createRequire } from "node:module";
2
2
  var __create = Object.create;
3
3
  var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
@@ -24,7 +24,7 @@ var __export = (target, all) => {
24
24
  set: (newValue) => all[name] = () => newValue
25
25
  });
26
26
  };
27
- var __require = import.meta.require;
27
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
28
 
29
29
  // src/schema.ts
30
30
  var exports_schema = {};
@@ -4013,7 +4013,7 @@ function createFleetDb(options) {
4013
4013
  const { projectPath, filename = "fleet.db", readonly = false } = options;
4014
4014
  const fleetDir = `${projectPath}/.fleet`;
4015
4015
  try {
4016
- import("fs").then((fs) => {
4016
+ import("node:fs").then((fs) => {
4017
4017
  fs.mkdirSync(fleetDir, { recursive: true });
4018
4018
  });
4019
4019
  } catch (error) {
@@ -4110,8 +4110,8 @@ class DatabasePool {
4110
4110
  }
4111
4111
  }
4112
4112
  // ../../node_modules/drizzle-orm/migrator.js
4113
- import crypto2 from "crypto";
4114
- import fs from "fs";
4113
+ import crypto2 from "node:crypto";
4114
+ import fs from "node:fs";
4115
4115
  function readMigrationFiles(config) {
4116
4116
  const migrationFolderTo = config.migrationsFolder;
4117
4117
  const migrationQueries = [];
@@ -4161,9 +4161,9 @@ var drizzle_config_default = {
4161
4161
  async function runMigrations(db) {
4162
4162
  try {
4163
4163
  await migrate(db, { ...drizzle_config_default, migrationsFolder: "./drizzle/migrations" });
4164
- console.log("\u2705 Migrations completed successfully");
4164
+ console.log(" Migrations completed successfully");
4165
4165
  } catch (error) {
4166
- console.error("\u274C Migration failed:", error);
4166
+ console.error(" Migration failed:", error);
4167
4167
  throw error;
4168
4168
  }
4169
4169
  }
@@ -4207,7 +4207,7 @@ async function rollbackMigration(db, targetVersion) {
4207
4207
  console.warn("For production, implement proper rollback using backup/restore");
4208
4208
  throw new Error("Rollback not implemented in this simplified version");
4209
4209
  } catch (error) {
4210
- console.error("\u274C Rollback failed:", error);
4210
+ console.error(" Rollback failed:", error);
4211
4211
  throw error;
4212
4212
  }
4213
4213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleettools/db",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Database layer for FleetTools using Drizzle ORM and libSQL",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,8 +11,9 @@
11
11
  }
12
12
  },
13
13
  "scripts": {
14
- "build": "bun build src/index.ts --outdir dist --target bun --format esm && bun run build:types",
15
- "build:types": "tsc --emitDeclarationOnly",
14
+ "build": "bun build src/index.ts --outdir dist --target node --format esm",
15
+ "build:bun": "bun build src/index.ts --outdir dist --target bun --format esm",
16
+ "build:node": "bun build src/index.ts --outdir dist --target node --format esm",
16
17
  "dev": "bun --watch src/index.ts",
17
18
  "test": "bun test",
18
19
  "test:watch": "bun test --watch",