Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

npm-template-sync

9.16.13 • Public • Published

npm License minified size downloads GitHub Issues Build Status semantic-release Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

npm-template-sync

Keep repository in sync with its template.

Generates pull requests to bring a repository back in sync with the template.

So by making changes to the template and applying npm-template-sync the target project will be updated accoring to the template.

export GH_TOKEN='token providing repositroy write access' # for github repos 
 
npm-template-sync --template aTemplateGithubUser/aRepo myGithubUser/myRepo

define (initial) properties to be used in the template

export GH_TOKEN='token providing repositroy write access' # for github repos 
 
npm-template-sync --define "description=a very new fantastic module" -t myUser/myTemplate myUser/newModule#aBranch

switch from arlac77/template-github to arlac77/template-arlac77-github template for arlac77/url-cmd, arlac77/uti, arlac77/content-entry and arlac77/repository-provider

export GH_TOKEN='token providing repositroy write access' # for github repos 
 
npm-template-sync --track --template arlac77/template-arlac77-github --template -arlac77/template-github arlac77/url-cmd arlac77/uti arlac77/content-entry arlac77/repository-provider

Merges contents from template branch into destination branch handling some special cases for:

generated pull request

Some templates

API

Table of Contents

Context

Extends LogLevelMixin(class _Context {})

Context prepared to execute one branch

Parameters

  • provider
  • targetBranchName string
  • options (optional, default {})

Properties

executeBranch

Returns [Promise<PullRequest>]

sortedKeys

order in which json keys are written

Package

Extends Merger

Merger for package.json

properties

Deliver some key properties

Parameters

  • entry ContentEntry

Returns Object

Merger

Mergable content

properties

Deliver some key properties

Parameters

  • entry ContentEntry

Returns Object

Merger

Type: Object

Properties

properties

Deliver some key properties

Parameters

  • entry ContentEntry

Returns Object

EntryMerger

Type: Object

Properties

Template

Extends LogLevelMixin(class {})

Parameters

Properties

  • context Conext
  • sources Array<string>
  • mergers Array<Merger>
  • branches Set<Branch> all used branches direct and inherited
  • keyBranches Set<Branch> branches used to define the template

entryMerger

Find a suitable merger for each entry

Parameters

  • entries Iterator<ContentEntry>

Returns Iterator<[ContentEntry, Merger]>

mergerFor

Find a suitable merger

Parameters

Returns Merger

_templateFrom

Load all templates and collects the entries

Parameters

  • sources string branch names
  • inheritencePath Array<string> who was requesting us (optional, default [])

Returns Object package as merged from sources

updateUsedBy

Updates usedBy section of the template branch

Parameters

  • targetBranch Branch template to be updated
  • templateSources Array<string> original branch identifiers (even with deleteion hints)

templateFor

load a template

Parameters

ReplaceIfEmpty

Extends Merger

Overwrites none existing entries from template

Readme

Extends Merger

injects badges into README.md

MergeLineSet

Extends Merger

Replace

Extends Merger

Replace file from template (always)

Skip

Extends Merger

Does not generate destination entry

normalizeTemplateSources

Remove duplicate sources. Sources staring with '-' will be removed

Parameters

Returns Array<string> normalized sources

jspath

Parameters

  • object
  • path
  • cb

install

With npm do:

npm install -g npm-template-sync
 
# npm-template-sync --help 

license

BSD-2-Clause

Install

npm i npm-template-sync

DownloadsWeekly Downloads

3,814

Version

9.16.13

License

BSD-2-Clause

Unpacked Size

88.2 kB

Total Files

26

Last publish

Collaborators

  • avatar