Skip to content

Commit

Permalink
Merge pull request #67 from sumocoders/remove-stimulus-controller
Browse files Browse the repository at this point in the history
Remove the default Stimulus controller
  • Loading branch information
Sander authored Feb 4, 2022
2 parents adc1e70 + 654d17f commit 74c72c1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Skeleton/PostCreateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,14 @@ private static function installFrameworkStylePackage(Event $event): void
$io->write(' Create new instance of the Framework object');
}
$insert = [
'new Framework()',
'window.framework = Framework()',
];
$content = self::insertStringAtPosition(
$content,
mb_strlen($content),
"\n" . implode("\n", $insert) . "\n"
);


// store the file
file_put_contents($projectDir . '/assets/app.js', $content);

Expand All @@ -151,6 +150,14 @@ private static function installFrameworkStylePackage(Event $event): void
if (file_exists($projectDir . '/assets/bootstrap.js')) {
shell_exec(' node_modules/.bin/standard assets/bootstrap.js --quiet --fix');
}

/*
* Remove the Symfony default Stimulus controller. We don't use it
* and it doesn't pass our StandardJS CI checks.
*/
if (file_exists($projectDir . '/assets/controllers/hello_controller.js')) {
shell_exec(sprintf('rm -rf %1$s', $projectDir . '/assets/controllers/hello_controller.js'));
}
}

private static function reconfigureWebpack(Event $event): void
Expand Down

0 comments on commit 74c72c1

Please sign in to comment.