Keep repository in sync with its template.
Generates pull requests to bring a repository back in sync with its template.
So by making changes to the template and applying template-sync the target project will be updated accoring to the template.
Works with github and bitbucket.
This is the engine for cli operation please see template-tools/template-sync-cli
Merges contents from template branch into destination branch handling some special cases for:
- Licenses - rewriting license years
- line set files like .npmignore and .gitignore - by merging both sets together
- package.json - merge (.*)[Dd]ependencies, engines and scripts
- rollup.conf.*js - copy / rewrite + detect dev dependencies
- *.yaml - merge
- .travis.yml - merge with hints
- *.toml - merge
- *.ini - merge
- *.json - merge
- README.md - merge badges
- arlac77/template-cli-app rollup ava travis
- arlac77/template-esm-only ava travis
- arlac77/template-svelte-component svelte rollup testcafe travis
- arlac77/template-svelte-app svelte rollup pkgbuild travis
- arlac77/template-kronos-component template-esm-only with node 14
- arlac77/template-kronos-app node 14 + systemd
- Context
- pullRequestBranch
- sortedKeys
- exportsConditionOrder
- Package
- Merger
- Merger
- Readme
- MergeLineSet
- ReplaceIfEmpty
- Replace
- INI
- Skip
- Delete
- EntryMerger
- Template
- normalizeTemplateSources
- jspath
- actions2message
- actions2messages
Extends LogLevelMixin(class _Context {})
Context prepared to execute one branch.
Type: (Branch | String)
Returns Promise<(Context | undefined)>
Generate Pull Requests.
Returns AsyncIterable<PullRequest>
Generate all commits from the template entry merges.
Returns AsyncIterable<Commit>
Generate Pull Requests.
Returns AsyncIterable<PullRequest> the actual PRs
Type: String
order in which json keys are written
Order in which exports are searched
Extends Merger
Merger for package.json
Deliver some key properties.
- name
- version
- description
- main
entry
ContentEntry
Mergable content
Deliver some key properties.
entry
ContentEntry
Returns Promise<Object> extracted properties
Generate commits as result of merging two entries.
context
destinationEntry
sourceEntry
options
Returns AsyncIterable<Commit>
Type: Object
Deliver some key properties.
entry
ContentEntry
Returns Promise<Object> extracted properties
Generate commits as result of merging two entries.
context
destinationEntry
sourceEntry
options
Returns AsyncIterable<Commit>
Extends Merger
Injects badges into README.md.
Extends Merger
Extends Merger
Overwrites none existing entries from template.
Extends Merger
Always overwrite entry from template
Extends Merger
Merge ini entries
Extends Merger
Does not generate destination entry
Extends Merger
Delete entry.
Type: Object
Extends LogLevelMixin(class {})
context
Conextsources
Set<string>toBeRemovedSources
Set<string>mergers
Array<Merger>branches
Set<Branch> all used branches direct and inheritedkeyBranches
Set<Branch> branches used to define the template
Used to identify generated branch.
Returns string short template key
Find a suitable merger for each entry
entries
Iterator<ContentEntry>
Returns Iterator<[ContentEntry, Merger]>
Find a suitable merger
name
string of the entry
Returns Merger
Load all templates and collects the entries.
sources
string branch namesinheritencePath
Array<Branch> who was requesting us (optional, default[]
)
Returns Object package as merged from sources
Updates usedBy section of the template branch.
targetBranch
Branch template to be updatedtemplateSources
Array<string> original branch identifiers (even with deletion hints)options
Object as passed to commitIntoPullRequest
Returns AsyncIterator<PullRequest>
Load a template.
Remove duplicate sources. Sources staring with '-' will be removed
Returns Array<string> normalized sources
object
path
cb
Returns any actions as one string lines ordered by scope
With npm do:
npm install -g @template-tools/sync-cli
BSD-2-Clause