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 npm-template-sync the target project will be updated accoring to the template.
Works with github and bitbucket.
export AGGREGATION_FACTORY="github-repository-provider" # for github repos
export GITHUB_TOKEN='token providing repositroy write access' # for github repos
template-sync --template aTemplateGithubUser/aRepo myGithubUser/myRepoDefine (initial) properties to be used in the template
export AGGREGATION_FACTORY="github-repository-provider" # for github repos
export GITHUB_TOKEN='token providing repositroy write access' # for github repos
template-sync --define "description=a very new fantastic module" -t myUser/myTemplate myUser/newModule#aBranchCreate new repository and bind it to aTemplateGithubUser/aRepo
export GITHUB_TOKEN='token providing repositroy write access' # for github repos
template-sync --track --create --template aTemplateGithubUser/aRepo myGithubUser/myRepoSwitch from arlac77/template-github to arlac77/template-arlac77-github template for arlac77/url-cmd, arlac77/uti, arlac77/content-entry and arlac77/repository-provider
export GITHUB_TOKEN='token providing repositroy write access' # for github repos
template-sync --track --template arlac77/template-arlac77-github --template -arlac77/template-github arlac77/url-cmd arlac77/uti arlac77/content-entry arlac77/repository-providerMerges 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
- sortedKeys
- Package
- Merger
- Merger
- EntryMerger
- Template
- ReplaceIfEmpty
- Readme
- MergeLineSet
- Replace
- Skip
- Delete
- normalizeTemplateSources
- jspath
Extends LogLevelMixin(class _Context {})
Context prepared to execute one branch.
providertargetBranchNamestringoptions(optional, default{})
Generate Pull Requests.
Returns AsyncIterator<PullRequest>
Generate all commits from the template entry merges.
Returns Commit<AsyncIterator>
Generate Pull Requests.
Returns AsyncIterator<PullRequest> the actual PRs
order in which json keys are written
Extends Merger
Merger for package.json
Deliver some key properties.
- name
- version
- description
- main
entryContentEntry
Returns Object
Mergable content
Deliver some key properties.
entryContentEntry
Returns Object extracted properties
Generate commits as result of merging two entries.
contextdestinationEntrysourceEntryoptions
Type: Object
Deliver some key properties.
entryContentEntry
Returns Object extracted properties
Generate commits as result of merging two entries.
contextdestinationEntrysourceEntryoptions
Type: Object
Extends LogLevelMixin(class {})
contextConextsourcesSet<string>toBeRemovedSourcesSet<string>mergersArray<Merger>branchesSet<Branch> all used branches direct and inheritedkeyBranchesSet<Branch> branches used to define the template
Find a suitable merger for each entry
entriesIterator<ContentEntry>
Returns Iterator<[ContentEntry, Merger]>
Find a suitable merger
namestring of the entry
Returns Merger
Load all templates and collects the entries.
sourcesstring branch namesinheritencePathArray<Branch> who was requesting us (optional, default[])
Returns Object package as merged from sources
Updates usedBy section of the template branch.
targetBranchBranch template to be updatedtemplateSourcesArray<string> original branch identifiers (even with deletion hints)optionsObject as passed to commitIntoPullRequest
Returns AsyncIterator<PullRequest>
Load a template
Extends Merger
Overwrites none existing entries from template
Extends Merger
injects badges into README.md
Extends Merger
Extends Merger
Replace file from template (always)
Extends Merger
Does not generate destination entry
Extends Merger
Delete entry.
Remove duplicate sources. Sources staring with '-' will be removed
Returns Array<string> normalized sources
objectpathcb
With npm do:
npm install -g @template-tools/sync-cli
# template-sync --helpBSD-2-Clause
