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 Oct 18, 2023
1 parent 2f4316f commit 0fbfab9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@
"type": "module",
"main": "build/index.js",
"files": [
"build/configure.js",
"build/configure.d.ts",
"build/index.js",
"build/index.d.ts",
"build/src",
"build/services",
"build/providers",
"build/factories",
"build/stubs",
"build/index.d.ts",
"build/index.js"
"build"
],
"engines": {
"node": ">=18.16.0"
Expand All @@ -33,8 +23,8 @@
"test:docker": "docker-compose -f docker-compose.ci.yml run --rm tests",
"quick:test": "node --enable-source-maps --loader=ts-node/esm ./bin/test.js",
"clean": "del-cli build",
"copy:templates": "copyfiles \"stubs/**/**/*.stub\" build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:templates",
"copy:templates": "copyfiles --up 1 \"stubs/**/**/*.stub\" build",
"compile": "npm run lint && npm run clean && tsup-node && npm run copy:templates",
"build": "npm run compile",
"release": "np",
"version": "npm run build",
Expand Down Expand Up @@ -67,6 +57,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 @@ -119,5 +110,19 @@
"tests/**",
"src/repl_bindings.ts"
]
},
"tsup": {
"entry": [
"./index.ts",
"./services/main.ts",
"./providers/redis_provider.ts",
"./factories/main.ts",
"./src/types/main.ts"
],
"outDir": "./build",
"clean": true,
"format": "esm",
"dts": true,
"target": "esnext"
}
}
7 changes: 7 additions & 0 deletions providers/redis_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
*/

import type { ApplicationService } from '@adonisjs/core/types'
import type { RedisService } from '../src/types/main.js'

declare module '@adonisjs/core/types' {
export interface ContainerBindings {
redis: RedisService
}
}

/**
* Registering the Redis manager as a singleton to the container
Expand Down
2 changes: 1 addition & 1 deletion tests/configure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* file that was distributed with this source code.
*/

import { fileURLToPath } from 'node:url'
import { test } from '@japa/runner'
import { fileURLToPath } from 'node:url'
import { IgnitorFactory } from '@adonisjs/core/factories'
import Configure from '@adonisjs/core/commands/configure'

Expand Down

0 comments on commit 0fbfab9

Please sign in to comment.