From dacb0a2232ed4f2dca5ccc1eca5518293265fa37 Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 10:40:38 -0600 Subject: [PATCH 1/7] adding template-redux, additional modules, travis fixes, and a little more --- .travis.yml | 47 ++--- packages/react-scripts/package.json | 16 +- packages/react-scripts/scripts/init.js | 10 +- .../scripts/utils/createJestConfig.js | 1 + .../scripts/utils/frontierInit.js | 166 ++++++++++++++++++ .../react-scripts/scripts/utils/osUtils.js | 15 ++ .../scripts/utils/verifyTypeScriptSetup.js | 2 +- .../react-scripts/template-redux/README.md | 44 +++++ .../react-scripts/template-redux/gitignore | 23 +++ .../template-redux/public/favicon.ico | Bin 0 -> 3870 bytes .../template-redux/public/index.html | 41 +++++ .../template-redux/public/manifest.json | 15 ++ .../template-redux/src/actions/index.js | 3 + .../src/actions/updateTimestamp.js | 5 + .../template-redux/src/components/App.css | 32 ++++ .../template-redux/src/components/App.jsx | 25 +++ .../src/components/App.test.jsx | 9 + .../src/components/ExampleTimestamp.jsx | 29 +++ .../template-redux/src/components/index.js | 3 + .../template-redux/src/components/logo.svg | 7 + .../template-redux/src/index.css | 14 ++ .../react-scripts/template-redux/src/index.js | 46 +++++ .../src/reducers/exampleReducer.js | 8 + .../template-redux/src/reducers/index.js | 4 + .../template-redux/src/serviceWorker.js | 135 ++++++++++++++ .../react-scripts/template/public/index.html | 1 + .../template/src/components/App.css | 32 ++++ .../template/src/components/App.jsx | 28 +++ .../template/src/components/App.test.jsx | 9 + .../template/src/components/index.js | 3 + .../template/src/components/logo.svg | 7 + packages/react-scripts/template/src/index.js | 2 +- 32 files changed, 740 insertions(+), 42 deletions(-) create mode 100644 packages/react-scripts/scripts/utils/frontierInit.js create mode 100644 packages/react-scripts/scripts/utils/osUtils.js create mode 100644 packages/react-scripts/template-redux/README.md create mode 100644 packages/react-scripts/template-redux/gitignore create mode 100644 packages/react-scripts/template-redux/public/favicon.ico create mode 100644 packages/react-scripts/template-redux/public/index.html create mode 100644 packages/react-scripts/template-redux/public/manifest.json create mode 100644 packages/react-scripts/template-redux/src/actions/index.js create mode 100644 packages/react-scripts/template-redux/src/actions/updateTimestamp.js create mode 100644 packages/react-scripts/template-redux/src/components/App.css create mode 100644 packages/react-scripts/template-redux/src/components/App.jsx create mode 100644 packages/react-scripts/template-redux/src/components/App.test.jsx create mode 100644 packages/react-scripts/template-redux/src/components/ExampleTimestamp.jsx create mode 100644 packages/react-scripts/template-redux/src/components/index.js create mode 100644 packages/react-scripts/template-redux/src/components/logo.svg create mode 100644 packages/react-scripts/template-redux/src/index.css create mode 100644 packages/react-scripts/template-redux/src/index.js create mode 100644 packages/react-scripts/template-redux/src/reducers/exampleReducer.js create mode 100644 packages/react-scripts/template-redux/src/reducers/index.js create mode 100644 packages/react-scripts/template-redux/src/serviceWorker.js create mode 100644 packages/react-scripts/template/src/components/App.css create mode 100644 packages/react-scripts/template/src/components/App.jsx create mode 100644 packages/react-scripts/template/src/components/App.test.jsx create mode 100644 packages/react-scripts/template/src/components/index.js create mode 100644 packages/react-scripts/template/src/components/logo.svg diff --git a/.travis.yml b/.travis.yml index 846a8143750..f2b02d971db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,18 @@ ---- -dist: trusty language: node_js node_js: - - 8 - 10 -cache: - yarn: true - directories: - - .npm -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly - - export PATH="$HOME/.yarn/bin:$PATH" -install: true -script: - - 'if [ $TEST_SUITE = "simple" ]; then tasks/e2e-simple.sh; fi' - - 'if [ $TEST_SUITE = "installs" ]; then tasks/e2e-installs.sh; fi' - - 'if [ $TEST_SUITE = "kitchensink" ]; then tasks/e2e-kitchensink.sh; fi' - - 'if [ $TEST_SUITE = "kitchensink-eject" ]; then tasks/e2e-kitchensink-eject.sh; fi' - - 'if [ $TEST_SUITE = "old-node" ]; then tasks/e2e-old-node.sh; fi' - - 'if [ $TEST_SUITE = "behavior" ]; then tasks/e2e-behavior.sh; fi' -env: - matrix: - - TEST_SUITE=simple - - TEST_SUITE=installs - - TEST_SUITE=kitchensink - - TEST_SUITE=kitchensink-eject - - TEST_SUITE=behavior -matrix: - include: - - os: osx - node_js: 8 - env: TEST_SUITE=behavior - - node_js: 6 - env: TEST_SUITE=old-node +install: + - npm i + - cd packages/react-scripts && npm i + - cd ../../ +before_deploy: + - cd packages && tar -zcf react-scripts-$TRAVIS_TAG.tgz react-scripts +deploy: + provider: releases + skip_cleanup: true + api_key: + secure: ndsLlqyGuhr1aCeLJcQ+5Dph8qFbhd8wno1z+hVz5PsCN8GYZr1tukGZ4xXGs76o2XCpxDrEIxceywrjEHfkMJtDU04WbB0w5oF6bHalgGEqIuARC2QlFdzwzeeG5WWYO1jnTWL4VbvHPQzt1CxGgqW9gX1sEdgqE89AW72KoPD3BQQm6W4NmwwCsDDgi3xnTpDys055ryvPZZOJ1FZ010wFa9TOgQ183ApFcpqPWVxJuZemU5i7RRfkAgKDM5nrgLRYkDg2Xo8txPmVp9aHgPOwYgtTmEORnDDi9HkvU/4tBUh7t5p319p9ayAlt3eVJfgJ31qkrNJGFNu03pAYSGA7OPMJ76llFJygcYS7qaqIAiijRKLrI8bBm187N+cbKl8KUsc8GNBdKPBwNdQAS6+/Zn5QqSvgOTVGGKl1rRx20SYoPVQQvLchHUy+slh5xzrSmRLmZOyd7yi+SiB9sx49X/aJWNIBUAdrFo3aa9wSEwplEZ6geidzSUPQWPwF1UBKGCvYFyTnewHXSrBHx4erlmjhvx17UG8CCK9cn12Gkp1OsxFXd4Y0bIB/Jj1rICyQMDNcvOHMfDy/M4J0kPc3DuI7nLCRF21Ak8flUMGYkBZExvrqmtB+5NtQCy6LQ/IUVf+lP1TEcfultynhH+9mI0sWg2ikNN/zH1Cfxug= + file: packages/react-scripts-$TRAVIS_TAG.tgz + on: + repo: fs-webdev/create-react-app + tags: true diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 05d784169f5..59d4e929810 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,14 +1,15 @@ { "name": "react-scripts", - "version": "2.1.1", + "version": "2.1.0", + "frontierVersion": "1.0.0", "description": "Configuration and scripts for Create React App.", - "repository": "facebook/create-react-app", + "repository": "joeycozza/create-react-app", "license": "MIT", "engines": { "node": ">=6" }, "bugs": { - "url": "https://github.com/facebook/create-react-app/issues" + "url": "https://github.com/joeycozza/create-react-app/issues" }, "files": [ "bin", @@ -30,11 +31,11 @@ "babel-eslint": "9.0.0", "babel-jest": "23.6.0", "babel-loader": "8.0.4", - "babel-plugin-named-asset-import": "^0.2.3", - "babel-preset-react-app": "^6.1.0", + "babel-plugin-named-asset-import": "^0.2.2", + "babel-preset-react-app": "^6.0.0", "bfj": "6.1.1", "case-sensitive-paths-webpack-plugin": "2.1.2", - "chalk": "2.4.1", + "chalk": "^2.4.1", "css-loader": "1.0.0", "dotenv": "6.0.0", "dotenv-expand": "4.2.0", @@ -50,6 +51,7 @@ "fs-extra": "7.0.0", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", + "inquirer": "^6.2.0", "jest": "23.6.0", "jest-pnp-resolver": "1.0.1", "jest-resolve": "23.6.0", @@ -61,7 +63,7 @@ "postcss-preset-env": "6.0.6", "postcss-safe-parser": "4.0.1", "react-app-polyfill": "^0.1.3", - "react-dev-utils": "^6.1.1", + "react-dev-utils": "^6.1.0", "resolve": "1.8.1", "sass-loader": "7.1.0", "style-loader": "0.23.0", diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index 771f6dbf490..bf6b1d730ab 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -22,6 +22,7 @@ const spawn = require('react-dev-utils/crossSpawn'); const { defaultBrowsers } = require('react-dev-utils/browsersHelper'); const os = require('os'); const verifyTypeScriptSetup = require('./utils/verifyTypeScriptSetup'); +const frontierInit = require('./utils/frontierInit'); function isInGitRepository() { try { @@ -75,13 +76,14 @@ function tryGitInit(appPath) { } } -module.exports = function( +module.exports = async function( appPath, appName, verbose, originalDirectory, template ) { + const answers = await frontierInit.promptForConfig(appPath); const ownPath = path.dirname( require.resolve(path.join(__dirname, '..', 'package.json')) ); @@ -114,6 +116,8 @@ module.exports = function( JSON.stringify(appPackage, null, 2) + os.EOL ); + frontierInit.packageJsonWritten(); + const readmeExists = fs.existsSync(path.join(appPath, 'README.md')); if (readmeExists) { fs.renameSync( @@ -195,6 +199,8 @@ module.exports = function( } } + frontierInit.installFrontierDependencies(appPath, answers, useYarn, ownPath); + if (useTypeScript) { verifyTypeScriptSetup(); } @@ -217,6 +223,8 @@ module.exports = function( // Change displayed command to yarn instead of yarnpkg const displayedCommand = useYarn ? 'yarn' : 'npm'; + frontierInit.cleanupFrontierCode(appPath); + console.log(); console.log(`Success! Created ${appName} at ${appPath}`); console.log('Inside that directory, you can run several commands:'); diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index abfd92c8d3c..86aa2068962 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -81,6 +81,7 @@ module.exports = (resolve, rootDir, isEjecting) => { 'resetModules', 'snapshotSerializers', 'watchPathIgnorePatterns', + 'transformIgnorePatterns' ]; if (overrides) { supportedKeys.forEach(key => { diff --git a/packages/react-scripts/scripts/utils/frontierInit.js b/packages/react-scripts/scripts/utils/frontierInit.js new file mode 100644 index 00000000000..ca1119df48c --- /dev/null +++ b/packages/react-scripts/scripts/utils/frontierInit.js @@ -0,0 +1,166 @@ +'use strict'; + +const fs = require('fs-extra'); +const os = require('os'); +const path = require('path'); +const chalk = require('chalk'); +const inquirer = require('inquirer'); +const osUtils = require('./osUtils'); + +module.exports = { + installFrontierDependencies, + promptForConfig, + packageJsonWritten, + cleanupFrontierCode, +}; + +function help() { + const g = chalk.green; + const y = chalk.gray; + const b = chalk.yellow; + + const TITLE = chalk.bold.underline('Frontier React Scripts'); + const DESC = 'The Coolest React-Scripterizer You Ever Seen.'; + + return ` + ${g('┏━━┓')} + ${y('┏━┓')} ${g('┗━━┛')} ${y('┏━━━━┓')} ${TITLE} + ${y('┗━┛')} ${b('┏━━┓')} ${y('┃ ┃')} +${g('┏━━━━┓')} ${b('┗━━┛')} ${y('┗━━━━┛')} ${DESC} +${g('┃ ┃')} ${b('//')} ${y('┏━━━━┓')} ${g('⏠')} +${g('┗━━━━┛')} ${b('/ /')} ${y('┃ ┃')} ${g('⏡')} + ${b('\\\\ │ │')} ${y('┗━━━━┛')} + ${b('\\ \\ //')} + ${b('\\ \\')} + ${b('\\ \\')} +`; +} + +async function promptForConfig() { + console.log(help()); + const questions = [ + { + type: 'checkbox', + name: 'additionalFeatures', + message: 'What additional features does your app require', + choices: [ + { + value: 'polymer', + name: 'Using a shared Polymer Component?', + }, + { + name: 'Redux', + value: 'redux', + }, + ], + }, + ]; + const answers = await inquirer.prompt(questions); + return answers; +} + +function packageJsonWritten() {} + +function installFrontierDependencies(appPath, answers, useYarn, ownPath) { + const { additionalFeatures } = answers; + + if (additionalFeatures.includes('polymer')) { + configurePolymer(appPath, useYarn); + } + if (additionalFeatures.includes('redux')) { + configureRedux(appPath, useYarn, ownPath); + } + injectPolymerCode(appPath); + + const defaultModules = [ + 'http-proxy-middleware@0.19.0', + 'react-router-dom@4.3.1', + ]; + installModulesSync(defaultModules, useYarn); +} + +function configurePolymer(appPath, useYarn) { + const appPackage = require(path.join(appPath, 'package.json')); + 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 + ); + + const polymerModules = [ + 'vendor-copy@2.0.0', + '@webcomponents/webcomponentsjs@2.1.3', + ]; + installModulesSync(polymerModules, useYarn, true); +} + +function injectPolymerCode(appPath) { + const indexPath = path.join(appPath, 'public/index.html'); + const polymerCode = ` + + + `; + + let indexHtml = fs.readFileSync(indexPath, 'UTF8'); + indexHtml = indexHtml.replace( + '', + polymerCode + ); + 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 cleanupFrontierCode(appPath) {} + +function installModulesSync(modules, useYarn, saveDev = false) { + const { command, args } = buildInstallCommandAndArgs(useYarn, saveDev); + osUtils.runExternalCommandSync(command, args.concat(modules)); +} + +function buildInstallCommandAndArgs(useYarn, saveDev = false) { + let command; + let args; + if (useYarn) { + command = 'yarnpkg'; + args = ['add']; + if (saveDev) { + args.push('--dev'); + } + } else { + command = 'npm'; + args = ['install', '--save']; + if (saveDev) { + args[1] = '--save-dev'; + } + } + return { command, args }; +} diff --git a/packages/react-scripts/scripts/utils/osUtils.js b/packages/react-scripts/scripts/utils/osUtils.js new file mode 100644 index 00000000000..f3962c29bd8 --- /dev/null +++ b/packages/react-scripts/scripts/utils/osUtils.js @@ -0,0 +1,15 @@ +'use strict'; + +const spawn = require('react-dev-utils/crossSpawn'); + +module.exports = { + runExternalCommandSync, +}; + +function runExternalCommandSync(command, args) { + const proc = spawn.sync(command, args, { stdio: 'inherit' }); + if (proc.status !== 0) { + console.error(`\`${command} ${args.join(' ')}\` failed`); + return; + } +} diff --git a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js index b1d6a5d71c9..4add778ff49 100644 --- a/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js +++ b/packages/react-scripts/scripts/utils/verifyTypeScriptSetup.js @@ -94,7 +94,7 @@ function verifyTypeScriptSetup() { suggested: 'es5', }, allowJs: { suggested: true }, - skipLibCheck: { suggested: false }, + skipLibCheck: { suggested: true }, esModuleInterop: { suggested: true }, allowSyntheticDefaultImports: { suggested: true }, strict: { suggested: true }, diff --git a/packages/react-scripts/template-redux/README.md b/packages/react-scripts/template-redux/README.md new file mode 100644 index 00000000000..897dc836601 --- /dev/null +++ b/packages/react-scripts/template-redux/README.md @@ -0,0 +1,44 @@ +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/packages/react-scripts/template-redux/gitignore b/packages/react-scripts/template-redux/gitignore new file mode 100644 index 00000000000..4d29575de80 --- /dev/null +++ b/packages/react-scripts/template-redux/gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/packages/react-scripts/template-redux/public/favicon.ico b/packages/react-scripts/template-redux/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a11777cc471a4344702741ab1c8a588998b1311a GIT binary patch literal 3870 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 baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ literal 0 HcmV?d00001 diff --git a/packages/react-scripts/template-redux/public/index.html b/packages/react-scripts/template-redux/public/index.html new file mode 100644 index 00000000000..b034f8bc4c5 --- /dev/null +++ b/packages/react-scripts/template-redux/public/index.html @@ -0,0 +1,41 @@ + + + + + + + + + + + React App + + + +
+ + + + diff --git a/packages/react-scripts/template-redux/public/manifest.json b/packages/react-scripts/template-redux/public/manifest.json new file mode 100644 index 00000000000..1f2f141fafd --- /dev/null +++ b/packages/react-scripts/template-redux/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/packages/react-scripts/template-redux/src/actions/index.js b/packages/react-scripts/template-redux/src/actions/index.js new file mode 100644 index 00000000000..b5435d93243 --- /dev/null +++ b/packages/react-scripts/template-redux/src/actions/index.js @@ -0,0 +1,3 @@ +import updateTimestamp from './updateTimestamp.js'; + +export default { updateTimestamp }; diff --git a/packages/react-scripts/template-redux/src/actions/updateTimestamp.js b/packages/react-scripts/template-redux/src/actions/updateTimestamp.js new file mode 100644 index 00000000000..373402a25fc --- /dev/null +++ b/packages/react-scripts/template-redux/src/actions/updateTimestamp.js @@ -0,0 +1,5 @@ +export default function updateTimestamp() { + return { + type: 'UPDATE_TIMESTAMP', + }; +} diff --git a/packages/react-scripts/template-redux/src/components/App.css b/packages/react-scripts/template-redux/src/components/App.css new file mode 100644 index 00000000000..92f956e8040 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/App.css @@ -0,0 +1,32 @@ +.App { + text-align: center; +} + +.App-logo { + animation: App-logo-spin infinite 20s linear; + height: 40vmin; +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/packages/react-scripts/template-redux/src/components/App.jsx b/packages/react-scripts/template-redux/src/components/App.jsx new file mode 100644 index 00000000000..b578ef3b977 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/App.jsx @@ -0,0 +1,25 @@ +import React, {Component} from 'react'; +import ExampleTimestamp from './ExampleTimestamp'; +import logo from './logo.svg'; +import './App.css'; + +class App extends Component { + render() { + return ( +
+
+ logo +

+ Edit src/App.js and save to reload. +

+
+ Learn Frontier + + +
+
+ ); + } +} + +export default App; diff --git a/packages/react-scripts/template-redux/src/components/App.test.jsx b/packages/react-scripts/template-redux/src/components/App.test.jsx new file mode 100644 index 00000000000..a754b201bf9 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/App.test.jsx @@ -0,0 +1,9 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; + +it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + ReactDOM.unmountComponentAtNode(div); +}); diff --git a/packages/react-scripts/template-redux/src/components/ExampleTimestamp.jsx b/packages/react-scripts/template-redux/src/components/ExampleTimestamp.jsx new file mode 100644 index 00000000000..919a49aaff6 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/ExampleTimestamp.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import {connect} from 'react-redux'; +import updateTimestamp from '../actions/updateTimestamp'; + +function ExampleTimestamp(props) { + return ( +
+ +
{props.timestamp}
+
+ ); +} + +const mapStateToProps = state => { + return { + timestamp: state.example.timestamp, + }; +}; + +const mapDispatchToProps = dispatch => ({ + updateTimestamp: () => { + dispatch(updateTimestamp()); + }, +}); + +export default connect( + mapStateToProps, + mapDispatchToProps +)(ExampleTimestamp); diff --git a/packages/react-scripts/template-redux/src/components/index.js b/packages/react-scripts/template-redux/src/components/index.js new file mode 100644 index 00000000000..0626e6e26a6 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/index.js @@ -0,0 +1,3 @@ +import App from './App'; + +export { App }; diff --git a/packages/react-scripts/template-redux/src/components/logo.svg b/packages/react-scripts/template-redux/src/components/logo.svg new file mode 100644 index 00000000000..6b60c1042f5 --- /dev/null +++ b/packages/react-scripts/template-redux/src/components/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/react-scripts/template-redux/src/index.css b/packages/react-scripts/template-redux/src/index.css new file mode 100644 index 00000000000..e2bd8f36a01 --- /dev/null +++ b/packages/react-scripts/template-redux/src/index.css @@ -0,0 +1,14 @@ +body { + margin: 0; + padding: 0; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/packages/react-scripts/template-redux/src/index.js b/packages/react-scripts/template-redux/src/index.js new file mode 100644 index 00000000000..13868b091af --- /dev/null +++ b/packages/react-scripts/template-redux/src/index.js @@ -0,0 +1,46 @@ +import React from 'react'; +import { render } from 'react-dom'; + +import { Provider } from 'react-redux'; +import { createStore, applyMiddleware, compose } from 'redux'; +import thunk from 'redux-thunk'; +import logger from 'redux-logger'; +import rootReducer from './reducers'; + +import { BrowserRouter as Router } from 'react-router-dom'; + +import { App } from './components'; +import './index.css'; +import * as serviceWorker from './serviceWorker'; + +const initialState = { + example: { + timestamp: Date.now(), + }, +}; + +// eslint-disable-next-line no-underscore-dangle +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; + +const store = createStore( + rootReducer, + initialState, + composeEnhancers(applyMiddleware(thunk, logger)) +); + +/* eslint-disable react/jsx-filename-extension */ +// https://medium.com/@pshrmn/a-simple-react-router-v4-tutorial-7f23ff27adf +render( + + + + + , + document.getElementById('root') +); +/* eslint-enable react/jsx-filename-extension */ + +// If you want your app to work offline and load faster, you can change +// unregister() to register() below. Note this comes with some pitfalls. +// Learn more about service workers: http://bit.ly/CRA-PWA +serviceWorker.unregister(); diff --git a/packages/react-scripts/template-redux/src/reducers/exampleReducer.js b/packages/react-scripts/template-redux/src/reducers/exampleReducer.js new file mode 100644 index 00000000000..132d711485e --- /dev/null +++ b/packages/react-scripts/template-redux/src/reducers/exampleReducer.js @@ -0,0 +1,8 @@ +export default function reduceTimestamp(state = {}, action) { + switch (action.type) { + case 'UPDATE_TIMESTAMP': + return { ...state, timestamp: Date.now() }; + default: + return state; + } +} diff --git a/packages/react-scripts/template-redux/src/reducers/index.js b/packages/react-scripts/template-redux/src/reducers/index.js new file mode 100644 index 00000000000..04172b6014a --- /dev/null +++ b/packages/react-scripts/template-redux/src/reducers/index.js @@ -0,0 +1,4 @@ +import { combineReducers } from 'redux'; +import example from './exampleReducer'; + +export default combineReducers({ example }); diff --git a/packages/react-scripts/template-redux/src/serviceWorker.js b/packages/react-scripts/template-redux/src/serviceWorker.js new file mode 100644 index 00000000000..2283ff9ced1 --- /dev/null +++ b/packages/react-scripts/template-redux/src/serviceWorker.js @@ -0,0 +1,135 @@ +// This optional code is used to register a service worker. +// register() is not called by default. + +// This lets the app load faster on subsequent visits in production, and gives +// it offline capabilities. However, it also means that developers (and users) +// will only see deployed updates on subsequent visits to a page, after all the +// existing tabs open on the page have been closed, since previously cached +// resources are updated in the background. + +// To learn more about the benefits of this model and instructions on how to +// opt-in, read http://bit.ly/CRA-PWA + +const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) +); + +export function register(config) { + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return; + } + + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); + + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit http://bit.ly/CRA-PWA' + ); + }); + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } + }); + } +} + +function registerValidSW(swUrl, config) { + navigator.serviceWorker + .register(swUrl) + .then(registration => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + 'New content is available and will be used when all ' + + 'tabs for this page are closed. See http://bit.ly/CRA-PWA.' + ); + + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.'); + + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch(error => { + console.error('Error during service worker registration:', error); + }); +} + +function checkValidServiceWorker(swUrl, config) { + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then(response => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get('content-type'); + if ( + response.status === 404 || + (contentType != null && contentType.indexOf('javascript') === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then(registration => { + registration.unregister().then(() => { + window.location.reload(); + }); + }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + 'No internet connection found. App is running in offline mode.' + ); + }); +} + +export function unregister() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then(registration => { + registration.unregister(); + }); + } +} diff --git a/packages/react-scripts/template/public/index.html b/packages/react-scripts/template/public/index.html index 4bfce95684f..b034f8bc4c5 100644 --- a/packages/react-scripts/template/public/index.html +++ b/packages/react-scripts/template/public/index.html @@ -36,5 +36,6 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> + diff --git a/packages/react-scripts/template/src/components/App.css b/packages/react-scripts/template/src/components/App.css new file mode 100644 index 00000000000..92f956e8040 --- /dev/null +++ b/packages/react-scripts/template/src/components/App.css @@ -0,0 +1,32 @@ +.App { + text-align: center; +} + +.App-logo { + animation: App-logo-spin infinite 20s linear; + height: 40vmin; +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/packages/react-scripts/template/src/components/App.jsx b/packages/react-scripts/template/src/components/App.jsx new file mode 100644 index 00000000000..769d6e85abf --- /dev/null +++ b/packages/react-scripts/template/src/components/App.jsx @@ -0,0 +1,28 @@ +import React, { Component } from 'react'; +import logo from './logo.svg'; +import './App.css'; + +class App extends Component { + render() { + return ( +
+
+ logo +

+ Edit src/App.js and save to reload. +

+ + Learn Frontier + +
+
+ ); + } +} + +export default App; diff --git a/packages/react-scripts/template/src/components/App.test.jsx b/packages/react-scripts/template/src/components/App.test.jsx new file mode 100644 index 00000000000..a754b201bf9 --- /dev/null +++ b/packages/react-scripts/template/src/components/App.test.jsx @@ -0,0 +1,9 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; + +it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + ReactDOM.unmountComponentAtNode(div); +}); diff --git a/packages/react-scripts/template/src/components/index.js b/packages/react-scripts/template/src/components/index.js new file mode 100644 index 00000000000..0626e6e26a6 --- /dev/null +++ b/packages/react-scripts/template/src/components/index.js @@ -0,0 +1,3 @@ +import App from './App'; + +export { App }; diff --git a/packages/react-scripts/template/src/components/logo.svg b/packages/react-scripts/template/src/components/logo.svg new file mode 100644 index 00000000000..6b60c1042f5 --- /dev/null +++ b/packages/react-scripts/template/src/components/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/react-scripts/template/src/index.js b/packages/react-scripts/template/src/index.js index 0c5e75da1cd..fece4db44c8 100644 --- a/packages/react-scripts/template/src/index.js +++ b/packages/react-scripts/template/src/index.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; -import App from './App'; +import App from './components/App'; import * as serviceWorker from './serviceWorker'; ReactDOM.render(, document.getElementById('root')); From 5479a68b269ae0b70fa74257f104384151570ed2 Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 10:46:43 -0600 Subject: [PATCH 2/7] fixing github org in the package.json --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 59d4e929810..798b4f1b3e1 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "react-scripts", - "version": "2.1.0", + "version": "2.1.1", "frontierVersion": "1.0.0", "description": "Configuration and scripts for Create React App.", "repository": "joeycozza/create-react-app", From 71364598c9505ff9e5d04f7d8ccfaa4296d6827d Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 11:29:34 -0600 Subject: [PATCH 3/7] moving the fs-logo to its own module --- packages/react-scripts/package.json | 1 + .../scripts/utils/frontierInit.js | 26 ++----------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 798b4f1b3e1..a550a3c08a8 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -48,6 +48,7 @@ "eslint-plugin-react": "7.11.1", "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", + "fs-cli-goodies": "github:fs-webdev/fs-cli-goodies", "fs-extra": "7.0.0", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", diff --git a/packages/react-scripts/scripts/utils/frontierInit.js b/packages/react-scripts/scripts/utils/frontierInit.js index ca1119df48c..4a2c9b06eda 100644 --- a/packages/react-scripts/scripts/utils/frontierInit.js +++ b/packages/react-scripts/scripts/utils/frontierInit.js @@ -3,7 +3,7 @@ const fs = require('fs-extra'); const os = require('os'); const path = require('path'); -const chalk = require('chalk'); +const fsCli = require('fs-cli-goodies'); const inquirer = require('inquirer'); const osUtils = require('./osUtils'); @@ -14,30 +14,8 @@ module.exports = { cleanupFrontierCode, }; -function help() { - const g = chalk.green; - const y = chalk.gray; - const b = chalk.yellow; - - const TITLE = chalk.bold.underline('Frontier React Scripts'); - const DESC = 'The Coolest React-Scripterizer You Ever Seen.'; - - return ` - ${g('┏━━┓')} - ${y('┏━┓')} ${g('┗━━┛')} ${y('┏━━━━┓')} ${TITLE} - ${y('┗━┛')} ${b('┏━━┓')} ${y('┃ ┃')} -${g('┏━━━━┓')} ${b('┗━━┛')} ${y('┗━━━━┛')} ${DESC} -${g('┃ ┃')} ${b('//')} ${y('┏━━━━┓')} ${g('⏠')} -${g('┗━━━━┛')} ${b('/ /')} ${y('┃ ┃')} ${g('⏡')} - ${b('\\\\ │ │')} ${y('┗━━━━┛')} - ${b('\\ \\ //')} - ${b('\\ \\')} - ${b('\\ \\')} -`; -} - async function promptForConfig() { - console.log(help()); + console.log(fsCli.fsLogo('Frontier React Scripts')); const questions = [ { type: 'checkbox', From cd1116069339316e3b317b1a383f7ec3f467aa1e Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 11:39:23 -0600 Subject: [PATCH 4/7] wrapping travis commands in strings. --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2b02d971db..b256399c56d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,11 @@ language: node_js node_js: - 10 install: - - npm i - - cd packages/react-scripts && npm i - - cd ../../ + - "npm i" + - "cd packages/react-scripts && npm i" + - "cd ../../" before_deploy: - - cd packages && tar -zcf react-scripts-$TRAVIS_TAG.tgz react-scripts + - "cd packages && tar -zcf react-scripts-$TRAVIS_TAG.tgz react-scripts" deploy: provider: releases skip_cleanup: true From 7c8b59f098c533e665c2ab01fee26140cf8c5a52 Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 11:43:22 -0600 Subject: [PATCH 5/7] removing postinstall script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 045e9655b43..b4b8d56fc14 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "create-react-app": "node tasks/cra.js", "e2e": "tasks/e2e-simple.sh", "e2e:docker": "tasks/local-test.sh", - "postinstall": "cd packages/react-error-overlay/ && yarn build:prod", + "postinstall": "echo \"cd packages/react-error-overlay/ && yarn build:prod\"", "publish": "tasks/publish.sh", "start": "cd packages/react-scripts && node bin/react-scripts.js start", "screencast": "node ./tasks/screencast.js", From a0b863b1a793eb5523e533fc534254e69825fb99 Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 12:20:03 -0600 Subject: [PATCH 6/7] adding the netrc stuff for travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b256399c56d..0f7c9618361 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: node_js node_js: - 10 +before_install: + - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc install: - "npm i" - "cd packages/react-scripts && npm i" From c48c3674f22baa58de998f6fd651bb660d9a51dc Mon Sep 17 00:00:00 2001 From: Joey Cozza Date: Fri, 2 Nov 2018 12:26:24 -0600 Subject: [PATCH 7/7] adding some docs --- CHANGELOG-FRONTIER.md | 16 ++++++++++++++++ README-FRONTIER.md | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 CHANGELOG-FRONTIER.md create mode 100644 README-FRONTIER.md diff --git a/CHANGELOG-FRONTIER.md b/CHANGELOG-FRONTIER.md new file mode 100644 index 00000000000..7d673e0523e --- /dev/null +++ b/CHANGELOG-FRONTIER.md @@ -0,0 +1,16 @@ +## 1.0.0 +Forked Create React App@2.1.0 + +#### :rocket: New Feature + +- Got travis to automatically make the tar file and upload it to the github release when a new tag is made (and pushed) +- Added a way to get User Input if they want their react app to have support for Polymer or Redux +- Added new jest configuration option `transformIgnorePatterns` + +#### :nail_care: Enhancement + +- Changed the React Template to say "Frontier" instead of "React" in the App.js template + +#### :memo: Documentation + +- Added a README-FRONTIER.md and a CHANGELOG-FRONTIER.md diff --git a/README-FRONTIER.md b/README-FRONTIER.md new file mode 100644 index 00000000000..6e159429264 --- /dev/null +++ b/README-FRONTIER.md @@ -0,0 +1,12 @@ +## How to test your local copy of react-scripts + +- We found that creating a new react-app through this command could utilize your local react-scripts + - You'll just need to change the path to your react-scripts version. + - `npx create-react-app polyer-cra-test --scripts-version file:create-react-app/packages/react-scripts` + +## How to make a Release + +- When the "develop" branch is ready to merge into frontierMaster for a release, make a PR and be sure to squash all the commits into a single commit. +- Create a tag on frontierMaster named `${SemverVersionOfFacebooksRelease}-frontier-${SemverVersionOfFrontiersRelease}` +- Push that newly created tag up to github with `git push origin ${nameOfTagFromAbove}` +- Travis will automatically catch that new tag, and create a tar file of react-scripts and upload it to the corresponding release on github.