create-nubis 0.1.0-next.1 → 0.1.0-next.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/dist/index.js +15 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { resolve } from "node:path";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "create-nubis",
|
|
8
|
-
version: "0.1.0-next.
|
|
8
|
+
version: "0.1.0-next.2",
|
|
9
9
|
description: "Scaffold a new Nubis Discord bot. Built by Eytak.",
|
|
10
10
|
keywords: [
|
|
11
11
|
"discord",
|
|
@@ -55,19 +55,21 @@ function templateFiles(options) {
|
|
|
55
55
|
const bun = packageManager === "bun";
|
|
56
56
|
const run = packageManager === "npm" ? "npm run" : packageManager;
|
|
57
57
|
const testImport = bun ? "bun:test" : "vitest";
|
|
58
|
+
const cli = bun ? "bun --bun nubis" : "nubis";
|
|
58
59
|
return {
|
|
59
60
|
"package.json": json({
|
|
60
61
|
name,
|
|
61
62
|
private: true,
|
|
62
63
|
type: "module",
|
|
63
64
|
scripts: {
|
|
64
|
-
dev:
|
|
65
|
-
start:
|
|
66
|
-
sync:
|
|
65
|
+
dev: `${cli} dev`,
|
|
66
|
+
start: `${cli} start`,
|
|
67
|
+
sync: `${cli} sync --global`,
|
|
67
68
|
test: bun ? "bun test" : "vitest run",
|
|
68
69
|
typecheck: "tsc --noEmit"
|
|
69
70
|
},
|
|
70
71
|
dependencies: { nubis: nubisVersion },
|
|
72
|
+
...bun ? {} : { engines: { node: ">=22.18" } },
|
|
71
73
|
devDependencies: bun ? { "@types/bun": "^1.4.4", typescript: "^7.0.0" } : { "@types/node": "^22.0.0", typescript: "^7.0.0", vitest: "^5.1.0" }
|
|
72
74
|
}),
|
|
73
75
|
"tsconfig.json": json({
|
|
@@ -75,6 +77,7 @@ function templateFiles(options) {
|
|
|
75
77
|
target: "ES2022",
|
|
76
78
|
module: "Preserve",
|
|
77
79
|
moduleResolution: "bundler",
|
|
80
|
+
allowImportingTsExtensions: true,
|
|
78
81
|
types: [bun ? "bun" : "node"],
|
|
79
82
|
strict: true,
|
|
80
83
|
noEmit: true,
|
|
@@ -110,6 +113,10 @@ A Discord bot built with [Nubis](https://eytak.com/nubis). Docs: https://eytak.c
|
|
|
110
113
|
2. Copy \`.env.example\` to \`.env\` and fill it in.
|
|
111
114
|
3. Run the tests: \`${run} test\`
|
|
112
115
|
4. Start the bot: \`${run} dev\`
|
|
116
|
+
${bun ? "" : `
|
|
117
|
+
Needs Node 22.18 or later, which runs TypeScript files directly.
|
|
118
|
+
`}
|
|
119
|
+
Import your own files with their extension (\`../components/counter.ts\`): Node needs it, and Bun accepts it.
|
|
113
120
|
|
|
114
121
|
## Deploying
|
|
115
122
|
|
|
@@ -171,7 +178,7 @@ export default command({
|
|
|
171
178
|
});
|
|
172
179
|
`,
|
|
173
180
|
"commands/counter.ts": `import { command } from "nubis";
|
|
174
|
-
import { counter } from "../components/counter";
|
|
181
|
+
import { counter } from "../components/counter.ts";
|
|
175
182
|
|
|
176
183
|
export default command({
|
|
177
184
|
description: "A button that counts clicks",
|
|
@@ -202,9 +209,9 @@ export default event("ready", (data) => {
|
|
|
202
209
|
`,
|
|
203
210
|
"tests/commands.test.ts": `import { describe, expect, test } from "${testImport}";
|
|
204
211
|
import { fake, testCommand, testComponent } from "nubis/testing";
|
|
205
|
-
import { counter } from "../components/counter";
|
|
206
|
-
import echo from "../commands/echo";
|
|
207
|
-
import ping from "../commands/ping";
|
|
212
|
+
import { counter } from "../components/counter.ts";
|
|
213
|
+
import echo from "../commands/echo.ts";
|
|
214
|
+
import ping from "../commands/ping.ts";
|
|
208
215
|
|
|
209
216
|
describe("commands", () => {
|
|
210
217
|
test("/ping answers", async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nubis",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.2",
|
|
4
4
|
"description": "Scaffold a new Nubis Discord bot. Built by Eytak.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"lint": "biome lint ."
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"nubis": "0.1.0-next.
|
|
37
|
+
"nubis": "0.1.0-next.2"
|
|
38
38
|
}
|
|
39
39
|
}
|