Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch from using md5 to sha1 #170

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
...computedSwcOptions,
module: {
...computedSwcOptions.module,
type: (jestOptions.supportsStaticESM ? 'es6' : 'commonjs' as any)

Check warning on line 37 in index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type
},
filename
})
Expand All @@ -47,7 +47,7 @@
module: {
...computedSwcOptions.module,
// async transform is always ESM
type: ('es6' as any)

Check warning on line 50 in index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type
},
filename
})
Expand All @@ -61,7 +61,7 @@
const options: TransformOptions = typeof rest[0] === 'string' ? rest[1] : rest[0]

return crypto
.createHash('md5')
.createHash('sha1')
.update(baseCacheKey)
.update('\0', 'utf8')
.update(JSON.stringify({ supportsStaticESM: options.supportsStaticESM }))
Expand Down Expand Up @@ -129,7 +129,7 @@
return computedSwcOptions
}

function insertInstrumentationOptions(jestOptions: TransformOptions<unknown>, canInstrument: boolean, swcTransformOpts: Options, instrumentOptions?: any) {

Check warning on line 132 in index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type
const shouldInstrument = jestOptions.instrument && canInstrument

if (!shouldInstrument) {
Expand All @@ -155,7 +155,7 @@
swcTransformOpts.jsc.experimental.plugins?.push(['swc-plugin-coverage-instrument', instrumentOptions ?? {}])
}

function set(obj: any, path: string, value: any) {

Check warning on line 158 in index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type

Check warning on line 158 in index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Unexpected any. Specify a different type
let o = obj
const parents = path.split('.')
const key = parents.pop() as string
Expand Down
154 changes: 136 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@swc/core": "*"
},
"dependencies": {
"@jest/create-cache-key-function": "^27.4.2",
"@jest/create-cache-key-function": "^29.7.0",
"jsonc-parser": "^3.2.0"
},
"devDependencies": {
Expand Down
Loading