create-seedcord 0.4.0 → 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 CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  <div align="center">
19
19
 
20
- [![npm](https://img.shields.io/npm/v/create-seedcord?style=flat-square&logo=npm&logoColor=c8341f&label=&labelColor=1f1f1f&color=c8341f)](https://www.npmjs.com/package/create-seedcord) [![node](https://img.shields.io/node/v/create-seedcord?style=flat-square&label=node&labelColor=1f1f1f&color=4d7d33)](https://nodejs.org) [![license](https://img.shields.io/npm/l/create-seedcord?style=flat-square&label=license&labelColor=1f1f1f&color=f8f6e8)](LICENSE)
20
+ [![npm](https://img.shields.io/npm/v/create-seedcord?style=flat-square&label=npm&labelColor=1f1f1f&color=c8341f)](https://www.npmjs.com/package/create-seedcord) [![node](https://img.shields.io/node/v/create-seedcord?style=flat-square&label=node&labelColor=1f1f1f&color=4d7d33)](https://nodejs.org) [![bun](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fseedcord%2Fseedcord%2Fnext%2Fcli%2Fcreate-seedcord%2Fpackage.json&query=%24.engines.bun&style=flat-square&label=bun&labelColor=1f1f1f&color=fbf0df)](https://bun.com) [![license](https://img.shields.io/npm/l/create-seedcord?style=flat-square&label=license&labelColor=1f1f1f&color=f8f6e8)](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-CFERGyXK.mjs
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["UnsupportedNodeVersion"] = 1008] = "UnsupportedNodeVersion";
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
- [1008]: (required, running) => `seedcord requires Node ${required} and this process runs ${running}. Upgrade Node before starting the bot.`,
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.0") {
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.0";
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: { run: extras.runCommand }
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
- runCommand: runPrefix(input.agent)
11352
+ agent: input.agent
11336
11353
  });
11337
11354
  try {
11338
11355
  await input.steps.run({