product:resolve
Table of contents
Introduction
product:resolve links every feature your product declares into <product>/features/, cloning the pinned releases the cache does not have yet. It needs a selected product (SPLENT_APP). The first resolve needs the network and can take a while, and cached releases link at once.
splent product:resolve --dev
product:resolve my_first_app
Editable features (1)
✓ notes workspace root dev
Pinned features (2)
✓ shop v1.2.7 cached
✓ cache v1.2.7 cloned
Synced 3 features.
An editable feature shows workspace root, or not found. A pinned one shows its version and cached, cloned or clone failed. dev or prod marks a feature from an environment list.
product:derive runs it for you.
What it links
- An editable feature (no
@version) links to its checkout at the workspace root, as<product>/features/<namespace>/<feature>. - A pinned feature (
feature@version) links to.splent_cache/features/<namespace>/<feature>@<version>/. When the cache does not have it,feature:clonefetches it from the forge first.
Links no declared feature matches, such as another @version, are removed. New features are recorded as declared in the manifest, and the entries of features that are not declared are dropped.
When it succeeds, it also brings the product’s forge workflows in step with the features, as product:sync-template --ci would.
Repairing a cached release
A release already in the cache is compared with its tag on every resolve. A tracked file that differs, in content or in mode (a script that lost its exec bit), is restored from git and made read-only again, and the line says restored N file(s) to the release. Untracked files, such as the docker/.env a product generates, are left alone.
For a cache that is beyond repair, clone every pinned release again.
splent product:resolve --force
--force deletes each cached release and asks before each folder. Add -y to skip the questions.
When a feature cannot be linked
A feature not found, or whose clone failed, is a failure. The others are still linked, and the summary becomes X of N features synced, K failed.
The exit code is 0 unless you pass --strict, which exits 1. product:derive passes it.
Reference
| Option | Description |
|---|---|
--dev |
Resolve the base list plus features_dev |
--prod |
Resolve the base list plus features_prod |
--strict |
Exit 1 when a feature could not be linked |
--force |
Delete each cached release and clone it again, asking for each folder |
-y, --yes |
Do not ask with --force |
Without --dev or --prod it uses SPLENT_ENV, and dev when that is unset.