reciple 10.0.0 → 10.0.1-dev.1

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/LICENSE ADDED
@@ -0,0 +1,155 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+
6
+ Everyone is permitted to copy and distribute verbatim copies of this license
7
+ document, but changing it is not allowed.
8
+
9
+ This version of the GNU Lesser General Public License incorporates the terms
10
+ and conditions of version 3 of the GNU General Public License, supplemented
11
+ by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, “this License” refers to version 3 of the GNU Lesser General
16
+ Public License, and the “GNU GPL” refers to version 3 of the
17
+ GNU General Public License.
18
+
19
+ “The Library” refers to a covered work governed by this License, other than
20
+ an Application or a Combined Work as defined below.
21
+
22
+ An “Application” is any work that makes use of an interface provided by the
23
+ Library, but which is not otherwise based on the Library. Defining a subclass
24
+ of a class defined by the Library is deemed a mode of using an interface
25
+ provided by the Library.
26
+
27
+ A “Combined Work” is a work produced by combining or linking an Application
28
+ with the Library. The particular version of the Library with which the
29
+ Combined Work was made is also called the “Linked Version”.
30
+
31
+ The “Minimal Corresponding Source” for a Combined Work means the Corresponding
32
+ Source for the Combined Work, excluding any source code for portions of the
33
+ Combined Work that, considered in isolation, are based on the Application,
34
+ and not on the Linked Version.
35
+
36
+ The “Corresponding Application Code” for a Combined Work means the object code
37
+ and/or source code for the Application, including any data and utility programs
38
+ needed for reproducing the Combined Work from the Application, but excluding
39
+ the System Libraries of the Combined Work.
40
+
41
+ 1. Exception to Section 3 of the GNU GPL.
42
+
43
+ You may convey a covered work under sections 3 and 4 of this License without
44
+ being bound by section 3 of the GNU GPL.
45
+
46
+ 2. Conveying Modified Versions.
47
+
48
+ If you modify a copy of the Library, and, in your modifications, a facility
49
+ refers to a function or data to be supplied by an Application that uses the
50
+ facility (other than as an argument passed when the facility is invoked),
51
+ then you may convey a copy of the modified version:
52
+
53
+ a) under this License, provided that you make a good faith effort to
54
+ ensure that, in the event an Application does not supply the function or
55
+ data, the facility still operates, and performs whatever part of its
56
+ purpose remains meaningful, or
57
+
58
+ b) under the GNU GPL, with none of the additional permissions of this
59
+ License applicable to that copy.
60
+
61
+ 3. Object Code Incorporating Material from Library Header Files.
62
+
63
+ The object code form of an Application may incorporate material from a header
64
+ file that is part of the Library. You may convey such object code under terms
65
+ of your choice, provided that, if the incorporated material is not limited to
66
+ numerical parameters, data structure layouts and accessors, or small macros,
67
+ inline functions and templates (ten or fewer lines in length),
68
+ you do both of the following:
69
+
70
+ a) Give prominent notice with each copy of the object code that the Library
71
+ is used in it and that the Library and its use are covered by this License.
72
+
73
+ b) Accompany the object code with a copy of the GNU GPL
74
+ and this license document.
75
+
76
+ 4. Combined Works.
77
+
78
+ You may convey a Combined Work under terms of your choice that, taken together,
79
+ effectively do not restrict modification of the portions of the Library
80
+ contained in the Combined Work and reverse engineering for debugging such
81
+ modifications, if you also do each of the following:
82
+
83
+ a) Give prominent notice with each copy of the Combined Work that the
84
+ Library is used in it and that the Library and its use are covered
85
+ by this License.
86
+
87
+ b) Accompany the Combined Work with a copy of the GNU GPL and
88
+ this license document.
89
+
90
+ c) For a Combined Work that displays copyright notices during execution,
91
+ include the copyright notice for the Library among these notices, as well
92
+ as a reference directing the user to the copies of the GNU GPL
93
+ and this license document.
94
+
95
+ d) Do one of the following:
96
+
97
+ 0) Convey the Minimal Corresponding Source under the terms of this
98
+ License, and the Corresponding Application Code in a form suitable
99
+ for, and under terms that permit, the user to recombine or relink
100
+ the Application with a modified version of the Linked Version to
101
+ produce a modified Combined Work, in the manner specified by section 6
102
+ of the GNU GPL for conveying Corresponding Source.
103
+
104
+ 1) Use a suitable shared library mechanism for linking with the
105
+ Library. A suitable mechanism is one that (a) uses at run time a
106
+ copy of the Library already present on the user's computer system,
107
+ and (b) will operate properly with a modified version of the Library
108
+ that is interface-compatible with the Linked Version.
109
+
110
+ e) Provide Installation Information, but only if you would otherwise be
111
+ required to provide such information under section 6 of the GNU GPL, and
112
+ only to the extent that such information is necessary to install and
113
+ execute a modified version of the Combined Work produced by recombining
114
+ or relinking the Application with a modified version of the Linked Version.
115
+ (If you use option 4d0, the Installation Information must accompany the
116
+ Minimal Corresponding Source and Corresponding Application Code. If you
117
+ use option 4d1, you must provide the Installation Information in the
118
+ manner specified by section 6 of the GNU GPL for
119
+ conveying Corresponding Source.)
120
+
121
+ 5. Combined Libraries.
122
+
123
+ You may place library facilities that are a work based on the Library side by
124
+ side in a single library together with other library facilities that are not
125
+ Applications and are not covered by this License, and convey such a combined
126
+ library under terms of your choice, if you do both of the following:
127
+
128
+ a) Accompany the combined library with a copy of the same work based on
129
+ the Library, uncombined with any other library facilities, conveyed under
130
+ the terms of this License.
131
+
132
+ b) Give prominent notice with the combined library that part of it is a
133
+ work based on the Library, and explaining where to find the accompanying
134
+ uncombined form of the same work.
135
+
136
+ 6. Revised Versions of the GNU Lesser General Public License.
137
+
138
+ The Free Software Foundation may publish revised and/or new versions of the
139
+ GNU Lesser General Public License from time to time. Such new versions will
140
+ be similar in spirit to the present version, but may differ in detail to
141
+ address new problems or concerns.
142
+
143
+ Each version is given a distinguishing version number. If the Library as you
144
+ received it specifies that a certain numbered version of the GNU Lesser
145
+ General Public License “or any later version” applies to it, you have the
146
+ option of following the terms and conditions either of that published version
147
+ or of any later version published by the Free Software Foundation. If the
148
+ Library as you received it does not specify a version number of the GNU Lesser
149
+ General Public License, you may choose any version of the GNU Lesser General
150
+ Public License ever published by the Free Software Foundation.
151
+
152
+ If the Library as you received it specifies that a proxy can decide whether
153
+ future versions of the GNU Lesser General Public License shall apply, that
154
+ proxy's public statement of acceptance of any version is permanent
155
+ authorization for you to choose that version for the Library.
@@ -86,7 +86,7 @@ var CLI = class {
86
86
  (function(_CLI) {
87
87
  _CLI.root = path.join(path.dirname(fileURLToPath(import.meta.url)), "../../../");
88
88
  _CLI.bin = path.join(CLI.root, "dist/bin/reciple.js");
89
- _CLI.version = "10.0.0";
89
+ _CLI.version = "10.0.1-dev.1";
90
90
  function stringifyFlags(flags, command, ignored = []) {
91
91
  let arr = [];
92
92
  for (const [key, value] of Object.entries(flags)) {
@@ -28,8 +28,8 @@ declare class ConfigReader {
28
28
  private _client;
29
29
  private _config;
30
30
  private _build;
31
- get client(): any;
32
- get config(): any;
31
+ get client(): Client<boolean>;
32
+ get config(): Config;
33
33
  get build(): UserConfig;
34
34
  constructor(filepath: string);
35
35
  read(options?: Omit<ConfigReader.ReadOptions, 'filepath'>): Promise<ConfigReader>;
@@ -294,7 +294,11 @@ var TemplateBuilder = class TemplateBuilder {
294
294
  _TemplateBuilder.ignoredDirectoryFiles = [".*", "LICENSE"];
295
295
  const dependencies = _TemplateBuilder.dependencies = {
296
296
  both: {
297
- dependencies: { "@reciple/jsx": packageJSON.dependencies?.["@reciple/jsx"] },
297
+ dependencies: {
298
+ "@reciple/core": packageJSON.dependencies?.["@reciple/core"],
299
+ "@reciple/jsx": packageJSON.dependencies?.["@reciple/jsx"],
300
+ "reciple": `^${packageJSON.version}`
301
+ },
298
302
  devDependencies: {
299
303
  "@types/node": packageJSON.devDependencies?.["@types/node"],
300
304
  nodemon: packageJSON.devDependencies?.nodemon
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateBuilder.mjs","names":["dir","packageManager: PackageManagerName|symbol","parseDotenv","dependencies: Record<'ts'|'js'|'both', Partial<Record<'dependencies'|'devDependencies', Record<string, string>>>>","data: CopyMetadata","data"],"sources":["../../../src/classes/templates/TemplateBuilder.ts"],"sourcesContent":["import { colors, PackageJsonBuilder } from '@reciple/utils';\nimport { ConfigReader } from '../cli/ConfigReader.js';\nimport { copyFile, mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { confirm, intro, isCancel, outro, select, text } from '@clack/prompts';\nimport micromatch from 'micromatch';\nimport { CLI } from '../cli/CLI.js';\nimport path from 'node:path';\nimport { existsSync, statSync } from 'node:fs';\nimport { NotAnError } from '../NotAnError.js';\nimport { slug } from 'github-slugger';\nimport { packageJSON } from '../../helpers/constants.js';\nimport { parse as parseDotenv } from '@dotenvx/dotenvx';\nimport { ModuleTemplateBuilder } from './ModuleTemplateBuilder.js';\nimport { detectPackageManager, installDependencies, installDependenciesCommand, runScript, runScriptCommand, type PackageManagerName } from 'nypm';\n\nexport class TemplateBuilder {\n private _directory?: string;\n\n public cli: CLI;\n public typescript?: boolean;\n public token?: string;\n public defaultAll: boolean;\n\n public config?: ConfigReader;\n public packageJson?: PackageJsonBuilder;\n\n public packageManager?: PackageManagerName;\n\n get directory() {\n return this._directory ?? process.cwd();\n }\n\n get relativeDirectory() {\n return path.relative(process.cwd(), this.directory) || './';\n }\n\n get packageJsonPath() {\n return path.join(this.directory, 'package.json');\n }\n\n get name() {\n return slug(path.basename(this.directory));\n }\n\n constructor(options: TemplateBuilder.Options) {\n this.cli = options.cli;\n this._directory = options.directory;\n this.typescript = options.typescript;\n this.defaultAll = options.defaultAll ?? false;\n this.packageManager = options.packageManager;\n this.token = options.token;\n }\n\n public async init(): Promise<this> {\n intro(colors.bold(colors.black(colors.bgCyan(` ${this.cli.command.name()} create - v${this.cli.build} `))));\n return this;\n }\n\n public async createDirectory(options?: TemplateBuilder.CreateDirectoryOptions): Promise<this> {\n this._directory = options?.directory ?? this._directory;\n\n if (!this._directory) {\n const dir = this.defaultAll\n ? process.cwd()\n : await text({\n message: `Enter project directory`,\n placeholder: `Leave empty to use current directory`,\n defaultValue: process.cwd(),\n validate: value => {\n const dir = path.resolve(value);\n if (existsSync(dir) && !statSync(dir).isDirectory()) return 'Invalid folder directory';\n }\n });\n\n if (isCancel(dir)) throw new NotAnError('Operation cancelled');\n this._directory = dir;\n }\n\n this._directory = path.resolve(this._directory);\n\n const stats = await stat(this.directory).catch(() => undefined);\n\n if (stats) {\n let files = await readdir(this.directory);\n files = micromatch.not(files, options?.ignoredFiles ?? TemplateBuilder.ignoredDirectoryFiles, { dot: true });\n\n if (files.length) {\n switch (options?.onNotEmpty) {\n case 'throw':\n throw new NotAnError(`Directory ${colors.cyan(this.relativeDirectory)} is not empty`);\n case 'ignore':\n return this;\n default:\n const overwrite = this.defaultAll\n ? false\n : await confirm({\n message: `Directory ${colors.cyan(this.relativeDirectory)} is not empty. Would you like to continue?`,\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (!overwrite) throw new NotAnError(`Directory ${colors.cyan(this.relativeDirectory)} is not empty`);\n if (isCancel(overwrite)) throw new NotAnError('Operation cancelled');\n break;\n }\n }\n }\n\n await mkdir(this.directory, { recursive: true });\n return this;\n }\n\n public async setupLanguage(options?: TemplateBuilder.SetupLanguageOptions): Promise<this> {\n this.typescript = options?.typescript ?? this.typescript;\n\n if (!this.typescript) {\n const isTypeScript = this.defaultAll\n ? false\n : await confirm({\n message: 'Would you like to use TypeScript?',\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (isCancel(isTypeScript)) throw new NotAnError('Operation cancelled');\n this.typescript = isTypeScript;\n }\n\n return this;\n }\n\n public async createConfig(options?: TemplateBuilder.CreateConfigOptions): Promise<this> {\n let filepath = options?.filepath;\n\n if (!filepath) {\n filepath = await ConfigReader.findConfig(\n this.directory,\n this.typescript\n ? 'ts'\n : this.typescript === false\n ? 'js'\n : undefined\n )\n ?? path.join(\n this.directory,\n ConfigReader.createConfigFilename(this.typescript ? 'ts' : 'js')\n );\n }\n\n const exists = await ConfigReader.hasFile(filepath);\n\n if (exists) {\n const overwrite = this.defaultAll\n ? false\n : await confirm({\n message: `Config file already exists at ${colors.green(path.relative(process.cwd(), filepath))}. Would you like to overwrite it?`,\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (!overwrite) return this;\n if (isCancel(overwrite)) throw new NotAnError('Operation cancelled');\n }\n\n this.config = await ConfigReader.create({\n ...options,\n filepath,\n type: this.typescript ? 'ts' : 'js',\n overwrite: true\n });\n\n return this;\n }\n\n public async createTemplate(options?: TemplateBuilder.CreateModulesOptions): Promise<this> {\n const source = path.join(CLI.root, './assets/templates/', this.typescript ? 'typescript' : 'javascript');\n const globals = path.join(CLI.root, './assets/global/');\n const modulesDirectory = path.join(this.directory, 'src');\n const moduleTemplates = await ModuleTemplateBuilder.resolveModuleTemplates(this.typescript ? 'ts' : 'js');\n const moduleOptions = {\n cli: this.cli,\n config: this.config!,\n defaultAll: true,\n typescript: this.typescript,\n };\n\n function rename(data: TemplateBuilder.CopyMetadata) {\n switch (data.basename) {\n case 'gitignore':\n return '.gitignore';\n default:\n return options?.rename?.(data) ?? data.basename;\n }\n }\n\n function overwrite(data: TemplateBuilder.CopyMetadata) {\n switch (data.basename) {\n case 'gitignore':\n return false;\n case 'tsconfig.json':\n case 'jsconfig.json':\n return true;\n default:\n return (typeof options?.overwrite === 'boolean' ? options.overwrite : options?.overwrite?.(data)) ?? true;\n }\n }\n\n const [template, loader] = CLI.createSpinnerPromise({\n promise: Promise.all([\n TemplateBuilder.copy(source, this.directory, { ...options, rename, overwrite }),\n TemplateBuilder.copy(globals, this.directory, { ...options, rename, overwrite }),\n new ModuleTemplateBuilder({\n ...moduleOptions,\n directory: path.join(modulesDirectory, 'commands'),\n filename: `SlashCommand.${this.typescript ? 'ts' : 'js'}`,\n template: moduleTemplates.find(t => t.name === 'SlashCommand')\n })\n .setupPlaceholders()\n .then(m => m.build({ silent: true })),\n new ModuleTemplateBuilder({\n ...moduleOptions,\n directory: path.join(modulesDirectory, 'events'),\n filename: `ClientEvent.${this.typescript ? 'ts' : 'js'}`,\n template: moduleTemplates.find(t => t.name === 'ClientEvent')\n })\n .setupPlaceholders()\n .then(m => m.build({ silent: true }))\n ]),\n message: 'Copying template files',\n successMessage: 'Files copied successfully',\n errorMessage: 'Failed to copy files'\n });\n\n await template;\n return this;\n }\n\n public async setPackageManager(options?: TemplateBuilder.SetPackageManagerOptions) {\n this.packageManager = options?.packageManager ?? this.packageManager;\n\n if (!this.packageManager) {\n const defaultPackageManager = await detectPackageManager(this.directory).then(pm => pm?.name ?? 'npm');\n const packageManager: PackageManagerName|symbol = this.defaultAll\n ? defaultPackageManager\n : await select({\n message: 'Select package manager',\n options: [\n { value: defaultPackageManager, label: defaultPackageManager },\n ...[\n { value: 'npm', label: 'npm' },\n { value: 'yarn', label: 'yarn' },\n { value: 'pnpm', label: 'pnpm' },\n { value: 'bun', label: 'bun' },\n { value: 'deno', label: 'deno' }\n ].filter(o => o.value !== defaultPackageManager) as { value: PackageManagerName; label: string; }[]\n ],\n initialValue: defaultPackageManager\n });\n\n if (isCancel(packageManager)) throw new NotAnError('Operation cancelled');\n this.packageManager = packageManager;\n }\n\n this.packageJson = await PackageJsonBuilder.read(this.packageJsonPath);\n this.packageJson.merge({\n name: this.name,\n version: '0.0.1',\n type: 'module',\n scripts: {\n build: `reciple build`,\n start: 'reciple start',\n dev: 'nodemon',\n },\n ...TemplateBuilder.createDependencyRecord(this.typescript ? 'ts' : 'js'),\n private: true\n });\n\n return this;\n }\n\n public async createEnvFile(options?: TemplateBuilder.CreateEnvFileOptions): Promise<this> {\n const tokenKey = options?.tokenKey ?? 'DISCORD_TOKEN';\n const envFile = options?.envFile ? path.resolve(options.envFile) : path.join(this.directory, '.env');\n const stats = await stat(envFile).catch(() => undefined);\n\n let env = options?.env ?? {};\n env = stats\n ? parseDotenv(await readFile(envFile, 'utf-8'), {\n processEnv: env\n })\n : env;\n\n if (env[tokenKey]) {\n const skip = this.defaultAll || await confirm({\n message: 'Discord bot token already exists in .env file, do you want to skip?',\n initialValue: true,\n active: 'Yes',\n inactive: 'No'\n });\n\n if (isCancel(skip)) throw new NotAnError('Operation cancelled');\n if (skip) return this;\n }\n\n const token = await text({\n message: 'Enter Discord Bot Token',\n placeholder: 'Bot Token from Discord Developer Portal',\n defaultValue: env[tokenKey]\n });\n\n if (isCancel(token)) throw new NotAnError('Operation cancelled');\n env[tokenKey] = token;\n\n await writeFile(envFile, `\\n${tokenKey}=\"${token}\"\\n`, {\n encoding: 'utf-8',\n flag: 'a'\n });\n\n return this;\n }\n\n public async build(options?: TemplateBuilder.BuildOptions): Promise<this> {\n await this.packageJson?.write(this.packageJsonPath, true);\n\n if (!options?.skipInstallDependencies) await CLI.createSpinnerPromise({\n promise: installDependencies({\n cwd: this.directory,\n packageManager: this.packageManager,\n silent: true\n }),\n indicator: 'timer',\n errorMessage: `${colors.bold(colors.red('✗'))} Failed to install dependencies`,\n successMessage: `${colors.bold(colors.green('✔'))} Dependencies installed successfully`,\n message: `${colors.bold(colors.dim('$'))} Installing dependencies`\n })[0];\n\n if (!options?.skipBuild) await CLI.createSpinnerPromise({\n promise: runScript('build', {\n cwd: this.directory,\n packageManager: this.packageManager,\n silent: true\n }),\n indicator: 'timer',\n errorMessage: `${colors.bold(colors.red('✗'))} Failed to build project`,\n successMessage: `${colors.bold(colors.green('✔'))} Project built successfully`,\n message: `${colors.bold(colors.dim('$'))} Building project`\n })[0];\n\n outro(`Project created in ${colors.cyan(this.relativeDirectory)}`);\n\n console.log(`\\n${colors.bold(colors.green('✔'))} Start developing:`);\n\n if (this.relativeDirectory !== './') {\n console.log(` • ${colors.cyan(colors.bold(`cd ${this.relativeDirectory}`))}`);\n }\n\n if (options?.skipInstallDependencies) {\n console.log(` • ${colors.cyan(colors.bold(installDependenciesCommand(this.packageManager ?? 'npm')))}`);\n }\n\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'build')))} ${colors.dim('(Build)')}`);\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'dev')))} ${colors.dim('(Development)')}`);\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'start')))} ${colors.dim('(Production)')}`);\n\n\n return this;\n }\n}\n\nexport namespace TemplateBuilder {\n export interface Options {\n cli: CLI;\n directory?: string;\n typescript?: boolean;\n packageManager?: PackageManagerName;\n defaultAll?: boolean;\n token?: string;\n }\n\n export const ignoredDirectoryFiles = ['.*', 'LICENSE'];\n\n export const dependencies: Record<'ts'|'js'|'both', Partial<Record<'dependencies'|'devDependencies', Record<string, string>>>> = {\n both: {\n dependencies: {\n // TODO: Uncomment when ready\n // '@reciple/core': packageJSON.dependencies?.['@reciple/core'],\n '@reciple/jsx': packageJSON.dependencies?.['@reciple/jsx']!,\n // 'reciple': `^${packageJSON.version}`,\n },\n devDependencies: {\n '@types/node': packageJSON.devDependencies?.['@types/node']!,\n nodemon: packageJSON.devDependencies?.nodemon!\n }\n },\n ts: {},\n js: {}\n };\n\n export function createDependencyRecord(type: 'ts'|'js'): Partial<Record<'dependencies'|'devDependencies', Record<string, string>>> {\n const record = type === 'ts'\n ? dependencies.ts\n : type === 'js'\n ? dependencies.js\n : {};\n\n record.dependencies = { ...record.dependencies, ...dependencies.both.dependencies };\n record.devDependencies = { ...record.devDependencies, ...dependencies.both.devDependencies };\n\n return record;\n }\n\n export interface CreateDirectoryOptions {\n directory?: string;\n ignoredFiles?: string[];\n onNotEmpty?: 'prompt'|'throw'|'ignore';\n }\n\n export interface SetupLanguageOptions {\n typescript?: boolean;\n }\n\n export interface CreateConfigOptions extends Partial<ConfigReader.CreateOptions> {}\n\n export interface CreateModulesOptions extends Partial<CopyOptions> {}\n\n export interface SetPackageManagerOptions {\n packageManager?: PackageManagerName;\n }\n\n export interface CreateEnvFileOptions {\n envFile?: string;\n tokenKey?: string;\n env?: Record<string, string>;\n }\n\n export interface BuildOptions {\n skipInstallDependencies?: boolean;\n skipBuild?: boolean;\n }\n\n export interface CopyOptions {\n overwrite?: boolean|((data: CopyMetadata) => boolean);\n filter?: (data: CopyMetadata) => boolean;\n rename?: (data: CopyMetadata) => string;\n }\n\n export interface CopyMetadata {\n basename: string;\n src: string;\n dest: string;\n }\n\n export async function copy(from: string, to: string, options?: CopyOptions): Promise<void> {\n const fromStats = await stat(from).catch(() => undefined);\n if (!fromStats) return;\n\n if (fromStats.isDirectory()) {\n const files = await readdir(from);\n\n for (const file of files) {\n const data: CopyMetadata = {\n basename: file,\n src: path.join(from, file),\n dest: to\n };\n\n await copy(\n data.src,\n path.join(to,\n options?.rename\n ? options.rename(data)\n : file\n ),\n options\n );\n }\n return;\n }\n\n const data: CopyMetadata = {\n basename: path.basename(from),\n src: from,\n dest: to\n };\n\n if (options?.filter && !options.filter(data)) return;\n\n const toStats = await stat(to).catch(() => undefined);\n const overwrite = typeof options?.overwrite === 'function'\n ? options.overwrite(data)\n : options?.overwrite ?? true;\n\n if (toStats && overwrite) return;\n\n await mkdir(path.dirname(to), { recursive: true });\n await copyFile(from, to);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAa,kBAAb,MAAa,gBAAgB;CACzB,AAAQ;CAER,AAAO;CACP,AAAO;CACP,AAAO;CACP,AAAO;CAEP,AAAO;CACP,AAAO;CAEP,AAAO;CAEP,IAAI,YAAY;AACZ,SAAO,KAAK,cAAc,QAAQ,KAAK;;CAG3C,IAAI,oBAAoB;AACpB,SAAO,KAAK,SAAS,QAAQ,KAAK,EAAE,KAAK,UAAU,IAAI;;CAG3D,IAAI,kBAAkB;AAClB,SAAO,KAAK,KAAK,KAAK,WAAW,eAAe;;CAGpD,IAAI,OAAO;AACP,SAAO,KAAK,KAAK,SAAS,KAAK,UAAU,CAAC;;CAG9C,YAAY,SAAkC;AAC1C,OAAK,MAAM,QAAQ;AACnB,OAAK,aAAa,QAAQ;AAC1B,OAAK,aAAa,QAAQ;AAC1B,OAAK,aAAa,QAAQ,cAAc;AACxC,OAAK,iBAAiB,QAAQ;AAC9B,OAAK,QAAQ,QAAQ;;CAGzB,MAAa,OAAsB;AAC/B,QAAM,OAAO,KAAK,OAAO,MAAM,OAAO,OAAO,IAAI,KAAK,IAAI,QAAQ,MAAM,CAAC,aAAa,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3G,SAAO;;CAGX,MAAa,gBAAgB,SAAiE;AAC1F,OAAK,aAAa,SAAS,aAAa,KAAK;AAE7C,MAAI,CAAC,KAAK,YAA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Q,KAAK;AAEjC,QAAK,MAAM,QAAQ,OAAO;IACtB,MAAMC,SAAqB;KACvB,UAAU;KACV,KAAK,KAAK,KAAK,MAAM,KAAK;KAC1B,MAAM;KACT;AAED,UAAM,KACFC,OAAK,KACL,KAAK,KAAK,IACN,SAAS,SACH,QAAQ,OAAOA,OAAK,GACpB,KACT,EACD,QACH;;AAEL;;EAGJ,MAAMD,OAAqB;GACvB,UAAU,KAAK,SAAS,KAAK;GAC7B,KAAK;GACL,MAAM;GACT;AAED,MAAI,SAAS,UAAU,CAAC,QAAQ,OAAO,KAAK,CAAE;EAE9C,MAAM,UAAU,MAAM,KAAK,GAAG,CAAC,YAAY,OAAU;EACrD,MAAM,YAAY,OAAO,SAAS,cAAc,aAC1C,QAAQ,UAAU,KAAK,GACvB,SAAS,aAAa;AAE5B,MAAI,WAAW,UAAW;AAE1B,QAAM,MAAM,KAAK,QAAQ,GAAG,EAAE,EAAE,WAAW,MAAM,CAAC;AAClD,QAAM,SAAS,MAAM,GAAG"}
1
+ {"version":3,"file":"TemplateBuilder.mjs","names":["dir","packageManager: PackageManagerName|symbol","parseDotenv","dependencies: Record<'ts'|'js'|'both', Partial<Record<'dependencies'|'devDependencies', Record<string, string>>>>","data: CopyMetadata","data"],"sources":["../../../src/classes/templates/TemplateBuilder.ts"],"sourcesContent":["import { colors, PackageJsonBuilder } from '@reciple/utils';\nimport { ConfigReader } from '../cli/ConfigReader.js';\nimport { copyFile, mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { confirm, intro, isCancel, outro, select, text } from '@clack/prompts';\nimport micromatch from 'micromatch';\nimport { CLI } from '../cli/CLI.js';\nimport path from 'node:path';\nimport { existsSync, statSync } from 'node:fs';\nimport { NotAnError } from '../NotAnError.js';\nimport { slug } from 'github-slugger';\nimport { packageJSON } from '../../helpers/constants.js';\nimport { parse as parseDotenv } from '@dotenvx/dotenvx';\nimport { ModuleTemplateBuilder } from './ModuleTemplateBuilder.js';\nimport { detectPackageManager, installDependencies, installDependenciesCommand, runScript, runScriptCommand, type PackageManagerName } from 'nypm';\n\nexport class TemplateBuilder {\n private _directory?: string;\n\n public cli: CLI;\n public typescript?: boolean;\n public token?: string;\n public defaultAll: boolean;\n\n public config?: ConfigReader;\n public packageJson?: PackageJsonBuilder;\n\n public packageManager?: PackageManagerName;\n\n get directory() {\n return this._directory ?? process.cwd();\n }\n\n get relativeDirectory() {\n return path.relative(process.cwd(), this.directory) || './';\n }\n\n get packageJsonPath() {\n return path.join(this.directory, 'package.json');\n }\n\n get name() {\n return slug(path.basename(this.directory));\n }\n\n constructor(options: TemplateBuilder.Options) {\n this.cli = options.cli;\n this._directory = options.directory;\n this.typescript = options.typescript;\n this.defaultAll = options.defaultAll ?? false;\n this.packageManager = options.packageManager;\n this.token = options.token;\n }\n\n public async init(): Promise<this> {\n intro(colors.bold(colors.black(colors.bgCyan(` ${this.cli.command.name()} create - v${this.cli.build} `))));\n return this;\n }\n\n public async createDirectory(options?: TemplateBuilder.CreateDirectoryOptions): Promise<this> {\n this._directory = options?.directory ?? this._directory;\n\n if (!this._directory) {\n const dir = this.defaultAll\n ? process.cwd()\n : await text({\n message: `Enter project directory`,\n placeholder: `Leave empty to use current directory`,\n defaultValue: process.cwd(),\n validate: value => {\n const dir = path.resolve(value);\n if (existsSync(dir) && !statSync(dir).isDirectory()) return 'Invalid folder directory';\n }\n });\n\n if (isCancel(dir)) throw new NotAnError('Operation cancelled');\n this._directory = dir;\n }\n\n this._directory = path.resolve(this._directory);\n\n const stats = await stat(this.directory).catch(() => undefined);\n\n if (stats) {\n let files = await readdir(this.directory);\n files = micromatch.not(files, options?.ignoredFiles ?? TemplateBuilder.ignoredDirectoryFiles, { dot: true });\n\n if (files.length) {\n switch (options?.onNotEmpty) {\n case 'throw':\n throw new NotAnError(`Directory ${colors.cyan(this.relativeDirectory)} is not empty`);\n case 'ignore':\n return this;\n default:\n const overwrite = this.defaultAll\n ? false\n : await confirm({\n message: `Directory ${colors.cyan(this.relativeDirectory)} is not empty. Would you like to continue?`,\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (!overwrite) throw new NotAnError(`Directory ${colors.cyan(this.relativeDirectory)} is not empty`);\n if (isCancel(overwrite)) throw new NotAnError('Operation cancelled');\n break;\n }\n }\n }\n\n await mkdir(this.directory, { recursive: true });\n return this;\n }\n\n public async setupLanguage(options?: TemplateBuilder.SetupLanguageOptions): Promise<this> {\n this.typescript = options?.typescript ?? this.typescript;\n\n if (!this.typescript) {\n const isTypeScript = this.defaultAll\n ? false\n : await confirm({\n message: 'Would you like to use TypeScript?',\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (isCancel(isTypeScript)) throw new NotAnError('Operation cancelled');\n this.typescript = isTypeScript;\n }\n\n return this;\n }\n\n public async createConfig(options?: TemplateBuilder.CreateConfigOptions): Promise<this> {\n let filepath = options?.filepath;\n\n if (!filepath) {\n filepath = await ConfigReader.findConfig(\n this.directory,\n this.typescript\n ? 'ts'\n : this.typescript === false\n ? 'js'\n : undefined\n )\n ?? path.join(\n this.directory,\n ConfigReader.createConfigFilename(this.typescript ? 'ts' : 'js')\n );\n }\n\n const exists = await ConfigReader.hasFile(filepath);\n\n if (exists) {\n const overwrite = this.defaultAll\n ? false\n : await confirm({\n message: `Config file already exists at ${colors.green(path.relative(process.cwd(), filepath))}. Would you like to overwrite it?`,\n active: 'Yes',\n inactive: 'No',\n initialValue: false\n });\n\n if (!overwrite) return this;\n if (isCancel(overwrite)) throw new NotAnError('Operation cancelled');\n }\n\n this.config = await ConfigReader.create({\n ...options,\n filepath,\n type: this.typescript ? 'ts' : 'js',\n overwrite: true\n });\n\n return this;\n }\n\n public async createTemplate(options?: TemplateBuilder.CreateModulesOptions): Promise<this> {\n const source = path.join(CLI.root, './assets/templates/', this.typescript ? 'typescript' : 'javascript');\n const globals = path.join(CLI.root, './assets/global/');\n const modulesDirectory = path.join(this.directory, 'src');\n const moduleTemplates = await ModuleTemplateBuilder.resolveModuleTemplates(this.typescript ? 'ts' : 'js');\n const moduleOptions = {\n cli: this.cli,\n config: this.config!,\n defaultAll: true,\n typescript: this.typescript,\n };\n\n function rename(data: TemplateBuilder.CopyMetadata) {\n switch (data.basename) {\n case 'gitignore':\n return '.gitignore';\n default:\n return options?.rename?.(data) ?? data.basename;\n }\n }\n\n function overwrite(data: TemplateBuilder.CopyMetadata) {\n switch (data.basename) {\n case 'gitignore':\n return false;\n case 'tsconfig.json':\n case 'jsconfig.json':\n return true;\n default:\n return (typeof options?.overwrite === 'boolean' ? options.overwrite : options?.overwrite?.(data)) ?? true;\n }\n }\n\n const [template, loader] = CLI.createSpinnerPromise({\n promise: Promise.all([\n TemplateBuilder.copy(source, this.directory, { ...options, rename, overwrite }),\n TemplateBuilder.copy(globals, this.directory, { ...options, rename, overwrite }),\n new ModuleTemplateBuilder({\n ...moduleOptions,\n directory: path.join(modulesDirectory, 'commands'),\n filename: `SlashCommand.${this.typescript ? 'ts' : 'js'}`,\n template: moduleTemplates.find(t => t.name === 'SlashCommand')\n })\n .setupPlaceholders()\n .then(m => m.build({ silent: true })),\n new ModuleTemplateBuilder({\n ...moduleOptions,\n directory: path.join(modulesDirectory, 'events'),\n filename: `ClientEvent.${this.typescript ? 'ts' : 'js'}`,\n template: moduleTemplates.find(t => t.name === 'ClientEvent')\n })\n .setupPlaceholders()\n .then(m => m.build({ silent: true }))\n ]),\n message: 'Copying template files',\n successMessage: 'Files copied successfully',\n errorMessage: 'Failed to copy files'\n });\n\n await template;\n return this;\n }\n\n public async setPackageManager(options?: TemplateBuilder.SetPackageManagerOptions) {\n this.packageManager = options?.packageManager ?? this.packageManager;\n\n if (!this.packageManager) {\n const defaultPackageManager = await detectPackageManager(this.directory).then(pm => pm?.name ?? 'npm');\n const packageManager: PackageManagerName|symbol = this.defaultAll\n ? defaultPackageManager\n : await select({\n message: 'Select package manager',\n options: [\n { value: defaultPackageManager, label: defaultPackageManager },\n ...[\n { value: 'npm', label: 'npm' },\n { value: 'yarn', label: 'yarn' },\n { value: 'pnpm', label: 'pnpm' },\n { value: 'bun', label: 'bun' },\n { value: 'deno', label: 'deno' }\n ].filter(o => o.value !== defaultPackageManager) as { value: PackageManagerName; label: string; }[]\n ],\n initialValue: defaultPackageManager\n });\n\n if (isCancel(packageManager)) throw new NotAnError('Operation cancelled');\n this.packageManager = packageManager;\n }\n\n this.packageJson = await PackageJsonBuilder.read(this.packageJsonPath);\n this.packageJson.merge({\n name: this.name,\n version: '0.0.1',\n type: 'module',\n scripts: {\n build: `reciple build`,\n start: 'reciple start',\n dev: 'nodemon',\n },\n ...TemplateBuilder.createDependencyRecord(this.typescript ? 'ts' : 'js'),\n private: true\n });\n\n return this;\n }\n\n public async createEnvFile(options?: TemplateBuilder.CreateEnvFileOptions): Promise<this> {\n const tokenKey = options?.tokenKey ?? 'DISCORD_TOKEN';\n const envFile = options?.envFile ? path.resolve(options.envFile) : path.join(this.directory, '.env');\n const stats = await stat(envFile).catch(() => undefined);\n\n let env = options?.env ?? {};\n env = stats\n ? parseDotenv(await readFile(envFile, 'utf-8'), {\n processEnv: env\n })\n : env;\n\n if (env[tokenKey]) {\n const skip = this.defaultAll || await confirm({\n message: 'Discord bot token already exists in .env file, do you want to skip?',\n initialValue: true,\n active: 'Yes',\n inactive: 'No'\n });\n\n if (isCancel(skip)) throw new NotAnError('Operation cancelled');\n if (skip) return this;\n }\n\n const token = await text({\n message: 'Enter Discord Bot Token',\n placeholder: 'Bot Token from Discord Developer Portal',\n defaultValue: env[tokenKey]\n });\n\n if (isCancel(token)) throw new NotAnError('Operation cancelled');\n env[tokenKey] = token;\n\n await writeFile(envFile, `\\n${tokenKey}=\"${token}\"\\n`, {\n encoding: 'utf-8',\n flag: 'a'\n });\n\n return this;\n }\n\n public async build(options?: TemplateBuilder.BuildOptions): Promise<this> {\n await this.packageJson?.write(this.packageJsonPath, true);\n\n if (!options?.skipInstallDependencies) await CLI.createSpinnerPromise({\n promise: installDependencies({\n cwd: this.directory,\n packageManager: this.packageManager,\n silent: true\n }),\n indicator: 'timer',\n errorMessage: `${colors.bold(colors.red('✗'))} Failed to install dependencies`,\n successMessage: `${colors.bold(colors.green('✔'))} Dependencies installed successfully`,\n message: `${colors.bold(colors.dim('$'))} Installing dependencies`\n })[0];\n\n if (!options?.skipBuild) await CLI.createSpinnerPromise({\n promise: runScript('build', {\n cwd: this.directory,\n packageManager: this.packageManager,\n silent: true\n }),\n indicator: 'timer',\n errorMessage: `${colors.bold(colors.red('✗'))} Failed to build project`,\n successMessage: `${colors.bold(colors.green('✔'))} Project built successfully`,\n message: `${colors.bold(colors.dim('$'))} Building project`\n })[0];\n\n outro(`Project created in ${colors.cyan(this.relativeDirectory)}`);\n\n console.log(`\\n${colors.bold(colors.green('✔'))} Start developing:`);\n\n if (this.relativeDirectory !== './') {\n console.log(` • ${colors.cyan(colors.bold(`cd ${this.relativeDirectory}`))}`);\n }\n\n if (options?.skipInstallDependencies) {\n console.log(` • ${colors.cyan(colors.bold(installDependenciesCommand(this.packageManager ?? 'npm')))}`);\n }\n\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'build')))} ${colors.dim('(Build)')}`);\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'dev')))} ${colors.dim('(Development)')}`);\n console.log(` • ${colors.cyan(colors.bold(runScriptCommand(this.packageManager ?? 'npm', 'start')))} ${colors.dim('(Production)')}`);\n\n\n return this;\n }\n}\n\nexport namespace TemplateBuilder {\n export interface Options {\n cli: CLI;\n directory?: string;\n typescript?: boolean;\n packageManager?: PackageManagerName;\n defaultAll?: boolean;\n token?: string;\n }\n\n export const ignoredDirectoryFiles = ['.*', 'LICENSE'];\n\n export const dependencies: Record<'ts'|'js'|'both', Partial<Record<'dependencies'|'devDependencies', Record<string, string>>>> = {\n both: {\n dependencies: {\n '@reciple/core': packageJSON.dependencies?.['@reciple/core']!,\n '@reciple/jsx': packageJSON.dependencies?.['@reciple/jsx']!,\n 'reciple': `^${packageJSON.version}`,\n },\n devDependencies: {\n '@types/node': packageJSON.devDependencies?.['@types/node']!,\n nodemon: packageJSON.devDependencies?.nodemon!\n }\n },\n ts: {},\n js: {}\n };\n\n export function createDependencyRecord(type: 'ts'|'js'): Partial<Record<'dependencies'|'devDependencies', Record<string, string>>> {\n const record = type === 'ts'\n ? dependencies.ts\n : type === 'js'\n ? dependencies.js\n : {};\n\n record.dependencies = { ...record.dependencies, ...dependencies.both.dependencies };\n record.devDependencies = { ...record.devDependencies, ...dependencies.both.devDependencies };\n\n return record;\n }\n\n export interface CreateDirectoryOptions {\n directory?: string;\n ignoredFiles?: string[];\n onNotEmpty?: 'prompt'|'throw'|'ignore';\n }\n\n export interface SetupLanguageOptions {\n typescript?: boolean;\n }\n\n export interface CreateConfigOptions extends Partial<ConfigReader.CreateOptions> {}\n\n export interface CreateModulesOptions extends Partial<CopyOptions> {}\n\n export interface SetPackageManagerOptions {\n packageManager?: PackageManagerName;\n }\n\n export interface CreateEnvFileOptions {\n envFile?: string;\n tokenKey?: string;\n env?: Record<string, string>;\n }\n\n export interface BuildOptions {\n skipInstallDependencies?: boolean;\n skipBuild?: boolean;\n }\n\n export interface CopyOptions {\n overwrite?: boolean|((data: CopyMetadata) => boolean);\n filter?: (data: CopyMetadata) => boolean;\n rename?: (data: CopyMetadata) => string;\n }\n\n export interface CopyMetadata {\n basename: string;\n src: string;\n dest: string;\n }\n\n export async function copy(from: string, to: string, options?: CopyOptions): Promise<void> {\n const fromStats = await stat(from).catch(() => undefined);\n if (!fromStats) return;\n\n if (fromStats.isDirectory()) {\n const files = await readdir(from);\n\n for (const file of files) {\n const data: CopyMetadata = {\n basename: file,\n src: path.join(from, file),\n dest: to\n };\n\n await copy(\n data.src,\n path.join(to,\n options?.rename\n ? options.rename(data)\n : file\n ),\n options\n );\n }\n return;\n }\n\n const data: CopyMetadata = {\n basename: path.basename(from),\n src: from,\n dest: to\n };\n\n if (options?.filter && !options.filter(data)) return;\n\n const toStats = await stat(to).catch(() => undefined);\n const overwrite = typeof options?.overwrite === 'function'\n ? options.overwrite(data)\n : options?.overwrite ?? true;\n\n if (toStats && overwrite) return;\n\n await mkdir(path.dirname(to), { recursive: true });\n await copyFile(from, to);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAa,kBAAb,MAAa,gBAAgB;CACzB,AAAQ;CAER,AAAO;CACP,AAAO;CACP,AAAO;CACP,AAAO;CAEP,AAAO;CACP,AAAO;CAEP,AAAO;CAEP,IAAI,YAAY;AACZ,SAAO,KAAK,cAAc,QAAQ,KAAK;;CAG3C,IAAI,oBAAoB;AACpB,SAAO,KAAK,SAAS,QAAQ,KAAK,EAAE,KAAK,UAAU,IAAI;;CAG3D,IAAI,kBAAkB;AAClB,SAAO,KAAK,KAAK,KAAK,WAAW,eAAe;;CAGpD,IAAI,OAAO;AACP,SAAO,KAAK,KAAK,SAAS,KAAK,UAAU,CAAC;;CAG9C,YAAY,SAAkC;AAC1C,OAAK,MAAM,QAAQ;AACnB,OAAK,aAAa,QAAQ;AAC1B,OAAK,aAAa,QAAQ;AAC1B,OAAK,aAAa,QAAQ,cAAc;AACxC,OAAK,iBAAiB,QAAQ;AAC9B,OAAK,QAAQ,QAAQ;;CAGzB,MAAa,OAAsB;AAC/B,QAAM,OAAO,KAAK,OAAO,MAAM,OAAO,OAAO,IAAI,KAAK,IAAI,QAAQ,MAAM,CAAC,aAAa,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3G,SAAO;;CAGX,MAAa,gBAAgB,SAAiE;AAC1F,OAAK,aAAa,SAAS,aAAa,KAAK;AAE7C,MAAI,CAAC,KAAK,YAAY;GAClB,MAAM,MAAM,KAAK,aACX,QAAQ,KAAK,GACb,MAAM,KAAK;IACT,SAAS;IACT,aAAa;IACb,cAAc,QAAQ,KAAK;IAC3B,WAAU,UAAS;KACf,MAAMA,QAAM,KAAK,QAAQ,MAAM;AAC/B,SAAI,WAAWA,MAAI,IAAI,CAAC,SAASA,M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K,KAAK,IACN,SAAS,SACH,QAAQ,OAAOA,OAAK,GACpB,KACT,EACD,QACH;;AAEL;;EAGJ,MAAMD,OAAqB;GACvB,UAAU,KAAK,SAAS,KAAK;GAC7B,KAAK;GACL,MAAM;GACT;AAED,MAAI,SAAS,UAAU,CAAC,QAAQ,OAAO,KAAK,CAAE;EAE9C,MAAM,UAAU,MAAM,KAAK,GAAG,CAAC,YAAY,OAAU;EACrD,MAAM,YAAY,OAAO,SAAS,cAAc,aAC1C,QAAQ,UAAU,KAAK,GACvB,SAAS,aAAa;AAE5B,MAAI,WAAW,UAAW;AAE1B,QAAM,MAAM,KAAK,QAAQ,GAAG,EAAE,EAAE,WAAW,MAAM,CAAC;AAClD,QAAM,SAAS,MAAM,GAAG"}
@@ -1,16 +1,37 @@
1
1
  import { ModuleType } from "../../helpers/constants.mjs";
2
2
  import { AnyModuleData } from "../../helpers/types.mjs";
3
3
  import { Validator } from "@reciple/core";
4
+ import * as _sapphire_shapeshift23 from "@sapphire/shapeshift";
4
5
 
5
6
  //#region src/classes/validation/BaseModuleValidator.d.ts
6
7
  declare class BaseModuleValidator extends Validator {
7
- static id: any;
8
- static moduleType: any;
9
- static onEnable: any;
10
- static onReady: any;
11
- static onDisable: any;
12
- static object: any;
13
- static resolvable: any;
8
+ static id: _sapphire_shapeshift23.StringValidator<string>;
9
+ static moduleType: _sapphire_shapeshift23.NativeEnumValidator<typeof ModuleType>;
10
+ static onEnable: _sapphire_shapeshift23.UnionValidator<Function | undefined>;
11
+ static onReady: _sapphire_shapeshift23.UnionValidator<Function | undefined>;
12
+ static onDisable: _sapphire_shapeshift23.UnionValidator<Function | undefined>;
13
+ static object: _sapphire_shapeshift23.ObjectValidator<{
14
+ id: string | undefined;
15
+ moduleType: ModuleType | undefined;
16
+ onEnable: Function | undefined;
17
+ onReady: Function | undefined;
18
+ onDisable: Function | undefined;
19
+ }, _sapphire_shapeshift23.UndefinedToOptional<{
20
+ id: string | undefined;
21
+ moduleType: ModuleType | undefined;
22
+ onEnable: Function | undefined;
23
+ onReady: Function | undefined;
24
+ onDisable: Function | undefined;
25
+ }>>;
26
+ static resolvable: _sapphire_shapeshift23.UnionValidator<_sapphire_shapeshift23.UndefinedToOptional<{
27
+ toJSON: Function;
28
+ }> | _sapphire_shapeshift23.UndefinedToOptional<{
29
+ id: string | undefined;
30
+ moduleType: ModuleType | undefined;
31
+ onEnable: Function | undefined;
32
+ onReady: Function | undefined;
33
+ onDisable: Function | undefined;
34
+ }>>;
14
35
  static isValidId(id: unknown): asserts id is string;
15
36
  static isValidModuleType(moduleType: unknown): asserts moduleType is ModuleType;
16
37
  static isValidOnEnable(onEnable: unknown): asserts onEnable is () => Promise<void>;
@@ -1,10 +1,115 @@
1
+ import { ModuleType } from "../../helpers/constants.mjs";
1
2
  import { AnyCommandModuleData } from "../../helpers/types.mjs";
3
+ import "../../index.mjs";
4
+ import * as _reciple_core0 from "@reciple/core";
2
5
  import { Validator } from "@reciple/core";
6
+ import * as _sapphire_shapeshift6 from "@sapphire/shapeshift";
3
7
 
4
8
  //#region src/classes/validation/CommandModuleValidator.d.ts
5
9
  declare class CommandModuleValidator extends Validator {
6
- static object: any;
7
- static resolvable: any;
10
+ static object: _sapphire_shapeshift6.ObjectValidator<{
11
+ id: string | undefined;
12
+ moduleType: ModuleType | undefined;
13
+ onEnable: Function | undefined;
14
+ onReady: Function | undefined;
15
+ onDisable: Function | undefined;
16
+ } & {
17
+ id: string;
18
+ type: _reciple_core0.CommandType;
19
+ data: _sapphire_shapeshift6.UndefinedToOptional<{
20
+ name: any;
21
+ description: any;
22
+ aliases: any;
23
+ options: any;
24
+ flags: any;
25
+ }> | _sapphire_shapeshift6.UndefinedToOptional<{
26
+ type: any;
27
+ name: any;
28
+ }>;
29
+ cooldown: number | undefined;
30
+ preconditions: _sapphire_shapeshift6.UndefinedToOptional<{
31
+ id: any;
32
+ scope: any;
33
+ execute: any;
34
+ }>[] | undefined;
35
+ postconditions: _sapphire_shapeshift6.UndefinedToOptional<{
36
+ id: any;
37
+ scope: any;
38
+ execute: any;
39
+ }>[] | undefined;
40
+ disabledPreconditions: string[] | undefined;
41
+ disabledPostconditions: string[] | undefined;
42
+ execute: Function;
43
+ }, _sapphire_shapeshift6.UndefinedToOptional<{
44
+ id: string | undefined;
45
+ moduleType: ModuleType | undefined;
46
+ onEnable: Function | undefined;
47
+ onReady: Function | undefined;
48
+ onDisable: Function | undefined;
49
+ } & {
50
+ id: string;
51
+ type: _reciple_core0.CommandType;
52
+ data: _sapphire_shapeshift6.UndefinedToOptional<{
53
+ name: any;
54
+ description: any;
55
+ aliases: any;
56
+ options: any;
57
+ flags: any;
58
+ }> | _sapphire_shapeshift6.UndefinedToOptional<{
59
+ type: any;
60
+ name: any;
61
+ }>;
62
+ cooldown: number | undefined;
63
+ preconditions: _sapphire_shapeshift6.UndefinedToOptional<{
64
+ id: any;
65
+ scope: any;
66
+ execute: any;
67
+ }>[] | undefined;
68
+ postconditions: _sapphire_shapeshift6.UndefinedToOptional<{
69
+ id: any;
70
+ scope: any;
71
+ execute: any;
72
+ }>[] | undefined;
73
+ disabledPreconditions: string[] | undefined;
74
+ disabledPostconditions: string[] | undefined;
75
+ execute: Function;
76
+ }>>;
77
+ static resolvable: _sapphire_shapeshift6.UnionValidator<_sapphire_shapeshift6.UndefinedToOptional<{
78
+ toJSON: Function;
79
+ }> | _sapphire_shapeshift6.UndefinedToOptional<{
80
+ id: string | undefined;
81
+ moduleType: ModuleType | undefined;
82
+ onEnable: Function | undefined;
83
+ onReady: Function | undefined;
84
+ onDisable: Function | undefined;
85
+ } & {
86
+ id: string;
87
+ type: _reciple_core0.CommandType;
88
+ data: _sapphire_shapeshift6.UndefinedToOptional<{
89
+ name: any;
90
+ description: any;
91
+ aliases: any;
92
+ options: any;
93
+ flags: any;
94
+ }> | _sapphire_shapeshift6.UndefinedToOptional<{
95
+ type: any;
96
+ name: any;
97
+ }>;
98
+ cooldown: number | undefined;
99
+ preconditions: _sapphire_shapeshift6.UndefinedToOptional<{
100
+ id: any;
101
+ scope: any;
102
+ execute: any;
103
+ }>[] | undefined;
104
+ postconditions: _sapphire_shapeshift6.UndefinedToOptional<{
105
+ id: any;
106
+ scope: any;
107
+ execute: any;
108
+ }>[] | undefined;
109
+ disabledPreconditions: string[] | undefined;
110
+ disabledPostconditions: string[] | undefined;
111
+ execute: Function;
112
+ }>>;
8
113
  static isValid(value: unknown): asserts value is AnyCommandModuleData;
9
114
  }
10
115
  //#endregion
@@ -1,15 +1,53 @@
1
+ import { ModuleType } from "../../helpers/constants.mjs";
1
2
  import { EventModule } from "../modules/events/EventModule.mjs";
3
+ import "../../index.mjs";
2
4
  import { Validator } from "@reciple/core";
3
5
  import { EventEmitter } from "node:events";
6
+ import * as _sapphire_shapeshift41 from "@sapphire/shapeshift";
4
7
 
5
8
  //#region src/classes/validation/EventModuleValidator.d.ts
6
9
  declare class EventModuleValidator extends Validator {
7
- static emitter: any;
8
- static event: any;
9
- static once: any;
10
- static onEvent: any;
11
- static object: any;
12
- static resolvable: any;
10
+ static emitter: _sapphire_shapeshift41.InstanceValidator<EventEmitter<[never] | Record<string | number | symbol, any[]>>>;
11
+ static event: _sapphire_shapeshift41.StringValidator<string>;
12
+ static once: _sapphire_shapeshift41.UnionValidator<boolean | undefined>;
13
+ static onEvent: _sapphire_shapeshift41.InstanceValidator<Function>;
14
+ static object: _sapphire_shapeshift41.ObjectValidator<{
15
+ id: string | undefined;
16
+ moduleType: ModuleType | undefined;
17
+ onEnable: Function | undefined;
18
+ onReady: Function | undefined;
19
+ onDisable: Function | undefined;
20
+ } & {
21
+ emitter: EventEmitter<[never] | Record<string | number | symbol, any[]>>;
22
+ event: string;
23
+ once: boolean | undefined;
24
+ onEvent: Function;
25
+ }, _sapphire_shapeshift41.UndefinedToOptional<{
26
+ id: string | undefined;
27
+ moduleType: ModuleType | undefined;
28
+ onEnable: Function | undefined;
29
+ onReady: Function | undefined;
30
+ onDisable: Function | undefined;
31
+ } & {
32
+ emitter: EventEmitter<[never] | Record<string | number | symbol, any[]>>;
33
+ event: string;
34
+ once: boolean | undefined;
35
+ onEvent: Function;
36
+ }>>;
37
+ static resolvable: _sapphire_shapeshift41.UnionValidator<_sapphire_shapeshift41.UndefinedToOptional<{
38
+ toJSON: Function;
39
+ }> | _sapphire_shapeshift41.UndefinedToOptional<{
40
+ id: string | undefined;
41
+ moduleType: ModuleType | undefined;
42
+ onEnable: Function | undefined;
43
+ onReady: Function | undefined;
44
+ onDisable: Function | undefined;
45
+ } & {
46
+ emitter: EventEmitter<[never] | Record<string | number | symbol, any[]>>;
47
+ event: string;
48
+ once: boolean | undefined;
49
+ onEvent: Function;
50
+ }>>;
13
51
  static isValidEmitter(emitter: unknown): asserts emitter is EventEmitter;
14
52
  static isValidEvent(event: unknown): asserts event is string;
15
53
  static isValidOnce(once: unknown): asserts once is boolean;
@@ -1,13 +1,25 @@
1
1
  import { PostconditionModule } from "../modules/PostconditionModule.mjs";
2
2
  import { CommandPostconditionReason, CommandType, Validator } from "@reciple/core";
3
+ import * as _sapphire_shapeshift33 from "@sapphire/shapeshift";
3
4
 
4
5
  //#region src/classes/validation/PostconditionModule.d.ts
5
6
  declare class PostconditionModuleValidator extends Validator {
6
- static scope: any;
7
- static accepts: any;
8
- static execute: any;
9
- static object: any;
10
- static resolvable: any;
7
+ static scope: _sapphire_shapeshift33.UnionValidator<CommandType[] | undefined>;
8
+ static accepts: _sapphire_shapeshift33.UnionValidator<CommandPostconditionReason[] | undefined>;
9
+ static execute: _sapphire_shapeshift33.InstanceValidator<Function>;
10
+ static object: _sapphire_shapeshift33.ObjectValidator<{
11
+ scope: CommandType[] | undefined;
12
+ execute: Function;
13
+ }, _sapphire_shapeshift33.UndefinedToOptional<{
14
+ scope: CommandType[] | undefined;
15
+ execute: Function;
16
+ }>>;
17
+ static resolvable: _sapphire_shapeshift33.UnionValidator<_sapphire_shapeshift33.UndefinedToOptional<{
18
+ toJSON: Function;
19
+ }> | _sapphire_shapeshift33.UndefinedToOptional<{
20
+ scope: CommandType[] | undefined;
21
+ execute: Function;
22
+ }>>;
11
23
  static isValidScope(scope: unknown): asserts scope is CommandType[];
12
24
  static isValidAccepts(accepts: unknown): asserts accepts is CommandPostconditionReason[];
13
25
  static isValidExecute(execute: unknown): asserts execute is (...args: unknown[]) => Promise<void>;
@@ -1,12 +1,24 @@
1
1
  import { PreconditionModule } from "../modules/PreconditionModule.mjs";
2
2
  import { CommandType, Validator } from "@reciple/core";
3
+ import * as _sapphire_shapeshift0 from "@sapphire/shapeshift";
3
4
 
4
5
  //#region src/classes/validation/PreconditionModule.d.ts
5
6
  declare class PreconditionModuleValidator extends Validator {
6
- static scope: any;
7
- static execute: any;
8
- static object: any;
9
- static resolvable: any;
7
+ static scope: _sapphire_shapeshift0.UnionValidator<CommandType[] | undefined>;
8
+ static execute: _sapphire_shapeshift0.InstanceValidator<Function>;
9
+ static object: _sapphire_shapeshift0.ObjectValidator<{
10
+ scope: CommandType[] | undefined;
11
+ execute: Function;
12
+ }, _sapphire_shapeshift0.UndefinedToOptional<{
13
+ scope: CommandType[] | undefined;
14
+ execute: Function;
15
+ }>>;
16
+ static resolvable: _sapphire_shapeshift0.UnionValidator<_sapphire_shapeshift0.UndefinedToOptional<{
17
+ scope: CommandType[] | undefined;
18
+ execute: Function;
19
+ }> | _sapphire_shapeshift0.UndefinedToOptional<{
20
+ toJSON: Function;
21
+ }>>;
10
22
  static isValidScope(scope: unknown): asserts scope is CommandType[];
11
23
  static isValidExecute(execute: unknown): asserts execute is (...args: unknown[]) => Promise<void>;
12
24
  static isValid(value: unknown): asserts value is PreconditionModule.Data;
@@ -1,11 +1,12 @@
1
1
  import { CLI } from "../classes/cli/CLI.mjs";
2
+ import { PackageJson } from "@reciple/utils";
2
3
 
3
4
  //#region src/helpers/constants.d.ts
4
5
 
5
6
  /**
6
7
  * @private
7
8
  */
8
- declare const packageJSON: any;
9
+ declare const packageJSON: PackageJson;
9
10
  declare const cli: CLI;
10
11
  declare enum ModuleType {
11
12
  Base = 1,
package/dist/index.d.mts CHANGED
@@ -20,10 +20,10 @@ import { RESTEventModule } from "./classes/modules/events/RESTEventModule.mjs";
20
20
  import { ModuleTemplateBuilder } from "./classes/templates/ModuleTemplateBuilder.mjs";
21
21
  import { TemplateBuilder } from "./classes/templates/TemplateBuilder.mjs";
22
22
  import { BaseModuleValidator } from "./classes/validation/BaseModuleValidator.mjs";
23
- import { CommandModuleValidator } from "./classes/validation/CommandModuleValidator.mjs";
24
23
  import { EventModuleValidator } from "./classes/validation/EventModuleValidator.mjs";
25
24
  import { PostconditionModuleValidator } from "./classes/validation/PostconditionModule.mjs";
26
25
  import { PreconditionModuleValidator } from "./classes/validation/PreconditionModule.mjs";
26
+ import { CommandModuleValidator } from "./classes/validation/CommandModuleValidator.mjs";
27
27
  import * as Prtyprnt from "prtyprnt";
28
28
  import { Logger } from "prtyprnt";
29
29
  import { Client } from "@reciple/core";
package/dist/package.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var package_default = {
3
3
  name: "reciple",
4
- version: "10.0.0",
4
+ version: "10.0.1-dev.1",
5
5
  license: "LGPL-3.0-only",
6
6
  description: "The CLI for reciple",
7
7
  module: "./dist/index.mjs",
@@ -37,7 +37,7 @@ var package_default = {
37
37
  dependencies: {
38
38
  "@clack/prompts": "^0.11.0",
39
39
  "@dotenvx/dotenvx": "^1.51.1",
40
- "@reciple/utils": "*",
40
+ "@reciple/utils": "^10.0.1-dev.0",
41
41
  "@sapphire/shapeshift": "^4.0.0",
42
42
  "@sapphire/snowflake": "^3.5.5",
43
43
  "commander": "^14.0.2",
@@ -55,7 +55,7 @@ var package_default = {
55
55
  "unrun": "^0.2.14"
56
56
  },
57
57
  devDependencies: {
58
- "@reciple/jsx": "*",
58
+ "@reciple/jsx": "^10.0.1-dev.0",
59
59
  "@types/micromatch": "^4.0.10",
60
60
  "@types/node": "^24.10.1",
61
61
  "@types/semver": "^7.7.1",
@@ -64,14 +64,15 @@ var package_default = {
64
64
  "rolldown": "^1.0.0-beta.52"
65
65
  },
66
66
  peerDependencies: {
67
- "@reciple/core": "*",
67
+ "@reciple/core": "^10.0.0 || >=10.0.1-dev.0",
68
68
  "discord.js": "^14.25.1"
69
69
  },
70
70
  peerDependenciesMeta: {
71
71
  "@reciple/core": { "optional": false },
72
72
  "discord.js": { "optional": false }
73
73
  },
74
- publishConfig: { "access": "public" }
74
+ publishConfig: { "access": "public" },
75
+ gitHead: "d1b10df6047657e7427a7811a5c808487b4985f4"
75
76
  };
76
77
 
77
78
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\r\n \"name\": \"reciple\",\r\n \"version\": \"10.0.0\",\r\n \"license\": \"LGPL-3.0-only\",\r\n \"description\": \"The CLI for reciple\",\r\n \"module\": \"./dist/index.mjs\",\r\n \"types\": \"./dist/index.d.mts\",\r\n \"bin\": \"./dist/bin/reciple.mjs\",\r\n \"type\": \"module\",\r\n \"exports\": {\r\n \".\": {\r\n \"import\": \"./dist/index.mjs\",\r\n \"types\": \"./dist/index.d.mts\"\r\n },\r\n \"./jsx-runtime\": {\r\n \"import\": \"./dist/helpers/jsx-runtime.mjs\",\r\n \"types\": \"./dist/helpers/jsx-runtime.d.mts\"\r\n }\r\n },\r\n \"files\": [\r\n \"dist\",\r\n \"assets\",\r\n \"README.md\"\r\n ],\r\n \"scripts\": {\r\n \"clean\": \"rimraf ./dist\",\r\n \"build\": \"tsdown --config-loader unrun\",\r\n \"check\": \"tsc --noEmit\",\r\n \"prepack\": \"npm run build\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/thenorthsolution/reciple\",\r\n \"directory\": \"packages/reciple\"\r\n },\r\n \"dependencies\": {\r\n \"@clack/prompts\": \"^0.11.0\",\r\n \"@dotenvx/dotenvx\": \"^1.51.1\",\r\n \"@reciple/utils\": \"*\",\r\n \"@sapphire/shapeshift\": \"^4.0.0\",\r\n \"@sapphire/snowflake\": \"^3.5.5\",\r\n \"commander\": \"^14.0.2\",\r\n \"detect-indent\": \"^7.0.2\",\r\n \"github-slugger\": \"^2.0.0\",\r\n \"globby\": \"^16.0.0\",\r\n \"load-tsconfig\": \"^0.2.5\",\r\n \"micromatch\": \"^4.0.8\",\r\n \"ora\": \"^9.0.0\",\r\n \"pkg-types\": \"^2.3.0\",\r\n \"semver\": \"^7.7.3\",\r\n \"ts-mixer\": \"^6.0.4\",\r\n \"tsdown\": \"^0.16.8\",\r\n \"unconfig\": \"^7.4.1\",\r\n \"unrun\": \"^0.2.14\"\r\n },\r\n \"devDependencies\": {\r\n \"@reciple/jsx\": \"*\",\r\n \"@types/micromatch\": \"^4.0.10\",\r\n \"@types/node\": \"^24.10.1\",\r\n \"@types/semver\": \"^7.7.1\",\r\n \"nodemon\": \"^3.1.11\",\r\n \"prtyprnt\": \"^2.0.1\",\r\n \"rolldown\": \"^1.0.0-beta.52\"\r\n },\r\n \"peerDependencies\": {\r\n \"@reciple/core\": \"*\",\r\n \"discord.js\": \"^14.25.1\"\r\n },\r\n \"peerDependenciesMeta\": {\r\n \"@reciple/core\": {\r\n \"optional\": false\r\n },\r\n \"discord.js\": {\r\n \"optional\": false\r\n }\r\n },\r\n \"publishConfig\": {\r\n \"access\": \"public\"\r\n }\r\n}\r\n"],"mappings":";sBAAA;OACU;UACG;UACA;cACI;SACL;QACD;MACF;OACC;UACG;EACT,KAAK;GACH,UAAU;GACV,SAAS;GACV;EACD,iBAAiB;GACf,UAAU;GACV,SAAS;GACV;EACF;QACQ;EACP;EACA;EACA;EACD;UACU;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,WAAW;EACZ;aACa;EACZ,QAAQ;EACR,OAAO;EACP,aAAa;EACd;eACe;EACd,kBAAkB;EAClB,oBAAoB;EACpB,kBAAkB;EAClB,wBAAwB;EACxB,uBAAuB;EACvB,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,UAAU;EACV,iBAAiB;EACjB,cAAc;EACd,OAAO;EACP,aAAa;EACb,UAAU;EACV,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,SAAS;EACV;kBACkB;EACjB,gBAAgB;EAChB,qBAAqB;EACrB,eAAe;EACf,iBAAiB;EACjB,WAAW;EACX,YAAY;EACZ,YAAY;EACb;mBACmB;EAClB,iBAAiB;EACjB,cAAc;EACf;uBACuB;EACtB,iBAAiB,EACf,YAAY,OACb;EACD,cAAc,EACZ,YAAY,OACb;EACF;gBACgB,EACf,UAAU,UACX;CACF"}
1
+ {"version":3,"file":"package.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"reciple\",\n \"version\": \"10.0.1-dev.1\",\n \"license\": \"LGPL-3.0-only\",\n \"description\": \"The CLI for reciple\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.mts\",\n \"bin\": \"./dist/bin/reciple.mjs\",\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.mts\"\n },\n \"./jsx-runtime\": {\n \"import\": \"./dist/helpers/jsx-runtime.mjs\",\n \"types\": \"./dist/helpers/jsx-runtime.d.mts\"\n }\n },\n \"files\": [\n \"dist\",\n \"assets\",\n \"README.md\"\n ],\n \"scripts\": {\n \"clean\": \"rimraf ./dist\",\n \"build\": \"tsdown --config-loader unrun\",\n \"check\": \"tsc --noEmit\",\n \"prepack\": \"npm run build\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/thenorthsolution/reciple\",\n \"directory\": \"packages/reciple\"\n },\n \"dependencies\": {\n \"@clack/prompts\": \"^0.11.0\",\n \"@dotenvx/dotenvx\": \"^1.51.1\",\n \"@reciple/utils\": \"^10.0.1-dev.0\",\n \"@sapphire/shapeshift\": \"^4.0.0\",\n \"@sapphire/snowflake\": \"^3.5.5\",\n \"commander\": \"^14.0.2\",\n \"detect-indent\": \"^7.0.2\",\n \"github-slugger\": \"^2.0.0\",\n \"globby\": \"^16.0.0\",\n \"load-tsconfig\": \"^0.2.5\",\n \"micromatch\": \"^4.0.8\",\n \"ora\": \"^9.0.0\",\n \"pkg-types\": \"^2.3.0\",\n \"semver\": \"^7.7.3\",\n \"ts-mixer\": \"^6.0.4\",\n \"tsdown\": \"^0.16.8\",\n \"unconfig\": \"^7.4.1\",\n \"unrun\": \"^0.2.14\"\n },\n \"devDependencies\": {\n \"@reciple/jsx\": \"^10.0.1-dev.0\",\n \"@types/micromatch\": \"^4.0.10\",\n \"@types/node\": \"^24.10.1\",\n \"@types/semver\": \"^7.7.1\",\n \"nodemon\": \"^3.1.11\",\n \"prtyprnt\": \"^2.0.1\",\n \"rolldown\": \"^1.0.0-beta.52\"\n },\n \"peerDependencies\": {\n \"@reciple/core\": \"^10.0.0 || >=10.0.1-dev.0\",\n \"discord.js\": \"^14.25.1\"\n },\n \"peerDependenciesMeta\": {\n \"@reciple/core\": {\n \"optional\": false\n },\n \"discord.js\": {\n \"optional\": false\n }\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"gitHead\": \"d1b10df6047657e7427a7811a5c808487b4985f4\"\n}\n"],"mappings":";sBAAA;OACU;UACG;UACA;cACI;SACL;QACD;MACF;OACC;UACG;EACT,KAAK;GACH,UAAU;GACV,SAAS;GACV;EACD,iBAAiB;GACf,UAAU;GACV,SAAS;GACV;EACF;QACQ;EACP;EACA;EACA;EACD;UACU;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,WAAW;EACZ;aACa;EACZ,QAAQ;EACR,OAAO;EACP,aAAa;EACd;eACe;EACd,kBAAkB;EAClB,oBAAoB;EACpB,kBAAkB;EAClB,wBAAwB;EACxB,uBAAuB;EACvB,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,UAAU;EACV,iBAAiB;EACjB,cAAc;EACd,OAAO;EACP,aAAa;EACb,UAAU;EACV,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,SAAS;EACV;kBACkB;EACjB,gBAAgB;EAChB,qBAAqB;EACrB,eAAe;EACf,iBAAiB;EACjB,WAAW;EACX,YAAY;EACZ,YAAY;EACb;mBACmB;EAClB,iBAAiB;EACjB,cAAc;EACf;uBACuB;EACtB,iBAAiB,EACf,YAAY,OACb;EACD,cAAc,EACZ,YAAY,OACb;EACF;gBACgB,EACf,UAAU,UACX;UACU;CACZ"}
package/package.json CHANGED
@@ -1,80 +1,81 @@
1
- {
2
- "name": "reciple",
3
- "version": "10.0.0",
4
- "license": "LGPL-3.0-only",
5
- "description": "The CLI for reciple",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.mts",
8
- "bin": "./dist/bin/reciple.mjs",
9
- "type": "module",
10
- "exports": {
11
- ".": {
12
- "import": "./dist/index.mjs",
13
- "types": "./dist/index.d.mts"
14
- },
15
- "./jsx-runtime": {
16
- "import": "./dist/helpers/jsx-runtime.mjs",
17
- "types": "./dist/helpers/jsx-runtime.d.mts"
18
- }
19
- },
20
- "files": [
21
- "dist",
22
- "assets",
23
- "README.md"
24
- ],
25
- "scripts": {
26
- "clean": "rimraf ./dist",
27
- "build": "tsdown --config-loader unrun",
28
- "check": "tsc --noEmit",
29
- "prepack": "npm run build"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/thenorthsolution/reciple",
34
- "directory": "packages/reciple"
35
- },
36
- "dependencies": {
37
- "@clack/prompts": "^0.11.0",
38
- "@dotenvx/dotenvx": "^1.51.1",
39
- "@reciple/utils": "*",
40
- "@sapphire/shapeshift": "^4.0.0",
41
- "@sapphire/snowflake": "^3.5.5",
42
- "commander": "^14.0.2",
43
- "detect-indent": "^7.0.2",
44
- "github-slugger": "^2.0.0",
45
- "globby": "^16.0.0",
46
- "load-tsconfig": "^0.2.5",
47
- "micromatch": "^4.0.8",
48
- "ora": "^9.0.0",
49
- "pkg-types": "^2.3.0",
50
- "semver": "^7.7.3",
51
- "ts-mixer": "^6.0.4",
52
- "tsdown": "^0.16.8",
53
- "unconfig": "^7.4.1",
54
- "unrun": "^0.2.14"
55
- },
56
- "devDependencies": {
57
- "@reciple/jsx": "*",
58
- "@types/micromatch": "^4.0.10",
59
- "@types/node": "^24.10.1",
60
- "@types/semver": "^7.7.1",
61
- "nodemon": "^3.1.11",
62
- "prtyprnt": "^2.0.1",
63
- "rolldown": "^1.0.0-beta.52"
64
- },
65
- "peerDependencies": {
66
- "@reciple/core": "*",
67
- "discord.js": "^14.25.1"
68
- },
69
- "peerDependenciesMeta": {
70
- "@reciple/core": {
71
- "optional": false
72
- },
73
- "discord.js": {
74
- "optional": false
75
- }
76
- },
77
- "publishConfig": {
78
- "access": "public"
79
- }
80
- }
1
+ {
2
+ "name": "reciple",
3
+ "version": "10.0.1-dev.1",
4
+ "license": "LGPL-3.0-only",
5
+ "description": "The CLI for reciple",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.mts",
8
+ "bin": "./dist/bin/reciple.mjs",
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.mjs",
13
+ "types": "./dist/index.d.mts"
14
+ },
15
+ "./jsx-runtime": {
16
+ "import": "./dist/helpers/jsx-runtime.mjs",
17
+ "types": "./dist/helpers/jsx-runtime.d.mts"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "assets",
23
+ "README.md"
24
+ ],
25
+ "scripts": {
26
+ "clean": "rimraf ./dist",
27
+ "build": "tsdown --config-loader unrun",
28
+ "check": "tsc --noEmit",
29
+ "prepack": "npm run build"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/thenorthsolution/reciple",
34
+ "directory": "packages/reciple"
35
+ },
36
+ "dependencies": {
37
+ "@clack/prompts": "^0.11.0",
38
+ "@dotenvx/dotenvx": "^1.51.1",
39
+ "@reciple/utils": "^10.0.1-dev.0",
40
+ "@sapphire/shapeshift": "^4.0.0",
41
+ "@sapphire/snowflake": "^3.5.5",
42
+ "commander": "^14.0.2",
43
+ "detect-indent": "^7.0.2",
44
+ "github-slugger": "^2.0.0",
45
+ "globby": "^16.0.0",
46
+ "load-tsconfig": "^0.2.5",
47
+ "micromatch": "^4.0.8",
48
+ "ora": "^9.0.0",
49
+ "pkg-types": "^2.3.0",
50
+ "semver": "^7.7.3",
51
+ "ts-mixer": "^6.0.4",
52
+ "tsdown": "^0.16.8",
53
+ "unconfig": "^7.4.1",
54
+ "unrun": "^0.2.14"
55
+ },
56
+ "devDependencies": {
57
+ "@reciple/jsx": "^10.0.1-dev.0",
58
+ "@types/micromatch": "^4.0.10",
59
+ "@types/node": "^24.10.1",
60
+ "@types/semver": "^7.7.1",
61
+ "nodemon": "^3.1.11",
62
+ "prtyprnt": "^2.0.1",
63
+ "rolldown": "^1.0.0-beta.52"
64
+ },
65
+ "peerDependencies": {
66
+ "@reciple/core": "^10.0.0 || >=10.0.1-dev.0",
67
+ "discord.js": "^14.25.1"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "@reciple/core": {
71
+ "optional": false
72
+ },
73
+ "discord.js": {
74
+ "optional": false
75
+ }
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "gitHead": "d1b10df6047657e7427a7811a5c808487b4985f4"
81
+ }