Stable babel transformation cache key
Summary: This diff makes babel transformation cache key stable. With the previous approach it was changed on each CI build so it was not possible to persist cache between builds. Now it is computed from the transformation package content after each build. Because of that it is equal for every CI build while Babel transformations unchanged and so we could use same cache on different Sandcastle agents. In addition to that, it makes it possible to specify directory for Metro cache so we can save/restore it in CI builds. Reviewed By: mweststrate Differential Revision: D26877989 fbshipit-source-id: 7cb04a177f86e61986585e5a74d9c7396ddddc18
This commit is contained in:
committed by
Facebook GitHub Bot
parent
baeb8ba5be
commit
c065760d15
41
desktop/scripts/compute-package-checksum.ts
Normal file
41
desktop/scripts/compute-package-checksum.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {computePackageChecksum} from 'flipper-pkg-lib';
|
||||
import yargs from 'yargs';
|
||||
|
||||
const argv = yargs
|
||||
.usage('yarn compute-package-checksum [args]')
|
||||
.version(false)
|
||||
.options({
|
||||
dir: {
|
||||
description: 'Package root directory',
|
||||
type: 'string',
|
||||
demandOption: true,
|
||||
alias: 'd',
|
||||
},
|
||||
out: {
|
||||
description:
|
||||
'File relative to the package root directory where the computed checksum should be saved, e.g. "lib/checksum.txt"',
|
||||
type: 'string',
|
||||
alias: 'o',
|
||||
},
|
||||
})
|
||||
.help()
|
||||
.strict()
|
||||
.parse(process.argv.slice(1));
|
||||
|
||||
computePackageChecksum(argv.dir, argv.out)
|
||||
.then(() => {
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user