Skip to content

Commit b50a553

Browse files
chore: wip
1 parent a43a810 commit b50a553

File tree

6 files changed

+110
-103
lines changed

6 files changed

+110
-103
lines changed

CHANGELOG.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
# Change Log
12

23
## ...main
34

4-
55
### 🏡 Chore
66

77
- Wip ([7d3f5ca](https://github.com/stacksjs/dynamodb-tooling/commit/7d3f5ca))
@@ -11,15 +11,11 @@
1111

1212
1313

14-
## ...main
15-
16-
17-
### 🏡 Chore
14+
### 🏡 Chores
1815

1916
- Wip ([7d3f5ca](https://github.com/stacksjs/dynamodb-tooling/commit/7d3f5ca))
2017
- Wip ([d2b1f64](https://github.com/stacksjs/dynamodb-tooling/commit/d2b1f64))
2118

22-
### ❤️ Contributors
19+
### ❤️ More Contributors
2320

2421
25-

README.md

Lines changed: 85 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,143 @@
1-
<p align="center"><img src=".github/art/cover.png" alt="Social Card of this repo"></p>
1+
# DynamoDB Goodies
2+
3+
![Social Card of this repo](.github/art/cover.png)
24

35
[![npm version][npm-version-src]][npm-version-href]
46
[![GitHub Actions][github-actions-src]][github-actions-href]
57
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
68
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
79
<!-- [![Codecov][codecov-src]][codecov-href] -->
810

9-
# DynamoDB Goodies
10-
1111
## Features
1212

13-
- Zero-config DynamoDB setup
14-
- Local development with SSL support (wip)
15-
- DynamoDB Toolbox integration
13+
-Zero-config DynamoDB setup
14+
-Local development with SSL support (wip)
15+
-DynamoDB Toolbox integration
1616

1717
## Install
1818

19-
```bash
20-
bun install -d dynamodb-tooling
21-
```
19+
```bash
20+
bun install -d dynamodb-tooling
21+
```
2222

2323
## Get Started
2424

25-
Getting started with the DynamoDB Tooling is easy. Just import `dynamoDb` and get going:
25+
Getting started with the DynamoDB Tooling is easy. Just import `dynamoDb` and get going:
2626

27-
```ts
28-
import { dynamoDb } from 'dynamodb-tooling'
27+
```ts
28+
import { dynamoDb } from 'dynamodb-tooling'
2929

30-
interface LaunchOptions {
31-
port: number
32-
dbPath?: string
33-
additionalArgs?: string[]
34-
verbose?: boolean
35-
detached?: boolean
36-
javaOpts?: string
37-
}
30+
interface LaunchOptions {
31+
port: number
32+
dbPath?: string
33+
additionalArgs?: string[]
34+
verbose?: boolean
35+
detached?: boolean
36+
javaOpts?: string
37+
}
3838

39-
const childProcess = await dynamoDb.launch(options)
40-
dynamoDb.stopChild(childProcess)
41-
dynamoDb.stop(options.port)
42-
dynamoDb.relaunch()
39+
const childProcess = await dynamoDb.launch(options)
40+
dynamoDb.stopChild(childProcess)
41+
dynamoDb.stop(options.port)
42+
dynamoDb.relaunch()
4343

44-
dynamoDb.configureInstaller()
45-
await dynamoDb.install()
46-
```
44+
dynamoDb.configureInstaller()
4745

48-
### Example
49-
50-
```ts
51-
import { dynamoDb } from 'dynamodb-tooling'
46+
await dynamoDb.install()
47+
```
5248

53-
const port = 8000
54-
// if you want to share with Bun Shell
55-
await dynamoDb.launch({
56-
port,
57-
additionalArgs: ['-sharedDb'],
58-
})
59-
// do your tests / trigger your logic
60-
dynamoDb.stop(port)
61-
```
62-
63-
Alternatively, you can use it as a detached server:
49+
### Example
6450

65-
```ts
66-
const port = 8000
67-
const child = await dynamoDb.launch({ port })
68-
// trigger your logic
69-
await dynamoDb.stopChild(child)
70-
```
51+
```ts
52+
import { dynamoDb } from 'dynamodb-tooling'
53+
54+
const port = 8000
55+
// if you want to share with Bun Shell
56+
// eslint-disable-next-line antfu/no-top-level-await
57+
await dynamoDb.launch({
58+
port,
59+
additionalArgs: ['-sharedDb'],
60+
})
61+
// do your tests / trigger your logic
62+
dynamoDb.stop(port)
63+
```
64+
65+
Alternatively, you can use it as a detached server:
66+
67+
```ts
68+
const port = 8000
69+
const child = await dynamoDb.launch({ port })
70+
// trigger your logic
71+
await dynamoDb.stopChild(child)
72+
```
7173

7274
## Configuration
7375

74-
The client can be configured using a `dynamodb.config.ts` _(or `dynamodb.config.js`)_ file and it will be automatically loaded.
76+
The client can be configured using a `dynamodb.config.ts` _(or `dynamodb.config.js`)_ file and it will be automatically loaded.
7577

76-
```ts
77-
// dynamodb.config.ts (or dynamodb.config.js)
78-
export default {
79-
installPath: path.join(os.tmpdir(), 'dynamodb-local'),
80-
downloadUrl: 'https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz', // the official download URL
81-
}
82-
```
78+
```ts
79+
// dynamodb.config.ts (or dynamodb.config.js)
80+
export default {
81+
installPath: path.join(os.tmpdir(), 'dynamodb-local'),
82+
downloadUrl: 'https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz', // the official download URL
83+
}
84+
```
8385

8486
## Testing
8587

86-
```bash
87-
bun test
88-
```
88+
```bash
89+
bun test
90+
```
8991

9092
## Changelog
9193

92-
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
94+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
9395

9496
## Contributing
9597

96-
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
98+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
9799

98100
## Community
99101

100-
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
102+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
101103

102-
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
104+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
103105

104-
For casual chit-chat with others using this package:
106+
For casual chit-chat with others using this package:
105107

106-
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
108+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
107109

108110
## Postcardware
109111

110-
Stacks OSS will always stay open-sourced, and we will always love to receive postcards from wherever Stacks is used! _And we also publish them on our website. Thank you, Spatie._
112+
Stacks OSS will always stay open-sourced, and we will always love to receive postcards from wherever Stacks is used! _And we also publish them on our website. Thank you, Spatie._
111113

112-
Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA, USA 🌎
114+
Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA, USA 🌎
113115

114116
## Sponsors
115117

116-
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
118+
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
117119

118-
- [JetBrains](https://www.jetbrains.com/)
119-
- [The Solana Foundation](https://solana.com/)
120+
-[JetBrains](https://www.jetbrains.com/)
121+
-[The Solana Foundation](https://solana.com/)
120122

121123
## Credits
122124

123-
- [dynamodb-toolbox](https://github.com/jeremydaly/dynamodb-toolbox)
124-
- [dynamodb-local](https://github.com/rynop/dynamodb-local)
125-
- [Chris Breuer](https://github.com/chrisbbreuer)
126-
- [All Contributors](../../contributors)
125+
-[dynamodb-toolbox](https://github.com/jeremydaly/dynamodb-toolbox)
126+
-[dynamodb-local](https://github.com/rynop/dynamodb-local)
127+
-[Chris Breuer](https://github.com/chrisbbreuer)
128+
-[All Contributors](../../contributors)
127129

128130
## License
129131

130-
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
132+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
131133

132-
Made with 💙
134+
Made with 💙
133135

134-
<!-- Badges -->
135-
[npm-version-src]: https://img.shields.io/npm/v/bun-reverse-proxy?style=flat-square
136-
[npm-version-href]: https://npmjs.com/package/bun-reverse-proxy
137-
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/reverse-proxy/ci.yml?style=flat-square&branch=main
138-
[github-actions-href]: https://github.com/stacksjs/reverse-proxy/actions?query=workflow%3Aci
136+
<!-- Badges -->
137+
[npm-version-src]: https://img.shields.io/npm/v/bun-reverse-proxy?style=flat-square
138+
[npm-version-href]: https://npmjs.com/package/bun-reverse-proxy
139+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/reverse-proxy/ci.yml?style=flat-square&branch=main
140+
[github-actions-href]: https://github.com/stacksjs/reverse-proxy/actions?query=workflow%3Aci
139141

140-
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/reverse-proxy/main?style=flat-square
141-
[codecov-href]: https://codecov.io/gh/stacksjs/reverse-proxy -->
142+
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/reverse-proxy/main?style=flat-square
143+
[codecov-href]: https://codecov.io/gh/stacksjs/reverse-proxy -->

build.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import dts from 'bun-plugin-dts-auto'
44
// eslint-disable-next-line no-console
55
console.log('Building...')
66

7-
const result = await Bun.build({
7+
Bun.build({
88
entrypoints: [
99
'src/index.ts',
1010
],
@@ -16,12 +16,18 @@ const result = await Bun.build({
1616
dts(),
1717
],
1818
})
19-
20-
if (result.success) {
21-
// eslint-disable-next-line no-console
22-
console.log('Build successful!')
23-
process.exit(0)
24-
}
25-
26-
console.error('Build failed!', result)
27-
process.exit(1)
19+
.then((result) => {
20+
if (result.success) {
21+
// eslint-disable-next-line no-console
22+
console.log('Build successful!')
23+
process.exit(0)
24+
}
25+
else {
26+
console.error('Build failed!', result)
27+
process.exit(1)
28+
}
29+
})
30+
.catch((err) => {
31+
console.error('Build process encountered an error:', err)
32+
process.exit(1)
33+
})

dynamodb.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as path from 'node:path'
2-
import * as os from 'node:os'
31
import type { Config } from './src/types'
2+
import * as os from 'node:os'
3+
import * as path from 'node:path'
44

55
export default {
66
port: 8000,

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import stacks from '@antfu/eslint-config'
22

3-
export default stacks()
3+
export default stacks({
4+
markdown: false,
5+
})

test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ console.log('Starting DynamoDB on port 8000')
55

66
const port = 8000
77
// if you want to share with Bun Shell
8+
// eslint-disable-next-line antfu/no-top-level-await
89
const dd = await dynamoDb.launch()
910

1011
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)