Skip to content

Commit f7b94a5

Browse files
committed
Compile (ECMAScript 2015+)
1 parent 6990d26 commit f7b94a5

40 files changed

+2034
-2943
lines changed

lib/cli.js

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
#!/usr/bin/env node
2-
'use strict'
2+
"use strict";
33

4-
var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault')
4+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
55

6-
var _toArray2 = _interopRequireDefault(
7-
require('@babel/runtime/helpers/toArray')
8-
)
6+
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
97

10-
var _process$argv = (0, _toArray2['default'])(process.argv),
11-
args = _process$argv.slice(0) // console.log(`folder name ${args[2]}`);
8+
var _process$argv = (0, _toArray2["default"])(process.argv),
9+
args = _process$argv.slice(0); // console.log(`folder name ${args[2]}`);
1210
// console.log(`folder location ${args[3]}`);
1311
// Current working directory
1412

15-
var cwd = process.cwd()
16-
console.log(cwd)
1713

18-
var inquirer = require('inquirer')
14+
var cwd = process.cwd();
15+
console.log(cwd);
1916

20-
var chalk = require('chalk')
17+
var inquirer = require('inquirer');
2118

22-
var clear = require('clear')
19+
var chalk = require('chalk');
2320

24-
var figlet = require('figlet') // Cli Model
21+
var clear = require('clear');
2522

26-
var cliModel = require('./cliModel')
23+
var figlet = require('figlet'); // Cli Model
2724

28-
var cliCommand = cliModel.cliCommand // CLI Main Options
2925

30-
var options = require('./options')
26+
var cliModel = require('./cliModel');
3127

32-
var prompt = inquirer.createPromptModule()
33-
clear()
34-
console.log(
35-
chalk.green(
36-
figlet.textSync('Adv. React CLI', {
37-
horizontalLayout: 'fitted',
38-
font: 'Small',
39-
verticalLayout: 'full'
40-
})
41-
)
42-
)
28+
var cliCommand = cliModel.cliCommand; // CLI Main Options
29+
30+
var options = require('./options');
31+
32+
var prompt = inquirer.createPromptModule();
33+
clear();
34+
console.log(chalk.green(figlet.textSync('Adv. React CLI', {
35+
horizontalLayout: 'fitted',
36+
font: 'Small',
37+
verticalLayout: 'full'
38+
})));
4339
prompt(cliCommand).then(function (answers) {
44-
options(answers)
45-
})
40+
options(answers);
41+
});

lib/cliModel/index.js

Lines changed: 79 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,89 @@
1-
'use strict'
1+
"use strict";
22

3-
module.exports.cliCommand = [
4-
{
5-
type: 'list',
6-
name: 'installation',
7-
message: 'What would you like to install?',
8-
choices: [
9-
'CustomPackageInstall',
10-
'CreateReactApp',
11-
'ReactComponent',
12-
'ReactRouter',
13-
'StylingPackages',
14-
'PropTypes',
15-
'StateManagement',
16-
'TypeScript'
17-
]
18-
}
19-
]
20-
module.exports.multiplePackageInstall = [
21-
{
22-
type: 'checkbox',
23-
name: 'packages',
24-
message: 'Select packages for your new React Project: ',
25-
default: ['create-react-app'],
26-
pageSize: 9,
27-
choices: [
28-
'create-react-app',
29-
'react-router react-router-dom',
30-
'redux react-redux',
31-
'redux-thunk',
32-
'prop-types',
33-
'node-sass',
34-
'styled-components',
35-
'unstated',
36-
'unstated-next',
37-
'typescript',
38-
'@types/node',
39-
'@types/react-redux',
40-
'@types/react @types/react-dom',
41-
'@types/react-router @types/react-router-dom',
42-
'@types/jest'
43-
]
44-
}
45-
]
46-
module.exports.installOption = [
47-
{
48-
type: 'list',
49-
name: 'decision',
50-
message: 'Would you like to Install or Uninstall?',
51-
choices: ['Install', 'Uninstall']
52-
}
53-
] // Add new package Yes/No
3+
module.exports.cliCommand = [{
4+
type: 'list',
5+
name: 'installation',
6+
message: 'What would you like to install?',
7+
choices: ['CustomPackageInstall', 'CreateReactApp', 'ReactComponent', 'ReactRouter', 'StylingPackages', 'PropTypes', 'StateManagement', 'TypeScript', 'AccesibilityPackages']
8+
}];
9+
module.exports.multiplePackageInstall = [{
10+
type: 'checkbox',
11+
name: 'packages',
12+
message: 'Select packages for your new React Project: ',
13+
"default": ['create-react-app'],
14+
pageSize: 9,
15+
choices: ['create-react-app', 'react-router react-router-dom', 'redux react-redux', 'redux-thunk', 'prop-types', 'node-sass', 'styled-components', 'unstated', 'unstated-next', 'typescript', 'react-a11y', 'react-axe', '@types/node', '@types/react-redux', '@types/react @types/react-dom', '@types/react-router @types/react-router-dom', '@types/jest']
16+
}];
17+
module.exports.installOption = [{
18+
type: 'list',
19+
name: 'decision',
20+
message: 'Would you like to Install or Uninstall?',
21+
choices: ['Install', 'Uninstall']
22+
}]; // Add new package Yes/No
5423

