-
Notifications
You must be signed in to change notification settings - Fork 123
Module Naming Conventions
Def. 1: An Amber Module is a collection of one or more Amber packages (each in its .st and .js file), located in one repository.
Conclusion 1: If an Amber Module is published in bower, the whole content is accessible via single bower name.
Note 1: Conclusion 1 is unidirectional. There can be a repo that hosts more modules.
In the majority of cases, an Amber Module contains one namespace, though it can contain more if desired. Amber core itself is such an Amber Module (it contains the amber
and amber_core
namespaces). Having more namespaces should be rare in bite-sized modules, it may be not so rare for large frameworks, though they are also encouraged to split to more distinct pieces.
This document gives recommendations on how to choose module bower names, namespaces and packages. It will only cover one-namespace modules.
There are three categories of Amber modules:
-
Amber core itself - this is the
amber
repository itself. - Amber-contrib modules - these are library modules that are maintained by the Amber team as part of the basic Amber system. If the Amber team maintains an app (Helios is an example), it should be treated as a userland module.
- Userland modules - the rest, not part of the contrib nor the core, governed by their respective contributors,
-
bower name:
amber
-
repo:
amber-smalltalk/amber
-
namespace(s):
amber
is the namespace reserved for Amber core, as well as any namespace beginning withamber_
, at the momentamber_core
andamber_cli
are used -
package(s): Mostly two-word, dash separated, from
Kernel-Xxx
,Compiler-Xxx
orPlatform-Xxx
group, though non-dashed ones are also present.Kernel-Xxx
should all be in Amber core, others may be partly moved to contrib modules.
The status quo is chaotic for contrib modules. None of them are in bower outside the incubator space in Amber repo itself, in the contrib
directory. Namespaces are too long atm, like amber-contrib-web
. Some other candidates for contrib, like domite
have one-word namespace.
This is a proposal for a consistent naming of contrib modules.
-
bower name: if not part of
amber
, useamber-contrib-foo
-
repo: if not part of
amber-smalltalk/amber
, useamber-smalltalk/amber-contrib-foo
-
namespace(s):
amber/foo
- package(s): See below in userland modules.
Note: amber-compat-xxx
modules are also forming a distinct group, similar to contrib modules. But these are often not the typical package containers, they are more infrastructure hacks. For these, the the status quo should be preserved: amber-compat-bar
as bower name, repo name and namespace, should they need one, at the same time.
Status quo is less chaotic mostly people either adopt amber init
-proposed amber-foo
, or just use the shortname
. This is what is proposed here, as well.
-
bower name: Use
amber-foo
orfoo
. If "foo" is too generic, lean towards the former -
repo:
owner/amber-foo
orowner/foo
, depending on previous line -
namespace(s):
amber-foo
orfoo
, copying the first line -
package(s): Use standard Smalltalk conventions using common prefix:
Foo
,Foo-DistinctPart
etc. withFoo-Tests
orFooTests
. If you wrap a known JS library, it is recommended that prefix beWrappers-JSLib
(as is used inWrappers-JQuery
atm).