How to use the mrm-core.lines 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 / semantic-release / index.js View on Github external
}
	travisYml
		// Add global semantic-release runner to .travis.yml
		.merge({
			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);
github sapegin / mrm / src / tasks / gitignore / index.js View on Github external
module.exports = function() {
	// .gitignore
	lines('.gitignore').remove(badIgnores).add(ignores).save();
};
module.exports.description = 'Adds .gitignore';
github sapegin / mrm / src / tasks / jest / index.js View on Github external
},
		});
	}

	// Clean up old scripts
	pkg
		.removeScript(/^mocha|mocha:.*?|ava|ava:.*?|test:mocha|test:ava$/)
		.removeScript('test', /mocha|ava/);

	// package.json: test command
	pkg.appendScript('test', 'npm run test:jest');

	pkg.save();

	// .gitignore
	lines('.gitignore').add('coverage/').save();

	// .npmignore
	lines('.npmignore').add('__tests__/').save();

	// ESLint
	if (pkg.get(`devDependencies.eslint`)) {
		const eslintignore = lines('.eslintignore').add('coverage/*');
		if (hasBabel) {
			eslintignore.add('lib/*');
		}
		eslintignore.save();
	}

	// Test template for small projects
	if (fs.existsSync('index.js') && !fs.existsSync('test')) {
		copyFiles(__dirname, 'test.js');
github sapegin / mrm / src / tasks / jest / index.js View on Github external
.removeScript('test', /mocha|ava/);

	// package.json: test command
	pkg.appendScript('test', 'npm run test:jest');

	pkg.save();

	// .gitignore
	lines('.gitignore').add('coverage/').save();

	// .npmignore
	lines('.npmignore').add('__tests__/').save();

	// ESLint
	if (pkg.get(`devDependencies.eslint`)) {
		const eslintignore = lines('.eslintignore').add('coverage/*');
		if (hasBabel) {
			eslintignore.add('lib/*');
		}
		eslintignore.save();
	}

	// Test template for small projects
	if (fs.existsSync('index.js') && !fs.existsSync('test')) {
		copyFiles(__dirname, 'test.js');
	}

	// Dependencies
	uninstall(oldPackages);
	install(packages);

	// Suggest jest-codemods if projects used other test frameworks
github sapegin / mrm / src / tasks / jest / index.js View on Github external
// Clean up old scripts
	pkg
		.removeScript(/^mocha|mocha:.*?|ava|ava:.*?|test:mocha|test:ava$/)
		.removeScript('test', /mocha|ava/);

	// package.json: test command
	pkg.appendScript('test', 'npm run test:jest');

	pkg.save();

	// .gitignore
	lines('.gitignore').add('coverage/').save();

	// .npmignore
	lines('.npmignore').add('__tests__/').save();

	// ESLint
	if (pkg.get(`devDependencies.eslint`)) {
		const eslintignore = lines('.eslintignore').add('coverage/*');
		if (hasBabel) {
			eslintignore.add('lib/*');
		}
		eslintignore.save();
	}

	// Test template for small projects
	if (fs.existsSync('index.js') && !fs.existsSync('test')) {
		copyFiles(__dirname, 'test.js');
	}

	// Dependencies