@atlaspack/core 2.12.1-canary.3408 → 2.12.1-canary.3410

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.
@@ -32,6 +32,13 @@ function _cache() {
32
32
  };
33
33
  return data;
34
34
  }
35
+ function _featureFlags() {
36
+ const data = require("@atlaspack/feature-flags");
37
+ _featureFlags = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
35
42
  function _packageManager() {
36
43
  const data = require("@atlaspack/package-manager");
37
44
  _packageManager = function () {
@@ -49,13 +56,6 @@ function _utils() {
49
56
  var _loadDotEnv = _interopRequireDefault(require("./loadDotEnv"));
50
57
  var _projectPath = require("./projectPath");
51
58
  var _AtlaspackConfigRequest = require("./requests/AtlaspackConfigRequest");
52
- function _featureFlags() {
53
- const data = require("@atlaspack/feature-flags");
54
- _featureFlags = function () {
55
- return data;
56
- };
57
- return data;
58
- }
59
59
  var _constants = require("./constants");
60
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
61
  // Default cache directory name
@@ -111,7 +111,12 @@ async function resolveOptions(initialOptions) {
111
111
  // where symlinked dependencies outside the project root need to trigger HMR
112
112
  // updates. Default to the project root if not provided.
113
113
  let watchDir = initialOptions.watchDir != null ? _path().default.resolve(initialOptions.watchDir) : projectRoot;
114
- let cache = initialOptions.cache ?? (outputFS instanceof _fs().NodeFS ? new (_cache().LMDBCache)(cacheDir) : new (_cache().FSCache)(outputFS, cacheDir));
114
+ let cache = initialOptions.cache ?? (outputFS instanceof _fs().NodeFS ? (() => {
115
+ if ((0, _featureFlags().getFeatureFlag)('useLmdbJsLite')) {
116
+ return new (_cache().LMDBLiteCache)(cacheDir);
117
+ }
118
+ return new (_cache().LMDBCache)(cacheDir);
119
+ })() : new (_cache().FSCache)(outputFS, cacheDir));
115
120
  let mode = initialOptions.mode ?? 'development';
116
121
  let shouldOptimize = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau = initialOptions.defaultTargetOptions) === null || _initialOptions$defau === void 0 ? void 0 : _initialOptions$defau.shouldOptimize) ?? mode === 'production';
117
122
  let publicUrl = (initialOptions === null || initialOptions === void 0 || (_initialOptions$defau2 = initialOptions.defaultTargetOptions) === null || _initialOptions$defau2 === void 0 ? void 0 : _initialOptions$defau2.publicUrl) ?? '/';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3408+7f7b7ea46",
3
+ "version": "2.12.1-canary.3410+11a9679ea",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,20 +20,20 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/cache": "2.12.1-canary.3408+7f7b7ea46",
24
- "@atlaspack/diagnostic": "2.12.1-canary.3408+7f7b7ea46",
25
- "@atlaspack/events": "2.12.1-canary.3408+7f7b7ea46",
26
- "@atlaspack/feature-flags": "2.12.1-canary.3408+7f7b7ea46",
27
- "@atlaspack/fs": "2.12.1-canary.3408+7f7b7ea46",
28
- "@atlaspack/graph": "3.2.1-canary.3408+7f7b7ea46",
29
- "@atlaspack/logger": "2.12.1-canary.3408+7f7b7ea46",
30
- "@atlaspack/package-manager": "2.12.1-canary.3408+7f7b7ea46",
31
- "@atlaspack/plugin": "2.12.1-canary.3408+7f7b7ea46",
32
- "@atlaspack/profiler": "2.12.1-canary.3408+7f7b7ea46",
33
- "@atlaspack/rust": "2.12.1-canary.3408+7f7b7ea46",
34
- "@atlaspack/types": "2.12.1-canary.3408+7f7b7ea46",
35
- "@atlaspack/utils": "2.12.1-canary.3408+7f7b7ea46",
36
- "@atlaspack/workers": "2.12.1-canary.3408+7f7b7ea46",
23
+ "@atlaspack/cache": "2.12.1-canary.3410+11a9679ea",
24
+ "@atlaspack/diagnostic": "2.12.1-canary.3410+11a9679ea",
25
+ "@atlaspack/events": "2.12.1-canary.3410+11a9679ea",
26
+ "@atlaspack/feature-flags": "2.12.1-canary.3410+11a9679ea",
27
+ "@atlaspack/fs": "2.12.1-canary.3410+11a9679ea",
28
+ "@atlaspack/graph": "3.2.1-canary.3410+11a9679ea",
29
+ "@atlaspack/logger": "2.12.1-canary.3410+11a9679ea",
30
+ "@atlaspack/package-manager": "2.12.1-canary.3410+11a9679ea",
31
+ "@atlaspack/plugin": "2.12.1-canary.3410+11a9679ea",
32
+ "@atlaspack/profiler": "2.12.1-canary.3410+11a9679ea",
33
+ "@atlaspack/rust": "2.12.1-canary.3410+11a9679ea",
34
+ "@atlaspack/types": "2.12.1-canary.3410+11a9679ea",
35
+ "@atlaspack/utils": "2.12.1-canary.3410+11a9679ea",
36
+ "@atlaspack/workers": "2.12.1-canary.3410+11a9679ea",
37
37
  "@mischnic/json-sourcemap": "^0.1.0",
38
38
  "@parcel/source-map": "^2.1.1",
39
39
  "base-x": "^3.0.8",
@@ -55,5 +55,5 @@
55
55
  "browser": {
56
56
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
57
57
  },
58
- "gitHead": "7f7b7ea4647e69d3cdaa0322531c129d7be1ee53"
58
+ "gitHead": "11a9679ea386c5e8342aa840646e41e77cbabd92"
59
59
  }
@@ -12,7 +12,8 @@ import type {AtlaspackOptions} from './types';
12
12
  import path from 'path';
13
13
  import {hashString} from '@atlaspack/rust';
14
14
  import {NodeFS} from '@atlaspack/fs';
15
- import {LMDBCache, FSCache} from '@atlaspack/cache';
15
+ import {LMDBCache, LMDBLiteCache, FSCache} from '@atlaspack/cache';
16
+ import {getFeatureFlag} from '@atlaspack/feature-flags';
16
17
  import {NodePackageManager} from '@atlaspack/package-manager';
17
18
  import {
18
19
  getRootDir,
@@ -108,10 +109,17 @@ export default async function resolveOptions(
108
109
  ? path.resolve(initialOptions.watchDir)
109
110
  : projectRoot;
110
111
 
112
+ const makeLMDBCache = () => {
113
+ if (getFeatureFlag('useLmdbJsLite')) {
114
+ return new LMDBLiteCache(cacheDir);
115
+ }
116
+ return new LMDBCache(cacheDir);
117
+ };
118
+
111
119
  let cache =
112
120
  initialOptions.cache ??
113
121
  (outputFS instanceof NodeFS
114
- ? new LMDBCache(cacheDir)
122
+ ? makeLMDBCache()
115
123
  : new FSCache(outputFS, cacheDir));
116
124
 
117
125
  let mode = initialOptions.mode ?? 'development';