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

New blog about how to create and publish packages #295

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vinzbarbuto
Copy link
Collaborator

This PR proposes adding a blog post to the website that explains how to create and publish a package to fully leverage the potential of the Lingua Franca Package Explorer in VS Code extension


## Publishing to the Community Repository

Once you've created your package and configured the `Lingo.toml` file, you’re ready to publish it in the [Lingua Franca Packages](https://github.com/lf-pkgs) organization. Publishing your package here allows other developers to easily find, install, and use it in their projects.
Copy link
Member

Choose a reason for hiding this comment

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

I think the default workflow should be the folks publish to their own (public) repo. That will already allow for the exchange of reusable libraries. Then, later on in the description we could mention the lf-pkgs organization and getting people's repos transfered. I'm actually starting to doubt that this is the right approach at all. I think it might be better to have a lf-lang/pkgs repo with a single text file that lists all the repos. That would be super easy to build a little website around where people can search for packages (or a feature in VS Code, for that matter). In the near term, adding a package would just amount to adding the repo URL, and it would not require transferring ownership. Ownership transfer is tedious because anyone who transfers ownership would have to be a member of the lf-lang organization, which has paid seats, so this won't scale. Perhaps this blog should just omit these details? Also tagging @tanneberger for feedback on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it might be better to have a lf-lang/pkgs repo with a single text file that lists all the repos.

I agree with that, it will be easier to show the list of packages, and people in the community won’t need to ask to join the GitHub organization.

So, in this blog, I’ll leave out all the comments about the GitHub organization for now

Copy link
Member

Choose a reason for hiding this comment

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

On reflection, if we do that route, we don't even need a separate organization. We could just have a lf-lang/pkgs repo.

blog/2024-11-11-package.md Outdated Show resolved Hide resolved
By the end of this guide, you'll have a fully configured, shareable package ready to distribute within the Lingua Franca ecosystem.

## Creating a New Package
You can create a new [LF package](/docs/glossary/#package) either manually by creating an [LF file](/docs/glossary/#lf-file) or by using the [Lingo Package Manager](https://github.com/lf-lang/lingo).
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend against manually setting up a LF project/package.

And a single LF file does not classify as a package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I can add (recommended) next to Option 1, which involves using Lingo.

And a single LF file does not classify as a package.

That’s correct. In fact, there is already a link to the Glossary explaining what an LF file is. However, it serves as the starting point for creating a package, which should include additional elements (there is a definition for LF package too in the Glossary)


#### Option 1: Create a Project Using the Lingo Package Manager
1. After [installing the Lingo Package Manager](https://www.lf-lang.org/docs/installation#lingo), create an empty directory to serve as the root of your new package.
2. Open the folder in VS Code.
Copy link
Member

Choose a reason for hiding this comment

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

remove 2.) VS Code is not needed for this.

Make people aware of --platform and --language

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What should I add about --platform and --language here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused about this. --platform and --language are not documented anywhere that I could find. They are not accepted as command-line options to lingo.

blog/2024-11-11-package.md Show resolved Hide resolved
blog/2024-11-11-package.md Outdated Show resolved Hide resolved
@lhstrh lhstrh requested a review from tanneberger December 14, 2024 18:30
Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

There is a key piece of information missing here, which is how to use a package. Where would I find that information?

Also, I think the docs can be simplified quite a bit by

  1. not assuming VS Code. I.e., don't say "Go to File > New File... and select New Lingua Franca File." Just say "Create a Lingua Franca file".
  2. Give instructions only for using cargo, not manually.

I think these will result in a considerably shorter text.

By the end of this guide, you'll have a fully configured, shareable package ready to distribute within the Lingua Franca ecosystem.

## Creating a New Package
You can create a new [LF package](/docs/glossary/#package) either manually by creating an [LF file](/docs/glossary/#lf-file) or by using the [Lingo Package Manager](https://github.com/lf-lang/lingo).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can create a new [LF package](/docs/glossary/#package) either manually by creating an [LF file](/docs/glossary/#lf-file) or by using the [Lingo Package Manager](https://github.com/lf-lang/lingo).
You can create a new [LF package](/docs/glossary/#package) using the [Lingo Package Manager](https://github.com/lf-lang/lingo) (recommended) or manually by creating the required files.

blog/2024-11-11-package.md Show resolved Hide resolved
└── └── Lingo.toml # Configuration file for current package
```

#### Option 2: Create a New LF File
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### Option 2: Create a New LF File
#### Option 2: Manually Create the Required Files

When creating a new package, ensure that you follow these guidelines:

- **README.md**: Include a `README.md` file in the root directory. This should provide an overview of the package, its purpose, a description of the LF files in the `lib/` folder, and relevant user information. The `README.md` is essential for publishing your package to the community repository and must be kept up to date.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **LICENSE**: A text file giving the license terms for the package.


[lib]
name = "PackageName"
main = "./src/Main.lf"
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not clear to me what main should be for a library. Typically, a library will have multiple example programs illustrating the use of the library. What file should this point to?

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.

4 participants