-
Notifications
You must be signed in to change notification settings - Fork 1
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 #778 from coinbase/yarn-auto-fix-v2
YarnAutoFix using yarn-audit-fix
- Loading branch information
Showing
9 changed files
with
1,829 additions
and
166 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"dependencies": { | ||
"@yarnpkg/lockfile": "^1.0.1" | ||
"@yarnpkg/lockfile": "^1.0.1", | ||
"yarn-audit-fix": "9.3.7" | ||
} | ||
} |
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,18 @@ | ||
require 'uri' | ||
require 'salus/yarn_formatter' | ||
require 'salus/auto_fix/base' | ||
|
||
module Salus::Autofix | ||
class YarnAuditV2 < Base | ||
def initialize(path_to_repo) | ||
@path_to_repo = path_to_repo | ||
end | ||
|
||
def run_auto_fix | ||
shell_return = run_shell("npx yarn-audit-fix", chdir: @path_to_repo) | ||
return true if shell_return.stdout.include?("success Saved lockfile.") | ||
|
||
false | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Math functions on shapes | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// For package depenency demonstration purposes only | ||
var multiply = require('lodash/multiply'); | ||
|
||
module.exports = { | ||
area_rectangle: function(width, height) { | ||
return multiply(height, width); | ||
} | ||
} |
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,24 @@ | ||
{ | ||
"name": "example-yarn-package", | ||
"version": "1.0.0", | ||
"description": "An example package to demonstrate Yarn", | ||
"main": "index.js", | ||
"repository": { | ||
"url": "github.com/yarnpkg/example-yarn-package", | ||
"type": "git" | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"author": "Yarn Contributors", | ||
"license": "BSD-2-Clause", | ||
"dependencies": { | ||
"lodash": "^4.16.2" | ||
}, | ||
"devDependencies": { | ||
"jest-cli": "15.1.1" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
} |
Oops, something went wrong.