Skip to content

Commit e0995e7

Browse files
committed
chore: use bunfig
1 parent d1fb405 commit e0995e7

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

src/config.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import type { Config } from './types'
2-
import { loadConfig } from 'c12'
2+
import { resolve } from 'node:path'
3+
import { loadConfig } from 'bunfig'
34

4-
// Define an async function to load the config
5-
async function loadDynamoDBConfig(): Promise<Config> {
6-
const { config } = (await loadConfig({
7-
name: 'dynamodb',
8-
defaultConfig: {
9-
port: 8000,
10-
dbPath: '',
11-
detached: false,
12-
additionalArgs: ['-sharedDb'],
13-
javaOpts: '',
14-
installPath: 'dynamodb-local',
15-
downloadUrl: 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz',
16-
},
17-
})) as { config: Config }
18-
19-
return config
5+
export const defaultConfig: Config = {
6+
port: 8000,
7+
defaultTableName: 'MyOfflineTable',
8+
dbPath: '',
9+
detached: false,
10+
additionalArgs: ['-sharedDb'],
11+
javaOpts: '',
12+
installPath: 'dynamodb-local',
13+
downloadUrl: 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz',
2014
}
2115

22-
// Export the config (wrapped in a promise)
2316
// eslint-disable-next-line antfu/no-top-level-await
24-
export const config: Config = await loadDynamoDBConfig()
17+
export const config: Config = await loadConfig({
18+
name: 'dynamodb',
19+
cwd: resolve(__dirname, '..'),
20+
defaultConfig,
21+
})

0 commit comments

Comments
 (0)