Skip to content

Commit be9380c

Browse files
committed
feat: rename copy-from-vendor command to copy:template for clarity
1 parent b7fef74 commit be9380c

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

.github/workflows/functional-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ jobs:
160160
echo "=== Copy From Vendor Tests ==="
161161
162162
echo "Test help command:"
163-
bin/magento mageforge:theme:copy-from-vendor --help
163+
bin/magento mageforge:copy:template --help
164164
165165
echo "Test alias help:"
166166
bin/magento theme:copy --help
167167
168168
echo "Test dry-run without required arguments (expect validation failure but command should execute):"
169-
bin/magento mageforge:theme:copy-from-vendor --dry-run || echo "Expected failure - missing or invalid arguments for copy-from-vendor"
169+
bin/magento mageforge:copy:template --dry-run || echo "Expected failure - missing or invalid arguments for copy-from-vendor"
170170
171171
echo "Test alias dry-run without required arguments (expect validation failure but alias should execute):"
172172
bin/magento theme:copy --dry-run || echo "Expected failure - missing or invalid arguments for theme:copy alias"

.github/workflows/magento-compatibility.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
bin/magento mageforge:theme:inspector --help
137137
bin/magento mageforge:hyva:compatibility:check --help
138138
bin/magento mageforge:hyva:tokens --help
139-
bin/magento mageforge:theme:copy-from-vendor --help
139+
bin/magento mageforge:copy:template --help
140140
141141
echo "Verify command aliases work:"
142142
bin/magento frontend:list --help
@@ -177,7 +177,7 @@ jobs:
177177
178178
if [ -n "$FRONTEND_FILE" ]; then
179179
echo "Test 1: Copy frontend file to frontend theme (dry-run):"
180-
bin/magento mageforge:theme:copy-from-vendor \
180+
bin/magento mageforge:copy:template \
181181
"$FRONTEND_FILE" \
182182
Magento/luma \
183183
--dry-run
@@ -189,7 +189,7 @@ jobs:
189189
190190
if [ -n "$BASE_FILE" ]; then
191191
echo "Test 2: Copy base file to frontend theme (dry-run):"
192-
bin/magento mageforge:theme:copy-from-vendor \
192+
bin/magento mageforge:copy:template \
193193
"$BASE_FILE" \
194194
Magento/blank \
195195
--dry-run
@@ -201,7 +201,7 @@ jobs:
201201
202202
if [ -n "$ETC_FILE" ]; then
203203
echo "Test 3: Verify non-view file is rejected:"
204-
if bin/magento mageforge:theme:copy-from-vendor \
204+
if bin/magento mageforge:copy:template \
205205
"$ETC_FILE" \
206206
Magento/luma \
207207
--dry-run 2>&1 | grep -q "not under a view"; then
@@ -217,7 +217,7 @@ jobs:
217217
218218
if [ -n "$FRONTEND_FILE" ]; then
219219
echo "Test 4: Verify cross-area mapping is rejected (frontend -> adminhtml):"
220-
if bin/magento mageforge:theme:copy-from-vendor \
220+
if bin/magento mageforge:copy:template \
221221
"$FRONTEND_FILE" \
222222
Magento/backend \
223223
--dry-run 2>&1 | grep -q "Cannot map file from area"; then
@@ -355,7 +355,7 @@ jobs:
355355
bin/magento mageforge:theme:inspector --help
356356
bin/magento mageforge:hyva:compatibility:check --help
357357
bin/magento mageforge:hyva:tokens --help
358-
bin/magento mageforge:theme:copy-from-vendor --help
358+
bin/magento mageforge:copy:template --help
359359
360360
echo "Verify command aliases work:"
361361
bin/magento frontend:list --help
@@ -396,7 +396,7 @@ jobs:
396396
397397
if [ -n "$FRONTEND_FILE" ]; then
398398
echo "Test 1: Copy frontend file to frontend theme (dry-run):"
399-
bin/magento mageforge:theme:copy-from-vendor \
399+
bin/magento mageforge:copy:template \
400400
"$FRONTEND_FILE" \
401401
Magento/luma \
402402
--dry-run
@@ -408,7 +408,7 @@ jobs:
408408
409409
if [ -n "$BASE_FILE" ]; then
410410
echo "Test 2: Copy base file to frontend theme (dry-run):"
411-
bin/magento mageforge:theme:copy-from-vendor \
411+
bin/magento mageforge:copy:template \
412412
"$BASE_FILE" \
413413
Magento/blank \
414414
--dry-run
@@ -420,7 +420,7 @@ jobs:
420420
421421
if [ -n "$ETC_FILE" ]; then
422422
echo "Test 3: Verify non-view file is rejected:"
423-
if bin/magento mageforge:theme:copy-from-vendor \
423+
if bin/magento mageforge:copy:template \
424424
"$ETC_FILE" \
425425
Magento/luma \
426426
--dry-run 2>&1 | grep -q "not under a view"; then
@@ -436,7 +436,7 @@ jobs:
436436
437437
if [ -n "$FRONTEND_FILE" ]; then
438438
echo "Test 4: Verify cross-area mapping is rejected (frontend -> adminhtml):"
439-
if bin/magento mageforge:theme:copy-from-vendor \
439+
if bin/magento mageforge:copy:template \
440440
"$FRONTEND_FILE" \
441441
Magento/backend \
442442
--dry-run 2>&1 | grep -q "Cannot map file from area"; then

