{"id":24716692,"url":"https://github.com/template-tools/template-sync","last_synced_at":"2026-02-13T03:20:21.636Z","repository":{"id":36988384,"uuid":"69404625","full_name":"template-tools/template-sync","owner":"template-tools","description":"Keep repository in sync with its template ","archived":false,"fork":false,"pushed_at":"2025-01-27T01:38:40.000Z","size":7160,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T02:28:27.219Z","etag":null,"topics":["bitbucket","boilerplate","github","gitignore","npm","npmignore","pull-requests","scaffolding","template","travis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/template-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-27T22:41:47.000Z","updated_at":"2025-01-27T01:36:28.000Z","dependencies_parsed_at":"2023-09-23T02:56:10.136Z","dependency_job_id":"e1e28632-4f56-43f6-9fc6-aaeb10b83546","html_url":"https://github.com/template-tools/template-sync","commit_stats":null,"previous_names":["arlac77/npm-template-sync"],"tags_count":1360,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/template-tools%2Ftemplate-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/template-tools%2Ftemplate-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/template-tools%2Ftemplate-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/template-tools%2Ftemplate-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/template-tools","download_url":"https://codeload.github.com/template-tools/template-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235826645,"owners_count":19051122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitbucket","boilerplate","github","gitignore","npm","npmignore","pull-requests","scaffolding","template","travis"],"created_at":"2025-01-27T09:13:44.479Z","updated_at":"2026-02-13T03:20:21.617Z","avatar_url":"https://github.com/template-tools.png","language":"JavaScript","readme":"[![npm](https://img.shields.io/npm/v/@template-tools/template-sync.svg)](https://www.npmjs.com/package/@template-tools/template-sync)\n[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)\n[![bundlejs](https://deno.bundlejs.com/?q=@template-tools/template-sync\\\u0026badge=detailed)](https://bundlejs.com/?q=@template-tools/template-sync)\n[![downloads](http://img.shields.io/npm/dm/@template-tools/template-sync.svg?style=flat-square)](https://npmjs.org/package/@template-tools/template-sync)\n[![GitHub Issues](https://img.shields.io/github/issues/template-tools/template-sync.svg?style=flat-square)](https://github.com/template-tools/template-sync/issues)\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftemplate-tools%2Ftemplate-sync%2Fbadge\\\u0026style=flat)](https://actions-badge.atrox.dev/template-tools/template-sync/goto)\n[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Known Vulnerabilities](https://snyk.io/test/github/template-tools/template-sync/badge.svg)](https://snyk.io/test/github/template-tools/template-sync)\n\n## template-sync\n\nKeep repository in sync with its template.\n\nGenerates pull requests to bring a repository back in sync with its template.\n\nSo by making changes to the template and applying template-sync the target project will be updated accoring to the template.\n\nWorks with github and bitbucket.\n\nThis is the engine for cli operation please see [template-tools/template-sync-cli](https://github.com/template-tools/template-sync-cli)\n\nMerges contents from template branch into destination branch handling some special cases for:\n\n*   Licenses - rewriting license years\n*   line set files like .npmignore and .gitignore - by merging both sets together\n*   package.json - merge (.\\*)\\[Dd]ependencies, engines and scripts\n*   rollup.conf.\\*js - copy / rewrite + detect dev dependencies\n*   [\\*.yaml - merge](doc/yaml/README.md)\n*   [.travis.yml - merge with hints](doc/travis/README.md)\n*   [\\*.toml - merge](doc/toml/README.md)\n*   [\\*.ini - merge](doc/ini/README.md)\n*   [\\*.json - merge](doc/json/README.md)\n*   README.md - merge badges\n\n![generated pull request](doc/pr_sample.png)\n\n## Some templates\n\n*   [arlac77/template-cli-app](https://github.com/arlac77/template-cli-app) *rollup* *ava* *travis*\n*   [arlac77/template-esm-only](https://github.com/arlac77/template-esm-only) *ava* *travis*\n*   [arlac77/template-svelte-component](https://github.com/arlac77/template-svelte-component) *svelte* *rollup* *testcafe* *travis*\n*   [arlac77/template-svelte-app](https://github.com/arlac77/template-svelte-app) *svelte* *rollup* *pkgbuild* *travis*\n*   [arlac77/template-kronos-component](https://github.com/arlac77/template-kronos-component) template-esm-only with node 14\n*   [arlac77/template-kronos-app](https://github.com/arlac77/template-kronos-app) node 14 + systemd\n\n# API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### Table of Contents\n\n*   [Context](#context)\n    *   [Parameters](#parameters)\n    *   [Properties](#properties)\n    *   [targetBranch](#targetbranch)\n    *   [initialize](#initialize)\n    *   [execute](#execute)\n    *   [commits](#commits)\n    *   [executeBranch](#executebranch)\n*   [pullRequestBranch](#pullrequestbranch)\n*   [sortedKeys](#sortedkeys)\n*   [exportsConditionOrder](#exportsconditionorder)\n*   [Package](#package)\n    *   [properties](#properties-1)\n        *   [Parameters](#parameters-1)\n*   [Merger](#merger)\n    *   [properties](#properties-2)\n        *   [Parameters](#parameters-2)\n    *   [commits](#commits-1)\n        *   [Parameters](#parameters-3)\n*   [Merger](#merger-1)\n    *   [Properties](#properties-3)\n    *   [properties](#properties-4)\n        *   [Parameters](#parameters-4)\n    *   [commits](#commits-2)\n        *   [Parameters](#parameters-5)\n*   [Readme](#readme)\n*   [MergeLineSet](#mergelineset)\n*   [ReplaceIfEmpty](#replaceifempty)\n*   [Replace](#replace)\n*   [INI](#ini)\n*   [Skip](#skip)\n*   [Delete](#delete)\n*   [EntryMerger](#entrymerger)\n    *   [Properties](#properties-5)\n*   [Template](#template)\n    *   [Parameters](#parameters-6)\n    *   [Properties](#properties-6)\n    *   [shortKey](#shortkey)\n    *   [entryMerger](#entrymerger-1)\n        *   [Parameters](#parameters-7)\n    *   [mergerFor](#mergerfor)\n        *   [Parameters](#parameters-8)\n    *   [\\_templateFrom](#_templatefrom)\n        *   [Parameters](#parameters-9)\n    *   [updateUsedBy](#updateusedby)\n        *   [Parameters](#parameters-10)\n    *   [templateFor](#templatefor)\n        *   [Parameters](#parameters-11)\n*   [normalizeTemplateSources](#normalizetemplatesources)\n    *   [Parameters](#parameters-12)\n*   [jspath](#jspath)\n    *   [Parameters](#parameters-13)\n*   [actions2message](#actions2message)\n    *   [Parameters](#parameters-14)\n*   [actions2messages](#actions2messages)\n    *   [Parameters](#parameters-15)\n\n## Context\n\n**Extends LogLevelMixin(class \\_Context {})**\n\nContext prepared to execute one branch.\n\n### Parameters\n\n*   `provider` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\u0026#x20;\n*   `targetBranch` **(Branch | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**\u0026#x20;\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**  (optional, default `{}`)\n\n### Properties\n\n*   `ctx` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\u0026#x20;\n*   `files` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\u003e**\u0026#x20;\n\n### targetBranch\n\nType: (Branch | [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))\n\n### initialize\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\u003c([Context](#context) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))\u003e**\u0026#x20;\n\n### execute\n\nGenerate Pull Requests.\n\nReturns **AsyncIterable\\\u003cPullRequest\u003e**\u0026#x20;\n\n### commits\n\nGenerate all commits from the template entry merges.\n\nReturns **AsyncIterable\\\u003cCommit\u003e**\u0026#x20;\n\n### executeBranch\n\nGenerate Pull Requests.\n\nReturns **AsyncIterable\\\u003cPullRequest\u003e** the actual PRs\n\n## pullRequestBranch\n\nType: [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n## sortedKeys\n\norder in which json keys are written\n\n## exportsConditionOrder\n\n*   **See**: {\u003chttps://nodejs.org/dist/latest/docs/api/packages.html#exports}\u003e\n\nOrder in which exports are searched\n\n## Package\n\n**Extends Merger**\n\nMerger for package.json\n\n### properties\n\nDeliver some key properties.\n\n*   name\n*   version\n*   description\n*   main\n\n#### Parameters\n\n*   `entry` **ContentEntry**\u0026#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\u003c[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\u003e**\u0026#x20;\n\n## Merger\n\nMergable content\n\n### properties\n\nDeliver some key properties.\n\n#### Parameters\n\n*   `entry` **ContentEntry**\u0026#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\u003c[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\u003e** extracted properties\n\n### commits\n\nGenerate commits as result of merging two entries.\n\n#### Parameters\n\n*   `context` \u0026#x20;\n*   `destinationEntry` \u0026#x20;\n*   `sourceEntry` \u0026#x20;\n*   `options` \u0026#x20;\n\nReturns **AsyncIterable\\\u003cCommit\u003e**\u0026#x20;\n\n## Merger\n\nType: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n### Properties\n\n*   `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n*   `pattern` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n*   `factory` **Class**\u0026#x20;\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\u0026#x20;\n\n### properties\n\nDeliver some key properties.\n\n#### Parameters\n\n*   `entry` **ContentEntry**\u0026#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\u003c[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\u003e** extracted properties\n\n### commits\n\nGenerate commits as result of merging two entries.\n\n#### Parameters\n\n*   `context` \u0026#x20;\n*   `destinationEntry` \u0026#x20;\n*   `sourceEntry` \u0026#x20;\n*   `options` \u0026#x20;\n\nReturns **AsyncIterable\\\u003cCommit\u003e**\u0026#x20;\n\n## Readme\n\n**Extends Merger**\n\nInjects badges into README.md.\n\n## MergeLineSet\n\n**Extends Merger**\n\n## ReplaceIfEmpty\n\n**Extends Merger**\n\nOverwrites none existing entries from template.\n\n## Replace\n\n**Extends Merger**\n\nAlways overwrite entry from template\n\n## INI\n\n**Extends Merger**\n\nMerge ini entries\n\n## Skip\n\n**Extends Merger**\n\nDoes not generate destination entry\n\n## Delete\n\n**Extends Merger**\n\nDelete entry.\n\n## EntryMerger\n\nType: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n### Properties\n\n*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n*   `factory` **Class**\u0026#x20;\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\u0026#x20;\n\n## Template\n\n**Extends LogLevelMixin(class {})**\n\n### Parameters\n\n*   `context` **Conext**\u0026#x20;\n*   `sources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**  (optional, default `{}`)\n\n### Properties\n\n*   `context` **Conext**\u0026#x20;\n*   `sources` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n*   `toBeRemovedSources` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n*   `mergers` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[Merger](#merger)\u003e**\u0026#x20;\n*   `branches` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\\\u003cBranch\u003e** all used branches direct and inherited\n*   `keyBranches` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\\\u003cBranch\u003e** branches used to define the template\n\n### shortKey\n\nUsed to identify generated branch.\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** short template key\n\n### entryMerger\n\nFind a suitable merger for each entry\n\n#### Parameters\n\n*   `entries` **Iterator\\\u003cContentEntry\u003e**\u0026#x20;\n\nReturns **Iterator\u003c\\[ContentEntry, [Merger](#merger)]\u003e**\u0026#x20;\n\n### mergerFor\n\nFind a suitable merger\n\n#### Parameters\n\n*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of the entry\n\nReturns **[Merger](#merger)**\u0026#x20;\n\n### \\_templateFrom\n\nLoad all templates and collects the entries.\n\n#### Parameters\n\n*   `sources` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** branch names\n*   `inheritencePath` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\\\u003cBranch\u003e** who was requesting us (optional, default `[]`)\n\nReturns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** package as merged from sources\n\n### updateUsedBy\n\nUpdates usedBy section of the template branch.\n\n#### Parameters\n\n*   `targetBranch` **Branch** template to be updated\n*   `templateSources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** original branch identifiers (even with deletion hints)\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as passed to commitIntoPullRequest\n\nReturns **AsyncIterator\\\u003cPullRequest\u003e**\u0026#x20;\n\n### templateFor\n\nLoad a template.\n\n#### Parameters\n\n*   `context` **[Context](#context)**\u0026#x20;\n*   `sources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\u0026#x20;\n\n## normalizeTemplateSources\n\nRemove duplicate sources.\nSources staring with '-' will be removed\n\n### Parameters\n\n*   `sources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\u0026#x20;\n*   `remove` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**  (optional, default `[]`)\n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u003c[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** normalized sources\n\n## jspath\n\n### Parameters\n\n*   `object` \u0026#x20;\n*   `path` \u0026#x20;\n*   `cb` \u0026#x20;\n\n## actions2message\n\n### Parameters\n\n*   `actions` \u0026#x20;\n*   `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n\nReturns **any** actions as one string lines ordered by scope\n\n## actions2messages\n\n### Parameters\n\n*   `actions` \u0026#x20;\n*   `prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\u0026#x20;\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```shell\nnpm install -g @template-tools/sync-cli\n```\n\n# license\n\nBSD-2-Clause\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemplate-tools%2Ftemplate-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemplate-tools%2Ftemplate-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemplate-tools%2Ftemplate-sync/lists"}