Skip to content

Commit

Permalink
✨ Export everything
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Dec 3, 2024
1 parent 926db9d commit 3f876d1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
8 changes: 6 additions & 2 deletions packages/blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ yarn add @huggingface/blob

```ts
// esm.sh
import { FileBlob, WebBlob } from "https://esm.sh/@huggingface/blob";
import { FileBlob } from "https://esm.sh/@huggingface/blob/FileBlob";
import { WebBlob } from "https://esm.sh/@huggingface/blob/WebBlob";
import { createBlob } from "https://esm.sh/@huggingface/blob";
// or npm:
import { FileBlob, WebBlob } from "npm:@huggingface/blob";
import { FileBlob } from "npm:@huggingface/blob/FileBlob";
import { WebBlob } from "npm:@huggingface/blob/WebBlob";
import { createBlob } from "npm:@huggingface/blob";
```

## Usage
Expand Down
14 changes: 11 additions & 3 deletions packages/blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./package.json": "./package.json",
"./WebBlob": {
"types": "./dist/WebBlob.d.ts",
"require": "./dist/WebBlob.js",
"import": "./dist/WebBlob.mjs"
},
"./FileBlob": {
"types": "./dist/FileBlob.d.ts",
"require": "./dist/FileBlob.js",
"import": "./dist/FileBlob.mjs"
}
},
"browser": {
"./src/utils/FileBlob.ts": false,
"./dist/index.js": "./dist/browser/index.js",
"./dist/index.mjs": "./dist/browser/index.mjs"
},
"engines": {
"node": ">=18"
},
"source": "index.ts",
"scripts": {
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
Expand Down
1 change: 0 additions & 1 deletion packages/blob/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./utils/createBlob";
export * from "./utils/WebBlob";
2 changes: 2 additions & 0 deletions packages/blob/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ const baseConfig: Options = {

const nodeConfig: Options = {
...baseConfig,
entry: ["./index.ts", "./src/utils/WebBlob.ts", "./src/utils/FileBlob.ts"],
platform: "node",
};

const browserConfig: Options = {
...baseConfig,
entry: ["./index.ts", "./src/utils/WebBlob.ts"],
platform: "browser",
target: "es2018",
splitting: true,
Expand Down

0 comments on commit 3f876d1

Please sign in to comment.