🦄 refactor(阅读代码): package.json增加注释

master
yetao 4 weeks ago
parent 94ce9f8e65
commit 065ca84b6d

@ -1,315 +1,465 @@
{ {
//
"name": "vscode-sshfs", "name": "vscode-sshfs",
// VSCode
"displayName": "SSH FS", "displayName": "SSH FS",
//
"description": "File system, terminal and task provider using SSH", "description": "File system, terminal and task provider using SSH",
//
"publisher": "Kelvin", "publisher": "Kelvin",
//
"version": "1.26.1", "version": "1.26.1",
// VSCode
"engines": { "engines": {
"vscode": "^1.49.0" "vscode": "^1.49.0"
}, },
// "Other"
"categories": [ "categories": [
"Other" "Other"
], ],
//
"activationEvents": [ "activationEvents": [
// 访 SSH
"onFileSystem:ssh", "onFileSystem:ssh",
// 访 SSH
"onFileSystemAccess:ssh", "onFileSystemAccess:ssh",
// SSH FS
"onView:sshfs-configs", "onView:sshfs-configs",
// SSH FS
"onView:sshfs-connections", "onView:sshfs-connections",
// sshfs.new
"onCommand:sshfs.new", "onCommand:sshfs.new",
// sshfs.add
"onCommand:sshfs.add", "onCommand:sshfs.add",
// sshfs.disconnect
"onCommand:sshfs.disconnect", "onCommand:sshfs.disconnect",
// sshfs.disconnectAll
"onCommand:sshfs.disconnectAll", "onCommand:sshfs.disconnectAll",
// sshfs.terminal
"onCommand:sshfs.terminal", "onCommand:sshfs.terminal",
// sshfs.focusTerminal
"onCommand:sshfs.focusTerminal", "onCommand:sshfs.focusTerminal",
// sshfs.closeTerminal
"onCommand:sshfs.closeTerminal", "onCommand:sshfs.closeTerminal",
// sshfs.configure
"onCommand:sshfs.configure", "onCommand:sshfs.configure",
// sshfs.reload
"onCommand:sshfs.reload", "onCommand:sshfs.reload",
// sshfs.settings
"onCommand:sshfs.settings", "onCommand:sshfs.settings",
// sshfs.refresh
"onCommand:sshfs.refresh" "onCommand:sshfs.refresh"
], ],
//
"main": "./dist/extension.js", "main": "./dist/extension.js",
//
"homepage": "https://github.com/SchoofsKelvin/vscode-sshfs", "homepage": "https://github.com/SchoofsKelvin/vscode-sshfs",
//
"author": { "author": {
//
"name": "Kelvin Schoofs", "name": "Kelvin Schoofs",
//
"email": "schoofs.kelvin@gmail.com", "email": "schoofs.kelvin@gmail.com",
// GitHub
"url": "https://github.com/SchoofsKelvin" "url": "https://github.com/SchoofsKelvin"
}, },
//
"repository": { "repository": {
// git
"type": "git", "type": "git",
// URL
"url": "https://github.com/SchoofsKelvin/vscode-sshfs" "url": "https://github.com/SchoofsKelvin/vscode-sshfs"
}, },
// Bug
"bugs": { "bugs": {
// Bug URL
"url": "https://github.com/SchoofsKelvin/vscode-sshfs/issues" "url": "https://github.com/SchoofsKelvin/vscode-sshfs/issues"
}, },
//
"license": "GPL-3.0", "license": "GPL-3.0",
//
"icon": "resources/Logo.png", "icon": "resources/Logo.png",
// VSCode
"keywords": [ "keywords": [
//
"remote", "remote",
// 使 SSH
"ssh", "ssh",
// 使 SSH SSHFS
"sshfs", "sshfs",
//
"sync", "sync",
//
"filesystem", "filesystem",
//
"terminal", "terminal",
// SFTP
"sftp", "sftp",
// SCP
"scp" "scp"
], ],
//
"badges": [ "badges": [
// GitHub
{ {
"url": "https://img.shields.io/github/v/release/SchoofsKelvin/vscode-sshfs?include_prereleases&label=GitHub%20version", "url": "https://img.shields.io/github/v/release/SchoofsKelvin/vscode-sshfs?include_prereleases&label=GitHub%20version",
"href": "https://github.com/SchoofsKelvin/vscode-sshfs/releases", "href": "https://github.com/SchoofsKelvin/vscode-sshfs/releases",
"description": "Releases on GitHub" "description": "Releases on GitHub"
}, },
// Open VSX Open VSX
{ {
"url": "https://img.shields.io/open-vsx/v/Kelvin/vscode-sshfs?label=Open%20VSX", "url": "https://img.shields.io/open-vsx/v/Kelvin/vscode-sshfs?label=Open%20VSX",
"href": "https://open-vsx.org/extension/Kelvin/vscode-sshfs", "href": "https://open-vsx.org/extension/Kelvin/vscode-sshfs",
"description": "Open VSX Registry" "description": "Open VSX Registry"
}, },
// Visual Studio Marketplace Visual Studio Marketplace
{ {
"url": "https://img.shields.io/visual-studio-marketplace/v/Kelvin.vscode-sshfs?label=VS%20Marketplace&logo=sdf", "url": "https://img.shields.io/visual-studio-marketplace/v/Kelvin.vscode-sshfs?label=VS%20Marketplace&logo=sdf",
"href": "https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs", "href": "https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs",
"description": "Visual Studio Marketplace" "description": "Visual Studio Marketplace"
}, },
// Visual Studio Marketplace Visual Studio Marketplace
{ {
"url": "https://img.shields.io/visual-studio-marketplace/i/Kelvin.vscode-sshfs?label=Installs", "url": "https://img.shields.io/visual-studio-marketplace/i/Kelvin.vscode-sshfs?label=Installs",
"href": "https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs", "href": "https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs",
"description": "Unique installs using Visual Studio Marketplace" "description": "Unique installs using Visual Studio Marketplace"
} }
], ],
//
"sponsor": { "sponsor": {
// URL
"url": "https://github.com/sponsors/SchoofsKelvin" "url": "https://github.com/sponsors/SchoofsKelvin"
}, },
// VSCode
"contributes": { "contributes": {
//
"views": { "views": {
// sshfs
"sshfs": [ "sshfs": [
{ {
//
"id": "sshfs-configs", "id": "sshfs-configs",
//
"name": "Configurations", "name": "Configurations",
//
"contextualTitle": "SSH FS - Configurations", "contextualTitle": "SSH FS - Configurations",
//
"icon": "resources/icon.svg", "icon": "resources/icon.svg",
//
"visibility": "visible" "visibility": "visible"
}, },
{ {
//
"id": "sshfs-connections", "id": "sshfs-connections",
//
"name": "Connections", "name": "Connections",
//
"contextualTitle": "SSH FS - Connections", "contextualTitle": "SSH FS - Connections",
//
"icon": "resources/icon.svg", "icon": "resources/icon.svg",
//
"visibility": "visible" "visibility": "visible"
} }
] ]
}, },
// VSCode
"viewsContainers": { "viewsContainers": {
// sshfs
"activitybar": [ "activitybar": [
{ {
//
"id": "sshfs", "id": "sshfs",
//
"title": "SSH FS", "title": "SSH FS",
//
"icon": "resources/icon.svg" "icon": "resources/icon.svg"
} }
] ]
}, },
// VSCode SSH FS
"commands": [ "commands": [
{ {
//
"command": "sshfs.new", "command": "sshfs.new",
//
"title": "Create a SSH FS configuration", "title": "Create a SSH FS configuration",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(new-file)" "icon": "$(new-file)"
}, },
{ {
//
"command": "sshfs.add", "command": "sshfs.add",
//
"title": "Add as Workspace folder", "title": "Add as Workspace folder",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(new-folder)" "icon": "$(new-folder)"
}, },
{ {
//
"command": "sshfs.disconnect", "command": "sshfs.disconnect",
//
"title": "Disconnect", "title": "Disconnect",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(debug-disconnect)" "icon": "$(debug-disconnect)"
}, },
{ {
//
"command": "sshfs.disconnectAll", "command": "sshfs.disconnectAll",
//
"title": "Disconnect all", "title": "Disconnect all",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(debug-disconnect)" "icon": "$(debug-disconnect)"
}, },
{ {
//
"command": "sshfs.terminal", "command": "sshfs.terminal",
//
"title": "Open remote SSH terminal", "title": "Open remote SSH terminal",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(terminal)" "icon": "$(terminal)"
}, },
{ {
//
"command": "sshfs.configure", "command": "sshfs.configure",
//
"title": "Edit configuration", "title": "Edit configuration",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(settings-gear)" "icon": "$(settings-gear)"
}, },
{ {
//
"command": "sshfs.reload", "command": "sshfs.reload",
//
"title": "Reload configurations", "title": "Reload configurations",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(refresh)" "icon": "$(refresh)"
}, },
{ {
//
"command": "sshfs.settings", "command": "sshfs.settings",
//
"title": "Open settings and edit configurations", "title": "Open settings and edit configurations",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(settings)" "icon": "$(settings)"
}, },
{ {
//
"command": "sshfs.refresh", "command": "sshfs.refresh",
//
"title": "Refresh", "title": "Refresh",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(refresh)" "icon": "$(refresh)"
}, },
{ {
//
"command": "sshfs.focusTerminal", "command": "sshfs.focusTerminal",
//
"title": "Focus terminal", "title": "Focus terminal",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(eye)" "icon": "$(eye)"
}, },
{ {
//
"command": "sshfs.closeTerminal", "command": "sshfs.closeTerminal",
//
"title": "Close terminal", "title": "Close terminal",
//
"category": "SSH FS", "category": "SSH FS",
// 使 VSCode
"icon": "$(close)" "icon": "$(close)"
} }
], ],
// menus
"menus": { "menus": {
// commandPalette
"commandPalette": [ "commandPalette": [
// sshfs.new SSH FS 1
{ {
"command": "sshfs.new", "command": "sshfs.new",
"group": "SSH FS@1" "group": "SSH FS@1"
}, },
// sshfs.add SSH FS 2
{ {
"command": "sshfs.add", "command": "sshfs.add",
"group": "SSH FS@2" "group": "SSH FS@2"
}, },
// sshfs.disconnect SSH FS 3
{ {
"command": "sshfs.disconnect", "command": "sshfs.disconnect",
"group": "SSH FS@3" "group": "SSH FS@3"
}, },
// sshfs.terminal SSH FS 4
{ {
"command": "sshfs.terminal", "command": "sshfs.terminal",
"group": "SSH FS@4" "group": "SSH FS@4"
}, },
// sshfs.configure SSH FS 5
{ {
"command": "sshfs.configure", "command": "sshfs.configure",
"group": "SSH FS@5" "group": "SSH FS@5"
}, },
// sshfs.reload SSH FS 6
{ {
"command": "sshfs.reload", "command": "sshfs.reload",
"group": "SSH FS@6" "group": "SSH FS@6"
}, },
// sshfs.disconnectAll SSH FS 7
{ {
"command": "sshfs.disconnectAll", "command": "sshfs.disconnectAll",
"group": "SSH FS@7" "group": "SSH FS@7"
}, },
// sshfs.settings SSH FS 8
{ {
"command": "sshfs.settings", "command": "sshfs.settings",
"group": "SSH FS@8" "group": "SSH FS@8"
}, },
// sshfs.focusTerminal
{ {
"command": "sshfs.focusTerminal", "command": "sshfs.focusTerminal",
"when": "false" "when": "false"
}, },
// sshfs.closeTerminal
{ {
"command": "sshfs.closeTerminal", "command": "sshfs.closeTerminal",
"when": "false" "when": "false"
}, },
// sshfs.refresh
{ {
"command": "sshfs.refresh", "command": "sshfs.refresh",
"when": "false" "when": "false"
} }
], ],
// view/title
"view/title": [ "view/title": [
// sshfs.refresh 'sshfs-configs' 'sshfs-connections' 1
{ {
"command": "sshfs.refresh", "command": "sshfs.refresh",
"when": "view == 'sshfs-configs' || view == 'sshfs-connections'", "when": "view == 'sshfs-configs' || view == 'sshfs-connections'",
"group": "navigation@1" "group": "navigation@1"
}, },
// sshfs.new 'sshfs-configs' 2
{ {
"command": "sshfs.new", "command": "sshfs.new",
"when": "view == 'sshfs-configs'", "when": "view == 'sshfs-configs'",
"group": "navigation@2" "group": "navigation@2"
}, },
// sshfs.add 'sshfs-connections' 2
{ {
"command": "sshfs.add", "command": "sshfs.add",
"when": "view == 'sshfs-connections'", "when": "view == 'sshfs-connections'",
"group": "navigation@2" "group": "navigation@2"
}, },
// sshfs.disconnectAll 'sshfs-connections' 3
{ {
"command": "sshfs.disconnectAll", "command": "sshfs.disconnectAll",
"when": "view == 'sshfs-connections'", "when": "view == 'sshfs-connections'",
"group": "navigation@3" "group": "navigation@3"
}, },
// sshfs.settings 'sshfs-configs' 'sshfs-connections' 100
{ {
"command": "sshfs.settings", "command": "sshfs.settings",
"when": "view == 'sshfs-configs' || view == 'sshfs-connections'", "when": "view == 'sshfs-configs' || view == 'sshfs-connections'",
"group": "navigation@100" "group": "navigation@100"
} }
], ],
//
"view/item/context": [ "view/item/context": [
// 'sshfs-configs' 'config' ''
{ {
"command": "sshfs.add", "command": "sshfs.add",
"when": "view == 'sshfs-configs' && viewItem == config", "when": "view == 'sshfs-configs' && viewItem == config",
"group": "inline@1" "group": "inline@1"
}, },
// 'sshfs-configs' 'config' ''
{ {
"command": "sshfs.terminal", "command": "sshfs.terminal",
"when": "view == 'sshfs-configs' && viewItem == config", "when": "view == 'sshfs-configs' && viewItem == config",
"group": "inline@2" "group": "inline@2"
}, },
// 'sshfs-configs' 'config' ''
{ {
"command": "sshfs.configure", "command": "sshfs.configure",
"when": "view == 'sshfs-configs' && viewItem == config", "when": "view == 'sshfs-configs' && viewItem == config",
"group": "inline@3" "group": "inline@3"
}, },
// 'sshfs-configs' 'config' ''
{ {
"command": "sshfs.disconnect", "command": "sshfs.disconnect",
"when": "view == 'sshfs-configs' && viewItem == config", "when": "view == 'sshfs-configs' && viewItem == config",
"group": "inline@4" "group": "inline@4"
}, },
// 'sshfs-connections' 'connection' ''
{ {
"command": "sshfs.terminal", "command": "sshfs.terminal",
"when": "view == 'sshfs-connections' && viewItem == connection", "when": "view == 'sshfs-connections' && viewItem == connection",
"group": "inline@1" "group": "inline@1"
}, },
// 'sshfs-connections' 'connection' ''
{ {
"command": "sshfs.disconnect", "command": "sshfs.disconnect",
"when": "view == 'sshfs-connections' && viewItem == connection", "when": "view == 'sshfs-connections' && viewItem == connection",
"group": "inline@2" "group": "inline@2"
}, },
// 'sshfs-connections' 'terminal' ''
{ {
"command": "sshfs.closeTerminal", "command": "sshfs.closeTerminal",
"when": "view == 'sshfs-connections' && viewItem == terminal", "when": "view == 'sshfs-connections' && viewItem == terminal",
"group": "inline@1" "group": "inline@1"
} }
], ],
//
"explorer/context": [ "explorer/context": [
// sshfs.terminal ssh 30
{ {
"command": "sshfs.terminal", "command": "sshfs.terminal",
"when": "explorerResourceIsFolder && resourceScheme == ssh", "when": "explorerResourceIsFolder && resourceScheme == ssh",
"group": "navigation@30" "group": "navigation@30"
} }
], ],
//
"statusBar/remoteIndicator": [ "statusBar/remoteIndicator": [
// sshfs.add remote_11_ssh_sshfs 1
{ {
"command": "sshfs.add", "command": "sshfs.add",
"group": "remote_11_ssh_sshfs@1" "group": "remote_11_ssh_sshfs@1"
}, },
// sshfs.terminal remote_11_ssh_sshfs 2
{ {
"command": "sshfs.terminal", "command": "sshfs.terminal",
"group": "remote_11_ssh_sshfs@2" "group": "remote_11_ssh_sshfs@2"
}, },
// sshfs.settings remote_11_ssh_sshfs 3
{ {
"command": "sshfs.settings", "command": "sshfs.settings",
"group": "remote_11_ssh_sshfs@3" "group": "remote_11_ssh_sshfs@3"
}, },
// sshfs.disconnect remote_11_ssh_sshfs 4 sshfs.openConnections 0
{ {
"command": "sshfs.disconnect", "command": "sshfs.disconnect",
"group": "remote_11_ssh_sshfs@4", "group": "remote_11_ssh_sshfs@4",
"when": "sshfs.openConnections > 0" "when": "sshfs.openConnections > 0"
}, },
// sshfs.disconnectAll remote_11_ssh_sshfs 5 sshfs.openConnections 0
{ {
"command": "sshfs.disconnectAll", "command": "sshfs.disconnectAll",
"group": "remote_11_ssh_sshfs@5", "group": "remote_11_ssh_sshfs@5",
@ -317,99 +467,166 @@
} }
] ]
}, },
//
"configuration": { "configuration": {
//
"title": "SSH FS Configuration", "title": "SSH FS Configuration",
//
"properties": { "properties": {
// sshfs.configpaths SSH FS
"sshfs.configpaths": { "sshfs.configpaths": {
//
"title": "A list of file locations to load SSH FS configurations from", "title": "A list of file locations to load SSH FS configurations from",
//
"description": "Location of JSON files to load configs from", "description": "Location of JSON files to load configs from",
//
"type": "array", "type": "array",
//
"items": "string", "items": "string",
//
"default": [] "default": []
}, },
// sshfs.configs SSH FS
"sshfs.configs": { "sshfs.configs": {
//
"title": "A list of SSH FS configurations", "title": "A list of SSH FS configurations",
//
"description": "Use the Settings UI to edit configurations (run command SSH FS: Open settings and edit configurations)", "description": "Use the Settings UI to edit configurations (run command SSH FS: Open settings and edit configurations)",
// Markdown
"markdownDescription": "Use the Settings UI to edit configurations *(run command `SSH FS: Open settings and edit configurations`)*", "markdownDescription": "Use the Settings UI to edit configurations *(run command `SSH FS: Open settings and edit configurations`)*",
//
"type": "array", "type": "array",
//
"items": "object", "items": "object",
//
"default": [ "default": [
{ {
//
"root": "/tmp", "root": "/tmp",
//
"host": "localhost", "host": "localhost",
//
"port": 22, "port": 22,
//
"username": "root", "username": "root",
//
"password": "CorrectHorseBatteryStaple" "password": "CorrectHorseBatteryStaple"
} }
] ]
}, },
// sshfs.flags /
"sshfs.flags": { "sshfs.flags": {
//
"title": "List of special flags to enable/disable certain fixes/features", "title": "List of special flags to enable/disable certain fixes/features",
//
"description": "Flags are usually used for issues or beta testing. Flags can disappear/change anytime!", "description": "Flags are usually used for issues or beta testing. Flags can disappear/change anytime!",
//
"type": "array", "type": "array",
//
"items": "string", "items": "string",
//
"default": [] "default": []
} }
} }
}, },
// SSH
"taskDefinitions": [ "taskDefinitions": [
{ {
//
"type": "ssh-shell", "type": "ssh-shell",
//
"properties": { "properties": {
// SSH
"host": { "host": {
//
"type": "string", "type": "string",
//
"description": "The configuration (name) to run this task on" "description": "The configuration (name) to run this task on"
}, },
//
"command": { "command": {
//
"type": "string", "type": "string",
//
"description": "The command to run on the server" "description": "The command to run on the server"
}, },
//
"workingDirectory": { "workingDirectory": {
//
"type": "string", "type": "string",
//
"description": "The working directory (relative to the config-defined root) to run the command in" "description": "The working directory (relative to the config-defined root) to run the command in"
} }
}, },
//
"required": [ "required": [
//
"host", "host",
//
"command" "command"
] ]
} }
], ],
// SSH
"resourceLabelFormatters": [ "resourceLabelFormatters": [
{ {
// ssh
"scheme": "ssh", "scheme": "ssh",
//
"formatting": { "formatting": {
// 使
"label": "${scheme}://${authority}/${path}", "label": "${scheme}://${authority}/${path}",
// /
"separator": "/", "separator": "/",
// ~ false
"tildify": false, "tildify": false,
// true
"stripPathStartingSeparator": true, "stripPathStartingSeparator": true,
// SSH FS
"workspaceSuffix": "SSH FS" "workspaceSuffix": "SSH FS"
} }
} }
], ],
// viewsWelcome
"viewsWelcome": [ "viewsWelcome": [
// sshfs-configs
{ {
//
"view": "sshfs-configs", "view": "sshfs-configs",
//
"contents": "No configurations created yet" "contents": "No configurations created yet"
}, },
// sshfs-connections
{ {
//
"view": "sshfs-connections", "view": "sshfs-connections",
//
"contents": "Not connected to anything" "contents": "Not connected to anything"
} }
] ]
}, },
//
"capabilities": { "capabilities": {
//
"virtualWorkspaces": true, "virtualWorkspaces": true,
//
"untrustedWorkspaces": { "untrustedWorkspaces": {
//
"supported": true "supported": true
} }
}, },
//
"scripts": { "scripts": {
//
"vscode:prepublish": "yarn workspaces foreach -tvip -j 2 run build", "vscode:prepublish": "yarn workspaces foreach -tvip -j 2 run build",
//
"build": "webpack --mode production", "build": "webpack --mode production",
//
"compile": "webpack --mode development", "compile": "webpack --mode development",
//
"watch": "webpack --mode development --watch" "watch": "webpack --mode development --watch"
}, },
//
"devDependencies": { "devDependencies": {
"@types/node": "^12.7.12", "@types/node": "^12.7.12",
"@types/request": "^2.48.1", "@types/request": "^2.48.1",
@ -426,6 +643,7 @@
"webpack": "^5.76.3", "webpack": "^5.76.3",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.1"
}, },
//
"dependencies": { "dependencies": {
"common": "workspace:*", "common": "workspace:*",
"event-stream": "^4.0.1", "event-stream": "^4.0.1",
@ -435,13 +653,18 @@
"ssh2": "^1.11.0", "ssh2": "^1.11.0",
"winreg": "^1.2.4" "winreg": "^1.2.4"
}, },
//
"resolutions": { "resolutions": {
"cpu-features": "npm:@favware/skip-dependency@1.1.3", "cpu-features": "npm:@favware/skip-dependency@1.1.3",
"ssh2@^1.11.0": "patch:ssh2@npm%3A1.11.0#./.yarn/patches/ssh2-npm-1.11.0-convertSha1.patch" "ssh2@^1.11.0": "patch:ssh2@npm%3A1.11.0#./.yarn/patches/ssh2-npm-1.11.0-convertSha1.patch"
}, },
//
"workspaces": [ "workspaces": [
// common
"./common", "./common",
// webview
"./webview" "./webview"
], ],
// 使
"packageManager": "yarn@3.5.0" "packageManager": "yarn@3.5.0"
} }

Loading…
Cancel
Save