Package Environment
February 14, 2013 ยท View on GitHub
A package environment is created by the presence of a package.json file.
Each package has a workspace which is used to make changes to the package.
To run a package see System.
Workspace
To enter a workspace:
sm switch <uri>
This will provide a console environment with the following features:
- Colored and named workspace prompt to identify workspace and indicate status (NYI).
./binand.sm/binonPATH.- Environment variables:
SM_HOMEpath to root directory of toolchain (package withsmas dependency typically at~/.sm).SM_WORKSPACE_HOMEpath to root of workspace.PINF_PROGRAMa local filesystem path to aprogram.jsonfile (how to boot).PINF_PACKAGEa local filesystem path to apackage.jsonfile (what to boot).PINF_RUNTIMEa local filesystem path to aprogram.rt.jsonfile (the state to boot in).PINF_MODEthe mode the runtime should run it. Will loadprogram.$PINF_MODE.json.
It will also provide a UI environment if the Package Descriptor declares the following scripts:
start-workspace- Called onsm switchand intended to start a workspace server & dev UI.stop-workspace- Called onexitaftersm switchand intended to stop the workspace server & dev UI.
Package
Defaults:
require("<depAlias>/<moduleId>")will resolve to./lib/<moduleId>.<engineExtension>if<moduleId>does not end in.<engineExtension>.require("<depAlias>/<moduleId>.<ext>")will resolve to./<moduleId>.<ext>.package.json ~ scripts.install = "<command>"is called after all dependencies are resolved and is intended to compile the package..distignoreholds the git like ignore rules to describe the minimal complete featureset of the package needed during runtime..rtholds program state data typically generated after callingsm runto run the program.
Recommendations:
.gitignoreshould contain:.sm/node_modules/ormapped_packages/depending on platform.
See Platforms and Engines for <platform*> and <engine*> defaults and specific details.
For more information about package.json see Package Descriptor.