backfill-hasher
Advanced tools
Comparing version 3.0.0 to 3.0.1-alpha.0
@@ -10,3 +10,3 @@ { | ||
}, | ||
"version": "3.0.0", | ||
"version": "3.0.1-alpha.0", | ||
"main": "lib/index.js", | ||
@@ -21,4 +21,4 @@ "scripts": { | ||
"@yarnpkg/lockfile": "^1.1.0", | ||
"backfill-config": "^3.0.0", | ||
"backfill-logger": "^3.0.0", | ||
"backfill-config": "^3.0.1-alpha.0", | ||
"backfill-logger": "^3.0.1-alpha.0", | ||
"fast-glob": "^3.0.4", | ||
@@ -34,3 +34,3 @@ "find-up": "^4.1.0", | ||
"@types/yarnpkg__lockfile": "^1.1.3", | ||
"backfill-utils-test": "^3.0.0", | ||
"backfill-utils-test": "^3.0.1-alpha.0", | ||
"backfill-utils-tsconfig": "^2.0.3", | ||
@@ -41,3 +41,3 @@ "jest": "^24.0.12", | ||
}, | ||
"gitHead": "7542473ba460ad74c0f6373e5e187528b219023c" | ||
"gitHead": "b67874e277f5f43c7cf4aa8e4e52565593e8025b" | ||
} |
import * as crypto from "crypto"; | ||
import * as path from "path"; | ||
import * as fs from "fs"; | ||
import * as fsExtra from "fs-extra"; | ||
import { logger } from "backfill-logger"; | ||
@@ -40,2 +42,14 @@ | ||
): Promise<PackageHashInfo> { | ||
const cacheFile = path.join(packageRoot, "node_modules", "backfill-hash.json"); | ||
try { | ||
const cachedValue = await fs.promises.readFile(cacheFile); | ||
const result = JSON.parse(cachedValue.toString()); | ||
return result; | ||
} | ||
catch { | ||
} | ||
const { name, dependencies, devDependencies } = require(path.join( | ||
@@ -81,3 +95,6 @@ packageRoot, | ||
await fsExtra.mkdirp(path.dirname(cacheFile)); | ||
await fs.promises.writeFile(cacheFile, JSON.stringify(packageHash)); | ||
return packageHash; | ||
} |
@@ -88,4 +88,4 @@ import { logger } from "backfill-logger"; | ||
const internalPackagesHash = generateHashOfInternalPackages(done); | ||
const buildCommandHash = await hashStrings(this.buildCommandSignature); | ||
const combinedHash = await hashStrings([ | ||
const buildCommandHash = hashStrings(this.buildCommandSignature); | ||
const combinedHash = hashStrings([ | ||
internalPackagesHash, | ||
@@ -92,0 +92,0 @@ buildCommandHash |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
255110
1458
2
+ Addedbackfill-config@3.0.1-alpha.0(transitive)
+ Addedbackfill-generic-logger@3.0.1-alpha.0(transitive)
+ Addedbackfill-logger@3.0.1-alpha.0(transitive)
+ Addedbackfill-performance-logger@3.0.1-alpha.0(transitive)
- Removedbackfill-config@3.0.0(transitive)
- Removedbackfill-generic-logger@3.0.0(transitive)
- Removedbackfill-logger@3.0.0(transitive)
- Removedbackfill-performance-logger@3.0.0(transitive)