docs/testing_copy_command.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Testing Guide: Copy From Vendor Command
22

3-
This guide describes how to test the `mageforge:theme:copy-from-vendor` command with different theme types and scenarios.
3+
This guide describes how to test the `mageforge:copy:template` command with different theme types and scenarios.
44

55
## Automated Tests
66

@@ -26,7 +26,7 @@ ddev magento setup:upgrade
2626

2727
```bash
2828
# Test with view/frontend file
29-
ddev magento mageforge:theme:copy-from-vendor \
29+
ddev magento mageforge:copy:template \
3030
vendor/magento/module-catalog/view/frontend/templates/product/list.phtml \
3131
Magento/luma \
3232
--dry-run
@@ -38,7 +38,7 @@ ddev magento mageforge:theme:copy-from-vendor \
3838

3939
```bash
4040
# Test with view/base file (should work with frontend theme)
41-
ddev magento mageforge:theme:copy-from-vendor \
41+
ddev magento mageforge:copy:template \
4242
vendor/magento/module-theme/view/base/web/css/print.css \
4343
Magento/blank \
4444
--dry-run
@@ -50,7 +50,7 @@ ddev magento mageforge:theme:copy-from-vendor \
5050

5151
```bash
5252
# Test with Hyvä-specific file
53-
ddev magento mageforge:theme:copy-from-vendor \
53+
ddev magento mageforge:copy:template \
5454
vendor/hyva-themes/magento2-default-theme/Magento_Catalog/templates/product/list/item.phtml \
5555
Hyva/default \
5656
--dry-run
@@ -64,7 +64,7 @@ ddev magento mageforge:theme:copy-from-vendor \
6464

6565
```bash
6666
# Test with view/adminhtml file
67-
ddev magento mageforge:theme:copy-from-vendor \
67+
ddev magento mageforge:copy:template \
6868
vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml \
6969
Magento/backend \
7070
--dry-run
@@ -76,7 +76,7 @@ ddev magento mageforge:theme:copy-from-vendor \
7676

7777
```bash
7878
# Test with view/base file (should work with adminhtml theme)
79-
ddev magento mageforge:theme:copy-from-vendor \
79+
ddev magento mageforge:copy:template \
8080
vendor/magento/module-ui/view/base/web/js/grid/columns/column.js \
8181
Magento/backend \
8282
--dry-run
@@ -90,7 +90,7 @@ ddev magento mageforge:theme:copy-from-vendor \
9090

9191
```bash
9292
# This should FAIL with clear error message
93-
ddev magento mageforge:theme:copy-from-vendor \
93+
ddev magento mageforge:copy:template \
9494
vendor/magento/module-catalog/view/frontend/templates/product/list.phtml \
9595
Magento/backend \
9696
--dry-run
@@ -102,7 +102,7 @@ ddev magento mageforge:theme:copy-from-vendor \
102102

