Skip to content

Commit bf5d40b

Browse files
Chore: fix CI (#16)
* Prettify files * Disable no-extraneous-dependencies eslint rule in the example, since there is no package.json * Boilerplate: use "rudy-src-main" entry point in production mode (to avoid dependency on library builds) * Correct value of "rudy-src-main" field in page title middleware and utils * Add "build" script to all libraries so that they are built before the CI runs the integration tests
1 parent 3daa812 commit bf5d40b

File tree

9 files changed

+42
-20
lines changed

9 files changed

+42
-20
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lerna-debug.log
1919
*.png
2020
*.snap
2121
*.log
22+
*.env
2223

2324
# Ignored dirs in sub packages
2425
packages/*/

README.md

+24-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
# Respond Framework
2-
Think of your app in terms of _states_, not _routes_ or _components_. Connect your components and just dispatch _Flux Standard Actions_!
32

4-
**Respond Framework** is the successor to [redux-first-router](https://github.com/faceyspacey/redux-first-router).
3+
Think of your app in terms of _states_, not _routes_ or _components_. Connect
4+
your components and just dispatch _Flux Standard Actions_!
5+
6+
**Respond Framework** is the successor to
7+
[redux-first-router](https://github.com/faceyspacey/redux-first-router).
58

69
## Motivation
7-
To be able to use Redux *as is* while keeping the address bar in sync. To achieve *bi-directional mapping* between the address bar and Redux actions. This way, changing the address (also via back/forward) dispatches an action, and dispatching an action changes the address. Paths are defined as actions, and path params and query strings are handled as action payloads.
810

9-
**Respond Framework** also seeks to *avoid* the following obstacles:
11+
To be able to use Redux _as is_ while keeping the address bar in sync. To
12+
achieve _bi-directional mapping_ between the address bar and Redux actions. This
13+
way, changing the address (also via back/forward) dispatches an action, and
14+
dispatching an action changes the address. Paths are defined as actions, and
15+
path params and query strings are handled as action payloads.
16+
17+
**Respond Framework** also seeks to _avoid_ the following obstacles:
1018

11-
* Rendering from state that doesn't come from Redux
12-
* Dealing with the added complexity from having state outside of Redux
13-
* Cluttering components with route-related code
14-
* Large API surface areas of frameworks like `react-router` and `next.js`
15-
* Routing frameworks getting in the way of optimizing animations (such as when animations coincide with component updates)
16-
* Having to do route changes differently in order to support server-side rendering
19+
- Rendering from state that doesn't come from Redux
20+
- Dealing with the added complexity from having state outside of Redux
21+
- Cluttering components with route-related code
22+
- Large API surface areas of frameworks like `react-router` and `next.js`
23+
- Routing frameworks getting in the way of optimizing animations (such as when
24+
animations coincide with component updates)
25+
- Having to do route changes differently in order to support server-side
26+
rendering
1727

1828
## Usage
1929

2030
### Install
31+
2132
`yarn add @respond-framework/rudy`
2233

2334
### Basic example for React
@@ -165,7 +176,9 @@ export {
165176

166177
The source code for this example can be found [here](./examples/react).
167178

168-
Also see the [boilerplate project](./packages/boilerplate) and the (partly outdated) [documentation](./packages/rudy/docs).
179+
Also see the [boilerplate project](./packages/boilerplate) and the (partly
180+
outdated) [documentation](./packages/rudy/docs).
169181

170182
## License
183+
171184
[MIT](LICENSE)

examples/react/basic/.eslintrc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ const path = require('path')
33
module.exports = {
44
extends: [path.resolve(__dirname, '../../../.eslintrc.js')],
55
env: {
6-
browser: true
6+
browser: true,
77
},
88
rules: {
99
'no-param-reassign': 0,
1010
'import/no-unresolved': 0,
1111
'import/extensions': 0,
1212
'react/jsx-filename-extension': 0,
13-
'react/prop-types': ['error', { skipUndeclared: true }]
13+
'react/prop-types': ['error', { skipUndeclared: true }],
14+
'import/no-extraneous-dependencies': 0, // There is no package.json
1415
},
1516
}

packages/boilerplate/server/webpack.config.babel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default (env) => {
9090
? ['.server.js', '.js', '.css']
9191
: ['.browser.js', '.js', '.css'],
9292
mainFields: [
93-
isDev && 'rudy-src-main',
93+
'rudy-src-main',
9494
isClient && 'browser',
9595
'module',
9696
'main',

packages/link/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"prepare": "yarn run build:cjs && yarn run build:es && yarn run flow-copy",
2121
"build:cjs": "babel --root-mode upward --source-maps true src -d cjs",
2222
"build:es": "BABEL_ENV=es babel --root-mode upward --source-maps true src -d es",
23+
"build": "yarn run build:cjs && yarn run build:es",
2324
"clean": "rimraf cjs && rimraf es",
2425
"flow-copy": "flow-copy-source src cjs && flow-copy-source src es",
2526
"prettier": "prettier",

packages/middleware-change-page-title/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Rudy middleware to synchronise the browser page title with redux state",
55
"main": "cjs/index.js",
66
"module": "es/index.js",
7-
"rudy-src-main": "src/index.jsx",
7+
"rudy-src-main": "src/index.js",
88
"repository": "https://github.com/respond-framework/rudy.git",
99
"contributors": [
1010
"James Gilmore <[email protected]>",
@@ -23,6 +23,7 @@
2323
"prepare": "yarn run build:cjs && yarn run build:es && yarn run flow-copy",
2424
"build:cjs": "babel --root-mode upward --source-maps true src -d cjs",
2525
"build:es": "BABEL_ENV=es babel --root-mode upward --source-maps true src -d es",
26+
"build": "yarn run build:cjs && yarn run build:es",
2627
"clean": "rimraf cjs && rimraf es",
2728
"flow-copy": "flow-copy-source src cjs && flow-copy-source src es",
2829
"prettier": "prettier",
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Differences from [redux-first-router](https://github.com/faceyspacey/redux-first-router)
22

3-
* `[NOT_FOUND]` -> `"NOT_FOUND"` in reducers (e.g. page reducer).
4-
* `connectRoutes` has been renamed to `createRouter` and does not return `enhancer` anymore.
5-
* `firstRoute`, now returned from `createRouter`, must be invoked before rendering.
6-
* `payload` has been renamed to `params`, e.g. `{ type: 'FOO', params: {} }` and `state.location.params`.
3+
- `[NOT_FOUND]` -> `"NOT_FOUND"` in reducers (e.g. page reducer).
4+
- `connectRoutes` has been renamed to `createRouter` and does not return
5+
`enhancer` anymore.
6+
- `firstRoute`, now returned from `createRouter`, must be invoked before
7+
rendering.
8+
- `payload` has been renamed to `params`, e.g. `{ type: 'FOO', params: {} }` and
9+
`state.location.params`.

packages/rudy/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"build:es": "BABEL_ENV=es babel --root-mode upward --source-maps true src -d es",
1616
"build:umd": "NODE_ENV=production webpack --mode production --env.minimize=false src/index.js -o dist/redux-first-router.js",
1717
"build:umd:min": "NODE_ENV=production webpack --mode production --env.minimize=true src/index.js -o dist/redux-first-router.min.js",
18+
"build": "yarn run build:cjs && yarn run build:es && yarn run build:umd && yarn run build:umd:min",
1819
"flow-copy": "flow-copy-source src dist && flow-copy-source src es",
1920
"flow-watch": "clear; printf \"\\033[3J\" & npm run flow & fswatch -o ./ | xargs -n1 -I{} sh -c 'clear; printf \"\\033[3J\" && npm run flow'",
2021
"flow": "flow; test $? -eq 0 -o $? -eq 2",

packages/utils/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Shared utilities for rudy",
55
"main": "cjs/index.js",
66
"module": "es/index.js",
7-
"rudy-src-main": "src/index.jsx",
7+
"rudy-src-main": "src/index.js",
88
"repository": "https://github.com/respond-framework/rudy.git",
99
"contributors": [
1010
"James Gilmore <[email protected]>",
@@ -23,6 +23,7 @@
2323
"prepare": "yarn run build:cjs && yarn run build:es && yarn run flow-copy",
2424
"build:cjs": "babel --root-mode upward --source-maps true src -d cjs",
2525
"build:es": "BABEL_ENV=es babel --root-mode upward --source-maps true src -d es",
26+
"build": "yarn run build:cjs && yarn run build:es",
2627
"clean": "rimraf cjs && rimraf es",
2728
"flow-copy": "flow-copy-source src cjs && flow-copy-source src es",
2829
"prettier": "prettier",

0 commit comments

Comments
 (0)