pattern-lab/edition-development-twig 问题修复 & 功能扩展

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

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

pattern-lab/edition-development-twig

最新稳定版本:v2.0.3

Composer 安装命令:

composer create-project pattern-lab/edition-development-twig

包简介

The Twig-based development edition of Pattern Lab. Allows one to clone all of the base Pattern Lab repos at once.

关键字:

README 文档

README

The Development Edition for Twig allows the core team to work on and commit changes to the latest editions of select Twig-related components while running each one within the overall Pattern Lab environment. This edition is NOT stable.

Pattern Lab Standard Edition for Twig is the stable version. Please start there for all your Twig needs.

Packaged Components

The Development Edition for Twig installs the dev branch from each of the following components:

Installing the Development Edition for Twig

Pattern Lab uses Composer to manage project dependencies. If you are going to use the Development Edition you are required to have Composer installed.

1. Install Composer

Please follow the directions for installing Composer on the Composer website. We recommend you install it globally.

2. Install the Development Edition

Use Composer's create-project feature to install the Development Edition into a location of your choosing. Type:

cd install/location/
composer create-project pattern-lab/edition-development-twig your-project-name && cd $_

This will create a directory called your-project-name. It will also install Pattern Lab's default folder structure as well as core, its dependencies, and the select packages as separate Git clones.

Helpful Commands

These are some helpful commands you can use on the command line for working with Pattern Lab.

List all of the available commands

To list all available commands type:

php core/console --help

To list the options for a particular command type:

php core/console --help --[command]

Generate Pattern Lab

To generate the front-end for Pattern Lab type:

php core/console --generate

Watch for changes and re-generate Pattern Lab

To watch for changes and re-generate the front-end for Pattern Lab type:

php core/console --watch

Start a server to view Pattern Lab

You can use PHP's built-in web server to review your Pattern Lab project in a browser. In a seperate window type:

php core/console --server

Then open http://localhost:8080 in your browser.

Install a StarterKit

To install a near-empty StarterKit as a starting point for your project type:

php core/console --starterkit --init

To install a specific StarterKit from GitHub type:

php core/console --starterkit --install <starterkit-vendor/starterkit-name>

Update Git Remotes

Due to an issue with Composer the default remote values for the dev branches are set to the wrong locations. This will cause issues if/when you try to push your changes. To update them you must type:

git config branch.dev.remote origin

for each package. The list of packages included in the Development Edition and their locations are:

pattern-lab/core -> vendor/pattern-lab/core/
pattern-lab/unified-asset-installer -> vendor/pattern-lab/unified-asset-installer
pattern-lab/patternengine-twig -> packages/pattern-lab/patternengine-twig
pattern-lab/starterkit-twig-default -> packages/pattern-lab/starterkit-twig-default
pattern-lab/styleguidekit-assets-default -> packages/pattern-lab/styleguidekit-assets-default
pattern-lab/styleguidekit-twig-default -> packages/pattern-lab/styleguidekit-twig-default

Important: If you add another Pattern Lab package (e.g. plug-in, StarterKit, etc.) you must also make sure to update the origin for its dev branch.

Adding a New Package

To add a new package to your version of the Development Edition for Twig type:

composer require package-name/from-packagist

Composer uses Packagist as the repository of all Pattern Lab-related packages from the core Pattern Lab team.

Important: If you add another Pattern Lab package (e.g. plug-in, StarterKit, etc.) you must also make sure to update the origin for its dev branch. See instructions above.

Forking and Testing a Package

To use the Development Edition to test changes you may have made to a fork of a package do the following:

1. Fork a Package and Create a Feature Test Branch

On GitHub you can fork the package you want to modify. You must create a new branch in which you will create your new changes. In this example we will use pattern-lab/patternengine-mustache as the example of our forked project and bugfix as the name of our branch.

2. Update the Repositories Section of composer.json

In composer.json you need to add or update the repositories section to point at your forked repository for a package:

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/your-name/patternengine-php-mustache"
    }
],

3. Update the Package Branch in Require Section of composer.json

In composer.json you need to update the require section to point at the new branch in your forked repository:

"require": {
    "pattern-lab/patternengine-twig": "dev-bugfix"
}

Reminder: dev- is used by Composer to know when it should clone a branch in a repo instead of downloading it. dev- should not he a part of the name of your branch.

4. Update the Development Edition's Dependencies

To update the Development Edition's dependencies to use your forked package type:

composer update pattern-lab/patternengine-twig

Testing Against "Releases"

Packages developed by the core Pattern Lab team use the gitflow model of Git repository management. Because the Development Edition clones the repos for each package you can technically switch each package to use the master branch to test against the last release of any particular package.

pattern-lab/edition-development-twig 适用场景与选型建议

pattern-lab/edition-development-twig 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 207 次下载、GitHub Stars 达 9, 最近一次更新时间为 2015 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 pattern-lab/edition-development-twig 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 6
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-06