Skip to content

Commit

Permalink
feat: add support for searching yarn 3 lock files
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemellander committed Sep 26, 2024
1 parent 99352ba commit 1a5ad3b
Show file tree
Hide file tree
Showing 3 changed files with 547 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/lib/deployer/repo/version_compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def current_version
def find_current_version
match =
yarn_lock_file.match(
/"#{package_name}@[^"]+":\n\s\sversion "([^"]+)"/m
/"#{Regexp.escape(package_name)}@[^"]+":?\n\s+version:?\s"?([^"\n]+)/m
)
package_not_found if match.nil?

Expand Down
11 changes: 11 additions & 0 deletions deploy/spec/deployer/repo/version_compare_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
describe Deployer::Repo::VersionCompare do
describe "#major_upgrade?" do
it "works when detecting a yarn 3 file" do
version_compare =
described_class.new(
package_name: "@planningcenter/tapestry-react",
version: "4.6.0",
yarn_lock_file_path: "spec/fixtures/yarn3.lock"
)

expect(version_compare.major_upgrade?).to eq(false)
end

it "works when detecting a yarn file" do
version_compare =
described_class.new(
Expand Down
Loading

0 comments on commit 1a5ad3b

Please sign in to comment.