Skip to content

Commit b07eab4

Browse files
committed
Improved Publishing a Package section
1 parent 1d290d0 commit b07eab4

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

blog/2024-11-11-package.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ authors: [vinzbarbuto]
55
tags: [packages, packaging, lingua franca, docs]
66
---
77

8-
The Lingua Franca (LF) [Package Explorer](/docs/tools/code-extension#package-explorer) is a new feature within the Lingua Franca Visual Studio Code extension, built to streamline package management for developers. Supporting both local and remote sources, the Package Explorer enables effortless listing and management of packages—whether defined locally by developers or installed through the Lingo Package Manager. This integration aligns with the Lingua Franca communitys vision for a collaborative and reusable ecosystem. Developers can create and publish their own packages, enabling others to easily incorporate these resources into their projects. This collaborative model not only enhances programmability and accelerates product development but also simplifies the design of complex Lingua Franca applications.
8+
The Lingua Franca (LF) [Package Explorer](/docs/tools/code-extension#package-explorer) is a new feature within the Lingua Franca Visual Studio Code extension, built to streamline package management for developers. Supporting both local and remote sources, the Package Explorer enables effortless listing and management of packages—whether defined locally by developers or installed through the Lingo Package Manager. This integration aligns with the Lingua Franca community's vision for a collaborative and reusable ecosystem. Developers can create and publish their own packages, enabling others to easily incorporate these resources into their projects. This collaborative model not only enhances programmability and accelerates product development but also simplifies the design of complex Lingua Franca applications.
99

1010
{/* truncate */}
1111

12-
In this guide, well walk you through the essential steps to create and publish a package to the community repository, covering:
12+
In this guide, we'll walk you through the essential steps to create and publish a package to the community repository, covering:
1313

1414
1. [**Creating a New Package**](#creating-a-package)
1515
Get started by setting up your package with the required files and directory structure to meet Lingua Franca standards.
@@ -25,7 +25,7 @@ By the end of this guide, you'll have a fully configured, shareable package read
2525
## Creating a New Package
2626
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).
2727

28-
#### Option 1: Create a Project Using the Lingo Package Manager (Recommended)
28+
#### Option 1: Create a project using the Lingo Package Manager (recommended)
2929
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.
3030
2. Open the terminal in this folder and run the <kbd>lingo init</kbd> command.
3131

@@ -38,7 +38,7 @@ This will set up a new LF package with the following structure:
3838
└── └── Lingo.toml # Configuration file for current package
3939
```
4040

41-
#### Option 2: Manually Create the Required Files
41+
#### Option 2: Manually create the required files
4242
1. Go to <kbd>File > New File...</kbd> and select `New Lingua Franca File`.
4343
2. Save the file in a directory called `src` to ensure that generated code is placed in a parallel `src-gen` directory. For example, if your file is called `Foo.lf`, the directory structure after building will look like this:
4444

@@ -55,7 +55,7 @@ This will set up a new LF package with the following structure:
5555

5656
If you manually create the `Lingo.toml` file, place it adjacent to the `src` folder in the root directory of the package. This file serves as a configuration for the package, allowing you to specify the package name, version, and other metadata, including any dependencies you want to install.
5757

58-
### Add `src/lib/` for Local Libraries
58+
### Add `src/lib/` for local libraries
5959

6060
To include local libraries in your Lingua Franca project, create a `lib` directory within the `src/` folder and place your LF files there. These files contain reusable reactors that can be used within the same package or, if published, in other packages via the Lingo Package Manager. The `src/lib` directory is the default location for Lingua Franca files your project exports, enabling other libraries to use them. This setup simplifies managing and reusing libraries across Lingua Franca projects.
6161

@@ -75,7 +75,7 @@ The `lib` directory should be placed alongside the `src` directory, organized as
7575

7676
In LF, there is no visibility control, meaning you cannot mark a reactor or file as `private` as in other programming languages. The `private` directory serves this purpose by containing files meant solely for internal package use. Files in this directory are hidden in the Package Explorer within the VS Code extension, making them inaccessible to other packages. The `private` directory is useful for implementing design patterns like the Abstract Factory Pattern, which provides an interface for creating families of related objects without specifying concrete classes. For example, a developer might define an `AbstractLibraryFile.lf` containing abstract reactors and implement them in various ways within different files under the `lib` directory.
7777

78-
### Must-Follow Guidelines
78+
### Must-follow guidelines
7979

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

@@ -122,16 +122,30 @@ Publishing your package makes it accessible to other developers, enabling them t
122122

123123
Follow these steps to publish your package:
124124

125-
#### 1. Push Your Package to Your GitHub Repository
125+
#### 1. Push your package to your GitHub repository
126126
Upload your package to your own (public) GitHub repository. This allows you to share it immediately.
127127

128-
#### 2. Follow the `<name>-<target>` Naming Scheme
128+
#### 2. Follow the `<name>-<target>` naming scheme
129129
Name your repository using the format `<name>-<target>`. For example, `package-python`.
130130
- Use lowercase letters and hyphens.
131131
- Ensure `<name>` is descriptive and unique.
132132
- Specify `<target>` as the package's target language.
133133

134-
#### 3. Add the Maintainer's Name to the Repository Description
135-
This helps others know who to contact for questions or assistance.
134+
#### 3. Add the maintainer's name to the repository description
135+
This helps others know who to contact for questions or assistance.
136+
137+
#### 4. List the package in the Lingua Franca Package Registry
138+
139+
After publishing your package, you can make it discoverable by listing it in the [Lingua Franca Package Registry](https://github.com/lf-lang/pkgs). To add your package:
140+
141+
1. Fork the [pkgs](https://github.com/lf-lang/pkgs) repository
142+
2. Find the appropriate target language section in `README.md` (e.g., C, Cpp, Python)
143+
3. Add your package entry in alphabetical order using this format:
144+
145+
```
146+
- [package-name](link-to-repository)
147+
```
148+
149+
4. Submit a pull request to the `pkgs` repository for review
136150

137151
By following these steps, you ensure your package is properly organized and ready for community use.

0 commit comments

Comments
 (0)