Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Offer updates from down stream #862

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"extends": [
"eslint-config-airbnb",
"prettier",
"prettier/flowtype",
"prettier/react"
],
"plugins": [
"prettier"
],
"parser": "babel-eslint",
"extends": ["eslint-config-airbnb", "prettier"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"browser": true,
"node": true,
Expand All @@ -27,7 +22,11 @@
"no-plusplus": [0],
"no-prototype-builtins": [0],
"no-return-assign": [0],
"max-len": ["error", { "code": 120, "ignorePattern": "^test", "ignoreUrls": true }],
"max-classes-per-file": [0],
"max-len": [
"error",
{ "code": 120, "ignorePattern": "^test", "ignoreUrls": true }
],
"lines-between-class-members": [0],
"prefer-destructuring": [0],
"import/no-unresolved": [0],
Expand All @@ -36,15 +35,23 @@
"import/prefer-default-export": [0],
"import/no-useless-path-segments": [0],
"jsx-a11y/label-has-for": [0],
"react/forbid-foreign-prop-types": [0],
"react/forbid-prop-types": [0],
"react/prop-types": [0],
"react/prefer-stateless-function": [0],
"react/no-multi-comp": [0],
"react/sort-comp": [0],
"react/static-property-placement": [0],
"react/state-in-constructor": [0],
"react/jsx-filename-extension": [0],
"prettier/prettier": ["error", {"semi": false, "trailingComma": "es5", "singleQuote": true}],
"prettier/prettier": [
"error",
{ "semi": false, "trailingComma": "es5", "singleQuote": true }
],
"react/destructuring-assignment": [0],
"react/function-component-definition": [0],
"react/jsx-curly-brace-presence": [0],
"react/jsx-props-no-spreading": [0],
"react/no-unused-prop-types": [0],
"react/require-default-props": [0],
"react/button-has-type": [0]
Expand Down
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[ignore]
<PROJECT_ROOT>/types/.*
<PROJECT_ROOT>/node_modules/resolve/.*

[include]

Expand All @@ -8,4 +9,4 @@
[options]
suppress_comment=\\(.\\|\n\\)*\\$ExpectError

[lints]
[lints]
28 changes: 14 additions & 14 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"lib/packages/recompose/dist/Recompose.umd.js": {
"bundled": 46425,
"minified": 16484,
"gzipped": 4625
"Recompose.umd.js": {
"bundled": 45973,
"minified": 16406,
"gzipped": 4670
},
"lib/packages/recompose/dist/Recompose.min.js": {
"bundled": 42863,
"minified": 15204,
"gzipped": 4194
"Recompose.min.js": {
"bundled": 42948,
"minified": 15146,
"gzipped": 4234
},
"lib/packages/recompose/dist/Recompose.esm.js": {
"bundled": 32428,
"minified": 15083,
"gzipped": 3550,
"Recompose.esm.js": {
"bundled": 32600,
"minified": 15285,
"gzipped": 3604,
"treeshaked": {
"rollup": {
"code": 310,
"import_statements": 310
"code": 283,
"import_statements": 283
},
"webpack": {
"code": 1838
Expand Down
48 changes: 22 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
"prepush": "yarn test"
},
"jest": {
"testEnvironment": "jsdom",
"testMatch": [
"<rootDir>/src/**/__tests__/**/*-test.js"
],
"coverageReporters": [
"text-summary",
"lcov"
],
"setupTestFrameworkScriptFile": "<rootDir>/scripts/jest.setup.js"
"setupFilesAfterEnv": ["<rootDir>/scripts/jest.setup.js"]
},
"lint-staged": {
"*.js": [
Expand All @@ -43,54 +44,49 @@
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^22.4.3",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^4.0.0",
"babel-jest": "^27.5.1",
"baconjs": "^0.7.84",
"chalk": "^1.1.1",
"chalk": "^4.0.0",
"change-case": "^2.3.1",
"codecov": "^1.0.1",
"codecov": "^3.8.3",
"create-react-class": "^15.5.0",
"cross-env": "^4.0.0",
"enzyme": "^3.3.0",
"eslint": "^5.3.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-prettier": "^2.0.1",
"eslint-plugin-react": "^7.10.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^8.10.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.3",
"flow-bin": "^0.72.0",
"flyd": "^0.2.4",
"husky": "^0.13.3",
"jest": "^22.4.3",
"jest": "^27.5.1",
"kefir": "^3.2.3",
"lint-staged": "^3.4.0",
"most": "^1.0.2",
"prettier": "^1.2.2",
"prettier": "^2.5.1",
"prop-types": "^15.6.1",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"readline-sync": "^1.2.21",
"rollup": "^0.65.0",
"rollup-plugin-babel": "^4.0.1",
"rollup-plugin-commonjs": "^9.1.6",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-size-snapshot": "^0.6.1",
"rollup-plugin-uglify": "^4.0.0",
"rollup": "^2.69.1",
"rollup-plugin-size-snapshot": "^0.12.0",
"rollup-plugin-terser": "^7.0.2",
"rx": "^4.1.0",
"rxjs": "^5.0.0",
"shelljs": "^0.6.0",
"sinon": "^1.17.1",
"webpack": "^2.4.1",
"xstream": "^5.0.5"
},
"devEngines": {
"node": "5.x",
"npm": "3.x"
},
"dependencies": {
"enzyme-adapter-react-16": "^1.1.1"
}
}
3 changes: 0 additions & 3 deletions scripts/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable */
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000

import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'

Expand Down
13 changes: 7 additions & 6 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ try {

log('Copying additional project files...')
const additionalProjectFiles = ['README.md', '.npmignore']
additionalProjectFiles.forEach(filename => {
additionalProjectFiles.forEach((filename) => {
const src = path.resolve(sourceDir, filename)

if (!test('-e', src)) return
Expand All @@ -104,11 +104,12 @@ try {
})

log('Generating package.json...')
const packageConfig = Object.assign(
{ name: packageName, version: nextVersion },
require(BASE_PACKAGE_LOC),
require(path.resolve(sourceDir, 'package.json'))
)
const packageConfig = {
name: packageName,
version: nextVersion,
...require(BASE_PACKAGE_LOC),
...require(path.resolve(sourceDir, 'package.json')),
}

writeFile(
path.resolve(outDir, 'package.json'),
Expand Down
27 changes: 17 additions & 10 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import path from 'path'
import nodeResolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs'
import { uglify } from 'rollup-plugin-uglify'
import nodeResolve from '@rollup/plugin-node-resolve'
import babel from '@rollup/plugin-babel'
import replace from '@rollup/plugin-replace'
import commonjs from '@rollup/plugin-commonjs'
import { sizeSnapshot } from 'rollup-plugin-size-snapshot'
import { terser } from 'rollup-plugin-terser'
import { pascalCase } from 'change-case'

const { PACKAGES_SRC_DIR, PACKAGES_OUT_DIR } = require('./getPackageNames')
Expand All @@ -17,11 +17,11 @@ const input = `./${path.join(PACKAGES_SRC_DIR, packageName, 'index.js')}`

const outDir = path.join(PACKAGES_OUT_DIR, packageName, 'dist')

const isExternal = id => !id.startsWith('.') && !id.startsWith('/')
const isExternal = (id) => !id.startsWith('.') && !id.startsWith('/')

const getBabelOptions = ({ useESModules }) => ({
exclude: '**/node_modules/**',
runtimeHelpers: true,
babelHelpers: 'runtime',
plugins: [['@babel/transform-runtime', { useESModules }]],
})

Expand All @@ -43,8 +43,12 @@ export default [
nodeResolve(),
babel(getBabelOptions({ useESModules: true })),
commonjs(),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('development'),
}),
sizeSnapshot({ matchSnapshot }),
terser(),
],
},

Expand All @@ -63,9 +67,12 @@ export default [
nodeResolve(),
babel(getBabelOptions({ useESModules: true })),
commonjs(),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
sizeSnapshot({ matchSnapshot }),
uglify(),
terser(),
],
},

Expand Down
9 changes: 4 additions & 5 deletions src/packages/recompose-relay/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
recompose-relay
===============
# recompose-relay

[![npm version](https://img.shields.io/npm/v/recompose-relay.svg?style=flat-square)](https://www.npmjs.com/package/recompose-relay)

Expand Down Expand Up @@ -38,8 +37,8 @@ const Post = compose(
name
}
}
`
}
`,
},
}),
flattenProp('post')
)(({ title, content, author }) => (
Expand All @@ -48,5 +47,5 @@ const Post = compose(
<h2>By {author.name}</h2>
<div>{content}</div>
</article>
));
))
```
2 changes: 1 addition & 1 deletion src/packages/recompose-relay/createContainer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Relay from 'react-relay'
import { toClass } from 'recompose'

const createContainer = options => BaseComponent =>
const createContainer = (options) => (BaseComponent) =>
Relay.createContainer(toClass(BaseComponent), options)

export default createContainer
3 changes: 1 addition & 2 deletions src/packages/recompose/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
recompose
=========
# recompose

[![npm version](https://img.shields.io/npm/v/recompose.svg?style=flat-square)](https://www.npmjs.com/package/recompose)

Expand Down
24 changes: 12 additions & 12 deletions src/packages/recompose/__tests__/branch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@ test('branch tests props and applies one of two HoCs, for true and false', () =>
const SayMyName = compose(
withState('isBad', 'updateIsBad', false),
branch(
props => props.isBad,
(props) => props.isBad,
withProps({ name: 'Heisenberg' }),
withProps({ name: 'Walter' })
)
)(({ isBad, name, updateIsBad }) =>
)(({ isBad, name, updateIsBad }) => (
<div>
<div className="isBad">
{isBad ? 'true' : 'false'}
</div>
<div className="name">
{name}
</div>
<button onClick={() => updateIsBad(b => !b)}>Toggle</button>
<div className="isBad">{isBad ? 'true' : 'false'}</div>
<div className="name">{name}</div>
<button onClick={() => updateIsBad((b) => !b)}>Toggle</button>
</div>
)
))

expect(SayMyName.displayName).toBe('withState(branch(Component))')

Expand All @@ -45,7 +41,7 @@ test('branch defaults third argument to identity function', () => {

const BranchedComponent = branch(
() => false,
() => props => <Left {...props} />
() => (props) => <Left {...props} />
)(Right)

const wrapper = mount(<BranchedComponent />)
Expand All @@ -58,7 +54,11 @@ test('branch third argument should not cause console error', () => {
const error = sinon.stub(console, 'error')
const Component = () => <div className="right">Component</div>

const BranchedComponent = branch(() => false, v => v, v => v)(Component)
const BranchedComponent = branch(
() => false,
(v) => v,
(v) => v
)(Component)

mount(<BranchedComponent />)

Expand Down
5 changes: 1 addition & 4 deletions src/packages/recompose/__tests__/componentFromProp-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ test('componentFromProp creates a component that takes a component as a prop and
const Container = componentFromProp('component')
expect(Container.displayName).toBe('componentFromProp(component)')

const Component = ({ pass }) =>
<div>
Pass: {pass}
</div>
const Component = ({ pass }) => <div>Pass: {pass}</div>

const wrapper = mount(<Container component={Component} pass="through" />)
const div = wrapper.find('div')
Expand Down
Loading