-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from gamunu/submenu
Improve explorer context menu for package.json files
- Loading branch information
Showing
16 changed files
with
250 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/class-name-casing": "error", | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"error", | ||
{ | ||
"multiline": { | ||
"delimiter": "semi", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/semi": [ | ||
"error", | ||
"always" | ||
], | ||
"@typescript-eslint/class-name-casing": [ | ||
"off", | ||
"always" | ||
], | ||
"curly": "error", | ||
"eqeqeq": [ | ||
"error", | ||
"always" | ||
], | ||
"no-redeclare": "error", | ||
"no-unused-expressions": "error", | ||
"prefer-const": "error" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ git clone [email protected]:gamunu/vscode-yarn.git gamunu.vscode-yarn | |
|
||
### Explorer context menu | ||
|
||
`yarn install` also available in the `package.json` file's explorer context menu. | ||
Few `yarn` commands also available in the `package.json` file's explorer context menu. | ||
|
||
![Context menu](images/context.png) | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import { packageExists, CommandArgument, pickPackageJson } from './utils'; | ||
import * as Messages from './messages'; | ||
import { getPackageJson } from './utils'; | ||
import { Uri } from 'vscode'; | ||
import { runCommand } from './run-command'; | ||
|
||
export async function yarnInstallPackages(arg: CommandArgument) { | ||
let packageJson = null | ||
export async function yarnInstallPackages(arg: Uri) { | ||
const packageJson: string = await getPackageJson(arg); | ||
|
||
// context menu wins always | ||
if (arg !== undefined) { | ||
packageJson = arg.fsPath; | ||
} else { // fall back to pick | ||
packageJson = await pickPackageJson() | ||
} | ||
if (packageJson === null) { return; } | ||
|
||
if (!packageExists(packageJson)) { | ||
Messages.noPackageError(); | ||
return; | ||
} | ||
runCommand(['install'], packageJson); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import { packageExists, pickPackageJson } from './utils'; | ||
import * as Messages from './messages'; | ||
import { getPackageJson } from './utils'; | ||
import { Uri } from 'vscode'; | ||
import { runCommand } from './run-command'; | ||
|
||
export async function yarnOutdated() { | ||
let packageJson = await pickPackageJson() | ||
if (!packageExists(packageJson)) { | ||
Messages.noPackageError(); | ||
return; | ||
} | ||
export async function yarnOutdated(arg: Uri) { | ||
const packageJson: string = await getPackageJson(arg); | ||
|
||
if (packageJson === null) { return; } | ||
|
||
runCommand(['outdated'], packageJson); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.