Menu

Creating Packages Ovie Lang
πŸ“°

Creating Packages Ovie Lang

DEV Community: tutorialΒ·Ovie langΒ·about 6 hours ago
#fNdAXa3P
#devtotutorial#devto#dev#value#float
Reading 0:00
15s threshold

This tutorial shows you how to create a reusable Ovie package that others can depend on.

What is a Package?

A package is a directory with an ovie.toml manifest and a src/mod.ov entry point. Other projects add it as a dependency and import from it using use package_name::symbol.

Step 1: Initialize the Package

ovie init my-math-utils

cd my-math-utils

Edit ovie.toml to describe your package:

[package]

name = "my-math-utils"

version = "0.1.0"

description = "Useful math utilities for Ovie"

authors = ["Your Name [email protected] "]

license = "MIT"

[dependencies]

no external dependencies yet

[build]

entry = "src/mod.ov"

Step 2: Write the Public API

Create src/mod.ov β€” the package entry point that re-exports your public API:

/// my-math-utils β€” Useful math utilities

///

/// # Examples

///

/// use my-math-utils::{clamp, lerp, map_range} /// ```

export use ./clamp::{clamp, clamp_f}; export use ./interpolate::{lerp, lerp_f, map_range}; export use ./stats::{mean, median, variance}; Step 3:…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.