55-
module.exports.addPackage = [
56-
{
57-
type: 'input',
58-
name: 'packageAdd',
59-
message: 'Would you like to add a package? (Y/N)'
60-
}
61-
] // Input name for Install Folder
24+
module.exports.addPackage = [{
25+
type: 'input',
26+
name: 'packageAdd',
27+
message: "Would you like to add a package? (Y/N)"
28+
}]; // Input name for Install Folder
6229

63-
module.exports.installFolder = [
64-
{
65-
type: 'input',
66-
name: 'folderName',
67-
message: 'Please name your project folder '
68-
} // Concise option menu
69-
] // Input name when creating new components for React project
30+
module.exports.installFolder = [{
31+
type: 'input',
32+
name: 'folderName',
33+
message: 'Please name your project folder '
34+
} // Concise option menu
35+
]; // Input name when creating new components for React project
7036

71-
module.exports.componentName = [
72-
{
73-
type: 'input',
74-
name: 'componentName',
75-
message:
76-
'Please enter the file name of the component you would like to create: '
77-
}
78-
] // React Components selection: Functional/Class
37+
module.exports.componentName = [{
38+
type: 'input',
39+
name: 'componentName',
40+
message: 'Please enter the file name of the component you would like to create: '
41+
}]; // React Components selection: Functional/Class
7942

80-
module.exports.reactComponents = [
81-
{
82-
type: 'list',
83-
name: 'component',
84-
message: 'Function or Class Component?',
85-
choices: ['function', 'class']
86-
}
87-
] // Styling Packages
43+
module.exports.reactComponents = [{
44+
type: 'list',
45+
name: 'component',
46+
message: 'Function or Class Component?',
47+
choices: ['function', 'class']
48+
}]; // Styling Packages
8849

89-
module.exports.stylingPackages = [
90-
{
91-
type: 'list',
92-
name: 'stylingTool',
93-
message: 'Please select the Styling Package to add to your project: ',
94-
choices: ['StyledComponents', 'NodeSass']
95-
}
96-
] // React State Management tools: More options soon! ('Unstated', Easy-Peasy')
50+
module.exports.stylingPackages = [{
51+
type: 'list',
52+
name: 'stylingTool',
53+
message: 'Please select the Styling Package to add to your project: ',
54+
choices: ['StyledComponents', 'NodeSass']
55+
}]; // React State Management tools: More options soon! ('Unstated', Easy-Peasy')
9756

98-
module.exports.stateManagement = [
99-
{
100-
type: 'list',
101-
name: 'state',
102-
message:
103-
'Please select the tool to add to your project for state management: ',
104-
choices: ['Redux', 'Unstated', 'Redux-Thunk']
105-
}
106-
] // Unstated options
57+
module.exports.stateManagement = [{
58+
type: 'list',
59+
name: 'state',
60+
message: 'Please select the tool to add to your project for state management: ',
61+
choices: ['Redux', 'Unstated', 'Redux-Thunk']
62+
}]; // Unstated options
10763

