@cxtms/cx-schema 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -110,13 +110,18 @@ npx cx-cli create module "Country" --template select --options '{
|
|
|
110
110
|
|
|
111
111
|
## Extract Command
|
|
112
112
|
|
|
113
|
-
Move a component (and its routes) from one module into another. Useful for splitting large modules
|
|
113
|
+
Move or copy a component (and its routes) from one module into another. Useful for splitting large modules or sharing components.
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
116
|
cx-cli extract <source-file> <component-name> --to <target-file>
|
|
117
|
+
cx-cli extract <source-file> <component-name> --to <target-file> --copy
|
|
117
118
|
```
|
|
118
119
|
|
|
119
|
-
###
|
|
120
|
+
### Flags
|
|
121
|
+
- `--to <file>` — target module file (required)
|
|
122
|
+
- `--copy` — copy instead of move (source keeps the component, target gets a higher-priority copy)
|
|
123
|
+
|
|
124
|
+
### What Gets Moved/Copied
|
|
120
125
|
- The component matching the exact `name` field
|
|
121
126
|
- Any routes whose `component` field matches the component name
|
|
122
127
|
- Permissions and entities are **NOT** moved
|
|
@@ -124,9 +129,12 @@ cx-cli extract <source-file> <component-name> --to <target-file>
|
|
|
124
129
|
### Examples
|
|
125
130
|
|
|
126
131
|
```bash
|
|
127
|
-
#
|
|
132
|
+
# Move a component to a new file (creates module scaffold automatically)
|
|
128
133
|
npx cx-cli extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml
|
|
129
134
|
|
|
135
|
+
# Copy a component (source unchanged, target gets higher priority)
|
|
136
|
+
npx cx-cli extract modules/orders.yaml Orders/CreateItem --to modules/order-create.yaml --copy
|
|
137
|
+
|
|
130
138
|
# Extract to an existing module
|
|
131
139
|
npx cx-cli extract modules/main.yaml Dashboard --to modules/dashboard.yaml
|
|
132
140
|
```
|