diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index d452983..bbd8213 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -15,8 +15,6 @@ body: ### **Check if the issue is reproducible with the latest stable version.** You can use the command `pnpm view gacm versions` to view it placeholder: latest - validations: - required: true - type: textarea id: reproduce attributes: @@ -24,7 +22,6 @@ body: description: | **After the replay is turned on, what actions do we need to perform to make the bug appear? Simple and clear steps can help us locate the problem more quickly. Please clearly describe the steps of reproducing the issue. Issues without clear reproducing steps will not be repaired. If the issue marked with 'need reproduction' does not provide relevant steps within 7 days, it will be closed directly.** placeholder: Please Input - validations: - type: textarea id: expected attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index a2fab4d..ed9d196 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -10,8 +10,6 @@ body: description: | Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature? placeholder: Please Input - validations: - required: true - type: textarea id: feature-api attributes: @@ -19,5 +17,3 @@ body: description: | Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use Markdown to format your code blocks. placeholder: Please Input - validations: - required: true diff --git a/dist/gacm.js b/dist/gacm.js index b83dda9..674ef95 100755 --- a/dist/gacm.js +++ b/dist/gacm.js @@ -16,7 +16,7 @@ var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa); var prompts__default = /*#__PURE__*/_interopDefaultLegacy(prompts); var name$1 = "gacm"; -var version$1 = "1.2.1"; +var version$1 = "1.2.2"; var description$1 = "git account manage"; var keywords = [ "git", @@ -82,7 +82,7 @@ const log = { }; var name = "gacm"; -var version = "1.2.1"; +var version = "1.2.2"; var description = "gacm"; var scripts = { build: "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts", diff --git a/dist/gnrm.js b/dist/gnrm.js index b27a352..3b6259f 100755 --- a/dist/gnrm.js +++ b/dist/gnrm.js @@ -16,7 +16,7 @@ var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa); var prompts__default = /*#__PURE__*/_interopDefaultLegacy(prompts); var name$1 = "gacm"; -var version$1 = "1.2.1"; +var version$1 = "1.2.2"; var description$1 = "git account manage"; var keywords = [ "git", @@ -82,7 +82,7 @@ const log = { }; var name = "gacm"; -var version = "1.2.1"; +var version = "1.2.2"; var description = "gacm"; var scripts = { build: "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts", @@ -317,26 +317,42 @@ const useLs = async (cmd) => { printMessages(messages); }; +const defaultPackageManager = ["npm", "yarn", "npm", "pnpm"]; const useUse = async ([name], cmd) => { const userConfig = await getFileUser(registriesPath); let registrylist = defaultNpmMirror; + let packageManager = "npm"; if (userConfig && userConfig.registry) registrylist = userConfig.registry; let useRegistry = void 0; if (name) { useRegistry = registrylist.find((x) => x.alias === name); } else { - const { registry } = await prompts__default["default"]({ - type: "select", - name: "registry", - message: "Pick a registry", - choices: registrylist.map((x) => { - return { - title: `${x.alias}${x.alias === x.name ? "" : `(${x.name})`} ${x.registry}`, + const { registry, pkg } = await prompts__default["default"]([ + { + type: "select", + name: "registry", + message: "Pick a registry", + choices: registrylist.map((x) => { + return { + title: `${x.alias}${x.alias === x.name ? "" : `(${x.name})`} ${x.registry}`, + value: x + }; + }) + }, + { + type: "select", + name: "pkg", + message: "Pick a packageManager,and you will set registry for it", + initial: 0, + choices: defaultPackageManager.map((x) => ({ + title: x, value: x - }; - }) - }); + })) + } + ]); + if (pkg) + packageManager = pkg; if (!registry) { log.error(`user cancel operation`); return; @@ -345,7 +361,6 @@ const useUse = async ([name], cmd) => { } if (!useRegistry) return log.error(`${name} not found`); - let packageManager = "npm"; if (cmd.packageManager) packageManager = cmd.packageManager; await execCommand(packageManager, [ diff --git a/dist/package.json b/dist/package.json index a7b8e69..e70a1b1 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,6 +1,6 @@ { "name": "gacm", - "version": "1.2.1", + "version": "1.2.2", "private": false, "description": "git account manage", "keywords": [ diff --git a/package.json b/package.json index 006c5c9..9d7624d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gacm", - "version": "1.2.1", + "version": "1.2.2", "description": "gacm", "scripts": { "build": "gulp --require sucrase/register/ts --gulpfile build/gulpfile.ts", diff --git a/package/commands/gnrm/useUse.ts b/package/commands/gnrm/useUse.ts index ce16a2a..5ffe495 100644 --- a/package/commands/gnrm/useUse.ts +++ b/package/commands/gnrm/useUse.ts @@ -6,28 +6,46 @@ import { log } from '../../utils/log'; import { execCommand } from '../../utils/shell'; import type { NrmCmd, RegistryInfo } from '../../type/shell.type'; +const defaultPackageManager = ['npm', 'yarn', 'npm', 'pnpm']; + export const useUse = async ([name]: string[], cmd: NrmCmd) => { const userConfig = await getFileUser(registriesPath); let registrylist = defaultNpmMirror; + let packageManager = 'npm'; if (userConfig && userConfig.registry) registrylist = userConfig.registry; let useRegistry: RegistryInfo | undefined = undefined; if (name) { useRegistry = registrylist.find((x) => x.alias === name); } else { - const { registry } = await prompts({ - type: 'select', - name: 'registry', - message: 'Pick a registry', - choices: registrylist.map((x) => { - return { - title: `${x.alias}${x.alias === x.name ? '' : `(${x.name})`} ${ - x.registry - }`, + const { registry, pkg } = await prompts([ + { + type: 'select', + name: 'registry', + message: 'Pick a registry', + choices: registrylist.map((x) => { + return { + title: `${x.alias}${x.alias === x.name ? '' : `(${x.name})`} ${ + x.registry + }`, + value: x, + }; + }), + }, + { + type: 'select', + name: 'pkg', + message: 'Pick a packageManager,and you will set registry for it', + initial: 0, + choices: defaultPackageManager.map((x) => ({ + title: x, value: x, - }; - }), - }); + })), + }, + ]); + + if (pkg) packageManager = pkg; + if (!registry) { log.error(`user cancel operation`); return; @@ -36,7 +54,6 @@ export const useUse = async ([name]: string[], cmd: NrmCmd) => { } if (!useRegistry) return log.error(`${name} not found`); - let packageManager = 'npm'; if (cmd.packageManager) packageManager = cmd.packageManager; await execCommand(packageManager, [ diff --git a/package/package.json b/package/package.json index 6c21c3c..92ec4e0 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { "name": "gacm", - "version": "1.2.1", + "version": "1.2.2", "private": false, "description": "git account manage", "keywords": [