Update Drupal configuration files
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
7671099aea
commit
96ac446aa5
22 changed files with 309 additions and 14 deletions
44
drupal-cms/.gitignore
vendored
Normal file
44
drupal-cms/.gitignore
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
/.direnv/
|
||||
/.editorconfig
|
||||
/.env
|
||||
/.gitattributes
|
||||
/.phpunit.result.cache
|
||||
/bin/
|
||||
/data/
|
||||
/phpcs.xml
|
||||
/phpunit.xml
|
||||
/phpstan.neon
|
||||
/recipes/README.txt
|
||||
/vendor/
|
||||
|
||||
/web/.csslintrc
|
||||
/web/.eslintignore
|
||||
/web/.eslintrc.json
|
||||
/web/.ht.router.php
|
||||
/web/.htaccess
|
||||
/web/INSTALL.txt
|
||||
/web/README.md
|
||||
/web/autoload.php
|
||||
/web/core/
|
||||
/web/example.gitignore
|
||||
/web/index.php
|
||||
/web/libraries/
|
||||
/web/modules/README.txt
|
||||
/web/modules/contrib/
|
||||
/web/profiles/
|
||||
/web/robots.txt
|
||||
/web/sites/*/files/
|
||||
/web/sites/*/private/
|
||||
/web/sites/*/services*.yml
|
||||
/web/sites/*/settings*.php
|
||||
/web/sites/README.txt
|
||||
/web/sites/default/default.services.yml
|
||||
/web/sites/default/default.settings.php
|
||||
/web/sites/development.services.yml
|
||||
/web/sites/example.settings.local.php
|
||||
/web/sites/example.sites.php
|
||||
/web/sites/simpletest/
|
||||
/web/themes/README.txt
|
||||
/web/themes/contrib/
|
||||
/web/update.php
|
||||
/web/web.config
|
8
drupal-cms/.tmux-sessionizer
Executable file
8
drupal-cms/.tmux-sessionizer
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
tmux new-window -dn scratch
|
||||
tmux new-window -dn server
|
||||
|
||||
tmux send-keys -t server "nix run" Enter
|
||||
|
||||
nvim .
|
8
drupal-cms/build
Executable file
8
drupal-cms/build
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
composer install
|
||||
composer recipe:unpack
|
||||
|
||||
php -S localhost:8888 -t web
|
6
drupal-cms/build-configs.yaml
Normal file
6
drupal-cms/build-configs.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
name: drupal-cms
|
||||
template: php-drupal
|
||||
parameters:
|
||||
database:
|
||||
name: drupal_cms
|
11
drupal-cms/clean
Executable file
11
drupal-cms/clean
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
rm -rf \
|
||||
web/core \
|
||||
web/modules/contrib \
|
||||
web/profiles/contrib \
|
||||
web/themes/contrib \
|
||||
bin \
|
||||
vendor
|
5
drupal-cms/start
Executable file
5
drupal-cms/start
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
nix run "$@"
|
29
drupal-cms/tools/scripts/new-drupal-module
Executable file
29
drupal-cms/tools/scripts/new-drupal-module
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
NAME="$1"
|
||||
|
||||
DIR="web/modules/custom/$NAME"
|
||||
|
||||
test -d "$DIR" && echo "Module $NAME already exists." && exit 1
|
||||
|
||||
DIRS=(
|
||||
"$DIR/src"
|
||||
"$DIR/tests/src"
|
||||
)
|
||||
|
||||
FILES=(
|
||||
"$DIR/$NAME.info.yml"
|
||||
"$DIR/$NAME.routing.yml"
|
||||
"$DIR/$NAME.services.yml"
|
||||
"$DIR/README.md"
|
||||
)
|
||||
|
||||
mkdir -p "${DIRS[@]}"
|
||||
|
||||
touch "${FILES[@]}"
|
||||
|
||||
echo "# $NAME" > "$DIR/README.md"
|
||||
|
||||
echo "Created $DIR."
|
5
drupal-nix-flake/.gitignore
vendored
5
drupal-nix-flake/.gitignore
vendored
|
@ -8,6 +8,7 @@
|
|||
/phpcs.xml
|
||||
/phpunit.xml
|
||||
/phpstan.neon
|
||||
/recipes/README.txt
|
||||
/vendor/
|
||||
|
||||
/web/.csslintrc
|
||||
|
@ -21,10 +22,10 @@
|
|||
/web/core/
|
||||
/web/example.gitignore
|
||||
/web/index.php
|
||||
/web/libraries/
|
||||
/web/modules/README.txt
|
||||
/web/modules/contrib/
|
||||
/web/profiles/README.txt
|
||||
/web/profiles/contrib/
|
||||
/web/profiles/
|
||||
/web/robots.txt
|
||||
/web/sites/*/files/
|
||||
/web/sites/*/private/
|
||||
|
|
11
drupal-nix-flake/clean
Executable file
11
drupal-nix-flake/clean
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
rm -rf \
|
||||
web/core \
|
||||
web/modules/contrib \
|
||||
web/profiles/contrib \
|
||||
web/themes/contrib \
|
||||
bin \
|
||||
vendor
|
5
drupal-nix-flake/start
Executable file
5
drupal-nix-flake/start
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
nix run "$@"
|
29
drupal-nix-flake/tools/scripts/new-drupal-module
Executable file
29
drupal-nix-flake/tools/scripts/new-drupal-module
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
NAME="$1"
|
||||
|
||||
DIR="web/modules/custom/$NAME"
|
||||
|
||||
test -d "$DIR" && echo "Module $NAME already exists." && exit 1
|
||||
|
||||
DIRS=(
|
||||
"$DIR/src"
|
||||
"$DIR/tests/src"
|
||||
)
|
||||
|
||||
FILES=(
|
||||
"$DIR/$NAME.info.yml"
|
||||
"$DIR/$NAME.routing.yml"
|
||||
"$DIR/$NAME.services.yml"
|
||||
"$DIR/README.md"
|
||||
)
|
||||
|
||||
mkdir -p "${DIRS[@]}"
|
||||
|
||||
touch "${FILES[@]}"
|
||||
|
||||
echo "# $NAME" > "$DIR/README.md"
|
||||
|
||||
echo "Created $DIR."
|
|
@ -1 +1 @@
|
|||
use flake .
|
||||
use flake
|
||||
|
|
51
drupal/.gitignore
vendored
51
drupal/.gitignore
vendored
|
@ -1,7 +1,44 @@
|
|||
.editorconfig
|
||||
.gitattributes
|
||||
data/
|
||||
recipes/README.txt
|
||||
vendor/
|
||||
web/
|
||||
web/core/
|
||||
/.direnv/
|
||||
/.editorconfig
|
||||
/.env
|
||||
/.gitattributes
|
||||
/.phpunit.result.cache
|
||||
/bin/
|
||||
/data/
|
||||
/phpcs.xml
|
||||
/phpunit.xml
|
||||
/phpstan.neon
|
||||
/recipes/README.txt
|
||||
/vendor/
|
||||
|
||||
/web/.csslintrc
|
||||
/web/.eslintignore
|
||||
/web/.eslintrc.json
|
||||
/web/.ht.router.php
|
||||
/web/.htaccess
|
||||
/web/INSTALL.txt
|
||||
/web/README.md
|
||||
/web/autoload.php
|
||||
/web/core/
|
||||
/web/example.gitignore
|
||||
/web/index.php
|
||||
/web/libraries/
|
||||
/web/modules/README.txt
|
||||
/web/modules/contrib/
|
||||
/web/profiles/
|
||||
/web/robots.txt
|
||||
/web/sites/*/files/
|
||||
/web/sites/*/private/
|
||||
/web/sites/*/services*.yml
|
||||
/web/sites/*/settings*.php
|
||||
/web/sites/README.txt
|
||||
/web/sites/default/default.services.yml
|
||||
/web/sites/default/default.settings.php
|
||||
/web/sites/development.services.yml
|
||||
/web/sites/example.settings.local.php
|
||||
/web/sites/example.sites.php
|
||||
/web/sites/simpletest/
|
||||
/web/themes/README.txt
|
||||
/web/themes/contrib/
|
||||
/web/update.php
|
||||
/web/web.config
|
||||
|
|
8
drupal/build-configs.yaml
Normal file
8
drupal/build-configs.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
name: drupal
|
||||
template: php-drupal
|
||||
parameters:
|
||||
database:
|
||||
name: drupal-lab
|
||||
nix:
|
||||
phpPackage: php83
|
11
drupal/clean
Executable file
11
drupal/clean
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
rm -rf \
|
||||
web/core \
|
||||
web/modules/contrib \
|
||||
web/profiles/contrib \
|
||||
web/themes/contrib \
|
||||
bin \
|
||||
vendor
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
databasePort = 3306;
|
||||
webPort = 8000;
|
||||
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
|
@ -45,7 +44,7 @@
|
|||
enable = true;
|
||||
|
||||
initialDatabases = [
|
||||
{ name = "drupal_nix_flake_example"; }
|
||||
{ name = "drupal-lab"; }
|
||||
];
|
||||
|
||||
settings.mysqld.port = toString databasePort;
|
||||
|
@ -75,8 +74,6 @@
|
|||
phpPackages.composer
|
||||
];
|
||||
};
|
||||
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
5
drupal/start
Executable file
5
drupal/start
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
nix run "$@"
|
29
drupal/tools/scripts/new-drupal-module
Executable file
29
drupal/tools/scripts/new-drupal-module
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
NAME="$1"
|
||||
|
||||
DIR="web/modules/custom/$NAME"
|
||||
|
||||
test -d "$DIR" && echo "Module $NAME already exists." && exit 1
|
||||
|
||||
DIRS=(
|
||||
"$DIR/src"
|
||||
"$DIR/tests/src"
|
||||
)
|
||||
|
||||
FILES=(
|
||||
"$DIR/$NAME.info.yml"
|
||||
"$DIR/$NAME.routing.yml"
|
||||
"$DIR/$NAME.services.yml"
|
||||
"$DIR/README.md"
|
||||
)
|
||||
|
||||
mkdir -p "${DIRS[@]}"
|
||||
|
||||
touch "${FILES[@]}"
|
||||
|
||||
echo "# $NAME" > "$DIR/README.md"
|
||||
|
||||
echo "Created $DIR."
|
3
drupal/web/modules/example/example.info.yml
Normal file
3
drupal/web/modules/example/example.info.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
name: Example
|
||||
type: module
|
||||
core_version_requirement: ^11
|
7
drupal/web/modules/example/example.routing.yml
Normal file
7
drupal/web/modules/example/example.routing.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
example.page:
|
||||
path: /example
|
||||
defaults:
|
||||
_controller: Drupal\example\Controller\ExamplePageController
|
||||
methods: [GET]
|
||||
requirements:
|
||||
_permission: access content
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\example\Controller;
|
||||
|
||||
use Drupal\Core\StringTranslation\StringTranslationTrait;
|
||||
|
||||
final class ExamplePageController {
|
||||
|
||||
use StringTranslationTrait;
|
||||
|
||||
public function __invoke(): array {
|
||||
return [
|
||||
'#markup' => $this->t('This page is powered by Drupal and Nix.'),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\example\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
class ExampleTest extends BrowserTestBase {
|
||||
|
||||
public $defaultTheme = 'stark';
|
||||
|
||||
public static $modules = [
|
||||
'example',
|
||||
'node',
|
||||
];
|
||||
|
||||
public function test_it_loads_the_page(): void {
|
||||
$this->drupalGet('/example');
|
||||
|
||||
$assert = $this->assertSession();
|
||||
|
||||
$assert->statusCodeEquals(200);
|
||||
$assert->pageTextContains('This page is powered by Drupal and Nix.');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue