forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 1
added eslint-config-frontier:recommended to the templates, as well as… #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5a60c85
added eslint-config-frontier:recommended to the templates, as well as…
joeycozza cb6931c
fixing pre-commit stuff to work with our prettier rules
joeycozza 1b2c107
trying to fix the prettier changes to a template file
joeycozza 91a29e7
trying to fix the prettier changes to a template file
joeycozza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,9 +45,6 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) { | |
| if (additionalFeatures.includes('polymer')) { | ||
| configurePolymer(appPath, useYarn); | ||
| } | ||
| if (additionalFeatures.includes('redux')) { | ||
| configureRedux(appPath, useYarn, ownPath); | ||
| } | ||
| if (additionalFeatures.includes('electric-flow')) { | ||
| configureEF(appPath, useYarn, ownPath); | ||
| } | ||
|
|
@@ -60,59 +57,59 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) { | |
| ]; | ||
|
|
||
| const defaultDevModules = [ | ||
| 'eslint@5.6.0', | ||
| 'fs-webdev/eslint-config-frontier#settingUpRecommendedReactConfig', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. start putting eslint-config-frontier into artifactory, and then update that usage here |
||
| 'react-styleguidist@9.0.0-beta4', | ||
| 'webpack@4.19.1', | ||
| ]; | ||
|
|
||
| installModulesSync(defaultModules, useYarn); | ||
| installModulesSync(defaultDevModules, useYarn, true); | ||
| addStyleguidistScriptsToPackageJson(appPath); | ||
| } | ||
|
|
||
| function addStyleguidistScriptsToPackageJson(appPath) { | ||
| //we read the package.json using fs instead of require() because require() uses the | ||
| //cached result from earlier, even though the package.json has been updated previously. | ||
| const appPackage = JSON.parse( | ||
| alterPackageJsonFile(appPath, appPackage => { | ||
| const packageJson = { ...appPackage }; | ||
| const additionalScripts = { | ||
| styleguide: 'styleguidist server --open', | ||
| 'styleguide:build': 'styleguidist build', | ||
| lint: 'eslint src/', | ||
| 'lint:fix': 'eslint src/ --fix', | ||
| }; | ||
| packageJson.scripts = { ...packageJson.scripts, ...additionalScripts }; | ||
| packageJson.eslintConfig = { | ||
| extends: ['frontier/recommended'], | ||
| }; | ||
| return packageJson; | ||
| }); | ||
| } | ||
| function alterPackageJsonFile(appPath, extendFunction) { | ||
| let appPackage = JSON.parse( | ||
| fs.readFileSync(path.join(appPath, 'package.json'), 'UTF8') | ||
| ); | ||
|
|
||
| appPackage.scripts.styleguide = 'styleguidist server --open'; | ||
| appPackage.scripts['styleguide:build'] = 'styleguidist build'; | ||
|
|
||
| appPackage = extendFunction(appPackage); | ||
| fs.writeFileSync( | ||
| path.join(appPath, 'package.json'), | ||
| JSON.stringify(appPackage, null, 2) + os.EOL | ||
| ); | ||
| } | ||
|
|
||
| function configurePolymer(appPath, useYarn) { | ||
| //we read the package.json using fs instead of require() because require() uses the | ||
| //cached result from earlier, even though the package.json has been updated previously. | ||
| const appPackage = JSON.parse( | ||
| fs.readFileSync(path.join(appPath, 'package.json'), 'UTF8') | ||
| ); | ||
| appPackage.vendorCopy = [ | ||
| { | ||
| from: | ||
| 'node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js', | ||
| to: 'public/vendor/custom-elements-es5-adapter.js', | ||
| }, | ||
| { | ||
| from: | ||
| 'node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js', | ||
| to: 'public/vendor/webcomponents-bundle.js', | ||
| }, | ||
| ]; | ||
|
|
||
| const { postinstall } = appPackage.scripts; | ||
| appPackage.scripts.postinstall = postinstall | ||
| ? `${postinstall} && ` | ||
| : '' + 'vendor-copy'; | ||
|
|
||
| fs.writeFileSync( | ||
| path.join(appPath, 'package.json'), | ||
| JSON.stringify(appPackage, null, 2) + os.EOL | ||
| ); | ||
| alterPackageJsonFile(appPath, appPackage => { | ||
| const packageJson = { ...appPackage }; | ||
| packageJson.vendorCopy = [ | ||
| { | ||
| from: | ||
| 'node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js', | ||
| to: 'public/vendor/custom-elements-es5-adapter.js', | ||
| }, | ||
| { | ||
| from: | ||
| 'node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js', | ||
| to: 'public/vendor/webcomponents-bundle.js', | ||
| }, | ||
| ]; | ||
| packageJson.scripts.postinstall = 'vendor-copy'; | ||
| return packageJson; | ||
| }); | ||
|
|
||
| const polymerModules = [ | ||
| 'vendor-copy@2.0.0', | ||
|
|
@@ -137,19 +134,6 @@ function injectPolymerCode(appPath) { | |
| fs.writeFileSync(indexPath, indexHtml); | ||
| } | ||
|
|
||
| function configureRedux(appPath, useYarn, ownPath) { | ||
| const reduxModules = [ | ||
| 'redux@4.0.0', | ||
| 'react-redux@5.0.7', | ||
| 'redux-logger@3.0.6', | ||
| 'redux-thunk@2.3.0', | ||
| ]; | ||
| installModulesSync(reduxModules, useYarn); | ||
|
|
||
| const templatePath = path.join(ownPath, 'template-redux'); | ||
| fs.copySync(templatePath, appPath, { overwrite: true }); | ||
| } | ||
|
|
||
| function configureEF(appPath, useYarn, ownPath) { | ||
| // TODO - modify package.json to make sure name is correct for blueprint | ||
| // TODO - use blueprint.yml as a template | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #dont worry about using newer versions of libraries than react-scripts | ||
| SKIP_PREFLIGHT_CHECK=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| import App from './App'; | ||
|
|
||
| export { App }; | ||
| export default App; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.