create-seedcord 0.1.0 → 0.1.2-next.0
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 +25 -12
- package/dist/index.mjs +201 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -9
- package/templates/.vscode/extensions.json.hbs +3 -0
- package/templates/prettier.config.mjs.hbs +1 -1
- package/templates/seedcord.config.ts.hbs +6 -0
package/dist/index.mjs
CHANGED
|
@@ -1922,27 +1922,23 @@ 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-BLQ8_el7.mjs
|
|
1926
1926
|
/**
|
|
1927
1927
|
* All Seedcord error codes.
|
|
1928
1928
|
*/
|
|
1929
1929
|
let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
1930
|
-
/** DISCORD_BOT_TOKEN is not present in the environment. */
|
|
1931
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigMissingDiscordToken"] = 1001] = "ConfigMissingDiscordToken";
|
|
1932
|
-
/** DISCORD_BOT_TOKEN is present but fails validation. */
|
|
1933
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectDiscordToken"] = 1002] = "ConfigIncorrectDiscordToken";
|
|
1934
1930
|
/** One or more configured emojis could not be resolved at startup. */
|
|
1935
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] =
|
|
1931
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigEmojiUnresolved"] = 1001] = "ConfigEmojiUnresolved";
|
|
1936
1932
|
/** A webhook reporter's env var is set but fails webhook URL validation. */
|
|
1937
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] =
|
|
1933
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookUrlInvalid"] = 1002] = "ConfigWebhookUrlInvalid";
|
|
1938
1934
|
/** A configured webhook does not exist on Discord (deleted, or a wrong id or token). */
|
|
1939
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] =
|
|
1940
|
-
/** DISCORD_PUBLIC_KEY is not present in the environment. */
|
|
1941
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigMissingPublicKey"] = 1006] = "ConfigMissingPublicKey";
|
|
1942
|
-
/** DISCORD_PUBLIC_KEY is present but fails validation. */
|
|
1943
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigIncorrectPublicKey"] = 1007] = "ConfigIncorrectPublicKey";
|
|
1935
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigWebhookNotFound"] = 1003] = "ConfigWebhookNotFound";
|
|
1944
1936
|
/** The generated route manifest was imported before `seedcord build` generated it. */
|
|
1945
|
-
SeedcordErrorCode[SeedcordErrorCode["ConfigManifestNotGenerated"] =
|
|
1937
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigManifestNotGenerated"] = 1004] = "ConfigManifestNotGenerated";
|
|
1938
|
+
/** A required environment variable is not present. */
|
|
1939
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigMissingEnv"] = 1005] = "ConfigMissingEnv";
|
|
1940
|
+
/** An environment variable is present and fails validation. */
|
|
1941
|
+
SeedcordErrorCode[SeedcordErrorCode["ConfigInvalidEnv"] = 1006] = "ConfigInvalidEnv";
|
|
1946
1942
|
/** Attempted to add lifecycle tasks after startup already completed. */
|
|
1947
1943
|
SeedcordErrorCode[SeedcordErrorCode["LifecycleAddAfterCompletion"] = 1101] = "LifecycleAddAfterCompletion";
|
|
1948
1944
|
/** Attempted to add lifecycle tasks while startup is still running. */
|
|
@@ -1979,18 +1975,16 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
1979
1975
|
SeedcordErrorCode[SeedcordErrorCode["CoreAccessorUnresolved"] = 1210] = "CoreAccessorUnresolved";
|
|
1980
1976
|
/** Interaction middleware decorated with disallowed event filters. */
|
|
1981
1977
|
SeedcordErrorCode[SeedcordErrorCode["DecoratorInteractionEventFilter"] = 1301] = "DecoratorInteractionEventFilter";
|
|
1982
|
-
/** A decorator could not find the original method being decorated. */
|
|
1983
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorMethodNotFound"] = 1302] = "DecoratorMethodNotFound";
|
|
1984
1978
|
/** A command decorator attempted to re-register an existing command scope. */
|
|
1985
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandAlreadyRegistered"] =
|
|
1979
|
+
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandAlreadyRegistered"] = 1302] = "DecoratorCommandAlreadyRegistered";
|
|
1986
1980
|
/** A global command decorator specified guild IDs, which is not allowed. */
|
|
1987
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGlobalWithGuilds"] =
|
|
1981
|
+
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGlobalWithGuilds"] = 1303] = "DecoratorCommandGlobalWithGuilds";
|
|
1988
1982
|
/** A guild command decorator omitted the required guild ID list. */
|
|
1989
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGuildWithoutGuilds"] =
|
|
1983
|
+
SeedcordErrorCode[SeedcordErrorCode["DecoratorCommandGuildWithoutGuilds"] = 1304] = "DecoratorCommandGuildWithoutGuilds";
|
|
1990
1984
|
/** Middleware priority provided by the decorator was not a finite number. */
|
|
1991
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorInvalidMiddlewarePriority"] =
|
|
1985
|
+
SeedcordErrorCode[SeedcordErrorCode["DecoratorInvalidMiddlewarePriority"] = 1305] = "DecoratorInvalidMiddlewarePriority";
|
|
1992
1986
|
/** A WebhookLog subclass is missing its `@WebhookUrl` decorator. */
|
|
1993
|
-
SeedcordErrorCode[SeedcordErrorCode["DecoratorWebhookUrlMissing"] =
|
|
1987
|
+
SeedcordErrorCode[SeedcordErrorCode["DecoratorWebhookUrlMissing"] = 1306] = "DecoratorWebhookUrlMissing";
|
|
1994
1988
|
/** Two interaction handlers registered the same route within a scope. */
|
|
1995
1989
|
SeedcordErrorCode[SeedcordErrorCode["InteractionDuplicateRoute"] = 1401] = "InteractionDuplicateRoute";
|
|
1996
1990
|
/** Two different interaction middleware classes share a class name. */
|
|
@@ -2055,6 +2049,8 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
2055
2049
|
SeedcordErrorCode[SeedcordErrorCode["ColorOutOfRange"] = 1902] = "ColorOutOfRange";
|
|
2056
2050
|
/** A plugin's constructor rejected its options through `rejectOptions`. */
|
|
2057
2051
|
SeedcordErrorCode[SeedcordErrorCode["PluginOptionsRejected"] = 2001] = "PluginOptionsRejected";
|
|
2052
|
+
/** Two or more plugins threw while disposing. */
|
|
2053
|
+
SeedcordErrorCode[SeedcordErrorCode["PluginDisposeFailures"] = 2002] = "PluginDisposeFailures";
|
|
2058
2054
|
/** Mongoose service class is missing the `@RegisterMongooseService` decorator. */
|
|
2059
2055
|
SeedcordErrorCode[SeedcordErrorCode["PluginMongooseServiceDecoratorMissing"] = 2101] = "PluginMongooseServiceDecoratorMissing";
|
|
2060
2056
|
/** Mongoose client failed to establish a connection. */
|
|
@@ -2095,72 +2091,54 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
2095
2091
|
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidExport"] = 3101] = "CliConfigInvalidExport";
|
|
2096
2092
|
/** Config is missing the required instance string. */
|
|
2097
2093
|
SeedcordErrorCode[SeedcordErrorCode["CliConfigMissingInstance"] = 3102] = "CliConfigMissingInstance";
|
|
2098
|
-
/** Config root was provided but not a string. */
|
|
2099
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidRoot"] = 3103] = "CliConfigInvalidRoot";
|
|
2100
2094
|
/** Unable to locate a Seedcord config file. */
|
|
2101
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigNotFound"] =
|
|
2095
|
+
SeedcordErrorCode[SeedcordErrorCode["CliConfigNotFound"] = 3103] = "CliConfigNotFound";
|
|
2102
2096
|
/** CLI entry file does not exist. */
|
|
2103
|
-
SeedcordErrorCode[SeedcordErrorCode["CliEntryNotFound"] =
|
|
2097
|
+
SeedcordErrorCode[SeedcordErrorCode["CliEntryNotFound"] = 3104] = "CliEntryNotFound";
|
|
2104
2098
|
/** tsx failed to import the provided entry file. */
|
|
2105
|
-
SeedcordErrorCode[SeedcordErrorCode["CliTsxImportFailed"] =
|
|
2099
|
+
SeedcordErrorCode[SeedcordErrorCode["CliTsxImportFailed"] = 3105] = "CliTsxImportFailed";
|
|
2106
2100
|
/** Native import and jiti fallback both failed. */
|
|
2107
|
-
SeedcordErrorCode[SeedcordErrorCode["CliImportFailed"] =
|
|
2101
|
+
SeedcordErrorCode[SeedcordErrorCode["CliImportFailed"] = 3106] = "CliImportFailed";
|
|
2108
2102
|
/** Seedcord instance export is missing a start() method. */
|
|
2109
|
-
SeedcordErrorCode[SeedcordErrorCode["CliInstanceInvalid"] =
|
|
2103
|
+
SeedcordErrorCode[SeedcordErrorCode["CliInstanceInvalid"] = 3107] = "CliInstanceInvalid";
|
|
2110
2104
|
/** Seedcord instance threw during startup. */
|
|
2111
|
-
SeedcordErrorCode[SeedcordErrorCode["CliStartFailed"] =
|
|
2105
|
+
SeedcordErrorCode[SeedcordErrorCode["CliStartFailed"] = 3108] = "CliStartFailed";
|
|
2112
2106
|
/** Config is missing the required entry string. */
|
|
2113
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigMissingEntry"] =
|
|
2114
|
-
/** Config build options must be an object when provided. */
|
|
2115
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidBuild"] = 3111] = "CliConfigInvalidBuild";
|
|
2116
|
-
/** Config build outDir must be a string when provided. */
|
|
2117
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidBuildOutDir"] = 3112] = "CliConfigInvalidBuildOutDir";
|
|
2118
|
-
/** Config build tsconfig must be a string when provided. */
|
|
2119
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidBuildTsconfig"] = 3113] = "CliConfigInvalidBuildTsconfig";
|
|
2120
|
-
/** Config build bootstrap must be a string when provided. */
|
|
2121
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidBuildBootstrap"] = 3114] = "CliConfigInvalidBuildBootstrap";
|
|
2107
|
+
SeedcordErrorCode[SeedcordErrorCode["CliConfigMissingEntry"] = 3109] = "CliConfigMissingEntry";
|
|
2122
2108
|
/** Entry file must be inside the configured root directory. */
|
|
2123
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigEntryOutsideRoot"] =
|
|
2109
|
+
SeedcordErrorCode[SeedcordErrorCode["CliConfigEntryOutsideRoot"] = 3110] = "CliConfigEntryOutsideRoot";
|
|
2124
2110
|
/** Unable to locate a TypeScript config file for builds. */
|
|
2125
|
-
SeedcordErrorCode[SeedcordErrorCode["CliBuildTsconfigNotFound"] =
|
|
2111
|
+
SeedcordErrorCode[SeedcordErrorCode["CliBuildTsconfigNotFound"] = 3111] = "CliBuildTsconfigNotFound";
|
|
2126
2112
|
/** TypeScript reported diagnostics during emit. */
|
|
2127
|
-
SeedcordErrorCode[SeedcordErrorCode["CliBuildFailed"] =
|
|
2113
|
+
SeedcordErrorCode[SeedcordErrorCode["CliBuildFailed"] = 3112] = "CliBuildFailed";
|
|
2128
2114
|
/** Unable to write the generated bootstrap file. */
|
|
2129
|
-
SeedcordErrorCode[SeedcordErrorCode["CliBootstrapWriteFailed"] =
|
|
2130
|
-
/** Config tsconfig must be a string when provided. */
|
|
2131
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidTsconfig"] = 3119] = "CliConfigInvalidTsconfig";
|
|
2132
|
-
/** Config hmr options must be an object when provided. */
|
|
2133
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidHmr"] = 3120] = "CliConfigInvalidHmr";
|
|
2134
|
-
/** Config hmr restart patterns must be an array of strings when provided. */
|
|
2135
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidHmrRestart"] = 3121] = "CliConfigInvalidHmrRestart";
|
|
2115
|
+
SeedcordErrorCode[SeedcordErrorCode["CliBootstrapWriteFailed"] = 3113] = "CliBootstrapWriteFailed";
|
|
2136
2116
|
/** Two commands resolve to the same slash route during codegen. */
|
|
2137
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCodegenDuplicateRoute"] =
|
|
2117
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCodegenDuplicateRoute"] = 3114] = "CliCodegenDuplicateRoute";
|
|
2138
2118
|
/** The commands directory could not be read during codegen. */
|
|
2139
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCodegenCommandsDirUnreadable"] =
|
|
2119
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCodegenCommandsDirUnreadable"] = 3115] = "CliCodegenCommandsDirUnreadable";
|
|
2140
2120
|
/** Two context-menu commands of the same kind share a name during codegen. */
|
|
2141
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCodegenDuplicateContextMenu"] =
|
|
2121
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCodegenDuplicateContextMenu"] = 3116] = "CliCodegenDuplicateContextMenu";
|
|
2142
2122
|
/** Could not resolve the application from the bot token during `commands --clean`. */
|
|
2143
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCleanAppFetchFailed"] =
|
|
2123
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCleanAppFetchFailed"] = 3117] = "CliCleanAppFetchFailed";
|
|
2144
2124
|
/** `commands --clean` ran with neither --guild nor --all-guilds. */
|
|
2145
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCleanNoGuilds"] =
|
|
2125
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCleanNoGuilds"] = 3118] = "CliCleanNoGuilds";
|
|
2146
2126
|
/** `commands --clean` combined --purge with --all-guilds, which would wipe every guild. */
|
|
2147
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCleanPurgeAllGuilds"] =
|
|
2127
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCleanPurgeAllGuilds"] = 3119] = "CliCleanPurgeAllGuilds";
|
|
2148
2128
|
/** An interactive prompt was cancelled (Ctrl-C), so the command aborts without changes. */
|
|
2149
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCancelled"] =
|
|
2129
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCancelled"] = 3120] = "CliCancelled";
|
|
2150
2130
|
/** `commands --clean --all-guilds` matched more guilds than the safety threshold without `--yes`. */
|
|
2151
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCleanLargeBotUnconfirmed"] =
|
|
2131
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCleanLargeBotUnconfirmed"] = 3121] = "CliCleanLargeBotUnconfirmed";
|
|
2152
2132
|
/** `commands --clean --apply` ran in a non-interactive environment without `--yes`, where it cannot prompt. */
|
|
2153
|
-
SeedcordErrorCode[SeedcordErrorCode["CliCleanApplyNeedsYes"] =
|
|
2154
|
-
/** Config hmr rollback flag must be a boolean when provided. */
|
|
2155
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidHmrRollback"] = 3131] = "CliConfigInvalidHmrRollback";
|
|
2156
|
-
/** Config tunnel must be a boolean or an https URL when provided. */
|
|
2157
|
-
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidTunnel"] = 3132] = "CliConfigInvalidTunnel";
|
|
2133
|
+
SeedcordErrorCode[SeedcordErrorCode["CliCleanApplyNeedsYes"] = 3122] = "CliCleanApplyNeedsYes";
|
|
2158
2134
|
/** The cloudflared metrics server never reported a quick-tunnel hostname. */
|
|
2159
|
-
SeedcordErrorCode[SeedcordErrorCode["CliTunnelUrlUnavailable"] =
|
|
2135
|
+
SeedcordErrorCode[SeedcordErrorCode["CliTunnelUrlUnavailable"] = 3123] = "CliTunnelUrlUnavailable";
|
|
2160
2136
|
/** Discord rejected the tunnel URL as an interactions endpoint. */
|
|
2161
|
-
SeedcordErrorCode[SeedcordErrorCode["CliTunnelNotVerified"] =
|
|
2137
|
+
SeedcordErrorCode[SeedcordErrorCode["CliTunnelNotVerified"] = 3124] = "CliTunnelNotVerified";
|
|
2162
2138
|
/** The tunnel URL never answered its health probe. */
|
|
2163
|
-
SeedcordErrorCode[SeedcordErrorCode["CliTunnelUnreachable"] =
|
|
2139
|
+
SeedcordErrorCode[SeedcordErrorCode["CliTunnelUnreachable"] = 3125] = "CliTunnelUnreachable";
|
|
2140
|
+
/** A config field is present with the wrong shape. */
|
|
2141
|
+
SeedcordErrorCode[SeedcordErrorCode["CliConfigInvalidField"] = 3126] = "CliConfigInvalidField";
|
|
2164
2142
|
/** A create prompt was cancelled (Ctrl-C), and nothing has been written yet. */
|
|
2165
2143
|
SeedcordErrorCode[SeedcordErrorCode["CreateCancelled"] = 3201] = "CreateCancelled";
|
|
2166
2144
|
/** A flag supplied an answer for a question the earlier answers skip. */
|
|
@@ -2175,16 +2153,33 @@ let SeedcordErrorCode = /* @__PURE__ */ function(SeedcordErrorCode) {
|
|
|
2175
2153
|
SeedcordErrorCode[SeedcordErrorCode["CreateStepFailed"] = 3206] = "CreateStepFailed";
|
|
2176
2154
|
return SeedcordErrorCode;
|
|
2177
2155
|
}({});
|
|
2156
|
+
const BRAND = {
|
|
2157
|
+
flesh: "#f04e36",
|
|
2158
|
+
rind: "#6fab49",
|
|
2159
|
+
pith: "#f8f6e8"
|
|
2160
|
+
};
|
|
2161
|
+
const paint = {
|
|
2162
|
+
sky: chalk.hex("#8fc7ff"),
|
|
2163
|
+
iris: chalk.hex("#e29bff"),
|
|
2164
|
+
mint: chalk.hex("#66d98a"),
|
|
2165
|
+
amber: chalk.hex("#ffc061"),
|
|
2166
|
+
coral: chalk.hex("#ff6b85"),
|
|
2167
|
+
flesh: chalk.hex(BRAND.flesh),
|
|
2168
|
+
rind: chalk.hex(BRAND.rind),
|
|
2169
|
+
pith: chalk.hex(BRAND.pith),
|
|
2170
|
+
mute: chalk.dim,
|
|
2171
|
+
bold: chalk.bold,
|
|
2172
|
+
italic: chalk.italic,
|
|
2173
|
+
underline: chalk.underline
|
|
2174
|
+
};
|
|
2178
2175
|
/** @internal */
|
|
2179
2176
|
const messages = {
|
|
2180
|
-
[
|
|
2181
|
-
[
|
|
2182
|
-
[
|
|
2183
|
-
[
|
|
2184
|
-
[
|
|
2185
|
-
[
|
|
2186
|
-
[1005]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
|
|
2187
|
-
[1003]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
|
|
2177
|
+
[1005]: (name) => `Missing ${name} environment variable.`,
|
|
2178
|
+
[1006]: (name, expected) => expected ? `Invalid ${name} value. Expected ${expected}.` : `Invalid ${name} value.`,
|
|
2179
|
+
[1004]: () => "The route manifest is generated by `seedcord build`. Run the build before importing it.",
|
|
2180
|
+
[1002]: (envKey) => `${envKey} is not a well-formed Discord webhook url.`,
|
|
2181
|
+
[1003]: (envKey) => `The webhook behind ${envKey} does not exist on Discord.`,
|
|
2182
|
+
[1001]: (count, failures) => `Could not resolve ${count} configured emoji${count === 1 ? "" : "s"} at startup.\n${failures}`,
|
|
2188
2183
|
[1101]: () => "Cannot add tasks after startup sequence has already completed.",
|
|
2189
2184
|
[1102]: () => "Cannot add tasks while startup sequence is in progress.",
|
|
2190
2185
|
[1103]: () => "Cannot remove tasks while startup sequence is in progress.",
|
|
@@ -2203,22 +2198,21 @@ const messages = {
|
|
|
2203
2198
|
[1209]: () => "The bot's application id could not be resolved.",
|
|
2204
2199
|
[1210]: (accessor, key) => `${accessor}.${key} has no value yet. ${accessor} fills during startup, and a read at the top of a file runs before that.`,
|
|
2205
2200
|
[1301]: () => "Interaction middleware cannot specify event filters.",
|
|
2206
|
-
[1302]: () => "
|
|
2207
|
-
[1303]: (
|
|
2208
|
-
[1304]: () => "RegisterCommand(\"
|
|
2209
|
-
[1305]: () => "
|
|
2210
|
-
[1306]: () =>
|
|
2211
|
-
[1307]: (className) => `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,
|
|
2201
|
+
[1302]: (commandName, existingScope, requestedScope) => `Command "${commandName}" is already registered as a "${existingScope}" command and cannot be re-registered as a "${requestedScope}" command.`,
|
|
2202
|
+
[1303]: () => "RegisterCommand(\"global\") cannot have guilds specified.",
|
|
2203
|
+
[1304]: () => "RegisterCommand(\"guild\") requires a non-empty guilds array.",
|
|
2204
|
+
[1305]: () => "Middleware priority must be a finite number.",
|
|
2205
|
+
[1306]: (className) => `${className} extends WebhookLog and needs a @WebhookUrl decorator naming its env var.`,
|
|
2212
2206
|
[1401]: (route, first, second) => `Two interaction handlers resolve to the same route \`${route}\`. Registered by ${first} and ${second}. Rename one.`,
|
|
2213
2207
|
[1402]: (name) => `Two different interaction middleware classes share the name \`${name}\`. Rename one so they do not collide.`,
|
|
2214
2208
|
[1403]: (route, exportName, from) => `Route \`${route}\` loads \`${exportName}\` from ${from}, which exports no such name.`,
|
|
2215
2209
|
[1404]: (keys, exportName, from) => `Subscriber row for \`${keys}\` loads \`${exportName}\` from ${from}, which does not extend Subscriber.`,
|
|
2216
2210
|
[1405]: (route, from) => `Route \`${route}\` failed to import ${from}.`,
|
|
2217
|
-
[1501]: (method, reason, alternative, routeId) => `${
|
|
2218
|
-
[1502]: (componentClass, index, detail, routeId) => `${
|
|
2219
|
-
[1503]: (method, targetId, routeId) => `${
|
|
2220
|
-
[1504]: (method, routeId) => `${
|
|
2221
|
-
[1505]: (method, routeId) => `The interaction callback for ${
|
|
2211
|
+
[1501]: (method, reason, alternative, routeId) => `${paint.sky(`${method}()`)} was called when ${reason}.\n${alternative} (route ${paint.mute(routeId)})`,
|
|
2212
|
+
[1502]: (componentClass, index, detail, routeId) => `${paint.sky(componentClass)} at components[${index}] failed to serialize: ${detail.replace(/\.$/, "")}. (route ${paint.mute(routeId)})`,
|
|
2213
|
+
[1503]: (method, targetId, routeId) => `${paint.sky(`${method}()`)} was passed message ${targetId}, which this interaction did not send.\nPass a message this interaction sent, returned by reply(), followUp(), edit(), or update(). (route ${paint.mute(routeId)})`,
|
|
2214
|
+
[1504]: (method, routeId) => `${paint.sky(`${method}()`)} was called on a modal opened from a command, which has no source message.\nUse reply() or defer() instead. (route ${paint.mute(routeId)})`,
|
|
2215
|
+
[1505]: (method, routeId) => `The interaction callback for ${paint.sky(`${method}()`)} returned no message. (route ${paint.mute(routeId)})`,
|
|
2222
2216
|
[1601]: (prefix) => `customId prefix ${JSON.stringify(prefix)} must be a non-empty string without a colon or control character.`,
|
|
2223
2217
|
[1602]: (field) => `customId field name ${JSON.stringify(field)} is integer-like, which JS reorders. Use a non-numeric name.`,
|
|
2224
2218
|
[1603]: (field) => `customId field ${JSON.stringify(field)} uses oneOf() with no choices.`,
|
|
@@ -2241,6 +2235,7 @@ const messages = {
|
|
|
2241
2235
|
[1901]: (value) => `Cannot convert ${value} into a color.`,
|
|
2242
2236
|
[1902]: () => "Color must be within the range 0 to 16777215 (0xffffff).",
|
|
2243
2237
|
[2001]: (pluginName, reason) => `${pluginName} rejected its options, ${reason.replace(/\.$/, "")}.`,
|
|
2238
|
+
[2002]: (count) => `${count} plugins failed to dispose.`,
|
|
2244
2239
|
[2101]: (className) => `Missing @RegisterMongooseService on ${className}.`,
|
|
2245
2240
|
[2102]: (databaseName) => databaseName ? `Could not connect to MongoDB (${databaseName}).` : "Could not connect to MongoDB.",
|
|
2246
2241
|
[2103]: () => "Failed to disconnect from MongoDB cleanly during shutdown.",
|
|
@@ -2261,39 +2256,30 @@ const messages = {
|
|
|
2261
2256
|
[2212]: (databaseName) => `Failed to ensure database ${databaseName} exists.`,
|
|
2262
2257
|
[3101]: () => "Config file must default export an object.",
|
|
2263
2258
|
[3102]: () => "Config must include an `instance` string that points to your Seedcord default export.",
|
|
2264
|
-
[3103]: () =>
|
|
2265
|
-
[
|
|
2266
|
-
[3110]: () =>
|
|
2267
|
-
[
|
|
2268
|
-
[
|
|
2269
|
-
[
|
|
2270
|
-
[
|
|
2271
|
-
[
|
|
2272
|
-
[
|
|
2273
|
-
[
|
|
2274
|
-
[
|
|
2275
|
-
[
|
|
2276
|
-
[
|
|
2277
|
-
[3116]: (
|
|
2278
|
-
[3117]: (
|
|
2279
|
-
[3118]: (
|
|
2280
|
-
[3119]: () => "
|
|
2281
|
-
[3120]: () => "
|
|
2282
|
-
[3121]: () =>
|
|
2283
|
-
[
|
|
2284
|
-
[
|
|
2285
|
-
[
|
|
2286
|
-
[
|
|
2287
|
-
[
|
|
2288
|
-
[3126]: () => "No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.",
|
|
2289
|
-
[3127]: () => "--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.",
|
|
2290
|
-
[3128]: () => "Cancelled.",
|
|
2291
|
-
[3129]: (count) => `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,
|
|
2292
|
-
[3130]: () => "Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes.",
|
|
2293
|
-
[3132]: () => "Config `tunnel` must be a boolean or an https URL.",
|
|
2294
|
-
[3133]: (seconds) => `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,
|
|
2295
|
-
[3134]: (url) => `Discord rejected ${url} as an interactions endpoint.`,
|
|
2296
|
-
[3135]: (url, seconds) => `${url} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,
|
|
2259
|
+
[3103]: (baseDir, candidates) => `Unable to locate a Seedcord config in ${baseDir}. Searched for ${candidates.join(", ")}.`,
|
|
2260
|
+
[3109]: () => "Config must include an `entry` string that points to your startup script.",
|
|
2261
|
+
[3110]: (entryPath, root) => `Entry file ${entryPath} must reside inside configured root ${root}.`,
|
|
2262
|
+
[3104]: (entryPath) => `Cannot find entry file at ${entryPath}.`,
|
|
2263
|
+
[3105]: (entryPath, reason) => `Failed to import ${entryPath} via tsx: ${reason}`,
|
|
2264
|
+
[3106]: (entryPath, nativeReason, fallbackReason) => `Failed to import ${entryPath}: ${nativeReason} (the jiti fallback also failed: ${fallbackReason})`,
|
|
2265
|
+
[3107]: () => "Seedcord instance must default export an object with a start() method.",
|
|
2266
|
+
[3108]: (instancePath, reason) => `Failed to start Seedcord from ${instancePath}: ${reason}`,
|
|
2267
|
+
[3111]: (hint) => `Unable to resolve a tsconfig for builds (${hint}). Provide build.tsconfig or add tsconfig.build.json / tsconfig.json.`,
|
|
2268
|
+
[3112]: (diagnostics) => `TypeScript build failed:\n${diagnostics}`,
|
|
2269
|
+
[3113]: (targetPath, reason) => `Failed to write bootstrap file at ${targetPath}: ${reason}`,
|
|
2270
|
+
[3114]: (route, firstFile, secondFile) => `Two commands resolve to the same slash route \`${route}\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,
|
|
2271
|
+
[3115]: (dir, reason) => `Could not read the commands directory ${dir} during codegen. ${reason}`,
|
|
2272
|
+
[3116]: (kind, name, firstFile, secondFile) => `Two ${kind} context-menu commands share the name \`${name}\`. Defined in ${firstFile} and ${secondFile}. Rename one.`,
|
|
2273
|
+
[3117]: (reason) => `Could not resolve the application from the bot token. ${reason}`,
|
|
2274
|
+
[3118]: () => "No guilds given. Pass --guild <ids...> or --all-guilds. Global commands are never touched.",
|
|
2275
|
+
[3119]: () => "--purge cannot be combined with --all-guilds. Use --guild <ids> to purge specific guilds.",
|
|
2276
|
+
[3120]: () => "Cancelled.",
|
|
2277
|
+
[3121]: (count) => `Refusing to scan ${count} guilds without confirmation. Re-run with --yes, or name specific guilds with --guild <ids>.`,
|
|
2278
|
+
[3122]: () => "Refusing to delete without confirmation in a non-interactive environment. Re-run with --yes.",
|
|
2279
|
+
[3123]: (seconds) => `cloudflared did not report a tunnel URL within ${seconds}s. Check that the binary runs and that the network allows it.`,
|
|
2280
|
+
[3124]: (url) => `Discord rejected ${url} as an interactions endpoint.`,
|
|
2281
|
+
[3125]: (url, seconds) => `${url} did not answer within ${seconds}s, so nothing was PATCHed to Discord.`,
|
|
2282
|
+
[3126]: (field, expected) => `Config \`${field}\` must be ${expected} when provided.`,
|
|
2297
2283
|
[3201]: () => "Cancelled.",
|
|
2298
2284
|
[3202]: (flag) => `The --${flag} flag does not apply to the answers you gave.`,
|
|
2299
2285
|
[3203]: (flag, reason) => `--${flag}: ${reason}`,
|
|
@@ -2324,117 +2310,117 @@ function resolveMessage(code, args) {
|
|
|
2324
2310
|
return formatSeedcordErrorMessage(code, args);
|
|
2325
2311
|
}
|
|
2326
2312
|
function formatErrorName(name, _identifier, code) {
|
|
2327
|
-
return `${
|
|
2313
|
+
return `${paint.coral.bold(name)}[${paint.mute(code)}]`;
|
|
2314
|
+
}
|
|
2315
|
+
const kIdentifier = Symbol.for("seedcord.errors.identifier");
|
|
2316
|
+
const CODED = Symbol.for("seedcord.errors.coded");
|
|
2317
|
+
function brand(prototype) {
|
|
2318
|
+
Object.defineProperty(prototype, CODED, { value: true });
|
|
2319
|
+
}
|
|
2320
|
+
function isCoded(error) {
|
|
2321
|
+
return typeof error === "object" && error !== null && CODED in error;
|
|
2328
2322
|
}
|
|
2329
|
-
/**
|
|
2330
|
-
* Base class for Seedcord errors.
|
|
2331
|
-
*/
|
|
2332
2323
|
var SeedcordError = class extends Error {
|
|
2333
2324
|
code;
|
|
2334
|
-
|
|
2325
|
+
[kIdentifier];
|
|
2335
2326
|
type = "SeedcordError";
|
|
2336
2327
|
constructor(code, ...rest) {
|
|
2337
2328
|
const { args, options } = resolveCtorInputs(rest);
|
|
2338
2329
|
const message = resolveMessage(code, args);
|
|
2339
2330
|
super(message, options);
|
|
2340
2331
|
this.code = code;
|
|
2341
|
-
this
|
|
2342
|
-
this.name = formatErrorName(new.target.name, this
|
|
2332
|
+
this[kIdentifier] = resolveIdentifier(code);
|
|
2333
|
+
this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);
|
|
2343
2334
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
2344
2335
|
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, new.target);
|
|
2345
2336
|
}
|
|
2346
2337
|
};
|
|
2347
|
-
|
|
2348
|
-
* TypeError class for Seedcord errors.
|
|
2349
|
-
*/
|
|
2338
|
+
brand(SeedcordError.prototype);
|
|
2350
2339
|
var SeedcordTypeError = class extends TypeError {
|
|
2351
2340
|
code;
|
|
2352
|
-
|
|
2341
|
+
[kIdentifier];
|
|
2353
2342
|
type = "SeedcordTypeError";
|
|
2354
2343
|
constructor(code, ...rest) {
|
|
2355
2344
|
const { args, options } = resolveCtorInputs(rest);
|
|
2356
2345
|
const message = resolveMessage(code, args);
|
|
2357
2346
|
super(message, options);
|
|
2358
2347
|
this.code = code;
|
|
2359
|
-
this
|
|
2360
|
-
this.name = formatErrorName(new.target.name, this
|
|
2348
|
+
this[kIdentifier] = resolveIdentifier(code);
|
|
2349
|
+
this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);
|
|
2361
2350
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
2362
2351
|
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, new.target);
|
|
2363
2352
|
}
|
|
2364
2353
|
};
|
|
2365
|
-
|
|
2366
|
-
* RangeError class for Seedcord errors.
|
|
2367
|
-
*/
|
|
2354
|
+
brand(SeedcordTypeError.prototype);
|
|
2368
2355
|
var SeedcordRangeError = class extends RangeError {
|
|
2369
2356
|
code;
|
|
2370
|
-
|
|
2357
|
+
[kIdentifier];
|
|
2371
2358
|
type = "SeedcordRangeError";
|
|
2372
2359
|
constructor(code, ...rest) {
|
|
2373
2360
|
const { args, options } = resolveCtorInputs(rest);
|
|
2374
2361
|
const message = resolveMessage(code, args);
|
|
2375
2362
|
super(message, options);
|
|
2376
2363
|
this.code = code;
|
|
2377
|
-
this
|
|
2378
|
-
this.name = formatErrorName(new.target.name, this
|
|
2364
|
+
this[kIdentifier] = resolveIdentifier(code);
|
|
2365
|
+
this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);
|
|
2379
2366
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
2380
2367
|
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, new.target);
|
|
2381
2368
|
}
|
|
2382
2369
|
};
|
|
2370
|
+
brand(SeedcordRangeError.prototype);
|
|
2371
|
+
var SeedcordAggregateError = class extends AggregateError {
|
|
2372
|
+
code;
|
|
2373
|
+
[kIdentifier];
|
|
2374
|
+
type = "SeedcordAggregateError";
|
|
2375
|
+
constructor(code, errors, ...rest) {
|
|
2376
|
+
const { args, options } = resolveCtorInputs(rest);
|
|
2377
|
+
const message = resolveMessage(code, args);
|
|
2378
|
+
super(errors, message, options);
|
|
2379
|
+
this.code = code;
|
|
2380
|
+
this[kIdentifier] = resolveIdentifier(code);
|
|
2381
|
+
this.name = formatErrorName(new.target.name, this[kIdentifier], this.code);
|
|
2382
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
2383
|
+
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, new.target);
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
brand(SeedcordAggregateError.prototype);
|
|
2383
2387
|
/**
|
|
2384
2388
|
* Determines whether an unknown value is a Seedcord error, with optional narrowing by class and error code.
|
|
2385
2389
|
*
|
|
2386
2390
|
* @param error - The value to inspect.
|
|
2387
|
-
* @param type - Optional error class discriminator
|
|
2391
|
+
* @param type - Optional error class discriminator.
|
|
2388
2392
|
* @param code - Optional {@link SeedcordErrorCode} discriminator to narrow by code.
|
|
2389
2393
|
* @typeParam Type - What kind of {@link SeedcordErrorTypeString} to filter by.
|
|
2390
2394
|
* @typeParam Code - The specific {@link SeedcordErrorCode} to filter by.
|
|
2391
2395
|
*/
|
|
2392
2396
|
function isSeedcordError(error, type, code) {
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
const isSeedcordRangeErrorInstance = error instanceof SeedcordRangeError && error.type === "SeedcordRangeError";
|
|
2396
|
-
if (!isSeedcordErrorInstance && !isSeedcordTypeErrorInstance && !isSeedcordRangeErrorInstance) return false;
|
|
2397
|
-
if (!(type ? type === "SeedcordError" && isSeedcordErrorInstance || type === "SeedcordTypeError" && isSeedcordTypeErrorInstance || type === "SeedcordRangeError" && isSeedcordRangeErrorInstance : true)) return false;
|
|
2397
|
+
if (!isCoded(error)) return false;
|
|
2398
|
+
if (type && error.type !== type) return false;
|
|
2398
2399
|
if (code === void 0) return true;
|
|
2399
|
-
return error
|
|
2400
|
+
return error[kIdentifier] === resolveIdentifier(code);
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
//#endregion
|
|
2404
|
+
//#region src/cli/banner.ts
|
|
2405
|
+
function banner(version = "0.1.2-next.0") {
|
|
2406
|
+
const wordmark = `${paint.flesh.bold("seed")}${paint.rind.bold("cord")}${paint.mute(" create")}`;
|
|
2407
|
+
if (version === void 0) return wordmark;
|
|
2408
|
+
return `${wordmark}${paint.pith(` • v${version}`)}`;
|
|
2400
2409
|
}
|
|
2401
2410
|
|
|
2402
2411
|
//#endregion
|
|
2403
2412
|
//#region ../../packages/errors/dist/internal.index.mjs
|
|
2404
|
-
const
|
|
2405
|
-
flesh: "#f04e36",
|
|
2406
|
-
rind: "#6fab49",
|
|
2407
|
-
pith: "#f8f6e8"
|
|
2408
|
-
};
|
|
2409
|
-
const paint = {
|
|
2410
|
-
sky: chalk.hex("#8fc7ff"),
|
|
2411
|
-
iris: chalk.hex("#e29bff"),
|
|
2412
|
-
mint: chalk.hex("#66d98a"),
|
|
2413
|
-
amber: chalk.hex("#ffc061"),
|
|
2414
|
-
coral: chalk.hex("#ff6b85"),
|
|
2415
|
-
flesh: chalk.hex(BRAND.flesh),
|
|
2416
|
-
rind: chalk.hex(BRAND.rind),
|
|
2417
|
-
pith: chalk.hex(BRAND.pith),
|
|
2418
|
-
mute: chalk.dim
|
|
2419
|
-
};
|
|
2413
|
+
const ENV_NAME = "DISCORD_BOT_TOKEN";
|
|
2420
2414
|
/** @internal */
|
|
2421
2415
|
function validateDiscordToken(raw) {
|
|
2422
|
-
if (raw === null || raw === void 0) throw new SeedcordError(
|
|
2423
|
-
if (typeof raw !== "string") throw new SeedcordError(
|
|
2416
|
+
if (raw === null || raw === void 0) throw new SeedcordError(1005, [ENV_NAME]);
|
|
2417
|
+
if (typeof raw !== "string") throw new SeedcordError(1006, [ENV_NAME]);
|
|
2424
2418
|
const value = raw.trim();
|
|
2425
|
-
if (value === "") throw new SeedcordError(
|
|
2426
|
-
if (!/^[A-Za-z\d_-]{24,}\.[A-Za-z\d_-]{6,}\.[A-Za-z\d_-]{27,}$/.test(value)) throw new SeedcordError(
|
|
2419
|
+
if (value === "") throw new SeedcordError(1005, [ENV_NAME]);
|
|
2420
|
+
if (!/^[A-Za-z\d_-]{24,}\.[A-Za-z\d_-]{6,}\.[A-Za-z\d_-]{27,}$/.test(value)) throw new SeedcordError(1006, [ENV_NAME]);
|
|
2427
2421
|
return value;
|
|
2428
2422
|
}
|
|
2429
2423
|
|
|
2430
|
-
//#endregion
|
|
2431
|
-
//#region src/cli/banner.ts
|
|
2432
|
-
function banner(version = "0.1.0") {
|
|
2433
|
-
const wordmark = `${paint.flesh.bold("seed")}${paint.rind.bold("cord")}`;
|
|
2434
|
-
if (version === void 0) return wordmark;
|
|
2435
|
-
return `${wordmark}${paint.pith(` • v${version}`)}`;
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
2424
|
//#endregion
|
|
2439
2425
|
//#region src/interview/steps/requireAnswer.ts
|
|
2440
2426
|
function requireAnswer(value) {
|
|
@@ -3668,14 +3654,35 @@ function failureLines(captured) {
|
|
|
3668
3654
|
const named = captured.filter((line) => NAMES_THE_CAUSE.test(line));
|
|
3669
3655
|
return named.length > 0 ? named.slice(0, KEPT_LINES) : captured.slice(-12);
|
|
3670
3656
|
}
|
|
3657
|
+
const SHIMS = /* @__PURE__ */ new Set([
|
|
3658
|
+
"npm",
|
|
3659
|
+
"npx",
|
|
3660
|
+
"pnpm",
|
|
3661
|
+
"yarn",
|
|
3662
|
+
"bun",
|
|
3663
|
+
"deno"
|
|
3664
|
+
]);
|
|
3665
|
+
function spawnSpec(command, args, platform) {
|
|
3666
|
+
const shell = platform === "win32" && SHIMS.has(command);
|
|
3667
|
+
if (!shell) return {
|
|
3668
|
+
command,
|
|
3669
|
+
args,
|
|
3670
|
+
shell
|
|
3671
|
+
};
|
|
3672
|
+
return {
|
|
3673
|
+
command: [command, ...args].join(" "),
|
|
3674
|
+
args: [],
|
|
3675
|
+
shell
|
|
3676
|
+
};
|
|
3677
|
+
}
|
|
3671
3678
|
async function execRunner(...[command, args, cwd]) {
|
|
3672
3679
|
const spoken = [command, ...args].join(" ");
|
|
3673
3680
|
const width = lineWidth();
|
|
3674
|
-
const
|
|
3681
|
+
const spec = spawnSpec(command, args, process$1.platform);
|
|
3675
3682
|
return new Promise((resolve, reject) => {
|
|
3676
|
-
const child = spawn(command, args, {
|
|
3683
|
+
const child = spawn(spec.command, spec.args, {
|
|
3677
3684
|
cwd,
|
|
3678
|
-
shell
|
|
3685
|
+
shell: spec.shell
|
|
3679
3686
|
});
|
|
3680
3687
|
const captured = [];
|
|
3681
3688
|
const take = (chunk) => {
|
|
@@ -11066,6 +11073,25 @@ async function writeTree(target, files) {
|
|
|
11066
11073
|
await writeFile(destination, file.contents, "utf8");
|
|
11067
11074
|
}
|
|
11068
11075
|
}
|
|
11076
|
+
async function runGitSteps(input, run) {
|
|
11077
|
+
try {
|
|
11078
|
+
await input.steps.run({
|
|
11079
|
+
running: "Setting up git",
|
|
11080
|
+
done: "Committed"
|
|
11081
|
+
}, async () => {
|
|
11082
|
+
await run("git", ["init"], input.target);
|
|
11083
|
+
await run("git", ["add", "."], input.target);
|
|
11084
|
+
await run("git", [
|
|
11085
|
+
"commit",
|
|
11086
|
+
"-m",
|
|
11087
|
+
"chore: create seedcord bot"
|
|
11088
|
+
], input.target);
|
|
11089
|
+
});
|
|
11090
|
+
return null;
|
|
11091
|
+
} catch (error) {
|
|
11092
|
+
return `${Error.isError(error) ? error.message : String(error)} The project is complete and uncommitted.`;
|
|
11093
|
+
}
|
|
11094
|
+
}
|
|
11069
11095
|
async function runInstallSteps(input, run, isGateway) {
|
|
11070
11096
|
const { agent, steps, target } = input;
|
|
11071
11097
|
const deps = addCommand(agent, runtimePackages(isGateway), false);
|
|
@@ -11116,23 +11142,12 @@ async function scaffold(input, run) {
|
|
|
11116
11142
|
steps.skip("Code formatted");
|
|
11117
11143
|
steps.skip("Types generated");
|
|
11118
11144
|
}
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
done: "Committed"
|
|
11122
|
-
}, async () => {
|
|
11123
|
-
await run("git", ["init"], input.target);
|
|
11124
|
-
await run("git", ["add", "."], input.target);
|
|
11125
|
-
await run("git", [
|
|
11126
|
-
"commit",
|
|
11127
|
-
"-m",
|
|
11128
|
-
"chore: create seedcord bot"
|
|
11129
|
-
], input.target);
|
|
11130
|
-
});
|
|
11145
|
+
let gitNotice = plan.notice;
|
|
11146
|
+
if (plan.init) gitNotice = await runGitSteps(input, run) ?? gitNotice;
|
|
11131
11147
|
else steps.skip("Committed");
|
|
11132
11148
|
return {
|
|
11133
11149
|
installed: input.install,
|
|
11134
|
-
|
|
11135
|
-
gitNotice: plan.notice
|
|
11150
|
+
gitNotice
|
|
11136
11151
|
};
|
|
11137
11152
|
} catch (error) {
|
|
11138
11153
|
await rm(input.target, {
|