@sapphire/cli 1.3.2-next.f854841.0 β†’ 1.4.0-next.323b2e0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,40 +33,14 @@ We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub S
33
33
  | Patreon | [Click Here](https://sapphirejs.dev/patreon) |
34
34
  | PayPal | [Click Here](https://sapphirejs.dev/paypal) |
35
35
 
36
- ## Contributors ✨
37
-
38
- Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
39
-
40
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
41
- <!-- prettier-ignore-start -->
42
- <!-- markdownlint-disable -->
43
- <table>
44
- <tr>
45
- <td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=favna" title="Code">πŸ’»</a> <a href="https://github.com/sapphiredev/cli/commits?author=favna" title="Documentation">πŸ“–</a> <a href="#infra-favna" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#projectManagement-favna" title="Project Management">πŸ“†</a> <a href="#plugin-favna" title="Plugin/utility libraries">πŸ”Œ</a></td>
46
- <td align="center"><a href="https://github.com/enxg"><img src="https://avatars.githubusercontent.com/u/61084101?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Enes GenΓ§</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=enxg" title="Code">πŸ’»</a> <a href="https://github.com/sapphiredev/cli/commits?author=enxg" title="Documentation">πŸ“–</a> <a href="#infra-enxg" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#ideas-enxg" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#example-enxg" title="Examples">πŸ’‘</a> <a href="#tutorial-enxg" title="Tutorials">βœ…</a></td>
47
- <td align="center"><a href="https://kaname.netlify.app"><img src="https://avatars.githubusercontent.com/u/56084970?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kaname</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=kaname-png" title="Code">πŸ’»</a></td>
48
- <td align="center"><a href="https://github.com/UndiedGamer"><img src="https://avatars.githubusercontent.com/u/84702365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>UndiedGamer</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=UndiedGamer" title="Documentation">πŸ“–</a></td>
49
- <td align="center"><a href="https://github.com/Lioness100"><img src="https://avatars.githubusercontent.com/u/65814829?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lioness100</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=Lioness100" title="Documentation">πŸ“–</a></td>
50
- <td align="center"><a href="https://megatank58.me/"><img src="https://avatars.githubusercontent.com/u/51410502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>megatank58</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=megatank58" title="Code">πŸ’»</a></td>
51
- <td align="center"><a href="https://renovate.whitesourcesoftware.com/"><img src="https://avatars.githubusercontent.com/u/25180681?v=4?s=100" width="100px;" alt=""/><br /><sub><b>WhiteSource Renovate</b></sub></a><br /><a href="#maintenance-renovate-bot" title="Maintenance">🚧</a></td>
52
- </tr>
53
- <tr>
54
- <td align="center"><a href="https://github.com/apps/renovate"><img src="https://avatars.githubusercontent.com/in/2740?v=4?s=100" width="100px;" alt=""/><br /><sub><b>renovate[bot]</b></sub></a><br /><a href="#maintenance-renovate[bot]" title="Maintenance">🚧</a></td>
55
- <td align="center"><a href="https://github.com/apps/allcontributors"><img src="https://avatars.githubusercontent.com/in/23186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>allcontributors[bot]</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=allcontributors[bot]" title="Documentation">πŸ“–</a></td>
56
- <td align="center"><a href="https://github.com/apps/depfu"><img src="https://avatars.githubusercontent.com/in/715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>depfu[bot]</b></sub></a><br /><a href="#maintenance-depfu[bot]" title="Maintenance">🚧</a></td>
57
- <td align="center"><a href="https://allianaab2m.github.io/"><img src="https://avatars.githubusercontent.com/u/56180684?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alliana</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=Allianaab2m" title="Code">πŸ’»</a></td>
58
- <td align="center"><a href="https://github.com/MajesticString"><img src="https://avatars.githubusercontent.com/u/66224939?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harry Allen</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=MajesticString" title="Code">πŸ’»</a></td>
59
- <td align="center"><a href="https://github.com/pinkcig"><img src="https://avatars.githubusercontent.com/u/62260409?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Faye Keller</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=pinkcig" title="Code">πŸ’»</a></td>
60
- <td align="center"><a href="https://github.com/boingtheboeing"><img src="https://avatars.githubusercontent.com/u/76058130?v=4?s=100" width="100px;" alt=""/><br /><sub><b>boingtheboeing</b></sub></a><br /><a href="#content-boingtheboeing" title="Content">πŸ–‹</a></td>
61
- </tr>
62
- <tr>
63
- <td align="center"><a href="https://github.com/BashGuy10"><img src="https://avatars.githubusercontent.com/u/63826227?v=4?s=100" width="100px;" alt=""/><br /><sub><b>bash</b></sub></a><br /><a href="https://github.com/sapphiredev/cli/commits?author=BashGuy10" title="Code">πŸ’»</a></td>
64
- </tr>
65
- </table>
66
-
67
- <!-- markdownlint-restore -->
68
- <!-- prettier-ignore-end -->
69
-
70
- <!-- ALL-CONTRIBUTORS-LIST:END -->
71
-
72
- This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
36
+ ## Contributors
37
+
38
+ Please make sure to read the [Contributing Guide][contributing] before making a pull request.
39
+
40
+ Thank you to all the people who already contributed to Sapphire!
41
+
42
+ <a href="https://github.com/sapphiredev/cli/graphs/contributors">
43
+ <img src="https://contrib.rocks/image?repo=sapphiredev/cli" />
44
+ </a>
45
+
46
+ [contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
@@ -27,9 +27,16 @@ async function installDeps(location, pm, verbose) {
27
27
  if (value.exitCode !== 0) {
28
28
  throw new Error('An unknown error occurred while installing the dependencies. Try running Sapphire CLI with "--verbose" flag.');
29
29
  }
30
- const oppositeLockfile = `./${location}/${pm === 'npm' ? 'yarn.lock' : 'package-lock.json'}`;
31
- if (await fileExists(oppositeLockfile)) {
32
- await rm(oppositeLockfile);
30
+ const oppositeLockfiles = {
31
+ npm: ['yarn.lock', 'pnpm-lock.yaml'],
32
+ yarn: ['package-lock.json', 'pnpm-lock.yaml'],
33
+ pnpm: ['package-lock.json', 'yarn.lock']
34
+ };
35
+ const lockfiles = pm === 'npm' ? oppositeLockfiles.npm : pm === 'Yarn' ? oppositeLockfiles.yarn : oppositeLockfiles.pnpm;
36
+ for (const lockfile of lockfiles) {
37
+ if (await fileExists(lockfile)) {
38
+ await rm(lockfile);
39
+ }
33
40
  }
34
41
  return true;
35
42
  }
@@ -83,7 +90,7 @@ async function cloneRepo(location, verbose) {
83
90
  return true;
84
91
  }
85
92
  export default async (name, flags) => {
86
- const response = await prompts(PromptNew(name, await CommandExists('yarn')));
93
+ const response = await prompts(PromptNew(name, await CommandExists('yarn'), await CommandExists('pnpm')));
87
94
  if (!response.projectName || !response.projectLang || !response.projectTemplate || !response.packageManager) {
88
95
  process.exit(1);
89
96
  }
@@ -98,6 +105,9 @@ export default async (name, flags) => {
98
105
  language: response.projectLang
99
106
  });
100
107
  await editPackageJson(response.projectName, projectName);
108
+ if (response.packageManager === 'pnpm') {
109
+ await writeFile(`./${response.projectName}/.npmrc`, '# pnpm only\nshamefully-hoist=true\npublic-hoist-pattern[]=@sapphire/*');
110
+ }
101
111
  };
102
112
  const jobs = [
103
113
  [() => cloneRepo(response.projectName, flags.verbose), 'Cloning the repository'],
@@ -8,13 +8,18 @@ const jsTemplates = [
8
8
  { title: 'with ESM (Recommended)', value: 'with-esm' },
9
9
  { title: 'with CommonJS', value: 'with-javascript' }
10
10
  ];
11
- export const PromptNew = (projectName, yarn) => {
11
+ export const PromptNew = (projectName, yarn, pnpm) => {
12
12
  const pmChoices = [
13
13
  {
14
14
  title: `Yarn (Recommended) ${yarn ? '' : '(Not installed)'}`,
15
15
  value: 'Yarn',
16
16
  disabled: !yarn
17
17
  },
18
+ {
19
+ title: `pnpm ${pnpm ? '' : '(Not Installed)'}`,
20
+ value: 'pnpm',
21
+ disabled: !pnpm
22
+ },
18
23
  { title: 'npm', value: 'npm' }
19
24
  ];
20
25
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/cli",
3
- "version": "1.3.2-next.f854841.0",
3
+ "version": "1.4.0-next.323b2e0.0",
4
4
  "description": "CLI for Sapphire Framework",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",
@@ -41,38 +41,38 @@
41
41
  "@favware/colorette-spinner": "^1.0.1",
42
42
  "@sapphire/result": "^2.6.0",
43
43
  "colorette": "^2.0.19",
44
- "commander": "^9.4.1",
44
+ "commander": "^10.0.0",
45
45
  "execa": "^6.1.0",
46
46
  "find-up": "^5.0.0",
47
47
  "js-yaml": "^4.1.0",
48
48
  "prompts": "^2.4.2",
49
- "tslib": "^2.4.0"
49
+ "tslib": "^2.4.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@commitlint/cli": "^17.1.2",
53
- "@commitlint/config-conventional": "^17.1.0",
54
- "@favware/cliff-jumper": "^1.8.8",
55
- "@favware/npm-deprecate": "^1.0.5",
52
+ "@commitlint/cli": "^17.4.2",
53
+ "@commitlint/config-conventional": "^17.4.2",
54
+ "@favware/cliff-jumper": "^1.10.0",
55
+ "@favware/npm-deprecate": "^1.0.7",
56
56
  "@sapphire/eslint-config": "^4.3.8",
57
- "@sapphire/prettier-config": "^1.4.4",
57
+ "@sapphire/prettier-config": "^1.4.5",
58
58
  "@sapphire/ts-config": "^3.3.4",
59
59
  "@types/js-yaml": "^4.0.5",
60
- "@types/node": "^18.7.15",
61
- "@types/prompts": "^2.4.1",
62
- "@typescript-eslint/eslint-plugin": "^5.40.1",
63
- "@typescript-eslint/parser": "^5.40.1",
60
+ "@types/node": "^18.11.18",
61
+ "@types/prompts": "^2.4.2",
62
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
63
+ "@typescript-eslint/parser": "^5.48.2",
64
64
  "cz-conventional-changelog": "^3.3.0",
65
- "eslint": "^8.26.0",
66
- "eslint-config-prettier": "^8.5.0",
65
+ "eslint": "^8.32.0",
66
+ "eslint-config-prettier": "^8.6.0",
67
67
  "eslint-plugin-prettier": "^4.2.1",
68
- "globby": "^13.1.2",
69
- "husky": "^8.0.1",
70
- "lint-staged": "^13.0.3",
68
+ "globby": "^13.1.3",
69
+ "husky": "^8.0.3",
70
+ "lint-staged": "^13.1.0",
71
71
  "pinst": "^3.0.0",
72
- "prettier": "^2.7.1",
72
+ "prettier": "^2.8.3",
73
73
  "pretty-quick": "^3.1.3",
74
74
  "ts-node": "^10.9.1",
75
- "typescript": "^4.8.4"
75
+ "typescript": "^4.9.4"
76
76
  },
77
77
  "resolutions": {
78
78
  "ansi-regex": "^5.0.1",
@@ -117,5 +117,5 @@
117
117
  "access": "public"
118
118
  },
119
119
  "prettier": "@sapphire/prettier-config",
120
- "packageManager": "yarn@3.2.4"
120
+ "packageManager": "yarn@3.3.1"
121
121
  }
@@ -26,10 +26,10 @@ class UserCommand extends Command {
26
26
  }
27
27
 
28
28
  /**
29
- * @param {Command.ContextMenuInteraction} interaction
29
+ * @param {Command.ContextMenuCommandInteraction} interaction
30
30
  */
31
31
  async contextMenuRun(interaction) {
32
- return await interaction.reply({ content: 'Hello world!' });
32
+ return interaction.reply({ content: 'Hello world!' });
33
33
  }
34
34
  }
35
35
 
@@ -16,7 +16,7 @@ export class UserCommand extends Command {
16
16
  );
17
17
  }
18
18
 
19
- public async contextMenuRun(interaction: Command.ContextMenuInteraction) {
20
- return await interaction.reply({ content: 'Hello world!' });
19
+ public async contextMenuRun(interaction: Command.ContextMenuCommandInteraction) {
20
+ return interaction.reply({ content: 'Hello world!' });
21
21
  }
22
22
  }
@@ -11,14 +11,14 @@ class UserPrecondition extends Precondition {
11
11
  }
12
12
 
13
13
  /**
14
- * @param {import('discord.js').CommandInteraction} interaction
14
+ * @param {import('discord.js').ChatInputCommandInteraction} interaction
15
15
  */
16
16
  chatInputRun(interaction) {
17
17
  return this.ok();
18
18
  }
19
19
 
20
20
  /**
21
- * @param {import('discord.js').ContextMenuInteraction} interaction
21
+ * @param {import('discord.js').ContextMenuCommandInteraction} interaction
22
22
  */
23
23
  contextMenuRun(interaction) {
24
24
  return this.ok();
@@ -1,18 +1,18 @@
1
1
  { "category": "preconditions" }
2
2
  ---
3
3
  import { Precondition } from '@sapphire/framework';
4
- import type { CommandInteraction, ContextMenuInteraction, Message } from 'discord.js';
4
+ import type { ChatInputCommandInteraction, ContextMenuCommandInteraction, Message } from 'discord.js';
5
5
 
6
6
  export class UserPrecondition extends Precondition {
7
7
  public override messageRun(message: Message) {
8
8
  return this.ok();
9
9
  }
10
10
 
11
- public override chatInputRun(interaction: CommandInteraction) {
11
+ public override chatInputRun(interaction: ChatInputCommandInteraction) {
12
12
  return this.ok();
13
13
  }
14
14
 
15
- public override contextMenuRun(interaction: ContextMenuInteraction) {
15
+ public override contextMenuRun(interaction: ContextMenuCommandInteraction) {
16
16
  return this.ok();
17
17
  }
18
18
  }
@@ -27,10 +27,10 @@ class UserCommand extends Command {
27
27
  }
28
28
 
29
29
  /**
30
- * @param {Command.ChatInputInteraction} interaction
30
+ * @param {Command.ChatInputCommandInteraction} interaction
31
31
  */
32
32
  async chatInputRun(interaction) {
33
- return await interaction.reply({ content: 'Hello world!' });
33
+ return interaction.reply({ content: 'Hello world!' });
34
34
  }
35
35
  }
36
36
 
@@ -15,7 +15,7 @@ export class UserCommand extends Command {
15
15
  );
16
16
  }
17
17
 
18
- public override async chatInputRun(interaction: Command.ChatInputInteraction) {
19
- return await interaction.reply({ content: 'Hello world!' });
18
+ public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
19
+ return interaction.reply({ content: 'Hello world!' });
20
20
  }
21
21
  }