feature:order

Show the topological load order of features in the active product, resolved against UVL dependency constraints.


Table of contents

  1. Usage
  2. Options
  3. Example output
  4. Description
  5. How the order is resolved
  6. Reverse dependencies
  7. Circular dependency detection
  8. Requires column
  9. JSON output
  10. Requirements
  11. See also

Usage

splent feature:order [--json] [--no-namespace] [--no-version] [--short] [--reverse <feature>]

Options

Option Description
--json Output the resolved order as a JSON array.
--no-namespace Hide the org/ prefix from feature names.
--no-version Hide the @vX.Y.Z suffix from feature names.
--short Shorthand for --no-namespace --no-version.
--reverse <feature> Show what would break if this feature were removed (reverse dependency closure).

Example output

splent feature:order
  Feature load order — sample_splent_app
  ──────────────────────────────────────────────────────────────────
  #    Feature                                      Requires
  ──────────────────────────────────────────────────────────────────
  1    splent-io/splent_feature_redis@v1.2.7        —
  2    splent-io/splent_feature_public@v1.2.7       —
  3    splent-io/splent_feature_mail@v1.2.7         —
  4    splent-io/splent_feature_confirmemail@v1.2.7 splent_feature_mail
  5    splent-io/splent_feature_auth@v1.2.7         —
  6    splent-io/splent_feature_profile@v1.2.7      splent_feature_auth
  7    splent-io/splent_feature_reset@v1.2.7        splent_feature_mail

  UVL: sample_splent_app.uvl
splent feature:order --short
  Feature load order — sample_splent_app
  ──────────────────────────────────────────────────────
  #    Feature                            Requires
  ──────────────────────────────────────────────────────
  1    splent_feature_redis               —
  2    splent_feature_public              —
  3    splent_feature_mail                —
  4    splent_feature_confirmemail        splent_feature_mail
  5    splent_feature_auth                —
  6    splent_feature_profile             splent_feature_auth
  7    splent_feature_reset               splent_feature_mail

  UVL: sample_splent_app.uvl

Description

Reads the feature list from the active product’s pyproject.toml and reorders it using a stable Kahn topological sort driven by the UVL constraints (profile => auth, confirmemail => mail, etc.).

This is exactly the order used by:

  • FeatureManager when registering blueprints at Flask startup
  • db:seed when running seeders

If no UVL file exists or contains no applicable constraints, the order falls back to the declaration order in pyproject.toml.


How the order is resolved

The UVL constraint A => B means “A requires B”. The resolver guarantees that B appears before A in the load order. Independent features preserve their original pyproject.toml order (stable sort).

Example: with constraints profile => auth and confirmemail => mail:

pyproject.toml order:   redis, public, mail, confirmemail, auth, profile, reset
resolved order:         redis, public, mail, confirmemail, auth, profile, reset
                                              ↑ before profile  ↑ before reset

Reverse dependencies

Use --reverse to find out what would break if you removed a feature:

splent feature:order --reverse auth
  Reverse dependencies — sample_splent_app
  UVL: sample_splent_app.uvl

  ⚠ Removing splent_feature_auth would break 2 feature(s):

    • splent_feature_profile  (direct)
    • splent_feature_notes  (direct)

If no features depend on it:

splent feature:order --reverse redis
  Reverse dependencies — sample_splent_app
  UVL: sample_splent_app.uvl

  ✓ No features depend on splent_feature_redis.
  It can be safely removed.

Accepts both short (auth) and full names (splent_feature_auth). The closure is transitive: if A depends on B and B depends on C, --reverse C shows both A and B, distinguishing direct from transitive dependencies.


Circular dependency detection

If the constraints form a cycle, the command aborts with an error:

❌ Circular dependency detected among features: ['auth', 'profile'].
   Review the 'constraints' section in your .uvl file.

Requires column

The Requires column shows direct dependencies read from the UVL constraints (A => B means A requires B). This is always available as long as the UVL file is present — no feature:release needed.


JSON output

splent feature:order --json
[
  {
    "position": 1,
    "feature": "splent-io/splent_feature_redis@v1.2.7",
    "namespace": "splent-io",
    "name": "splent_feature_redis",
    "version": "v1.2.7",
    "requires": []
  },
  {
    "position": 6,
    "feature": "splent-io/splent_feature_profile@v1.2.7",
    "namespace": "splent-io",
    "name": "splent_feature_profile",
    "version": "v1.2.7",
    "requires": ["splent_feature_auth"]
  }
]

Requirements

  • A product must be selected (splent product:select).
  • SPLENT_APP must be set.
  • The UVL file must exist at uvl/<product_name>.uvl for constraint resolution (optional — falls back gracefully).

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es