cli: removed unused @sucrase/jest-plugin dependency

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-01 17:53:47 +01:00
parent f382f2d324
commit 43b2b9c791
4 changed files with 6 additions and 16 deletions
@@ -17,7 +17,6 @@
const { createHash } = require('crypto');
const { transform } = require('sucrase');
const sucrasePkg = require('sucrase/package.json');
const sucrasePluginPkg = require('@sucrase/jest-plugin/package.json');
const ESM_REGEX = /\b(?:import|export)\b/;
@@ -70,15 +69,12 @@ function createTransformer(config) {
return { code: source };
};
// TODO: contribute something like this to @sucrase/jest-plugin
const getCacheKey = sourceText => {
return createHash('md5')
.update(sourceText)
.update(Buffer.alloc(1))
.update(sucrasePkg.version)
.update(Buffer.alloc(1))
.update(sucrasePluginPkg.version)
.update(Buffer.alloc(1))
.update(JSON.stringify(config))
.update(Buffer.alloc(1))
.update('1') // increment whenever the transform logic in this file changes