定制 helsingborg-stad/project-synchronizer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

helsingborg-stad/project-synchronizer

最新稳定版本:0.1.14

Composer 安装命令:

composer require helsingborg-stad/project-synchronizer

包简介

A utitlity to synchronize projects from one repo to another

README 文档

README

Adds and upgrades dependencies and files from a master repository.

Installation

Install using composer: composer global require helsingborg-stad/project-synchronizer

Usage

Usage: $(composer config -g home)/vendor/bin/ps

	--config <file|url>            	Configuration file or URL
	--source <folder|url>          	Source repository path
	--target <folder>				Target repository path
	--force							Overwrite existing files and property values
	--help                         	Display this help message

Configuration

A project specific configuration file is used to define which file and optionally which properties of a file that should be synchronized. The composition of the configuration is quite straight forward.

Commandline options (except for the --config parameter) can be stored in the configurationfile. If the corresponding options are provided in the configuration, they will take prescedence over the commandline options.

{
	"source": "...",
	"target": "...",
	"force": true|false,
	"files": { <see below> }
}

The files structure:

{
	"files": {
		"/package.json": [
			"license",
			"dependencies",
			"devDependencies",
			"scripts",
			"engines",
			"jest"
		],
		"/composer.json": ["require", "require-dev", "scripts"],
		"/tsconfig.json": ["compilerOptions"],
		"/.vscode/settings.json": [
			"editor.formatOnSave",
			"editor.defaultFormatter",
			"editor.codeActionsOnSave"
		],
		"/.vscode/extensions.json": ["recommendations"],
		"/vite.config.mjs": []
	}
}

Note that only json files can be transformed. Other file types will be be copied "as is".

By default the application is looking for a ps-config.json file in the running path of the project but the path could be altered with the --config parameter.

Default target is the current directory.

The location of the source files should be set using the --source parameter, either https or filesystem. (It will default to this Github project).

To configure which files to be synched, simply list the project relative path of the file and optionally which items to synchronize. If the item list is empty, e.g "/myfile.txt": [], the complete file will be transfered (see constraints of 'target files' below).

The synchronization is non-destructive by default:

  • Additions will always be processed (e.g a property is missing in the target project).
  • A target property will be replaced IF it contains a semver compatible value AND the range of the source value is higher than the same value in the target property.
  • Arrays will be merged and existing values preserved.
  • Existing target files will be preserved

Using the --force flag will have the following implications:

  • Existing target properties will be overwritten with values of source.
  • Target arrays will be replaced with the values of the source.
  • Existing target files will be replaced.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-15