nubis 0.1.0-next.0 → 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 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
  }
@@ -704,7 +708,9 @@ async function syncCommands(options) {
704
708
  ...toCommandPayloads(options.project.tree),
705
709
  ...toMenuPayloads(options.project.menus)
706
710
  ];
707
- const remote = await options.rest.get(route);
711
+ const remote = await options.rest.get(route, {
712
+ query: new URLSearchParams({ with_localizations: "true" })
713
+ });
708
714
  const plan = planSync(local, remote);
709
715
  const scope = options.guildId ? "guild" : "global";
710
716
  if (options.dryRun || !hasChanges(plan))
@@ -905,7 +911,7 @@ var init_commands = __esm(() => {
905
911
  // package.json
906
912
  var package_default = {
907
913
  name: "nubis",
908
- version: "0.1.0-next.0",
914
+ version: "0.1.0-next.2",
909
915
  description: "The Discord bot framework that feels like building a modern web app. Built by Eytak.",
910
916
  keywords: [
911
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
  }
@@ -544,7 +548,9 @@ async function syncCommands(options) {
544
548
  ...toCommandPayloads(options.project.tree),
545
549
  ...toMenuPayloads(options.project.menus)
546
550
  ];
547
- const remote = await options.rest.get(route);
551
+ const remote = await options.rest.get(route, {
552
+ query: new URLSearchParams({ with_localizations: "true" })
553
+ });
548
554
  const plan = planSync(local, remote);
549
555
  const scope = options.guildId ? "guild" : "global";
550
556
  if (options.dryRun || !hasChanges(plan))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nubis",
3
- "version": "0.1.0-next.0",
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.0",
55
- "@nubisjs/testing": "0.1.0-next.0",
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
  }