[][src]Crate sliderule

Sliderule is an implementation of the Distributed OSHW (Open Source Hardware) Framework (DOF) being developed by Mach 30 Foundation for Space Development.

Sliderule wraps the git and npm commands and uses them to manage DOF/Sliderule projects, both on the local file system, and on a remote server. At this time only structure management is provided, there is no capability to render models for documentation like assembly instructions out into their distributable form.

Central to understanding Sliderule is the concept of local and remote components. Local components are stored with a project, which is the top-level, enclosing component. Local components do not have a repository associated with them, they are only stored in the components directory of a project. Remote components, on the other hand, are stored in a remote repository, and are only installed into the local file system if the user requests it. Remote components are intended to be shared, local components are intended to only be used within their parent project. A local component can be converted into a remote component later, if desired.

The following is a list of the major operations available through this crate.

  • create - Creates a top level component unless creating a component inside of an existing component. In that case the new component is placed within the components directory of the parent "project" component.
  • add - Adds a remote component from a repository into the node_modules directory of the current component.
  • download - Downloads a copy of a component form a remote repository.
  • update - Downloads the latest changes to the component and/or its remote components (dependencies)
  • remove - Removes a component, whether it is local or remote.
  • upload - Uploads component changes on the local file system to its remote repository.
  • refactor - Converts a local component to a remote component so that it may be more easily shared.

There are also various helper functions to do things like getting what level a component is in a hierarchy and compiling the licenses of all components in a project.

Modules

git_sr
npm_sr
templates

Structs

SROutput

Functions

add_remote_component

Adds a component from the remote repository at the provided URL to the node_modules directory.

change_licenses

Allows the user to change the source and/or documentation licenses for the project.

create_component

Creates a new component or converts an existing directory into a component.

download_component

Downloads a copy of a component from the remote repository at the specified URL.

get_level

Figures out and returns what depth within another component's hierarchy the component is at. 0 = A top level component is probably being created 1 = A top level component with no parent 2 = A sub-component at depth n

get_licenses

Extracts the source and documentation licenses from a component's .sr file.

list_all_licenses

Prints out each of the licenses in the component's directory tree so that users can see what licenses are in use and where they reside.

refactor

Converts a local component into a remote component, uploading it to the remote repo and then installing via npm.

remove

Removes a component (local or remote) from the project directory structure.

remove_remote_component

Removes a remote component via the name.

update_dependencies

Updates all remote component in the node_modules directory.

update_local_component

Downloads updates from the remote repository that is set for this directory.

upload_component

Uploads any changes to the project/component to a remote repository.