@fluxy-chat/create-fluxy-chat 0.1.0 → 0.2.0
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/LICENSE +21 -0
- package/dist/index.js +0 -0
- package/package.json +45 -45
- package/readme.md +11 -18
- package/templates/basic/fluxy.config.ts +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fluxychat contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluxy-chat/create-fluxy-chat",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Scaffold a new FluxyChat bot project with a single command",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-fluxy-chat": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=20.12"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"templates",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@clack/prompts": "^0.7.0",
|
|
20
|
+
"picocolors": "^1.1.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"tsup": "^8.3.5",
|
|
25
|
+
"typescript": "^5.6.0"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/AlessandroFare/fluxychat.git",
|
|
30
|
+
"directory": "packages/create-fluxy-chat"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/AlessandroFare/fluxychat/tree/main/packages/create-fluxy-chat#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/AlessandroFare/fluxychat/issues"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup src/index.ts --format esm --dts",
|
|
42
|
+
"dev": "tsup src/index.ts --format esm --watch",
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Scaffold a new [FluxyChat](https://github.com/AlessandroFare/fluxychat) bot project with a single command.
|
|
4
4
|
|
|
5
|
-
## Quick
|
|
5
|
+
## Quick start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx create-fluxy-chat my-bot
|
|
@@ -10,7 +10,7 @@ npx create-fluxy-chat my-bot
|
|
|
10
10
|
|
|
11
11
|
This launches an interactive prompt to configure your bot project.
|
|
12
12
|
|
|
13
|
-
## Non-
|
|
13
|
+
## Non-interactive usage
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# Create a Slack bot with pnpm
|
|
@@ -22,7 +22,7 @@ npx create-fluxy-chat my-bot --adapter telegram --skip-install
|
|
|
22
22
|
# Create a Discord bot with defaults
|
|
23
23
|
npx create-fluxy-chat my-bot -y --adapter discord
|
|
24
24
|
|
|
25
|
-
# Create a basic webhook bot
|
|
25
|
+
# Create a basic webhook bot (includes fluxy.config.ts template)
|
|
26
26
|
npx create-fluxy-chat my-bot --adapter basic
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -48,20 +48,20 @@ npx create-fluxy-chat my-bot --adapter basic
|
|
|
48
48
|
| `discord` | Discord interactions bot | Discord |
|
|
49
49
|
| `web` | Web chat HTTP API bot | Any HTTP client |
|
|
50
50
|
|
|
51
|
-
## What
|
|
51
|
+
## What you get
|
|
52
52
|
|
|
53
53
|
Each generated project includes:
|
|
54
54
|
|
|
55
55
|
- **`src/index.ts`** — Cloudflare Workers entry point with route handling
|
|
56
56
|
- **`src/bot.ts`** — Bot handler using `@fluxy-chat/sdk`
|
|
57
|
+
- **`fluxy.config.ts`** — Room authz and publish middleware (basic template)
|
|
57
58
|
- **`wrangler.toml`** — Cloudflare Workers deployment config
|
|
58
59
|
- **`.dev.vars`** — Local development environment variables
|
|
59
60
|
- **`.env.example`** — Example environment variables for your adapter
|
|
60
61
|
- **`tsconfig.json`** — TypeScript configuration (for TS projects)
|
|
61
62
|
- **`README.md`** — Project-specific setup instructions
|
|
62
|
-
- **`.gitignore`** — Standard ignore patterns
|
|
63
63
|
|
|
64
|
-
## Package
|
|
64
|
+
## Package manager detection
|
|
65
65
|
|
|
66
66
|
The CLI auto-detects your package manager from lockfiles:
|
|
67
67
|
|
|
@@ -69,20 +69,13 @@ The CLI auto-detects your package manager from lockfiles:
|
|
|
69
69
|
- `yarn.lock` → yarn
|
|
70
70
|
- `package-lock.json` or none → npm
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Override with `--pm`.
|
|
73
73
|
|
|
74
|
-
##
|
|
74
|
+
## Related packages
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
# Build the CLI
|
|
81
|
-
pnpm build
|
|
82
|
-
|
|
83
|
-
# Run locally
|
|
84
|
-
node dist/index.js my-test-bot -y --adapter basic
|
|
85
|
-
```
|
|
76
|
+
- [`@fluxy-chat/sdk`](https://www.npmjs.com/package/@fluxy-chat/sdk)
|
|
77
|
+
- [`@fluxy-chat/agent`](https://www.npmjs.com/package/@fluxy-chat/agent)
|
|
78
|
+
- [`@fluxy-chat/config`](https://www.npmjs.com/package/@fluxy-chat/config)
|
|
86
79
|
|
|
87
80
|
## License
|
|
88
81
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example fluxy.config.ts — copy to your worker project root.
|
|
3
|
+
* See packages/config/README.md
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
defineConfig,
|
|
7
|
+
allow,
|
|
8
|
+
block,
|
|
9
|
+
defineMiddleware,
|
|
10
|
+
allowPublish,
|
|
11
|
+
} from "@fluxy-chat/config";
|
|
12
|
+
|
|
13
|
+
const moderate = defineMiddleware("publish", (ctx) => {
|
|
14
|
+
if (ctx.capabilities.publish === false) {
|
|
15
|
+
return { action: "block", reason: "You cannot post here." };
|
|
16
|
+
}
|
|
17
|
+
return allowPublish();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
client: { readOn: "visible", wsCache: "on", historyLimit: 50 },
|
|
22
|
+
rooms: {
|
|
23
|
+
"room-*": {
|
|
24
|
+
anonymous: true,
|
|
25
|
+
authz: () => allow({ publish: true }),
|
|
26
|
+
onPublish: [moderate.handler],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|