Skip to content

Commit

Permalink
Merge pull request #111 from Vahelnir/main
Browse files Browse the repository at this point in the history
feat: export Treaty namespace from treaty2
  • Loading branch information
SaltyAom authored Jul 12, 2024
2 parents 5de82d4 + 1215bc3 commit 03aae7b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
"default": "./dist/treaty.js",
"types": "./dist/treaty/index.d.ts"
},
"./treaty2": {
"require": "./dist/2.js",
"import": "./dist/treaty2.mjs",
"node": "./dist/treaty2.js",
"default": "./dist/treaty2.js",
"types": "./dist/treaty2/index.d.ts"
},
"./fetch": {
"require": "./dist/fetch.js",
"import": "./dist/fetch.mjs",
Expand Down
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import type { Elysia } from 'elysia'

import type { Treaty } from './treaty2'
import type { EdenTreaty } from './treaty'
import type { EdenFetch } from './fetch'
export type { Treaty } from './treaty2'

export { treaty } from './treaty2'
export { edenTreaty } from './treaty'
Expand Down
2 changes: 1 addition & 1 deletion src/treaty2/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export namespace Treaty {
[K in keyof T]: Awaited<T[K]>
}

type TreatyResponse<
export type TreatyResponse<
_Res extends Record<number, unknown>,
Res extends Record<
number,
Expand Down
3 changes: 1 addition & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import { defineConfig } from 'tsup'
import { resolve } from 'path'
import { execSync } from 'child_process'

import { copyFile } from 'fs/promises'

export default defineConfig({
entry: {
index: resolve(__dirname, 'src/index.ts'),
treaty: resolve(__dirname, 'src/treaty/index.ts'),
treaty2: resolve(__dirname, 'src/treaty2/index.ts'),
fetch: resolve(__dirname, 'src/fetch/index.ts')
},
format: ['cjs', 'esm', 'iife'],
Expand Down

0 comments on commit 03aae7b

Please sign in to comment.