Skip to content
Open

new #131

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
27 changes: 27 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changes (2026-02-28)

## What changed
- **Publish configs**: Added `src/configs/**` to `package.json:files` so ESLint/TS/Prettier presets ship with the package.
- **Security cleanup**: Replaced transitive `npm` CLI dependency (brought in by `@cardano-sdk/*`) with a minimal stub under `stubs/npm`, declared via `package.json` overrides. This removes the vulnerable minimatch/tar chain reported by `npm audit`.

## Files touched
- `package.json` -- publish files, overrides pointing `npm` to `stubs/npm`.
- `package-lock.json` -- refreshed after overrides.
- `stubs/npm/package.json`, `stubs/npm/index.js` -- safe stub that exports `{}`.

## Commands run
- `npm install` (before/after overrides)
- `npm run build:sdk`
- `npm audit`, `npm audit --production`
- `npm pack --dry-run`

## Current status
- `npm audit` reports **0 vulnerabilities**.
- `npm run build:sdk` succeeds; dist artifacts generated.

## Rationale / caveats
- `@cardano-sdk/*` list `npm` as a dependency but do not require it at runtime; the stub keeps runtime behavior intact while eliminating vulnerable bundled deps.
- If a future task needs the real npm CLI from those packages (unlikely), remove the `npm` override and reinstall; expect audit warnings to return.

## Next steps
- If you plan to publish: `npm run build:sdk` then `npm pack --dry-run` to confirm contents include `dist/` and `src/configs/**`.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ Check [https://docs.utxos.dev/sponsor](https://docs.utxos.dev/sponsor) for more
- **Cardano**: Mainnet (Preview, Preprod, Mainnet)
- **Spark**: Mainnet and Regtest

## Repository notes (local changes)

- Config presets are now published with the package (`src/configs/**` is included in `package.json:files`) so consumers can import the ESLint/TypeScript/Prettier configs directly.
- Security hardening: `package.json` overrides point `npm` to a minimal stub in `stubs/npm`. This removes the vulnerable bundled npm CLI pulled in by `@cardano-sdk/*` dependencies while leaving runtime behavior unchanged. If you need the real npm CLI for tooling inside those packages, delete the override and rerun `npm install` (audit warnings will return).

## Links

- [Documentation](https://docs.utxos.dev/)
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"react-native": "./dist/index.native.js",
"browser": "./dist/index.js",
"files": [
"dist/**"
"dist/**",
"src/configs/**"
],
"scripts": {
"build:sdk": "tsup",
Expand Down Expand Up @@ -72,6 +73,9 @@
"base32-encoding": "^1.0.0",
"uuid": "^11.1.0"
},
"overrides": {
"npm": "file:stubs/npm"
},
"peerDependencies": {
"react-native-quick-crypto": ">=0.7.0",
"@react-native-async-storage/async-storage": ">=1.19.0",
Expand Down
4 changes: 4 additions & 0 deletions stubs/npm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Minimal stub: @cardano-sdk packages declare a dependency on "npm"
// but do not require it at runtime. Returning an empty object avoids
// pulling the real npm CLI (and its vulnerable transitive deps).
module.exports = {};
7 changes: 7 additions & 0 deletions stubs/npm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "npm",
"version": "11.11.0-stub",
"description": "Stubbed npm package to satisfy @cardano-sdk dependencies without pulling vulnerable npm CLI tree.",
"main": "index.js",
"license": "MIT"
}