Welcome to the migration guide for v9.0.0-Nirbose
. This guide will help you transition from v8.0.0-Capi
(or earlier versions) to the latest release. Due to the breaking changes and significant restructuring introduced in this version, careful attention to the migration steps is essential.
Version v9.0.0-Nirbose
represents a major overhaul, introducing:
- Full support for Bun and Deno.
- Package manager agnosticism for
npm
,yarn
,pnpm
,bun
, anddeno
. - A modern CLI with new features.
- Simplified project setup with cleaner dependencies and improved templating using EJS.
Migrating ensures access to these advancements while maintaining compatibility with the latest tools.
-
Project Structure Update
The
app/
directory has been replaced bycore/
.
Update your imports accordingly:- import * as app from "#app"; + import * as all from "#all"; - import { Foo } from "#app"; + import { Foo } from "#core/foo";
-
Node.js Built-in Module Imports
All Node.js built-in imports must now include thenode:
prefix:- import path from "path"; + import path from "node:path";
-
Discord.js Imports
If you're usingEmbedBuilder
or other classes fromdiscord.js
, ensure you import directly from the library:- import { EmbedBuilder } from "#app"; + import { EmbedBuilder } from "discord.js";
-
Removed File Extensions
All file imports should omit extensions:- import { Foo } from "./foo.js"; + import { Foo } from "./foo";
-
Moved ResponseCache
TheResponseCache
class has been removed from the core files:- import { ResponseCache } from "#database"; + import { ResponseCache } from "@ghom/orm";
- Install the latest version of the CLI globally:
npm i -g @ghom/bot.ts-cli@latest
- Remove the
esbuild
package from your project to prevent crashes:npm remove --purge @esbuild/linux-x64
- Install the following packages before running the update script:
npm install dotenv ejs fast-glob git-commit-info
- Create a
scripts/
directory at the root of your bot project:mkdir scripts
- Download the framework updater into the
scripts/
folder asupdate-framework.js
. - Download the compatibility file and place it at the root of your bot as
compatibility.json
.
-
From the root of your bot project, in a bash terminal, run the update script:
node scripts/update-framework.js
-
This script will:
- Update all native framework files.
- Install new dependencies required for the updated framework.
- Delete the following files and folders:
rm -rf src/app/ src/app.ts src/app.native.ts tests/ templates/button templates/command templates/cron templates/listener templates/mysql2 templates/pg templates/slash templates/sqlite3 templates/table
-
Define your engine (package manager and runtime) using the CLI:
bot config engine
-
This command will:
- Update the scripts in
package.json
. - Set the appropriate values in the
.env
file.
- Update the scripts in
- Convert all custom files in your project to account for the breaking changes listed earlier.
- Pay special attention to updated import paths, the removal of file extensions, and required prefixes for Node.js built-ins.
All versions prior to v9.0.0
are now officially deprecated. Support and updates are no longer provided for these versions. We strongly recommend migrating to v9.0.0-Nirbose
to benefit from enhanced features and long-term stability.