@parcel/cache
Advanced tools
Comparing version 2.0.0-canary.1646 to 2.0.0-canary.1647
@@ -42,2 +42,9 @@ "use strict"; | ||
} | ||
function _featureFlags() { | ||
const data = require("@parcel/feature-flags"); | ||
_featureFlags = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _fs() { | ||
@@ -160,5 +167,5 @@ const data = require("@parcel/fs"); | ||
} | ||
const largeBlobKey = (0, _featureFlags().getFeatureFlag)('randomLargeBlobKeys') ? | ||
// $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present | ||
const largeBlobKey = `${key}_${_crypto().default.randomUUID()}`; | ||
`${key}_${_crypto().default.randomUUID()}` : key; | ||
await this.fsCache.setLargeBlob(largeBlobKey, contents, options); | ||
@@ -165,0 +172,0 @@ await this.set(key, { |
{ | ||
"name": "@parcel/cache", | ||
"description": "Interface for defining caches and file-system, IDB and LMDB implementations.", | ||
"version": "2.0.0-canary.1646+9eff0bfeb", | ||
"version": "2.0.0-canary.1647+2ce4efe40", | ||
"license": "MIT", | ||
@@ -28,9 +28,9 @@ "publishConfig": { | ||
"dependencies": { | ||
"@parcel/fs": "2.0.0-canary.1646+9eff0bfeb", | ||
"@parcel/logger": "2.0.0-canary.1646+9eff0bfeb", | ||
"@parcel/utils": "2.0.0-canary.1646+9eff0bfeb", | ||
"@parcel/fs": "2.0.0-canary.1647+2ce4efe40", | ||
"@parcel/logger": "2.0.0-canary.1647+2ce4efe40", | ||
"@parcel/utils": "2.0.0-canary.1647+2ce4efe40", | ||
"lmdb": "2.8.5" | ||
}, | ||
"peerDependencies": { | ||
"@parcel/core": "^2.0.0-canary.1644+9eff0bfeb" | ||
"@parcel/core": "^2.0.0-canary.1645+2ce4efe40" | ||
}, | ||
@@ -44,3 +44,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "9eff0bfeb655845c8ffd86d8acdba9a21bbafc82" | ||
"gitHead": "2ce4efe40b663d04706dcd21b1a38e78eb24be79" | ||
} |
@@ -11,2 +11,3 @@ // @flow strict-local | ||
import {serialize, deserialize, registerSerializableClass} from '@parcel/core'; | ||
import {getFeatureFlag} from '@parcel/feature-flags'; | ||
import {NodeFS} from '@parcel/fs'; | ||
@@ -151,4 +152,6 @@ // flowlint-next-line untyped-import:off | ||
// $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present | ||
const largeBlobKey = `${key}_${crypto.randomUUID()}`; | ||
const largeBlobKey = getFeatureFlag('randomLargeBlobKeys') | ||
? // $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present | ||
`${key}_${crypto.randomUUID()}` | ||
: key; | ||
await this.fsCache.setLargeBlob(largeBlobKey, contents, options); | ||
@@ -155,0 +158,0 @@ const entry: LargeBlobEntry = {type: 'LARGE_BLOB', largeBlobKey}; |
// @flow | ||
import {DEFAULT_FEATURE_FLAGS, setFeatureFlags} from '@parcel/feature-flags'; | ||
import * as mkdirp from 'mkdirp'; | ||
@@ -18,4 +19,15 @@ import * as tempy from 'tempy'; | ||
await lmdbCache.ensure(); | ||
setFeatureFlags({ | ||
...DEFAULT_FEATURE_FLAGS, | ||
randomLargeBlobKeys: true, | ||
}); | ||
}); | ||
afterEach(() => { | ||
setFeatureFlags({ | ||
...DEFAULT_FEATURE_FLAGS, | ||
}); | ||
}); | ||
it('LMDBCache::get / set will return key values', async () => { | ||
@@ -22,0 +34,0 @@ assert(!(await lmdbCache.has('test-key')), 'LMDB did not start empty'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
40766
1222
9