Every package is identified by { namespace, name } (TcePackageIdentifier in
@tce-v3/common). Both parts are required, real data; the loader serializes the pair as
namespace/name, and so does every registry endpoint, embed URL and manifest.
The namespace names the publisher, the way an npm scope does: two publishers may use the same
name without colliding. It is open — any string matching the
identifier pattern is a namespace — and it is never a framework-level
constant. No runtime code, bootstrap, data layer or generator may contain the literal namespace
of a particular publisher; each layer carries the namespace it was given:
config/tce.php, used only to expand the short-form routes (/tce-elements/{name},
/tce/{name}) and as the generator's default. tobidot is this site's value, not the
framework's.A package name is used directly as its HTML tag, so it must be a valid custom-element name:
lower-case letters, digits and hyphens, with at least one hyphen. The exact pattern, enforced by
the generator and the upload validation:
^[a-z][a-z0-9]*(-[a-z0-9]+)+$
Conventions on top of that rule:
tce-: tce-clock, tce-notepad, tce-explorer.dll-tce- (they never reach customElements.define, but the shape
keeps a package list readable): dll-tce-file-system, dll-tce-settings.A name is never rewritten silently: an invalid name is rejected, not prefixed or slugged.
The class behind a package is the StudlyCase form of its full name — the prefix included, so the class says what kind of thing it is:
| Name | Class |
|---|---|
tce-shape-me |
TceShapeMe |
tce-desktop |
TceDesktop |
dll-tce-file-system |
DllTceFileSystem |
The collaborators of a split element (Coding Style)
append their role: TceDesktopSettings, TceDesktopReferences, TceDesktopProperties,
TceDesktopRenderer, TceDesktopLogic. Renaming a package means renaming its class, its files
and its entry script — nothing does that automatically.
The SDK packages are published to the registry under their plain directory names (common,
desktop-protocol) and consumed from npm under the @tce-v3 scope (@tce-v3/common,
@tce-v3/desktop-protocol). config/tce.php maps the one to the other for the generator.
Both name and namespace must match
^[0-9a-zA-Z\-_]+$
This is checked by package_identifier_schema on every bind(), by
TcePackageLoader.serialize_identifier, and by the upload validation on the server. It is
deliberately looser than the tag-name rule above: a library name is never passed to
customElements.define, and a namespace is not a tag at all. An element whose name violates the
tag-name rule fails at registration time, which is why the stricter rule is enforced where names
are created — in the generator and the upload.
tce-* (element) or dll-tce-* (library), lower-case with hyphens.namespace through as data at every layer; this site's own value lives in
config/tce.php only.customElements.define(),
far from the mistake.