108-
module.exports.unstatedOptions = [
109-
{
110-
type: 'list',
111-
name: 'state',
112-
message:
113-
'Please select the which version of Unstated you would like to add to your project: ',
114-
choices: ['Unstated', 'Unstated-next']
115-
}
116-
] // TypeScript and Packages
64+
module.exports.unstatedOptions = [{
65+
type: 'list',
66+
name: 'state',
67+
message: 'Please select the which version of Unstated you would like to add to your project: ',
68+
choices: ['Unstated', 'Unstated-next']
69+
}]; // TypeScript and Packages
11770

118-
module.exports.typescriptPackages = [
119-
{
120-
type: 'list',
121-
name: 'typescriptPackage',
122-
message: 'Please select the TypeScript module to add to your project: ',
123-
choices: [
124-
'CustomInstall',
125-
'TypeScript',
126-
'@types/node',
127-
'@types/react @types/react-dom',
128-
'@types/react-router @types/react-router-dom',
129-
'@types/react-redux',
130-
'@types/jest'
131-
]
132-
}
133-
] // Package Manager Options
71+
module.exports.typescriptPackages = [{
72+
type: 'list',
73+
name: 'typescriptPackage',
74+
message: 'Please select the TypeScript module to add to your project: ',
75+
choices: ['CustomInstall', 'TypeScript', '@types/node', '@types/react @types/react-dom', '@types/react-router @types/react-router-dom', '@types/react-redux', '@types/jest']
76+
}];
77+
module.exports.accesibilityPackages = [{
78+
type: 'list',
79+
name: 'access',
80+
message: 'Please select the accesibility package to add to your project: ',
81+
choices: ['Reacta11y', 'Reactaxe']
82+
}]; // Package Manager Options
13483

135-
module.exports.YarnOrNpm = [
136-
{
137-
type: 'list',
138-
name: 'packageManager',
139-
message: 'Would you like to install using Yarn or NPM?',
140-
choices: ['Yarn', 'NPM']
141-
}
142-
]
84+
module.exports.YarnOrNpm = [{
85+
type: 'list',
86+
name: 'packageManager',
87+
message: 'Would you like to install using Yarn or NPM?',
88+
choices: ['Yarn', 'NPM']
89+
}];

lib/cliModel/install-commands-yarn.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict'
1+
"use strict";
22

33
/*
44
Yarn Install commands
@@ -55,6 +55,14 @@ module.exports = {
5555
install: 'yarn add redux-thunk',
5656
uninstall: 'yarn remove redux-thunk'
5757
},
58+
reacta11yObjYarn: {
59+
install: 'yarn add react-a11y',
60+
uninstall: 'yarn remove react-a11y'
61+
},
62+
reactaxeObjYarn: {
63+
install: 'yarn add react-axe --dev',
64+
uninstall: 'yarn remove react-axe'
65+
},
5866
unstatedObjYarn: {
5967
unstatedYarn: {
6068
install: 'yarn add unstated',
@@ -65,4 +73,4 @@ module.exports = {
6573
uninstall: 'yarn remove unstated-next'
6674
}
6775
}
68-
}
76+
};

lib/cliModel/install-commands.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict'
1+
"use strict";
22

33
module.exports = {
44
createReactApp: 'npx create-react-app',
@@ -52,6 +52,14 @@ module.exports = {
5252
install: 'npm i redux-thunk --save',
5353
uninstall: 'npm uninstall redux-thunk'
5454
},
55+
reacta11yObj: {
56+
install: 'npm i react-a11y --save',
57+
uninstall: 'npm uninstall react-a11y'
58+
},
59+
reactaxeObj: {
60+
install: 'npm i react-axe --save-dev',
61+
uninstall: 'npm uninstall react-axe'
62+
},
5563
unstatedObj: {
5664
unstated: {
5765
install: 'npm install unstated --save',
@@ -62,4 +70,5 @@ module.exports = {
6270
uninstall: 'npm uninstall unstated-next'
6371
}
6472
} // easyPeasy: "npm install easy-peasy"
65-
}
73+
74+
};

lib/cliModel/starter-code/propTypes.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)