103103
```bash
104104
# This should FAIL with clear error message
105-
ddev magento mageforge:theme:copy-from-vendor \
105+
ddev magento mageforge:copy:template \
106106
vendor/magento/module-backend/view/adminhtml/templates/dashboard.phtml \
107107
Magento/luma \
108108
--dry-run
@@ -114,7 +114,7 @@ ddev magento mageforge:theme:copy-from-vendor \
114114

115115
```bash
116116
# This should FAIL with clear error message
117-
ddev magento mageforge:theme:copy-from-vendor \
117+
ddev magento mageforge:copy:template \
118118
vendor/magento/module-catalog/etc/di.xml \
119119
Magento/luma \
120120
--dry-run
@@ -126,7 +126,7 @@ ddev magento mageforge:theme:copy-from-vendor \
126126

127127
```bash
128128
# This should FAIL with clear error message
129-
ddev magento mageforge:theme:copy-from-vendor \
129+
ddev magento mageforge:copy:template \
130130
vendor/magento/module-catalog/view/frontend/templates/nonexistent.phtml \
131131
Magento/luma \
132132
--dry-run
@@ -140,7 +140,7 @@ ddev magento mageforge:theme:copy-from-vendor \
140140

141141
```bash
142142
# Test interactive theme selection (omit theme argument)
143-
ddev magento mageforge:theme:copy-from-vendor \
143+
ddev magento mageforge:copy:template \
144144
vendor/magento/module-catalog/view/frontend/templates/product/view.phtml \
145145
--dry-run
146146

@@ -157,7 +157,7 @@ ddev magento mageforge:theme:copy-from-vendor \
157157

158158
```bash
159159
# Copy a file that doesn't exist in theme yet
160-
ddev magento mageforge:theme:copy-from-vendor \
160+
ddev magento mageforge:copy:template \
161161
vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar.phtml \
162162
Magento/luma
163163

@@ -171,7 +171,7 @@ ddev magento mageforge:theme:copy-from-vendor \
171171

172172
```bash
173173
# Copy to same location again
174-
ddev magento mageforge:theme:copy-from-vendor \
174+
ddev magento mageforge:copy:template \
175175
vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar.phtml \
176176
Magento/luma
177177

@@ -238,16 +238,16 @@ The command should be tested in CI/CD pipeline:
238238
- name: Test Copy Command
239239
run: |
240240
# Test basic functionality
241-
bin/magento mageforge:theme:copy-from-vendor --help
241+
bin/magento mageforge:copy:template --help
242242
243243
# Test dry-run mode
244-
bin/magento mageforge:theme:copy-from-vendor \
244+
bin/magento mageforge:copy:template \
245245
vendor/magento/module-catalog/view/frontend/templates/product/list.phtml \
246246
Magento/luma \
247247
--dry-run
248248
249249
# Test error handling
250-
if bin/magento mageforge:theme:copy-from-vendor \
250+
if bin/magento mageforge:copy:template \
251251
vendor/magento/module-catalog/etc/di.xml \
252252
Magento/luma \
253253
--dry-run 2>&1 | grep -q "not under a view"; then
@@ -285,7 +285,7 @@ For large files or batch operations:
285285

286286
```bash
287287
# Time the operation
288-
time ddev magento mageforge:theme:copy-from-vendor \
288+
time ddev magento mageforge:copy:template \
289289
vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml \
290290
Magento/luma \
291291
--dry-run
@@ -302,7 +302,7 @@ After each deployment or environment update:
302302
ddev magento dev:tests:run unit vendor/openforgeproject/mageforge/Test/
303303

304304
# Run smoke test
305-
ddev magento mageforge:theme:copy-from-vendor \
305+
ddev magento mageforge:copy:template \
306306
vendor/magento/module-theme/view/frontend/templates/page/copyright.phtml \
307307
Magento/luma \
308308
--dry-run

src/Console/Command/Theme/CopyFromVendorCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function __construct(
5050
*/
5151
protected function configure(): void
5252
{
53-
$this->setName($this->getCommandName('theme', 'copy-from-vendor'))
53+
$this->setName($this->getCommandName('copy', 'template'))
5454
->setDescription('Copy a file from vendor/ to a specific theme with correct path resolution')
55-
->setAliases(['theme:copy'])
55+
->setAliases(['copy:template'])
5656
->addArgument('file', InputArgument::REQUIRED, 'Path to the source file (vendor/...)')
5757
->addArgument('theme', InputArgument::OPTIONAL, 'Target theme code (e.g. Magento/luma)')
5858
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Preview the copy operation without performing it');

0 commit comments

Comments
 (0)