- Python 81.9%
- JavaScript 10.3%
- HTML 4.7%
- CSS 3%
- Mako 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| frontend | ||
| src | ||
| .gitignore | ||
| COPYING | ||
| COPYING.LESSER | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
splent_feature_hubfile
The hubfile feature of a SPLENT product line.
A SPLENT feature is a Python package that a product composes with others:
its models, routes, services, templates and hooks are registered when the
product starts. What this feature provides and requires is listed in the
[tool.splent.contract] section of pyproject.toml, which
splent feature:contract --write keeps in sync with the source.
Use it in a product
splent feature:add splent_feature_hubfile
It requires auth and dataset 0.10.0 or later, and knows no file type of its
own beyond the generic one: uvl registers the UVL model. In the OpenHubs
line it is a mandatory feature of repositorio, with hubfile => auth and
hubfile => dataset, and the kinds of file a hub takes are the or-group
tipo_artefacto: uvl, and generic_files, the node of
HUBFILE_FILE_EXTENSIONS (see Configuration).
Where the files live
One storage keeps them, by key (storage.py, StorageService), never
under a path built by hand:
datasets/<dataset_id>/src/<hubfile_id> a file of a dataset
datasets/<dataset_id>/derived/<hubfile_id>/<format> what is derived from it (uvl)
uploads/<upload_id>/<staged_id> a file staged for an upload
tmp/<stamp>-<token>/ temporaries, swept once they expire
trash/<stamp>_dataset_<dataset_id>/ what a deletion took (DL-2)
A key names neither the owner nor the file, so a transfer is an UPDATE of
the dataset's owner, and a name with spaces, accents or a .. in it is
only a column. A file whose content is replaced gets a key of its own,
datasets/<id>/src/<file>-<revision>, and the old one goes once the
replacement commits, and so does what was derived from it (PB-7): until
the domain features derive it again, the file has nothing derived rather
than what came of another content. The row says where its file is (storage_key), what
was found when it moved (storage_status), what its checksum is
(checksum_algo: sha256, or md5 for the rows of uvlhub before 2.0), the
sha256 of its content whatever the checksum is (content_sha256), and its
type (artifact_type, see below).
The keys live in a backend: LocalStorageBackend, a folder,
HUBFILE_STORAGE_ROOT, by default the hubfile folder of the product's
protected uploads (PROTECTED_UPLOADS_DIR), which production mounts as a
volume. StorageBackend is the interface another one (S3) implements:
local_file downloads to a temporary file, writing uploads once the block
ends, send redirects or streams. Nothing is written over: a file is
written next to its key and renamed onto it, and a file of the store itself
(a staged upload, what a ZIP unpacked to, a mirror of the old layout) is
linked to its key rather than copied, so a hard link never changes the copy
it came from. A reader that needs a path (uvl, factlabel) gets one with
the file's extension, a link to the content.
Inside a transaction a file is placed at its key at once, and the transaction decides what stays: once it commits, the copy it came from (the staged upload) goes; if it rolls back, the file placed goes. So a committed row always has its bytes, and a refused upload leaves none. A deleted file, or every file of a deleted dataset, goes to the trash once the deletion commits, and a rollback keeps them where they were. The hubfile-created signal comes once the content is at its key.
What a publication deposits (PB-7)
StorageService.manifest(dataset, derived=False) is the list of what a
deposit of a dataset holds, from its rows, never from walking a folder:
each file at <folder of its type>/<relative path>, and with derived
what its type derives from it, at <format>/<folder>/<name>.<extension>,
sorted by that path. A file the store does not have is absent, and what
is derived and not made yet missing, so the caller decides whether to
wait or to go without (dataset's DATASET_DEPOSIT_CONTENT).
write_manifest(manifest, path) writes its ZIP whole or not at all, next to
the path and renamed onto it, and the same files make the same bytes: one
order, one time for every entry, the same permissions and compression.
dataset's publication packages every deposit this way; the downloads keep
write_archive.
Moving the layout of hubfile 0.4
hubfile 0.4 and earlier kept the files in their owner's folder. A row
without a key is still there, and is read from there until
storage-migrate moves it.
| Layout of hubfile 0.4 (under the same root) | Key |
|---|---|
user_<owner>/dataset_<id>/uvl/<directory_path>/<name> |
datasets/<id>/src/<hubfile_id> |
user_<owner>/dataset_<id>/<format>/<directory_path>/<stem>.<extension>, for glencoe (.json), dimacs (.cnf) and splot (.splx) |
datasets/<id>/derived/<hubfile_id>/<format> |
uploads/temp/<user_id>/ (outside the store, the old staging) |
not moved: nothing reads it any more |
trash/ |
stays |
splent feature:hubfile storage-migrate --dry-run -v # what would move, touching nothing
splent feature:hubfile storage-migrate # move, dataset by dataset
splent feature:hubfile storage-migrate --dataset 42
splent feature:hubfile storage-migrate --source <root>/.legacy_mirror --link
splent feature:hubfile storage-migrate --reverse # back, before returning to hubfile 0.4
Each file is checked against its row before it moves, its size and its
checksum with its algorithm, and the sha256 of its content is written down
(DM-16). It moves all the same when they differ, as mismatch; a checksum
of no known algorithm (the seeds') moves as unverified; a row whose file
is not there keeps no key, as missing, and is looked for again on the
next run; one with another file at its key, which does not match it,
keeps none either, as conflict. The command commits each dataset, so it can stop and run again: a
row with a key is done, and a file already at its key from a run cut short
is taken as it is. The files of the old layout no row names are listed and
stay. A dry run works on a database that does not have this release's
columns yet; a real run needs its migrations. A transfer of a dataset moves
its files the same way first, in its own transaction.
For the migration of uvlhub.io (MIG-05): mirror uploads/ into
<root>/.legacy_mirror/, inside the same mount as the store, and run the
command with --source and --link: each file is hard linked to its key,
the mirror stays as it is, and hubfiles.storage_status says what was
found. A file missing or in mismatch is the one to recover from Zenodo.
The migrator may write storage_key itself instead: any key under
datasets/<id>/ is read as the row says.
Configuration
Every setting has a working default, declared in [tool.splent.config]
with its type in [tool.splent.config_schema].
| Variable | Type | Bind | Default | Meaning |
|---|---|---|---|---|
HUBFILE_TASKS_MODE |
enum | deploy | "" |
How the processing of the domain features runs: thread (empty), rq or sync |
HUBFILE_STORAGE_ROOT |
str | deploy | "" |
Where the files are kept. Empty is the hubfile folder of PROTECTED_UPLOADS_DIR, where hubfile 0.4 kept them. A folder elsewhere has to be a volume too |
HUBFILE_STORAGE_BACKEND |
enum: local |
deploy | "local" |
The store that holds them |
HUBFILE_UPLOAD_EXPIRY_HOURS |
int, at least 1 |
deploy | 24 |
How long an upload under way lasts after its last file, and how old a temporary may get |
HUBFILE_FILE_EXTENSIONS |
list | derivation | [] |
The extensions of the generic file type, ["*"] for any file. Empty takes none. It has uvl = true: a list that is not empty selects the line's generic_files node (splent_framework 1.27.0 and splent_cli 1.45.0 or later) |
HUBFILE_FILE_MAX_SIZE |
size | derivation | "20M" |
The largest file of the generic type |
HUBFILE_UNPACK_ARCHIVES |
bool | derivation | true |
Whether a ZIP that comes in is unpacked into its files, its folders kept. false keeps it as a file, which a type has to take (["*"] does), within that type's largest file |
HUBFILE_ZIP_MAX_SIZE |
size | derivation | "100M" |
The largest ZIP an upload takes, before it unpacks |
HUBFILE_MAX_UNZIPPED_BYTES |
int, at least 1 |
derivation | 536870912 |
Most bytes the ZIPs of one upload may unpack to (512 MiB), checked before they unpack and counted as they do |
HUBFILE_MAX_FILES |
int, at least 1 |
derivation | 20000 |
Most files the ZIPs of one upload may hold |
HUBFILE_MAX_ZIP_RATIO |
int, at least 1 |
derivation | 200 |
Most a file of more than 1 MiB may grow from its compressed size; more is refused as a ZIP bomb |
HUBFILE_GITHUB_IMPORT |
bool | derivation | true |
Whether the upload zone imports files from a GitHub repository. false leaves out its part of the zone and its two routes |
A ZIP over any of the last three is refused, with the reason, and leaves
nothing unpacked. A size is written as 20M, 1G or a number of bytes,
and 0 means no limit. The deploy settings are each deployment's, the
derivation ones the product's, and product:validate checks a value
against its type: an extension of HUBFILE_FILE_EXTENSIONS is * or
letters, digits, ., _ and -, with or without its leading dot.
Who reads a file
A file is read by whoever may read its dataset: hubfile asks dataset's
access policy (DatasetAccessPolicy, through the service locator) on every
route that serves a file, its page, its LaTeX or its workbench content, and
anyone else gets a 404, as for a file that does not exist. The routes that
take a DOI go through the policy's lookup by DOI: a 404 for metadata a
deletion left without its dataset, and 410 (451 for a legal reason) for a
withdrawn dataset. Which files the hub takes is its registry of file types'
answer (below).
The addresses of a file
| Address | Endpoint | What it answers |
|---|---|---|
/hubfiles/raw/<id>/<name> |
raw_file |
Its content (see below) |
/hubfiles/download/<id> |
download_file |
Its content, as a download |
/doi/<doi>/files/<name> |
view_file_by_doi |
The dataset page with the file open, for a DOI |
/doi/<doi>/files/raw/<path> and .../<path>/ |
doi_file_raw |
Its content, by its path in the dataset |
/records/<public_id>/files/<name> |
view_file_by_record |
The dataset page with the file open, under the canonical landing |
/records/<public_id>/files/raw/<path> |
record_file_raw |
Its content, by its path in the dataset |
/datasets/unsynchronized/<id>/files/<file id> |
view_unsynchronized_file |
A draft's file, for whoever may read the draft |
A file's page is under its dataset's landing (HubfileService.get_hubfile_url,
files_path): /doi/<doi>/files/ for a DOI, the addresses uvlhub froze,
and /records/<public_id>/files/ for an identifier of the hub's own
(local_publication's), which answer without a session as the landing does.
A dataset with a DOI answers under /records/<public_id>/ too. A draft has
no landing, and its owner reads its files at the draft's address. The
workbench puts the page of the file it opens in the address bar, and the
dataset's landing opens the file ?file=<id> names.
A raw address answers a file as it is, on the hub's own origin, whatever its owner uploaded, so nothing a file holds runs there:
- a PDF, a PNG, a JPEG, a GIF or a WebP goes out as what it is
(
application/pdf,image/png...), by its extension, and any other file astext/plain, an HTML page or an SVG drawing included; - every answer says
X-Content-Type-Options: nosniff, so the browser guesses no other type, andContent-Security-Policy: sandbox, so what it opens runs no script and has an origin of its own; - a public file of a published dataset is open to every site, without
credentials (
Access-Control-Allow-Origin: *, D7), at its three raw addresses, and so is a redirect to where it went. A draft's file, which its owner alone reads, and a file that is not there, are not. A preflight is answered for any site.
flamapyIDE and FactLabel fetch a UVL model, which is text, from their own
sites at /hubfiles/raw/<id>/<name> (Hubfile.public_raw_url), as they
did from uvlhub.
raw_uvl and view_uvl_with_doi, the endpoints' names up to 0.9.0, still
build and answer the same addresses for url_for and for the features that
look them up (generator's seed picker); they go in the next minor.
Uploads
An upload under way has an id and a row (upload_session, uploads.py),
and each file staged in it another (staged_file), under the upload's key
(HF-4). The upload zone draws a new id, and nothing is made until its first
file comes. Each file the zone sends is checked as its type asks (below), a
ZIP unpacked within the limits of HF-2 and each file in it checked, and
what passes is staged; a file that does not pass is refused with the
reason, which the zone shows on it. The form sends the upload's id and the
parts it keeps (the files of a ZIP are one part), and dataset takes those
and nothing else, in the transaction that creates the dataset, and the
upload goes with it. The API and the import by URL stage their file in an
upload of their own, in the same transaction.
| Route | Does |
|---|---|
POST /hubfile/upload |
Stage a file (file, upload_id, uuid: the part) |
POST /hubfile/upload-github |
Stage a file of a GitHub repository (upload_id, uuid, github_url, branch, file_path) |
POST /hubfile/list-github-files |
The files of a folder of a repository the hub takes |
POST /hubfile/delete |
Take a part out (upload_id, part) |
POST /hubfile/clear_temp |
Empty the upload (upload_id) |
The two GitHub routes are there while HUBFILE_GITHUB_IMPORT is true, the
default: they are added as an app registers the blueprint
(serve_github_import), and the upload zone draws its part of the import
only then.
No GET deletes anything. Another account's upload is not there (404), and
an expired one is gone (410). An upload lasts HUBFILE_UPLOAD_EXPIRY_HOURS
after its last file came. uploads-cleanup removes the expired ones with
their files, the folders of uploads with no row, and the temporaries older
than that. Nothing runs it on a schedule, so run it from cron:
0 * * * * docker exec <web container> bash -lc 'cd /workspace && splent feature:hubfile uploads-cleanup'
An account that goes takes its uploads with it.
The file types a hub takes
artifacts.py keeps the registry (HF-5). A type is registered by the
feature that knows it, and names the configuration keys of its extensions
(whatever their case) and of its largest file:
uvl, the UVL model of the uvl feature (UVL_EXTENSIONS,UVL_MAX_SIZE), with its syntax check and its derived formats;file, any file, this feature's own (HUBFILE_FILE_EXTENSIONS,HUBFILE_FILE_MAX_SIZE), which takes nothing until a product names its extensions,["*"]for any file: what a hub without the UVL layer uses.
register_ingest_validator(type, fn) adds a check, fn(path, name)
answering what is wrong with the file; register_ingest_handler(type, fn)
runs as a file of the type joins a dataset (uvl gives a UVL model its
feature model); register_removal_handler(type, fn) runs as a file of the
type leaves a dataset that stays, before its row goes (uvl lets go of the
feature model); register_derived_format(name, extension, type) names
what a feature derives from each file of the type, so an archive of a
dataset carries it. A file every check takes is stored; one refused by any
is not, wherever it comes from: the zone, a ZIP, GitHub, an import, the
API, a replaced file or a new version.
What dataset's forms call the files of the hub, and which extensions their
file inputs take, come from the same registry: files_noun(), the noun of
the one type that takes files ("UVL files", which uvl registers) or
"files", and accept(hubfile=None), the extensions of a file's type or of
every type, both template globals (hubfile_files_noun, hubfile_accept).
A hub with HUBFILE_UNPACK_ARCHIVES = false unpacks no ZIP: a .zip is a
file like any other, staged as it came when a type takes it (the generic
type with ["*"]), and refused otherwise.
The upload zone, its help text and the request cap of the upload all come
from the same limits (upload_limits): Dropzone takes the extensions of
the types and .zip (when the hub unpacks one), refuses a file over its type's limit before sending
it, and says what each type takes. The upload route takes a request as big
as the largest file of any type or the largest ZIP, plus 1 MiB for the form
around it, and no other route does: the app's MAX_CONTENT_LENGTH stays
the cap of the rest, and one the deployment's environment sets is kept. A
body over the cap is a 413 the zone shows as the file's error. In uvlhub
that is 100 MiB and 1 MiB, so nginx's client_max_body_size needs to be
101M at least.
Copying and removing a file
dataset's new version starts as a copy of every file of the version it
comes from, and its owner adds, replaces and removes files before
publishing it (DL-4). HubfileService.copy_into(dataset_id, hubfile) adds
a copy to another dataset, in the caller's transaction: the same name,
folder, type and content, under a key of its own (StorageService.copy_key,
a hard link on a local disk), and what was derived from it
(copy_derived). It runs the type's handlers as any file that joins a
dataset does, and announces it with hubfile-created. remove(hubfile)
takes a file out of a dataset that stays: the type's removal handlers, its
view and download records and its row, and its content goes to the trash
once the removal commits. Both came in 0.8.0; dataset asks for them and
does without on an older release.
A file that was renamed
A renamed file keeps the addresses it had. hubfile_alias
(HubfileAlias, migration hubfile0004_aliases) holds the folder and the
name a file had in its dataset, compared byte for byte (utf8mb4_bin, as
the routes compare a name), and an alias goes with its file. Those old
addresses answer with a permanent redirect, 308, to the current one:
/hubfiles/raw/<id>/<old name>goes to/hubfiles/raw/<id>/<name>. It answered 400 ("Filename mismatch") before, and still does for any other name;/doi/<doi>/files/raw/<old path>/and/doi/<doi>/files/<old name>go to the file's path and name under the same DOI.
A path or a name a file of the dataset has now is that file's, whatever an
alias says, and the file is checked first: an address of a file the reader
may not read is a 404, old or new. Nothing in hubfile renames a file yet.
The migration of uvlhub 2.12 fills the table for the files it renames: of
two files on one path, the first by id keeps the path, the one v2.12
served there, and every other gets ~<id> before its extension (DM-10).
HubfileService.was_named(hubfile, name) and
renamed_from(dataset_id, path) are the lookups the routes use. Came in
0.9.0; the downgrade drops the table, and the old addresses answer 400 and
404 again.
Signals
hubfile-created is sent once a file's content is at its key (an upload,
a copy into a new version), and hubfile-viewed and hubfile-downloaded
when somebody reads one, which statistics counts as its register of use.
An account that goes
hubfile listens to auth's user-deleting: the account's visits to files and
downloads of them stay counted without it, in the same transaction as its
deletion, and its uploads under way go. The files of its drafts go with the
drafts, which dataset deletes, and so do their records.
What it adds to the dataset pages
dataset names none of the features above it. It opens slots, and this
feature fills them from hooks.py.
| Slot | What goes in |
|---|---|
dataset.form.upload |
The upload zone of the upload form: a Dropzone that stages each file in its upload as it is dropped, and the import from a GitHub repository unless HUBFILE_GITHUB_IMPORT is false, with the files an import from a URL (uvl's) staged and the upload they are in |
dataset.form.scripts |
The bundle of the upload zone, ahead of dataset's own on the upload and edit form |
dataset.view.workbench |
The file workbench: the tree of the files and the open file, its header and its views |
dataset.view.scripts |
The workbench's data and its bundle (CodeMirror, the workbench's script and styles) |
The upload zone is the provider of dataset's upload contract
(window.SPLENT.dataset.uploads, which dataset's README describes):
assets/js/upload_zone.js registers it once the zone is ready, answers
files() with Dropzone's files and their states as the contract's text
(queued, uploading, success, error, canceled) and hasErrors(),
says changed() whenever a file is added, sent, fails or is removed, and
answers manifest(), the upload and the parts the form sends.
dataset's steps ask only the contract, so this feature requires dataset
and dataset never names it. The zone needs the dataset release that opens
dataset.form.upload and defines the contract: with an earlier one the
upload step draws no zone.
A file type may check a file in the browser too, before the server checks
it again: the feature that knows the type registers a function of the
file's text, which throws what is wrong, in window.SPLENT.hubfile.fileChecks
under the type's name (uvl checks the syntax of a UVL model). The zone asks
for it when a file comes, and shows "Valid syntax" or the error on the file.
The file workbench
The workbench of the dataset page shows the files as a repository does.
The files are always in view at the left, as the tree of the folders they
came in, each a link to its page, the open one marked as the current page
(aria-current="page"), with a "Go to file" filter above them. The open
file is at the right: its header (its format, its name, its size, what can
be done with it and a Download menu with the file itself) over its views as
tabs, its code first, in a read-only CodeMirror with a copy button. On a
narrow workbench (under 640px, a container query) the tree gives way to a
list to pick a file from, above the open file.
A click on a file opens it in place and adds its page to the history, so
Back and Forward move between the files opened. In the tree the arrow keys
move between the entries and open the file they rest on, replacing the
address rather than adding one; Right and Left open and fold a folder, Home
and End go to the first and the last entry. In the filter, Down goes to the
tree, Enter opens the first match and Escape clears it. The tabs move with
Left and Right, and the view chosen last is remembered in the browser under
<storage>.view.
Whatever a kind of file adds comes from the feature that knows it, through
these slots (hooks.py), so the hub imports none of them:
| Slot | What goes in |
|---|---|
hubfile.workbench.panel(kind) |
What the workbench and the upload zone call the files of a hub whose one type is kind (None for several): {"noun", "nouns", "example", "storage", "key"}, "file", "files", a path for the GitHub import's placeholder, the prefix of the key the chosen view is remembered under, and the code view's key, the type's name. uvl's are "model" and "models", under uvlhub.wb |
hubfile.workbench.file_view(hubfile) |
How a file is shown: {"mode", "logo", "label"}, its CodeMirror mode, the logo of its format in the file's header and the name of its format. A file no feature knows is plain text under its type's label |
hubfile.workbench.export_items(selected_file) |
Entries of the Download menu (uvl: Glencoe, DIMACS, SPLOT) |
hubfile.workbench.file_urls(hubfile) |
{format: url} for those entries, and for any button marked data-workbench-format (uvl: latex) |
hubfile.workbench.actions(selected_file) |
Buttons of the file's header (uvl: "Export to LaTeX", "Open with Flamapy IDE") |
hubfile.workbench.uvl_actions(selected_file) |
The same, under the name flamapy 0.3 filled. Deprecated: it goes in the next minor |
hubfile.workbench.views(selected_file) |
Another view of the open file, a tab beside its code, the width of the workbench: {"key", "label", "panel", "actions"}, its name, the tab's words, its markup and the buttons shown beside the tabs while it is open, or a list of them (factlabel's Fact label) |
hubfile.workbench.side_panel(selected_file) |
A panel under the views, the name factlabel 0.7 filled. Deprecated: it goes in the next minor |
hubfile.workbench.dialogs(selected_file) |
The dialogs those buttons open (uvl's LaTeX export) |
hubfile.workbench.scripts(dataset) |
Scripts and styles after the workbench's bundle, before the page is ready (uvl's CodeMirror mode) |
hubfile.workbench.content(hubfile) |
Fields added to /hubfiles/<id>/workbench-content (uvl: ide_url) |
As a file opens, the header takes its name, size, logo and label, a
Download entry or a data-workbench-format button shows only when the
file has that format among its URLs, a link marked
data-workbench-href="<field>" follows that field of the file's workbench
content and hides when it has none, and an element marked
data-workbench-current-name (dataset's breadcrumb) takes the file's name.
/hubfiles/<id>/workbench-content answers the file's text as content
(uvl up to 0.5).
The page's data is a JSON script, #workbench-data (workbench_state):
the files, the open one, the code view's key, where the chosen view is
remembered and the words the script writes. The bundle reads it into
window.WORKBENCH; WORKBENCH.files lists the files and
WORKBENCH.models, the name up to 0.9.0, which factlabel 0.6 and uvl 0.2
read, is the same list, and window.workbenchCurrentFileId() names the
open one. The script sends workbench:loading and workbench:content as
a file opens, and workbench:view-shown ({key, fileId}) when a view's
tab opens: a view drawn by measuring itself, as factlabel's label is, waits
for it, since a hidden tab has no size.
The code view is keyed by the one type the hub takes (data-panel-key="uvl"
in uvlhub, file in a hub of any file), and its ids are the workbench's
own (workbench-editor, workbench-file-name, workbench-file-size,
file-tree, workbench-filter, workbench-file-select).
The LaTeX export, the UVL logo and mode and the "Open with Flamapy IDE" link were this feature's and flamapy's up to hubfile 0.5: they are the uvl feature's now, with uvlhighlight, uvl-parser and antlr4, and uvlhub's sample models and their seeder.
Frontend
Two bundles, which the SPLENT toolchain builds from frontend/package.json:
| Entry | Source | Loaded by | Ships |
|---|---|---|---|
hubfile |
assets/js/scripts.js |
dataset's upload form (dataset.form.scripts), ahead of dataset's own bundle |
Dropzone 5.9.3 (MIT) |
workbench |
assets/js/workbench.js |
the dataset page (dataset.view.scripts), after the workbench's data, with workbench.css, which the workbench links ahead of its markup |
CodeMirror 5.65.16 (MIT), its simple mode and folding addons and their stylesheets, the workbench's script (workbench_view.js) and styles (assets/css/workbench.css) |
Both libraries are npm dependencies, locked in frontend/package-lock.json,
and nothing of them is vendored or served from a CDN; they are byte for
byte the copies assets/vendor/npm held. Both bundles are classic scripts,
loaded where those copies were.
Dropzone is a singleton (Dropzone.autoDiscover makes every .dropzone
of a page a zone), so this feature is the one that bundles it, and
product:validate refuses a product where another feature bundles it too:
dataset uses the zone through the upload contract, never its own Dropzone.
The modes other features add (hubfile.workbench.scripts, uvl's mode of
UVL) load after the bundle and find CodeMirror as window.CodeMirror,
which the workbench bundle sets and
this feature declares it provides (splent.provides, CodeMirror
5.65.16); a feature that adds a mode declares it consumes it, and
product:validate checks the versions agree. The templates use the shell's
Bootstrap (bootstrap.Dropdown, bootstrap.Tooltip), its CSS and its
feather icons, declared in splent.shell.
splent feature:compile hubfile # build both, in development mode
splent feature:compile hubfile --watch # again on every change
splent feature:compile hubfile --verify # the files match assets/meta/manifest.json
splent feature:npm hubfile outdated # a newer Dropzone or CodeMirror?
Develop
splent feature:test splent_feature_hubfile
splent feature:contract splent_feature_hubfile
Release
splent feature:release splent_feature_hubfile --dry-run --bump patch
splent feature:release splent_feature_hubfile
The first command rehearses the release and changes nothing. The second publishes it to the git forge and to PyPI, and a PyPI version is permanent.