Labs/Jetpack/JEP/31: Difference between revisions

Jump to navigation Jump to search
added more
(→‎Philosophy: reworded code reuse section)
(added more)
Line 43: Line 43:
At any time, <tt>deactivate</tt> can be entered to deactivate the environment and return the shell to its original state.
At any time, <tt>deactivate</tt> can be entered to deactivate the environment and return the shell to its original state.


== Package Management ==
== Packages ==


Packages are simply subdirectories of the <tt>packages</tt> directory, which is located in the root of the cfx repository.
Packages are simply subdirectories of the <tt>packages</tt> directory, which is located in the root of the cfx repository.


Each package directory must contain a file called <tt>package.json</tt>, which specifies package metadata.
=== Management ===


== Creating Packages ==
At the moment, package ''management'' functionality is outside the scope of cfx.  This means that it is currently the developer's responsibility to manually manage the installation, removal, and updating of packages on their own.


=== The Manifest ===
=== Structure ===


=== Tests ===
==== Manifest ====


=== Modules ===
Each package directory must contain a JSON file called <tt>package.json</tt>, which specifies package metadata.


=== Resources ===
The manifest may contain the following keys:


=== Programs ===
* <tt>name</tt> - the name of the package. The package system will only load one package with a given name. The name defaults to the name of the parent directory. If the package is ever built as an XPI, this is used as the extension's <tt>em:name</tt> element in its <tt>install.rdf</tt>.
 
* <tt>description</tt> - a String describing the package. If the package is ever built as an XPI, this is used as the extension's <tt>em:description</tt> element in its <tt>install.rdf</tt>.
 
* <tt>author</tt> - the original author of the package. The author may be a String including an optional URL in parentheses and optional email address in angle brackets. If the package is ever built as an XPI, this is used as the extension's <tt>em:creator</tt> element in its <tt>install.rdf</tt>.
 
* <tt>contributors</tt> - may be an Array of additional author Strings.
 
* <tt>id</tt> - a globally unique identifier for the package, which is usually either a String in the form of a GUID or an email address. If the package is ever built as an XPI, this is used as the extension's <tt>em:id</tt> element in its <tt>install.rdf</tt>.
 
* <tt>version</tt> - a String representing the version of the package. If the package is ever built as an XPI, this is used as the extension's <tt>em:version</tt> element in its <tt>install.rdf</tt>.
 
* <tt>dependencies</tt> - a String or Array of Strings representing package names that this package requires in order to function properly.
 
* <tt>lib</tt> - a String or Array of Strings representing top-level module directories provided in this package. Defaults to <tt>"lib"</tt>.
 
* <tt>tests</tt> - a String or Array of Strings representing top-level module directories containing test suites for this package. Defaults to <tt>"tests"</tt>.
 
* <tt>main</tt> - a String representing a top-level module directory that contains a program module. Defaults to <tt>"main"</tt>.
 
==== Modules ====
 
All modules in cfx are [http://wiki.commonjs.org/wiki/Modules/1.1 CommonJS modules].
 
==== Test Modules ====
 
==== Program Modules ====


== Building Targets ==
== Building Targets ==
== Examples ==
874

edits

Navigation menu