@abtnode/db-cache 1.16.46-beta-20250706-075512-de1b046b → 1.16.46-beta-20250709-071942-1f57b2b8

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.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const path = require('path');
3
4
  const redis = require('redis');
4
5
  const sqlite3 = require('sqlite3');
5
- const path = require('path');
6
6
  const fs = require('fs');
7
7
 
8
8
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -19,8 +19,9 @@ function _interopNamespaceCompat(e) {
19
19
  return n;
20
20
  }
21
21
 
22
- const sqlite3__default = /*#__PURE__*/_interopDefaultCompat(sqlite3);
23
22
  const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
23
+ const path__default = /*#__PURE__*/_interopDefaultCompat(path);
24
+ const sqlite3__default = /*#__PURE__*/_interopDefaultCompat(sqlite3);
24
25
  const fs__namespace = /*#__PURE__*/_interopNamespaceCompat(fs);
25
26
 
26
27
  var __defProp$4 = Object.defineProperty;
@@ -837,9 +838,10 @@ const isJestTest = () => {
837
838
  return process.env.NODE_ENV === "test" || process.env.BABEL_ENV === "test" || typeof jest !== "undefined";
838
839
  };
839
840
  const getAbtNodeRedisAndSQLiteUrl = () => {
841
+ const blockletCacheDir = process.env.BLOCKLET_DATA_DIR ? path__default.join(process.env.BLOCKLET_DATA_DIR, "__default-cache-store.db") : void 0;
840
842
  const params = {
841
843
  redisUrl: process.env.ABT_NODE_CACHE_REDIS_URL,
842
- sqlitePath: isJestTest() ? "test.db" : process.env.ABT_NODE_CACHE_SQLITE_PATH
844
+ sqlitePath: isJestTest() ? "test.db" : process.env.ABT_NODE_CACHE_SQLITE_PATH || blockletCacheDir
843
845
  };
844
846
  if (process.env.ABT_NODE_NO_CACHE === "true") {
845
847
  params.ttl = 1;
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
+ import * as path from 'path';
2
+ import path__default from 'path';
1
3
  import { createClient } from 'redis';
2
4
  import sqlite3 from 'sqlite3';
3
- import * as path from 'path';
4
5
  import * as fs from 'fs';
5
6
 
6
7
  var __defProp$4 = Object.defineProperty;
@@ -817,9 +818,10 @@ const isJestTest = () => {
817
818
  return process.env.NODE_ENV === "test" || process.env.BABEL_ENV === "test" || typeof jest !== "undefined";
818
819
  };
819
820
  const getAbtNodeRedisAndSQLiteUrl = () => {
821
+ const blockletCacheDir = process.env.BLOCKLET_DATA_DIR ? path__default.join(process.env.BLOCKLET_DATA_DIR, "__default-cache-store.db") : void 0;
820
822
  const params = {
821
823
  redisUrl: process.env.ABT_NODE_CACHE_REDIS_URL,
822
- sqlitePath: isJestTest() ? "test.db" : process.env.ABT_NODE_CACHE_SQLITE_PATH
824
+ sqlitePath: isJestTest() ? "test.db" : process.env.ABT_NODE_CACHE_SQLITE_PATH || blockletCacheDir
823
825
  };
824
826
  if (process.env.ABT_NODE_NO_CACHE === "true") {
825
827
  params.ttl = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abtnode/db-cache",
3
- "version": "1.16.46-beta-20250706-075512-de1b046b",
3
+ "version": "1.16.46-beta-20250709-071942-1f57b2b8",
4
4
  "description": "Db cache use redis or sqlite as backend",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,7 +20,8 @@
20
20
  "ts-check": "npx tsc --noemit --skipLibCheck --incremental --tsBuildInfoFile './node_modules/.tsbuildinfo'",
21
21
  "lint": "npm run ts-check && eslint src",
22
22
  "lint:fix": "npm run lint -- --fix",
23
- "test": "jest",
23
+ "test": "node tools/jest.js",
24
+ "coverage": "npm run test -- --coverage",
24
25
  "build": "unbuild",
25
26
  "build:db-cache": "npm run build"
26
27
  },
@@ -44,5 +45,5 @@
44
45
  "typescript": "^5.6.3",
45
46
  "unbuild": "^2.0.0"
46
47
  },
47
- "gitHead": "e6d80405142a38be22341a684229625361be7293"
48
+ "gitHead": "9184af39c696a06817570abb559d509ca3970739"
48
49
  }