create-seedcord 0.4.1 → 0.4.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/README.md +1 -1
- package/dist/index.mjs +25 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
- package/templates/bunfig.toml.hbs +4 -0
- package/templates/package.json.hbs +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
<div align="center">
|
|
19
19
|
|
|
20
|
-
[](https://www.npmjs.com/package/create-seedcord) [](https://nodejs.org) [](https://bun.com) [](LICENSE)
|
|
21
21
|
|
|
22
22
|
</div>
|
|
23
23
|
|
package/dist/index.mjs
CHANGED
|
@@ -1922,7 +1922,7 @@ const chalk = createChalk();
|
|
|
1922
1922
|
const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1923
1923
|
|
|
1924
1924
|
//#endregion
|
|
1925
|
-
//#region ../../packages/errors/dist/SeedcordError-
|
|
1925
|
+
//#region ../../packages/errors/dist/SeedcordError-UFUYeAQ_.mjs
|
|
1926
1926
|
/**
|
|
1927
1927
|
* All Seedcord error codes.
|
|
1928
1928
|
*/
|
|
@@ -1941,10 +1941,12 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
1941
1941
|
SeedcordErrorCode[SeedcordErrorCode["ConfigInvalidEnv"] = 1006] = "ConfigInvalidEnv";
|
|
1942
1942
|
/** A command usable in a guild is registered without the `Guilds` intent that caches guilds. */
|
|
1943
1943
|
SeedcordErrorCode[SeedcordErrorCode["MissingGuildsIntent"] = 1007] = "MissingGuildsIntent";
|
|
1944
|
-
/** The running Node version is below the range seedcord declares in `engines`. */
|
|
1945
|
-
SeedcordErrorCode[SeedcordErrorCode["
|
|
1944
|
+
/** The running Node or Bun version is below the range seedcord declares for it in `engines`. */
|
|
1945
|
+
SeedcordErrorCode[SeedcordErrorCode["UnsupportedRuntimeVersion"] = 1008] = "UnsupportedRuntimeVersion";
|
|
1946
1946
|
/** `DISCORD_BOT_TOKEN` passed its shape check and carries no readable application id. */
|
|
1947
1947
|
SeedcordErrorCode[SeedcordErrorCode["ConfigTokenUnreadable"] = 1009] = "ConfigTokenUnreadable";
|
|
1948
|
+
/** An edge config sets a REST sweeper interval. */
|
|
1949
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigEdgeRestSweeper"] = 1010] = "ConfigEdgeRestSweeper";
|
|
1948
1950
|
/** Attempted to add lifecycle tasks after startup already completed. */
|
|
1949
1951
|
SeedcordErrorCode[SeedcordErrorCode["LifecycleAddAfterCompletion"] = 1101] = "LifecycleAddAfterCompletion";
|
|
1950
1952
|
/** Attempted to add lifecycle tasks while startup is still running. */
|
|
@@ -2127,6 +2129,8 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
2127
2129
|
SeedcordErrorCode[SeedcordErrorCode["PluginKyselyConnectionFailed"] = 2211] = "PluginKyselyConnectionFailed";
|
|
2128
2130
|
/** Bootstrapper failed to ensure the target Postgres database exists. */
|
|
2129
2131
|
SeedcordErrorCode[SeedcordErrorCode["PluginKyselyBootstrapFailed"] = 2212] = "PluginKyselyBootstrapFailed";
|
|
2132
|
+
/** Two listed migration files share a name once their extensions are stripped. */
|
|
2133
|
+
SeedcordErrorCode[SeedcordErrorCode["PluginKyselyDuplicateMigrationName"] = 2213] = "PluginKyselyDuplicateMigrationName";
|
|
2130
2134
|
/** Config file default export was not an object. */
|
|
2131
2135
|
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidExport"] = 3101] = "CliConfigInvalidExport";
|
|
2132
2136
|
/** Config is missing the required instance string. */
|
|
@@ -2224,7 +2228,8 @@ const messages = {
|
|
|
2224
2228
|
[1001]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
|
|
2225
2229
|
[1009]: () => "DISCORD_BOT_TOKEN carries no readable application id. Discord builds the first part of a bot token from that id, so a token failing here is truncated or mistyped. Copy it again from your application's Bot page.",
|
|
2226
2230
|
[1007]: (commands) => `Add GatewayIntentBits.Guilds to clientOptions.intents. Without it discord.js doesn't cache any guild, so interaction.guild is null inside these commands: ${commands}.`,
|
|
2227
|
-
[
|
|
2231
|
+
[1010]: (key) => `Remove ${paint.sky(`bot.restOptions.${key}`)} from your edge config. A sweeper interval starts a timer at the worker's global scope, where workerd throws.`,
|
|
2232
|
+
[1008]: (runtime, required, running) => `seedcord requires ${runtime} ${required} but this process runs ${running}. Upgrade ${runtime} before starting the bot.`,
|
|
2228
2233
|
[1101]: () => "Cannot add tasks after startup sequence has already completed.",
|
|
2229
2234
|
[1102]: () => "Cannot add tasks while startup sequence is in progress.",
|
|
2230
2235
|
[1103]: () => "Cannot remove tasks while startup sequence is in progress.",
|
|
@@ -2316,6 +2321,7 @@ const messages = {
|
|
|
2316
2321
|
[2210]: () => "Kysely services accessed before the plugin finished initializing.",
|
|
2317
2322
|
[2211]: (databaseName) => databaseName ? `Could not connect to Postgres (${databaseName}).` : "Could not connect to Postgres.",
|
|
2318
2323
|
[2212]: (databaseName) => `Failed to ensure database ${databaseName} exists.`,
|
|
2324
|
+
[2213]: (name, first, second) => `${paint.sky(first)} and ${paint.sky(second)} are both the migration ${paint.sky(name)}. Kysely identifies a migration by its file name without the extension. Rename one file, or list only one of them.`,
|
|
2319
2325
|
[3101]: () => "Config file must default export an object.",
|
|
2320
2326
|
[3102]: () => "Config must include an `instance` string that points to your Seedcord default export.",
|
|
2321
2327
|
[3103]: (baseDir, candidates) => `Unable to locate a Seedcord config in ${baseDir}. Searched for ${candidates.join(", ")}.`,
|
|
@@ -2465,7 +2471,7 @@ function isSeedcordError(error, type, code) {
|
|
|
2465
2471
|
|
|
2466
2472
|
//#endregion
|
|
2467
2473
|
//#region src/cli/banner.ts
|
|
2468
|
-
function banner(version = "0.4.
|
|
2474
|
+
function banner(version = "0.4.2") {
|
|
2469
2475
|
const wordmark = `${paint.flesh.bold("seed")}${paint.rind.bold("cord")}${paint.mute(" create")}`;
|
|
2470
2476
|
if (version === void 0) return wordmark;
|
|
2471
2477
|
return `${wordmark}${paint.pith(` • v${version}`)}`;
|
|
@@ -3682,7 +3688,7 @@ function silentSteps() {
|
|
|
3682
3688
|
|
|
3683
3689
|
//#endregion
|
|
3684
3690
|
//#region src/cli/version.ts
|
|
3685
|
-
const version = "0.4.
|
|
3691
|
+
const version = "0.4.2";
|
|
3686
3692
|
|
|
3687
3693
|
//#endregion
|
|
3688
3694
|
//#region src/cli/summary.ts
|
|
@@ -3912,6 +3918,13 @@ async function claimTarget(target) {
|
|
|
3912
3918
|
throw new SeedcordError(SeedcordErrorCode.CreateTargetNotEmpty, [target]);
|
|
3913
3919
|
}
|
|
3914
3920
|
|
|
3921
|
+
//#endregion
|
|
3922
|
+
//#region package.json
|
|
3923
|
+
var engines = {
|
|
3924
|
+
"node": ">=24.11",
|
|
3925
|
+
"bun": ">=1.4.2"
|
|
3926
|
+
};
|
|
3927
|
+
|
|
3915
3928
|
//#endregion
|
|
3916
3929
|
//#region src/template/context.ts
|
|
3917
3930
|
const MESSAGE_CAPABILITIES = /* @__PURE__ */ new Set([
|
|
@@ -3944,7 +3957,11 @@ function buildContext(answers, extras) {
|
|
|
3944
3957
|
publicKey: answers.publicKey ?? "",
|
|
3945
3958
|
botColor: answers.botColor,
|
|
3946
3959
|
developerUsername: extras.developerUsername,
|
|
3947
|
-
pm: {
|
|
3960
|
+
pm: {
|
|
3961
|
+
run: runPrefix(extras.agent),
|
|
3962
|
+
isBun: extras.agent === "bun"
|
|
3963
|
+
},
|
|
3964
|
+
engines
|
|
3948
3965
|
};
|
|
3949
3966
|
}
|
|
3950
3967
|
|
|
@@ -11332,7 +11349,7 @@ async function runInstallSteps(input, run, isGateway) {
|
|
|
11332
11349
|
async function writeProject(input, plan, existed) {
|
|
11333
11350
|
const context = buildContext(input.answers, {
|
|
11334
11351
|
developerUsername: plan.developerUsername,
|
|
11335
|
-
|
|
11352
|
+
agent: input.agent
|
|
11336
11353
|
});
|
|
11337
11354
|
try {
|
|
11338
11355
|
await input.steps.run({
|