@sapphire/cli 1.8.0 → 1.8.1-next.30a80bb.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
@@ -17,6 +17,7 @@
17
17
  - Generate Sapphire projects easily
18
18
  - Generate components (commands, listeners, etc.)
19
19
  - Create your own templates for components
20
+ - Generate loaders for [virtual components](https://www.sapphirejs.dev/docs/Guide/additional-information/registering-virtual-pieces)
20
21
 
21
22
  ## [Get Started with the CLI](https://www.sapphirejs.dev/docs/Guide/CLI/introduction)
22
23
 
@@ -44,24 +44,16 @@ async function configureYarnRc(location, name, value) {
44
44
  await execa('yarn', ['config', 'set', name, value], { cwd: `./${location}/` });
45
45
  return true;
46
46
  }
47
- async function installYarnV3(location, verbose) {
47
+ async function installYarnV4(location, verbose) {
48
48
  const valueSetVersion = await execa('yarn', ['set', 'version', 'berry'], {
49
49
  stdio: verbose ? 'inherit' : undefined,
50
50
  cwd: `./${location}/`
51
51
  });
52
- const valueInstallPlugins = await execa('yarn', ['plugin', 'import', 'interactive-tools'], {
53
- stdio: verbose ? 'inherit' : undefined,
54
- cwd: `./${location}/`
55
- });
56
- if (valueSetVersion.exitCode !== 0 || valueInstallPlugins.exitCode !== 0) {
57
- throw new Error('An unknown error occurred while installing Yarn v3. Try running Sapphire CLI with "--verbose" flag.');
52
+ if (valueSetVersion.exitCode !== 0) {
53
+ throw new Error('An unknown error occurred while installing Yarn v4. Try running Sapphire CLI with "--verbose" flag.');
58
54
  }
59
55
  return true;
60
56
  }
61
- async function installYarnTypescriptPlugin(location) {
62
- await execa('yarn', ['plugin', 'import', 'typescript'], { cwd: `./${location}/` });
63
- return true;
64
- }
65
57
  async function initializeGitRepo(location) {
66
58
  await execa('git', ['init'], { cwd: `./${location}/` });
67
59
  return true;
@@ -115,12 +107,10 @@ export default async (name, flags) => {
115
107
  if (response.git) {
116
108
  jobs.push([() => initializeGitRepo(response.projectName), 'Initializing git repo']);
117
109
  }
118
- if (response.yarnV3) {
119
- jobs.push([() => installYarnV3(response.projectName, flags.verbose), 'Installing Yarn v3']);
120
- if (response.projectLang === 'ts')
121
- jobs.push([() => installYarnTypescriptPlugin(response.projectName), 'Installing Yarn Typescript Plugin']);
122
- jobs.push([() => configureYarnRc(response.projectName, 'enableGlobalCache', 'true'), 'Enabling Yarn v3 global cache']);
123
- jobs.push([() => configureYarnRc(response.projectName, 'nodeLinker', 'node-modules'), 'Configuring Yarn v3 to use node-modules']);
110
+ if (response.yarnV4) {
111
+ jobs.push([() => installYarnV4(response.projectName, flags.verbose), 'Installing Yarn v4']);
112
+ jobs.push([() => configureYarnRc(response.projectName, 'enableGlobalCache', 'true'), 'Enabling Yarn v4 global cache']);
113
+ jobs.push([() => configureYarnRc(response.projectName, 'nodeLinker', 'node-modules'), 'Configuring Yarn v4 to use node-modules']);
124
114
  }
125
115
  jobs.push([
126
116
  () => installDeps(response.projectName, response.packageManager, flags.verbose),
@@ -61,8 +61,8 @@ export const PromptNew = (projectName, yarn, pnpm) => {
61
61
  },
62
62
  {
63
63
  type: (prev) => (prev === 'Yarn' ? 'confirm' : false),
64
- name: 'yarnV3',
65
- message: 'Do you want to use Yarn v3?',
64
+ name: 'yarnV4',
65
+ message: 'Do you want to use Yarn v4?',
66
66
  initial: true
67
67
  },
68
68
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/cli",
3
- "version": "1.8.0",
3
+ "version": "1.8.1-next.30a80bb.0",
4
4
  "description": "CLI for Sapphire Framework",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",
@@ -55,13 +55,13 @@
55
55
  "@sapphire/prettier-config": "^2.0.0",
56
56
  "@sapphire/ts-config": "^5.0.0",
57
57
  "@types/js-yaml": "^4.0.9",
58
- "@types/node": "^20.9.1",
58
+ "@types/node": "^20.9.2",
59
59
  "@types/prompts": "^2.4.8",
60
60
  "@typescript-eslint/eslint-plugin": "^6.11.0",
61
61
  "@typescript-eslint/parser": "^6.11.0",
62
62
  "cz-conventional-changelog": "^3.3.0",
63
63
  "discord.js": "*",
64
- "eslint": "^8.53.0",
64
+ "eslint": "^8.54.0",
65
65
  "eslint-config-prettier": "^9.0.0",
66
66
  "eslint-plugin-prettier": "^5.0.1",
67
67
  "globby": "^14.0.0",
@@ -113,5 +113,5 @@
113
113
  "access": "public"
114
114
  },
115
115
  "prettier": "@sapphire/prettier-config",
116
- "packageManager": "yarn@4.0.1"
116
+ "packageManager": "yarn@4.0.2"
117
117
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://raw.githubusercontent.com/sapphiredev/cli/main/templates/schemas/.sapphirerc.scheme.json",
2
3
  "projectLanguage": "{{language}}",
3
4
  "locations": {
4
5
  "base": "src",
@@ -1,3 +1,4 @@
1
+ $schema: "./node_modules/@sapphire/cli/templates/schemas/.sapphirerc.scheme.json"
1
2
  projectLanguage: "{{language}}"
2
3
  locations:
3
4
  base: src
@@ -1,12 +1,13 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "https://json-schema.org/draft-04/schema#",
3
3
  "title": "Sapphire CLI Config",
4
4
  "description": "Scheme for Sapphire CLI Config (@sapphire/cli)",
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "projectLanguage": {
8
8
  "description": "Project language (ts | js)",
9
- "type": "string"
9
+ "type": "string",
10
+ "enum": ["ts", "js"]
10
11
  },
11
12
  "locations": {
12
13
  "description": "Categories and their locations",