Skip to content

Commit

Permalink
chore: use tsup for bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 6, 2023
1 parent d030749 commit 78ab5bf
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 22 deletions.
25 changes: 20 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"main": "./build/index.js",
"type": "module",
"files": [
"build/src",
"build/index.d.ts",
"build/index.js"
"build",
"!build/bin",
"!build/tests_helpers",
"!build/tests"
],
"exports": {
".": "./build/index.js",
Expand All @@ -20,9 +21,10 @@
"pretest": "npm run lint && npm run typecheck",
"test": "c8 npm run quick:test",
"clean": "del-cli build",
"compile": "npm run lint && npm run clean && tsc",
"precompile": "npm run lint && npm run clean",
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
"build": "npm run compile",
"release": "np --message=\"chore(release): %s\"",
"release": "np",
"version": "npm run build",
"prepublishOnly": "npm run build",
"lint": "eslint . --ext=.ts",
Expand Down Expand Up @@ -52,6 +54,7 @@
"np": "^8.0.4",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
},
"dependencies": {
Expand Down Expand Up @@ -118,5 +121,17 @@
},
"directories": {
"test": "tests"
},
"tsup": {
"entry": [
"./index.ts",
"./src/types.ts"
],
"outDir": "./build",
"clean": true,
"format": "esm",
"dts": false,
"sourcemap": true,
"target": "esnext"
}
}
2 changes: 1 addition & 1 deletion tests/api_client/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { test } from '@japa/runner'

import { ApiClient } from '../../src/client.js'
import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'
import { ApiResponse } from '../../src/response.js'
import { RequestConfig } from '../../src/types.js'

Expand Down
2 changes: 1 addition & 1 deletion tests/request/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request | auth', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IncomingMessage } from 'node:http'
import { ApiRequest } from '../../src/request.js'
import { RequestConfig } from '../../src/types.js'
import { ApiResponse } from '../../src/response.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/body.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { parse } from 'node:querystring'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { awaitStream, httpServer } from '../../test_helpers/index.js'
import { awaitStream, httpServer } from '../../tests_helpers/index.js'
import { fileURLToPath } from 'node:url'

test.group('Request | body', (group) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/cookies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cookie from 'cookie'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request | cookies', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/custom_types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { awaitStream, httpServer } from '../../test_helpers/index.js'
import { awaitStream, httpServer } from '../../tests_helpers/index.js'

test.group('Request | custom types', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/headers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request | headers', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/lifecycle_hooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request | lifecycle hooks', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/request/query_string.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { parse } from 'node:querystring'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Request | query string', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/assertions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cookie from 'cookie'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | assertions', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/cookies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cookie from 'cookie'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | cookies', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/custom_types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { load } from 'cheerio'
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | custom types', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/data_types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { test } from '@japa/runner'
import { createReadStream } from 'node:fs'

import { ApiRequest } from '../../src/request.js'
import { awaitStream, httpServer } from '../../test_helpers/index.js'
import { awaitStream, httpServer } from '../../tests_helpers/index.js'
import { fileURLToPath } from 'node:url'

test.group('Response | data types', (group) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/error_handling.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | error handling', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/lifecycle_hooks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { ApiResponse } from '../../src/response.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | lifecycle hooks', (group) => {
group.each.setup(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/response/redirects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { test } from '@japa/runner'

import { ApiRequest } from '../../src/request.js'
import { httpServer } from '../../test_helpers/index.js'
import { httpServer } from '../../tests_helpers/index.js'

test.group('Response | redirects', (group) => {
group.each.setup(async () => {
Expand Down
File renamed without changes.

0 comments on commit 78ab5bf

Please sign in to comment.