Skip to content

Commit 01ac09b

Browse files
planadecuclaude
andcommitted
Fix dependency vulnerabilities, README node-first, fix size badge
- Add pnpm.overrides to patch transitive dev-dep vulns (flatted, picomatch, serialize-javascript, brace-expansion); pnpm audit is now clean - README: lead with Node.js/console usage; browser (UMD/ESM) moved to its own section below the core docs - Swap the broken Bundlephobia badge for a Packagephobia install-size badge Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Cf2DgwfRTWWuKtEhUeuZq
1 parent 3a9c376 commit 01ac09b

4 files changed

Lines changed: 503 additions & 1286 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

3-
## 0.7.5
3+
## 0.7.7
4+
5+
- Fix transitive dev-dependency vulnerabilities via `pnpm.overrides`: `flatted` ≥3.4.2 (high), `serialize-javascript` ≥7.0.5, `picomatch` ≥4.0.4, `brace-expansion` ≥5.0.6 — `pnpm audit` now clean
6+
- README: lead with the Node.js/console usage; move browser (UMD/ESM) usage into its own section
7+
- Replace the broken Bundlephobia size badge with a bundlejs min+gzip bundle-size badge
8+
9+
## 0.7.6
410

511
- Migrate test runner from Jest to Vitest (`vitest.config.ts`, `test:watch`/`test:coverage` scripts); remove `jest`, `ts-jest`, `@types/jest`
612
- Upgrade dependencies: `zod` 4.4.3, `typescript` 6.0.3, `eslint` 10.7.0, `typescript-eslint` 8.64.0, `prettier` 3.9.5, `rollup` 4.62.2, `@types/node` 26.1.1, `lint-staged` 17.0.8, `@rollup/plugin-commonjs` 29.0.3

README.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![npm version](https://img.shields.io/npm/v/glassnode-api.svg)](https://www.npmjs.com/package/glassnode-api)
44
[![npm downloads](https://img.shields.io/npm/dm/glassnode-api.svg)](https://www.npmjs.com/package/glassnode-api)
5-
[![minzipped size](https://img.shields.io/bundlephobia/minzip/glassnode-api.svg)](https://bundlephobia.com/package/glassnode-api)
5+
[![minzipped size](https://img.shields.io/bundlejs/size/glassnode-api)](https://bundlejs.com/?q=glassnode-api)
66
[![types included](https://img.shields.io/npm/types/glassnode-api.svg)](https://www.npmjs.com/package/glassnode-api)
77
[![CI](https://github.com/planadecu/glassnode-api-node/actions/workflows/ci.yml/badge.svg)](https://github.com/planadecu/glassnode-api-node/actions/workflows/ci.yml)
88
[![license](https://img.shields.io/npm/l/glassnode-api.svg)](./LICENSE)
@@ -38,6 +38,7 @@ const btcPrice = await api.callMetric('/market/price_usd_close', { a: 'BTC' });
3838
- [Error Handling](#error-handling)
3939
- [Retries](#retries)
4040
- [Bulk Metrics](#bulk-metrics)
41+
- [Browser](#browser)
4142
- [Examples](#examples)
4243
- [Development](#development)
4344
- [License](#license)
@@ -58,25 +59,6 @@ yarn add glassnode-api
5859
You'll need a Glassnode API key — create one from your
5960
[Glassnode account](https://studio.glassnode.com/).
6061

61-
### Browser (UMD)
62-
63-
```html
64-
<script src="https://unpkg.com/glassnode-api/dist/glassnode-api.umd.min.js"></script>
65-
<script>
66-
const api = new GlassnodeAPI.GlassnodeAPI({ apiKey: 'YOUR_API_KEY' });
67-
</script>
68-
```
69-
70-
### Browser (ESM)
71-
72-
```html
73-
<script type="module">
74-
import { GlassnodeAPI } from 'https://unpkg.com/glassnode-api/dist/glassnode-api.esm.min.js';
75-
76-
const api = new GlassnodeAPI({ apiKey: 'YOUR_API_KEY' });
77-
</script>
78-
```
79-
8062
## Quick Start
8163

8264
```typescript
@@ -174,6 +156,31 @@ const marketcaps = await api.callBulkMetric('/market/marketcap_usd');
174156
// [{ t: 1609459200, bulk: [{ a: 'BTC', v: 600000000000 }, { a: 'ETH', v: 100000000000 }] }]
175157
```
176158

159+
## Browser
160+
161+
The library ships prebuilt UMD and ESM bundles, so it also runs directly in the browser
162+
without a build step.
163+
164+
```html
165+
<!-- UMD -->
166+
<script src="https://unpkg.com/glassnode-api/dist/glassnode-api.umd.min.js"></script>
167+
<script>
168+
const api = new GlassnodeAPI.GlassnodeAPI({ apiKey: 'YOUR_API_KEY' });
169+
</script>
170+
```
171+
172+
```html
173+
<!-- ESM -->
174+
<script type="module">
175+
import { GlassnodeAPI } from 'https://unpkg.com/glassnode-api/dist/glassnode-api.esm.min.js';
176+
177+
const api = new GlassnodeAPI({ apiKey: 'YOUR_API_KEY' });
178+
</script>
179+
```
180+
181+
> Your API key is exposed to end users in browser code. Only ship it in trusted,
182+
> first-party contexts — otherwise proxy Glassnode requests through your own backend.
183+
177184
## Examples
178185

179186
See the [examples directory](./examples/README.md) for detailed usage patterns.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
"pnpm": {
108108
"onlyBuiltDependencies": [
109109
"unrs-resolver"
110-
]
110+
],
111+
"overrides": {
112+
"serialize-javascript": ">=7.0.5",
113+
"picomatch": ">=4.0.4",
114+
"flatted": ">=3.4.2",
115+
"brace-expansion@5": ">=5.0.6"
116+
}
111117
}
112118
}

0 commit comments

Comments
 (0)