承接 shel/yaml-splitter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

shel/yaml-splitter

Composer 安装命令:

composer require shel/yaml-splitter

包简介

Splits YAML files

关键字:

README 文档

README

Features:

  • split YAML files containing multiple nodetypes into separate files each containing one nodetype
  • reorganize nodetypes files from the old style Configuration folder to the new NodeTypes folder and will also create subfolders based on their naming scheme

Installation

Recommended

Download the Phar version of the latest release. You can find it after the individual change log in the Assets section.

Afterwards you should make the file executable by running

chmod a+x yaml-splitter.phar

Now you can follow the usage examples below.

Via composer

Add this tool as dependency to your project via

composer require --dev shel/yaml-splitter 

Or install the package globally via

composer global require shel/yaml-splitter 

Afterwards you can run the commands in your project by prefixing the usage examples like this:

bin/yaml-splitter.php split ...

Usage

List commands

./yaml-splitter.phar list

Show options for split command

./yaml-splitter.phar help split

Split a file

./yaml-splitter.phar split [options] [--] <path> [<output-path>]

This will copy each node type found in the input file into a new file. Each new file be have a name like NodeTypes.MyNodeType.yaml.

Additionally, each filename will get a prefix after NodeTypes like Document, Content or Mixin based on the name of the actual node type.

Also, when the option package-key is provided, node types matching the package key will have the standard naming and others will get names like NodeTypes.Override.SomeOtherNodeType.yaml.

Options

  • dry-run allows seeing what would happen without writing any file
  • use-folders splits the nodetypes into a folder structure for Neos 7.2+
  • package-key allows to define the main package key of your node types, so node types with different package keys would be written to NodeTypes.Override.xyz files.
  • indentation number of spaces for indentation in the resulting YAML files

Example

./yaml-splitter.phar split --dry-run --package-key MyVendor path/to/MyVendor.NodeTypes.yaml path/to/package

Reorganize the nodetypes in a Configuration folder into Neos 7.2+ nodetype subfolders

With Neos 7.2 it's possible to organize nodetypes into separate folders than Configuration. It also allows you to use subfolders.

With the following command you can move all NodeTypes.*.yaml from a Configuration folder into another folder. They will automatically be put into subfolders based on their naming scheme.

So for example you have the following files in your Configuration folder of your site package:

Configuration
├── NodeTypes.Content.Image.yaml
├── NodeTypes.Content.Text.yaml
├── NodeTypes.Document.Abstract.Page.yaml
├── NodeTypes.Document.Home.yaml
├── NodeTypes.Document.Page.yaml
├── NodeTypes.Override.Content.Popup.yaml
├── NodeTypes.Override.Mixin.Document.yaml
└── NodeTypes.Override.Mixin.MarginMixin.yaml

Now you run the reorganize command:

./yaml-splitter.phar reorganize path/to/sitepackage/Configuration path/to/sitepackage/NodeTypes

After you execute the command you will have the following structure:

NodeTypes
├── Content
│   ├── Image.yaml
│   └── Text.yaml
├── Document
│  ├── Abstract
│  │   └── Page.yaml
│  ├── Home.yaml
│  └── Page.yaml
└── Override
    ├── Content
    │   └── Popup.yaml
    └── Mixin
        ├── Document.yaml
        └── MarginMixin.yaml

Note: If you still have multiple nodetypes inside one file, it's recommended to first run the split command and then reorganize.

Contributing

The tool is based on the Symfony console component.

Building the phar

First install box.

Then run

composer run compile 

shel/yaml-splitter 适用场景与选型建议

shel/yaml-splitter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 831 次下载、GitHub Stars 达 11, 最近一次更新时间为 2021 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 shel/yaml-splitter 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-11