Skip to content

Commit 1d919dc

Browse files
committed
chore: wip
1 parent 41de230 commit 1d919dc

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

app/Server/Preloader.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

bunfig.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# preload these modules before running bun
2-
preload = [ "./app/Server/Preloader.ts" ]
2+
preload = [ "./server/Preloader/main.ts" ]
3+
4+
[test]
5+
preload = [ "./server/Preloader/test.ts" ]
36

47
[install]
58
# To configure Bun's package auto-install behavior.

server/Preloader/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Main Preloader
3+
*
4+
* This file is loaded before the main (Bun) process is started.
5+
* You may use this file to preload/define plugins that will
6+
* automatically be injected into the Bun process.
7+
*/
8+
9+
// allows for importing .env files
10+
await import('bun-plugin-env')
11+
12+
// allows for importing .yaml files
13+
await import('bun-plugin-yml')

server/Preloader/test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { type BunPlugin as Plugin, plugin } from 'bun'
2+
3+
/**
4+
* Test Preloader
5+
*
6+
* This plugin is triggered before each test is run. You may use this file
7+
* to preload/define plugins that will automatically be injected
8+
* into the Bun process before tests are run.
9+
*/
10+
11+
const customPlugin: Plugin = {
12+
name: 'Custom loader',
13+
setup() {
14+
// eslint-disable-next-line no-console
15+
console.log('Custom loader, triggered before tests run')
16+
},
17+
}
18+
19+
plugin(customPlugin)

app/Server/README.md renamed to server/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# What is this Server directory?
1+
# What is this "server" directory?
22

3-
Currently, the Server directory is used to define the preloaded functionality by the local Bun process. Soon, it will also be used to define the Cloud container.
3+
Currently, the Server directory is used to define the preloaded functionality by the Bun process. It is broken into two parts, `Preloader/main.ts` and `Preloader/test.ts`. In other words, ...
4+
5+
1. **Main**: The main preloader is triggered before the main local Bun process is started
6+
2. **Test**: The test preloader is triggered before tests are run
7+
8+
_Soon, the server directory will also be used to define the Cloud container._
49

510
## 🚜 Contributing
611

@@ -18,6 +23,6 @@ For casual chit-chat with others using this package:
1823

1924
## 📄 License
2025

21-
The MIT License (MIT). Please see [LICENSE](../../LICENSE.md) for more information.
26+
The MIT License (MIT). Please see [LICENSE](../LICENSE.md) for more information.
2227

2328
Made with 💙

0 commit comments

Comments
 (0)