How to use the liferay-npm-build-tools-common/lib/plugin-logger 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 / steps / rules.js View on Github external
function processFile(srcPkg, destPkg, prjRelPath) {
	const loaders = project.rules.loadersForFile(prjRelPath);

	if (loaders.length == 0) {
		return Promise.resolve();
	}

	const fileAbsPath = project.dir.join(prjRelPath).asNative;

	const context = {
		content: fs.readFileSync(fileAbsPath),
		filePath: prjRelPath,
		extraArtifacts: {},
		log: new PluginLogger(),
	};

	return runLoaders(loaders, 0, context)
		.then(() => writeLoadersResult(srcPkg, destPkg, context))
		.then(() => report.rulesRun(prjRelPath, context.log));
}
github liferay / liferay-js-toolkit / packages / babel-plugin-add-module-metadata / src / index.js View on Github external
const {log} = babelIpc.get(state, () => ({
		log: new PluginLogger(),
	}));
github liferay / liferay-js-toolkit / packages / babel-plugin-namespace-modules / src / index.js View on Github external
const {log} = babelIpc.get(state, () => ({
							log: new PluginLogger(),
						}));
github liferay / liferay-js-toolkit / packages / babel-plugin-normalize-requires / src / index.js View on Github external
const {log} = babelIpc.get(state, () => ({
							log: new PluginLogger(),
						}));
github liferay / liferay-js-toolkit / packages / babel-plugin-wrap-modules-amd / src / index.js View on Github external
const {log} = babelIpc.get(state, () => ({
						log: new PluginLogger(),
					}));
github liferay / liferay-js-toolkit / packages / babel-plugin-name-amd-modules / src / index.js View on Github external
const {log} = babelIpc.get(state, () => ({
						log: new PluginLogger(),
					}));
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / runners.js View on Github external
.map(filePath => {
				filePath = path.resolve(filePath);

				const context = {
					content: fs.readFileSync(filePath, 'utf-8').toString(),
					filePath,
					extraArtifacts: {},
					log: new PluginLogger(),
				};

				const loaders = project.rules.loadersForFile(filePath);

				if (loaders.length == 0) {
					return Promise.resolve();
				}

				return runLoaders(loaders, 0, context).then(() => {
					fs.writeFileSync(filePath, context.content);

					Object.entries(context.extraArtifacts).forEach(
						([filePath, content]) =>
							fs.writeFileSync(filePath, content)
					);
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / steps / transform.js View on Github external
return new Promise(resolve => {
		const logger = new PluginLogger();

		babelIpc.set(project.dir.join(prjRelPath).asNative, {
			log: logger,
			manifest,
			rootPkgJson: clone(project.pkgJson),
			globalConfig: clone(project.globalConfig),
		});

		const fileAbsPath = project.dir.join(prjRelPath).asNative;
		const filePkgRelPath = project.dir
			.join(destPkg.dir)
			.relative(fileAbsPath).asNative;

		babel.transformFile(
			fileAbsPath,
			{
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / runners.js View on Github external
plugins.forEach(plugin => {
		const params = {
			config: plugin.config,
			log: new PluginLogger(),
			rootPkgJson: readJsonSync('package.json'),
			globalConfig: config.getGlobalConfig(),

			pkg: pkg.clone(),

			source: {
				pkg: srcPkg.clone(),
			},
		};

		plugin.run(params, state);

		if (callback) {
			callback(plugin, params.log);
		}
	});