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/cli.js +6 -2
- package/dist/node.js +5 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -536,7 +536,7 @@ var init_http = __esm(() => {
|
|
|
536
536
|
|
|
537
537
|
// src/loader.ts
|
|
538
538
|
import { readdir, stat } from "node:fs/promises";
|
|
539
|
-
import { extname, join as join3, relative, sep } from "node:path";
|
|
539
|
+
import { basename, extname, join as join3, relative, sep } from "node:path";
|
|
540
540
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
541
541
|
import {
|
|
542
542
|
buildCommandTree,
|
|
@@ -582,6 +582,10 @@ async function importModule(file, root, version) {
|
|
|
582
582
|
if (code === "ERR_UNKNOWN_FILE_EXTENSION") {
|
|
583
583
|
throw new NubisError3(`${relative(root, file)}: this runtime can't import ${extname(file)} files. Run the bot with Bun or Node 22.18+, or build it to JavaScript first.`);
|
|
584
584
|
}
|
|
585
|
+
const missing = error.message?.match(/Cannot find module '([^']+)' imported from (\S+)/);
|
|
586
|
+
if (code === "ERR_MODULE_NOT_FOUND" && missing?.[1] && missing[2] && !extname(missing[1]) && /\.[mc]?ts$/.test(missing[2])) {
|
|
587
|
+
throw new NubisError3(`${relative(root, missing[2])}: can't find "${relative(root, missing[1])}". Node needs the extension in imports between your own files: import "${basename(missing[1])}.ts", not "${basename(missing[1])}". Or run the CLI with Bun: bun --bun nubis dev.`);
|
|
588
|
+
}
|
|
585
589
|
throw error;
|
|
586
590
|
}
|
|
587
591
|
}
|
|
@@ -907,7 +911,7 @@ var init_commands = __esm(() => {
|
|
|
907
911
|
// package.json
|
|
908
912
|
var package_default = {
|
|
909
913
|
name: "nubis",
|
|
910
|
-
version: "0.1.0-next.
|
|
914
|
+
version: "0.1.0-next.2",
|
|
911
915
|
description: "The Discord bot framework that feels like building a modern web app. Built by Eytak.",
|
|
912
916
|
keywords: [
|
|
913
917
|
"discord",
|
package/dist/node.js
CHANGED
|
@@ -12,7 +12,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
12
12
|
|
|
13
13
|
// src/loader.ts
|
|
14
14
|
import { readdir, stat } from "node:fs/promises";
|
|
15
|
-
import { extname, join, relative, sep } from "node:path";
|
|
15
|
+
import { basename, extname, join, relative, sep } from "node:path";
|
|
16
16
|
import { pathToFileURL } from "node:url";
|
|
17
17
|
import {
|
|
18
18
|
buildCommandTree,
|
|
@@ -58,6 +58,10 @@ async function importModule(file, root, version) {
|
|
|
58
58
|
if (code === "ERR_UNKNOWN_FILE_EXTENSION") {
|
|
59
59
|
throw new NubisError(`${relative(root, file)}: this runtime can't import ${extname(file)} files. Run the bot with Bun or Node 22.18+, or build it to JavaScript first.`);
|
|
60
60
|
}
|
|
61
|
+
const missing = error.message?.match(/Cannot find module '([^']+)' imported from (\S+)/);
|
|
62
|
+
if (code === "ERR_MODULE_NOT_FOUND" && missing?.[1] && missing[2] && !extname(missing[1]) && /\.[mc]?ts$/.test(missing[2])) {
|
|
63
|
+
throw new NubisError(`${relative(root, missing[2])}: can't find "${relative(root, missing[1])}". Node needs the extension in imports between your own files: import "${basename(missing[1])}.ts", not "${basename(missing[1])}". Or run the CLI with Bun: bun --bun nubis dev.`);
|
|
64
|
+
}
|
|
61
65
|
throw error;
|
|
62
66
|
}
|
|
63
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nubis",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.2",
|
|
4
4
|
"description": "The Discord bot framework that feels like building a modern web app. Built by Eytak.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@discordjs/core": "^2.7.0",
|
|
52
52
|
"@discordjs/rest": "^2.6.3",
|
|
53
53
|
"@discordjs/ws": "^2.0.4",
|
|
54
|
-
"@nubisjs/core": "0.1.0-next.
|
|
55
|
-
"@nubisjs/testing": "0.1.0-next.
|
|
54
|
+
"@nubisjs/core": "0.1.0-next.2",
|
|
55
|
+
"@nubisjs/testing": "0.1.0-next.2",
|
|
56
56
|
"discord-api-types": "^0.38.59"
|
|
57
57
|
}
|
|
58
58
|
}
|