flarecord 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/package.json +18 -5
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# flarecord
|
|
1
|
+
# flarecord 🌥️
|
|
2
2
|
|
|
3
3
|
discord gateway client for cloudflare workers. built with typescript and optimized for durable objects.
|
|
4
4
|
|
|
@@ -8,6 +8,30 @@ discord gateway client for cloudflare workers. built with typescript and optimiz
|
|
|
8
8
|
npm install flarecord
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## using source files directly
|
|
12
|
+
|
|
13
|
+
if you encounter bundling issues with the compiled version, you can import directly from the source files:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// import from source (recommended for cloudflare workers)
|
|
17
|
+
import { DiscordClient, GatewayIntents, MessageHelper } from "flarecord/src";
|
|
18
|
+
|
|
19
|
+
// or import specific modules
|
|
20
|
+
import { DiscordClient } from "flarecord/src/core/client";
|
|
21
|
+
import { MessageHelper } from "flarecord/src/utils/message-helper";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**when to use source files:**
|
|
25
|
+
- cloudflare workers projects (handles typescript natively)
|
|
26
|
+
- when you need to avoid bundling issues
|
|
27
|
+
- when you want to use the latest source code
|
|
28
|
+
|
|
29
|
+
**when to use compiled version:**
|
|
30
|
+
- standard node.js projects
|
|
31
|
+
- when you prefer pre-compiled javascript
|
|
32
|
+
|
|
33
|
+
the source files are included in the npm package, so both options work without additional configuration.
|
|
34
|
+
|
|
11
35
|
## how it works
|
|
12
36
|
|
|
13
37
|
flarecord connects to discord's gateway api using websockets. it runs inside cloudflare durable objects which provide:
|
package/package.json
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flarecord",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "discord gateway client for cloudflare workers. built with typescript and optimized for durable objects.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./
|
|
7
|
-
"types": "./
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"source": "./src/index.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
11
|
+
"source": "./src/index.ts",
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"import": "./src/index.ts",
|
|
14
|
+
"default": "./src/index.ts"
|
|
15
|
+
},
|
|
16
|
+
"./src": {
|
|
17
|
+
"source": "./src/index.ts",
|
|
18
|
+
"types": "./src/index.ts",
|
|
19
|
+
"import": "./src/index.ts"
|
|
20
|
+
},
|
|
21
|
+
"./src/*": {
|
|
22
|
+
"source": "./src/*.ts",
|
|
23
|
+
"types": "./src/*.ts",
|
|
24
|
+
"import": "./src/*.ts"
|
|
12
25
|
}
|
|
13
26
|
},
|
|
14
27
|
"files": [
|