create-reciple 9.12.0 → 10.0.1-dev.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/LICENSE +155 -674
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +17 -46
- package/README.md +0 -44
- package/assets/README.md +0 -29
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -58
- package/dist/bin.js.map +0 -1
- package/dist/classes/Addon.d.ts +0 -68
- package/dist/classes/Addon.js +0 -111
- package/dist/classes/Addon.js.map +0 -1
- package/dist/classes/Config.d.ts +0 -31
- package/dist/classes/Config.js +0 -61
- package/dist/classes/Config.js.map +0 -1
- package/dist/classes/Setup.d.ts +0 -43
- package/dist/classes/Setup.js +0 -149
- package/dist/classes/Setup.js.map +0 -1
- package/dist/classes/TemplateBuilder.d.ts +0 -94
- package/dist/classes/TemplateBuilder.js +0 -244
- package/dist/classes/TemplateBuilder.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -13
- package/dist/utils/constants.js +0 -75
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -32
- package/dist/utils/helpers.js +0 -88
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/types.d.ts +0 -20
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.js.map +0 -1
- package/templates/javascript/dot.gitignore +0 -130
- package/templates/javascript/modules/commands/PingCommand.js +0 -68
- package/templates/javascript/modules/events/WelcomeEvent.js +0 -54
- package/templates/javascript/modules/halts/CommandErrorHalt.js +0 -59
- package/templates/javascript/modules/preconditions/ExamplePrecondition.js +0 -27
- package/templates/javascript/nodemon.json +0 -16
- package/templates/javascript/package.json +0 -18
- package/templates/javascript/template.json +0 -4
- package/templates/typescript/dot.gitignore +0 -133
- package/templates/typescript/nodemon.json +0 -17
- package/templates/typescript/package.json +0 -21
- package/templates/typescript/src/commands/PingCommand.ts +0 -52
- package/templates/typescript/src/events/WelcomeEvent.ts +0 -39
- package/templates/typescript/src/halts/CommandErrorHalt.ts +0 -44
- package/templates/typescript/src/preconditions/ExamplePrecondition.ts +0 -18
- package/templates/typescript/template.json +0 -4
- package/templates/typescript/tsconfig.json +0 -19
- package/templates/typescript-decorators/dot.gitignore +0 -133
- package/templates/typescript-decorators/nodemon.json +0 -17
- package/templates/typescript-decorators/package.json +0 -22
- package/templates/typescript-decorators/src/commands/PingCommand.ts +0 -45
- package/templates/typescript-decorators/src/events/WelcomeEvent.ts +0 -37
- package/templates/typescript-decorators/src/halts/CommandErrorHalt.ts +0 -44
- package/templates/typescript-decorators/src/preconditions/ExamplePrecondition.ts +0 -18
- package/templates/typescript-decorators/template.json +0 -4
- package/templates/typescript-decorators/tsconfig.json +0 -19
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fork } from "node:child_process";
|
|
3
|
+
import { CLI } from "reciple";
|
|
4
|
+
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
fork(CLI.bin, ["create", ...process.argv.slice(2)], { stdio: "inherit" });
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { };
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { fork } from 'node:child_process';\nimport { CLI } from 'reciple';\n\nfork(CLI.bin, ['create', ...process.argv.slice(2)], {\n stdio: 'inherit'\n});\n"],"mappings":";;;;;AAIA,KAAK,IAAI,KAAK,CAAC,UAAU,GAAG,QAAQ,KAAK,MAAM,EAAE,CAAC,EAAE,EAChD,OAAO,WACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,59 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-reciple",
|
|
3
|
-
"
|
|
4
|
-
"license": "
|
|
5
|
-
"
|
|
3
|
+
"version": "10.0.1-dev.0",
|
|
4
|
+
"license": "LGPL-3.0-only",
|
|
5
|
+
"description": "Alias for `reciple create`",
|
|
6
|
+
"bin": "./dist/index.mjs",
|
|
6
7
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"keywords": [
|
|
11
|
-
"reciple",
|
|
12
|
-
"template"
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
13
11
|
],
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"import": "./dist/index.js",
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/thenorthsolution/Reciple",
|
|
23
|
-
"directory": "packages/create-reciple"
|
|
24
|
-
},
|
|
25
12
|
"scripts": {
|
|
26
13
|
"clean": "rimraf ./dist",
|
|
27
|
-
"build": "
|
|
14
|
+
"build": "tsdown --config-loader unrun",
|
|
28
15
|
"check": "tsc --noEmit",
|
|
29
|
-
"docs": "node ../docgen/dist/bin.js -i ./src/index.ts -o ./docs/docs.json",
|
|
30
16
|
"prepack": "npm run build"
|
|
31
17
|
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/thenorthsolution/reciple",
|
|
21
|
+
"directory": "packages/create-reciple"
|
|
22
|
+
},
|
|
38
23
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
"@reciple/core": "^9.9.0",
|
|
41
|
-
"@reciple/decorators": "^9.5.0",
|
|
42
|
-
"@reciple/utils": "^9.8.0",
|
|
43
|
-
"commander": "^13.1.0",
|
|
44
|
-
"compressing": "^1.10.1",
|
|
45
|
-
"detect-indent": "^7.0.1",
|
|
46
|
-
"discord.js": "^14.18.0",
|
|
47
|
-
"fallout-utility": "^2.9.1",
|
|
48
|
-
"ora": "^8.2.0",
|
|
49
|
-
"package-json": "^10.0.1",
|
|
50
|
-
"reciple": "^9.9.0"
|
|
24
|
+
"reciple": "^10.0.1-dev.0"
|
|
51
25
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"nodemon": "^3.1.9",
|
|
55
|
-
"rimraf": "^6.0.1",
|
|
56
|
-
"typescript": "^5.7.2"
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
57
28
|
},
|
|
58
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "2face99ea9bbfcf1e9385c30c19b6265c4ec556d"
|
|
59
30
|
}
|
package/README.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<h1 align="center">
|
|
2
|
-
<img src="https://i.imgur.com/h0ljJR5.png" width="50%">
|
|
3
|
-
<br>
|
|
4
|
-
</h1>
|
|
5
|
-
|
|
6
|
-
<h3 align="center">
|
|
7
|
-
<a href="https://discord.gg/2gyckrwK7b">
|
|
8
|
-
<img src="https://img.shields.io/discord/1032785824686817291?color=5865F2&logo=discord&logoColor=white">
|
|
9
|
-
</a>
|
|
10
|
-
<a href="https://npmjs.org/package/create-reciple">
|
|
11
|
-
<img src="https://img.shields.io/npm/v/create-reciple?label=npm">
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://github.com/thenorthsolution/Reciple/tree/main/packages/create-reciple">
|
|
14
|
-
<img src="https://img.shields.io/npm/dt/create-reciple?maxAge=3600">
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://www.codefactor.io/repository/github/thenorthsolution/reciple">
|
|
17
|
-
<img src="https://www.codefactor.io/repository/github/thenorthsolution/reciple/badge">
|
|
18
|
-
</a>
|
|
19
|
-
<br>
|
|
20
|
-
<div style="padding-top: 1rem">
|
|
21
|
-
<a href="https://discord.gg/2gyckrwK7b">
|
|
22
|
-
<img src="http://invidget.switchblade.xyz/2gyckrwK7b">
|
|
23
|
-
</a>
|
|
24
|
-
</div>
|
|
25
|
-
</h3>
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## About
|
|
30
|
-
|
|
31
|
-
`create-reciple` is a tool used to easily create Reciple projects.
|
|
32
|
-
|
|
33
|
-
## Installation
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm create reciple@latest
|
|
37
|
-
yarn create reciple@latest
|
|
38
|
-
pnpm create reciple@latest
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Templates
|
|
42
|
-
- Javascript (ES Modules)
|
|
43
|
-
- Typescript (ES Modules)
|
|
44
|
-
|
package/assets/README.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Reciple App
|
|
2
|
-
|
|
3
|
-
This project is generated with [`create-reciple`](https://npmjs.org/package/create-reciple)
|
|
4
|
-
|
|
5
|
-
## Developing
|
|
6
|
-
|
|
7
|
-
Set your Discord token in `.env` file located in your bot's root directory.
|
|
8
|
-
|
|
9
|
-
```properties
|
|
10
|
-
# Replace this value to your Discord bot token from https://discord.com/developers/applications
|
|
11
|
-
TOKEN=""
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
To start your bot in watch mode, run:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
npm run dev
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
To start your bot for production your can use `npm run start`.
|
|
21
|
-
|
|
22
|
-
> Note: You need to have Node.js v18+ installed.
|
|
23
|
-
|
|
24
|
-
If your want to learn more, refer to these websites:
|
|
25
|
-
|
|
26
|
-
- [Reciple Guide](https://reciple.js.org/guide)
|
|
27
|
-
- [Reciple Docs](https://reciple.js.org/docs)
|
|
28
|
-
- [Discord.js Docs](https://discord.js.org/#/)
|
|
29
|
-
- [Discord API Docs](https://discord.com/developers/docs)
|
package/dist/bin.d.ts
DELETED
package/dist/bin.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { packageJson, packageManagers, templatesFolder } from './utils/constants.js';
|
|
3
|
-
import { getTemplates } from './utils/helpers.js';
|
|
4
|
-
import { Setup } from './classes/Setup.js';
|
|
5
|
-
import { kleur } from 'fallout-utility';
|
|
6
|
-
import { outro, select } from '@clack/prompts';
|
|
7
|
-
import { Command } from 'commander';
|
|
8
|
-
import { TemplateBuilder } from './classes/TemplateBuilder.js';
|
|
9
|
-
const command = new Command()
|
|
10
|
-
.name(packageJson.name)
|
|
11
|
-
.description(packageJson.description)
|
|
12
|
-
.version(packageJson.version, '-v, --version')
|
|
13
|
-
.argument('[dir]', 'Create template in this folder')
|
|
14
|
-
.option('--force', 'Force override existing files in directory', false)
|
|
15
|
-
.option('--typescript', 'Use typescript templates', 'null')
|
|
16
|
-
.option('--package-manager <npm,yarn,pnpm>', 'Set package manager', 'null')
|
|
17
|
-
.option('-t, --token <DiscordToken>', 'Add token to created .env')
|
|
18
|
-
.option('--no-addons', 'Disable addons prompt', false)
|
|
19
|
-
.option('-a, --addons <addon...>', 'Add a Reciple official addons', []);
|
|
20
|
-
command.parse(process.argv);
|
|
21
|
-
const options = command.opts();
|
|
22
|
-
const templates = await getTemplates(templatesFolder);
|
|
23
|
-
const setup = new Setup({
|
|
24
|
-
dir: command.args[0] || undefined,
|
|
25
|
-
isTypescript: (options.typescript !== 'null' ? options.typescript : '') || undefined,
|
|
26
|
-
packageManager: (options.packageManager !== 'null' ? options.packageManager : '') || undefined,
|
|
27
|
-
token: options.token || undefined,
|
|
28
|
-
addons: Array.isArray(options.addons) && options.addons.length ? options.addons : undefined
|
|
29
|
-
});
|
|
30
|
-
await setup.prompt(options.force || false);
|
|
31
|
-
const availableTemplates = templates.filter(p => p.language === (setup.isTypescript ? 'Typescript' : 'Javascript'));
|
|
32
|
-
if (!availableTemplates.length) {
|
|
33
|
-
setup.cancelPrompts(`Template not found`);
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
const templateId = availableTemplates.length === 1
|
|
37
|
-
? availableTemplates[0].id
|
|
38
|
-
: await select({
|
|
39
|
-
message: 'Select a template',
|
|
40
|
-
options: availableTemplates.map(t => ({
|
|
41
|
-
label: t.name,
|
|
42
|
-
value: t.id
|
|
43
|
-
})),
|
|
44
|
-
maxItems: 1
|
|
45
|
-
});
|
|
46
|
-
const template = templates.find(t => t.id === templateId);
|
|
47
|
-
if (setup.packageManager && !packageManagers.some(p => p.value === setup.packageManager)) {
|
|
48
|
-
setup.cancelPrompts(`Invalid package manager`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
if (setup.introShown)
|
|
52
|
-
outro(`Setup Done! Creating from ${kleur.cyan().bold(template.name)} template`);
|
|
53
|
-
const templateBuilder = new TemplateBuilder({
|
|
54
|
-
setup: setup.toJSON(),
|
|
55
|
-
template
|
|
56
|
-
});
|
|
57
|
-
await templateBuilder.build();
|
|
58
|
-
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KACxB,IAAI,CAAC,WAAW,CAAC,I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B,CAAC;AAED,IAAI,KAAK,CAAC,UAAU;IAAE,KAAK,CAAC,6BAA6B,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAEtG,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,QAAQ;CACX,CAAC,CAAC;AAEH,MAAM,eAAe,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/classes/Addon.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { type AbbreviatedVersion } from 'package-json';
|
|
2
|
-
import type { PackageJson } from 'fallout-utility';
|
|
3
|
-
export interface AddonOptions {
|
|
4
|
-
module: string;
|
|
5
|
-
version?: string;
|
|
6
|
-
/**
|
|
7
|
-
* @default 'https://registry.npmjs.org'
|
|
8
|
-
*/
|
|
9
|
-
registry?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface AddonReadTarballData {
|
|
12
|
-
packageJson: PackageJson;
|
|
13
|
-
initialModuleContent: {
|
|
14
|
-
js?: string;
|
|
15
|
-
ts?: string;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare class Addon implements AddonOptions {
|
|
19
|
-
static readonly NPM_REGISTRY = "https://registry.npmjs.org";
|
|
20
|
-
static readonly YARN_REGISTRY = "https://registry.yarnpkg.com";
|
|
21
|
-
static readonly PNPM_REGISTRY = "https://registry.npmjs.org";
|
|
22
|
-
static readonly BUN_REGISTRY = "https://registry.npmjs.org";
|
|
23
|
-
static readonly DEFAULT_ADDON_VERSIONS: {
|
|
24
|
-
'reciple-interaction-events': string;
|
|
25
|
-
'reciple-anticrash': string;
|
|
26
|
-
'reciple-dev-commands': string;
|
|
27
|
-
'reciple-registry-cache': string;
|
|
28
|
-
};
|
|
29
|
-
module: string;
|
|
30
|
-
version?: string;
|
|
31
|
-
registry?: string;
|
|
32
|
-
metadata?: AbbreviatedVersion;
|
|
33
|
-
tarball?: Buffer;
|
|
34
|
-
tarballData?: AddonReadTarballData;
|
|
35
|
-
get tarballURL(): string | null;
|
|
36
|
-
get tarballShasum(): string | null;
|
|
37
|
-
get tmpDir(): string | null;
|
|
38
|
-
constructor(options: AddonOptions);
|
|
39
|
-
/**
|
|
40
|
-
* Asynchronously fetches package metadata and downloads the tarball for the specified module.
|
|
41
|
-
* If the metadata is already available, it will be used instead of fetching it again.
|
|
42
|
-
*
|
|
43
|
-
* @return {Promise<AbbreviatedVersion>} The fetched package metadata.
|
|
44
|
-
*/
|
|
45
|
-
fetch(): Promise<AbbreviatedVersion>;
|
|
46
|
-
/**
|
|
47
|
-
* Reads the tarball and extracts the necessary data from it.
|
|
48
|
-
*
|
|
49
|
-
* @return {Promise<AddonReadTarballData>} The data extracted from the tarball.
|
|
50
|
-
* @throws {Error} If the tarball is not downloaded or if the temporary directory does not exist.
|
|
51
|
-
*/
|
|
52
|
-
readTarball(): Promise<AddonReadTarballData>;
|
|
53
|
-
/**
|
|
54
|
-
* Downloads the tarball from the specified tarballURL if it hasn't been downloaded already.
|
|
55
|
-
* Verifies the tarball's shasum against the stored tarballShasum.
|
|
56
|
-
*
|
|
57
|
-
* @return {Promise<Buffer|undefined>} The downloaded tarball as a Buffer, or undefined if the tarballURL is falsy or the tarball already exists.
|
|
58
|
-
* @throws {Error} If the tarball cannot be downloaded or if the shasum does not match.
|
|
59
|
-
*/
|
|
60
|
-
protected downloadTarball(): Promise<Buffer | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Verifies the tarball's shasum against the stored tarballShasum.
|
|
63
|
-
*
|
|
64
|
-
* @param {Buffer} buffer - The tarball buffer to be verified.
|
|
65
|
-
* @return {Promise<boolean>} A promise that resolves to a boolean indicating whether the shasum matches or not.
|
|
66
|
-
*/
|
|
67
|
-
protected verifyTarball(buffer: Buffer): Promise<boolean>;
|
|
68
|
-
}
|
package/dist/classes/Addon.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import fetchPackage, {} from 'package-json';
|
|
2
|
-
import { existsAsync } from '@reciple/utils';
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { createHash } from 'node:crypto';
|
|
6
|
-
import { tgz } from 'compressing';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
export class Addon {
|
|
9
|
-
static NPM_REGISTRY = 'https://registry.npmjs.org';
|
|
10
|
-
static YARN_REGISTRY = 'https://registry.yarnpkg.com';
|
|
11
|
-
static PNPM_REGISTRY = Addon.NPM_REGISTRY;
|
|
12
|
-
static BUN_REGISTRY = Addon.NPM_REGISTRY;
|
|
13
|
-
static DEFAULT_ADDON_VERSIONS = {
|
|
14
|
-
'reciple-interaction-events': '^4',
|
|
15
|
-
'reciple-anticrash': '^4',
|
|
16
|
-
'reciple-dev-commands': '^4',
|
|
17
|
-
'reciple-registry-cache': '^4',
|
|
18
|
-
};
|
|
19
|
-
module;
|
|
20
|
-
version;
|
|
21
|
-
registry;
|
|
22
|
-
metadata;
|
|
23
|
-
tarball;
|
|
24
|
-
tarballData;
|
|
25
|
-
get tarballURL() { return this.metadata?.dist.tarball ?? null; }
|
|
26
|
-
get tarballShasum() { return this.metadata?.dist.shasum ?? null; }
|
|
27
|
-
get tmpDir() { return this.tarballShasum && path.join(path.dirname(fileURLToPath(import.meta.url)), '../../tmp', this.tarballShasum); }
|
|
28
|
-
constructor(options) {
|
|
29
|
-
this.module = options?.module;
|
|
30
|
-
this.registry = options?.registry ?? Addon.NPM_REGISTRY;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Asynchronously fetches package metadata and downloads the tarball for the specified module.
|
|
34
|
-
* If the metadata is already available, it will be used instead of fetching it again.
|
|
35
|
-
*
|
|
36
|
-
* @return {Promise<AbbreviatedVersion>} The fetched package metadata.
|
|
37
|
-
*/
|
|
38
|
-
async fetch() {
|
|
39
|
-
this.metadata ??= await fetchPackage(this.module, { version: this.version, registry: this.registry });
|
|
40
|
-
await this.downloadTarball();
|
|
41
|
-
this.version = this.metadata.version;
|
|
42
|
-
return this.metadata;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Reads the tarball and extracts the necessary data from it.
|
|
46
|
-
*
|
|
47
|
-
* @return {Promise<AddonReadTarballData>} The data extracted from the tarball.
|
|
48
|
-
* @throws {Error} If the tarball is not downloaded or if the temporary directory does not exist.
|
|
49
|
-
*/
|
|
50
|
-
async readTarball() {
|
|
51
|
-
if (!this.tarball || !this.tmpDir)
|
|
52
|
-
throw new Error('Tarball not downloaded');
|
|
53
|
-
if (this.tarballData)
|
|
54
|
-
return this.tarballData;
|
|
55
|
-
if (!(await existsAsync(this.tmpDir)))
|
|
56
|
-
await tgz.uncompress(this.tarball, this.tmpDir);
|
|
57
|
-
const packageJson = JSON.parse(await readFile(path.join(this.tmpDir, 'package/package.json'), 'utf-8'));
|
|
58
|
-
let initialModuleContent = {};
|
|
59
|
-
if (('initialModuleContent' in packageJson)) {
|
|
60
|
-
if (typeof packageJson.initialModuleContent === 'string') {
|
|
61
|
-
const content = await readFile(path.join(this.tmpDir, 'package/', packageJson.initialModuleContent), 'utf-8');
|
|
62
|
-
initialModuleContent.js = content;
|
|
63
|
-
initialModuleContent.ts = content;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
if ('js' in packageJson.initialModuleContent)
|
|
67
|
-
initialModuleContent.js = await readFile(path.join(this.tmpDir, 'package/', packageJson.initialModuleContent.js), 'utf-8');
|
|
68
|
-
if ('ts' in packageJson.initialModuleContent)
|
|
69
|
-
initialModuleContent.ts = await readFile(path.join(this.tmpDir, 'package/', packageJson.initialModuleContent.ts), 'utf-8');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return this.tarballData = {
|
|
73
|
-
packageJson,
|
|
74
|
-
initialModuleContent
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Downloads the tarball from the specified tarballURL if it hasn't been downloaded already.
|
|
79
|
-
* Verifies the tarball's shasum against the stored tarballShasum.
|
|
80
|
-
*
|
|
81
|
-
* @return {Promise<Buffer|undefined>} The downloaded tarball as a Buffer, or undefined if the tarballURL is falsy or the tarball already exists.
|
|
82
|
-
* @throws {Error} If the tarball cannot be downloaded or if the shasum does not match.
|
|
83
|
-
*/
|
|
84
|
-
async downloadTarball() {
|
|
85
|
-
if (!this.tarballURL)
|
|
86
|
-
return;
|
|
87
|
-
if (this.tarball)
|
|
88
|
-
return this.tarball;
|
|
89
|
-
const response = await fetch(this.tarballURL);
|
|
90
|
-
if (!response.ok)
|
|
91
|
-
return;
|
|
92
|
-
const data = await response.arrayBuffer();
|
|
93
|
-
const buffer = Buffer.from(data);
|
|
94
|
-
if (!await this.verifyTarball(buffer))
|
|
95
|
-
throw new Error('Tarball shasum does not match');
|
|
96
|
-
return this.tarball = buffer;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Verifies the tarball's shasum against the stored tarballShasum.
|
|
100
|
-
*
|
|
101
|
-
* @param {Buffer} buffer - The tarball buffer to be verified.
|
|
102
|
-
* @return {Promise<boolean>} A promise that resolves to a boolean indicating whether the shasum matches or not.
|
|
103
|
-
*/
|
|
104
|
-
async verifyTarball(buffer) {
|
|
105
|
-
const i = createHash('sha1');
|
|
106
|
-
i.update(buffer);
|
|
107
|
-
const shasum = i.digest('hex');
|
|
108
|
-
return shasum === this.tarballShasum;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=Addon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Addon.js","sourceRoot":"","sources":["../../src/classes/Addon.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAA2B,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAA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AC,OAAO,GAAG,MAAM,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,aAAa,CAAC,MAAc;QACxC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEjB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE/B,OAAO,MAAM,KAAK,IAAI,CAAC,aAAa,CAAC;IACzC,CAAC"}
|
package/dist/classes/Config.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface ConfigOptions {
|
|
2
|
-
dir?: string;
|
|
3
|
-
isTypeScript?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare class Config {
|
|
6
|
-
dir: string;
|
|
7
|
-
isTypeScript: boolean;
|
|
8
|
-
content: string;
|
|
9
|
-
get filePath(): string;
|
|
10
|
-
get indent(): string;
|
|
11
|
-
constructor(options?: ConfigOptions);
|
|
12
|
-
setup(options?: Partial<Record<'halts' | 'preconditions', {
|
|
13
|
-
class: string;
|
|
14
|
-
notDefault?: boolean;
|
|
15
|
-
from: string;
|
|
16
|
-
}[]>>): Promise<this>;
|
|
17
|
-
addPreconditions(preconditions: {
|
|
18
|
-
class: string;
|
|
19
|
-
notDefault?: boolean;
|
|
20
|
-
from: string;
|
|
21
|
-
}[]): void;
|
|
22
|
-
addHalts(halts: {
|
|
23
|
-
class: string;
|
|
24
|
-
notDefault?: boolean;
|
|
25
|
-
from: string;
|
|
26
|
-
}[]): void;
|
|
27
|
-
addImport(imports: string | string[], from: string): void;
|
|
28
|
-
readContent(): Promise<string>;
|
|
29
|
-
writeContent(): Promise<string>;
|
|
30
|
-
saveContent(): Promise<string>;
|
|
31
|
-
}
|
package/dist/classes/Config.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import detectIndentSize from 'detect-indent';
|
|
3
|
-
import { existsAsync } from '@reciple/utils';
|
|
4
|
-
import { Config as ConfigReader } from 'reciple';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
export class Config {
|
|
7
|
-
dir;
|
|
8
|
-
isTypeScript = false;
|
|
9
|
-
content = '';
|
|
10
|
-
get filePath() {
|
|
11
|
-
return path.join(this.dir, 'reciple.mjs');
|
|
12
|
-
}
|
|
13
|
-
get indent() {
|
|
14
|
-
return detectIndentSize(this.content).indent ?? ' ';
|
|
15
|
-
}
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.dir = options?.dir ?? process.cwd();
|
|
18
|
-
this.isTypeScript = options?.isTypeScript ?? false;
|
|
19
|
-
}
|
|
20
|
-
async setup(options) {
|
|
21
|
-
await this.readContent();
|
|
22
|
-
if (options?.preconditions?.length)
|
|
23
|
-
this.addPreconditions(options.preconditions);
|
|
24
|
-
if (options?.halts?.length)
|
|
25
|
-
this.addHalts(options.halts);
|
|
26
|
-
await this.saveContent();
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
addPreconditions(preconditions) {
|
|
30
|
-
preconditions = preconditions.filter(precondition => !this.content.includes(`new ${precondition.class}()`));
|
|
31
|
-
this.content = this.content.replaceAll(`new CommandPermissionsPrecondition()`, `new CommandPermissionsPrecondition(),\n${this.indent.repeat(2)}${preconditions.map(precondition => `new ${precondition.class}(),`).join('\n' + this.indent.repeat(2))}`);
|
|
32
|
-
for (const precondition of preconditions) {
|
|
33
|
-
this.addImport(precondition.notDefault !== true ? [precondition.class] : precondition.class, precondition.from);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
addHalts(halts) {
|
|
37
|
-
halts = halts.filter(halt => !this.content.includes(`new ${halt.class}()`));
|
|
38
|
-
this.content = this.content.replaceAll(`commandHalts: []`, `commandHalts: [\n${this.indent.repeat(2)}${halts.map(halt => `new ${halt.class}(),`).join('\n' + this.indent.repeat(2))}\n${this.indent}]`);
|
|
39
|
-
for (const halt of halts) {
|
|
40
|
-
this.addImport(halt.notDefault !== true ? [halt.class] : halt.class, halt.from);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
addImport(imports, from) {
|
|
44
|
-
const importString = `import ${typeof imports === 'string' ? imports : ('{ ' + imports.join(', ') + ' }')} from '${from}';`;
|
|
45
|
-
if (this.content.includes(importString))
|
|
46
|
-
return;
|
|
47
|
-
this.content = this.content.replace(`import { IntentsBitField } from 'discord.js';`, `import { IntentsBitField } from 'discord.js';\n${importString}`);
|
|
48
|
-
}
|
|
49
|
-
async readContent() {
|
|
50
|
-
return this.content = await existsAsync(this.filePath) ? await readFile(this.filePath, 'utf-8') : await this.writeContent();
|
|
51
|
-
}
|
|
52
|
-
async writeContent() {
|
|
53
|
-
await ConfigReader.createConfigFile(this.filePath);
|
|
54
|
-
return this.readContent();
|
|
55
|
-
}
|
|
56
|
-
async saveContent() {
|
|
57
|
-
await writeFile(this.filePath, this.content, 'utf-8');
|
|
58
|
-
return this.content;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=Config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/classes/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,gBAAgB,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,MAAM,OAAO,MAAM;IACR,GAAG,CAAS;IACZ,YAAY,GAAY,KAAK,CAAC;IAC9B,OAAO,GAAW,EAAE,CAAC;IAE5B,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAC9C,C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,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;YAAE,OAAO;QAEhD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,+CAA+C,EAAE,kDAAkD,YAAY,EAAE,CAAC,CAAC;IAC3J,CAAC;IAEM,KAAK,CAAC,WAAW;QACpB,OAAO,IAAI,CAAC,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IAChI,CAAC;IAEM,KAAK,CAAC,YAAY;QACrB,MAAM,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,WAAW;QACpB,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ"}
|
package/dist/classes/Setup.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type PackageManager } from '@reciple/utils';
|
|
2
|
-
export interface SetupOptions {
|
|
3
|
-
dir?: string;
|
|
4
|
-
isTypescript?: boolean;
|
|
5
|
-
packageManager?: PackageManager | null;
|
|
6
|
-
addons?: string[];
|
|
7
|
-
token?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class Setup implements SetupOptions {
|
|
10
|
-
dir?: string;
|
|
11
|
-
isTypescript?: boolean;
|
|
12
|
-
packageManager?: PackageManager | null;
|
|
13
|
-
addons?: string[];
|
|
14
|
-
token?: string;
|
|
15
|
-
get isDone(): boolean;
|
|
16
|
-
introShown: boolean;
|
|
17
|
-
constructor(options?: SetupOptions);
|
|
18
|
-
/**
|
|
19
|
-
* Prompts the user for input to set up the necessary parameters for creating a reciple.
|
|
20
|
-
*
|
|
21
|
-
* @param {boolean} force - Whether to force override existing files in the directory.
|
|
22
|
-
* @return {Promise<this>} A promise that resolves to the current instance of the Setup class.
|
|
23
|
-
*/
|
|
24
|
-
prompt(force?: boolean): Promise<this>;
|
|
25
|
-
promptDir(dir?: string): Promise<string>;
|
|
26
|
-
promptIsTypescript(isTypescript?: boolean): Promise<boolean>;
|
|
27
|
-
promptAddons(addons?: string[]): Promise<string[]>;
|
|
28
|
-
promptPackageManager(packageManager?: PackageManager | null): Promise<PackageManager | null>;
|
|
29
|
-
promptToken(token?: string): Promise<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Cancels the prompts and exits the process with the given reason.
|
|
32
|
-
*
|
|
33
|
-
* @param {string} [reason] - The reason for cancelling the prompts.
|
|
34
|
-
* @return {Promise<never>} - A promise that never resolves.
|
|
35
|
-
*/
|
|
36
|
-
cancelPrompts(reason?: string): Promise<never>;
|
|
37
|
-
/**
|
|
38
|
-
* Returns a SetupOptions object with the current setup details.
|
|
39
|
-
*
|
|
40
|
-
* @return {SetupOptions} The setup options object.
|
|
41
|
-
*/
|
|
42
|
-
toJSON(): SetupOptions;
|
|
43
|
-
}
|