GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JuliaString/ModuleInterfaceTools.jl: Adds a macro (`@api`) to help manage a consistent API between multiple packages

BranchesTags
Open more actions menu

Latest commit

 

History

84 Commits
84 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
LICENSE.md
LICENSE.md
 
 
Project.toml
Project.toml
 
 
README.md
README.md
 
 

Repository files navigation

ModuleInterfaceTools

contributions welcome

Julia Version Unit Tests Coverage
Julia Latest

This provides a way of having different lists of names that you want to be part of a public API, as well as being part of a development API (i.e. functions that are not normally needed by users of a package, but are needed by a developer writing a package that depends on it). It also separates lists of names of functions, that can be extended, from names of types, modules, constants that cannot be extended, and functions that are not intended to be extended.

This is a bit of a work-in-progress, I heartily welcome any suggestions for better syntax, better implementation, and extra functionality.

@api <cmd> [<symbols>...]

 * @api list                # display information about this module's API
 * @api freeze              # use at end of module, to "freeze" API

 * @api list   <modules>... # display information about one or more modules' API
 * @api use    <modules>... # for normal use, i.e. `using`
 * @api test   <modules>... # using public and develop symbols, for testing purposes
 * @api extend <modules>... # for development, imports `base`, `public`, and `develop` lists,
 *                          # uses `define_public`and `define_develop` lists
 * @api export <modules>... # export api symbols

 * @api base     <names...> # Add functions from Base that are part of the API
 * @api public!  <names...> # Add functions that are part of the public API
 * @api develop! <names...> # Add functions that are part of the development API
 * @api public   <names...> # Add other symbols that are part of the public API (structs, consts)
 * @api develop  <names...> # Add other symbols that are part of the development API
 * @api modules  <names...> # Add submodule names that are part of the API
 * @api base!    <names...> # Conditionally import functions from Base, or define them

This also includes the @def macro, renamed as @api def which I've found very useful!

I would also like to add commands that add the functionality of @reexport, but instead of exporting the symbols found in the module(s), add them to either the public or develop list. (I had a thought that it could automatically add names that do not start with _, have a docstring, and are not exported, to the develop list, and all exported names would be added to the public list).

Another thing I'd like to add is a way of using/importing a module, but having pairs of names, for renaming purposes, i.e. something like @api use Foobar: icantreadthisname => i_cant_read_this_name which would import the variable from Foobar, but with the name after the =>.

About

Adds a macro (`@api`) to help manage a consistent API between multiple packages

Topics

apihacktoberfestjuliatools

Resources

Readme
Activity
Custom properties

Stars

9 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.