Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ - Use package.path instead of manually constructing path part 2 #87

Merged

Conversation

DZakh
Copy link
Contributor

@DZakh DZakh commented Feb 25, 2024

It's a continuation of the change 1647b2a

I recreated the changes of the PR #84, because it was easier than solving merge conflicts. Also, I didn't include the change where I start resolving path differently to support pnpm, I want to do it in a separate PR, since this one is already quite big.

@@ -7,15 +7,17 @@ use regex::Regex;
use std::fs::File;
use std::io::prelude::*;

use super::packages;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok? For logger to depend on packages doesn't look very nice, but here it actually makes sense.

Comment on lines +65 to +82
impl Package {
pub fn get_bs_build_path(&self) -> String {
format!("{}/lib/bs", self.path)
}

pub fn get_build_path(&self) -> String {
format!("{}/lib/ocaml", self.path)
}

pub fn get_mlmap_path(&self) -> String {
self.get_build_path()
+ "/"
+ &self
.namespace
.to_suffix()
.expect("namespace should be set for mlmap module")
+ ".mlmap"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should I keep these functions in helpers.rs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this is much nicer. I wanted to do this myself for some of the helpers that relate to structs. When I wrote some of the code I was still learning Rust :)

@DZakh DZakh mentioned this pull request Feb 25, 2024
@jfrolich
Copy link
Collaborator

The code looks great. I also tested it on our monorepo, and I couldn't find any obvious issues. LGTM!

@DZakh
Copy link
Contributor Author

DZakh commented Mar 6, 2024

@jfrolich What about merging. I'd like to continue working on pnpm support

@jfrolich
Copy link
Collaborator

jfrolich commented Mar 6, 2024

I think you can merge?

@DZakh
Copy link
Contributor Author

DZakh commented Mar 6, 2024

No, only the maintainers of the repo can merge

@DZakh
Copy link
Contributor Author

DZakh commented Mar 6, 2024

image

@tsnobip
Copy link
Contributor

tsnobip commented Mar 7, 2024

I would also appreciate if it could be merged and released, can't wait to try it on my setup!

@DZakh
Copy link
Contributor Author

DZakh commented Mar 7, 2024

@tsnobip this is not a fix yet, but one step closer to it 😁

@jfrolich jfrolich merged commit 8012191 into rescript-lang:master Mar 7, 2024
1 check passed
@jfrolich
Copy link
Collaborator

jfrolich commented Mar 7, 2024

sorry for the confusion, we should make it possible to merge after approval. Merged now!

@jfrolich
Copy link
Collaborator

jfrolich commented Mar 7, 2024

@rolandpeelen let's make @DZakh a maintainer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants