How to use the mrm-core.markdown function in mrm-core

To help you get started, we’ve selected a few mrm-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sapegin / mrm / src / tasks / travis / index.js View on Github external
const requireNodeVersion = pkg.get('engines.node');
	const minNodeVersion = requireNodeVersion
		? semverUtils.parseRange(requireNodeVersion)[0].major
		: latestNodeVersion;

	// Only LTS or latest
	const nodeVersions = range(minNodeVersion, latestNodeVersion + 1).filter(
		ver => ver % 2 === 0 || ver === latestNodeVersion
	);
	travisYml.set('node_js', nodeVersions);

	travisYml.save();

	// Add Travis package badge to Readme
	const url = `https://travis-ci.org/${github}/${pkg.get('name')}`;
	markdown(readmeFile).addBadge(`${url}.svg`, url, 'Build Status').save();

	console.log(`
1. Activate your repository on Travis CI:
${url}

2. Commit and push your changes
`);
}
github sapegin / mrm / src / tasks / codecov / index.js View on Github external
);
	}

	// .travis.yml
	if (!travisYml.get('after_success', []).includes(uploadCommand)) {
		travisYml
			.merge({
				script: [`npm run ${coverageScript}`],
				after_success: [uploadCommand],
			})
			.save();
	}

	// Add Codecov badge to Readme
	const url = `https://codecov.io/gh/${github}/${pkg.get('name')}`;
	markdown(readme).addBadge(`${url}/branch/master/graph/badge.svg`, url, 'Codecov').save();
}
github sapegin / mrm / src / tasks / semantic-release / index.js View on Github external
after_success: [
				`npm install -g semantic-release`,
				'semantic-release pre && npm publish && semantic-release post',
			],
			branches: {
				except: ['/^v\\d+\\.\\d+\\.\\d+$/'],
			},
		})
		.save();

	// Add Changelog.md to .gitignore
	lines('.gitignore').add(config('changelog', 'Changelog.md')).save();

	// Add npm package version badge to Readme.md
	const name = pkg.get('name');
	const readme = markdown(config('readme', 'Readme.md'));
	if (readme.exists()) {
		readme
			.addBadge(
				`https://img.shields.io/npm/v/${name}.svg`,
				`https://www.npmjs.com/package/${name}`,
				'npm'
			)
			.save();
	}

	// Dependencies
	uninstall(PACKAGE_NAME);
};
module.exports.description = 'Adds semantic-release';