nexocord 1.0.5 → 1.1.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.
Files changed (72) hide show
  1. package/README.md +24 -69
  2. package/dist/bin/cli.js +1103 -104
  3. package/dist/cli/create/create.d.ts +2 -0
  4. package/dist/cli/create/create.d.ts.map +1 -0
  5. package/dist/cli/create/index.d.ts +2 -0
  6. package/dist/cli/create/index.d.ts.map +1 -0
  7. package/dist/cli/create/install.d.ts +3 -0
  8. package/dist/cli/create/install.d.ts.map +1 -0
  9. package/dist/cli/create/prompts.d.ts +6 -0
  10. package/dist/cli/create/prompts.d.ts.map +1 -0
  11. package/dist/cli/logger.d.ts +10 -0
  12. package/dist/cli/logger.d.ts.map +1 -0
  13. package/dist/cli/runner.d.ts +5 -0
  14. package/dist/cli/runner.d.ts.map +1 -0
  15. package/dist/cli/runtime.d.ts +4 -0
  16. package/dist/cli/runtime.d.ts.map +1 -0
  17. package/dist/cli/utils.d.ts +4 -0
  18. package/dist/cli/utils.d.ts.map +1 -0
  19. package/dist/commands/create/index.d.ts +4 -0
  20. package/dist/commands/create/index.d.ts.map +1 -0
  21. package/dist/commands/create/index.js +867 -0
  22. package/dist/commands/create/prompts.d.ts +46 -0
  23. package/dist/commands/create/prompts.d.ts.map +1 -0
  24. package/dist/commands/create/prompts.js +105 -0
  25. package/dist/commands/create/template.d.ts +23 -0
  26. package/dist/commands/create/template.d.ts.map +1 -0
  27. package/dist/commands/create/template.js +762 -0
  28. package/dist/commands/create/utils.d.ts +45 -0
  29. package/dist/commands/create/utils.d.ts.map +1 -0
  30. package/dist/commands/create/utils.js +119 -0
  31. package/dist/commands/create.command.d.ts +3 -0
  32. package/dist/commands/create.command.d.ts.map +1 -0
  33. package/dist/commands/dev.command.d.ts +3 -0
  34. package/dist/commands/dev.command.d.ts.map +1 -0
  35. package/dist/commands/start.command.d.ts +3 -0
  36. package/dist/commands/start.command.d.ts.map +1 -0
  37. package/dist/core/creators.d.ts.map +1 -1
  38. package/dist/core/modules/commands/handler.d.ts.map +1 -1
  39. package/dist/core/modules/events/handler.d.ts.map +1 -1
  40. package/dist/core/types/index.js +57456 -0
  41. package/dist/core/ui/index.js +57899 -0
  42. package/dist/core/utils/Responder.d.ts +1 -1
  43. package/dist/core/utils/Responder.d.ts.map +1 -1
  44. package/dist/core/utils/extensions.d.ts +4 -0
  45. package/dist/core/utils/extensions.d.ts.map +1 -0
  46. package/dist/core/utils/index.d.ts +0 -1
  47. package/dist/core/utils/index.d.ts.map +1 -1
  48. package/dist/core/utils/index.js +598 -0
  49. package/dist/create/generator.d.ts +10 -0
  50. package/dist/create/generator.d.ts.map +1 -0
  51. package/dist/create/prompts.d.ts +8 -0
  52. package/dist/create/prompts.d.ts.map +1 -0
  53. package/dist/create/templates/bun-js/README.md +7 -0
  54. package/dist/create/templates/bun-js/src/commands/utils/ping.tpl +10 -0
  55. package/dist/create/templates/bun-js/src/events/ready.tpl +10 -0
  56. package/dist/create/templates/bun-js/src/index.tpl +11 -0
  57. package/dist/create/templates/bun-ts/README.md +7 -0
  58. package/dist/create/templates/bun-ts/src/commands/utils/ping.tpl +10 -0
  59. package/dist/create/templates/bun-ts/src/events/ready.tpl +10 -0
  60. package/dist/create/templates/bun-ts/src/index.tpl +11 -0
  61. package/dist/create/templates/node-js/README.md +7 -0
  62. package/dist/create/templates/node-js/src/commands/utils/ping.tpl +10 -0
  63. package/dist/create/templates/node-js/src/events/ready.tpl +10 -0
  64. package/dist/create/templates/node-js/src/index.tpl +11 -0
  65. package/dist/create/templates/node-ts/README.md +7 -0
  66. package/dist/create/templates/node-ts/src/commands/utils/ping.tpl +10 -0
  67. package/dist/create/templates/node-ts/src/events/ready.tpl +10 -0
  68. package/dist/create/templates/node-ts/src/index.tpl +11 -0
  69. package/dist/index.cjs +88 -80
  70. package/dist/index.js +841 -832
  71. package/package.json +10 -9
  72. package/tsconfig.json +0 -31
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Nexocord
2
- ![npm](https://img.shields.io/npm/v/%40mitsuk%2Fnexocord)
3
- ![license](https://img.shields.io/npm/l/%40mitsuk%2Fnexocord)
2
+ ![npm](https://img.shields.io/npm/v/nexocord)
3
+ ![downloads](https://img.shields.io/npm/dm/nexocord)
4
+ ![license](https://img.shields.io/npm/nexocord)
5
+ ![types](https://img.shields.io/npm/types/nexocord)
4
6
 
5
7
  Nexocord é um framework para criação de bots Discord modernos usando TypeScript ou JavaScript, focado em organização, produtividade e escalabilidade desde o primeiro arquivo.
6
8
 
@@ -36,78 +38,29 @@ O Nexocord resolve isso oferecendo:
36
38
  npm install nexocord discord.js
37
39
  ```
38
40
 
39
- Com Bun:
41
+ ## ⚡ Primeiro bot com CLI
40
42
 
41
43
  ```bash
42
- bun add nexocord discord.js
44
+ npx nexo create meu-bot
45
+ cd meu-bot
46
+ npx nexo dev
43
47
  ```
44
48
 
49
+ Esse fluxo já cria a base inicial do projeto para você começar sem montar estrutura manualmente.
50
+
45
51
  ## ⚙️ Configuração
46
52
  Crie um arquivo .env:
47
53
  ```txt
48
54
  TOKEN=seu_token_aqui
49
55
  ```
50
56
 
51
- ## ⚡ Início rápido (JavaScript)
52
-
53
- Crie um arquivo de entrada (exemplo: `src/index.js`):
54
-
55
- ```js
56
- const { Bootstrap } = require('nexocord');
57
- const { GatewayIntentBits } = require('discord.js');
58
-
59
- async function main() {
60
- await Bootstrap.init({
61
- token: process.env.TOKEN,
62
- intents: [GatewayIntentBits.Guilds],
63
- paths: {
64
- commands: 'src/commands',
65
- events: 'src/events',
66
- },
67
- });
68
- }
69
-
70
- main()
71
- ```
72
-
73
-
74
- ### 📝 Exemplo de comando
75
-
76
- `src/commands/util/ping.ts`
77
-
78
- ```ts
79
- const { createCommand, CommandType } = require('nexocord');
80
-
81
- module.exports = createCommand({
82
- name: 'ping',
83
- description: 'Responde com pong!',
84
- type: CommandType.ChatInput,
85
- async run(interaction) {
86
- await interaction.reply({ content: 'Pong!' });
87
- },
88
- });
89
- ```
90
-
91
- ### 📡 Exemplo de evento
92
-
93
- `src/events/ready.ts`
94
-
95
- ```ts
96
- const { createEvent } = require('nexocord');
97
-
98
- module.exports = createEvent({
99
- name: 'ready',
100
- once: true,
101
- run(client) {
102
- console.log(`Bot ${client.user?.username} está online!`);
103
- },
104
- });
105
- ```
106
-
107
57
  ## 🧰 CLI
108
58
  O Nexocord inclui uma CLI própria.
109
59
 
110
60
  ```bash
61
+ # criar projeto
62
+ npx nexo create meu-bot
63
+
111
64
  # desenvolvimento
112
65
  npx nexo dev
113
66
 
@@ -121,16 +74,18 @@ npx nexo dev --watch
121
74
  npx nexo start dist/bot.js
122
75
  ```
123
76
 
124
- ## 📂 Estrutura sugerida
77
+ ## 📂 Estrutura criada pelo template
125
78
 
126
- ```txt
127
- src/
128
- commands/
129
- util/
130
- ping.ts
131
- events/
132
- ready.ts
133
- index.ts
79
+ ```
80
+ 📂 meu-bot/
81
+ ┣ 📂 src/
82
+ ┃ ┣ 📂 commands/
83
+ ┃ ┃ ┗ 📂 utils/
84
+ ┃ ┃ ┗ 📜 ping.ts
85
+ ┃ ┣ 📂 events/
86
+ ┃ ┃ ┗ 📜 ready.ts
87
+ ┃ ┗ 📜 index.ts
88
+ ┗ 📜 package.json
134
89
  ```
135
90
 
136
91
  ## 🚧 Status do projeto