@atlaspack/cache 2.12.1-dev.3466 → 2.12.1-dev.3502

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/lib/LMDBCache.js CHANGED
@@ -25,16 +25,16 @@ function _util() {
25
25
  };
26
26
  return data;
27
27
  }
28
- function _fs() {
29
- const data = require("@atlaspack/fs");
30
- _fs = function () {
28
+ function _buildCache() {
29
+ const data = require("@atlaspack/build-cache");
30
+ _buildCache = function () {
31
31
  return data;
32
32
  };
33
33
  return data;
34
34
  }
35
- function _buildCache() {
36
- const data = require("@atlaspack/build-cache");
37
- _buildCache = function () {
35
+ function _fs() {
36
+ const data = require("@atlaspack/fs");
37
+ _fs = function () {
38
38
  return data;
39
39
  };
40
40
  return data;
@@ -81,8 +81,6 @@ function open(directory
81
81
  }
82
82
  const pipeline = (0, _util().promisify)(_stream().default.pipeline);
83
83
  class LMDBLiteCache {
84
- // $FlowFixMe
85
-
86
84
  constructor(cacheDir) {
87
85
  this.fs = new (_fs().NodeFS)();
88
86
  this.dir = cacheDir;
@@ -93,6 +91,13 @@ class LMDBLiteCache {
93
91
  compression: true
94
92
  });
95
93
  }
94
+
95
+ /**
96
+ * Use this to pass the native LMDB instance back to Rust.
97
+ */
98
+ getNativeRef() {
99
+ return this.store.lmdb;
100
+ }
96
101
  ensure() {
97
102
  return Promise.resolve();
98
103
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlaspack/cache",
3
3
  "description": "Interface for defining caches and file-system, IDB and LMDB implementations.",
4
- "version": "2.12.1-dev.3466+9a12fb8bd",
4
+ "version": "2.12.1-dev.3502+c2daeab5a",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -22,15 +22,13 @@
22
22
  "check-ts": "tsc --noEmit index.d.ts"
23
23
  },
24
24
  "dependencies": {
25
- "@atlaspack/fs": "2.12.1-dev.3466+9a12fb8bd",
26
- "@atlaspack/logger": "2.12.1-dev.3466+9a12fb8bd",
27
- "@atlaspack/rust": "2.12.1-dev.3466+9a12fb8bd",
28
- "@atlaspack/utils": "2.12.1-dev.3466+9a12fb8bd",
25
+ "@atlaspack/build-cache": "2.12.1-dev.3502+c2daeab5a",
26
+ "@atlaspack/fs": "2.12.1-dev.3502+c2daeab5a",
27
+ "@atlaspack/logger": "2.12.1-dev.3502+c2daeab5a",
28
+ "@atlaspack/rust": "2.12.1-dev.3502+c2daeab5a",
29
+ "@atlaspack/utils": "2.12.1-dev.3502+c2daeab5a",
29
30
  "lmdb": "2.8.5"
30
31
  },
31
- "peerDependencies": {
32
- "@atlaspack/build-cache": "^2.12.0"
33
- },
34
32
  "devDependencies": {
35
33
  "idb": "^5.0.8"
36
34
  },
@@ -38,5 +36,5 @@
38
36
  "./src/IDBCache.js": "./src/IDBCache.browser.js",
39
37
  "./src/LMDBCache.js": false
40
38
  },
41
- "gitHead": "9a12fb8bd1b72e407ed043e20337dc60fbec9cbe"
39
+ "gitHead": "c2daeab5a12461903159dec34df5671eaaa9b749"
42
40
  }
package/src/LMDBCache.js CHANGED
@@ -7,12 +7,12 @@ import stream from 'stream';
7
7
  import path from 'path';
8
8
  import {promisify} from 'util';
9
9
 
10
- import {NodeFS} from '@atlaspack/fs';
11
10
  import {
12
11
  deserialize,
13
12
  registerSerializableClass,
14
13
  serialize,
15
14
  } from '@atlaspack/build-cache';
15
+ import {NodeFS} from '@atlaspack/fs';
16
16
  // flowlint-next-line untyped-import:off
17
17
  import lmdb from 'lmdb';
18
18
 
@@ -75,8 +75,7 @@ const pipeline: (Readable, Writable) => Promise<void> = promisify(
75
75
  export class LMDBLiteCache implements Cache {
76
76
  fs: NodeFS;
77
77
  dir: FilePath;
78
- // $FlowFixMe
79
- store: any;
78
+ store: LmdbWrapper;
80
79
  fsCache: FSCache;
81
80
 
82
81
  constructor(cacheDir: FilePath) {
@@ -91,6 +90,13 @@ export class LMDBLiteCache implements Cache {
91
90
  });
92
91
  }
93
92
 
93
+ /**
94
+ * Use this to pass the native LMDB instance back to Rust.
95
+ */
96
+ getNativeRef(): Lmdb {
97
+ return this.store.lmdb;
98
+ }
99
+
94
100
  ensure(): Promise<void> {
95
101
  return Promise.resolve();
96
102
  }