Skip to content

Commit b3a11fd

Browse files
authored
1.4.0 (#24)
* 1.0.5 fixing the i18n merge issues * Streamline release See if skipping node_modules fixes some build issues * Artifactory (#17) * 1.1.0 publish to artifactory * Release 1.1.1 test release * adding styleguidist beginnings * adding a little postversion "hook" * package-lock update * updating readme a bit * styleguidist working well in normal template. Not quite finished for the redux template * removing logs * updated changelog and fixed package.json reading/cache issue in another place in frontierInit.js * 1.4.0 - version bump from running `npm version`
1 parent 3e2b8dd commit b3a11fd

File tree

14 files changed

+4120
-4151
lines changed

14 files changed

+4120
-4151
lines changed

CHANGELOG-FRONTIER.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 1.4.0
2+
3+
#### :rocket: New Feature
4+
5+
- Incorporated Styleguidist by default into the app template
6+
7+
#### :bug: Bug Fix
8+
9+
- Fixed a bug in the frontierInit.js file dealing with package.json not having the correct dependencies after an npm install
10+
111
## 1.1.0
212

313
#### :rocket: New Feature

README-FRONTIER.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ npx create-react-app {app-name} --scripts-version @familysearch/react-scripts
99
## How to test your local copy of react-scripts
1010

1111
- We found that creating a new react-app through this command could utilize your local react-scripts
12-
- You'll just need to change the path to your react-scripts version.
12+
- You'll just need to change the path (after the string "file:") to your react-scripts version.
1313
- `npx create-react-app cra-test --scripts-version file:create-react-app/packages/react-scripts`
1414

1515
## How to make a Release
1616

1717
- When the "develop" branch is ready to merge into frontierMaster for a release
18-
- run `npm version (patch|minor|major)`
19-
- make a PR to the `frontierMaster` branch and be sure to squash all the commits into a single commit.
18+
1. run `npm version (patch|minor|major)` on the develop branch
19+
- This will bump the version in the package.json file, and also make a git tag for the commit
20+
2. make a PR to the `frontierMaster` branch and be sure to squash all the commits into a single commit.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const { version, upstreamVersion } = require('./package');
2+
const osUtils = require('./scripts/utils/osUtils');
3+
4+
const command = 'git';
5+
const args = ['tag', `v${version}-upstream-${upstreamVersion}`];
6+
osUtils.runExternalCommandSync(command, args);

packages/react-scripts/package-lock.json

Lines changed: 4001 additions & 4117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-scripts/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
2-
"name": "@familysearch/react-scripts",
3-
"version": "1.1.1",
4-
"craVersion": "2.1.2",
2+
"name": "react-scripts",
3+
"version": "1.4.0",
4+
"upstreamVersion": "2.1.2",
55
"description": "Configuration and scripts for Create React App.",
66
"repository": "fs-webdev/create-react-app",
77
"license": "MIT",
88
"engines": {
99
"node": ">=6"
1010
},
11+
"scripts": {
12+
"postversion": "node gitTagForkedStyle.js"
13+
},
1114
"bugs": {
1215
"url": "https://github.com/fs-webdev/create-react-app/issues"
1316
},

packages/react-scripts/scripts/utils/frontierInit.js

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ async function promptForConfig() {
2323
message: 'What additional features does your app require',
2424
choices: [
2525
{
26+
name: 'Using a shared Polymer Component within your React App?',
2627
value: 'polymer',
27-
name: 'Using a shared Polymer Component?',
2828
},
2929
{
30-
name: 'Redux',
30+
name: `Redux (Chances are high you don't need this yet)`,
3131
value: 'redux',
3232
},
3333
],
@@ -55,11 +55,36 @@ function installFrontierDependencies(appPath, answers, useYarn, ownPath) {
5555
'react-router-dom@4.3.1',
5656
'fs-webdev/exo',
5757
];
58+
59+
const defaultDevModules = ['react-styleguidist@9.0.0-beta4', 'webpack'];
60+
5861
installModulesSync(defaultModules, useYarn);
62+
installModulesSync(defaultDevModules, useYarn, true);
63+
addStyleguidistScriptsToPackageJson(appPath);
64+
}
65+
66+
function addStyleguidistScriptsToPackageJson(appPath) {
67+
//we read the package.json using fs instead of require() because require() uses the
68+
//cached result from earlier, even though the package.json has been updated previously.
69+
const appPackage = JSON.parse(
70+
fs.readFileSync(path.join(appPath, 'package.json'), 'UTF8')
71+
);
72+
73+
appPackage.scripts.styleguide = 'styleguidist server --open';
74+
appPackage.scripts['styleguide:build'] = 'styleguidist build';
75+
76+
fs.writeFileSync(
77+
path.join(appPath, 'package.json'),
78+
JSON.stringify(appPackage, null, 2) + os.EOL
79+
);
5980
}
6081

6182
function configurePolymer(appPath, useYarn) {
62-
const appPackage = require(path.join(appPath, 'package.json'));
83+
//we read the package.json using fs instead of require() because require() uses the
84+
//cached result from earlier, even though the package.json has been updated previously.
85+
const appPackage = JSON.parse(
86+
fs.readFileSync(path.join(appPath, 'package.json'), 'UTF8')
87+
);
6388
appPackage.vendorCopy = [
6489
{
6590
from:
@@ -92,12 +117,13 @@ function configurePolymer(appPath, useYarn) {
92117

93118
function injectPolymerCode(appPath) {
94119
const indexPath = path.join(appPath, 'public/index.html');
120+
let indexHtml = fs.readFileSync(indexPath, 'UTF8');
121+
95122
const polymerCode = `
96123
<script src="%PUBLIC_URL%/vendor/webcomponents-bundle.js"></script>
97124
<script src="%PUBLIC_URL%/vendor/custom-elements-es5-adapter.js"></script>
98125
`;
99126

100-
let indexHtml = fs.readFileSync(indexPath, 'UTF8');
101127
indexHtml = indexHtml.replace(
102128
'<!--FRONTIER WEBCOMPONENT LOADER CODE FRONTIER -->',
103129
polymerCode

packages/react-scripts/template-redux/src/components/App.jsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
import React, {Component} from 'react';
1+
import React, { Component } from 'react';
22
import ExampleTimestamp from './ExampleTimestamp';
33
import logo from './logo.svg';
4-
import './App.css';
4+
import styles from './App.module.css';
55

66
class App extends Component {
77
render() {
88
return (
9-
<div className="App">
10-
<header className="App-header">
11-
<img src={logo} className="App-logo" alt="logo" />
9+
<div className={styles.app}>
10+
<header className={styles.appHeader}>
11+
<img src={logo} className={styles.appLogo} alt="logo" />
1212
<p>
1313
Edit <code>src/components/App.jsx</code> and save to reload.
1414
</p>
15-
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
15+
<a
16+
className={styles.appLink}
17+
href="https://reactjs.org"
18+
target="_blank"
19+
rel="noopener noreferrer"
20+
>
1621
Learn Frontier
1722
</a>
18-
<ExampleTimestamp/>
23+
<ExampleTimestamp />
1924
</header>
2025
</div>
2126
);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
For help getting styleguidist to work with redux, read the docs [ there ](https://github.com/styleguidist/react-styleguidist/blob/master/docs/Thirdparties.md#working-with-third-party-libraries)
2+
3+
App Example
4+
5+
```jsx
6+
// In order to make styleguidist work with redux, we need to setup the
7+
// store here for App, cause it uses ExampleTimestamp
8+
9+
import { Provider } from 'react-redux';
10+
import { createStore } from 'redux';
11+
import rootReducer from '../reducers';
12+
13+
const startState = {
14+
example: {
15+
timestamp: Date.now(),
16+
},
17+
};
18+
const store = createStore(rootReducer, startState);
19+
20+
<Provider store={store}>
21+
<App />
22+
</Provider>;
23+
```

packages/react-scripts/template-redux/src/components/App.css renamed to packages/react-scripts/template-redux/src/components/App.module.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
.App {
1+
.app {
22
text-align: center;
33
}
44

5-
.App-logo {
6-
animation: App-logo-spin infinite 20s linear;
5+
.appLogo {
6+
animation: appLogoSpin infinite 20s linear;
77
height: 40vmin;
88
}
99

10-
.App-header {
10+
.appHeader {
1111
background-color: #282c34;
1212
min-height: 100vh;
1313
display: flex;
@@ -18,11 +18,11 @@
1818
color: white;
1919
}
2020

21-
.App-link {
21+
.appLink {
2222
color: #61dafb;
2323
}
2424

25-
@keyframes App-logo-spin {
25+
@keyframes appLogoSpin {
2626
from {
2727
transform: rotate(0deg);
2828
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
webpackConfig: require('react-scripts/config/webpack.config'),
3+
};

0 commit comments

Comments
 (0)