How to use the origami-build-tools.demo function in origami-build-tools

To help you get started, we’ve selected a few origami-build-tools 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 Financial-Times / origami-build-service / lib / democompiler.js View on Github external
return new Promise((resolve, reject) => {
			const log = this.log;
			const demoConfig = {
				dist: true,
				demoFilter: options.demoName,
				cwd: installation.getComponentDir(options.moduleName),
				brand: options.brand
			};

			log.trace(demoConfig, 'Starting OBT Demo build');
			const demoStream = obt.demo(gulp, demoConfig);

			const filesGenerated = [];

			demoStream.on('data', function(file) {
				log.trace('OBT demo compiling');
				filesGenerated.push(file);
			});

			demoStream.on('end', () => {
				if (filesGenerated.length > 0) {
					log.trace(demoConfig, 'OBT Demo build complete');
					const html = filesGenerated[0].contents.toString('utf8');
					const versionLockedContent = this.fileProxy.versionLockBuildserviceUrls(html, options.moduleName, options.moduleVersion, 'https://' + hostnames.preferred + options.reqUrl);
					resolve(new Buffer(versionLockedContent));
				} else {
					reject(new CompileError('No file were generated running obt.demo'));

origami-build-tools

Origami component development tools.

MIT
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages