Skip to content

Commit 4bb8a41

Browse files
committed
fix: git dependency overrides should have top-level git field
1 parent b26f310 commit 4bb8a41

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

melos.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ command:
4343
version:
4444
# Generate commit links in package changelogs.
4545
linkToCommits: true
46-
# Only allow versioning to happen on main branch.
47-
branch: main
4846
# Additionally build a changelog at the root of the workspace.
4947
workspaceChangelog: true
5048
hooks:

packages/melos/lib/src/common/extensions/dependency.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,26 @@ extension HostedDependencyExtension on HostedDependency {
5050
return inlineVersion
5151
? version.toString()
5252
: {
53-
'version': version.toString(),
54-
if (hosted != null)
55-
'hosted': {
56-
'name': hosted!.declaredName,
57-
'url': hosted!.url?.toString(),
58-
},
53+
'hosted': {
54+
'version': version.toString(),
55+
if (hosted != null)
56+
'hosted': {
57+
'name': hosted!.declaredName,
58+
'url': hosted!.url?.toString(),
59+
},
60+
},
5961
};
6062
}
6163
}
6264

6365
extension GitDependencyExtension on GitDependency {
6466
Map<String, dynamic> toJson() {
6567
return {
66-
'url': url.toString(),
67-
if (ref != null) 'ref': ref,
68-
if (path != null) 'path': path,
68+
'git': {
69+
'url': url.toString(),
70+
if (ref != null) 'ref': ref,
71+
if (path != null) 'path': path,
72+
},
6973
};
7074
}
7175
}

0 commit comments

Comments
 (0)