diff --git a/commands/map-callout.js b/commands/map-callout.js index 4fb1c3e..c72f851 100644 --- a/commands/map-callout.js +++ b/commands/map-callout.js @@ -1,30 +1,29 @@ -// @cliDescription Generates a map callout component. -// @cliExample ignite generate map-callout StoreCallout -// Generates a map callout component that can be inserted into any map. -// ---------------------------------------------------------------------------- -module.exports = async function (context) { - const { parameters, strings, print, ignite } = context - const { pascalCase, isBlank } = strings +module.exports = { + description: 'Generates a map callout component.', + run: async function (context) { + const { parameters, strings, print, ignite } = context + const { pascalCase, isBlank } = strings - // validation - if (isBlank(parameters.first)) { - print.info(`ignite generate map-callout \n`) - print.info('A name is required.') - return - } + // validation + if (isBlank(parameters.first)) { + print.info(`ignite generate map-callout \n`) + print.info('A name is required.') + return + } - const name = pascalCase(parameters.first) + const name = pascalCase(parameters.first) - // Copies the callout template - // into App/Components/${name}.js. - const copyJobs = [{ - template: 'map-callout-component.js.ejs', - target: `App/Components/${name}.js` - }, { - template: 'map-callout-styles.js.ejs', - target: `App/Components/Styles/${name}Styles.js` - }] + // Copies the callout template + // into App/Components/${name}.js. + const copyJobs = [{ + template: 'map-callout-component.js.ejs', + target: `App/Components/${name}.js` + }, { + template: 'map-callout-styles.js.ejs', + target: `App/Components/Styles/${name}Styles.js` + }] - // make the templates and pass in props with the third argument here - await ignite.copyBatch(context, copyJobs, { calloutName: name }) -} + // make the templates and pass in props with the third argument here + await ignite.copyBatch(context, copyJobs, { calloutName: name }) + } +} \ No newline at end of file diff --git a/commands/map-utilities.js b/commands/map-utilities.js index a4ee4fd..32690c2 100644 --- a/commands/map-utilities.js +++ b/commands/map-utilities.js @@ -1,20 +1,19 @@ -// @cliDescription Generates map utility functions. -// @cliExample ignite generate map-utilities -// Generates a map utilities file in App/Lib -// ---------------------------------------------------------------------------- -module.exports = async function (context) { - const { ignite } = context +module.exports = { + description: 'Generates map utility functions.', + run: async function (context) { + const { ignite } = context - // TODO: Detect if Ramda is not installed and error - // or install for them? + // TODO: Detect if Ramda is not installed and error + // or install for them? - // Copies the `MapHelpers.js.ejs` in the templates folder - // into App/Lib/MapHelpers.js. - const copyJobs = [{ - template: 'MapHelpers.js.ejs', - target: `App/Lib/MapHelpers.js` - }] + // Copies the `MapHelpers.js.ejs` in the templates folder + // into App/Lib/MapHelpers.js. + const copyJobs = [{ + template: 'MapHelpers.js.ejs', + target: `App/Lib/MapHelpers.js` + }] - // make the templates and pass in props with the third argument here - await ignite.copyBatch(context, copyJobs, {}) -} + // make the templates and pass in props with the third argument here + await ignite.copyBatch(context, copyJobs, {}) + } +} \ No newline at end of file diff --git a/commands/map.js b/commands/map.js index 9edb83c..d38537c 100644 --- a/commands/map.js +++ b/commands/map.js @@ -1,37 +1,36 @@ -// @cliDescription Generates a map component. -// @cliExample ignite generate map StoreLocator -// Generates a map component that can be inserted into any screen. -// ---------------------------------------------------------------------------- -module.exports = async function (context) { - const { parameters, strings, print, ignite } = context - const { pascalCase, isBlank } = strings +module.exports = { + description: 'Generates a map component.', + run: async function (context) { + const { parameters, strings, print, ignite } = context + const { pascalCase, isBlank } = strings - // validation - if (isBlank(parameters.first)) { - print.info(`ignite generate map \n`) - print.info('A name is required.') - return - } + // validation + if (isBlank(parameters.first)) { + print.info(`ignite generate map \n`) + print.info('A name is required.') + return + } - const name = pascalCase(parameters.first) - const calloutName = `${name}Callout` + const name = pascalCase(parameters.first) + const calloutName = `${name}Callout` - // Copies the `map.js.ejs` in the templates folder - // into App/Components/${name}.js. - const copyJobs = [{ - template: 'map-component.js.ejs', - target: `App/Components/${name}.js` - }, { - template: 'map-styles.js.ejs', - target: `App/Components/Styles/${name}Styles.js` - }, { - template: 'map-callout-component.js.ejs', - target: `App/Components/${calloutName}.js` - }, { - template: 'map-callout-styles.js.ejs', - target: `App/Components/Styles/${calloutName}Styles.js` - }] + // Copies the `map.js.ejs` in the templates folder + // into App/Components/${name}.js. + const copyJobs = [{ + template: 'map-component.js.ejs', + target: `App/Components/${name}.js` + }, { + template: 'map-styles.js.ejs', + target: `App/Components/Styles/${name}Styles.js` + }, { + template: 'map-callout-component.js.ejs', + target: `App/Components/${calloutName}.js` + }, { + template: 'map-callout-styles.js.ejs', + target: `App/Components/Styles/${calloutName}Styles.js` + }] - // make the templates and pass in props with the third argument here - await ignite.copyBatch(context, copyJobs, { name: name, calloutName: calloutName }) -} + // make the templates and pass in props with the third argument here + await ignite.copyBatch(context, copyJobs, { name: name, calloutName: calloutName }) + } +} \ No newline at end of file