Browse Source

chore: Upgrade Dependencies

张雨涵 2 years ago
parent
commit
8f171e2273
7 changed files with 354 additions and 396 deletions
  1. 1 0
      .gitignore
  2. 34 31
      README.md
  3. 28 23
      package.json
  4. 9 4
      src/commands/init/index.ts
  5. 0 15
      src/commands/update/index.ts
  6. 0 10
      src/hooks/postrun/index.ts
  7. 282 313
      yarn.lock

+ 1 - 0
.gitignore

@@ -7,3 +7,4 @@
 /tmp
 /tmp
 node_modules
 node_modules
 oclif.manifest.json
 oclif.manifest.json
+.idea

+ 34 - 31
README.md

@@ -26,7 +26,8 @@ USAGE
 # Commands
 # Commands
 <!-- commands -->
 <!-- commands -->
 * [`jianyu create`](#jianyu-create)
 * [`jianyu create`](#jianyu-create)
-* [`jianyu help [COMMAND]`](#jianyu-help-command)
+* [`jianyu cz`](#jianyu-cz)
+* [`jianyu help [COMMANDS]`](#jianyu-help-commands)
 * [`jianyu init DIR`](#jianyu-init-dir)
 * [`jianyu init DIR`](#jianyu-init-dir)
 * [`jianyu plugins`](#jianyu-plugins)
 * [`jianyu plugins`](#jianyu-plugins)
 * [`jianyu plugins:install PLUGIN...`](#jianyu-pluginsinstall-plugin)
 * [`jianyu plugins:install PLUGIN...`](#jianyu-pluginsinstall-plugin)
@@ -38,7 +39,6 @@ USAGE
 * [`jianyu plugins:uninstall PLUGIN...`](#jianyu-pluginsuninstall-plugin-2)
 * [`jianyu plugins:uninstall PLUGIN...`](#jianyu-pluginsuninstall-plugin-2)
 * [`jianyu plugins:update`](#jianyu-pluginsupdate)
 * [`jianyu plugins:update`](#jianyu-pluginsupdate)
 * [`jianyu sync`](#jianyu-sync)
 * [`jianyu sync`](#jianyu-sync)
-* [`jianyu update`](#jianyu-update)
 
 
 ## `jianyu create`
 ## `jianyu create`
 
 
@@ -55,16 +55,31 @@ EXAMPLES
   $ jianyu create
   $ jianyu create
 ```
 ```
 
 
-## `jianyu help [COMMAND]`
+## `jianyu cz`
+
+git 提交规范 - 交互式
+
+```
+USAGE
+  $ jianyu cz
+
+DESCRIPTION
+  git 提交规范 - 交互式
+
+EXAMPLES
+  $ jianyu cz
+```
+
+## `jianyu help [COMMANDS]`
 
 
 Display help for jianyu.
 Display help for jianyu.
 
 
 ```
 ```
 USAGE
 USAGE
-  $ jianyu help [COMMAND] [-n]
+  $ jianyu help [COMMANDS] [-n]
 
 
 ARGUMENTS
 ARGUMENTS
-  COMMAND  Command to show help for.
+  COMMANDS  Command to show help for.
 
 
 FLAGS
 FLAGS
   -n, --nested-commands  Include all nested commands in the output.
   -n, --nested-commands  Include all nested commands in the output.
@@ -73,7 +88,7 @@ DESCRIPTION
   Display help for jianyu.
   Display help for jianyu.
 ```
 ```
 
 
-_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.10/src/commands/help.ts)_
+_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.8/src/commands/help.ts)_
 
 
 ## `jianyu init DIR`
 ## `jianyu init DIR`
 
 
@@ -81,7 +96,7 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.1
 
 
 ```
 ```
 USAGE
 USAGE
-  $ jianyu init [DIR] -f <value>
+  $ jianyu init DIR -f <value>
 
 
 ARGUMENTS
 ARGUMENTS
   DIR  目录名,同时用于项目名
   DIR  目录名,同时用于项目名
@@ -115,7 +130,7 @@ EXAMPLES
   $ jianyu plugins
   $ jianyu plugins
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/index.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/index.ts)_
 
 
 ## `jianyu plugins:install PLUGIN...`
 ## `jianyu plugins:install PLUGIN...`
 
 
@@ -135,7 +150,6 @@ FLAGS
 
 
 DESCRIPTION
 DESCRIPTION
   Installs a plugin into the CLI.
   Installs a plugin into the CLI.
-
   Can be installed from npm or a git url.
   Can be installed from npm or a git url.
 
 
   Installation of a user-installed plugin will override a core plugin.
   Installation of a user-installed plugin will override a core plugin.
@@ -144,6 +158,7 @@ DESCRIPTION
   will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
   will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
   the CLI without the need to patch and update the whole CLI.
   the CLI without the need to patch and update the whole CLI.
 
 
+
 ALIASES
 ALIASES
   $ jianyu plugins:add
   $ jianyu plugins:add
 
 
@@ -170,6 +185,9 @@ FLAGS
   -h, --help     Show CLI help.
   -h, --help     Show CLI help.
   -v, --verbose
   -v, --verbose
 
 
+GLOBAL FLAGS
+  --json  Format output as json.
+
 DESCRIPTION
 DESCRIPTION
   Displays installation properties of a plugin.
   Displays installation properties of a plugin.
 
 
@@ -177,7 +195,7 @@ EXAMPLES
   $ jianyu plugins:inspect myplugin
   $ jianyu plugins:inspect myplugin
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/inspect.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/inspect.ts)_
 
 
 ## `jianyu plugins:install PLUGIN...`
 ## `jianyu plugins:install PLUGIN...`
 
 
@@ -197,7 +215,6 @@ FLAGS
 
 
 DESCRIPTION
 DESCRIPTION
   Installs a plugin into the CLI.
   Installs a plugin into the CLI.
-
   Can be installed from npm or a git url.
   Can be installed from npm or a git url.
 
 
   Installation of a user-installed plugin will override a core plugin.
   Installation of a user-installed plugin will override a core plugin.
@@ -206,6 +223,7 @@ DESCRIPTION
   will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
   will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
   the CLI without the need to patch and update the whole CLI.
   the CLI without the need to patch and update the whole CLI.
 
 
+
 ALIASES
 ALIASES
   $ jianyu plugins:add
   $ jianyu plugins:add
 
 
@@ -217,7 +235,7 @@ EXAMPLES
   $ jianyu plugins:install someuser/someplugin
   $ jianyu plugins:install someuser/someplugin
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/install.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/install.ts)_
 
 
 ## `jianyu plugins:link PLUGIN`
 ## `jianyu plugins:link PLUGIN`
 
 
@@ -236,17 +254,17 @@ FLAGS
 
 
 DESCRIPTION
 DESCRIPTION
   Links a plugin into the CLI for development.
   Links a plugin into the CLI for development.
-
   Installation of a linked plugin will override a user-installed or core plugin.
   Installation of a linked plugin will override a user-installed or core plugin.
 
 
   e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
   e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
   command will override the user-installed or core plugin implementation. This is useful for development work.
   command will override the user-installed or core plugin implementation. This is useful for development work.
 
 
+
 EXAMPLES
 EXAMPLES
   $ jianyu plugins:link myplugin
   $ jianyu plugins:link myplugin
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/link.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/link.ts)_
 
 
 ## `jianyu plugins:uninstall PLUGIN...`
 ## `jianyu plugins:uninstall PLUGIN...`
 
 
@@ -294,7 +312,7 @@ ALIASES
   $ jianyu plugins:remove
   $ jianyu plugins:remove
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/uninstall.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/uninstall.ts)_
 
 
 ## `jianyu plugins:uninstall PLUGIN...`
 ## `jianyu plugins:uninstall PLUGIN...`
 
 
@@ -335,7 +353,7 @@ DESCRIPTION
   Update installed plugins.
   Update installed plugins.
 ```
 ```
 
 
-_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/update.ts)_
+_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/update.ts)_
 
 
 ## `jianyu sync`
 ## `jianyu sync`
 
 
@@ -351,19 +369,4 @@ DESCRIPTION
 EXAMPLES
 EXAMPLES
   $ jianyu sync
   $ jianyu sync
 ```
 ```
-
-## `jianyu update`
-
-检测 CLI 版本更新
-
-```
-USAGE
-  $ jianyu update
-
-DESCRIPTION
-  检测 CLI 版本更新
-
-EXAMPLES
-  $ jianyu update
-```
 <!-- commandsstop -->
 <!-- commandsstop -->

+ 28 - 23
package.json

@@ -22,31 +22,33 @@
   ],
   ],
   "dependencies": {
   "dependencies": {
     "@jianyu/dl-template": "^0.2.2",
     "@jianyu/dl-template": "^0.2.2",
-    "@oclif/core": "^1",
-    "@oclif/plugin-help": "^5",
-    "@oclif/plugin-plugins": "^2.0.1",
-    "ejs": "^3.1.8",
+    "@oclif/core": "^2.7.1",
+    "@oclif/plugin-help": "^5.2.8",
+    "@oclif/plugin-not-found": "^2.3.22",
+    "@oclif/plugin-plugins": "^2.4.3",
+    "@oclif/plugin-warn-if-update-available": "^2.0.32",
+    "ejs": "^3.1.9",
     "inquirer": "^8.2.1",
     "inquirer": "^8.2.1",
     "replace-in-file": "^6.3.5"
     "replace-in-file": "^6.3.5"
   },
   },
   "devDependencies": {
   "devDependencies": {
-    "@oclif/test": "^2",
-    "@types/chai": "^4",
-    "@types/ejs": "^3.1.1",
+    "@oclif/test": "^2.3.11",
+    "@types/chai": "^4.3.4",
+    "@types/ejs": "^3.1.2",
     "@types/inquirer": "^8.2.1",
     "@types/inquirer": "^8.2.1",
-    "@types/mocha": "^9.0.0",
-    "@types/node": "^16.9.4",
-    "chai": "^4",
+    "@types/mocha": "^10.0.1",
+    "@types/node": "^18.15.6",
+    "chai": "^4.3.7",
     "eslint": "^7.32.0",
     "eslint": "^7.32.0",
     "eslint-config-oclif": "^4",
     "eslint-config-oclif": "^4",
-    "eslint-config-oclif-typescript": "^1.0.2",
-    "globby": "^11",
-    "mocha": "^9",
-    "oclif": "^3",
-    "shx": "^0.3.3",
-    "ts-node": "^10.2.1",
-    "tslib": "^2.3.1",
-    "typescript": "^4.4.3"
+    "eslint-config-oclif-typescript": "^1.0.3",
+    "globby": "^13.1.3",
+    "mocha": "^10.2.0",
+    "oclif": "^3.7.2",
+    "shx": "^0.3.4",
+    "ts-node": "^10.9.1",
+    "tslib": "^2.5.0",
+    "typescript": "^5.0.2"
   },
   },
   "oclif": {
   "oclif": {
     "bin": "jianyu",
     "bin": "jianyu",
@@ -54,12 +56,15 @@
     "commands": "./dist/commands",
     "commands": "./dist/commands",
     "plugins": [
     "plugins": [
       "@oclif/plugin-help",
       "@oclif/plugin-help",
-      "@oclif/plugin-plugins"
+      "@oclif/plugin-plugins",
+      "@oclif/plugin-not-found",
+      "@oclif/plugin-warn-if-update-available"
     ],
     ],
-    "hooks": {
-      "postrun": [
-        "./dist/hooks/postrun/index"
-      ]
+    "warn-if-update-available": {
+      "timeoutInDays": 0,
+      "message": "检测到新版本 <%= chalk.greenBright(latest) %>\nHow: <%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>. \nTip:yarn add @jianyu/cli -g --registry http://192.168.3.207:4873/",
+      "registry": "http://192.168.3.207:4873",
+      "authorization": "Basic <SOME READ ONLY AUTH TOKEN>"
     }
     }
   },
   },
   "scripts": {
   "scripts": {

+ 9 - 4
src/commands/init/index.ts

@@ -1,4 +1,4 @@
-import { Command, Flags } from '@oclif/core'
+import { Args, Command, Flags } from '@oclif/core'
 import {TEMPLATES, TemplateNames, ComponentPrompt, PackagePrompt, PACKAGE } from '../../template'
 import {TEMPLATES, TemplateNames, ComponentPrompt, PackagePrompt, PACKAGE } from '../../template'
 import DownloadRemoteProjectTemplate, { FormatParams } from '@jianyu/dl-template'
 import DownloadRemoteProjectTemplate, { FormatParams } from '@jianyu/dl-template'
 import render from '../../utils/render'
 import render from '../../utils/render'
@@ -27,11 +27,16 @@ export default class Init extends Command {
     from: Flags.string({ char: 'f', description: '指定拉取模版的名称', required: true })
     from: Flags.string({ char: 'f', description: '指定拉取模版的名称', required: true })
   }
   }
 
 
-  static args = [{ name: 'dir', description: '目录名,同时用于项目名', required: true }]
+  static args = {
+    dir: Args.string({
+      description: '目录名,同时用于项目名',
+      required: true
+    })
+  }
 
 
   async run(): Promise<void> {
   async run(): Promise<void> {
     const { args, flags } = await this.parse(Init)
     const { args, flags } = await this.parse(Init)
-    const canNext = TemplateNames.includes(flags.from)
+    const canNext = TemplateNames.includes(<string>flags.from)
 
 
     if (!canNext) {
     if (!canNext) {
       this.error(`🚨 [template error] 没有找到对应的模版配置, 可用的模版为 [${TemplateNames.join(',')}]`)
       this.error(`🚨 [template error] 没有找到对应的模版配置, 可用的模版为 [${TemplateNames.join(',')}]`)
@@ -46,7 +51,7 @@ export default class Init extends Command {
     })
     })
 
 
     const { repo, assets, title } = TEMPLATES[flags.from]
     const { repo, assets, title } = TEMPLATES[flags.from]
-    const destinationFolder = path.resolve(process.cwd(), args.dir)
+    const destinationFolder = path.resolve(process.cwd(), <string>args.dir)
 
 
     this.log(`🗃 项目初始化目录路径: ${args.dir}`)
     this.log(`🗃 项目初始化目录路径: ${args.dir}`)
 
 

+ 0 - 15
src/commands/update/index.ts

@@ -1,15 +0,0 @@
-import { Command } from '@oclif/core'
-import checkUpdate from '../../utils/update'
-
-export default class Update extends Command {
-  static description = '检测 CLI 版本更新'
-
-  static examples = [
-    '$ jianyu update'
-  ]
-
-  async run(): Promise<void> {
-    await this.parse(Update)
-    checkUpdate()
-  }
-}

+ 0 - 10
src/hooks/postrun/index.ts

@@ -1,10 +0,0 @@
-import { Hook } from '@oclif/core'
-import checkUpdate from '../../utils/update'
-
-const hook: Hook<'postrun'> = async function (opts) {
-  if (opts.Command.id !== 'update') {
-    checkUpdate()
-  }
-}
-
-export default hook

File diff suppressed because it is too large
+ 282 - 313
yarn.lock


Some files were not shown because too many files changed in this diff