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
- The folder
.splent_cache/features/<namespace>/<old_name>/, andsrc/<namespace>/<old_name>/inside it. - The references in its
.py,.html,.tomland.jsfiles, the import path and thetemplates/<old_name>/paths. - The product’s link in
features/<namespace>/and its entry infeatures, 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.tomlcannot be edited exactly, the command warnsCould not update pyproject.tomlwith 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>/.