Skip to content

Commit

Permalink
Prepare for jsr publish
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 8, 2025
1 parent 0d731e7 commit 8758ac5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish package to jsr
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- run: npm install -g jsr
- run: jsr publish
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Awaiting for promise is equal to node nextTick
const nextTick = async () => {};
// Small internal primitive to limit concurrency
function limit(concurrencyLimit: number) {
function limit(concurrencyLimit: number): <T>(fn: () => Promise<T>) => Promise<T> {
let currentlyProcessing = 0;
const queue: ((value?: unknown) => void)[] = [];
const next = () => {
Expand Down Expand Up @@ -30,7 +30,7 @@ function limit(concurrencyLimit: number) {
}

// Fetch
type FetchOpts = RequestInit & { timeout?: number };
export type FetchOpts = RequestInit & { timeout?: number };
export type FetchFn = (
url: string,
opts?: FetchOpts
Expand Down
14 changes: 14 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@paulmillr/ftch",
"version": "0.4.0",
"exports": "./index.ts",
"publish": {
"include": [
"index.ts",
"jsr.json",
"LICENSE",
"README.md"
]
},
"license": "MIT"
}

0 comments on commit 8758ac5

Please sign in to comment.