Comparing version 3.0.4-alpha.0 to 3.0.5-alpha.0
@@ -8,2 +8,3 @@ "use strict"; | ||
const backfill_config_1 = require("backfill-config"); | ||
const backfill_logger_1 = require("backfill-logger"); | ||
const index_1 = require("../index"); | ||
@@ -15,9 +16,9 @@ const commandRunner_1 = require("../commandRunner"); | ||
await backfill_utils_test_1.setupFixture("basic"); | ||
const config = backfill_config_1.createConfig(); | ||
const config = backfill_config_1.createConfig(process.cwd()); | ||
const { cacheStorageConfig, clearOutput, internalCacheFolder, outputGlob, packageRoot } = config; | ||
// Arrange | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, internalCacheFolder); | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, internalCacheFolder, backfill_logger_1.logger, process.cwd()); | ||
const buildCommandRaw = "npm run compile"; | ||
const buildCommand = commandRunner_1.createBuildCommand([buildCommandRaw], clearOutput, outputGlob); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob }, buildCommandRaw); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob, logger: backfill_logger_1.logger }, buildCommandRaw); | ||
// Spy | ||
@@ -46,2 +47,2 @@ const spiedCacheStorage = ts_mockito_1.spy(cacheStorage); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja2ZpbGwudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9fX3Rlc3RzX18vYmFja2ZpbGwudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDJDQUEwRTtBQUUxRSw2REFBbUQ7QUFDbkQsbURBQXlEO0FBQ3pELHFEQUF5QztBQUN6QyxxREFBK0M7QUFFL0Msb0NBQW9DO0FBQ3BDLG9EQUFzRDtBQUV0RCxRQUFRLENBQUMsVUFBVSxFQUFFLEdBQUcsRUFBRTtJQUN4QixFQUFF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CxtQkFBTSxDQUFDLFdBQVcsQ0FBQyxpQkFBaUIsRUFBRSxDQUFDLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDL0MsTUFBTSxDQUFDLGlCQUFpQixDQUFDLENBQUMsR0FBRyxDQUFDLGdCQUFnQixFQUFFLENBQUM7UUFDakQsbUJBQU0sQ0FBQyxpQkFBaUIsQ0FBQyxLQUFLLENBQUMsc0JBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNwRCxtQkFBTSxDQUFDLGlCQUFpQixDQUFDLEdBQUcsQ0FBQyxzQkFBUyxFQUFFLEVBQUUsc0JBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUNsRSxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0= |
@@ -1,5 +0,6 @@ | ||
export declare function computeHash(cwd: string): Promise<string>; | ||
export declare function rehydrateFromCache(cwd: string): Promise<void>; | ||
import { Logger } from "backfill-generic-logger"; | ||
export declare function computeHash(cwd: string, logger: Logger): Promise<string>; | ||
export declare function rehydrateFromCache(cwd: string, logger: Logger): Promise<void>; | ||
export declare function isCacheHit(cwd: string): Promise<boolean>; | ||
export declare function populateCache(cwd: string): Promise<void>; | ||
export declare function populateCache(cwd: string, logger: Logger): Promise<void>; | ||
//# sourceMappingURL=api.d.ts.map |
@@ -13,6 +13,6 @@ "use strict"; | ||
*/ | ||
async function computeHash(cwd) { | ||
async function computeHash(cwd, logger) { | ||
const config = backfill_config_1.createConfig(cwd); | ||
const { outputGlob, packageRoot } = config; | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
const hash = await hasher.createPackageHash(); | ||
@@ -25,7 +25,7 @@ return hash; | ||
*/ | ||
async function rehydrateFromCache(cwd) { | ||
async function rehydrateFromCache(cwd, logger) { | ||
const config = backfill_config_1.createConfig(cwd); | ||
const { cacheStorageConfig, internalCacheFolder, outputGlob, packageRoot } = config; | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, path.join(cwd, internalCacheFolder)); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, path.join(cwd, internalCacheFolder), logger, cwd); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
const hash = await hasher.createPackageHash(); | ||
@@ -57,7 +57,7 @@ const fetch = await cacheStorage.fetch(hash); | ||
*/ | ||
async function populateCache(cwd) { | ||
async function populateCache(cwd, logger) { | ||
const config = backfill_config_1.createConfig(cwd); | ||
const { cacheStorageConfig, internalCacheFolder, outputGlob, packageRoot } = config; | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, path.join(cwd, internalCacheFolder), cwd); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, path.join(cwd, internalCacheFolder), logger, cwd); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
const hash = await hasher.createPackageHash(); | ||
@@ -67,2 +67,2 @@ await cacheStorage.put(hash, outputGlob); | ||
exports.populateCache = populateCache; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHFEQUF5QztBQUN6QyxxREFBK0M7QUFDL0MsbURBQXlEO0FBQ3pELHlCQUF5QjtBQUV6QixvQ0FBb0M7QUFDcEMsNkJBQTZCO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QUUsQ0FBQztJQUM5QyxNQUFNLFlBQVksQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxDQUFDO0FBQzNDLENBQUM7QUFsQkQsc0NBa0JDIn0= |
@@ -30,3 +30,3 @@ "use strict"; | ||
.then(() => { | ||
backfill_logger_1.logger.setTime("buildTime", "buildCommand:run"); | ||
backfill_logger_1.logger.setTime("buildTime", "buildCommand:run", backfill_logger_1.logger); | ||
}) | ||
@@ -43,2 +43,2 @@ // Catch to pretty-print the command that failed and re-throw | ||
exports.createBuildCommand = createBuildCommand; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZFJ1bm5lci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jb21tYW5kUnVubmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsK0JBQStCO0FBQy9CLCtCQUErQjtBQUMvQixnQ0FBZ0M7QUFDaEMscURBQXlDO0FBS3pDLFNBQWdCLGtCQUFrQjtJQUNoQyxPQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUN6QyxDQUFDO0FBRkQsZ0RBRUM7QUFFRCxTQUFnQixrQkFBa0IsQ0FDaEMsWUFBc0IsRUFDdEIsV0FBb0IsRUFDcEIsVUFBb0I7SUFFcEIsT0FBTyxLQUFLLElBQWtDLEVBQUU7UUFDOUMsTUFBTSxrQkFBa0IsR0FBRyxZQUFZLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBRWxELElBQUksQ0FBQyxrQkFBa0IsRUFBRTtZQUN2QixNQUFNLElBQUksS0FBSyxDQUFDLHNCQUFzQixDQUFDLENBQUM7U0FDekM7UUFFRCxJQUFJLFdBQVcsRUFBRTtZQUNmLE1BQU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QU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQ25DLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxrQkFBa0IsRUFBRTtZQUN2QyxLQUFLLEVBQUUsSUFBSTtZQUNYLEdBQUcsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsS0FBSyxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsS0FBSyxFQUFFLFNBQVMsRUFBRSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUM7U0FDakUsQ0FBQyxDQUFDO1FBRUgsT0FBTyxDQUNMLE1BQU07WUFDSiwyQ0FBMkM7YUFDMUMsSUFBSSxDQUFDLEdBQUcsRUFBRTtZQUNULHdCQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxrQkFBa0IsRUFBRSx3QkFBTSxDQUFDLENBQUM7UUFDMUQsQ0FBQyxDQUFDO1lBQ0YsNkRBQTZEO2FBQzVELEtBQUssQ0FBQyxHQUFHLENBQUMsRUFBRTtZQUNYLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLEtBQUssTUFBTSxFQUFFO2dCQUNuQyx3QkFBTSxDQUFDLEtBQUssQ0FBQywwQkFBMEIsa0JBQWtCLEdBQUcsQ0FBQyxDQUFDO2FBQy9EO1lBQ0QsTUFBTSxHQUFHLENBQUM7UUFDWixDQUFDLENBQUMsQ0FDTCxDQUFDO0lBQ0osQ0FBQyxDQUFDO0FBQ0osQ0FBQztBQXZDRCxnREF1Q0MifQ== |
@@ -17,5 +17,5 @@ "use strict"; | ||
const { cacheStorageConfig, outputGlob, name, mode, logFolder, producePerformanceLogs, validateOutput } = config; | ||
backfill_logger_1.logger.setName(name); | ||
backfill_logger_1.logger.setMode(mode); | ||
backfill_logger_1.logger.setCacheProvider(cacheStorageConfig.provider); | ||
backfill_logger_1.logger.setName(name, backfill_logger_1.logger); | ||
backfill_logger_1.logger.setMode(mode, backfill_logger_1.logger); | ||
backfill_logger_1.logger.setCacheProvider(cacheStorageConfig.provider, backfill_logger_1.logger); | ||
const createPackageHash = async () => await hasher.createPackageHash(); | ||
@@ -68,6 +68,6 @@ const fetch = async (hash) => await cacheStorage.fetch(hash); | ||
const hashOfOutput = await hasher.hashOfOutput(); | ||
backfill_logger_1.logger.setHashOfOutput(hashOfOutput); | ||
backfill_logger_1.logger.setHashOfOutput(hashOfOutput, backfill_logger_1.logger); | ||
} | ||
if (producePerformanceLogs) { | ||
await backfill_logger_1.logger.toFile(logFolder); | ||
await backfill_logger_1.logger.toFile(logFolder, backfill_logger_1.logger); | ||
} | ||
@@ -78,3 +78,3 @@ } | ||
try { | ||
const config = backfill_config_1.createConfig(); | ||
const config = backfill_config_1.createConfig(process.cwd()); | ||
const { cacheStorageConfig, clearOutput, hashGlobs, internalCacheFolder, logFolder, logLevel, outputGlob, packageRoot } = config; | ||
@@ -95,4 +95,4 @@ if (logLevel) { | ||
const buildCommand = commandRunner_1.createBuildCommand(argv["_"], clearOutput, outputGlob); | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, internalCacheFolder); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob }, commandRunner_1.getRawBuildCommand()); | ||
const cacheStorage = backfill_cache_1.getCacheStorageProvider(cacheStorageConfig, internalCacheFolder, backfill_logger_1.logger, process.cwd()); | ||
const hasher = new backfill_hasher_1.Hasher({ packageRoot, outputGlob, logger: backfill_logger_1.logger }, commandRunner_1.getRawBuildCommand()); | ||
if (argv["audit"]) { | ||
@@ -112,2 +112,2 @@ audit_1.initializeWatcher(packageRoot, internalCacheFolder, logFolder, outputGlob, hashGlobs); | ||
exports.main = main; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUF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-alpha.0", | ||
"version": "3.0.5-alpha.0", | ||
"main": "lib/index.js", | ||
@@ -24,6 +24,7 @@ "bin": { | ||
"anymatch": "^3.0.3", | ||
"backfill-cache": "^3.0.4-alpha.0", | ||
"backfill-config": "^3.0.3-alpha.0", | ||
"backfill-hasher": "^3.0.4-alpha.0", | ||
"backfill-logger": "^3.0.3-alpha.0", | ||
"backfill-cache": "^3.0.5-alpha.0", | ||
"backfill-config": "^3.0.5-alpha.0", | ||
"backfill-generic-logger": "^3.0.5-alpha.0", | ||
"backfill-hasher": "^3.0.5-alpha.0", | ||
"backfill-logger": "^3.0.5-alpha.0", | ||
"backfill-utils-dotenv": "^3.0.1-alpha.0", | ||
@@ -41,3 +42,3 @@ "chokidar": "^3.2.1", | ||
"@types/yargs": "^15.0.1", | ||
"backfill-utils-test": "^3.0.1-alpha.0", | ||
"backfill-utils-test": "^3.0.5-alpha.0", | ||
"backfill-utils-tsconfig": "^2.0.3", | ||
@@ -50,3 +51,3 @@ "find-up": "^4.0.0", | ||
}, | ||
"gitHead": "2fd97508d44b640c445e2766b2226a195beb8386" | ||
"gitHead": "ec218e9ecf7b2553af7701ae1ee8e84753b1b35d" | ||
} |
@@ -7,2 +7,3 @@ import { anyString, anything, spy, verify, resetCalls } from "ts-mockito"; | ||
import { createConfig } from "backfill-config"; | ||
import { logger } from "backfill-logger"; | ||
@@ -17,3 +18,3 @@ import { backfill } from "../index"; | ||
const config = createConfig(); | ||
const config = createConfig(process.cwd()); | ||
const { | ||
@@ -30,3 +31,5 @@ cacheStorageConfig, | ||
cacheStorageConfig, | ||
internalCacheFolder | ||
internalCacheFolder, | ||
logger, | ||
process.cwd() | ||
); | ||
@@ -39,3 +42,6 @@ const buildCommandRaw = "npm run compile"; | ||
); | ||
const hasher = new Hasher({ packageRoot, outputGlob }, buildCommandRaw); | ||
const hasher = new Hasher( | ||
{ packageRoot, outputGlob, logger }, | ||
buildCommandRaw | ||
); | ||
@@ -42,0 +48,0 @@ // Spy |
import { Hasher } from "backfill-hasher"; | ||
import { createConfig } from "backfill-config"; | ||
import { getCacheStorageProvider } from "backfill-cache"; | ||
import { Logger } from "backfill-generic-logger"; | ||
import * as fs from "fs"; | ||
@@ -14,7 +15,8 @@ | ||
export async function computeHash( | ||
cwd: string = process.cwd() | ||
cwd: string, | ||
logger: Logger | ||
): Promise<string> { | ||
const config = createConfig(cwd); | ||
const { outputGlob, packageRoot } = config; | ||
const hasher = new Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const hasher = new Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
const hash = await hasher.createPackageHash(); | ||
@@ -28,3 +30,4 @@ return hash; | ||
export async function rehydrateFromCache( | ||
cwd: string = process.cwd() | ||
cwd: string, | ||
logger: Logger | ||
): Promise<void> { | ||
@@ -40,5 +43,7 @@ const config = createConfig(cwd); | ||
cacheStorageConfig, | ||
path.join(cwd, internalCacheFolder) | ||
path.join(cwd, internalCacheFolder), | ||
logger, | ||
cwd | ||
); | ||
const hasher = new Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const hasher = new Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
const hash = await hasher.createPackageHash(); | ||
@@ -59,5 +64,3 @@ const fetch = await cacheStorage.fetch(hash); | ||
*/ | ||
export async function isCacheHit( | ||
cwd: string = process.cwd() | ||
): Promise<boolean> { | ||
export async function isCacheHit(cwd: string): Promise<boolean> { | ||
try { | ||
@@ -78,3 +81,3 @@ fs.statSync(path.join(cwd, "node_modules", "cache-hit.json")); | ||
*/ | ||
export async function populateCache(cwd: string = process.cwd()) { | ||
export async function populateCache(cwd: string, logger: Logger) { | ||
const config = createConfig(cwd); | ||
@@ -90,5 +93,6 @@ const { | ||
path.join(cwd, internalCacheFolder), | ||
logger, | ||
cwd | ||
); | ||
const hasher = new Hasher({ packageRoot, outputGlob }, "ci-pipeline"); | ||
const hasher = new Hasher({ packageRoot, outputGlob, logger }, "ci-pipeline"); | ||
@@ -95,0 +99,0 @@ const hash = await hasher.createPackageHash(); |
@@ -41,3 +41,3 @@ import * as execa from "execa"; | ||
.then(() => { | ||
logger.setTime("buildTime", "buildCommand:run"); | ||
logger.setTime("buildTime", "buildCommand:run", logger); | ||
}) | ||
@@ -44,0 +44,0 @@ // Catch to pretty-print the command that failed and re-throw |
@@ -37,5 +37,5 @@ import * as yargs from "yargs"; | ||
logger.setName(name); | ||
logger.setMode(mode); | ||
logger.setCacheProvider(cacheStorageConfig.provider); | ||
logger.setName(name, logger); | ||
logger.setMode(mode, logger); | ||
logger.setCacheProvider(cacheStorageConfig.provider, logger); | ||
@@ -97,7 +97,7 @@ const createPackageHash = async () => await hasher.createPackageHash(); | ||
const hashOfOutput = await hasher.hashOfOutput(); | ||
logger.setHashOfOutput(hashOfOutput); | ||
logger.setHashOfOutput(hashOfOutput, logger); | ||
} | ||
if (producePerformanceLogs) { | ||
await logger.toFile(logFolder); | ||
await logger.toFile(logFolder, logger); | ||
} | ||
@@ -108,3 +108,3 @@ } | ||
try { | ||
const config = createConfig(); | ||
const config = createConfig(process.cwd()); | ||
const { | ||
@@ -141,7 +141,9 @@ cacheStorageConfig, | ||
cacheStorageConfig, | ||
internalCacheFolder | ||
internalCacheFolder, | ||
logger, | ||
process.cwd() | ||
); | ||
const hasher = new Hasher( | ||
{ packageRoot, outputGlob }, | ||
{ packageRoot, outputGlob, logger }, | ||
getRawBuildCommand() | ||
@@ -148,0 +150,0 @@ ); |
@@ -8,2 +8,3 @@ { | ||
{ "path": "../config" }, | ||
{ "path": "../generic-logger" }, | ||
{ "path": "../hasher" }, | ||
@@ -10,0 +11,0 @@ { "path": "../logger" }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
242951
1041
12
+ Addedbackfill-cache@3.0.5-alpha.0(transitive)
+ Addedbackfill-config@3.0.5-alpha.0(transitive)
+ Addedbackfill-generic-logger@3.0.5-alpha.0(transitive)
+ Addedbackfill-hasher@3.0.5-alpha.0(transitive)
+ Addedbackfill-logger@3.0.5-alpha.0(transitive)
+ Addedbackfill-performance-logger@3.0.5-alpha.0(transitive)
- Removedbackfill-cache@3.0.4-alpha.0(transitive)
- Removedbackfill-config@3.0.3-alpha.0(transitive)
- Removedbackfill-generic-logger@3.0.1-alpha.0(transitive)
- Removedbackfill-hasher@3.0.4-api.0(transitive)
- Removedbackfill-logger@3.0.3-alpha.0(transitive)
- Removedbackfill-performance-logger@3.0.3-alpha.0(transitive)