Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ composer.lock
/tests-output
phpunit.xml
.phpunit.result.cache
.phpunit.cache/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The installer has not been tested on Windows yet, but it should work. Let me kno

It is possible to install WordPress through the installer. You will be prompted with this option.

Note that this will setup WordPress, but you still need a local development enviroment for PHP and MySQL. If you use MacOS, try out [Laravel Valet](https://laravel.com/docs/8.x/valet).
Note that this will setup WordPress, but you still need a local development environment for PHP and a database. If you use MacOS, try out [Laravel Valet](https://laravel.com/docs/11.x/valet) or [Herd](https://herd.laravel.com).

## Release notes

Expand Down
2 changes: 1 addition & 1 deletion bin/tailpress
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (file_exists(__DIR__.'/../../../autoload.php')) {
require __DIR__.'/../vendor/autoload.php';
}

$app = new Symfony\Component\Console\Application('TailPress Installer', '1.0.1');
$app = new Symfony\Component\Console\Application('TailPress Installer', '3.0.0');

$app->add(new Jeffreyvr\TailPressInstaller\Console\NewCommand);

Expand Down
28 changes: 8 additions & 20 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="TailPress Installer Test Suite">
<directory suffix="Test.php">./tests</directory>
<exclude>./tests/scaffolds</exclude>
</testsuite>
</testsuites>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" beStrictAboutTestsThatDoNotTestAnything="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="TailPress Installer Test Suite">
<directory suffix="Test.php">./tests</directory>
<exclude>./tests/scaffolds</exclude>
</testsuite>
</testsuites>
</phpunit>
17 changes: 1 addition & 16 deletions src/Console/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ protected function configure()
->addOption('git', null, InputOption::VALUE_NONE, 'Initialize a Git repository')
->addOption('branch', null, InputOption::VALUE_REQUIRED, 'The branch that should be created for a new repository', $this->defaultBranch())
->addOption('wordpress', null, InputOption::VALUE_NONE, 'Install WordPress.')
->addOption('compiler', null, InputOption::VALUE_OPTIONAL, 'Compiling tool can either be mix (Laravel Mix) or esbuild.', 'mix')
->addOption('dbname', null, InputOption::VALUE_OPTIONAL, 'The name of your database.')
->addOption('dbuser', null, InputOption::VALUE_OPTIONAL, 'The name of your database user.', 'root')
->addOption('dbpass', null, InputOption::VALUE_OPTIONAL, 'The password of your database.', 'root')
Expand All @@ -49,8 +48,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
false
));

$compiler = $input->getOption('compiler');

$folder = $input->getArgument('folder');
$slug = $this->determineSlug($folder);
$prefix = $this->determineSlug($folder, true);
Expand All @@ -68,14 +65,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$commands[] = "cd \"$workingDirectory\"";
$commands[] = "git clone -b master https://github.com/jeffreyvr/tailpress.git . --q";
$commands[] = "git clone -b 4.x https://github.com/jeffreyvr/tailpress.git . --q";

if (($process = $this->runCommands($commands, $input, $output))->isSuccessful()) {
if ($compiler === 'esbuild') {
$this->replaceFilesWithStubs($workingDirectory, 'esbuild', ['package.json', 'postcss.config.js']);
$this->deleteFiles($workingDirectory, ['webpack.mix.js', 'mix-manifest.json']);
}

if ($name = $input->getOption('name')) {
$this->replaceInFile('TailPress', $name, $workingDirectory.'/style.css');
$this->replaceInFile('tailpress', $prefix, $workingDirectory.'/style.css');
Expand Down Expand Up @@ -171,13 +163,6 @@ protected function replaceThemeHeader(string $stylesheet, string $header, string
file_put_contents($stylesheet, $content);
}

protected function replaceFilesWithStubs(string $workingDirectory, string $stubFolder, array $stubs)
{
foreach ($stubs as $stub) {
file_put_contents($workingDirectory.'/' . $stub, file_get_contents(__DIR__ . '/../../stubs/'.$stubFolder.'/'.$stub.'.stub'));
}
}

protected function deleteFiles(string $workingDirectory, array $files)
{
foreach ($files as $file) {
Expand Down
42 changes: 0 additions & 42 deletions stubs/esbuild/package.json.stub

This file was deleted.

8 changes: 0 additions & 8 deletions stubs/esbuild/postcss.config.js.stub

This file was deleted.

34 changes: 0 additions & 34 deletions stubs/mix/package.json.stub

This file was deleted.

8 changes: 0 additions & 8 deletions stubs/mix/postcss.config.js.stub

This file was deleted.

32 changes: 0 additions & 32 deletions stubs/mix/webpack.mix.js.stub

This file was deleted.