Skip to content

Commit

Permalink
Merge pull request #14 from jaebradley/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
jaebradley authored Apr 23, 2018
2 parents 46b7072 + 9302b9e commit 8d80f8d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
11 changes: 10 additions & 1 deletion src/executor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import untildify from 'untildify';
import fse from 'fs-extra';
import { spawn } from 'child_process';
import { spawn } from 'child-process-promise';
import normalizePackageData from 'normalize-package-data';
import sortPackageJSON from 'sort-package-json';
import isOnline from 'is-online';
Expand Down Expand Up @@ -92,8 +92,17 @@ const executor = async () => {
normalizePackageData(packageJSON);
fse.writeJsonSync(packageJSONLocation, sortPackageJSON(packageJSON), 'utf8');

console.log('⌛ 🤞 Installing packages');
await spawn('npm', ['install'], { cwd: destinationDirectory, stdio: 'inherit' });
await spawn('git', ['init'], { cwd: destinationDirectory, stdio: 'inherit' });

console.log('🥝 🍋 🍐 🍓 🍊 🍍 🍰 Installation complete! 🍒 🍈 🍇 🍉 🍏 🍎 🍌');
console.log('🔥 "npm run test" runs the jest tests');
console.log('🏗️ "npm run build" will build your modules');

if (isReact) {
console.log('📖 "npm run storybook" starts Storybook!');
}
};

export default executor;
14 changes: 7 additions & 7 deletions src/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const prompts = async () => (
inquirer.prompt([
{
name: 'packageType',
message: 'Package Type',
message: 'Select a package type',
type: 'list',
choices: [
PACKAGE_TYPES.NODE,
Expand All @@ -22,7 +22,7 @@ const prompts = async () => (
},
{
name: 'packageFeatures',
message: 'Package Features',
message: 'Select package Features',
type: 'checkbox',
choices: [
PACKAGE_FEATURES.COMMITLINT,
Expand All @@ -31,25 +31,25 @@ const prompts = async () => (
},
{
name: 'packageName',
message: 'Name of Package',
message: 'Input a package name',
type: 'input',
validate: packageName => validateNpmPackageName(packageName).validForNewPackages || `${packageName} is an invalid package name`,
},
{
name: 'packageDescription',
message: 'Package description',
message: 'Input a package description',
type: 'input',
validate: answer => answer && answer.length > 0,
},
{
name: 'packageVersion',
message: 'Package version',
message: 'Input an initial package version',
type: 'input',
validate: answer => isSemver(answer) || `${answer} is an invalid package version`,
},
{
name: 'targetDirectory',
message: 'Where to create the package',
message: 'Input the relative package location',
type: 'input',
validate: answer => answer && answer.length > 0,
},
Expand All @@ -61,7 +61,7 @@ const prompts = async () => (
},
{
name: 'gitHubUsername',
message: 'Input your GitHub Username',
message: 'Input your GitHub username',
type: 'input',
validate: async (username) => {
if (await isGitHubUsernameValid(username)) {
Expand Down
8 changes: 7 additions & 1 deletion src/templates/core/package.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@babel/core": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "22.4.3",
"codecov": "^3.0.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
Expand All @@ -40,12 +41,17 @@
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-import": "^2.9.0",
"jest": "^22.4.3",
"regenerator-runtime": "0.11.1",
"rollup": "^0.58.1",
"rollup-plugin-babel": "^4.0.0-beta.4",
"rollup-plugin-babel-minify": "^4.0.0",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-filesize": "^1.5.0",
"rollup-plugin-local-resolve": "^1.0.7",
"rollup-plugin-node-resolve": "^3.3.0"
}
},
"testPathIgnorePatterns": [
"<rootDir>/build/",
"<rootDir>/node_modules/"
]
}
3 changes: 3 additions & 0 deletions src/templates/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
],
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testPathIgnorePatterns": [
"*.stories.{js,jsx}"
]
}
}

0 comments on commit 8d80f8d

Please sign in to comment.