Skip to content
Open
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
10 changes: 10 additions & 0 deletions .ddev/.env.web
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to put this file in a separate PR?

We'll also need to update composer-scripts/post-create-project.php to change that PRIMARY_SITE_URL

I'm happy to make that change, or feel free to go for it if you have time.

If you hit any snags testing it out, I'm happy to pair up later this week or early tomorrow.

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the extra changes and force-pushed. I don't really understand about the post-create-project.php file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little funky. We should just finally do our Craft modules 1:1 and maybe piggy back some site starter stuff while we're doing it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CRAFT_DB_SERVER="db"
CRAFT_DB_DATABASE="db"
CRAFT_DB_PASSWORD="db"
MAILPIT_SMTP_HOSTNAME="127.0.0.1"
MAILPIT_SMTP_PORT="1025"
CRAFT_DB_DRIVER="mysql"
CRAFT_DB_PORT="3306"
PRIMARY_SITE_URL="https://viget-craft-starter.ddev.site"
CRAFT_DB_USER="db"
CRAFT_WEB_ROOT="/var/www/html/web"
6 changes: 4 additions & 2 deletions config/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use craft\config\GeneralConfig;
use craft\helpers\App;
use craft\helpers\StringHelper;

return GeneralConfig::create()
// Set the default week start day for date pickers (0 = Sunday, 1 = Monday, etc.)
Expand All @@ -23,5 +24,6 @@
// Set the @webroot alias so the clear-caches command knows where to find CP resources
->aliases([
'@webroot' => dirname(__DIR__) . '/web',
])
;
'@web' => App::env('PRIMARY_SITE_URL'),
'@primarySiteUrl' => StringHelper::ensureRight(App::env('PRIMARY_SITE_URL'), '/'),
]);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseUrl: $PRIMARY_SITE_URL
baseUrl: '@primarySiteUrl'
enabled: true
handle: default
hasUrls: true
Expand Down
3 changes: 2 additions & 1 deletion config/vite.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use craft\helpers\App;
use craft\helpers\StringHelper;

// This Vite config expects that PRIMARY_SITE_URL uses https
$host = App::env('PRIMARY_SITE_URL');
Expand All @@ -10,7 +11,7 @@

return [
// Strips custom ports from PRIMARY_SITE_URL if present
'devServerPublic' => preg_replace('/:\d+$/', '', $host) . ':' . $httpsPort,
'devServerPublic' => StringHelper::trimRight(preg_replace('/:\d+$/', '', $host), '/') . ':' . $httpsPort,
'serverPublic' => '/dist/',
'useDevServer' => App::env('CRAFT_ENVIRONMENT') === 'dev',
'manifestPath' => '@webroot/dist/.vite/manifest.json',
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.