refactor: remove @pnpm/crypto.polyfill (#9867)

This commit is contained in:
Zoltan Kochan authored and GitHub committed 2025-08-15 16:14:17 +02:00
1 parent 60badc5ca6
commit c4272201b4
17 files changed
+107 -245

No files matched your search

-1
View File
@@ -33,7 +33,6 @@
"compile": "tsc --build && pnpm run lint --fix"
},
"dependencies": {
"@pnpm/crypto.polyfill": "workspace:*",
"@pnpm/graceful-fs": "workspace:*",
"ssri": "catalog:"
},
+1 -1
View File
@@ -1,4 +1,4 @@
import * as crypto from '@pnpm/crypto.polyfill'
import crypto from 'crypto'
import fs from 'fs'
import gfs from '@pnpm/graceful-fs'
import ssri from 'ssri'
-3
View File
@@ -14,9 +14,6 @@
},
{
"path": "../../fs/graceful-fs"
},
{
"path": "../polyfill"
}
]
}
-17
View File
@@ -1,17 +0,0 @@
# @pnpm/crypto.polyfill
## 1000.1.0
### Minor Changes
- 58d8597: Fix the type of `hash`. It was `any` because `crypto.hash` not being declared would fall back to `any`.
## 1.0.0
### Major Changes
- 222d10a: Initial release.
### Patch Changes
- 222d10a: Use `crypto.hash`, when available, for improved performance [#8629](https://github.com/pnpm/pnpm/pull/8629).
-15
View File
@@ -1,15 +0,0 @@
# @pnpm/crypto.polyfill
> Polyfill for functions in the crypto library
[![npm version](https://img.shields.io/npm/v/@pnpm/crypto.polyfill.svg)](https://www.npmjs.com/package/@pnpm/crypto.polyfill)
## Installation
```sh
pnpm add @pnpm/crypto.polyfill
```
## License
MIT
-42
View File
@@ -1,42 +0,0 @@
{
"name": "@pnpm/crypto.polyfill",
"version": "1000.1.0",
"description": "Polyfill for functions in the crypto library",
"keywords": [
"pnpm",
"pnpm10",
"crypto"
],
"license": "MIT",
"funding": "https://opencollective.com/pnpm",
"repository": "https://github.com/pnpm/pnpm/blob/main/crypto/polyfill",
"homepage": "https://github.com/pnpm/pnpm/blob/main/crypto/polyfill#readme",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"type": "commonjs",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"files": [
"lib",
"!*.map"
],
"scripts": {
"lint": "eslint \"src/**/*.ts\"",
"test": "pnpm run compile",
"prepublishOnly": "pnpm run compile",
"compile": "tsc --build && pnpm run lint --fix"
},
"devDependencies": {
"@pnpm/crypto.polyfill": "workspace:*"
},
"engines": {
"node": ">=20.19"
},
"jest": {
"preset": "@pnpm/jest-config"
}
}
-8
View File
@@ -1,8 +0,0 @@
import crypto from 'crypto'
export type Hash = (algorithm: string, data: crypto.BinaryLike, outputEncoding: crypto.BinaryToTextEncoding) => string
export const hash: Hash =
// @ts-expect-error -- crypto.hash is supported in Node 21.7.0+, 20.12.0+
crypto.hash ??
((algorithm, data, outputEncoding) => crypto.createHash(algorithm).update(data).digest(outputEncoding))
-12
View File
@@ -1,12 +0,0 @@
{
"extends": "@pnpm/tsconfig",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"include": [
"src/**/*.ts",
"../../__typings__/**/*.d.ts"
],
"references": []
}
-8
View File
@@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"test/**/*.ts",
"../../__typings__/**/*.d.ts"
]
}