Back to home

netlify/

react

Version: 0.0.1

Last Updated: Unknown


Lift - Netlify

Node scaffold for Netlify. Adds netlify.toml file to your project.

It requires a siteId passed through.

Layout

# key name netlify: # building for node - react: siteId: saga-build.nodular.co

Module files

1#!/usr/bin/env node
2
3const dir = __dirname;
4const path = process.cwd();
5const appDir = path;
6
7/**
8 * Build out the Circle CI file
9 * using the circleci.ejs template
10 * file.
11 *
12 * @param {*} data
13 */
14const buildNetlify = ({ dependencies, data }) => {
15 dependencies.ejs.renderFile(`${dir}/netlify.ejs`, data, {}, function (
16 err,
17 str,
18 ) {
19 // str => Rendered HTML string
20 if (err) {
21 console.log(err);
22 throw err;
23 }
24
25 const outputFilePath = `${appDir}/netlify.toml`;
26 dependencies.fs.outputFileSync(outputFilePath, str);
27 console.log('\t- Netlify config file generated');
28 });
29};
30
31/**
32 * Bridge the Netlify file
33 *
34 * @example
35 * lift up up.yml
36 *
37 * @param {*} options
38 */
39module.exports = function (options) {
40 console.log('Bridging Netlify toml file');
41 try {
42 // map the correct types across
43 buildNetlify(options);
44 } catch (err) {
45 console.error(err);
46 }
47};

Install


Lift generate


Repository

https://github.com/okeeffed/pkg-lift-netlify

Sections