Skip to content

Commit

Permalink
feat: tsconfig.json uses module=NodeNext, and package.json supports b…
Browse files Browse the repository at this point in the history
…eing imported (#95)

Motivation:
* I'm (momentarily at least) importing some stuff from this repository
to work I'm doing in hoverboard
  • Loading branch information
gobengo authored Dec 13, 2023
1 parent 52c3f45 commit 0ba2dec
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 73 deletions.
Empty file added .npmignore
Empty file.
225 changes: 177 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@
"name": "freeway",
"version": "2.14.0",
"description": "An IPFS gateway for accessing UnixFS data via CAR CIDs",
"main": "index.js",
"main": "src/index.js",
"types": "dist/src/index.d.ts",
"type": "module",
"exports": {
".": {
"import": "./src/index.js",
"types": "./dist/src/index.d.ts"
},
"./blockstore": {
"import": "./src/lib/blockstore.js",
"types": "./dist/src/lib/blockstore.d.ts"
}
},
"scripts": {
"prepare": "npm run build",
"start": "npm run dev",
"dev": "npm run build:debug && miniflare dist/worker.mjs --watch --debug -m --r2-persist --global-async-io --global-timers",
"build": "esbuild --bundle src/index.js --format=esm --sourcemap --minify --outfile=dist/worker.mjs",
"build": "esbuild --bundle src/index.js --format=esm --sourcemap --minify --outfile=dist/worker.mjs && npm run build:tsc",
"build:debug": "esbuild --bundle src/index.js --format=esm --outfile=dist/worker.mjs",
"build:tsc": "tsc --build",
"test": "npm run build:debug && node --test --experimental-vm-modules",
"lint": "standard"
},
Expand All @@ -27,9 +40,9 @@
"@ipld/dag-cbor": "^9.0.0",
"@ipld/dag-json": "^10.0.1",
"@ipld/dag-pb": "^4.0.2",
"@web3-storage/content-claims": "^3.1.0",
"@web3-storage/gateway-lib": "^3.5.1",
"cardex": "^2.3.1",
"@web3-storage/content-claims": "^4.0.0",
"@web3-storage/gateway-lib": "^4.1.0",
"cardex": "^2.3.3",
"chardet": "^1.5.0",
"dagula": "^7.2.2",
"http-range-parse": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/car-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Http from '../lib/http.js'
/**
* Handler that serves CAR files directly from R2.
*
* @type {import('@web3-storage/gateway-lib').Handler<CarBlockHandlerContext, import('../bindings').Environment>}
* @type {import('@web3-storage/gateway-lib').Handler<CarBlockHandlerContext, import('../bindings.js').Environment>}
*/
export async function handleCarBlock (request, env, ctx) {
const { searchParams, dataCid } = ctx
Expand Down Expand Up @@ -40,7 +40,7 @@ export async function handleCarBlock (request, env, ctx) {
})
}

/** @type {import('../lib/http').Range|undefined} */
/** @type {import('../lib/http.js').Range|undefined} */
let range
if (request.headers.has('range')) {
try {
Expand Down
Loading

0 comments on commit 0ba2dec

Please sign in to comment.