Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar authored Nov 6, 2023
2 parents fdfed79 + 5d49c4a commit c7ccc73
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/commands/bootstrap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ project, just add the dependencies you wish to share between the packages to
your bootstrap config in your `melos.yaml` file.

If a dependency from `environment`, `dependencies` or `dev_dependencies` in
your `common_packages.yaml` exists in a package, the dependency version in this
your `melos.yaml` exists in a package, the dependency version in this
package will be updated to match the version defined in your
bootstrap config every time `melos bootstrap` is run.

Expand Down
1 change: 1 addition & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The following projects are using Melos:
- [NetGlade/auto_mappr](https://github.com/netglade/auto_mappr)
- [myConsciousness/atproto.dart](https://github.com/myConsciousness/atproto.dart)
- [GrowERP Flutter ERP](https://github.com/growerp/growerp)
- [mrverdant13/coverde](https://github.com/mrverdant13/coverde)

<Info>

Expand Down
1 change: 1 addition & 0 deletions packages/melos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ The following projects are using Melos:
- [NetGlade/auto_mappr](https://github.com/netglade/auto_mappr)
- [myConsciousness/atproto.dart](https://github.com/myConsciousness/atproto.dart)
- [GrowERP Flutter ERP](https://github.com/growerp/growerp)
- [mrverdant13/coverde](https://github.com/mrverdant13/coverde)

> Submit a PR if you'd like to add your project to the list. Update the
> [README.md](https://github.com/invertase/melos/edit/main/packages/melos/README.md)
Expand Down
4 changes: 3 additions & 1 deletion packages/melos/lib/src/common/intellij_project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ class IntellijProject {
}

String ideaModuleStringForName(String moduleName, {String? relativePath}) {
final imlPath = relativePath != null
var imlPath = relativePath != null
? p.normalize('$relativePath/$moduleName.iml')
: '$moduleName.iml';
// Use `/` instead of `\` no matter what platform is.
imlPath = imlPath.replaceAll(r'\', '/');
final module = '<module '
'fileurl="file://\$PROJECT_DIR\$/$imlPath" '
'filepath="\$PROJECT_DIR\$/$imlPath" '
Expand Down
25 changes: 25 additions & 0 deletions packages/melos/test/common/intellij_project_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,29 @@ void main() {
expect(modulesXml, contains(r'file://$PROJECT_DIR$/melos_root.iml'));
},
);

// https://github.com/invertase/melos/issues/582
test(
'always generates iml paths with `/`',
() async {
final tempDir = createTestTempDir();
final workspaceBuilder = VirtualWorkspaceBuilder(
path: tempDir.path,
'''
packages:
- .
''',
)..addPackage(
'''
name: test
''',
path: 'test',
);
final workspace = workspaceBuilder.build();
final project = IntellijProject.fromWorkspace(workspace);
await project.generate();
final modulesXml = readTextFile(project.pathModulesXml);
expect(modulesXml, contains(r'file://$PROJECT_DIR$/test/melos_test.iml'));
},
);
}

0 comments on commit c7ccc73

Please sign in to comment.