feature:rename

Introduction

feature:rename renames a local feature in .splent_cache, with its source package and the references inside its files. It is for a feature that has no version and no git repository yet.

splent feature:rename splent_feature_notepad splent_feature_notes
🚚 Renaming feature 'splent_feature_notepad' → 'splent_feature_notes' in namespace 'splent_io'...

âś… Rename complete!
📦 New path: /workspace/.splent_cache/features/splent_io/splent_feature_notes
🏷️  Namespace: splent_io
đź§© Product: my_first_app

📊 Summary:
   ✏️  Modified files: 7
   đź”— Symlink updated: âś…
   🗂️  pyproject.toml updated: ✅
   ⚙️  Feature was active: ✅

What it renames

  1. The folder .splent_cache/features/<namespace>/<old_name>/, and src/<namespace>/<old_name>/ inside it.
  2. The references in its .py, .html, .toml and .js files, the import path and the templates/<old_name>/ paths.
  3. The product’s link in features/<namespace>/ and its entry in features, when the selected product lists the feature under that exact name.

Every file is read before anything changes, and a failure while applying puts everything back as it was. Only the feature entry is edited in the product’s pyproject.toml. Comments, blank lines, key order and quote style stay as they were.


Choosing the namespace

splent feature:rename splent_feature_notepad splent_feature_notes --namespace splent-io

Without --namespace, the command uses SPLENT_FORGE_USER (or GITHUB_USER), otherwise splent-io.


Reference

Arguments and options

Argument / Option Description
OLD_NAME The feature’s current name
NEW_NAME The new name
-n, --namespace The feature’s namespace

Errors

Each of these exits 1 and changes nothing.

Message What to do
Feature '<name>' not found in namespace '<ns>'. Check the namespace. An editable feature at the workspace root is not looked for
A feature named '<name>' already exists in '<ns>'. Pick another name
Versioned features cannot be renamed manually. Drop the @version
Feature is linked to a Git repository; cannot rename. A feature with a .git has a remote, so this command leaves it alone
Cannot rename: <path> could not be read as UTF-8 text (...). Fix or remove that file
Rename failed (...); rolled back to '<name>'. Read the reason. The feature is as it was

When the product’s pyproject.toml cannot be edited exactly, the command warns Could not update pyproject.toml with the reason. The feature is still renamed, so edit the entry by hand.


Requirements

  • A selected product (SPLENT_APP).
  • The feature in .splent_cache/features/<namespace>/.

Back to top

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