├── .docker-config ├── mysql │ └── Dockerfile ├── nginx │ ├── Dockerfile │ └── default.conf ├── php-dev-craft │ ├── v3 │ │ └── Dockerfile │ ├── v4 │ │ └── Dockerfile │ └── v5 │ │ └── Dockerfile ├── php-prod-craft │ ├── v3 │ │ ├── Dockerfile │ │ ├── composer_install.sh │ │ └── run_queue.sh │ ├── v4 │ │ ├── Dockerfile │ │ ├── composer_install.sh │ │ └── run_queue.sh │ └── v5 │ │ ├── Dockerfile │ │ ├── composer_install.sh │ │ └── run_queue.sh ├── postgres │ └── Dockerfile └── redis │ └── Dockerfile ├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── Makefile ├── README.md ├── cms_v3 ├── Makefile ├── bootstrap.php ├── buildchain │ ├── .gitignore │ ├── Dockerfile │ ├── Makefile │ ├── README.md │ ├── eslint.config.js │ ├── package.json │ ├── src │ │ ├── css │ │ │ ├── app.css │ │ │ ├── components │ │ │ │ ├── global.css │ │ │ │ ├── typography.css │ │ │ │ └── webfonts.css │ │ │ ├── pages │ │ │ │ ├── settings.css │ │ │ │ └── welcome.css │ │ │ ├── tailwind-config.css │ │ │ └── vendor.css │ │ ├── js │ │ │ ├── @types │ │ │ │ └── shims.d.ts │ │ │ ├── Confetti.ts │ │ │ ├── app.ts │ │ │ └── welcome.ts │ │ └── vue │ │ │ ├── @types │ │ │ ├── confetti.d.ts │ │ │ └── shims-vue.d.ts │ │ │ ├── App.vue │ │ │ └── ConfettiParty.vue │ ├── stylelint.config.js │ ├── tailwind.config.js │ ├── tsconfig.json │ └── vite.config.ts ├── composer.json ├── config │ ├── _configs │ │ ├── mysql │ │ │ ├── db.php │ │ │ └── general.php │ │ └── postgres │ │ │ ├── db.php │ │ │ └── general.php │ ├── app.console.php │ ├── app.php │ ├── app.web.php │ ├── db.php │ ├── fastcgi-cache-bust.php │ ├── general.php │ ├── htmlpurifier │ │ └── Default.json │ ├── redactor │ │ ├── Default.json │ │ └── Simple.json │ ├── routes.php │ ├── seomatic-config │ │ └── globalmeta │ │ │ └── Creator.php │ ├── twigpack.php │ └── vite.php ├── craft ├── craft.bat ├── ecs.php ├── example.env ├── modules │ └── sitemodule │ │ ├── .craftplugin │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── src │ │ ├── SiteModule.php │ │ ├── assetbundles │ │ └── sitemodule │ │ │ ├── SiteModuleAsset.php │ │ │ └── dist │ │ │ ├── css │ │ │ └── SiteModule.css │ │ │ ├── img │ │ │ └── SiteModule-icon.svg │ │ │ └── js │ │ │ └── SiteModule.js │ │ ├── config.php │ │ ├── helpers │ │ └── Config.php │ │ ├── services │ │ └── Helper.php │ │ ├── translations │ │ └── en │ │ │ └── site-module.php │ │ └── variables │ │ └── SiteVariable.php ├── phpstan.neon ├── rector.php ├── templates │ ├── .gitkeep │ ├── blog │ │ ├── _entry.twig │ │ └── index.twig │ └── index.twig └── web │ ├── .htaccess │ ├── assets │ └── .gitignore │ ├── cpresources │ └── .gitignore │ ├── img │ └── site │ │ ├── login-background-image.png │ │ └── nys-logo.svg │ ├── index.php │ ├── offline.svg │ └── web.config ├── cms_v4 ├── Makefile ├── bootstrap.php ├── buildchain │ ├── .gitignore │ ├── Dockerfile │ ├── Makefile │ ├── README.md │ ├── eslint.config.js │ ├── package.json │ ├── src │ │ ├── css │ │ │ ├── app.css │ │ │ ├── components │ │ │ │ ├── global.css │ │ │ │ ├── typography.css │ │ │ │ └── webfonts.css │ │ │ ├── pages │ │ │ │ ├── settings.css │ │ │ │ └── welcome.css │ │ │ ├── tailwind-config.css │ │ │ └── vendor.css │ │ ├── js │ │ │ ├── @types │ │ │ │ └── shims.d.ts │ │ │ ├── Confetti.ts │ │ │ ├── app.ts │ │ │ └── welcome.ts │ │ └── vue │ │ │ ├── @types │ │ │ ├── confetti.d.ts │ │ │ └── shims-vue.d.ts │ │ │ ├── App.vue │ │ │ └── ConfettiParty.vue │ ├── stylelint.config.js │ ├── tailwind.config.js │ ├── tsconfig.json │ └── vite.config.ts ├── composer.json ├── config │ ├── _configs │ │ ├── mysql │ │ │ ├── db.php │ │ │ └── general.php │ │ └── postgres │ │ │ ├── db.php │ │ │ └── general.php │ ├── app.console.php │ ├── app.php │ ├── app.web.php │ ├── custom.php │ ├── db.php │ ├── fastcgi-cache-bust.php │ ├── general.php │ ├── htmlpurifier │ │ └── Default.json │ ├── redactor │ │ ├── Default.json │ │ └── Simple.json │ ├── routes.php │ ├── seomatic-config │ │ └── globalmeta │ │ │ └── Creator.php │ ├── twigpack.php │ └── vite.php ├── craft ├── craft.bat ├── ecs.php ├── example.env ├── modules │ └── sitemodule │ │ ├── .craftplugin │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── src │ │ ├── SiteModule.php │ │ ├── assetbundles │ │ └── sitemodule │ │ │ ├── SiteModuleAsset.php │ │ │ └── dist │ │ │ ├── css │ │ │ └── SiteModule.css │ │ │ ├── img │ │ │ └── SiteModule-icon.svg │ │ │ └── js │ │ │ └── SiteModule.js │ │ ├── config.php │ │ ├── helpers │ │ └── Config.php │ │ ├── services │ │ └── Helper.php │ │ ├── translations │ │ └── en │ │ │ └── site-module.php │ │ └── variables │ │ └── SiteVariable.php ├── phpstan.neon ├── rector.php ├── templates │ ├── .gitkeep │ ├── blog │ │ ├── _entry.twig │ │ └── index.twig │ └── index.twig └── web │ ├── .htaccess │ ├── assets │ └── .gitignore │ ├── cpresources │ └── .gitignore │ ├── img │ └── site │ │ ├── login-background-image.png │ │ └── nys-logo.svg │ ├── index.php │ ├── offline.svg │ └── web.config ├── cms_v5 ├── Makefile ├── bootstrap.php ├── buildchain │ ├── .gitignore │ ├── Dockerfile │ ├── Makefile │ ├── README.md │ ├── eslint.config.js │ ├── package.json │ ├── src │ │ ├── css │ │ │ ├── app.css │ │ │ ├── components │ │ │ │ ├── global.css │ │ │ │ ├── typography.css │ │ │ │ └── webfonts.css │ │ │ ├── pages │ │ │ │ ├── settings.css │ │ │ │ └── welcome.css │ │ │ ├── tailwind-config.css │ │ │ └── vendor.css │ │ ├── js │ │ │ ├── @types │ │ │ │ └── shims.d.ts │ │ │ ├── Confetti.ts │ │ │ ├── app.ts │ │ │ └── welcome.ts │ │ └── vue │ │ │ ├── @types │ │ │ ├── confetti.d.ts │ │ │ └── shims-vue.d.ts │ │ │ ├── App.vue │ │ │ └── ConfettiParty.vue │ ├── stylelint.config.js │ ├── tailwind.config.js │ ├── tsconfig.json │ └── vite.config.ts ├── composer.json ├── config │ ├── _configs │ │ ├── mysql │ │ │ ├── db.php │ │ │ └── general.php │ │ └── postgres │ │ │ ├── db.php │ │ │ └── general.php │ ├── app.console.php │ ├── app.php │ ├── app.web.php │ ├── custom.php │ ├── db.php │ ├── fastcgi-cache-bust.php │ ├── general.php │ ├── htmlpurifier │ │ └── Default.json │ ├── redactor │ │ ├── Default.json │ │ └── Simple.json │ ├── routes.php │ ├── seomatic-config │ │ └── globalmeta │ │ │ └── Creator.php │ ├── twigpack.php │ └── vite.php ├── craft ├── craft.bat ├── ecs.php ├── example.env ├── modules │ └── sitemodule │ │ ├── .craftplugin │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── src │ │ ├── SiteModule.php │ │ ├── assetbundles │ │ └── sitemodule │ │ │ ├── SiteModuleAsset.php │ │ │ └── dist │ │ │ ├── css │ │ │ └── SiteModule.css │ │ │ ├── img │ │ │ └── SiteModule-icon.svg │ │ │ └── js │ │ │ └── SiteModule.js │ │ ├── config.php │ │ ├── helpers │ │ └── Config.php │ │ ├── services │ │ └── Helper.php │ │ ├── translations │ │ └── en │ │ │ └── site-module.php │ │ └── variables │ │ └── SiteVariable.php ├── phpstan.neon ├── rector.php ├── templates │ ├── .gitkeep │ ├── blog │ │ ├── _entry.twig │ │ └── index.twig │ └── index.twig └── web │ ├── .htaccess │ ├── assets │ └── .gitignore │ ├── cpresources │ └── .gitignore │ ├── img │ └── site │ │ ├── login-background-image.png │ │ └── nys-logo.svg │ ├── index.php │ ├── offline.svg │ └── web.config ├── composer.json ├── db-seed ├── mysql │ ├── db_init.sh │ └── dbs │ │ ├── project_v3.sql │ │ ├── project_v4.sql │ │ ├── project_v5.sql │ │ └── test.sql └── postgres │ ├── db_init.sh │ └── dbs │ ├── project_v3.sql │ ├── project_v4.sql │ ├── project_v5.sql │ └── test.sql ├── docker-compose.yml └── src └── templates /.docker-config/mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mysql/mysql-server:latest 2 | -------------------------------------------------------------------------------- /.docker-config/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.19-alpine 2 | 3 | COPY ./default.conf /etc/nginx/conf.d/default.conf 4 | -------------------------------------------------------------------------------- /.docker-config/nginx/default.conf: -------------------------------------------------------------------------------- 1 | # default Docker DNS server 2 | resolver 127.0.0.11; 3 | 4 | # If a cookie doesn't exist, it evaluates to an empty string, so if neither cookie exists, it'll match : 5 | # (empty string on either side of the :), but if either or both cookies are set, it won't match, and will hit the default rule 6 | map $cookie_XDEBUG_SESSION:$cookie_XDEBUG_PROFILE $container_name { 7 | default php_xdebug; 8 | ':' php; 9 | } 10 | 11 | map $server_port $craft_cms_version { 12 | 8003 v3; 13 | 8004 v4; 14 | 8005 v5; 15 | } 16 | 17 | server { 18 | listen 8003; 19 | listen [::]:8003; 20 | listen 8004; 21 | listen [::]:8004; 22 | listen 8005; 23 | listen [::]:8005; 24 | 25 | set $fast_cgi_pass "${container_name}_${craft_cms_version}"; 26 | set $craft_server_root "/var/www/project/cms_${craft_cms_version}/web"; 27 | 28 | server_name _; 29 | root $craft_server_root; 30 | index index.html index.htm index.php; 31 | charset utf-8; 32 | 33 | gzip_static on; 34 | 35 | ssi on; 36 | 37 | client_max_body_size 0; 38 | 39 | error_page 404 /index.php?$query_string; 40 | 41 | access_log off; 42 | error_log /dev/stdout info; 43 | 44 | location = /favicon.ico { access_log off; log_not_found off; } 45 | 46 | location / { 47 | try_files $uri/index.html $uri $uri/ /index.php?$query_string; 48 | } 49 | 50 | location ~ [^/]\.php(/|$) { 51 | try_files $uri $uri/ /index.php?$query_string; 52 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 53 | fastcgi_pass $fast_cgi_pass:9000; 54 | fastcgi_index index.php; 55 | include fastcgi_params; 56 | fastcgi_param PATH_INFO $fastcgi_path_info; 57 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 58 | fastcgi_param DOCUMENT_ROOT $realpath_root; 59 | fastcgi_param HTTP_PROXY ""; 60 | 61 | add_header Last-Modified $date_gmt; 62 | add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; 63 | if_modified_since off; 64 | expires off; 65 | etag off; 66 | 67 | fastcgi_intercept_errors off; 68 | fastcgi_buffer_size 16k; 69 | fastcgi_buffers 4 16k; 70 | fastcgi_connect_timeout 300; 71 | fastcgi_send_timeout 300; 72 | fastcgi_read_timeout 300; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v3/composer_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Composer Install shell script 4 | # 5 | # This shell script runs `composer install` if either the `composer.lock` file or 6 | # the `vendor/` directory is not present` 7 | # 8 | # @author nystudio107 9 | # @copyright Copyright (c) 2022 nystudio107 10 | # @link https://nystudio107.com/ 11 | # @license MIT 12 | 13 | # Ensure permissions on directories Craft needs to write to 14 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 15 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 16 | # Check for `composer.lock` & `vendor/autoload.php` 17 | cd $CMS_ROOT_PATH 18 | if [ ! -f "composer.lock" ] || [ ! -f "vendor/autoload.php" ]; then 19 | chown -R www-data:www-data /var/www/project 20 | su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction 21 | # Wait until the MySQL db container responds 22 | echo "### Waiting for MySQL database" 23 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 24 | do 25 | sleep 1 26 | done 27 | # Wait until the Postgres db container responds 28 | echo "### Waiting for Postgres database" 29 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 30 | do 31 | sleep 1 32 | done 33 | # Run any pending migrations/project config changes 34 | su-exec www-data composer craft-update 35 | fi 36 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v3/run_queue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run Queue shell script 4 | # 5 | # This shell script runs the Craft CMS queue via `php craft queue/listen` 6 | # It waits until the database container responds, then runs any pending 7 | # migrations / project config changes via the `craft-update` Composer script, 8 | # then runs the queue listener that listens for and runs pending queue jobs 9 | # 10 | # @author nystudio107 11 | # @copyright Copyright (c) 2022 nystudio107 12 | # @link https://nystudio107.com/ 13 | # @license MIT 14 | 15 | cd $CMS_ROOT_PATH 16 | # Wait until the MySQL db container responds 17 | echo "### Waiting for MySQL database" 18 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 19 | do 20 | sleep 1 21 | done 22 | # Wait until the Postgres db container responds 23 | echo "### Waiting for Postgres database" 24 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 25 | do 26 | sleep 1 27 | done 28 | # Wait until the `composer install` is done by looking for the `vendor/autoload.php` and `composer.lock` files 29 | echo "### Waiting for vendor/autoload.php" 30 | while [ ! -f "vendor/autoload.php" ] || [ ! -f "composer.lock" ] 31 | do 32 | sleep 1 33 | done 34 | # Ensure permissions on directories Craft needs to write to 35 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 36 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 37 | # Run any pending migrations/project config changes 38 | su-exec www-data composer craft-update 39 | # Run a queue listener 40 | su-exec www-data php craft queue/listen 10 41 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v4/composer_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Composer Install shell script 4 | # 5 | # This shell script runs `composer install` if either the `composer.lock` file or 6 | # the `vendor/` directory is not present` 7 | # 8 | # @author nystudio107 9 | # @copyright Copyright (c) 2022 nystudio107 10 | # @link https://nystudio107.com/ 11 | # @license MIT 12 | 13 | # Ensure permissions on directories Craft needs to write to 14 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 15 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 16 | # Check for `composer.lock` & `vendor/autoload.php` 17 | cd $CMS_ROOT_PATH 18 | if [ ! -f "composer.lock" ] || [ ! -f "vendor/autoload.php" ]; then 19 | chown -R www-data:www-data /var/www/project 20 | su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction 21 | # Wait until the MySQL db container responds 22 | echo "### Waiting for MySQL database" 23 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 24 | do 25 | sleep 1 26 | done 27 | # Wait until the Postgres db container responds 28 | echo "### Waiting for Postgres database" 29 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 30 | do 31 | sleep 1 32 | done 33 | # Run any pending migrations/project config changes 34 | su-exec www-data composer craft-update 35 | fi 36 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v4/run_queue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run Queue shell script 4 | # 5 | # This shell script runs the Craft CMS queue via `php craft queue/listen` 6 | # It waits until the database container responds, then runs any pending 7 | # migrations / project config changes via the `craft-update` Composer script, 8 | # then runs the queue listener that listens for and runs pending queue jobs 9 | # 10 | # @author nystudio107 11 | # @copyright Copyright (c) 2022 nystudio107 12 | # @link https://nystudio107.com/ 13 | # @license MIT 14 | 15 | cd $CMS_ROOT_PATH 16 | # Wait until the MySQL db container responds 17 | echo "### Waiting for MySQL database" 18 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 19 | do 20 | sleep 1 21 | done 22 | # Wait until the Postgres db container responds 23 | echo "### Waiting for Postgres database" 24 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 25 | do 26 | sleep 1 27 | done 28 | # Wait until the `composer install` is done by looking for the `vendor/autoload.php` and `composer.lock` files 29 | echo "### Waiting for vendor/autoload.php" 30 | while [ ! -f "vendor/autoload.php" ] || [ ! -f "composer.lock" ] 31 | do 32 | sleep 1 33 | done 34 | # Ensure permissions on directories Craft needs to write to 35 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 36 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 37 | # Run any pending migrations/project config changes 38 | su-exec www-data composer craft-update 39 | # Run a queue listener 40 | su-exec www-data php craft queue/listen 10 41 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v5/composer_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Composer Install shell script 4 | # 5 | # This shell script runs `composer install` if either the `composer.lock` file or 6 | # the `vendor/` directory is not present` 7 | # 8 | # @author nystudio107 9 | # @copyright Copyright (c) 2022 nystudio107 10 | # @link https://nystudio107.com/ 11 | # @license MIT 12 | 13 | # Ensure permissions on directories Craft needs to write to 14 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 15 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 16 | # Check for `composer.lock` & `vendor/autoload.php` 17 | cd $CMS_ROOT_PATH 18 | if [ ! -f "composer.lock" ] || [ ! -f "vendor/autoload.php" ]; then 19 | chown -R www-data:www-data /var/www/project 20 | su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction 21 | # Wait until the MySQL db container responds 22 | echo "### Waiting for MySQL database" 23 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 24 | do 25 | sleep 1 26 | done 27 | # Wait until the Postgres db container responds 28 | echo "### Waiting for Postgres database" 29 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 30 | do 31 | sleep 1 32 | done 33 | # Run any pending migrations/project config changes 34 | su-exec www-data composer craft-update 35 | fi 36 | -------------------------------------------------------------------------------- /.docker-config/php-prod-craft/v5/run_queue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run Queue shell script 4 | # 5 | # This shell script runs the Craft CMS queue via `php craft queue/listen` 6 | # It waits until the database container responds, then runs any pending 7 | # migrations / project config changes via the `craft-update` Composer script, 8 | # then runs the queue listener that listens for and runs pending queue jobs 9 | # 10 | # @author nystudio107 11 | # @copyright Copyright (c) 2022 nystudio107 12 | # @link https://nystudio107.com/ 13 | # @license MIT 14 | 15 | cd $CMS_ROOT_PATH 16 | # Wait until the MySQL db container responds 17 | echo "### Waiting for MySQL database" 18 | until eval "mysql -h mysql -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 19 | do 20 | sleep 1 21 | done 22 | # Wait until the Postgres db container responds 23 | echo "### Waiting for Postgres database" 24 | until eval "PGPASSWORD=$DB_PASSWORD psql -h postgres -U $DB_USER $DB_DATABASE -c 'select 1' > /dev/null 2>&1" 25 | do 26 | sleep 1 27 | done 28 | # Wait until the `composer install` is done by looking for the `vendor/autoload.php` and `composer.lock` files 29 | echo "### Waiting for vendor/autoload.php" 30 | while [ ! -f "vendor/autoload.php" ] || [ ! -f "composer.lock" ] 31 | do 32 | sleep 1 33 | done 34 | # Ensure permissions on directories Craft needs to write to 35 | chown -R www-data:www-data $CMS_ROOT_PATH/storage 36 | chown -R www-data:www-data $CMS_ROOT_PATH/web/cpresources 37 | # Run any pending migrations/project config changes 38 | su-exec www-data composer craft-update 39 | # Run a queue listener 40 | su-exec www-data php craft queue/listen 10 41 | -------------------------------------------------------------------------------- /.docker-config/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:13-alpine 2 | -------------------------------------------------------------------------------- /.docker-config/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM redis:5-alpine 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Craft .gitignore 2 | # 3 | # Example .gitignore file for Craft CMS projects 4 | # 5 | # @author nystudio107 6 | # @copyright Copyright (c) 2017 nystudio107 7 | # @link https://nystudio107.com/ 8 | # @package nystudio107/craft 9 | # @since 1.0.0 10 | # @license MIT 11 | 12 | # This file should be placed in your Craft CMS project root directory 13 | 14 | # CRAFT ENVIRONMENT 15 | .env* 16 | license.key* 17 | 18 | # COMPOSER 19 | */vendor/* 20 | 21 | # CRAFT STORAGE 22 | */storage/* 23 | !*/storage/.gitkeep 24 | 25 | # ASSETS 26 | /cms_v3/web/assets/* 27 | /cms_v3/web/cpresources/* 28 | /cms_v3/web/dist/* 29 | /cms_v4/web/assets/* 30 | /cms_v4/web/cpresources/* 31 | /cms_v4/web/dist/* 32 | 33 | # BUILD FILES 34 | node_modules 35 | yarn-error.log 36 | npm-debug.log 37 | 38 | # MISC FILES 39 | .cache 40 | .DS_Store 41 | .idea 42 | .project 43 | .settings 44 | *.esproj 45 | *.sublime-workspace 46 | *.sublime-project 47 | *.tmproj 48 | *.tmproject 49 | .vscode/* 50 | !.vscode/settings.json 51 | !.vscode/tasks.json 52 | !.vscode/launch.json 53 | !.vscode/extensions.json 54 | config.codekit3 55 | prepros-6.config 56 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) Pixel & Tonic, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted. 5 | 6 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 7 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 8 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 9 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 10 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 11 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 12 | PERFORMANCE OF THIS SOFTWARE. 13 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SEPARATOR:=- 2 | PROJECT_NAME?=$(shell basename $(CURDIR)) 3 | SERVICE_NAME?=php 4 | CMS_ROOT_NAME?=cms_ 5 | CMS_VERSIONS:=v3 v4 v5 6 | 7 | .PHONY: dev clean nuke up 8 | 9 | dev: up 10 | clean: 11 | for v in $(CMS_VERSIONS) ; do \ 12 | rm -f $(CMS_ROOT_NAME)$$v/composer.lock ; \ 13 | rm -rf $(CMS_ROOT_NAME)$$v/vendor/ ; \ 14 | done 15 | nuke: clean 16 | docker-compose down -v 17 | docker-compose up --build --force-recreate 18 | up: CONTAINER=$(PROJECT_NAME)$(SEPARATOR)$(SERVICE_NAME)_$(word 1,$(CMS_VERSIONS))$(SEPARATOR)1 19 | up: 20 | if [ ! "$$(docker ps -q -f name=$(CONTAINER))" ]; then \ 21 | for v in $(CMS_VERSIONS) ; do \ 22 | cp -fn $(CMS_ROOT_NAME)$$v/example.env $(CMS_ROOT_NAME)$$v/.env ; \ 23 | done ; \ 24 | docker-compose up ; \ 25 | fi 26 | down: 27 | docker-compose down 28 | %: 29 | @: 30 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 31 | -------------------------------------------------------------------------------- /cms_v3/Makefile: -------------------------------------------------------------------------------- 1 | SEPARATOR:=- 2 | PROJECT_NAME?=$(shell basename $(dir $(CURDIR))) 3 | PROJECT_DIR?=/var/www/project/ 4 | SERVICE_NAME?=php 5 | QUEUE_SERVICE_NAME?=queue 6 | CMS_ROOT_NAME?=cms_ 7 | CMS_VERSION:=v3 8 | CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 9 | QUEUE_CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(QUEUE_SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 10 | CMS_DIR:=$(CMS_ROOT_NAME)$(CMS_VERSION) 11 | 12 | .PHONY: codecept composer craft ecs mysql phpstan postgres rector ssh 13 | 14 | codecept: 15 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/codecept \ 16 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 17 | composer: 18 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data composer \ 19 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 20 | craft: 21 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data php craft \ 22 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 23 | ecs: 24 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/ecs \ 25 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 26 | mysql: 27 | cp config/_configs/mysql/db.php config/db.php 28 | cp config/_configs/mysql/general.php config/general.php 29 | docker restart $(QUEUE_CONTAINER) 30 | phpstan: 31 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/phpstan --memory-limit=1G \ 32 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | postgres: 34 | cp config/_configs/postgres/db.php config/db.php 35 | cp config/_configs/postgres/general.php config/general.php 36 | docker restart $(QUEUE_CONTAINER) 37 | rector: 38 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/rector \ 39 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 40 | ssh: 41 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data /bin/sh 42 | %: 43 | @: 44 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 45 | -------------------------------------------------------------------------------- /cms_v3/bootstrap.php: -------------------------------------------------------------------------------- 1 | safeLoad(); 16 | } 17 | 18 | // Define additional PHP constants 19 | // (see https://craftcms.com/docs/3.x/config/#php-constants) 20 | define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); 21 | -------------------------------------------------------------------------------- /cms_v3/buildchain/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Misc directories & files 27 | coverage/* 28 | .stylelintcache 29 | -------------------------------------------------------------------------------- /cms_v3/buildchain/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG=22-alpine 2 | FROM node:$TAG 3 | 4 | RUN npm install -g npm@^11.0.0 5 | 6 | WORKDIR /app/buildchain 7 | 8 | CMD ["run build"] 9 | 10 | ENTRYPOINT ["npm"] 11 | -------------------------------------------------------------------------------- /cms_v3/buildchain/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR_VERSION?=3 2 | TAG?=22-alpine 3 | CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-buildchain 4 | DEV_PORT?=400${MAJOR_VERSION} 5 | IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) 6 | IMAGE_NAME=${CONTAINER}:${TAG} 7 | DOCKER_RUN=docker container run --rm -it --network plugindev_default -l dev.orbstack.domains=vite_v${MAJOR_VERSION}.plugindev.local -v "${CURDIR}"/../:/app 8 | 9 | .PHONY: build clean dev image-build image-check npm ssh 10 | 11 | # Perform a dist build via npm run build 12 | build: image-check 13 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run build 14 | # Remove node_modules/ & package-lock.json 15 | clean: 16 | rm -rf node_modules/ 17 | rm -f package-lock.json 18 | # Run the development server via npm run dev 19 | dev: image-check 20 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} run dev 21 | # Build the Docker image & run npm install 22 | image-build: 23 | docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache 24 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install 25 | # Ensure the image has been created 26 | image-check: 27 | ifeq ($(IMAGE_INFO), []) 28 | image-check: image-build 29 | endif 30 | # Run the passed in npm command 31 | npm: image-check 32 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | # Run the passed in npx command 34 | npx: image-check 35 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -it --entrypoint=/usr/local/bin/npx ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 36 | # Open a shell inside of the container 37 | ssh: image-check 38 | ${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME} 39 | %: 40 | @: 41 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 42 | -------------------------------------------------------------------------------- /cms_v3/buildchain/README.md: -------------------------------------------------------------------------------- 1 | # Vite buildchain 2 | 3 | The buildchain is a self-contained build system for a demo Vite `^6.0.0` setup. 4 | 5 | ## Overview 6 | 7 | The buildchain exists primarily as testbed Vite setup for testing the Craft Vite plugin, as well as a general playground for using Vite. 8 | 9 | It uses: 10 | 11 | * Vite `^6.0.0` 12 | * TailwindCSS `^4.0.0` 13 | * Vue `^3.0.0` 14 | * `eslint`, `stylelint`, & `vue-tsc` code linting tools 15 | * TypeScript (latest) 16 | 17 | ## Prerequisites 18 | 19 | To run the buildchain for development purposes: 20 | 21 | - You must have [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or the equivalent) installed 22 | 23 | ## Commands 24 | 25 | This buildchain uses `make` as an interface to the buildchain. The following commands are available from the `buildchain/` directory: 26 | 27 | - `make build` - Do a distribution build of the static assets into `../web/dist/` 28 | - `make dev` - Start Vite HMR dev server for local development 29 | - `make clean` - Remove `node_modules/` and `package-lock.json` to start clean (need to run `make image-build` after doing this, see below) 30 | - `make npm XXX` - Run an `npm` command inside the container, e.g.: `make npm run lint` or `make npm install` 31 | - `make npx XXX` - Run an `npx` command inside the container, e.g.: `make npx @tailwindcss/upgrade@next` 32 | - `make ssh` - Open up a shell session into the buildchain Docker container 33 | - `make image-build` - Build the Docker image & run `npm install` 34 | 35 | ## File Structure 36 | 37 | Source files: 38 | 39 | `buildchain/src/` 40 | 41 | Built distribution files: 42 | 43 | `../web/dist/` 44 | 45 | ## Running 46 | 47 | To get the buildchain up and running, type the following into your terminal: 48 | 49 | ```bash 50 | make dev 51 | ``` 52 | 53 | This starts up the Vite dev server. 54 | 55 | The first time you do this, it may take some time to build the Docker container, and install all of the npm packages. Subsequent startup times will be much faster. 56 | 57 | ## Using 58 | 59 | The appropriate `config/vite.php` is already included in `plugindev`. The have the scripts load, just add this to your templates: 60 | 61 | ```twig 62 | {% block headScripts %} 63 | {{ craft.vite.script("src/js/app.ts") }} 64 | {{ craft.vite.script("src/js/welcome.ts") }} 65 | {% endblock headScripts %} 66 | ``` 67 | 68 | The `app.ts` just includes our CSS and an icon, while the `welcome.ts` mounts a Vue component that generates confetti. 69 | 70 | To get the confettit to appear, you just need to add the following to your template: 71 | 72 | ```twig 73 | {% block preContent %} 74 |
75 | {% endblock preContent %} 76 | ``` 77 | 78 | ...so that the Vue component has a root element to mount to. 79 | -------------------------------------------------------------------------------- /cms_v3/buildchain/eslint.config.js: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | import pluginVue from "eslint-plugin-vue"; 5 | 6 | 7 | /** @type {import('eslint').Linter.Config[]} */ 8 | export default [ 9 | {files: ["**/*.{js,mjs,cjs,ts,vue}"]}, 10 | {languageOptions: { globals: globals.browser }}, 11 | pluginJs.configs.recommended, 12 | ...tseslint.configs.recommended, 13 | ...pluginVue.configs["flat/essential"], 14 | {files: ["**/*.vue"], languageOptions: {parserOptions: {parser: tseslint.parser}}}, 15 | ]; -------------------------------------------------------------------------------- /cms_v3/buildchain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buildchain", 3 | "description": "A drop-in buildchain for using Vite in your Craft CMS plugins or modules", 4 | "type": "module", 5 | "author": { 6 | "email": "info@nystudio107.com", 7 | "name": "nystudio107", 8 | "url": "https://nystudio107.com" 9 | }, 10 | "dependencies": { 11 | "vue": "^3.2.0", 12 | "vue-confetti": "^2.0.8" 13 | }, 14 | "devDependencies": { 15 | "@eslint/js": "^9.19.0", 16 | "@types/node": "^22.0.0", 17 | "@tailwindcss/vite": "^4.0.0", 18 | "@vitejs/plugin-vue": "^5.0.0", 19 | "@vue/compiler-sfc": "^3.0.0", 20 | "eslint": "^9.19.0", 21 | "eslint-plugin-vue": "^9.0.0", 22 | "globals": "^15.0.0", 23 | "rollup-plugin-visualizer": "^5.0.0", 24 | "stylelint": "^16.0.0", 25 | "stylelint-config-recommended": "^15.0.0", 26 | "stylelint-config-recommended-vue": "^1.0.0", 27 | "stylelint-config-standard-scss": "^14.0.0", 28 | "tailwindcss": "^4.0.0", 29 | "typescript-eslint": "^8.0.0", 30 | "vite": "^6.0.0", 31 | "vite-plugin-checker": "^0.8.0", 32 | "vite-plugin-compression": "^0.5.0", 33 | "vite-plugin-manifest-sri": "^0.2.0", 34 | "vite-plugin-restart": "^0.4.0", 35 | "vue-tsc": "^2.0.0" 36 | }, 37 | "scripts": { 38 | "dev": "vite", 39 | "build": "vite build" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/app.css: -------------------------------------------------------------------------------- 1 | /** 2 | * app.css 3 | * 4 | * The entry point for the css. 5 | * 6 | */ 7 | 8 | @import "./tailwind-config.css"; 9 | 10 | @import "./components/webfonts.css"; 11 | @import "./components/typography.css"; 12 | @import "./components/global.css"; 13 | 14 | /** 15 | * Include styles for individual pages 16 | * 17 | */ 18 | @import "./pages/settings.css"; 19 | @import "./pages/welcome.css"; 20 | 21 | /** 22 | * Include vendor css. 23 | * 24 | */ 25 | @import "./vendor.css"; 26 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/components/global.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/global.css 3 | * 4 | * Project-wide styles 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/components/typography.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/typography.css 3 | * 4 | * Typography rules. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/components/webfonts.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/webfonts.css 3 | * 4 | * Project webfonts. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/pages/settings.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Settings page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/pages/welcome.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Welcome page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/tailwind-config.css: -------------------------------------------------------------------------------- 1 | /** 2 | * tailwind-config.css 3 | * 4 | * CSS-based configuration for Tailwind CSS 5 | * ref: https://tailwindcss.com/docs/theme 6 | */ 7 | 8 | @import "tailwindcss"; 9 | 10 | @source "../../../src/templates"; 11 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/css/vendor.css: -------------------------------------------------------------------------------- 1 | /** 2 | * vendor.css 3 | * 4 | * All vendor CSS is imported here. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/js/@types/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module "app"; 2 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/js/Confetti.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v3/buildchain/src/js/Confetti.ts -------------------------------------------------------------------------------- /cms_v3/buildchain/src/js/app.ts: -------------------------------------------------------------------------------- 1 | // Import our CSS 2 | import '@/css/app.css'; 3 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/js/welcome.ts: -------------------------------------------------------------------------------- 1 | import App from '@/vue/App.vue'; 2 | import { createApp } from 'vue'; 3 | 4 | // App main 5 | const main = async () => { 6 | // Create our vue instance 7 | const app = createApp(App); 8 | // Mount the app 9 | const root = app.mount('#app-container'); 10 | 11 | return root; 12 | }; 13 | 14 | // Execute async function 15 | main().then( () => { 16 | console.log(); 17 | }); 18 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/vue/@types/confetti.d.ts: -------------------------------------------------------------------------------- 1 | declare module "vue-confetti/src/confetti.js"; 2 | 3 | interface ConfettiInterface { 4 | start(opts: Partial): void, 5 | 6 | update(opts: Partial): void, 7 | 8 | stop(): void, 9 | } 10 | 11 | type ParticlesType = "circle" | "rect" | "heart" | "image"; 12 | 13 | interface ParticlesConfig { 14 | type: ParticlesType, 15 | size: number, 16 | dropRate: number, 17 | colors: string[], 18 | url: string | null, 19 | } 20 | 21 | interface ConfettiConfig { 22 | particles: Partial[], 23 | defaultType: ParticlesType, 24 | defaultSize: number, 25 | defaultDropRate: number, 26 | defaultColors: string[], 27 | canvasId: number, 28 | particlesPerFrame: number, 29 | } 30 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/vue/@types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { defineComponent } from "vue"; 3 | const Component : ReturnType; 4 | export default Component; 5 | } 6 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/vue/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /cms_v3/buildchain/src/vue/ConfettiParty.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /cms_v3/buildchain/stylelint.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | "extends": [ 4 | "stylelint-config-recommended", 5 | "stylelint-config-standard-scss", 6 | "stylelint-config-recommended-vue" 7 | ], 8 | "rules": { 9 | // For TailwindCSS @apply directive 10 | "at-rule-no-deprecated": { 11 | "ignoreAtRules": [ 12 | "apply" 13 | ], 14 | }, 15 | // For TailwindCSS theme() function properties 16 | "declaration-property-value-no-unknown": { 17 | "ignoreProperties": [ 18 | "/^theme/" 19 | ], 20 | }, 21 | // For TailwindCSS theme() function 22 | "function-no-unknown": { 23 | "ignoreFunctions": [ 24 | "theme" 25 | ] 26 | }, 27 | "scss/at-rule-no-unknown": [ 28 | true, 29 | { 30 | // For TailwindCSS custom @ directives 31 | "ignoreAtRules": [ 32 | "theme", 33 | "source", 34 | "utility", 35 | "variant", 36 | "custom-variant", 37 | "apply", 38 | "reference", 39 | "config", 40 | "plugin", 41 | ] 42 | } 43 | ], 44 | "no-invalid-position-at-import-rule": null, 45 | "block-no-empty": null, 46 | "selector-id-pattern": null, 47 | "selector-class-pattern": null, 48 | "no-descending-specificity": null, 49 | "font-family-no-missing-generic-family-keyword": null 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cms_v3/buildchain/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | '../src/templates/**/*.{twig,html}', 5 | './src/vue/**/*.{vue,html}', 6 | ], 7 | theme: { 8 | }, 9 | plugins: [], 10 | }; 11 | -------------------------------------------------------------------------------- /cms_v3/buildchain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true, 5 | "baseUrl": "node_modules", 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "experimentalDecorators": true, 9 | "importHelpers": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "noEmit": true, 13 | "noImplicitAny": true, 14 | "outDir": "../web/dist", 15 | "paths": { 16 | "@/*": [ 17 | "./src/*" 18 | ] 19 | }, 20 | "resolveJsonModule": true, 21 | "skipLibCheck": true, 22 | "sourceMap": true, 23 | "strict": true, 24 | "strictBindCallApply": true, 25 | "strictFunctionTypes": true, 26 | "strictNullChecks": true, 27 | "target": "esnext", 28 | "typeRoots": [ 29 | "node_modules/@types" 30 | ] 31 | }, 32 | "include": [ 33 | "./src/**/*.ts", 34 | "./src/**/*.vue" 35 | ], 36 | "exclude": [ 37 | "./node_modules" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /cms_v3/buildchain/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vite'; 2 | import checker from 'vite-plugin-checker'; 3 | import manifestSRI from 'vite-plugin-manifest-sri'; 4 | import tailwindcss from "@tailwindcss/vite"; 5 | import vue from '@vitejs/plugin-vue' 6 | import ViteRestart from 'vite-plugin-restart'; 7 | import {visualizer} from 'rollup-plugin-visualizer'; 8 | import viteCompression from 'vite-plugin-compression'; 9 | import * as path from 'path'; 10 | 11 | // https://vitejs.dev/config/ 12 | export default defineConfig(({command}) => ({ 13 | base: command === 'serve' ? '' : '/dist/', 14 | build: { 15 | emptyOutDir: true, 16 | manifest: 'manifest.json', 17 | outDir: '../web/dist', 18 | rollupOptions: { 19 | input: { 20 | app: 'src/js/app.ts', 21 | welcome: 'src/js/welcome.ts', 22 | }, 23 | }, 24 | sourcemap: true 25 | }, 26 | plugins: [ 27 | ViteRestart({ 28 | reload: [ 29 | '../templates/**/*', 30 | ], 31 | }), 32 | vue(), 33 | manifestSRI(), 34 | viteCompression({ 35 | filter: /\.(js|mjs|json|css|map)$/i 36 | }), 37 | visualizer({ 38 | filename: '../web/dist/stats.html', 39 | template: 'treemap', 40 | sourcemap: true, 41 | }), 42 | tailwindcss(), 43 | checker({ 44 | eslint: { 45 | lintCommand: 'eslint "./src/**/*.{js,ts}"', 46 | useFlatConfig: true, 47 | dev: { 48 | overrideConfig: { 49 | cache: true, 50 | } 51 | } 52 | }, 53 | stylelint: { 54 | lintCommand: 'stylelint ./src/**/*.{css,scss,sass,pcss} --fix', 55 | dev: { 56 | overrideConfig: { 57 | cache: true, 58 | } 59 | } 60 | }, 61 | typescript: true, 62 | vueTsc: true, 63 | }), 64 | ], 65 | resolve: { 66 | alias: { 67 | '@': path.resolve(__dirname, './src') 68 | }, 69 | preserveSymlinks: true, 70 | }, 71 | server: { 72 | // Allow cross-origin requests -- https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6 73 | allowedHosts: true, 74 | cors: { 75 | origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(localhost|\.local|\.test|\.ddev\.site)(?::\d+)?$/ 76 | }, 77 | fs: { 78 | strict: false 79 | }, 80 | headers: { 81 | "Access-Control-Allow-Private-Network": "true", 82 | }, 83 | host: '0.0.0.0', 84 | origin: 'http://localhost:' + process.env.DEV_PORT, 85 | port: parseInt(process.env.DEV_PORT), 86 | strictPort: true, 87 | } 88 | })); 89 | -------------------------------------------------------------------------------- /cms_v3/config/_configs/mysql/db.php: -------------------------------------------------------------------------------- 1 | App::env('DB_DSN') ?: null, 15 | 'driver' => 'mysql', 16 | 'server' => 'mysql', 17 | 'port' => 3306, 18 | 'database' => App::env('DB_DATABASE'), 19 | 'user' => App::env('DB_USER'), 20 | 'password' => App::env('DB_PASSWORD'), 21 | 'schema' => App::env('DB_SCHEMA'), 22 | 'tablePrefix' => App::env('DB_TABLE_PREFIX'), 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v3/config/_configs/mysql/general.php: -------------------------------------------------------------------------------- 1 | 'CraftSessionIdMySQL', 15 | // Craft config settings from .env variables 16 | 'aliases' => [ 17 | '@assetsUrl' => App::env('ASSETS_URL'), 18 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 19 | '@web' => App::env('SITE_URL'), 20 | '@webroot' => App::env('WEB_ROOT_PATH'), 21 | ], 22 | 'allowUpdates' => (bool)App::env('ALLOW_UPDATES'), 23 | 'allowAdminChanges' => (bool)App::env('ALLOW_ADMIN_CHANGES'), 24 | 'backupOnUpdate' => (bool)App::env('BACKUP_ON_UPDATE'), 25 | 'devMode' => (bool)App::env('DEV_MODE'), 26 | 'enableTemplateCaching' => (bool)App::env('ENABLE_TEMPLATE_CACHING'), 27 | 'resourceBasePath' => App::env('WEB_ROOT_PATH').'/cpresources', 28 | 'runQueueAutomatically' => (bool)App::env('RUN_QUEUE_AUTOMATICALLY'), 29 | 'securityKey' => App::env('SECURITY_KEY'), 30 | // Craft config settings from constants 31 | 'cacheDuration' => false, 32 | 'defaultSearchTermOptions' => [ 33 | 'subLeft' => true, 34 | 'subRight' => true, 35 | ], 36 | 'defaultTokenDuration' => 'P2W', 37 | 'enableCsrfProtection' => true, 38 | 'generateTransformsBeforePageLoad' => true, 39 | 'maxCachedCloudImageSize' => 3000, 40 | 'maxUploadFileSize' => '100M', 41 | 'omitScriptNameInUrls' => true, 42 | 'useEmailAsUsername' => false, 43 | 'usePathInfo' => true, 44 | ]; 45 | -------------------------------------------------------------------------------- /cms_v3/config/_configs/postgres/db.php: -------------------------------------------------------------------------------- 1 | App::env('DB_DSN') ?: null, 15 | 'driver' => 'pgsql', 16 | 'server' => 'postgres', 17 | 'port' => 5432, 18 | 'database' => App::env('DB_DATABASE'), 19 | 'user' => App::env('DB_USER'), 20 | 'password' => App::env('DB_PASSWORD'), 21 | 'schema' => App::env('DB_SCHEMA'), 22 | 'tablePrefix' => App::env('DB_TABLE_PREFIX'), 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v3/config/_configs/postgres/general.php: -------------------------------------------------------------------------------- 1 | 'CraftSessionIdPostgres', 15 | // Craft config settings from .env variables 16 | 'aliases' => [ 17 | '@assetsUrl' => App::env('ASSETS_URL'), 18 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 19 | '@web' => App::env('SITE_URL'), 20 | '@webroot' => App::env('WEB_ROOT_PATH'), 21 | ], 22 | 'allowUpdates' => (bool)App::env('ALLOW_UPDATES'), 23 | 'allowAdminChanges' => (bool)App::env('ALLOW_ADMIN_CHANGES'), 24 | 'backupOnUpdate' => (bool)App::env('BACKUP_ON_UPDATE'), 25 | 'devMode' => (bool)App::env('DEV_MODE'), 26 | 'enableTemplateCaching' => (bool)App::env('ENABLE_TEMPLATE_CACHING'), 27 | 'resourceBasePath' => App::env('WEB_ROOT_PATH').'/cpresources', 28 | 'runQueueAutomatically' => (bool)App::env('RUN_QUEUE_AUTOMATICALLY'), 29 | 'securityKey' => App::env('SECURITY_KEY'), 30 | // Craft config settings from constants 31 | 'cacheDuration' => false, 32 | 'defaultSearchTermOptions' => [ 33 | 'subLeft' => true, 34 | 'subRight' => true, 35 | ], 36 | 'defaultTokenDuration' => 'P2W', 37 | 'enableCsrfProtection' => true, 38 | 'generateTransformsBeforePageLoad' => true, 39 | 'maxCachedCloudImageSize' => 3000, 40 | 'maxUploadFileSize' => '100M', 41 | 'omitScriptNameInUrls' => true, 42 | 'useEmailAsUsername' => false, 43 | 'usePathInfo' => true, 44 | ]; 45 | -------------------------------------------------------------------------------- /cms_v3/config/app.console.php: -------------------------------------------------------------------------------- 1 | App::env('APP_ID') ?: 'CraftCMS', 24 | 'modules' => [ 25 | 'site-module' => [ 26 | 'class' => \modules\sitemodule\SiteModule::class, 27 | ], 28 | ], 29 | 'bootstrap' => ['site-module'], 30 | 'components' => [ 31 | 'cache' => [ 32 | 'class' => yii\redis\Cache::class, 33 | 'keyPrefix' => App::env('APP_ID') ?: 'CraftCMS', 34 | 'redis' => [ 35 | 'hostname' => App::env('REDIS_HOSTNAME'), 36 | 'port' => App::env('REDIS_PORT'), 37 | 'database' => App::env('REDIS_CRAFT_DB'), 38 | ], 39 | ], 40 | 'deprecator' => [ 41 | 'throwExceptions' => App::env('DEV_MODE'), 42 | ], 43 | 'queue' => [ 44 | 'class' => craft\queue\Queue::class, 45 | 'ttr' => 10 * 60, 46 | ], 47 | 'redis' => [ 48 | 'class' => yii\redis\Connection::class, 49 | 'hostname' => App::env('REDIS_HOSTNAME'), 50 | 'port' => App::env('REDIS_PORT'), 51 | 'database' => App::env('REDIS_DEFAULT_DB'), 52 | ], 53 | ], 54 | ]; 55 | -------------------------------------------------------------------------------- /cms_v3/config/app.web.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'session' => static function() { 23 | // Get the default component config 24 | $config = App::sessionConfig(); 25 | // Override the class to use Redis' session class and our config settings 26 | $config['class'] = yii\redis\Session::class; 27 | $config['keyPrefix'] = App::env('APP_ID') ?: 'CraftCMS'; 28 | $config['redis'] = [ 29 | 'hostname' => App::env('REDIS_HOSTNAME'), 30 | 'port' => App::env('REDIS_PORT'), 31 | 'database' => App::env('REDIS_DEFAULT_DB'), 32 | ]; 33 | // Instantiate and return it 34 | return Craft::createObject($config); 35 | }, 36 | ], 37 | ]; 38 | -------------------------------------------------------------------------------- /cms_v3/config/db.php: -------------------------------------------------------------------------------- 1 | App::env('DB_DSN') ?: null, 15 | 'driver' => 'mysql', 16 | 'server' => 'mysql', 17 | 'port' => 3306, 18 | 'database' => App::env('DB_DATABASE'), 19 | 'user' => App::env('DB_USER'), 20 | 'password' => App::env('DB_PASSWORD'), 21 | 'schema' => App::env('DB_SCHEMA'), 22 | 'tablePrefix' => App::env('DB_TABLE_PREFIX'), 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v3/config/fastcgi-cache-bust.php: -------------------------------------------------------------------------------- 1 | App::env('FAST_CGI_CACHE_PATH'), 30 | ]; 31 | -------------------------------------------------------------------------------- /cms_v3/config/general.php: -------------------------------------------------------------------------------- 1 | 'CraftSessionIdMySQL', 15 | // Craft config settings from .env variables 16 | 'aliases' => [ 17 | '@assetsUrl' => App::env('ASSETS_URL'), 18 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 19 | '@web' => App::env('SITE_URL'), 20 | '@webroot' => App::env('WEB_ROOT_PATH'), 21 | ], 22 | 'allowUpdates' => (bool)App::env('ALLOW_UPDATES'), 23 | 'allowAdminChanges' => (bool)App::env('ALLOW_ADMIN_CHANGES'), 24 | 'backupOnUpdate' => (bool)App::env('BACKUP_ON_UPDATE'), 25 | 'devMode' => (bool)App::env('DEV_MODE'), 26 | 'enableGraphqlCaching' => (bool)App::env('ENABLE_GRAPHQL_CACHING'), 27 | 'enableTemplateCaching' => (bool)App::env('ENABLE_TEMPLATE_CACHING'), 28 | 'resourceBasePath' => App::env('WEB_ROOT_PATH').'/cpresources', 29 | 'runQueueAutomatically' => (bool)App::env('RUN_QUEUE_AUTOMATICALLY'), 30 | 'securityKey' => App::env('SECURITY_KEY'), 31 | // Craft config settings from constants 32 | 'cacheDuration' => false, 33 | 'defaultSearchTermOptions' => [ 34 | 'subLeft' => true, 35 | 'subRight' => true, 36 | ], 37 | 'defaultTokenDuration' => 'P2W', 38 | 'enableCsrfProtection' => true, 39 | 'generateTransformsBeforePageLoad' => true, 40 | 'maxCachedCloudImageSize' => 3000, 41 | 'maxUploadFileSize' => '100M', 42 | 'omitScriptNameInUrls' => true, 43 | 'useEmailAsUsername' => false, 44 | 'usePathInfo' => true, 45 | 'useProjectConfigFile' => true, 46 | 'requireMatchingUserAgentForSession' => false, 47 | 'rememberedUserSessionDuration' => 31536000, 48 | ]; 49 | -------------------------------------------------------------------------------- /cms_v3/config/htmlpurifier/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "Attr.AllowedFrameTargets": [ 3 | "_blank" 4 | ], 5 | "Attr.EnableID": true, 6 | "HTML.AllowedComments": [ 7 | "pagebreak" 8 | ], 9 | "HTML.SafeIframe": true, 10 | "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%" 11 | } 12 | -------------------------------------------------------------------------------- /cms_v3/config/redactor/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": [ 3 | "html", 4 | "formatting", 5 | "bold", 6 | "italic", 7 | "unorderedlist", 8 | "orderedlist", 9 | "link", 10 | "image", 11 | "video" 12 | ], 13 | "plugins": [ 14 | "fullscreen", 15 | "video", 16 | "richvariables" 17 | ], 18 | "linkNewTab": true, 19 | "toolbarFixed": true 20 | } 21 | -------------------------------------------------------------------------------- /cms_v3/config/redactor/Simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": ["bold", "italic"], 3 | "toolbarFixed": true, 4 | "plugins": ["richvariables"] 5 | } 6 | -------------------------------------------------------------------------------- /cms_v3/config/routes.php: -------------------------------------------------------------------------------- 1 | ' => ['template' => 'blog/_archive'], 15 | * 16 | * That example would match URIs such as `/blog/archive/2012`, and pass the 17 | * request along to the `blog/_archive` template, providing it a `year` variable 18 | * set to the value `2012`. 19 | */ 20 | 21 | return [ 22 | 'amp' => ['template' => 'amp-index'], 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v3/config/seomatic-config/globalmeta/Creator.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'siteType' => 'Organization', 21 | 'siteSubType' => '', 22 | 'siteSpecificType' => '', 23 | 'computedType' => 'Organization', 24 | 'genericName' => 'nystudio107', 25 | 'genericAlternateName' => 'nys', 26 | 'genericDescription' => 'We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO', 27 | 'genericUrl' => 'https://nystudio107.com/', 28 | 'genericImage' => 'https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png', 29 | 'genericImageWidth' => '1042', 30 | 'genericImageHeight' => '1042', 31 | 'genericImageIds' => [], 32 | 'genericTelephone' => '', 33 | 'genericEmail' => 'info@nystudio107.com', 34 | 'genericStreetAddress' => '', 35 | 'genericAddressLocality' => 'Webster', 36 | 'genericAddressRegion' => 'NY', 37 | 'genericPostalCode' => '14580', 38 | 'genericAddressCountry' => 'US', 39 | 'genericGeoLatitude' => '43.2365384', 40 | 'genericGeoLongitude' => '-77.49211620000001', 41 | 'personGender' => '', 42 | 'personBirthPlace' => '', 43 | 'organizationDuns' => '', 44 | 'organizationFounder' => 'Andrew Welch, Polly Welch', 45 | 'organizationFoundingDate' => '2013-05-02', 46 | 'organizationFoundingLocation' => 'Webster, NY', 47 | 'organizationContactPoints' => [], 48 | 'corporationTickerSymbol' => '', 49 | 'localBusinessPriceRange' => '', 50 | 'localBusinessOpeningHours' => [], 51 | 'restaurantServesCuisine' => '', 52 | 'restaurantMenuUrl' => '', 53 | 'restaurantReservationsUrl' => '', 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /cms_v3/config/twigpack.php: -------------------------------------------------------------------------------- 1 | App::env('DEV_MODE'), 31 | // The JavaScript entry from the manifest.json to inject on Twig error pages 32 | 'errorEntry' => ['runtime.js', 'app.js'], 33 | // Manifest file names 34 | 'manifest' => [ 35 | 'legacy' => 'manifest-legacy.json', 36 | 'modern' => 'manifest.json', 37 | ], 38 | // Public server config 39 | 'server' => [ 40 | 'manifestPath' => '@webroot/dist/', 41 | 'publicPath' => '/', 42 | ], 43 | // webpack-dev-server config 44 | 'devServer' => [ 45 | 'manifestPath' => App::env('TWIGPACK_DEV_SERVER_MANIFEST_PATH'), 46 | 'publicPath' => App::env('TWIGPACK_DEV_SERVER_PUBLIC_PATH'), 47 | ], 48 | // Bundle to use with the webpack-dev-server 49 | 'devServerBuildType' => 'modern', 50 | // Whether to include a Content Security Policy "nonce" for inline 51 | // CSS or JavaScript. Valid values are 'header' or 'tag' for how the CSP 52 | // should be included. c.f.: 53 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#Unsafe_inline_script 54 | 'cspNonce' => '', 55 | // Local files config 56 | 'localFiles' => [ 57 | 'basePath' => '@webroot/', 58 | 'criticalPrefix' => 'dist/criticalcss/', 59 | 'criticalSuffix' => '_critical.min.css', 60 | ], 61 | ]; 62 | -------------------------------------------------------------------------------- /cms_v3/craft: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 16 | exit($exitCode); 17 | -------------------------------------------------------------------------------- /cms_v3/craft.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Craft command line bootstrap script for Windows 5 | rem ------------------------------------------------------------- 6 | 7 | @setlocal 8 | 9 | set CRAFT_PATH=%~dp0 10 | 11 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 12 | 13 | "%PHP_COMMAND%" "%CRAFT_PATH%craft" %* 14 | 15 | @endlocal 16 | -------------------------------------------------------------------------------- /cms_v3/ecs.php: -------------------------------------------------------------------------------- 1 | parallel(); 8 | $ecsConfig->sets([SetList::CRAFT_CMS_3]); 9 | }; 10 | -------------------------------------------------------------------------------- /cms_v3/example.env: -------------------------------------------------------------------------------- 1 | # Craft general settings 2 | ALLOW_UPDATES=1 3 | ALLOW_ADMIN_CHANGES=1 4 | APP_ID=project_v3 5 | BACKUP_ON_UPDATE=0 6 | DEV_MODE=1 7 | ENABLE_GRAPHQL_CACHING=0 8 | ENABLE_TEMPLATE_CACHING=0 9 | ENVIRONMENT=dev 10 | RUN_QUEUE_AUTOMATICALLY=0 11 | SECURITY_KEY=EOdiVBONceb8zFGJP7InMui2pMkvNACz 12 | SITE_NAME=plugindev 13 | 14 | # Craft database settings 15 | DB_USER=project 16 | DB_PASSWORD=project 17 | DB_DATABASE=project_v3 18 | DB_SCHEMA=public 19 | DB_TABLE_PREFIX= 20 | 21 | # URL & path settings 22 | ASSETS_URL=http://plugindev.local:8003 23 | SITE_URL=http://plugindev.local:8003 24 | WEB_ROOT_PATH=/var/www/project/cms_v3/web 25 | CMS_ROOT_PATH=/var/www/project/cms_v3 26 | 27 | # Redis settings 28 | REDIS_HOSTNAME=redis 29 | REDIS_PORT=6379 30 | REDIS_DEFAULT_DB=0 31 | REDIS_CRAFT_DB=1 32 | 33 | # Xdebug Settings 34 | DBGP_IDEKEY=phpstorm 35 | 36 | # Plugin debug 37 | NYS_PLUGIN_DEVSERVER=1 38 | VITE_PLUGIN_DEVSERVER=1 39 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/.craftplugin: -------------------------------------------------------------------------------- 1 | {"pluginName":"Site","pluginDescription":"An example module for Craft CMS 3 that lets you enhance your websites with a custom site module","pluginVersion":"1.0.0","pluginAuthorName":"nystudio107","pluginVendorName":"nystudio107","pluginAuthorUrl":"https://nystudio107.com/","codeComments":[],"pluginComponents":[],"apiVersion":"module_api_version_3_0"} -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/.gitignore: -------------------------------------------------------------------------------- 1 | # CRAFT ENVIRONMENT 2 | .env.php 3 | .env.sh 4 | .env 5 | 6 | # COMPOSER 7 | /vendor 8 | 9 | # BUILD FILES 10 | /bower_components/* 11 | /node_modules/* 12 | /build/* 13 | /yarn-error.log 14 | 15 | # MISC FILES 16 | .cache 17 | .DS_Store 18 | .idea 19 | .project 20 | .settings 21 | *.esproj 22 | *.sublime-workspace 23 | *.sublime-project 24 | *.tmproj 25 | *.tmproject 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | config.codekit3 32 | prepros-6.config 33 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Site Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## 1.0.0 - 2018-01-19 8 | ### Added 9 | - Initial release 10 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 nystudio107 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/README.md: -------------------------------------------------------------------------------- 1 | # Site module for Craft CMS 3.x 2 | 3 | An example module for Craft CMS 3 that lets you enhance your websites with a custom site module 4 | 5 | ## Requirements 6 | 7 | This module requires Craft CMS 3.0.0-RC1 or later. 8 | 9 | ## Installation 10 | 11 | To install the module, follow these instructions. 12 | 13 | First, you'll need to add the contents of the `app.php` file to your `config/app.php` (or just copy it there if it does not exist). This ensures that your module will get loaded for each request. The file might look something like this: 14 | ``` 15 | return [ 16 | 'modules' => [ 17 | 'site-module' => [ 18 | 'class' => \modules\sitemodule\SiteModule::class, 19 | ], 20 | ], 21 | 'bootstrap' => ['site-module'], 22 | ]; 23 | ``` 24 | You'll also need to make sure that you add the following to your project's `composer.json` file so that Composer can find your module: 25 | 26 | "autoload": { 27 | "psr-4": { 28 | "modules\\sitemodule\\": "modules/sitemodule/src/" 29 | } 30 | }, 31 | 32 | After you have added this, you will need to do: 33 | 34 | composer dump-autoload 35 | 36 | …from the project’s root directory, to rebuild the Composer autoload map. This will happen automatically any time you do a `composer install` or `composer update` as well. 37 | 38 | ## Site Overview 39 | 40 | -Insert text here- 41 | 42 | ## Using Site 43 | 44 | -Insert text here- 45 | 46 | ## Site Roadmap 47 | 48 | Some things to do, and ideas for potential features: 49 | 50 | * Release it 51 | 52 | Brought to you by [nystudio107](https://nystudio107.com/) 53 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/assetbundles/sitemodule/SiteModuleAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = "@modules/sitemodule/assetbundles/sitemodule/dist"; 33 | 34 | $this->depends = [ 35 | CpAsset::class, 36 | ]; 37 | 38 | $this->js = [ 39 | 'js/SiteModule.js', 40 | ]; 41 | 42 | $this->css = [ 43 | 'css/SiteModule.css', 44 | ]; 45 | 46 | parent::init(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/assetbundles/sitemodule/dist/css/SiteModule.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site CSS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | 13 | body.login { 14 | background-color: #FFF; 15 | background-image: url('/img/site/login-background-image.png'); 16 | } 17 | 18 | body.login label, body.login #forgot-password { 19 | background-color: #FFF; 20 | } 21 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/assetbundles/sitemodule/dist/img/SiteModule-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/assetbundles/sitemodule/dist/js/SiteModule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/config.php: -------------------------------------------------------------------------------- 1 | getConfig()->env; 44 | 45 | // Try craft/config first 46 | $path = Craft::getAlias('@config/'.$fileName, false); 47 | if ($path === false || !file_exists($path)) { 48 | // Now try our own internal config 49 | $path = Craft::getAlias('@modules/sitemodule/'.$fileName, false); 50 | if ($path === false || !file_exists($path)) { 51 | return []; 52 | } 53 | } 54 | 55 | if (!is_array($config = @include $path)) { 56 | return []; 57 | } 58 | 59 | // If it's not a multi-environment config, return the whole thing 60 | if (!array_key_exists('*', $config)) { 61 | return $config; 62 | } 63 | 64 | // If no environment was specified, just look in the '*' array 65 | if ($currentEnv === null) { 66 | return $config['*']; 67 | } 68 | 69 | $mergedConfig = []; 70 | foreach ($config as $env => $envConfig) { 71 | if ($env === '*' || StringHelper::contains($currentEnv, $env)) { 72 | $mergedConfig = ArrayHelper::merge($mergedConfig, $envConfig); 73 | } 74 | } 75 | 76 | return $mergedConfig; 77 | } 78 | 79 | // Private Methods 80 | // ========================================================================= 81 | } 82 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/services/Helper.php: -------------------------------------------------------------------------------- 1 | 'Site plugin loaded', 18 | ]; 19 | -------------------------------------------------------------------------------- /cms_v3/modules/sitemodule/src/variables/SiteVariable.php: -------------------------------------------------------------------------------- 1 | parameters(); 11 | /** @noinspection PhpParamsInspection */ 12 | $parameters->set(Option::SKIP, [ 13 | // Relative paths need to be used here because the plugin repo directories are aliased 14 | '../../../../Users/andrew/webdev/craft_v4/craft-seomatic/src/integrations', 15 | '../../../../Users/andrew/webdev/craft_v4/craft-seomatic/src/models/jsonld', 16 | ]); 17 | 18 | // Craft Version 19 | $containerConfigurator->import(CraftSetList::CRAFT_CMS_40); 20 | $containerConfigurator->import(CraftSetList::CRAFT_COMMERCE_40); 21 | /* 22 | * Additional Rector set lists that can be uncommented to modernize code beyond 23 | * Craft CMS 4 compatibility 24 | 25 | // PHP Version 26 | $containerConfigurator->import(LevelSetList::UP_TO_PHP_80); 27 | // Other 28 | $containerConfigurator->import(SetList::CODE_QUALITY); 29 | $containerConfigurator->import(SetList::CODING_STYLE); 30 | $containerConfigurator->import(SetList::DEAD_CODE); 31 | $containerConfigurator->import(SetList::TYPE_DECLARATION); 32 | */ 33 | }; 34 | -------------------------------------------------------------------------------- /cms_v3/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v3/templates/.gitkeep -------------------------------------------------------------------------------- /cms_v3/templates/blog/_entry.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

{{ entry.plainText }}

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v3/templates/blog/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

Blog Index

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v3/templates/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v3/web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | # Send would-be 404 requests to Craft 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] 8 | RewriteRule (.+) index.php?p=$1 [QSA,L] 9 | 10 | -------------------------------------------------------------------------------- /cms_v3/web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v3/web/cpresources/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v3/web/img/site/login-background-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v3/web/img/site/login-background-image.png -------------------------------------------------------------------------------- /cms_v3/web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /cms_v3/web/offline.svg: -------------------------------------------------------------------------------- 1 | Offlineoffline 2 | -------------------------------------------------------------------------------- /cms_v3/web/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /cms_v4/Makefile: -------------------------------------------------------------------------------- 1 | SEPARATOR:=- 2 | PROJECT_NAME?=$(shell basename $(dir $(CURDIR))) 3 | PROJECT_DIR?=/var/www/project/ 4 | SERVICE_NAME?=php 5 | QUEUE_SERVICE_NAME?=queue 6 | CMS_ROOT_NAME?=cms_ 7 | CMS_VERSION:=v4 8 | CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 9 | QUEUE_CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(QUEUE_SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 10 | CMS_DIR:=$(CMS_ROOT_NAME)$(CMS_VERSION) 11 | 12 | .PHONY: codecept composer craft ecs mysql phpstan postgres rector ssh 13 | 14 | codecept: 15 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/codecept \ 16 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 17 | composer: 18 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data composer \ 19 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 20 | craft: 21 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data php craft \ 22 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 23 | ecs: 24 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/ecs \ 25 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 26 | mysql: 27 | cp config/_configs/mysql/db.php config/db.php 28 | cp config/_configs/mysql/general.php config/general.php 29 | docker restart $(QUEUE_CONTAINER) 30 | pest: 31 | docker exec -it -e PROJECT_VENDOR_DIR=$(PROJECT_VENDOR_DIR) -w $(PROJECT_DIR)$(CMS_DIR) $(DEBUG_CONTAINER) su-exec www-data vendor/bin/pest \ 32 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | phpstan: 34 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/phpstan --memory-limit=1G \ 35 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 36 | postgres: 37 | cp config/_configs/postgres/db.php config/db.php 38 | cp config/_configs/postgres/general.php config/general.php 39 | docker restart $(QUEUE_CONTAINER) 40 | rector: 41 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/rector \ 42 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 43 | ssh: 44 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data /bin/sh 45 | %: 46 | @: 47 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 48 | -------------------------------------------------------------------------------- /cms_v4/bootstrap.php: -------------------------------------------------------------------------------- 1 | safeLoad(); 16 | } 17 | 18 | // Define additional PHP constants 19 | // (see https://craftcms.com/docs/3.x/config/#php-constants) 20 | define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); 21 | -------------------------------------------------------------------------------- /cms_v4/buildchain/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Misc directories & files 27 | coverage/* 28 | .stylelintcache 29 | -------------------------------------------------------------------------------- /cms_v4/buildchain/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG=22-alpine 2 | FROM node:$TAG 3 | 4 | RUN npm install -g npm@^11.0.0 5 | 6 | WORKDIR /app/buildchain 7 | 8 | CMD ["run build"] 9 | 10 | ENTRYPOINT ["npm"] 11 | -------------------------------------------------------------------------------- /cms_v4/buildchain/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR_VERSION?=4 2 | TAG?=22-alpine 3 | CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-buildchain 4 | DEV_PORT?=400${MAJOR_VERSION} 5 | IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) 6 | IMAGE_NAME=${CONTAINER}:${TAG} 7 | DOCKER_RUN=docker container run --rm -it --network plugindev_default -l dev.orbstack.domains=vite_v${MAJOR_VERSION}.plugindev.local -v "${CURDIR}"/../:/app 8 | 9 | .PHONY: build clean dev image-build image-check npm ssh 10 | 11 | # Perform a dist build via npm run build 12 | build: image-check 13 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run build 14 | # Remove node_modules/ & package-lock.json 15 | clean: 16 | rm -rf node_modules/ 17 | rm -f package-lock.json 18 | # Run the development server via npm run dev 19 | dev: image-check 20 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} run dev 21 | # Build the Docker image & run npm install 22 | image-build: 23 | docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache 24 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install 25 | # Ensure the image has been created 26 | image-check: 27 | ifeq ($(IMAGE_INFO), []) 28 | image-check: image-build 29 | endif 30 | # Run the passed in npm command 31 | npm: image-check 32 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | # Run the passed in npx command 34 | npx: image-check 35 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -it --entrypoint=/usr/local/bin/npx ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 36 | # Open a shell inside of the container 37 | ssh: image-check 38 | ${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME} 39 | %: 40 | @: 41 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 42 | -------------------------------------------------------------------------------- /cms_v4/buildchain/README.md: -------------------------------------------------------------------------------- 1 | # Vite buildchain 2 | 3 | The buildchain is a self-contained build system for a demo Vite `^6.0.0` setup. 4 | 5 | ## Overview 6 | 7 | The buildchain exists primarily as testbed Vite setup for testing the Craft Vite plugin, as well as a general playground for using Vite. 8 | 9 | It uses: 10 | 11 | * Vite `^6.0.0` 12 | * TailwindCSS `^4.0.0` 13 | * Vue `^3.0.0` 14 | * `eslint`, `stylelint`, & `vue-tsc` code linting tools 15 | * TypeScript (latest) 16 | 17 | ## Prerequisites 18 | 19 | To run the buildchain for development purposes: 20 | 21 | - You must have [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or the equivalent) installed 22 | 23 | ## Commands 24 | 25 | This buildchain uses `make` as an interface to the buildchain. The following commands are available from the `buildchain/` directory: 26 | 27 | - `make build` - Do a distribution build of the static assets into `../web/dist/` 28 | - `make dev` - Start Vite HMR dev server for local development 29 | - `make clean` - Remove `node_modules/` and `package-lock.json` to start clean (need to run `make image-build` after doing this, see below) 30 | - `make npm XXX` - Run an `npm` command inside the container, e.g.: `make npm run lint` or `make npm install` 31 | - `make npx XXX` - Run an `npx` command inside the container, e.g.: `make npx @tailwindcss/upgrade@next` 32 | - `make ssh` - Open up a shell session into the buildchain Docker container 33 | - `make image-build` - Build the Docker image & run `npm install` 34 | 35 | ## File Structure 36 | 37 | Source files: 38 | 39 | `buildchain/src/` 40 | 41 | Built distribution files: 42 | 43 | `../web/dist/` 44 | 45 | ## Running 46 | 47 | To get the buildchain up and running, type the following into your terminal: 48 | 49 | ```bash 50 | make dev 51 | ``` 52 | 53 | This starts up the Vite dev server. 54 | 55 | The first time you do this, it may take some time to build the Docker container, and install all of the npm packages. Subsequent startup times will be much faster. 56 | 57 | ## Using 58 | 59 | The appropriate `config/vite.php` is already included in `plugindev`. The have the scripts load, just add this to your templates: 60 | 61 | ```twig 62 | {% block headScripts %} 63 | {{ craft.vite.script("src/js/app.ts") }} 64 | {{ craft.vite.script("src/js/welcome.ts") }} 65 | {% endblock headScripts %} 66 | ``` 67 | 68 | The `app.ts` just includes our CSS and an icon, while the `welcome.ts` mounts a Vue component that generates confetti. 69 | 70 | To get the confettit to appear, you just need to add the following to your template: 71 | 72 | ```twig 73 | {% block preContent %} 74 |
75 | {% endblock preContent %} 76 | ``` 77 | 78 | ...so that the Vue component has a root element to mount to. 79 | -------------------------------------------------------------------------------- /cms_v4/buildchain/eslint.config.js: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | import pluginVue from "eslint-plugin-vue"; 5 | 6 | 7 | /** @type {import('eslint').Linter.Config[]} */ 8 | export default [ 9 | {files: ["**/*.{js,mjs,cjs,ts,vue}"]}, 10 | {languageOptions: { globals: globals.browser }}, 11 | pluginJs.configs.recommended, 12 | ...tseslint.configs.recommended, 13 | ...pluginVue.configs["flat/essential"], 14 | {files: ["**/*.vue"], languageOptions: {parserOptions: {parser: tseslint.parser}}}, 15 | ]; -------------------------------------------------------------------------------- /cms_v4/buildchain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buildchain", 3 | "description": "A drop-in buildchain for using Vite in your Craft CMS plugins or modules", 4 | "type": "module", 5 | "author": { 6 | "email": "info@nystudio107.com", 7 | "name": "nystudio107", 8 | "url": "https://nystudio107.com" 9 | }, 10 | "dependencies": { 11 | "vue": "^3.2.0", 12 | "vue-confetti": "^2.0.8" 13 | }, 14 | "devDependencies": { 15 | "@eslint/js": "^9.19.0", 16 | "@types/node": "^22.0.0", 17 | "@tailwindcss/vite": "^4.0.0", 18 | "@vitejs/plugin-vue": "^5.0.0", 19 | "@vue/compiler-sfc": "^3.0.0", 20 | "eslint": "^9.19.0", 21 | "eslint-plugin-vue": "^9.0.0", 22 | "globals": "^15.0.0", 23 | "rollup-plugin-visualizer": "^5.0.0", 24 | "stylelint": "^16.0.0", 25 | "stylelint-config-recommended": "^15.0.0", 26 | "stylelint-config-recommended-vue": "^1.0.0", 27 | "stylelint-config-standard-scss": "^14.0.0", 28 | "tailwindcss": "^4.0.0", 29 | "typescript-eslint": "^8.0.0", 30 | "vite": "^6.0.0", 31 | "vite-plugin-checker": "^0.8.0", 32 | "vite-plugin-compression": "^0.5.0", 33 | "vite-plugin-manifest-sri": "^0.2.0", 34 | "vite-plugin-restart": "^0.4.0", 35 | "vue-tsc": "^2.0.0" 36 | }, 37 | "scripts": { 38 | "dev": "vite", 39 | "build": "vite build" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/app.css: -------------------------------------------------------------------------------- 1 | /** 2 | * app.css 3 | * 4 | * The entry point for the css. 5 | * 6 | */ 7 | 8 | @import "./tailwind-config.css"; 9 | 10 | @import "./components/webfonts.css"; 11 | @import "./components/typography.css"; 12 | @import "./components/global.css"; 13 | 14 | /** 15 | * Include styles for individual pages 16 | * 17 | */ 18 | @import "./pages/settings.css"; 19 | @import "./pages/welcome.css"; 20 | 21 | /** 22 | * Include vendor css. 23 | * 24 | */ 25 | @import "./vendor.css"; 26 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/components/global.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/global.css 3 | * 4 | * Project-wide styles 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/components/typography.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/typography.css 3 | * 4 | * Typography rules. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/components/webfonts.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/webfonts.css 3 | * 4 | * Project webfonts. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/pages/settings.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Settings page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/pages/welcome.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Welcome page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/tailwind-config.css: -------------------------------------------------------------------------------- 1 | /** 2 | * tailwind-config.css 3 | * 4 | * CSS-based configuration for Tailwind CSS 5 | * ref: https://tailwindcss.com/docs/theme 6 | */ 7 | 8 | @import "tailwindcss"; 9 | 10 | @source "../../../src/templates"; 11 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/css/vendor.css: -------------------------------------------------------------------------------- 1 | /** 2 | * vendor.css 3 | * 4 | * All vendor CSS is imported here. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/js/@types/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module "app"; 2 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/js/Confetti.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v4/buildchain/src/js/Confetti.ts -------------------------------------------------------------------------------- /cms_v4/buildchain/src/js/app.ts: -------------------------------------------------------------------------------- 1 | // Import our CSS 2 | import '@/css/app.css'; 3 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/js/welcome.ts: -------------------------------------------------------------------------------- 1 | import App from '@/vue/App.vue'; 2 | import { createApp } from 'vue'; 3 | 4 | // App main 5 | const main = async () => { 6 | // Create our vue instance 7 | const app = createApp(App); 8 | // Mount the app 9 | const root = app.mount('#app-container'); 10 | 11 | return root; 12 | }; 13 | 14 | // Execute async function 15 | main().then( () => { 16 | console.log(); 17 | }); 18 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/vue/@types/confetti.d.ts: -------------------------------------------------------------------------------- 1 | declare module "vue-confetti/src/confetti.js"; 2 | 3 | interface ConfettiInterface { 4 | start(opts: Partial): void, 5 | 6 | update(opts: Partial): void, 7 | 8 | stop(): void, 9 | } 10 | 11 | type ParticlesType = "circle" | "rect" | "heart" | "image"; 12 | 13 | interface ParticlesConfig { 14 | type: ParticlesType, 15 | size: number, 16 | dropRate: number, 17 | colors: string[], 18 | url: string | null, 19 | } 20 | 21 | interface ConfettiConfig { 22 | particles: Partial[], 23 | defaultType: ParticlesType, 24 | defaultSize: number, 25 | defaultDropRate: number, 26 | defaultColors: string[], 27 | canvasId: number, 28 | particlesPerFrame: number, 29 | } 30 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/vue/@types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { defineComponent } from "vue"; 3 | const Component : ReturnType; 4 | export default Component; 5 | } 6 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/vue/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /cms_v4/buildchain/src/vue/ConfettiParty.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /cms_v4/buildchain/stylelint.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | "extends": [ 4 | "stylelint-config-recommended", 5 | "stylelint-config-standard-scss", 6 | "stylelint-config-recommended-vue" 7 | ], 8 | "rules": { 9 | // For TailwindCSS @apply directive 10 | "at-rule-no-deprecated": { 11 | "ignoreAtRules": [ 12 | "apply" 13 | ], 14 | }, 15 | // For TailwindCSS theme() function properties 16 | "declaration-property-value-no-unknown": { 17 | "ignoreProperties": [ 18 | "/^theme/" 19 | ], 20 | }, 21 | // For TailwindCSS theme() function 22 | "function-no-unknown": { 23 | "ignoreFunctions": [ 24 | "theme" 25 | ] 26 | }, 27 | "scss/at-rule-no-unknown": [ 28 | true, 29 | { 30 | // For TailwindCSS custom @ directives 31 | "ignoreAtRules": [ 32 | "theme", 33 | "source", 34 | "utility", 35 | "variant", 36 | "custom-variant", 37 | "apply", 38 | "reference", 39 | "config", 40 | "plugin", 41 | ] 42 | } 43 | ], 44 | "no-invalid-position-at-import-rule": null, 45 | "block-no-empty": null, 46 | "selector-id-pattern": null, 47 | "selector-class-pattern": null, 48 | "no-descending-specificity": null, 49 | "font-family-no-missing-generic-family-keyword": null 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cms_v4/buildchain/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | '../src/templates/**/*.{twig,html}', 5 | './src/vue/**/*.{vue,html}', 6 | ], 7 | theme: { 8 | }, 9 | plugins: [], 10 | }; 11 | -------------------------------------------------------------------------------- /cms_v4/buildchain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true, 5 | "baseUrl": "node_modules", 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "experimentalDecorators": true, 9 | "importHelpers": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "noEmit": true, 13 | "noImplicitAny": true, 14 | "outDir": "../web/dist", 15 | "paths": { 16 | "@/*": [ 17 | "./src/*" 18 | ] 19 | }, 20 | "resolveJsonModule": true, 21 | "skipLibCheck": true, 22 | "sourceMap": true, 23 | "strict": true, 24 | "strictBindCallApply": true, 25 | "strictFunctionTypes": true, 26 | "strictNullChecks": true, 27 | "target": "esnext", 28 | "typeRoots": [ 29 | "node_modules/@types" 30 | ] 31 | }, 32 | "include": [ 33 | "./src/**/*.ts", 34 | "./src/**/*.vue" 35 | ], 36 | "exclude": [ 37 | "./node_modules" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /cms_v4/buildchain/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vite'; 2 | import checker from 'vite-plugin-checker'; 3 | import manifestSRI from 'vite-plugin-manifest-sri'; 4 | import tailwindcss from "@tailwindcss/vite"; 5 | import vue from '@vitejs/plugin-vue' 6 | import ViteRestart from 'vite-plugin-restart'; 7 | import {visualizer} from 'rollup-plugin-visualizer'; 8 | import viteCompression from 'vite-plugin-compression'; 9 | import * as path from 'path'; 10 | 11 | // https://vitejs.dev/config/ 12 | export default defineConfig(({command}) => ({ 13 | base: command === 'serve' ? '' : '/dist/', 14 | build: { 15 | emptyOutDir: true, 16 | manifest: 'manifest.json', 17 | outDir: '../web/dist', 18 | rollupOptions: { 19 | input: { 20 | app: 'src/js/app.ts', 21 | welcome: 'src/js/welcome.ts', 22 | }, 23 | }, 24 | sourcemap: true 25 | }, 26 | plugins: [ 27 | ViteRestart({ 28 | reload: [ 29 | '../templates/**/*', 30 | ], 31 | }), 32 | vue(), 33 | manifestSRI(), 34 | viteCompression({ 35 | filter: /\.(js|mjs|json|css|map)$/i 36 | }), 37 | visualizer({ 38 | filename: '../web/dist/stats.html', 39 | template: 'treemap', 40 | sourcemap: true, 41 | }), 42 | tailwindcss(), 43 | checker({ 44 | eslint: { 45 | lintCommand: 'eslint "./src/**/*.{js,ts}"', 46 | useFlatConfig: true, 47 | dev: { 48 | overrideConfig: { 49 | cache: true, 50 | } 51 | } 52 | }, 53 | stylelint: { 54 | lintCommand: 'stylelint ./src/**/*.{css,scss,sass,pcss} --fix', 55 | dev: { 56 | overrideConfig: { 57 | cache: true, 58 | } 59 | } 60 | }, 61 | typescript: true, 62 | vueTsc: true, 63 | }), 64 | ], 65 | resolve: { 66 | alias: { 67 | '@': path.resolve(__dirname, './src') 68 | }, 69 | preserveSymlinks: true, 70 | }, 71 | server: { 72 | // Allow cross-origin requests -- https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6 73 | allowedHosts: true, 74 | cors: { 75 | origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(localhost|\.local|\.test|\.ddev\.site)(?::\d+)?$/ 76 | }, 77 | fs: { 78 | strict: false 79 | }, 80 | headers: { 81 | "Access-Control-Allow-Private-Network": "true", 82 | }, 83 | host: '0.0.0.0', 84 | origin: 'http://localhost:' + process.env.DEV_PORT, 85 | port: parseInt(process.env.DEV_PORT), 86 | strictPort: true, 87 | } 88 | })); 89 | -------------------------------------------------------------------------------- /cms_v4/config/_configs/mysql/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('mysql') 17 | ->server('mysql') 18 | ->port(3306) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')); 24 | -------------------------------------------------------------------------------- /cms_v4/config/_configs/mysql/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdMySQL') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableGraphqlCaching(App::env('ENABLE_GRAPHQL_CACHING')) 28 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 29 | ->resourceBasePath(App::env('WEB_ROOT_PATH') . '/cpresources') 30 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 31 | ->securityKey(App::env('SECURITY_KEY')) 32 | // Craft config settings from constants 33 | ->cacheDuration(false) 34 | ->defaultSearchTermOptions([ 35 | 'subLeft' => true, 36 | 'subRight' => true, 37 | ]) 38 | ->defaultTokenDuration('P2W') 39 | ->enableCsrfProtection(true) 40 | ->generateTransformsBeforePageLoad(true) 41 | ->maxCachedCloudImageSize(3000) 42 | ->maxUploadFileSize('100M') 43 | ->omitScriptNameInUrls(true) 44 | ->useEmailAsUsername(false) 45 | ->usePathInfo(true) 46 | ->requireMatchingUserAgentForSession(false) 47 | ->rememberedUserSessionDuration(31536000) 48 | ; 49 | -------------------------------------------------------------------------------- /cms_v4/config/_configs/postgres/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('pgsql') 17 | ->server('postgres') 18 | ->port(5432) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')) 24 | ; 25 | -------------------------------------------------------------------------------- /cms_v4/config/_configs/postgres/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdPostgres') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 28 | ->resourceBasePath(App::env('WEB_ROOT_PATH').'/cpresources') 29 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 30 | ->securityKey(App::env('SECURITY_KEY')) 31 | // Craft config settings from constants 32 | ->cacheDuration(false) 33 | ->defaultSearchTermOptions([ 34 | 'subLeft' => true, 35 | 'subRight' => true, 36 | ]) 37 | ->defaultTokenDuration('P2W') 38 | ->enableCsrfProtection(true) 39 | ->generateTransformsBeforePageLoad(true) 40 | ->maxCachedCloudImageSize(3000) 41 | ->maxUploadFileSize('100M') 42 | ->omitScriptNameInUrls(true) 43 | ->useEmailAsUsername(false) 44 | ->usePathInfo(true) 45 | ; 46 | -------------------------------------------------------------------------------- /cms_v4/config/app.console.php: -------------------------------------------------------------------------------- 1 | App::env('APP_ID') ?: 'CraftCMS', 24 | 'modules' => [ 25 | 'site-module' => [ 26 | 'class' => \modules\sitemodule\SiteModule::class, 27 | ], 28 | ], 29 | 'bootstrap' => ['site-module'], 30 | 'components' => [ 31 | 'cache' => [ 32 | 'class' => yii\redis\Cache::class, 33 | 'keyPrefix' => App::env('APP_ID') ?: 'CraftCMS', 34 | 'redis' => [ 35 | 'hostname' => App::env('REDIS_HOSTNAME'), 36 | 'port' => App::env('REDIS_PORT'), 37 | 'database' => App::env('REDIS_CRAFT_DB'), 38 | ], 39 | ], 40 | 'deprecator' => [ 41 | 'throwExceptions' => App::env('DEV_MODE'), 42 | ], 43 | 'queue' => [ 44 | 'class' => craft\queue\Queue::class, 45 | 'ttr' => 10 * 60, 46 | ], 47 | 'redis' => [ 48 | 'class' => yii\redis\Connection::class, 49 | 'hostname' => App::env('REDIS_HOSTNAME'), 50 | 'port' => App::env('REDIS_PORT'), 51 | 'database' => App::env('REDIS_DEFAULT_DB'), 52 | ], 53 | ], 54 | ]; 55 | -------------------------------------------------------------------------------- /cms_v4/config/app.web.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'session' => static function() { 23 | // Get the default component config 24 | $config = App::sessionConfig(); 25 | // Override the class to use Redis' session class and our config settings 26 | $config['class'] = yii\redis\Session::class; 27 | $config['keyPrefix'] = App::env('APP_ID') ?: 'CraftCMS'; 28 | $config['redis'] = [ 29 | 'hostname' => App::env('REDIS_HOSTNAME'), 30 | 'port' => App::env('REDIS_PORT'), 31 | 'database' => App::env('REDIS_DEFAULT_DB'), 32 | ]; 33 | // Instantiate and return it 34 | return Craft::createObject($config); 35 | }, 36 | ], 37 | ]; 38 | -------------------------------------------------------------------------------- /cms_v4/config/custom.php: -------------------------------------------------------------------------------- 1 | config->{mycustomsetting}. 7 | * 8 | * @see https://craftcms.com/docs/4.x/upgrade.html#configuration 9 | */ 10 | 11 | return [ 12 | ]; 13 | -------------------------------------------------------------------------------- /cms_v4/config/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('mysql') 17 | ->server('mysql') 18 | ->port(3306) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')) 24 | ; 25 | -------------------------------------------------------------------------------- /cms_v4/config/fastcgi-cache-bust.php: -------------------------------------------------------------------------------- 1 | App::env('FAST_CGI_CACHE_PATH'), 30 | ]; 31 | -------------------------------------------------------------------------------- /cms_v4/config/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdMySQL') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableGraphqlCaching(App::env('ENABLE_GRAPHQL_CACHING')) 28 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 29 | ->resourceBasePath(App::env('WEB_ROOT_PATH') . '/cpresources') 30 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 31 | ->securityKey(App::env('SECURITY_KEY')) 32 | // Craft config settings from constants 33 | ->cacheDuration(false) 34 | ->defaultSearchTermOptions([ 35 | 'subLeft' => true, 36 | 'subRight' => true, 37 | ]) 38 | ->defaultTokenDuration('P2W') 39 | ->enableCsrfProtection(true) 40 | ->generateTransformsBeforePageLoad(true) 41 | ->maxCachedCloudImageSize(3000) 42 | ->maxUploadFileSize('100M') 43 | ->omitScriptNameInUrls(true) 44 | ->useEmailAsUsername(false) 45 | ->usePathInfo(true) 46 | ->requireMatchingUserAgentForSession(false) 47 | ->rememberedUserSessionDuration(31536000) 48 | ; 49 | -------------------------------------------------------------------------------- /cms_v4/config/htmlpurifier/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "Attr.AllowedFrameTargets": [ 3 | "_blank" 4 | ], 5 | "Attr.EnableID": true, 6 | "HTML.AllowedComments": [ 7 | "pagebreak" 8 | ], 9 | "HTML.SafeIframe": true, 10 | "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%" 11 | } 12 | -------------------------------------------------------------------------------- /cms_v4/config/redactor/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": [ 3 | "html", 4 | "formatting", 5 | "bold", 6 | "italic", 7 | "unorderedlist", 8 | "orderedlist", 9 | "link", 10 | "image", 11 | "video" 12 | ], 13 | "plugins": [ 14 | "fullscreen", 15 | "video", 16 | "richvariables" 17 | ], 18 | "linkNewTab": true, 19 | "toolbarFixed": true 20 | } 21 | -------------------------------------------------------------------------------- /cms_v4/config/redactor/Simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": ["bold", "italic"], 3 | "toolbarFixed": true, 4 | "plugins": ["richvariables"] 5 | } 6 | -------------------------------------------------------------------------------- /cms_v4/config/routes.php: -------------------------------------------------------------------------------- 1 | ' => ['template' => 'blog/_archive'], 15 | * 16 | * That example would match URIs such as `/blog/archive/2012`, and pass the 17 | * request along to the `blog/_archive` template, providing it a `year` variable 18 | * set to the value `2012`. 19 | */ 20 | 21 | return [ 22 | 'amp' => ['template' => 'amp-index'], 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v4/config/seomatic-config/globalmeta/Creator.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'siteType' => 'Organization', 21 | 'siteSubType' => '', 22 | 'siteSpecificType' => '', 23 | 'computedType' => 'Organization', 24 | 'genericName' => 'nystudio107', 25 | 'genericAlternateName' => 'nys', 26 | 'genericDescription' => 'We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO', 27 | 'genericUrl' => 'https://nystudio107.com/', 28 | 'genericImage' => 'https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png', 29 | 'genericImageWidth' => '1042', 30 | 'genericImageHeight' => '1042', 31 | 'genericImageIds' => [], 32 | 'genericTelephone' => '', 33 | 'genericEmail' => 'info@nystudio107.com', 34 | 'genericStreetAddress' => '', 35 | 'genericAddressLocality' => 'Webster', 36 | 'genericAddressRegion' => 'NY', 37 | 'genericPostalCode' => '14580', 38 | 'genericAddressCountry' => 'US', 39 | 'genericGeoLatitude' => '43.2365384', 40 | 'genericGeoLongitude' => '-77.49211620000001', 41 | 'personGender' => '', 42 | 'personBirthPlace' => '', 43 | 'organizationDuns' => '', 44 | 'organizationFounder' => 'Andrew Welch, Polly Welch', 45 | 'organizationFoundingDate' => '2013-05-02', 46 | 'organizationFoundingLocation' => 'Webster, NY', 47 | 'organizationContactPoints' => [], 48 | 'corporationTickerSymbol' => '', 49 | 'localBusinessPriceRange' => '', 50 | 'localBusinessOpeningHours' => [], 51 | 'restaurantServesCuisine' => '', 52 | 'restaurantMenuUrl' => '', 53 | 'restaurantReservationsUrl' => '', 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /cms_v4/config/twigpack.php: -------------------------------------------------------------------------------- 1 | App::env('DEV_MODE'), 31 | // The JavaScript entry from the manifest.json to inject on Twig error pages 32 | 'errorEntry' => ['runtime.js', 'app.js'], 33 | // Manifest file names 34 | 'manifest' => [ 35 | 'legacy' => 'manifest-legacy.json', 36 | 'modern' => 'manifest.json', 37 | ], 38 | // Public server config 39 | 'server' => [ 40 | 'manifestPath' => '@webroot/dist/', 41 | 'publicPath' => '/', 42 | ], 43 | // webpack-dev-server config 44 | 'devServer' => [ 45 | 'manifestPath' => App::env('TWIGPACK_DEV_SERVER_MANIFEST_PATH'), 46 | 'publicPath' => App::env('TWIGPACK_DEV_SERVER_PUBLIC_PATH'), 47 | ], 48 | // Bundle to use with the webpack-dev-server 49 | 'devServerBuildType' => 'modern', 50 | // Whether to include a Content Security Policy "nonce" for inline 51 | // CSS or JavaScript. Valid values are 'header' or 'tag' for how the CSP 52 | // should be included. c.f.: 53 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#Unsafe_inline_script 54 | 'cspNonce' => '', 55 | // Local files config 56 | 'localFiles' => [ 57 | 'basePath' => '@webroot/', 58 | 'criticalPrefix' => 'dist/criticalcss/', 59 | 'criticalSuffix' => '_critical.min.css', 60 | ], 61 | ]; 62 | -------------------------------------------------------------------------------- /cms_v4/craft: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 16 | exit($exitCode); 17 | -------------------------------------------------------------------------------- /cms_v4/craft.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Craft command line bootstrap script for Windows 5 | rem ------------------------------------------------------------- 6 | 7 | @setlocal 8 | 9 | set CRAFT_PATH=%~dp0 10 | 11 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 12 | 13 | "%PHP_COMMAND%" "%CRAFT_PATH%craft" %* 14 | 15 | @endlocal 16 | -------------------------------------------------------------------------------- /cms_v4/ecs.php: -------------------------------------------------------------------------------- 1 | parallel(); 8 | $ecsConfig->sets([SetList::CRAFT_CMS_4]); 9 | }; 10 | -------------------------------------------------------------------------------- /cms_v4/example.env: -------------------------------------------------------------------------------- 1 | # Craft general settings 2 | ALLOW_UPDATES=1 3 | ALLOW_ADMIN_CHANGES=1 4 | APP_ID=project_v4 5 | BACKUP_ON_UPDATE=0 6 | DEV_MODE=1 7 | ENABLE_GRAPHQL_CACHING=0 8 | ENABLE_TEMPLATE_CACHING=0 9 | ENVIRONMENT=dev 10 | RUN_QUEUE_AUTOMATICALLY=0 11 | SECURITY_KEY=EOdiVBONceb8zFGJP7InMui2pMkvNACz 12 | SITE_NAME=plugindev 13 | 14 | # Craft database settings 15 | DB_USER=project 16 | DB_PASSWORD=project 17 | DB_DATABASE=project_v4 18 | DB_SCHEMA=public 19 | DB_TABLE_PREFIX= 20 | 21 | # URL & path settings 22 | ASSETS_URL=http://plugindev.local:8004 23 | SITE_URL=http://plugindev.local:8004 24 | WEB_ROOT_PATH=/var/www/project/cms_v4/web 25 | CMS_ROOT_PATH=/var/www/project/cms_v4 26 | 27 | # Redis settings 28 | REDIS_HOSTNAME=redis 29 | REDIS_PORT=6379 30 | REDIS_DEFAULT_DB=0 31 | REDIS_CRAFT_DB=1 32 | 33 | # Xdebug Settings 34 | DBGP_IDEKEY=phpstorm 35 | 36 | # Plugin debug 37 | NYS_PLUGIN_DEVSERVER=1 38 | VITE_PLUGIN_DEVSERVER=1 39 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/.craftplugin: -------------------------------------------------------------------------------- 1 | {"pluginName":"Site","pluginDescription":"An example module for Craft CMS 3 that lets you enhance your websites with a custom site module","pluginVersion":"1.0.0","pluginAuthorName":"nystudio107","pluginVendorName":"nystudio107","pluginAuthorUrl":"https://nystudio107.com/","codeComments":[],"pluginComponents":[],"apiVersion":"module_api_version_3_0"} -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/.gitignore: -------------------------------------------------------------------------------- 1 | # CRAFT ENVIRONMENT 2 | .env.php 3 | .env.sh 4 | .env 5 | 6 | # COMPOSER 7 | /vendor 8 | 9 | # BUILD FILES 10 | /bower_components/* 11 | /node_modules/* 12 | /build/* 13 | /yarn-error.log 14 | 15 | # MISC FILES 16 | .cache 17 | .DS_Store 18 | .idea 19 | .project 20 | .settings 21 | *.esproj 22 | *.sublime-workspace 23 | *.sublime-project 24 | *.tmproj 25 | *.tmproject 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | config.codekit3 32 | prepros-6.config 33 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Site Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## 1.0.0 - 2018-01-19 8 | ### Added 9 | - Initial release 10 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 nystudio107 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/README.md: -------------------------------------------------------------------------------- 1 | # Site module for Craft CMS 3.x 2 | 3 | An example module for Craft CMS 3 that lets you enhance your websites with a custom site module 4 | 5 | ## Requirements 6 | 7 | This module requires Craft CMS 3.0.0-RC1 or later. 8 | 9 | ## Installation 10 | 11 | To install the module, follow these instructions. 12 | 13 | First, you'll need to add the contents of the `app.php` file to your `config/app.php` (or just copy it there if it does not exist). This ensures that your module will get loaded for each request. The file might look something like this: 14 | ``` 15 | return [ 16 | 'modules' => [ 17 | 'site-module' => [ 18 | 'class' => \modules\sitemodule\SiteModule::class, 19 | ], 20 | ], 21 | 'bootstrap' => ['site-module'], 22 | ]; 23 | ``` 24 | You'll also need to make sure that you add the following to your project's `composer.json` file so that Composer can find your module: 25 | 26 | "autoload": { 27 | "psr-4": { 28 | "modules\\sitemodule\\": "modules/sitemodule/src/" 29 | } 30 | }, 31 | 32 | After you have added this, you will need to do: 33 | 34 | composer dump-autoload 35 | 36 | …from the project’s root directory, to rebuild the Composer autoload map. This will happen automatically any time you do a `composer install` or `composer update` as well. 37 | 38 | ## Site Overview 39 | 40 | -Insert text here- 41 | 42 | ## Using Site 43 | 44 | -Insert text here- 45 | 46 | ## Site Roadmap 47 | 48 | Some things to do, and ideas for potential features: 49 | 50 | * Release it 51 | 52 | Brought to you by [nystudio107](https://nystudio107.com/) 53 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/assetbundles/sitemodule/SiteModuleAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = "@modules/sitemodule/assetbundles/sitemodule/dist"; 33 | 34 | $this->depends = [ 35 | CpAsset::class, 36 | ]; 37 | 38 | $this->js = [ 39 | 'js/SiteModule.js', 40 | ]; 41 | 42 | $this->css = [ 43 | 'css/SiteModule.css', 44 | ]; 45 | 46 | parent::init(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/assetbundles/sitemodule/dist/css/SiteModule.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site CSS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | 13 | body.login { 14 | background-color: #FFF; 15 | background-image: url('/img/site/login-background-image.png'); 16 | } 17 | 18 | body.login label, body.login #forgot-password { 19 | background-color: #FFF; 20 | } 21 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/assetbundles/sitemodule/dist/img/SiteModule-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/assetbundles/sitemodule/dist/js/SiteModule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/config.php: -------------------------------------------------------------------------------- 1 | getConfig()->env; 44 | 45 | // Try craft/config first 46 | $path = Craft::getAlias('@config/'.$fileName, false); 47 | if ($path === false || !file_exists($path)) { 48 | // Now try our own internal config 49 | $path = Craft::getAlias('@modules/sitemodule/'.$fileName, false); 50 | if ($path === false || !file_exists($path)) { 51 | return []; 52 | } 53 | } 54 | 55 | if (!is_array($config = @include $path)) { 56 | return []; 57 | } 58 | 59 | // If it's not a multi-environment config, return the whole thing 60 | if (!array_key_exists('*', $config)) { 61 | return $config; 62 | } 63 | 64 | // If no environment was specified, just look in the '*' array 65 | if ($currentEnv === null) { 66 | return $config['*']; 67 | } 68 | 69 | $mergedConfig = []; 70 | foreach ($config as $env => $envConfig) { 71 | if ($env === '*' || StringHelper::contains($currentEnv, $env)) { 72 | $mergedConfig = ArrayHelper::merge($mergedConfig, $envConfig); 73 | } 74 | } 75 | 76 | return $mergedConfig; 77 | } 78 | 79 | // Private Methods 80 | // ========================================================================= 81 | } 82 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/services/Helper.php: -------------------------------------------------------------------------------- 1 | 'Site plugin loaded', 18 | ]; 19 | -------------------------------------------------------------------------------- /cms_v4/modules/sitemodule/src/variables/SiteVariable.php: -------------------------------------------------------------------------------- 1 | parameters(); 11 | /** @noinspection PhpParamsInspection */ 12 | $parameters->set(Option::SKIP, [ 13 | '../../../../Users/andrew/webdev/craft_v4/craft-seomatic/src/integrations', 14 | '../../../../Users/andrew/webdev/craft_v4/craft-seomatic/src/models/jsonld', 15 | ]); 16 | 17 | // Craft Version 18 | $containerConfigurator->import(CraftSetList::CRAFT_CMS_40); 19 | $containerConfigurator->import(CraftSetList::CRAFT_COMMERCE_40); 20 | /* 21 | * Additional Rector set lists that can be uncommented to modernize code beyond 22 | * Craft CMS 4 compatibility 23 | 24 | // PHP Version 25 | $containerConfigurator->import(LevelSetList::UP_TO_PHP_80); 26 | // Other 27 | $containerConfigurator->import(SetList::CODE_QUALITY); 28 | $containerConfigurator->import(SetList::CODING_STYLE); 29 | $containerConfigurator->import(SetList::DEAD_CODE); 30 | $containerConfigurator->import(SetList::TYPE_DECLARATION); 31 | */ 32 | }; 33 | -------------------------------------------------------------------------------- /cms_v4/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v4/templates/.gitkeep -------------------------------------------------------------------------------- /cms_v4/templates/blog/_entry.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

{{ entry.plainText }}

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v4/templates/blog/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

Blog Index

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v4/templates/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v4/web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | # Send would-be 404 requests to Craft 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] 8 | RewriteRule (.+) index.php?p=$1 [QSA,L] 9 | 10 | -------------------------------------------------------------------------------- /cms_v4/web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v4/web/cpresources/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v4/web/img/site/login-background-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v4/web/img/site/login-background-image.png -------------------------------------------------------------------------------- /cms_v4/web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /cms_v4/web/offline.svg: -------------------------------------------------------------------------------- 1 | Offlineoffline 2 | -------------------------------------------------------------------------------- /cms_v4/web/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /cms_v5/Makefile: -------------------------------------------------------------------------------- 1 | SEPARATOR:=- 2 | PROJECT_NAME?=$(shell basename $(dir $(CURDIR))) 3 | PROJECT_DIR?=/var/www/project/ 4 | SERVICE_NAME?=php 5 | QUEUE_SERVICE_NAME?=queue 6 | CMS_ROOT_NAME?=cms_ 7 | CMS_VERSION:=v5 8 | CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 9 | QUEUE_CONTAINER:=$(PROJECT_NAME)$(SEPARATOR)$(QUEUE_SERVICE_NAME)_$(CMS_VERSION)$(SEPARATOR)1 10 | CMS_DIR:=$(CMS_ROOT_NAME)$(CMS_VERSION) 11 | 12 | .PHONY: codecept composer craft ecs mysql phpstan postgres rector ssh 13 | 14 | codecept: 15 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/codecept \ 16 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 17 | composer: 18 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data composer \ 19 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 20 | craft: 21 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data php craft \ 22 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 23 | ecs: 24 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/ecs \ 25 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 26 | mysql: 27 | cp config/_configs/mysql/db.php config/db.php 28 | cp config/_configs/mysql/general.php config/general.php 29 | docker restart $(QUEUE_CONTAINER) 30 | pest: 31 | docker exec -it -e PROJECT_VENDOR_DIR=$(PROJECT_VENDOR_DIR) -w $(PROJECT_DIR)$(CMS_DIR) $(DEBUG_CONTAINER) su-exec www-data vendor/bin/pest \ 32 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | phpstan: 34 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/phpstan --memory-limit=1G \ 35 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 36 | postgres: 37 | cp config/_configs/postgres/db.php config/db.php 38 | cp config/_configs/postgres/general.php config/general.php 39 | docker restart $(QUEUE_CONTAINER) 40 | rector: 41 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data vendor/bin/rector \ 42 | $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 43 | ssh: 44 | docker exec -it -w $(PROJECT_DIR)$(CMS_DIR) $(CONTAINER) su-exec www-data /bin/sh 45 | %: 46 | @: 47 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 48 | -------------------------------------------------------------------------------- /cms_v5/bootstrap.php: -------------------------------------------------------------------------------- 1 | safeLoad(); 16 | } 17 | 18 | // Define additional PHP constants 19 | // (see https://craftcms.com/docs/3.x/config/#php-constants) 20 | define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); 21 | -------------------------------------------------------------------------------- /cms_v5/buildchain/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Misc directories & files 27 | coverage/* 28 | .stylelintcache 29 | -------------------------------------------------------------------------------- /cms_v5/buildchain/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG=22-alpine 2 | FROM node:$TAG 3 | 4 | RUN npm install -g npm@^11.0.0 5 | 6 | WORKDIR /app/buildchain 7 | 8 | CMD ["run build"] 9 | 10 | ENTRYPOINT ["npm"] 11 | -------------------------------------------------------------------------------- /cms_v5/buildchain/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR_VERSION?=5 2 | TAG?=22-alpine 3 | CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-buildchain 4 | DEV_PORT?=400${MAJOR_VERSION} 5 | IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) 6 | IMAGE_NAME=${CONTAINER}:${TAG} 7 | DOCKER_RUN=docker container run --rm -it --network plugindev_default -l dev.orbstack.domains=vite_v${MAJOR_VERSION}.plugindev.local -v "${CURDIR}"/../:/app 8 | 9 | .PHONY: build clean dev image-build image-check npm ssh 10 | 11 | # Perform a dist build via npm run build 12 | build: image-check 13 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run build 14 | # Remove node_modules/ & package-lock.json 15 | clean: 16 | rm -rf node_modules/ 17 | rm -f package-lock.json 18 | # Run the development server via npm run dev 19 | dev: image-check 20 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} run dev 21 | # Build the Docker image & run npm install 22 | image-build: 23 | docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache 24 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install 25 | # Ensure the image has been created 26 | image-check: 27 | ifeq ($(IMAGE_INFO), []) 28 | image-check: image-build 29 | endif 30 | # Run the passed in npm command 31 | npm: image-check 32 | ${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 33 | # Run the passed in npx command 34 | npx: image-check 35 | ${DOCKER_RUN} --name ${CONTAINER}-$@ -it --entrypoint=/usr/local/bin/npx ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) 36 | # Open a shell inside of the container 37 | ssh: image-check 38 | ${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME} 39 | %: 40 | @: 41 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 42 | -------------------------------------------------------------------------------- /cms_v5/buildchain/eslint.config.js: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | import pluginVue from "eslint-plugin-vue"; 5 | 6 | 7 | /** @type {import('eslint').Linter.Config[]} */ 8 | export default [ 9 | {files: ["**/*.{js,mjs,cjs,ts,vue}"]}, 10 | {languageOptions: { globals: globals.browser }}, 11 | pluginJs.configs.recommended, 12 | ...tseslint.configs.recommended, 13 | ...pluginVue.configs["flat/essential"], 14 | {files: ["**/*.vue"], languageOptions: {parserOptions: {parser: tseslint.parser}}}, 15 | ]; -------------------------------------------------------------------------------- /cms_v5/buildchain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buildchain", 3 | "description": "A drop-in buildchain for using Vite in your Craft CMS plugins or modules", 4 | "type": "module", 5 | "author": { 6 | "email": "info@nystudio107.com", 7 | "name": "nystudio107", 8 | "url": "https://nystudio107.com" 9 | }, 10 | "dependencies": { 11 | "vue": "^3.2.0", 12 | "vue-confetti": "^2.0.8" 13 | }, 14 | "devDependencies": { 15 | "@eslint/js": "^9.19.0", 16 | "@types/node": "^22.0.0", 17 | "@tailwindcss/vite": "^4.0.0", 18 | "@vitejs/plugin-vue": "^5.0.0", 19 | "@vue/compiler-sfc": "^3.0.0", 20 | "eslint": "^9.19.0", 21 | "eslint-plugin-vue": "^9.0.0", 22 | "globals": "^15.0.0", 23 | "rollup-plugin-visualizer": "^5.0.0", 24 | "stylelint": "^16.0.0", 25 | "stylelint-config-recommended": "^15.0.0", 26 | "stylelint-config-recommended-vue": "^1.0.0", 27 | "stylelint-config-standard-scss": "^14.0.0", 28 | "tailwindcss": "^4.0.0", 29 | "typescript-eslint": "^8.0.0", 30 | "vite": "^6.0.0", 31 | "vite-plugin-checker": "^0.8.0", 32 | "vite-plugin-compression": "^0.5.0", 33 | "vite-plugin-manifest-sri": "^0.2.0", 34 | "vite-plugin-restart": "^0.4.0", 35 | "vue-tsc": "^2.0.0" 36 | }, 37 | "scripts": { 38 | "dev": "vite", 39 | "build": "vite build" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/app.css: -------------------------------------------------------------------------------- 1 | /** 2 | * app.css 3 | * 4 | * The entry point for the css. 5 | * 6 | */ 7 | 8 | @import "./tailwind-config.css"; 9 | 10 | @import "./components/webfonts.css"; 11 | @import "./components/typography.css"; 12 | @import "./components/global.css"; 13 | 14 | /** 15 | * Include styles for individual pages 16 | * 17 | */ 18 | @import "./pages/settings.css"; 19 | @import "./pages/welcome.css"; 20 | 21 | /** 22 | * Include vendor css. 23 | * 24 | */ 25 | @import "./vendor.css"; 26 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/components/global.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/global.css 3 | * 4 | * Project-wide styles 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/components/typography.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/typography.css 3 | * 4 | * Typography rules. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/components/webfonts.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/webfonts.css 3 | * 4 | * Project webfonts. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/pages/settings.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Settings page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/pages/welcome.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Welcome page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/tailwind-config.css: -------------------------------------------------------------------------------- 1 | /** 2 | * tailwind-config.css 3 | * 4 | * CSS-based configuration for Tailwind CSS 5 | * ref: https://tailwindcss.com/docs/theme 6 | */ 7 | 8 | @import "tailwindcss"; 9 | 10 | @source "../../../src/templates"; 11 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/css/vendor.css: -------------------------------------------------------------------------------- 1 | /** 2 | * vendor.css 3 | * 4 | * All vendor CSS is imported here. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/js/@types/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module "app"; 2 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/js/Confetti.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v5/buildchain/src/js/Confetti.ts -------------------------------------------------------------------------------- /cms_v5/buildchain/src/js/app.ts: -------------------------------------------------------------------------------- 1 | // Import our CSS 2 | import '@/css/app.css'; 3 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/js/welcome.ts: -------------------------------------------------------------------------------- 1 | import App from '@/vue/App.vue'; 2 | import { createApp } from 'vue'; 3 | 4 | // App main 5 | const main = async () => { 6 | // Create our vue instance 7 | const app = createApp(App); 8 | // Mount the app 9 | const root = app.mount('#app-container'); 10 | 11 | return root; 12 | }; 13 | 14 | // Execute async function 15 | main().then( () => { 16 | console.log(); 17 | }); 18 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/vue/@types/confetti.d.ts: -------------------------------------------------------------------------------- 1 | declare module "vue-confetti/src/confetti.js"; 2 | 3 | interface ConfettiInterface { 4 | start(opts: Partial): void, 5 | 6 | update(opts: Partial): void, 7 | 8 | stop(): void, 9 | } 10 | 11 | type ParticlesType = "circle" | "rect" | "heart" | "image"; 12 | 13 | interface ParticlesConfig { 14 | type: ParticlesType, 15 | size: number, 16 | dropRate: number, 17 | colors: string[], 18 | url: string | null, 19 | } 20 | 21 | interface ConfettiConfig { 22 | particles: Partial[], 23 | defaultType: ParticlesType, 24 | defaultSize: number, 25 | defaultDropRate: number, 26 | defaultColors: string[], 27 | canvasId: number, 28 | particlesPerFrame: number, 29 | } 30 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/vue/@types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { defineComponent } from "vue"; 3 | const Component : ReturnType; 4 | export default Component; 5 | } 6 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/vue/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /cms_v5/buildchain/src/vue/ConfettiParty.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /cms_v5/buildchain/stylelint.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | "extends": [ 4 | "stylelint-config-recommended", 5 | "stylelint-config-standard-scss", 6 | "stylelint-config-recommended-vue" 7 | ], 8 | "rules": { 9 | // For TailwindCSS @apply directive 10 | "at-rule-no-deprecated": { 11 | "ignoreAtRules": [ 12 | "apply" 13 | ], 14 | }, 15 | // For TailwindCSS theme() function properties 16 | "declaration-property-value-no-unknown": { 17 | "ignoreProperties": [ 18 | "/^theme/" 19 | ], 20 | }, 21 | // For TailwindCSS theme() function 22 | "function-no-unknown": { 23 | "ignoreFunctions": [ 24 | "theme" 25 | ] 26 | }, 27 | "scss/at-rule-no-unknown": [ 28 | true, 29 | { 30 | // For TailwindCSS custom @ directives 31 | "ignoreAtRules": [ 32 | "theme", 33 | "source", 34 | "utility", 35 | "variant", 36 | "custom-variant", 37 | "apply", 38 | "reference", 39 | "config", 40 | "plugin", 41 | ] 42 | } 43 | ], 44 | "no-invalid-position-at-import-rule": null, 45 | "block-no-empty": null, 46 | "selector-id-pattern": null, 47 | "selector-class-pattern": null, 48 | "no-descending-specificity": null, 49 | "font-family-no-missing-generic-family-keyword": null 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cms_v5/buildchain/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | '../src/templates/**/*.{twig,html}', 5 | './src/vue/**/*.{vue,html}', 6 | ], 7 | theme: { 8 | }, 9 | plugins: [], 10 | }; 11 | -------------------------------------------------------------------------------- /cms_v5/buildchain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "allowSyntheticDefaultImports": true, 5 | "baseUrl": "node_modules", 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "experimentalDecorators": true, 9 | "importHelpers": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "noEmit": true, 13 | "noImplicitAny": true, 14 | "outDir": "../web/dist", 15 | "paths": { 16 | "@/*": [ 17 | "./src/*" 18 | ] 19 | }, 20 | "resolveJsonModule": true, 21 | "skipLibCheck": true, 22 | "sourceMap": true, 23 | "strict": true, 24 | "strictBindCallApply": true, 25 | "strictFunctionTypes": true, 26 | "strictNullChecks": true, 27 | "target": "esnext", 28 | "typeRoots": [ 29 | "node_modules/@types" 30 | ] 31 | }, 32 | "include": [ 33 | "./src/**/*.ts", 34 | "./src/**/*.vue" 35 | ], 36 | "exclude": [ 37 | "./node_modules" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /cms_v5/buildchain/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vite'; 2 | import checker from 'vite-plugin-checker'; 3 | import manifestSRI from 'vite-plugin-manifest-sri'; 4 | import tailwindcss from "@tailwindcss/vite"; 5 | import vue from '@vitejs/plugin-vue' 6 | import ViteRestart from 'vite-plugin-restart'; 7 | import {visualizer} from 'rollup-plugin-visualizer'; 8 | import viteCompression from 'vite-plugin-compression'; 9 | import * as path from 'path'; 10 | 11 | // https://vitejs.dev/config/ 12 | export default defineConfig(({command}) => ({ 13 | base: command === 'serve' ? '' : '/dist/', 14 | build: { 15 | emptyOutDir: true, 16 | manifest: 'manifest.json', 17 | outDir: '../web/dist', 18 | rollupOptions: { 19 | input: { 20 | app: 'src/js/app.ts', 21 | welcome: 'src/js/welcome.ts', 22 | }, 23 | }, 24 | sourcemap: true 25 | }, 26 | plugins: [ 27 | ViteRestart({ 28 | reload: [ 29 | '../templates/**/*', 30 | ], 31 | }), 32 | vue(), 33 | manifestSRI(), 34 | viteCompression({ 35 | filter: /\.(js|mjs|json|css|map)$/i 36 | }), 37 | visualizer({ 38 | filename: '../web/dist/stats.html', 39 | template: 'treemap', 40 | sourcemap: true, 41 | }), 42 | tailwindcss(), 43 | checker({ 44 | eslint: { 45 | lintCommand: 'eslint "./src/**/*.{js,ts}"', 46 | useFlatConfig: true, 47 | dev: { 48 | overrideConfig: { 49 | cache: true, 50 | } 51 | } 52 | }, 53 | stylelint: { 54 | lintCommand: 'stylelint ./src/**/*.{css,scss,sass,pcss} --fix', 55 | dev: { 56 | overrideConfig: { 57 | cache: true, 58 | } 59 | } 60 | }, 61 | typescript: true, 62 | vueTsc: true, 63 | }), 64 | ], 65 | resolve: { 66 | alias: { 67 | '@': path.resolve(__dirname, './src') 68 | }, 69 | preserveSymlinks: true, 70 | }, 71 | server: { 72 | // Allow cross-origin requests -- https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6 73 | allowedHosts: true, 74 | cors: { 75 | origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(localhost|\.local|\.test|\.ddev\.site)(?::\d+)?$/ 76 | }, 77 | fs: { 78 | strict: false 79 | }, 80 | headers: { 81 | "Access-Control-Allow-Private-Network": "true", 82 | }, 83 | host: '0.0.0.0', 84 | origin: 'http://localhost:' + process.env.DEV_PORT, 85 | port: parseInt(process.env.DEV_PORT), 86 | strictPort: true, 87 | } 88 | })); 89 | -------------------------------------------------------------------------------- /cms_v5/config/_configs/mysql/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('mysql') 17 | ->server('mysql') 18 | ->port(3306) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')) 24 | ->charset(App::env('DB_CHARSET')) 25 | ->collation(App::env('DB_COLLATION')) 26 | ; 27 | -------------------------------------------------------------------------------- /cms_v5/config/_configs/mysql/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdMySQL') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableGraphqlCaching(App::env('ENABLE_GRAPHQL_CACHING')) 28 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 29 | ->resourceBasePath(App::env('WEB_ROOT_PATH') . '/cpresources') 30 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 31 | ->securityKey(App::env('SECURITY_KEY')) 32 | // Craft config settings from constants 33 | ->cacheDuration(false) 34 | ->defaultSearchTermOptions([ 35 | 'subLeft' => true, 36 | 'subRight' => true, 37 | ]) 38 | ->defaultTokenDuration('P2W') 39 | ->enableCsrfProtection(true) 40 | ->generateTransformsBeforePageLoad(true) 41 | ->maxCachedCloudImageSize(3000) 42 | ->maxUploadFileSize('100M') 43 | ->omitScriptNameInUrls(true) 44 | ->useEmailAsUsername(false) 45 | ->usePathInfo(true) 46 | ->requireMatchingUserAgentForSession(false) 47 | ->rememberedUserSessionDuration(31536000) 48 | ; 49 | -------------------------------------------------------------------------------- /cms_v5/config/_configs/postgres/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('pgsql') 17 | ->server('postgres') 18 | ->port(5432) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')) 24 | ; 25 | -------------------------------------------------------------------------------- /cms_v5/config/_configs/postgres/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdPostgres') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 28 | ->resourceBasePath(App::env('WEB_ROOT_PATH').'/cpresources') 29 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 30 | ->securityKey(App::env('SECURITY_KEY')) 31 | // Craft config settings from constants 32 | ->cacheDuration(false) 33 | ->defaultSearchTermOptions([ 34 | 'subLeft' => true, 35 | 'subRight' => true, 36 | ]) 37 | ->defaultTokenDuration('P2W') 38 | ->enableCsrfProtection(true) 39 | ->generateTransformsBeforePageLoad(true) 40 | ->maxCachedCloudImageSize(3000) 41 | ->maxUploadFileSize('100M') 42 | ->omitScriptNameInUrls(true) 43 | ->useEmailAsUsername(false) 44 | ->usePathInfo(true) 45 | ; 46 | -------------------------------------------------------------------------------- /cms_v5/config/app.console.php: -------------------------------------------------------------------------------- 1 | App::env('APP_ID') ?: 'CraftCMS', 24 | 'modules' => [ 25 | 'site-module' => [ 26 | 'class' => \modules\sitemodule\SiteModule::class, 27 | ], 28 | ], 29 | 'bootstrap' => ['site-module'], 30 | 'components' => [ 31 | 'cache' => [ 32 | 'class' => yii\redis\Cache::class, 33 | 'keyPrefix' => App::env('APP_ID') ?: 'CraftCMS', 34 | 'redis' => [ 35 | 'hostname' => App::env('REDIS_HOSTNAME'), 36 | 'port' => App::env('REDIS_PORT'), 37 | 'database' => App::env('REDIS_CRAFT_DB'), 38 | ], 39 | ], 40 | 'deprecator' => [ 41 | 'throwExceptions' => App::env('DEV_MODE'), 42 | ], 43 | 'queue' => [ 44 | 'class' => craft\queue\Queue::class, 45 | 'ttr' => 10 * 60, 46 | ], 47 | 'redis' => [ 48 | 'class' => yii\redis\Connection::class, 49 | 'hostname' => App::env('REDIS_HOSTNAME'), 50 | 'port' => App::env('REDIS_PORT'), 51 | 'database' => App::env('REDIS_DEFAULT_DB'), 52 | ], 53 | ], 54 | ]; 55 | -------------------------------------------------------------------------------- /cms_v5/config/app.web.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'session' => static function() { 23 | // Get the default component config 24 | $config = App::sessionConfig(); 25 | // Override the class to use Redis' session class and our config settings 26 | $config['class'] = yii\redis\Session::class; 27 | $config['keyPrefix'] = App::env('APP_ID') ?: 'CraftCMS'; 28 | $config['redis'] = [ 29 | 'hostname' => App::env('REDIS_HOSTNAME'), 30 | 'port' => App::env('REDIS_PORT'), 31 | 'database' => App::env('REDIS_DEFAULT_DB'), 32 | ]; 33 | // Instantiate and return it 34 | return Craft::createObject($config); 35 | }, 36 | ], 37 | ]; 38 | -------------------------------------------------------------------------------- /cms_v5/config/custom.php: -------------------------------------------------------------------------------- 1 | config->{mycustomsetting}. 7 | * 8 | * @see https://craftcms.com/docs/4.x/upgrade.html#configuration 9 | */ 10 | 11 | return [ 12 | ]; 13 | -------------------------------------------------------------------------------- /cms_v5/config/db.php: -------------------------------------------------------------------------------- 1 | dsn(App::env('DB_DSN') ?: null) 16 | ->driver('mysql') 17 | ->server('mysql') 18 | ->port(3306) 19 | ->database(App::env('DB_DATABASE')) 20 | ->user(App::env('DB_USER')) 21 | ->password(App::env('DB_PASSWORD')) 22 | ->schema(App::env('DB_SCHEMA')) 23 | ->tablePrefix(App::env('DB_TABLE_PREFIX')) 24 | ->charset(App::env('DB_CHARSET')) 25 | ->collation(App::env('DB_COLLATION')) 26 | ; 27 | -------------------------------------------------------------------------------- /cms_v5/config/fastcgi-cache-bust.php: -------------------------------------------------------------------------------- 1 | App::env('FAST_CGI_CACHE_PATH'), 30 | ]; 31 | -------------------------------------------------------------------------------- /cms_v5/config/general.php: -------------------------------------------------------------------------------- 1 | phpSessionName('CraftSessionIdMySQL') 16 | // Craft config settings from .env variables 17 | ->aliases([ 18 | '@assetsUrl' => App::env('ASSETS_URL'), 19 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 20 | '@web' => App::env('SITE_URL'), 21 | '@webroot' => App::env('WEB_ROOT_PATH'), 22 | ]) 23 | ->allowUpdates(App::env('ALLOW_UPDATES')) 24 | ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES')) 25 | ->backupOnUpdate(App::env('BACKUP_ON_UPDATE')) 26 | ->devMode(App::env('DEV_MODE')) 27 | ->enableGraphqlCaching(App::env('ENABLE_GRAPHQL_CACHING')) 28 | ->enableTemplateCaching(App::env('ENABLE_TEMPLATE_CACHING')) 29 | ->resourceBasePath(App::env('WEB_ROOT_PATH') . '/cpresources') 30 | ->runQueueAutomatically(App::env('RUN_QUEUE_AUTOMATICALLY')) 31 | ->securityKey(App::env('SECURITY_KEY')) 32 | // Craft config settings from constants 33 | ->cacheDuration(false) 34 | ->defaultSearchTermOptions([ 35 | 'subLeft' => true, 36 | 'subRight' => true, 37 | ]) 38 | ->defaultTokenDuration('P2W') 39 | ->enableCsrfProtection(true) 40 | ->generateTransformsBeforePageLoad(true) 41 | ->maxCachedCloudImageSize(3000) 42 | ->maxUploadFileSize('100M') 43 | ->omitScriptNameInUrls(true) 44 | ->useEmailAsUsername(false) 45 | ->usePathInfo(true) 46 | ->requireMatchingUserAgentForSession(false) 47 | ->rememberedUserSessionDuration(31536000) 48 | ; 49 | -------------------------------------------------------------------------------- /cms_v5/config/htmlpurifier/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "Attr.AllowedFrameTargets": [ 3 | "_blank" 4 | ], 5 | "Attr.EnableID": true, 6 | "HTML.AllowedComments": [ 7 | "pagebreak" 8 | ], 9 | "HTML.SafeIframe": true, 10 | "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%" 11 | } 12 | -------------------------------------------------------------------------------- /cms_v5/config/redactor/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": [ 3 | "html", 4 | "formatting", 5 | "bold", 6 | "italic", 7 | "unorderedlist", 8 | "orderedlist", 9 | "link", 10 | "image", 11 | "video" 12 | ], 13 | "plugins": [ 14 | "fullscreen", 15 | "video", 16 | "richvariables" 17 | ], 18 | "linkNewTab": true, 19 | "toolbarFixed": true 20 | } 21 | -------------------------------------------------------------------------------- /cms_v5/config/redactor/Simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": ["bold", "italic"], 3 | "toolbarFixed": true, 4 | "plugins": ["richvariables"] 5 | } 6 | -------------------------------------------------------------------------------- /cms_v5/config/routes.php: -------------------------------------------------------------------------------- 1 | ' => ['template' => 'blog/_archive'], 15 | * 16 | * That example would match URIs such as `/blog/archive/2012`, and pass the 17 | * request along to the `blog/_archive` template, providing it a `year` variable 18 | * set to the value `2012`. 19 | */ 20 | 21 | return [ 22 | 'amp' => ['template' => 'amp-index'], 23 | ]; 24 | -------------------------------------------------------------------------------- /cms_v5/config/seomatic-config/globalmeta/Creator.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'siteType' => 'Organization', 21 | 'siteSubType' => '', 22 | 'siteSpecificType' => '', 23 | 'computedType' => 'Organization', 24 | 'genericName' => 'nystudio107', 25 | 'genericAlternateName' => 'nys', 26 | 'genericDescription' => 'We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO', 27 | 'genericUrl' => 'https://nystudio107.com/', 28 | 'genericImage' => 'https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png', 29 | 'genericImageWidth' => '1042', 30 | 'genericImageHeight' => '1042', 31 | 'genericImageIds' => [], 32 | 'genericTelephone' => '', 33 | 'genericEmail' => 'info@nystudio107.com', 34 | 'genericStreetAddress' => '', 35 | 'genericAddressLocality' => 'Webster', 36 | 'genericAddressRegion' => 'NY', 37 | 'genericPostalCode' => '14580', 38 | 'genericAddressCountry' => 'US', 39 | 'genericGeoLatitude' => '43.2365384', 40 | 'genericGeoLongitude' => '-77.49211620000001', 41 | 'personGender' => '', 42 | 'personBirthPlace' => '', 43 | 'organizationDuns' => '', 44 | 'organizationFounder' => 'Andrew Welch, Polly Welch', 45 | 'organizationFoundingDate' => '2013-05-02', 46 | 'organizationFoundingLocation' => 'Webster, NY', 47 | 'organizationContactPoints' => [], 48 | 'corporationTickerSymbol' => '', 49 | 'localBusinessPriceRange' => '', 50 | 'localBusinessOpeningHours' => [], 51 | 'restaurantServesCuisine' => '', 52 | 'restaurantMenuUrl' => '', 53 | 'restaurantReservationsUrl' => '', 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /cms_v5/config/twigpack.php: -------------------------------------------------------------------------------- 1 | App::env('DEV_MODE'), 31 | // The JavaScript entry from the manifest.json to inject on Twig error pages 32 | 'errorEntry' => ['runtime.js', 'app.js'], 33 | // Manifest file names 34 | 'manifest' => [ 35 | 'legacy' => 'manifest-legacy.json', 36 | 'modern' => 'manifest.json', 37 | ], 38 | // Public server config 39 | 'server' => [ 40 | 'manifestPath' => '@webroot/dist/', 41 | 'publicPath' => '/', 42 | ], 43 | // webpack-dev-server config 44 | 'devServer' => [ 45 | 'manifestPath' => App::env('TWIGPACK_DEV_SERVER_MANIFEST_PATH'), 46 | 'publicPath' => App::env('TWIGPACK_DEV_SERVER_PUBLIC_PATH'), 47 | ], 48 | // Bundle to use with the webpack-dev-server 49 | 'devServerBuildType' => 'modern', 50 | // Whether to include a Content Security Policy "nonce" for inline 51 | // CSS or JavaScript. Valid values are 'header' or 'tag' for how the CSP 52 | // should be included. c.f.: 53 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#Unsafe_inline_script 54 | 'cspNonce' => '', 55 | // Local files config 56 | 'localFiles' => [ 57 | 'basePath' => '@webroot/', 58 | 'criticalPrefix' => 'dist/criticalcss/', 59 | 'criticalSuffix' => '_critical.min.css', 60 | ], 61 | ]; 62 | -------------------------------------------------------------------------------- /cms_v5/craft: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 16 | exit($exitCode); 17 | -------------------------------------------------------------------------------- /cms_v5/craft.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Craft command line bootstrap script for Windows 5 | rem ------------------------------------------------------------- 6 | 7 | @setlocal 8 | 9 | set CRAFT_PATH=%~dp0 10 | 11 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 12 | 13 | "%PHP_COMMAND%" "%CRAFT_PATH%craft" %* 14 | 15 | @endlocal 16 | -------------------------------------------------------------------------------- /cms_v5/ecs.php: -------------------------------------------------------------------------------- 1 | parallel(); 8 | $ecsConfig->sets([SetList::CRAFT_CMS_4]); 9 | }; 10 | -------------------------------------------------------------------------------- /cms_v5/example.env: -------------------------------------------------------------------------------- 1 | # Craft general settings 2 | ALLOW_UPDATES=1 3 | ALLOW_ADMIN_CHANGES=1 4 | APP_ID=project_v5 5 | BACKUP_ON_UPDATE=0 6 | DEV_MODE=1 7 | ENABLE_GRAPHQL_CACHING=0 8 | ENABLE_TEMPLATE_CACHING=0 9 | ENVIRONMENT=dev 10 | RUN_QUEUE_AUTOMATICALLY=0 11 | SECURITY_KEY=EOdiVBONceb8zFGJP7InMui2pMkvNACz 12 | SITE_NAME=plugindev 13 | 14 | # Craft database settings 15 | DB_USER=project 16 | DB_PASSWORD=project 17 | DB_DATABASE=project_v5 18 | DB_SCHEMA=public 19 | DB_TABLE_PREFIX= 20 | DB_CHARSET=utf8mb4 21 | DB_COLLATION=utf8mb4_unicode_ci 22 | 23 | # URL & path settings 24 | ASSETS_URL=http://plugindev.local:8005 25 | SITE_URL=http://plugindev.local:8005 26 | WEB_ROOT_PATH=/var/www/project/cms_v5/web 27 | CMS_ROOT_PATH=/var/www/project/cms_v5 28 | 29 | # Redis settings 30 | REDIS_HOSTNAME=redis 31 | REDIS_PORT=6379 32 | REDIS_DEFAULT_DB=0 33 | REDIS_CRAFT_DB=1 34 | 35 | # Xdebug Settings 36 | DBGP_IDEKEY=phpstorm 37 | 38 | # Plugin debug 39 | NYS_PLUGIN_DEVSERVER=1 40 | VITE_PLUGIN_DEVSERVER=1 41 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/.craftplugin: -------------------------------------------------------------------------------- 1 | {"pluginName":"Site","pluginDescription":"An example module for Craft CMS 3 that lets you enhance your websites with a custom site module","pluginVersion":"1.0.0","pluginAuthorName":"nystudio107","pluginVendorName":"nystudio107","pluginAuthorUrl":"https://nystudio107.com/","codeComments":[],"pluginComponents":[],"apiVersion":"module_api_version_3_0"} -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/.gitignore: -------------------------------------------------------------------------------- 1 | # CRAFT ENVIRONMENT 2 | .env.php 3 | .env.sh 4 | .env 5 | 6 | # COMPOSER 7 | /vendor 8 | 9 | # BUILD FILES 10 | /bower_components/* 11 | /node_modules/* 12 | /build/* 13 | /yarn-error.log 14 | 15 | # MISC FILES 16 | .cache 17 | .DS_Store 18 | .idea 19 | .project 20 | .settings 21 | *.esproj 22 | *.sublime-workspace 23 | *.sublime-project 24 | *.tmproj 25 | *.tmproject 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | config.codekit3 32 | prepros-6.config 33 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Site Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## 1.0.0 - 2018-01-19 8 | ### Added 9 | - Initial release 10 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 nystudio107 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/README.md: -------------------------------------------------------------------------------- 1 | # Site module for Craft CMS 3.x 2 | 3 | An example module for Craft CMS 3 that lets you enhance your websites with a custom site module 4 | 5 | ## Requirements 6 | 7 | This module requires Craft CMS 3.0.0-RC1 or later. 8 | 9 | ## Installation 10 | 11 | To install the module, follow these instructions. 12 | 13 | First, you'll need to add the contents of the `app.php` file to your `config/app.php` (or just copy it there if it does not exist). This ensures that your module will get loaded for each request. The file might look something like this: 14 | ``` 15 | return [ 16 | 'modules' => [ 17 | 'site-module' => [ 18 | 'class' => \modules\sitemodule\SiteModule::class, 19 | ], 20 | ], 21 | 'bootstrap' => ['site-module'], 22 | ]; 23 | ``` 24 | You'll also need to make sure that you add the following to your project's `composer.json` file so that Composer can find your module: 25 | 26 | "autoload": { 27 | "psr-4": { 28 | "modules\\sitemodule\\": "modules/sitemodule/src/" 29 | } 30 | }, 31 | 32 | After you have added this, you will need to do: 33 | 34 | composer dump-autoload 35 | 36 | …from the project’s root directory, to rebuild the Composer autoload map. This will happen automatically any time you do a `composer install` or `composer update` as well. 37 | 38 | ## Site Overview 39 | 40 | -Insert text here- 41 | 42 | ## Using Site 43 | 44 | -Insert text here- 45 | 46 | ## Site Roadmap 47 | 48 | Some things to do, and ideas for potential features: 49 | 50 | * Release it 51 | 52 | Brought to you by [nystudio107](https://nystudio107.com/) 53 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/assetbundles/sitemodule/SiteModuleAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = "@modules/sitemodule/assetbundles/sitemodule/dist"; 33 | 34 | $this->depends = [ 35 | CpAsset::class, 36 | ]; 37 | 38 | $this->js = [ 39 | 'js/SiteModule.js', 40 | ]; 41 | 42 | $this->css = [ 43 | 'css/SiteModule.css', 44 | ]; 45 | 46 | parent::init(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/assetbundles/sitemodule/dist/css/SiteModule.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site CSS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | 13 | body.login { 14 | background-color: #FFF; 15 | background-image: url('/img/site/login-background-image.png'); 16 | } 17 | 18 | body.login label, body.login #forgot-password { 19 | background-color: #FFF; 20 | } 21 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/assetbundles/sitemodule/dist/img/SiteModule-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/assetbundles/sitemodule/dist/js/SiteModule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/config.php: -------------------------------------------------------------------------------- 1 | getConfig()->env; 44 | 45 | // Try craft/config first 46 | $path = Craft::getAlias('@config/'.$fileName, false); 47 | if ($path === false || !file_exists($path)) { 48 | // Now try our own internal config 49 | $path = Craft::getAlias('@modules/sitemodule/'.$fileName, false); 50 | if ($path === false || !file_exists($path)) { 51 | return []; 52 | } 53 | } 54 | 55 | if (!is_array($config = @include $path)) { 56 | return []; 57 | } 58 | 59 | // If it's not a multi-environment config, return the whole thing 60 | if (!array_key_exists('*', $config)) { 61 | return $config; 62 | } 63 | 64 | // If no environment was specified, just look in the '*' array 65 | if ($currentEnv === null) { 66 | return $config['*']; 67 | } 68 | 69 | $mergedConfig = []; 70 | foreach ($config as $env => $envConfig) { 71 | if ($env === '*' || StringHelper::contains($currentEnv, $env)) { 72 | $mergedConfig = ArrayHelper::merge($mergedConfig, $envConfig); 73 | } 74 | } 75 | 76 | return $mergedConfig; 77 | } 78 | 79 | // Private Methods 80 | // ========================================================================= 81 | } 82 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/services/Helper.php: -------------------------------------------------------------------------------- 1 | 'Site plugin loaded', 18 | ]; 19 | -------------------------------------------------------------------------------- /cms_v5/modules/sitemodule/src/variables/SiteVariable.php: -------------------------------------------------------------------------------- 1 | parameters(); 11 | /** @noinspection PhpParamsInspection */ 12 | $parameters->set(Option::SKIP, [ 13 | '../../../../Users/andrew/webdev/craft_v5/craft-seomatic/src/integrations', 14 | '../../../../Users/andrew/webdev/craft_v5/craft-seomatic/src/models/jsonld', 15 | ]); 16 | 17 | // Craft Version 18 | $containerConfigurator->import(CraftSetList::CRAFT_CMS_40); 19 | $containerConfigurator->import(CraftSetList::CRAFT_COMMERCE_40); 20 | /* 21 | * Additional Rector set lists that can be uncommented to modernize code beyond 22 | * Craft CMS 4 compatibility 23 | 24 | // PHP Version 25 | $containerConfigurator->import(LevelSetList::UP_TO_PHP_80); 26 | // Other 27 | $containerConfigurator->import(SetList::CODE_QUALITY); 28 | $containerConfigurator->import(SetList::CODING_STYLE); 29 | $containerConfigurator->import(SetList::DEAD_CODE); 30 | $containerConfigurator->import(SetList::TYPE_DECLARATION); 31 | */ 32 | }; 33 | -------------------------------------------------------------------------------- /cms_v5/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v5/templates/.gitkeep -------------------------------------------------------------------------------- /cms_v5/templates/blog/_entry.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

{{ entry.plainText }}

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v5/templates/blog/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

Blog Index

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v5/templates/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "vendor/nystudio107/craft-twig-base-templates/templates/_layouts/html-page.twig" %} 2 | 3 | {# -- Content that appears before the primary content block -- #} 4 | {% block preContent %} 5 |
6 |

preContent

7 |
8 | {% endblock %} 9 | 10 | {# -- Primary content block -- #} 11 | {% block content %} 12 |
13 |

{{ entry.title }}

14 |

content

15 |
16 | {% endblock %} 17 | 18 | {# -- Content that appears after the primary content block -- #} 19 | {% block postContent %} 20 |
21 |

postContent

22 |
23 | {% endblock %} 24 | 25 | {# -- Any tags that should be included before -- #} 26 | {% block bodyScripts %} 27 | {{ parent() }} 28 | {% endblock bodyScripts %} 29 | -------------------------------------------------------------------------------- /cms_v5/web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | # Send would-be 404 requests to Craft 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] 8 | RewriteRule (.+) index.php?p=$1 [QSA,L] 9 | 10 | -------------------------------------------------------------------------------- /cms_v5/web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v5/web/cpresources/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms_v5/web/img/site/login-background-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/plugindev/7a01d2cd87b5acb2e8159f4e0363e750f0f9101c/cms_v5/web/img/site/login-background-image.png -------------------------------------------------------------------------------- /cms_v5/web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /cms_v5/web/offline.svg: -------------------------------------------------------------------------------- 1 | Offlineoffline 2 | -------------------------------------------------------------------------------- /cms_v5/web/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nystudio107/plugindev", 3 | "description": "nystudio107 Craft CMS plugin development environment scaffolding", 4 | "keywords": [ 5 | "craft", 6 | "cms", 7 | "craftcms", 8 | "plugin", 9 | "development" 10 | ], 11 | "license": "0BSD", 12 | "homepage": "https://craftcms.com/", 13 | "type": "project", 14 | "support": { 15 | "email": "support@craftcms.com", 16 | "issues": "https://github.com/craftcms/cms/issues", 17 | "forum": "https://craftcms.stackexchange.com/", 18 | "source": "https://github.com/craftcms/cms", 19 | "docs": "https://craftcms.com/docs", 20 | "rss": "https://craftcms.com/changelog.rss" 21 | }, 22 | "scripts": { 23 | "post-create-project-cmd": [ 24 | "@php -r \"copy('./cms_v3/example.env', './cms_v3/.env');\"", 25 | "@php -r \"copy('./cms_v4/example.env', './cms_v4/.env');\"", 26 | "@php -r \"@unlink('composer.json');\"", 27 | "@php -r \"@unlink('composer.lock');\"", 28 | "@php -r \"@unlink('LICENSE.md');\"" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /db-seed/mysql/db_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | MYSQL_DB_SEED_DIR="dbs" 3 | MYSQL_DATABASES_ARRAY=( $MYSQL_DATABASES ) 4 | 5 | # from: https://github.com/mysql/mysql-docker/blob/main/mysql-server/8.0/docker-entrypoint.sh 6 | # Check if entrypoint (and the container) is running as root 7 | if [ $(id -u) = "0" ]; then 8 | is_root=1 9 | install_devnull="install /dev/null -m0600 -omysql -gmysql" 10 | MYSQLD_USER=mysql 11 | else 12 | install_devnull="install /dev/null -m0600" 13 | MYSQLD_USER=$(id -u) 14 | fi 15 | # To avoid using password on commandline, put it in a temporary file. 16 | # The file is only populated when and if the root password is set. 17 | PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX) 18 | $install_devnull "$PASSFILE" 19 | if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then 20 | # Put the password into the temporary config file 21 | cat >"$PASSFILE" </dev/null 20 | echo "### \`$POSTGRES_DB\` database seeded" 21 | done 22 | -------------------------------------------------------------------------------- /db-seed/postgres/dbs/test.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- PostgreSQL database dump 3 | -- 4 | 5 | -- Dumped from database version 12.10 6 | -- Dumped by pg_dump version 13.5 7 | -------------------------------------------------------------------------------- /src/templates: -------------------------------------------------------------------------------- 1 | ../cms/templates --------------------------------------------------------------------------------