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

feat: create and manage the .wws.toml file and its metadata #75

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

Angelmmiguel
Copy link
Contributor

@Angelmmiguel Angelmmiguel commented Jan 26, 2023

The .wws.toml file includes information about the required runtimes for a specific project. It will allow other developers to quickly install these dependencies when pulling a new wws project.

In this PR, I moved the existing Config struct that referenced to workers configuration into the workers module. Then, I created a new Config fiel to refer to the .wws.toml file. The struct implements some of the methods thart will be required to interact with this file like:

  • load
  • save
  • save_runtime
  • remove_runtime

Example

let mut config = config::Config::load(&args.path).unwrap();
let repo = Repository::from_remote_file(
    "https://raw.githubusercontent.com/Angelmmiguel/wws-index-test/main/index.toml",
)
.await
.unwrap();

let runtime = repo.runtimes.first().unwrap();

config.remove_runtime("wlr", runtime);
config.save(&args.path).unwrap();

It closes #67

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Jan 26, 2023
@Angelmmiguel Angelmmiguel added this to the v1.0.0 milestone Jan 26, 2023
@Angelmmiguel Angelmmiguel requested a review from a team January 26, 2023 12:09
@Angelmmiguel Angelmmiguel self-assigned this Jan 26, 2023
@Angelmmiguel
Copy link
Contributor Author

This API is not exposed yet to devs, so I'm gonna merge these changes to continue with #63. Feel free to add any comment to this PR and I will apply them in a new one 😄

@Angelmmiguel Angelmmiguel merged commit e2bcf3f into main Jan 27, 2023
@Angelmmiguel Angelmmiguel deleted the 67-implement-wws-file branch May 8, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the .wws.toml file
2 participants