UNPKG

@template-tools/template-sync

Version:
54 lines (45 loc) 1.06 kB
import { Commit } from "repository-provider"; /** * Mergable content */ export class Merger { static get pattern() { return "**/*"; } static get priority() { return 1.0; } static get options() { return { messagePrefix: "", expand: true, mergeHints: {} }; } /** * Deliver some key properties. * @param {ContentEntry} entry * @return {Promise<Object>} extracted properties */ static async properties(entry) { return {}; } static optionalDevDependencies(into, dependencies, options = this.options) { if (options.optionalDevDependencies) { Array.from(dependencies).forEach(dep => { for (const r of options.optionalDevDependencies) { if (dep.match(r)) into.add(dep); } }); } return into; } static usedDevDependencies(into, entry) { return into; } /** * Generate commits as result of merging two entries. * @return {AsyncIterable<Commit>} */ static async *commits(context, destinationEntry, sourceEntry, options) {} }