Skip to content

Commit

Permalink
feat!: move server to sub-module export (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas committed Mar 6, 2024
1 parent 3148833 commit 4bcfeff
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 1 addition & 2 deletions build.mjs
Expand Up @@ -2,7 +2,6 @@
import { rm } from 'node:fs/promises'
import { argv } from 'process'

// eslint-disable-next-line import/no-extraneous-dependencies
import { build } from 'tsup'

const dist = './dist'
Expand All @@ -11,7 +10,7 @@ await rm(dist, { recursive: true, force: true })

/** @type {import('tsup').Options} */
const options = {
entry: ['src/main.ts'],
entry: ['src/server.ts', 'src/main.ts'],
tsconfig: 'tsconfig.json',
bundle: true,
dts: true,
Expand Down
19 changes: 17 additions & 2 deletions package.json
Expand Up @@ -24,10 +24,25 @@
"default": "./dist/main.js"
}
},
"./package.json": "./package.json"
"./package.json": "./package.json",
"./server": {
"require": {
"types": "./dist/server.d.cts",
"default": "./dist/server.cjs"
},
"import": {
"types": "./dist/server.d.ts",
"default": "./dist/server.js"
},
"default": {
"types": "./dist/server.d.ts",
"default": "./dist/server.js"
}
}
},
"files": [
"dist/**/*"
"dist/**/*",
"server.d.ts"
],
"scripts": {
"build": "run-s build:*",
Expand Down
1 change: 1 addition & 0 deletions server.d.ts
@@ -0,0 +1 @@
export * from './dist/server.d.ts'
1 change: 0 additions & 1 deletion src/main.ts
@@ -1,6 +1,5 @@
export { getDeployStore, getStore } from './store_factory.ts'
export { listStores } from './store_list.ts'
export { BlobsServer } from './server.ts'
export type {
Store,
StoreOptions,
Expand Down

0 comments on commit 4bcfeff

Please sign in to comment.