diff --git a/.gitignore b/.gitignore index cb71707..8a22332 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ dist *.tsbuildinfo *.tgz coverage +.pack-check # Kubo repos (local dev + integration tests) .ipfs diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..fe4bd7b --- /dev/null +++ b/.npmignore @@ -0,0 +1,20 @@ +packages/ +examples/ +tests/ +scripts/ +docs/ +.github/ +coverage/ +node_modules/ + +*.ts +!dist/** +tsconfig*.json +vitest.config.ts +vitest.setup*.ts +tsup.config.ts + +.gitignore +.editorconfig +.prettierrc* +.eslintrc* diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..af10b83 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +## 1.0.1 — 2026-07-06 + +### Fixed + +- README and package metadata: correct repository links to [IPFS-Meshkit/meshkit0](https://github.com/IPFS-Meshkit/meshkit0) +- Expanded README with install, usage examples, API overview, and CommonJS support + +## 1.0.0 — 2026-06-18 + +### Added + +- **`@ipfs-meshkit/meshkit` v1.0.0** — single npm package with root `dist/` (ESM + CJS + TypeScript) +- Bundles core, node, and meshkit into one install — `npm install @ipfs-meshkit/meshkit` +- Portable `./.ipfs` repo for server migration +- Unit test suite with coverage; integration tests for persistence, IPNS, attach (local, requires Kubo) + +### Not included in 1.0.0 + +- Separate `@ipfs-meshkit/core` / `@ipfs-meshkit/node` npm packages (code is bundled into meshkit) +- `@ipfs-meshkit/react-native` and `@ipfs-meshkit/capacitor` remain private in the monorepo diff --git a/README.md b/README.md index a1f3938..8118672 100644 --- a/README.md +++ b/README.md @@ -1,218 +1,184 @@ # IPFS Meshkit0 -IPFS Meshkit0 is a universal SDK for decentralized storage on Node.js, React Native, Flutter, and Capacitor. Install **`@ipfs-meshkit/meshkit`** for Agentic and Web3 AI (ERC-8004) ecosystem with storage APIs, optional local Kubo startup, and failover, without wiring up Kubo RPC yourself. +**@ipfs-meshkit/meshkit** is a Node.js SDK for [Kubo](https://docs.ipfs.tech/) (IPFS). Upload, retrieve, and pin content over Kubo’s HTTP RPC, with optional local daemon startup, IPNS, and multi-node failover. -## Why Meshkit on Kubo? +[![test](https://github.com/IPFS-Meshkit/meshkit0/actions/workflows/test.yml/badge.svg)](https://github.com/IPFS-Meshkit/meshkit0/actions/workflows/test.yml) +[![npm version](https://img.shields.io/npm/v/@ipfs-meshkit/meshkit.svg)](https://www.npmjs.com/package/@ipfs-meshkit/meshkit) +[![license](https://img.shields.io/npm/l/@ipfs-meshkit/meshkit.svg)](https://github.com/IPFS-Meshkit/meshkit0/blob/main/LICENSE) +[![node](https://img.shields.io/node/v/@ipfs-meshkit/meshkit.svg)](https://www.npmjs.com/package/@ipfs-meshkit/meshkit) -[Helia](https://github.com/ipfs/helia) embeds IPFS inside your app (Node.js or browser) as a JavaScript library. **IPFS Meshkit** takes a different approach: it is a TypeScript SDK on top of **Kubo** — you get `upload`, `retrieve`, and `pin` over Kubo’s HTTP RPC, with optional local daemon startup, failover, and platform adapters. +[![NPM](https://nodei.co/npm/@ipfs-meshkit/meshkit.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/@ipfs-meshkit/meshkit) -We built Meshkit because apps like invoice backup need **Kubo’s persistence and pinning** without wiring up `kubo-rpc-client`, node lifecycle, repo migration, and mobile/browser integration by hand. +## Install -| | **Helia** | **IPFS Meshkit (Kubo)** | -|---|-----------|-------------------------| -| **Model** | IPFS runs in-process in your app | App talks to a Kubo daemon via RPC | -| **API** | Compose `@helia/unixfs`, blockstores, libp2p | `upload`, `retrieve`, `pin` out of the box | -| **Persistence** | You choose and wire the datastore | Kubo repo on disk (default `./.ipfs`) | -| **Networking** | App joins libp2p directly | Kubo handles swarm, DHT, bitswap | -| **Node lifecycle** | Start/stop Helia in-process | `init({ localNode: true })`, graceful shutdown | -| **Multi-node** | Roll your own retry logic | Built-in health checks and failover | -| **Host migration** | Re-export blocks or re-provide CIDs | Copy `./.ipfs` + `listPins()` manifest | -| **Web / mobile** | Large bundles, polyfills, in-browser P2P | Kubo on a server; app uses Meshkit HTTP API | - -``` -Your app ──► @ipfs-meshkit/meshkit ──► Kubo (./.ipfs) - upload · retrieve · pin API :5001 · GW :8080 +```bash +npm install @ipfs-meshkit/meshkit ``` -Meshkit keeps **Kubo as the engine** and gives applications a single SDK for storage, node management, and deployment across Node.js, Capacitor, and React Native. +**Requirements:** Node.js **20+**. For `localNode: true`, install [Kubo](https://docs.ipfs.tech/install/) and ensure `ipfs` is on your `PATH`. -## Typical use case +## Quick start -A developer building an invoice app can: - -1. Store invoices in a local DB, **or** -2. Upload them to decentralized storage via Meshkit (`upload`, `retrieve`, `pin`) - -On Node.js, Meshkit can start a local Kubo daemon for you. On mobile, point at a Kubo node on your PC or VPS. +```typescript +import { init, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; -## Packages +const { meshkit, localNode } = await init({ localNode: true }); +setupGracefulShutdown(localNode); -| Package | Description | -|---------|-------------| -| [`@ipfs-meshkit/meshkit`](./packages/meshkit) | **Primary entry** — storage + local Kubo lifecycle (Node.js) | -| [`@ipfs-meshkit/core`](./packages/core) | Kubo RPC client with multi-node failover | -| [`@ipfs-meshkit/node`](./packages/node) | Start/stop a local Kubo daemon (`startIPFSNode`) | -| [`@ipfs-meshkit/capacitor`](./packages/capacitor) | Capacitor adapter for Ionic / hybrid apps | -| [`@ipfs-meshkit/react-native`](./packages/react-native) | React Native adapter (re-exports core + polyfill entry) | +const bytes = new TextEncoder().encode('hello'); +const cid = await meshkit.upload(bytes); +await meshkit.pin(cid); -## Prerequisites +const retrieved = await meshkit.retrieve(cid); +console.log(new TextDecoder().decode(retrieved)); // hello +``` -Install [Kubo](https://docs.ipfs.tech/install/) (`ipfs` on your PATH). Meshkit can spawn the daemon on Node.js; mobile apps still need a reachable Kubo endpoint (LAN IP or VPS). +`localNode: true` starts or attaches to Kubo on `http://127.0.0.1:5001` and stores data in `./.ipfs`. Add `.ipfs` to `.gitignore`. -## Development +## How it works -```bash -npm install -npm run build -npm test # unit tests (no Kubo) -npm run test:integration # build + E2E (requires Kubo) -npm run test:all # full suite +``` +Your app → init() → Kubo RPC (:5001) → ./.ipfs on disk + upload · retrieve · pin · IPNS ``` -See [docs/Testing.md](./docs/Testing.md). +1. **`init()`** — connect to one or more Kubo nodes; optionally spawn a local daemon. +2. **`meshkit`** — storage API with failover (`upload`, `retrieve`, `pin`, IPNS). +3. **`setupGracefulShutdown()`** — stop a managed Kubo cleanly on Ctrl+C / SIGTERM. ## Usage -```bash -npm install @ipfs-meshkit/meshkit -``` - -### Node.js — automatic local Kubo - -`localNode: true` stores pinned data in `./.ipfs` (relative to where you start the process). Add `.ipfs` to `.gitignore`. +### Local Kubo (recommended for Node.js) ```typescript -import { readFile, writeFile } from 'node:fs/promises'; +import { readFile } from 'node:fs/promises'; import { init, listPins, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; const { meshkit, localNode } = await init({ localNode: true }); +setupGracefulShutdown(localNode); -setupGracefulShutdown(localNode); // Ctrl+C flushes Kubo; ./.ipfs stays on disk - -const pdf = await readFile('./invoice.pdf'); -const cid = await meshkit.upload(pdf); +const file = await readFile('./document.pdf'); +const cid = await meshkit.upload(file); await meshkit.pin(cid); -console.log('repo:', localNode?.repo); -console.log('pins:', await listPins(meshkit.activeNodes[0]!)); - -const retrieved = await meshkit.retrieve(cid); -await writeFile('./invoice-copy.pdf', retrieved); -``` - -### Migrating servers (AWS → GCP) - -1. Stop the server gracefully (`setupGracefulShutdown` or `stopIPFSNode`) -2. Copy the `./.ipfs` directory (tar, EBS snapshot, S3, etc.) -3. Restore on the new host and start with the same repo path: - -```typescript -const { meshkit, localNode } = await init({ - localNode: { repo: './.ipfs', init: false }, -}); +const pins = await listPins(meshkit.activeNodes[0]!); +console.log('pinned:', pins.length); ``` -Use `listPins()` to export CIDs as a backup manifest for re-pinning. +### Remote Kubo only (no local spawn) -### Node.js — server bootstrap +Use when Kubo already runs on a server or LAN machine: ```typescript -import { init, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; +import { init } from '@ipfs-meshkit/meshkit'; -const { meshkit, localNode } = await init({ localNode: true }); -setupGracefulShutdown(localNode, { - onShutdown: async () => { /* close HTTP server, DB, etc. */ }, +const { meshkit } = await init({ + nodes: ['https://kubo.example.com:5001'], }); -// ... app.listen(3000) ... +const cid = await meshkit.upload(new Uint8Array([1, 2, 3])); ``` -`startIPFSNode` reuses an existing daemon on `127.0.0.1:5001` when one is already healthy. - -### Remote nodes + failover +### Local + backup nodes (failover) ```typescript import { init } from '@ipfs-meshkit/meshkit'; const { meshkit } = await init({ localNode: true, - nodes: [ - 'https://node2.yourinfra.com:5001', - 'https://node3.yourinfra.com:5001', - ], + nodes: ['https://backup.example.com:5001'], }); -console.log('Active nodes:', meshkit.activeNodes); +const backup = new TextEncoder().encode('failover example'); +await meshkit.upload(backup); ``` -Each `upload`, `retrieve`, and `pin` call tries nodes in priority order. If every node fails, a `MeshkitError` is thrown. - -### IPNS (mutable names) - -Use a **CID** when you want a permanent link to one exact version of content. Use **IPNS** when you need a **stable name** that can be updated to point at a newer CID (e.g. latest invoice bundle). - -| | **CID** | **IPNS** | -|---|---------|----------| -| **Address** | `/ipfs/Qm...` | `/ipns/Qm...` | -| **Mutability** | Immutable — new content = new CID | Mutable pointer — same name, new CID via `publishName` | -| **Analogy** | Direct file hash | DNS record pointing at current content | -| **Read access** | Public | Public (no key required to resolve) | -| **Write access** | Anyone can add content; pinning is separate | Only the node holding the **private key** can publish updates | +### IPNS (mutable pointer) ```typescript import { init, IPNS_TTL_FAST } from '@ipfs-meshkit/meshkit'; const { meshkit } = await init({ localNode: true }); -// One-time: create a stable signing identity -await meshkit.generateKey('invoice-latest'); +await meshkit.generateKey('latest'); +const contentBytes = new TextEncoder().encode('v1'); +const cid = await meshkit.upload(contentBytes); +await meshkit.pin(cid); // publishName does not pin — pin content you care about -// Publish v1 -const cid1 = await meshkit.upload(invoiceV1); -await meshkit.pin(cid1); -const { name } = await meshkit.publishName(cid1, { - key: 'invoice-latest', +const { name } = await meshkit.publishName(cid, { + key: 'latest', ttl: IPNS_TTL_FAST, }); -// Readers use the stable IPNS name (no key required) -const bytes = await meshkit.resolveAndRetrieve(`/ipns/${name}`); - -// Update to v2 — same IPNS name, new CID -const cid2 = await meshkit.upload(invoiceV2); -await meshkit.pin(cid2); -await meshkit.publishName(cid2, { key: 'invoice-latest', ttl: IPNS_TTL_FAST }); - -// Verify latest (nocache bypasses local cache after publish) -const path = await meshkit.resolveName(`/ipns/${name}`, { nocache: true }); +const latest = await meshkit.resolveAndRetrieve(`/ipns/${name}`); ``` -Gateway URL for browsers: `http://127.0.0.1:8080/ipns/${name}`. +### Server shutdown hook -**Operator notes:** +```typescript +import { init, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; -- `publishName` does **not** pin — always `pin(cid)` for content you publish. -- IPNS keys live in `./.ipfs/keystore` — copy the repo to migrate names (same as pins). -- **`ttl`** is a cache hint (upper bound on stale reads for cached resolvers), not a fixed global propagation delay. After updating a CID, expect eventual consistency (seconds to a few minutes). -- **Multi-node:** `publishName`, `generateKey`, and `listKeys` use the **primary node** (`activeNodes[0]`). `resolveName` and `resolveAndRetrieve` failover across healthy nodes. +const { meshkit, localNode } = await init({ localNode: true }); -### Low-level client +setupGracefulShutdown(localNode, { + onShutdown: async () => { + // close HTTP server, DB, etc. + }, +}); +``` -For a single node without failover, use `@ipfs-meshkit/core` directly: +### Low-level client (single node, no failover) ```typescript -import { createMeshkitClient } from '@ipfs-meshkit/core'; +import { createMeshkitClient } from '@ipfs-meshkit/meshkit'; const client = createMeshkitClient({ apiUrl: 'http://127.0.0.1:5001' }); -const cid = await client.upload(await readFile('./invoice.pdf')); +const cid = await client.upload(new Uint8Array([1, 2, 3])); ``` -### React Native +### CommonJS -```bash -npm install @ipfs-meshkit/react-native react-native-get-random-values \ - react-native-url-polyfill react-native-fetch-api web-streams-polyfill fast-text-encoding +```javascript +const { init } = require('@ipfs-meshkit/meshkit'); + +(async () => { + const { meshkit } = await init({ nodes: ['http://127.0.0.1:5001'] }); + console.log(await meshkit.upload(Buffer.from('hello'))); +})(); ``` -```typescript -import '@ipfs-meshkit/react-native/polyfills'; -import { Meshkit } from '@ipfs-meshkit/react-native'; +## API overview -const mk = await Meshkit.init({ - nodes: ['http://192.168.1.42:5001'], -}); +| Export | Purpose | +|--------|---------| +| `init()` | Main entry — connect (+ optional `localNode`) | +| `meshkit.upload` / `retrieve` / `pin` | Storage with failover | +| `meshkit.publishName` / `resolveName` / `resolveAndRetrieve` | IPNS | +| `meshkit.generateKey` / `listKeys` | IPNS keystore | +| `setupGracefulShutdown` | Graceful Kubo shutdown | +| `listPins` | List pinned CIDs (migration / backups) | +| `createMeshkitClient` | Single-node RPC client | +| `startIPFSNode` / `stopIPFSNode` | Low-level daemon control | -const cid = await mk.upload(new Uint8Array([1, 2, 3])); -``` +TypeScript types are included (`import type { Meshkit, IPFSNodeHandle } from '@ipfs-meshkit/meshkit'`). + +## Documentation + +- [GitHub repository](https://github.com/IPFS-Meshkit/meshkit0) +- [Kubo install guide](https://docs.ipfs.tech/install/) +- [Security policy](https://github.com/IPFS-Meshkit/meshkit0/blob/main/SECURITY.md) + +## Support + +- [GitHub Issues](https://github.com/IPFS-Meshkit/meshkit0/issues) — bugs and feature requests + +## Credits + +Open source project by **IPFS Meshkit Contributors**: + +- [Anurag Pandey](https://github.com/anurag-p6) — primary development +- [Manu Sheel Gupta](https://github.com/seetadev) — project lead + +## License -On Android, allow cleartext HTTP for local dev (`android:usesCleartextTraffic="true"`). On iOS, enable local networking in `Info.plist` if using `http://` on LAN. +[MIT](https://github.com/IPFS-Meshkit/meshkit0/blob/main/LICENSE) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..b39b0a0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,22 @@ +# Security Policy + +## Supported versions + +| Version | Supported | +| ------- | --------- | +| 1.0.x | Yes | + +## Reporting a vulnerability + +Please **do not** open a public GitHub issue for security vulnerabilities. + +Report security issues privately via [GitHub Security Advisories](https://github.com/IPFS-Meshkit/meshkit0/security/advisories/new) or by opening a confidential issue with the maintainers. + +Include: + +- A description of the vulnerability +- Steps to reproduce +- Impact assessment (if known) +- Affected versions + +We aim to acknowledge reports within a few business days and will work on a fix before public disclosure when possible. diff --git a/package-lock.json b/package-lock.json index a72edcf..e533a47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,30 +1,36 @@ { - "name": "ipfs-meshkit", + "name": "@ipfs-meshkit/meshkit", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "ipfs-meshkit", + "name": "@ipfs-meshkit/meshkit", "version": "1.0.0", "license": "MIT", "workspaces": [ "packages/*", "examples/*" ], + "dependencies": { + "kubo-rpc-client": "^7.1.0" + }, "devDependencies": { - "@ipfs-meshkit/meshkit": "*", "@types/node": "^25.9.3", "@vitest/coverage-v8": "^3.2.4", + "tsup": "^8.5.0", "typescript": "^6.0.3", "vitest": "^3.2.4" + }, + "engines": { + "node": ">=20" } }, "examples/dummy-app": { "name": "meshkit-dummy-app", "version": "1.0.0", "dependencies": { - "@ipfs-meshkit/meshkit": "*" + "@ipfs-meshkit/meshkit": "file:../.." } }, "node_modules/@ampproject/remapping": { @@ -797,6 +803,10 @@ "link": true }, "node_modules/@ipfs-meshkit/meshkit": { + "resolved": "", + "link": true + }, + "node_modules/@ipfs-meshkit/meshkit-workspace": { "resolved": "packages/meshkit", "link": true }, @@ -2014,7 +2024,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2063,6 +2072,13 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, "node_modules/any-signal": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.2.0.tgz", @@ -2277,6 +2293,22 @@ "license": "MIT", "peer": true }, + "node_modules/bundle-require": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.18" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -2387,6 +2419,22 @@ "node": ">= 16" } }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/chrome-launcher": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", @@ -2470,6 +2518,13 @@ "node": ">=18" } }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -2503,6 +2558,16 @@ "license": "MIT", "peer": true }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -2926,6 +2991,18 @@ "license": "MIT", "peer": true }, + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" + } + }, "node_modules/flow-enums-runtime": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", @@ -3628,6 +3705,16 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3745,6 +3832,36 @@ "license": "MIT", "peer": true }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -4290,6 +4407,19 @@ "node": ">=10" } }, + "node_modules/mlly": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.16.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.3" + } + }, "node_modules/ms": { "version": "4.0.0-nightly.202508271359", "resolved": "https://registry.npmjs.org/ms/-/ms-4.0.0-nightly.202508271359.tgz", @@ -4305,6 +4435,18 @@ "integrity": "sha512-iWK1RrAS58p2NDfeZFuSUSv3ZPewTIhsGbh/5NgeGGJwJmRljLxGtjRR3nkn+loG3zl+IrfR/W1590QnrSK+Gg==", "license": "Apache-2.0 OR MIT" }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoid": { "version": "5.1.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.11.tgz", @@ -4370,6 +4512,16 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -4538,6 +4690,28 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, "node_modules/postcss": { "version": "8.5.16", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", @@ -4567,6 +4741,49 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, "node_modules/postcss/node_modules/nanoid": { "version": "3.3.15", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", @@ -4864,6 +5081,20 @@ "node": ">= 6" } }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/regenerator-runtime": { "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", @@ -4881,6 +5112,16 @@ "node": ">=0.10.0" } }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -5362,6 +5603,39 @@ "dev": true, "license": "MIT" }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/supports-color": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", @@ -5415,6 +5689,29 @@ "node": ">=18" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -5540,6 +5837,23 @@ "node": ">=0.6" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -5547,45 +5861,599 @@ "dev": true, "license": "0BSD" }, - "node_modules/type-fest": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", - "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", - "license": "(MIT OR CC0-1.0)", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "node_modules/tsup": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" }, "engines": { - "node": ">=14.17" + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } } }, - "node_modules/uint8-varint": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-3.0.0.tgz", - "integrity": "sha512-S4DdpXBaLwKcFo7f0bWzWfHjbZ/i3QhM842qn+ZvHjxqFCfUcEB9SQNcmI69S+zMlcmIcKxsk9Iyw77S2Kxv6Q==", - "license": "Apache-2.0 OR MIT", - "dependencies": { - "uint8arraylist": "^3.0.1", - "uint8arrays": "^6.1.0" + "node_modules/tsup/node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" } }, - "node_modules/uint8-varint/node_modules/uint8arraylist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-3.0.2.tgz", - "integrity": "sha512-LDVoq9BQaGJzGDUovEnoX6rpKCvnY/Jbtws4ikwnBzjRbq5qBAFpBZevUEbSmMM87aO0Sp+wOZy2ZXf5yODmXQ==", - "license": "Apache-2.0 OR MIT", + "node_modules/tsup/node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/tsup/node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "dev": true, + "license": "MIT" + }, + "node_modules/uint8-varint": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-3.0.0.tgz", + "integrity": "sha512-S4DdpXBaLwKcFo7f0bWzWfHjbZ/i3QhM842qn+ZvHjxqFCfUcEB9SQNcmI69S+zMlcmIcKxsk9Iyw77S2Kxv6Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "uint8arraylist": "^3.0.1", + "uint8arrays": "^6.1.0" + } + }, + "node_modules/uint8-varint/node_modules/uint8arraylist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-3.0.2.tgz", + "integrity": "sha512-LDVoq9BQaGJzGDUovEnoX6rpKCvnY/Jbtws4ikwnBzjRbq5qBAFpBZevUEbSmMM87aO0Sp+wOZy2ZXf5yODmXQ==", + "license": "Apache-2.0 OR MIT", "dependencies": { "uint8arrays": "^6.0.0" } @@ -6195,13 +7063,8 @@ } }, "packages/meshkit": { - "name": "@ipfs-meshkit/meshkit", + "name": "@ipfs-meshkit/meshkit-workspace", "version": "1.0.0", - "license": "MIT", - "dependencies": { - "@ipfs-meshkit/core": "*", - "@ipfs-meshkit/node": "*" - }, "devDependencies": { "@types/node": "^25.9.3" } @@ -6211,7 +7074,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@ipfs-meshkit/core": "*" + "@ipfs-meshkit/core": "1.0.0" } }, "packages/react-native": { @@ -6238,11 +7101,11 @@ } }, "tests/integration": { - "name": "@ipfs-meshkit/integration-tests", + "name": "ipfs-meshkit/integration-tests", "version": "1.0.0", "extraneous": true, "dependencies": { - "@ipfs-meshkit/meshkit": "*" + "ipfs-meshkit/meshkit": "*" } } } diff --git a/package.json b/package.json index f3c0d63..62faa67 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,37 @@ { - "name": "ipfs-meshkit", - "version": "1.0.0", - "private": true, - "description": "IPFS Meshkit is a SDK for building IPFS applications.", + "name": "@ipfs-meshkit/meshkit", + "version": "1.0.1", + "description": "Node.js SDK for Kubo/IPFS — upload, pin, IPNS, local daemon, and multi-node failover.", "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "files": [ + "dist", + "README.md", + "LICENSE", + "SECURITY.md" + ], "workspaces": [ "packages/*", "examples/*" ], "scripts": { - "build": "tsc --build", - "clean": "npm run clean --workspaces --if-present", + "build": "tsup", + "clean": "rm -rf dist && npm run clean --workspaces --if-present && find packages -name 'tsconfig.tsbuildinfo' -delete 2>/dev/null || true", + "prepublishOnly": "npm run build", "test": "npm run test:unit", "test:unit": "vitest run --project unit", "test:unit:watch": "vitest --project unit", @@ -21,26 +42,47 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/seetadev/IPFS-meshkit.git" + "url": "git+https://github.com/IPFS-Meshkit/meshkit0.git" }, - "keywords": ["ipfs", "meshkit", "stack", "ionic"], - "author": "Manu Sheel Gupta", + "keywords": [ + "ipfs", + "kubo", + "meshkit", + "decentralized-storage", + "ipns", + "typescript" + ], + "author": "IPFS Meshkit Contributors", "contributors": [ { "name": "Anurag Pandey", "url": "https://github.com/anurag-p6" + }, + { + "name": "Manu Sheel Gupta", + "url": "https://github.com/seetadev" } ], "license": "MIT", "bugs": { - "url": "https://github.com/seetadev/IPFS-meshkit/issues" + "url": "https://github.com/IPFS-Meshkit/meshkit0/issues" + }, + "homepage": "https://github.com/IPFS-Meshkit/meshkit0#readme", + "sideEffects": false, + "engines": { + "node": ">=20" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "kubo-rpc-client": "^7.1.0" }, - "homepage": "https://github.com/seetadev/IPFS-meshkit#readme", "devDependencies": { - "@ipfs-meshkit/meshkit": "*", "@types/node": "^25.9.3", "@vitest/coverage-v8": "^3.2.4", "typescript": "^6.0.3", + "tsup": "^8.5.0", "vitest": "^3.2.4" } } diff --git a/packages/capacitor/package.json b/packages/capacitor/package.json index fc53662..2700f1e 100644 --- a/packages/capacitor/package.json +++ b/packages/capacitor/package.json @@ -1,6 +1,7 @@ { "name": "@ipfs-meshkit/capacitor", "version": "1.0.0", + "private": true, "description": "Capacitor adapter for IPFS Meshkit (Ionic and hybrid mobile apps).", "type": "module", "main": "./dist/index.js", diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000..b3ee089 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,24 @@ +# @ipfs-meshkit/core + +**Private monorepo package** — Kubo RPC client with multi-node health checks and failover. + +Not published separately. It is bundled into [`@ipfs-meshkit/meshkit`](../../README.md). + +## For app developers + +```bash +npm install @ipfs-meshkit/meshkit +``` + +```typescript +import { Meshkit, createMeshkitClient } from '@ipfs-meshkit/meshkit'; + +const meshkit = await Meshkit.init({ nodes: ['http://127.0.0.1:5001'] }); +const client = createMeshkitClient({ apiUrl: 'http://127.0.0.1:5001' }); +``` + +## Monorepo development + +Source: `packages/core/src/`. Imported as `@ipfs-meshkit/core`. + +Full documentation: [repository README](../../README.md) diff --git a/packages/core/package.json b/packages/core/package.json index 6b4e34c..03138e7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,21 +1,10 @@ { "name": "@ipfs-meshkit/core", "version": "1.0.0", - "description": "Core TypeScript SDK for IPFS Meshkit.", + "private": true, + "description": "Core TypeScript SDK for IPFS Meshkit (bundled into root @ipfs-meshkit/meshkit).", "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js" - } - }, - "files": [ - "dist" - ], "scripts": { - "build": "tsc", "clean": "rm -rf dist" }, "license": "MIT", diff --git a/packages/meshkit/README.md b/packages/meshkit/README.md new file mode 100644 index 0000000..85eaa6e --- /dev/null +++ b/packages/meshkit/README.md @@ -0,0 +1,22 @@ +# @ipfs-meshkit/meshkit-workspace + +**Private monorepo package** — source for the published npm package [`@ipfs-meshkit/meshkit`](../../README.md). + +Built from this folder into root `dist/` via `npm run build`. + +## For app developers + +```bash +npm install @ipfs-meshkit/meshkit +``` + +```typescript +import { init, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; +``` + +## Monorepo development + +- Entry: `packages/meshkit/src/index.ts` +- Depends on `@ipfs-meshkit/core` and `@ipfs-meshkit/node` + +Full documentation: [repository README](../../README.md) diff --git a/packages/meshkit/package.json b/packages/meshkit/package.json index 91c1508..943cd8b 100644 --- a/packages/meshkit/package.json +++ b/packages/meshkit/package.json @@ -1,29 +1,12 @@ { - "name": "@ipfs-meshkit/meshkit", + "name": "@ipfs-meshkit/meshkit-workspace", "version": "1.0.0", - "description": "Universal IPFS Meshkit SDK — storage, local Kubo lifecycle, and platform adapters.", + "private": true, + "description": "Workspace source for ipfs-meshkit (published from repo root dist/).", "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js" - } - }, - "files": [ - "dist" - ], "scripts": { - "build": "tsc", "clean": "rm -rf dist" }, - "license": "MIT", - "sideEffects": false, - "dependencies": { - "@ipfs-meshkit/core": "*", - "@ipfs-meshkit/node": "*" - }, "devDependencies": { "@types/node": "^25.9.3" } diff --git a/packages/node/README.md b/packages/node/README.md new file mode 100644 index 0000000..e66454f --- /dev/null +++ b/packages/node/README.md @@ -0,0 +1,26 @@ +# @ipfs-meshkit/node + +**Private monorepo package** — start, attach to, or stop a local Kubo daemon. **Node.js only.** + +Bundled into [`@ipfs-meshkit/meshkit`](../../README.md). + +## For app developers + +```bash +npm install @ipfs-meshkit/meshkit +``` + +```typescript +import { init, startIPFSNode, stopIPFSNode, setupGracefulShutdown } from '@ipfs-meshkit/meshkit'; + +const { meshkit, localNode } = await init({ localNode: true }); +setupGracefulShutdown(localNode); +``` + +Requires Kubo (`ipfs`) on `PATH` when spawning a daemon. + +## Monorepo development + +Source: `packages/node/src/`. Imported as `@ipfs-meshkit/node`. + +Full documentation: [repository README](../../README.md) diff --git a/packages/node/package.json b/packages/node/package.json index 9e12381..40327a1 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,26 +1,15 @@ { "name": "@ipfs-meshkit/node", "version": "1.0.0", - "description": "Local Kubo lifecycle management for IPFS Meshkit on Node.js.", + "private": true, + "description": "Local Kubo lifecycle for IPFS Meshkit (bundled into root @ipfs-meshkit/meshkit).", "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js" - } - }, - "files": [ - "dist" - ], "scripts": { - "build": "tsc", "clean": "rm -rf dist" }, "license": "MIT", "sideEffects": false, "dependencies": { - "@ipfs-meshkit/core": "*" + "@ipfs-meshkit/core": "1.0.0" } } diff --git a/packages/react-native/package.json b/packages/react-native/package.json index e6d4e88..41d1bfa 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,6 +1,7 @@ { "name": "@ipfs-meshkit/react-native", "version": "1.0.0", + "private": true, "description": "React Native adapter for IPFS Meshkit. Re-exports @ipfs-meshkit/core with optional polyfill entry.", "type": "module", "main": "./dist/index.js", diff --git a/tests/integration/helpers.ts b/tests/integration/helpers.ts index 75032f4..2075f57 100644 --- a/tests/integration/helpers.ts +++ b/tests/integration/helpers.ts @@ -1,9 +1,9 @@ import { execSync } from 'node:child_process'; import { access, rm } from 'node:fs/promises'; -import type { IPFSNodeHandle } from '@ipfs-meshkit/node'; import { extractCidFromPath, stopIPFSNode, + type IPFSNodeHandle, type Meshkit, } from '@ipfs-meshkit/meshkit'; diff --git a/tsconfig.base.json b/tsconfig.base.json index ed564b7..835c794 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,6 +15,7 @@ "noUncheckedSideEffectImports": true, "moduleDetection": "force", "skipLibCheck": true, + "ignoreDeprecations": "6.0", "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..3a314db --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,35 @@ +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { defineConfig } from 'tsup'; + +const root = path.dirname(fileURLToPath(import.meta.url)); + +export default defineConfig({ + entry: [path.join(root, 'packages/meshkit/src/index.ts')], + format: ['esm', 'cjs'], + outDir: 'dist', + clean: true, + sourcemap: true, + target: 'es2022', + esbuildOptions(options) { + options.alias = { + '@ipfs-meshkit/core': path.join(root, 'packages/core/src/index.ts'), + '@ipfs-meshkit/node': path.join(root, 'packages/node/src/index.ts'), + }; + }, + dts: { + compilerOptions: { + composite: false, + incremental: false, + ignoreDeprecations: '6.0', + paths: { + '@ipfs-meshkit/core': ['./packages/core/src/index.ts'], + '@ipfs-meshkit/node': ['./packages/node/src/index.ts'], + }, + baseUrl: '.', + }, + }, + // Bundle workspace packages into one publishable artifact. + noExternal: [/^@ipfs-meshkit\//], + external: ['kubo-rpc-client'], +});