-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [#14] Install Craft & Plugins. Commit project config * [#21] Route all email through Mailpit https://mailpit.axllent.org/ * [#20] Rename project config in post-create-project script * [#20] Adjust ddev config renaming * [#20] Rename package.json & package-lock.json * [#20] Remove plugin license lines * [#20] Clean up starter only .gitignore * [#20] Clean out unused ScriptHelpers * [#20] PC changes
- Loading branch information
1 parent
cce8b08
commit a349449
Showing
18 changed files
with
260 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,14 @@ CRAFT_APP_ID= | |
# The environment Craft is currently running in (dev, staging, production, etc.) | ||
CRAFT_ENVIRONMENT=dev | ||
|
||
[email protected] | ||
SYSTEM_EMAIL_SENDER="Craft CMS" | ||
SYSTEM_EMAIL_HOSTNAME= | ||
SYSTEM_EMAIL_PORT= | ||
SYSTEM_EMAIL_USERNAME= | ||
SYSTEM_EMAIL_PASSWORD= | ||
|
||
# Database connection settings | ||
CRAFT_DB_DRIVER=mysql | ||
CRAFT_DB_SERVER=127.0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,13 @@ CRAFT_APP_ID= | |
# The environment Craft is currently running in (dev, staging, production, etc.) | ||
CRAFT_ENVIRONMENT=production | ||
|
||
[email protected] | ||
SYSTEM_EMAIL_HOSTNAME= | ||
SYSTEM_EMAIL_PORT= | ||
SYSTEM_EMAIL_USERNAME= | ||
SYSTEM_EMAIL_PASSWORD= | ||
|
||
# Database connection settings | ||
CRAFT_DB_DRIVER=mysql | ||
CRAFT_DB_SERVER=127.0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,13 @@ CRAFT_APP_ID= | |
# The environment Craft is currently running in (dev, staging, production, etc.) | ||
CRAFT_ENVIRONMENT=staging | ||
|
||
[email protected] | ||
SYSTEM_EMAIL_HOSTNAME= | ||
SYSTEM_EMAIL_PORT= | ||
SYSTEM_EMAIL_USERNAME= | ||
SYSTEM_EMAIL_PASSWORD= | ||
|
||
# Database connection settings | ||
CRAFT_DB_DRIVER=mysql | ||
CRAFT_DB_SERVER=127.0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ node_modules | |
/web/dist | ||
/.vite | ||
php-cs-fixer.cache | ||
|
||
# BEGIN-STARTER-ONLY | ||
config/license.key | ||
# END-STARTER-ONLY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
class ScriptHelpers | ||
{ | ||
public static function replaceFileText(string $filePath, string $pattern, string $replacement): void | ||
{ | ||
$fileContent = file_get_contents($filePath); | ||
$fileContent = preg_replace($pattern, $replacement, $fileContent); | ||
file_put_contents($filePath, $fileContent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
|
||
use craft\helpers\Console; | ||
use craft\helpers\StringHelper; | ||
|
||
require_once 'ScriptHelpers.php'; | ||
require_once 'vendor/autoload.php'; | ||
|
||
$cwd = getcwd(); | ||
|
||
/** | ||
* Prompt the user for input | ||
*/ | ||
$projectName = Console::prompt('What is the name of your project (Example: My Client Name)? ', [ | ||
'required' => true, | ||
]); | ||
|
||
Console::output("Great! We'll use the name: $projectName"); | ||
|
||
$suggestedProjectSlug = StringHelper::toKebabCase($projectName); | ||
|
||
$projectSlugPrompt = Console::prompt("Customize the project slug? This controls the DDEV URL, etc.", [ | ||
'default' => $suggestedProjectSlug, | ||
]); | ||
|
||
$projectSlug = !empty(trim($projectSlugPrompt)) ? StringHelper::toKebabCase($projectSlugPrompt) : $suggestedProjectSlug; | ||
|
||
Console::output("Great! We'll use $projectSlug"); | ||
|
||
/** | ||
* Update DDEV config | ||
*/ | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/.ddev/config.yaml", | ||
pattern: "/name:\s+viget-craft-starter/", | ||
replacement: "name: $projectSlug", | ||
); | ||
|
||
/** | ||
* Update package.json | ||
*/ | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/package.json", | ||
pattern: "/\"name\": \"viget-craft-starter\"/", | ||
replacement: "\"name\": \"$projectSlug\"", | ||
); | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/package-lock.json", | ||
pattern: "/\"name\": \"viget-craft-starter\"/", | ||
replacement: "\"name\": \"$projectSlug\"", | ||
); | ||
|
||
/** | ||
* Update project config | ||
*/ | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/config/project/project.yaml", | ||
pattern: "/Viget Craft Starter/", | ||
replacement: "$projectName", | ||
); | ||
|
||
// Replace plugin license keys. | ||
// These are regenerated when viewing the Control Panel | ||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/config/project/project.yaml", | ||
pattern: "/ licenseKey: REPLACE[\r\n|\r|\n]/", // Make sure to remove new line too | ||
replacement: "", | ||
); | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/config/project/siteGroups/805d8826-faed-4186-9b88-f509eb9b07e6.yaml", | ||
pattern: "/Viget Craft Starter/", | ||
replacement: "$projectName", | ||
); | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml", | ||
pattern: "/Viget Craft Starter/", | ||
replacement: "$projectName", | ||
); | ||
|
||
/** | ||
* .gitignore | ||
*/ | ||
|
||
ScriptHelpers::replaceFileText( | ||
filePath: "$cwd/.gitignore", | ||
pattern: "/# BEGIN-STARTER-ONLY\X*# END-STARTER-ONLY/m", | ||
replacement: '', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
config/project/ckeditor/configs/b7e66782-af96-4012-9e17-914134073ced.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
headingLevels: | ||
- 1 | ||
- 2 | ||
- 3 | ||
- 4 | ||
- 5 | ||
- 6 | ||
name: Simple | ||
toolbar: | ||
- heading | ||
- '|' | ||
- bold | ||
- italic | ||
- link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
dateModified: 1716932096 | ||
email: | ||
fromEmail: $SYSTEM_EMAIL_FROM | ||
fromName: 'Viget Craft Starter' | ||
replyToEmail: null | ||
template: null | ||
transportSettings: | ||
host: $SYSTEM_EMAIL_HOSTNAME | ||
password: $SYSTEM_EMAIL_PASSWORD | ||
port: $SYSTEM_EMAIL_PORT | ||
useAuthentication: '1' | ||
username: $SYSTEM_EMAIL_USERNAME | ||
transportType: craft\mail\transportadapters\Smtp | ||
meta: | ||
__names__: | ||
35b563a0-4662-40b9-b885-a8450a2868d9: 'Viget Craft Starter' # Viget Craft Starter | ||
805d8826-faed-4186-9b88-f509eb9b07e6: 'Viget Craft Starter' # Viget Craft Starter | ||
b7e66782-af96-4012-9e17-914134073ced: Simple # Simple | ||
plugins: | ||
aws-s3: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: '2.0' | ||
ckeditor: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: 3.0.0.0 | ||
classnames: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: 3.0.0 | ||
cp-field-inspect: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: 1.0.0 | ||
empty-coalesce: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: 1.0.0 | ||
imager-x: | ||
edition: lite | ||
enabled: true | ||
licenseKey: REPLACE | ||
schemaVersion: 4.0.0 | ||
navigation: | ||
edition: standard | ||
enabled: true | ||
licenseKey: REPLACE | ||
schemaVersion: 2.1.0 | ||
retour: | ||
edition: standard | ||
enabled: true | ||
licenseKey: REPLACE | ||
schemaVersion: 3.0.12 | ||
seomatic: | ||
edition: standard | ||
enabled: true | ||
licenseKey: REPLACE | ||
schemaVersion: 3.0.12 | ||
vite: | ||
edition: standard | ||
enabled: true | ||
schemaVersion: 1.0.0 | ||
system: | ||
edition: solo | ||
live: true | ||
name: 'Viget Craft Starter' | ||
schemaVersion: 5.0.0.20 | ||
timeZone: America/Los_Angeles | ||
users: | ||
allowPublicRegistration: false | ||
defaultGroup: null | ||
photoSubpath: null | ||
photoVolumeUid: null | ||
require2fa: false | ||
requireEmailVerification: true |
1 change: 1 addition & 0 deletions
1
config/project/siteGroups/805d8826-faed-4186-9b88-f509eb9b07e6.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: 'Viget Craft Starter' |
9 changes: 9 additions & 0 deletions
9
config/project/sites/default--35b563a0-4662-40b9-b885-a8450a2868d9.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
baseUrl: $PRIMARY_SITE_URL | ||
enabled: true | ||
handle: default | ||
hasUrls: true | ||
language: en-US | ||
name: 'Viget Craft Starter' | ||
primary: true | ||
siteGroup: 805d8826-faed-4186-9b88-f509eb9b07e6 # Viget Craft Starter | ||
sortOrder: 1 |
Oops, something went wrong.