@@ -77,9 +77,37 @@ transform([
77
77
"
78
78
], fn ($ changes ) => $ files ->replaceInFile (array_keys ($ changes ), array_values ($ changes ), "{$ workingPath }/stubs/NovaServiceProvider.stub " ));
79
79
80
- Symfony \Component \Process \Process::fromShellCommandline (
81
- 'npx -p typescript tsc ' , $ workingPath
82
- )->mustRun ();
80
+ if (! $ files ->isFile ("{$ workingPath }/vendor/laravel/nova/webpack.mix.js " )) {
81
+ $ files ->copy ("{$ workingPath }/vendor/laravel/nova/webpack.mix.js.dist " , "{$ workingPath }/vendor/laravel/nova/webpack.mix.js " );
82
+ }
83
+
84
+ Illuminate \Support \Collection::make ([
85
+ 'npm ci ' ,
86
+ 'npm run prod ' ,
87
+ ])->each (function ($ command ) use ($ workingPath ) {
88
+ tap (
89
+ Symfony \Component \Process \Process::fromShellCommandline ($ command , "{$ workingPath }/vendor/laravel/nova " ),
90
+ function ($ process ) {
91
+ $ process ->setTty (true );
92
+ $ process ->setTimeout (3600 );
93
+ $ process ->mustRun ();
94
+ }
95
+ );
96
+ });
97
+
98
+ Illuminate \Support \Collection::make ([
99
+ 'npm ci ' ,
100
+ 'npx -p typescript tsc ' ,
101
+ ])->each (function ($ command ) use ($ workingPath ) {
102
+ tap (
103
+ Symfony \Component \Process \Process::fromShellCommandline ($ command , $ workingPath ),
104
+ function ($ process ) {
105
+ $ process ->setTty (true );
106
+ $ process ->setTimeout (3600 );
107
+ $ process ->mustRun ();
108
+ }
109
+ );
110
+ });
83
111
84
112
$ files ->ensureDirectoryExists ("{$ workingPath }/types/@types/laravel-nova-ui " );
85
113
@@ -89,4 +117,4 @@ Illuminate\Support\Collection::make([
89
117
->filter (fn ($ file ) => is_file ($ file ))
90
118
->each (function ($ file ) use ($ files , $ workingPath ) {
91
119
$ files ->copy ($ file , "{$ workingPath }/types/@types/laravel-nova-ui " .Illuminate \Support \Str::after ($ file , "{$ workingPath }/vendor/laravel/nova/resources/types/components " ));
92
- });
120
+ });
0 commit comments