zizther/craftcms-ddev 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zizther/craftcms-ddev

Composer 安装命令:

composer create-project zizther/craftcms-ddev

包简介

A Craft CMS starter project using DDEV for local hosting and Vite for front-end bundling and HMR.

README 文档

README

A Craft CMS starter project using DDEV for local hosting and Vite for front-end bundling and HMR.

Going from zero to Vite HMR on a fresh Craft install, with only 4 CLI commands:

  1. composer create-project...
  2. make init
  3. make setup
  4. make dev

Notable Features:

Local machine prerequisites:

  1. Docker
  2. DDEV, minimum version 1.19
  3. Optional, but recommended, Composer

Getting Started

Option 1: With Composer (recommended)

If you have Composer installed on your local machine, you can use create-project to pull the latest tagged release.

Open terminal prompt, and run:

composer create-project zizther/craftcms-ddev PATH --no-install

Make sure that PATH is a new or existing and empty folder.

Option 2: With Git CLI

Alternatively you can clone the repo via the Git CLI. degit is the easiest way:

degit git@github.com:zizther/craftcms-ddev.git PATH

Make sure that PATH is a new or existing and empty folder.

Last, clean up and set some default files for use:

make init

If you are using git clone

You'll want to discard the existing /.git directory. In the terminal, run:

cd PATH
rm -rf .git

Option 3: Manual Download

Download a copy of the repo to your local machine and move to where you want to your project to run. Similar to above, you'll then want to clean up and set some default files for use. In the terminal, run:

make init

Configuring DDEV

Note: This section is optional. If you are simply test-driving this project, feel free to skip to the next section. ⚡

To configure your project to operate on a domain other than https://craftcms.test, run:

ddev config

Follow the prompts.

  • Project name: e.g. mysite would result in a project URL of https://mysite.test (make note of this for later in the installation process)
  • Docroot location: defaults to web, keep as-is
  • Project Type: defaults to php, keep as-is

Installing Craft

To install a clean version of Craft, run:

make setup

Follow the prompts.

This command will:

  1. Set the project name and domain
  2. Copy your local SSH keys into the container (handy if you are setting up craft-scripts)
  3. Start your DDEV project
  4. Install Composer
  5. Install npm
  6. Do a one-time build of Vite
  7. Generate CRAFT_APP_ID and save to your .env file
  8. Generate CRAFT_SECURITY_KEY and save to your .env file
  9. Installing Craft for the first time, allowing you to set the admin's account credentials
  10. Install some of the Craft plugins

Once the process is complete, type ddev launch to open the project in your default browser. 🚀

Local development with Vite

To begin development with Vite's dev server & HMR, run:

make dev

This command will:

  1. Copy your local SSH keys into the container (handy if you are setting up craft-scripts)
  2. Start your DDEV project
  3. Install Composer
  4. Install npm
  5. Do a one-time build of Vite
  6. Spin up the Vite dev server

Open up a browser to your project domain to verify that Vite is connected. Begin crafting beautiful things. ❤️

Makefile

A Makefile has been included to provide a unified CLI for common development commands.

  • make install - Runs a complete one-time process to set the project up and install Craft.
  • make up - Starts the DDEV project, ensuring that SSH keys have been added, and npm & Composer have been installed.
  • make dev - Runs a one-time build of all front-end assets, then starts Vite's server for HMR.
  • make build - Builds all front-end assets.
  • make composer xxx - Run Composer commands inside the container, e.g. make composer install
  • make craft xxx - Run Craft commands inside the container, e.g. make craft project-config/touch
  • make npm xxx - Run npm commands inside the container, e.g. make npm install
  • make clean - Removes the composer.lock, package-lock.json and the entire node_modules & vendor directory
  • make nuke - Restarts the project from scratch by running make clean (above), then reinstalls composer and node packages
  • make pull - Pull remote db & assets (requires setting up craft-scripts

Tip: If you try a command like make craft project-config/apply --force you’ll see an error, because the shell thinks the --force flag should be applied to the make command. To side-step this, use the -- (double-dash) to disable further option processing, like this: make -- craft project-config/apply --force

Craft CMS Plugins

  1. AWS S3
  2. CKEditor
  3. CP Clear Cache
  4. CP Field Inspect
  5. Craft Autocomplete
  6. Hyper
  7. Navigation
  8. Neo
  9. Quick Field
  10. Ray
  11. Retour
  12. SEOmatic
  13. Vite

Javascript Libraries

  1. Alpine
  2. Body Scroll Locking
  3. Splide
  4. GSAP
  5. Quicklink
  6. Reframe
  7. Vanilla Lazyload

Kudos

Thanks to Andrew (nystudio107) and johndwells for the inspiration

zizther/craftcms-ddev 适用场景与选型建议

zizther/craftcms-ddev 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「cms」 「Craft」 「craftcms」 「ddev」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 zizther/craftcms-ddev 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 zizther/craftcms-ddev 我们能提供哪些服务?
定制开发 / 二次开发

基于 zizther/craftcms-ddev 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-30