Skip to content

Commit ea473a9

Browse files
committed
feat: update installables
1 parent 1d3f4bd commit ea473a9

File tree

3 files changed

+16
-36
lines changed

3 files changed

+16
-36
lines changed

src/CreateCommand.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,22 @@ protected function handle(): int
131131

132132
if (sprout()->run(implode(' && ', $commands)) === 0) {
133133
if ($this->projectType === 'api') {
134-
//
134+
if (\Leaf\FS\File::exists("$directory/vite.config.js")) {
135+
\Leaf\FS\File::delete("$directory/vite.config.js");
136+
}
137+
138+
if (\Leaf\FS\File::exists("$directory/package.json")) {
139+
\Leaf\FS\File::delete("$directory/package.json");
140+
}
141+
142+
\Leaf\FS\Directory::delete("$directory/app/views");
143+
\Leaf\FS\Directory::create("$directory/app/views");
144+
145+
\Leaf\FS\Directory::delete("$directory/app/routes");
146+
\Leaf\FS\Directory::copy(__DIR__ . '/themes/api/routes', "$directory/app/routes");
147+
148+
\Leaf\FS\Directory::delete("$directory/public/index.php");
149+
\Leaf\FS\Directory::copy(__DIR__ . '/themes/api/index.php', "$directory/public/index.php");
135150
}
136151

137152
$this->writeln("\n🚀 Successfully created project <info>" . basename($directory) . '</info>');

src/themes/api/index.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@
5656
unset($path);
5757
}
5858

59-
/*
60-
|--------------------------------------------------------------------------
61-
| Attach blade view
62-
|--------------------------------------------------------------------------
63-
|
64-
| Templating has been disabled because you chose the MVC for APIs starter.
65-
| If you want to use blade in your application,
66-
| you can uncomment the line below.
67-
|
68-
*/
69-
// Leaf\Config::attachView(\Leaf\Blade::class);
70-
7159
/*
7260
|--------------------------------------------------------------------------
7361
| Load Leaf configuration
@@ -100,18 +88,6 @@
10088
*/
10189
// \Leaf\Database::initDb();
10290

103-
/*
104-
|--------------------------------------------------------------------------
105-
| Load custom libraries
106-
|--------------------------------------------------------------------------
107-
|
108-
| You can load your custom libraries here. If you have
109-
| anything defined in your lib folder, you can load
110-
| them here. Simply uncomment the line below.
111-
|
112-
*/
113-
// \Leaf\Core::loadLibs();
114-
11591
/*
11692
|--------------------------------------------------------------------------
11793
| Run your Leaf MVC application

src/themes/api/routes/index.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@
2828
response()->json('An error occured, our team has been notified', 500, true);
2929
});
3030

31-
/*
32-
|--------------------------------------------------------------------------
33-
| Set up Controller namespace
34-
|--------------------------------------------------------------------------
35-
|
36-
| This allows you to directly use controller names instead of typing
37-
| the controller namespace first.
38-
|
39-
*/
40-
app()->setNamespace('\App\Controllers');
41-
4231
/*
4332
|--------------------------------------------------------------------------
4433
| Your application routes

0 commit comments

Comments
 (0)