garvinhicking / tdk-project
TYPO3 Composer 开发套件:项目模板
Requires
- ext-json: *
- composer/composer: ^2.6
- garvinhicking/tdk-cli: @dev
- garvinhicking/tdk-core: @dev
Requires (Dev)
- bk2k/bootstrap-package: @dev
- typo3/cms-adminpanel: @dev
- typo3/cms-backend: @dev
- typo3/cms-belog: @dev
- typo3/cms-beuser: @dev
- typo3/cms-core: @dev
- typo3/cms-dashboard: @dev
- typo3/cms-extbase: @dev
- typo3/cms-extensionmanager: @dev
- typo3/cms-felogin: @dev
- typo3/cms-filelist: @dev
- typo3/cms-filemetadata: @dev
- typo3/cms-fluid: @dev
- typo3/cms-fluid-styled-content: @dev
- typo3/cms-form: @dev
- typo3/cms-frontend: @dev
- typo3/cms-impexp: @dev
- typo3/cms-indexed-search: @dev
- typo3/cms-info: @dev
- typo3/cms-install: @dev
- typo3/cms-linkvalidator: @dev
- typo3/cms-lowlevel: @dev
- typo3/cms-opendocs: @dev
- typo3/cms-recordlist: @dev
- typo3/cms-recycler: @dev
- typo3/cms-redirects: @dev
- typo3/cms-reports: @dev
- typo3/cms-rte-ckeditor: @dev
- typo3/cms-scheduler: @dev
- typo3/cms-seo: @dev
- typo3/cms-setup: @dev
- typo3/cms-styleguide: @dev
- typo3/cms-sys-note: @dev
- typo3/cms-t3editor: @dev
- typo3/cms-tstemplate: @dev
- typo3/cms-viewpage: @dev
- typo3/cms-workspaces: @dev
This package is auto-updated.
Last update: 2024-09-24 17:33:55 UTC
README
提供一个模板,用于 "composer create-project",以创建自己的项目
这项工作建立在巨人的肩膀上
感谢 Jochen Roth, Stefan Bürk, Andreas Wolf(以及不知名的 Helmut Hummel)一直忍受我,一次又一次地讨论这个想法。 ;)
如何
从头开始创建
## Initialize a composer project by using a boilerplate
composer create-project --stability dev garvinhicking/tdk-project my-tdk-demo
## Change to the new directory
chdir my-tdk-demo
## Now you can install the actual TYPO3-cms packages as a
## dev-dependency (you are actually using a dev-setup, so
## in my world, you're good!)
## Using "composer install" at this point would install
## locked versions of the PACKAGIST, so we actually
## run "composer update" at this point to both update
## and install the local packages. Sounds confusing? Yes. It is.
composer update
从现有仓库创建
通过上述方法创建的项目可以提交到您的自己的仓库。然后,您可以克隆您的目录,并通过以下方式使用 TYPO3-core 进行设置:
## Clone your repository (can be anything, must not be GitHub)
git clone git@github.com:your-vendor/your-repo.git my-tdk-demo
## Change to directory
cd my-tdk-demo
## Install the required modules WITHOUT DEV FIRST (see note)
## !!!VERY IMPORTANT!!!
composer install --no-dev
## That will have then checked out your sources. Now you should
## be able to update composer and install the dev-dependencies
## properly.
composer update
后续:DDEV
该项目还提供了一个默认的 DDEV 配置。
您可以使用 ddev start
启动它。
tdk-project 伪数据提供了基本配置,但您需要初始化数据库。这可以通过 ddev ssh
最容易完成,然后
TYPO3_DB_DRIVER=mysqli \
TYPO3_DB_USERNAME=db \
TYPO3_DB_PORT=3306 \
TYPO3_DB_HOST=db \
TYPO3_DB_DBNAME=db \
TYPO3_DB_PASSWORD=db \
TYPO3_SETUP_ADMIN_PASSWORD="SuperDuper0815." \
TYPO3_SETUP_ADMIN_EMAIL=admin@example.com \
TYPO3_SETUP_ADMIN_USERNAME=admin \
TYPO3_SETUP_CREATE_SITE="https://tdk-project.ddev.site/" \
TYPO3_PROJECT_NAME="TYPO3 Development Kit" \
TYPO3_SERVER_TYPE="apache" \
./vendor/bin/typo3 setup --force
如果您分支出自己的项目,您应该
- 编辑
.ddev/config.yaml
并配置您自己的主机名 - 提供您自己的
config/sites/tdk-project/
站点配置 - 提供您自己的
config/system/*.php
核心配置
只需这样做
现在您应该有一个具有后端和前端的正常工作的 TYPO3 环境。
您的目录 typo3-core
是一个独立的 GIT 工作目录。
您可以去那个目录并执行常规的 git
操作,如拉取、选择。
理论上,您也可以更改分支,但那时您必须调整您的 composer.json 以反映版本号。这个存储库旨在 main
开发(目前:TYPO3 v13)。
在通过 git pull
更新到最新的 TYPO3 变更后,您可能还需要在根目录中运行 composer update
。这可以确保可以解决依赖关系。
在 typo3-core
目录中,您也可以运行 composer install
,以便在该树中安装所有开发包。这将允许您运行常规的开发者任务,如 Build/Scripts/runTests.sh
脚本以及 phpstan
等。
当您以这种方式为 TYPO3-core 贡献时,您可以使用此项目中的工作目录。只需记住,您需要在 typo3-core
目录中操作 GIT。如果您在目录外操作 GIT,您正在对 tdk-project
特定目录进行更改。这个目录永远不会持有 TYPO3 特定核心信息,它只是一个包装器,以便您可以在 composer 模式下利用 TYPO3
。
最大的好处是,您可以将自定义扩展放在 /packages/
子目录中,并使用 composer
(在项目根目录中,而不是 typo3-core
子目录中)要求这些扩展。这些扩展将在您的 TYPO3 安装中可用。
这还允许您将这些扩展存储在主项目仓库中,以便其他人可以轻松检出带有您提供的扩展的 TYPO3 Core
的各个方面。
您还可以将自定义的SQL导出
文件添加到这个仓库中,并允许通过ddev import-db
(和ddev export-db
)轻松(重新)导入。
注意
目前采用了复杂的解决方案来尝试解决特定的问题。
一旦执行了vendor/bin/tdk-cli clone
命令成功,我们才能在composer.json
中列出并正确安装typo3/cms-*
包。因为没有本地仓库,这些包不能从本地GIT仓库中安装。
在列出包之前不能创建本地git仓库,因为人们可能在没有Git工作目录的情况下检出项目。
我们需要将composer.json
放入这个仓库中,以便人们能够生成自定义项目并使其运行。
现在的解决方案是在实际的TYPO3包上使用"require-dev",并首先通过不要求包(我们无法找到本地包的地方)来启动"composer install"。
当然还有更好的方法。我只是还没有找到。帮帮我!:-)
待办事项
- CLI询问要加载哪些扩展
- 添加githooks
- 添加git提交模板
- ...?