Commit de57937
authored
Make the
## Related issues
<!--
Link a related issue to this PR. If the PR does not immediately resolve
the issue,
for example, it requires a separate deployment to production, avoid
using the "Fixes" keyword and use "Related to" instead.
-->
- Fixes STU-1814
## How AI was used in this PR
<!--
Help reviewers understand what to look for and verify that you've
reviewed the code yourself.
-->
I used Claude to help me with the initial implementation. Then I had to
slow down to understand the `pull-reprint` architecture and the changes
that Claude made. I went through a few rounds of iterations by hand and
with Claude before reaching the final state.
## Proposed Changes
<!--
Explain the intent of this PR:
- What problem does it solve, or what need does it address?
- How does it affect the user (new capability, fix, performance,
accessibility, etc.)?
- Note any user-visible behavior changes or trade-offs.
Focus on the "why" and the user impact. Avoid listing modified files or
describing implementation mechanics — the diff already shows that.
-->
The `pull-reprint` command comes with more assumptions about the PHP
runtime than most other Studio features do. The prime example is how it
uses PHP-WASM-based parsing to extract constants from `runtime.php`.
Studio now has two PHP runtimes, and native PHP is slated to become the
new default shortly. This PR makes the `pull-reprint` command work with
native PHP. This implementation does not cover all bases, but it works
when pulling a typical WordPress.com site. We'll keep iterating to
refine the experience.
## Testing Instructions
<!--
Add as many details as possible to help others reproduce the issue and
test the fix.
"Before / After" screenshots can also be very helpful when the change is
visual.
-->
1. Run `npm run cli:build`
2. Run `STUDIO_ENABLE_PULL_REPRINT=1 STUDIO_RUNTIME=native-php node
apps/cli/dist/cli/main.mjs pull-reprint`
3. Ensure that you can successfully complete a pull, that the site
starts and works
## Pre-merge Checklist
<!--
Complete applicable items on this checklist **before** merging into
trunk. Inapplicable items can be left unchecked.
Both the PR author and reviewer are responsible for ensuring the
checklist is completed.
-->
- [ ] Have you checked for TypeScript, React or other console errors?pull-reprint command work with native PHP (#3881)1 parent 9250419 commit de57937
12 files changed
Lines changed: 368 additions & 124 deletions
File tree
- apps/cli
- commands
- tests
- lib
- native-php
- pull
- types
- php
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
390 | 400 | | |
391 | 401 | | |
392 | 402 | | |
393 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
394 | 410 | | |
395 | 411 | | |
396 | 412 | | |
| |||
434 | 450 | | |
435 | 451 | | |
436 | 452 | | |
437 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
438 | 460 | | |
439 | 461 | | |
440 | 462 | | |
| |||
452 | 474 | | |
453 | 475 | | |
454 | 476 | | |
455 | | - | |
| 477 | + | |
456 | 478 | | |
457 | 479 | | |
458 | 480 | | |
| |||
494 | 516 | | |
495 | 517 | | |
496 | 518 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
501 | 531 | | |
502 | 532 | | |
503 | 533 | | |
| |||
566 | 596 | | |
567 | 597 | | |
568 | 598 | | |
569 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
570 | 606 | | |
571 | 607 | | |
572 | 608 | | |
| |||
606 | 642 | | |
607 | 643 | | |
608 | 644 | | |
| 645 | + | |
609 | 646 | | |
610 | 647 | | |
611 | 648 | | |
| |||
640 | 677 | | |
641 | 678 | | |
642 | 679 | | |
| 680 | + | |
643 | 681 | | |
644 | 682 | | |
645 | 683 | | |
| |||
810 | 848 | | |
811 | 849 | | |
812 | 850 | | |
813 | | - | |
| 851 | + | |
814 | 852 | | |
815 | 853 | | |
816 | 854 | | |
| |||
830 | 868 | | |
831 | 869 | | |
832 | 870 | | |
| 871 | + | |
833 | 872 | | |
834 | 873 | | |
835 | 874 | | |
| |||
839 | 878 | | |
840 | 879 | | |
841 | 880 | | |
| 881 | + | |
842 | 882 | | |
843 | 883 | | |
844 | 884 | | |
| |||
853 | 893 | | |
854 | 894 | | |
855 | 895 | | |
856 | | - | |
| 896 | + | |
857 | 897 | | |
858 | 898 | | |
859 | 899 | | |
| |||
868 | 908 | | |
869 | 909 | | |
870 | 910 | | |
| 911 | + | |
871 | 912 | | |
872 | 913 | | |
873 | 914 | | |
| |||
886 | 927 | | |
887 | 928 | | |
888 | 929 | | |
| 930 | + | |
889 | 931 | | |
890 | 932 | | |
891 | 933 | | |
| |||
939 | 981 | | |
940 | 982 | | |
941 | 983 | | |
| 984 | + | |
942 | 985 | | |
943 | 986 | | |
944 | 987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
| |||
309 | 317 | | |
310 | 318 | | |
311 | 319 | | |
312 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
313 | 327 | | |
314 | 328 | | |
315 | 329 | | |
| |||
362 | 376 | | |
363 | 377 | | |
364 | 378 | | |
365 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
366 | 386 | | |
367 | 387 | | |
368 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
| |||
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
153 | | - | |
154 | | - | |
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
161 | 171 | | |
162 | 172 | | |
163 | | - | |
164 | 173 | | |
165 | 174 | | |
166 | | - | |
| 175 | + | |
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
170 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
171 | 187 | | |
172 | 188 | | |
173 | 189 | | |
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
177 | | - | |
| 193 | + | |
178 | 194 | | |
179 | 195 | | |
180 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments