How to use the liferay-npm-build-tools-common/lib/project.misc function in liferay-npm-build-tools-common

To help you get started, we’ve selected a few liferay-npm-build-tools-common 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 liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / index.ts View on Github external
.then(() => {
				// Report and show execution time
				const hrtime = process.hrtime(start);
				report.executionTime(hrtime);
				log.info(`Bundling took ${pretty(hrtime)}`);

				// Send report analytics data
				report.sendAnalytics();

				// Write report if requested
				if (project.misc.reportFile) {
					fs.writeFileSync(
						project.misc.reportFile.asNative,
						report.toHtml()
					);

					log.info(
						`Report written to ${project.misc.reportFile.asNative}`
					);
				} else if (report.warningsPresent) {
					log.debug('The build has emitted some warning messages.');
				}
			})
			.catch(abort);
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / steps / transform.js View on Github external
globs.push(...gl.negate(project.transform.babelIgnores));
	}

	// Run babel through files
	const prjRelPaths = findFiles(
		project.dir.asNative,
		gl.prefix(`${project.dir.asPosix}/${destPkg.dir.asPosix}/`, globs)
	);

	log.debug(
		`Babelifying ${prjRelPaths.length} files in package '${destPkg.id}'...`
	);

	return runInChunks(
		prjRelPaths,
		project.misc.maxParallelFiles,
		0,
		prjRelPath => babelifyFile(destPkg, prjRelPath, babelConfig)
	);
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / index.ts View on Github external
.then(() => {
				// Report and show execution time
				const hrtime = process.hrtime(start);
				report.executionTime(hrtime);
				log.info(`Bundling took ${pretty(hrtime)}`);

				// Send report analytics data
				report.sendAnalytics();

				// Write report if requested
				if (project.misc.reportFile) {
					fs.writeFileSync(
						project.misc.reportFile.asNative,
						report.toHtml()
					);

					log.info(
						`Report written to ${project.misc.reportFile.asNative}`
					);
				} else if (report.warningsPresent) {
					log.debug('The build has emitted some warning messages.');
				}
			})
			.catch(abort);
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / index.ts View on Github external
export default function(argv: {version: boolean}): void {
	const versionsInfo = project.versionsInfo;

	if (argv.version) {
		versionsInfo.forEach((value, key) => {
			console.log(`"${key}":`, JSON.stringify(value, null, 2));
		});
		return;
	}

	report.versionsInfo(versionsInfo);

	if (project.misc.noTracking) {
		run();
	} else {
		log.debug(
			'The tool is sending usage statistics to our remote servers.'
		);
		insight.init().then(run);
	}
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / log.js View on Github external
export function debug(...args) {
	if (project.misc.verbose) {
		console.log(...args);
	}
}
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / steps / rules.js View on Github external
: ['**/*'];

	const globs = [...sourceGlobs, '!node_modules/**/*'];

	const sourcePrjRelPaths = findFiles(
		project.dir.asNative,
		gl.prefix(`${project.dir.asPosix}/${srcPkg.dir.asPosix}/`, globs)
	);

	const destPkg = srcPkg.clone({
		dir: getDestDir(srcPkg),
	});

	return runInChunks(
		sourcePrjRelPaths,
		project.misc.maxParallelFiles,
		0,
		prjRelPath => processFile(srcPkg, destPkg, prjRelPath)
	);
}