Skip to content

Commit

Permalink
Update v7 branch to use Yarn v2 and improve CI process (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Sep 4, 2021
1 parent 099e104 commit c16d3c1
Show file tree
Hide file tree
Showing 15 changed files with 17,752 additions and 64,025 deletions.
6 changes: 6 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sandboxes": ["vanilla", "vanilla-ts"],
"node": "14",
"buildCommand": "build",
"packages": ["."]
}
43 changes: 20 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,36 @@ name: Tests

on:
push:
branches: [ master ]
branches: [master, 7.x]
pull_request:
branches: [ master ]
branches: [master, 7.x]

jobs:
build:
name: Test Suite
runs-on: ubuntu-latest

steps:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Checkout code
uses: actions/checkout@v2

- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: .yarn/cache
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: yarn-

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-
${{ runner.OS }}-
- name: Install dependencies
run: yarn install

- name: Install dependencies
run: npm ci
- name: Run test suite
run: yarn test

- name: Run test suite
run: npm test

- name: Collect coverage
run: npm run coverage
- name: Collect coverage
run: yarn coverage
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ lib
coverage
es

.cache
.yarnrc
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
*.tgz
react-redux-*/

.yalc
yalc.lock
yalc.sig

lib/core/metadata.js
lib/core/MetadataBlog.js

Expand Down
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-compat.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: `@yarnpkg/plugin-compat`,
factory: (require) => {
// we are not using PNP and want to use `typescript@next` in CI without hassle
// dummy implementation to override the built-in version of this plugin
// can be dropped once we switch to yarn 3
return {}
},
}
29 changes: 29 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions .yarn/releases/yarn-berry.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
- path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
spec: '@yarnpkg/plugin-compat'

yarnPath: .yarn/releases/yarn-berry.cjs
41 changes: 28 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Contributing
We are open to, and grateful for, any contributions made by the community. By contributing to React Redux, you agree to abide by the [code of conduct](https://github.com/reduxjs/react-redux/blob/master/CODE_OF_CONDUCT.md).

We are open to, and grateful for, any contributions made by the community. By contributing to React Redux, you agree to abide by the [code of conduct](https://github.com/reduxjs/react-redux/blob/master/CODE_OF_CONDUCT.md).

Please review the [Redux Style Guide](https://redux.js.org/style-guide/style-guide) in the Redux docs to keep track of our best practices.

## Reporting Issues and Asking Questions

Before opening an issue, please search the [issue tracker](https://github.com/reduxjs/react-redux/issues) to make sure your issue hasn't already been reported.

Please ask any general and implementation specific questions on [Stack Overflow with a Redux tag](http://stackoverflow.com/questions/tagged/redux?sort=votes&pageSize=50) for support.
Expand All @@ -13,43 +15,56 @@ Please ask any general and implementation specific questions on [Stack Overflow
Visit the [Issue tracker](https://github.com/reduxjs/react-redux/issues) to find a list of open issues that need attention.

Fork, then clone the repo:

```
git clone https://github.com/your-username/react-redux.git
```

This repository uses Yarn v2 to manage packages. You'll need to have Yarn v1.22 installed globally on your system first, as Yarn v2 depends on that being available first. Install dependencies with:

```
yarn install
```

### Building

Running the `build` task will create both a CommonJS module-per-module build and a UMD build.

```
npm run build
yarn build
```

To create just a CommonJS module-per-module build:

```
npm run build:lib
yarn build:lib
```

To create just a UMD build:

```
npm run build:umd
npm run build:umd:min
yarn build:umd
yarn build:umd:min
```

### Testing and Linting

To run the tests:

```
npm run test
yarn test
```

To continuously watch and run tests, run the following:

```
npm test -- --watch
yarn test --watch
```

To perform linting with `eslint`, run the following:

```
npm run lint
yarn lint
```

### New Features
Expand All @@ -58,11 +73,11 @@ Please open an issue with a proposal for a new feature or refactoring before sta

## Submitting Changes

* Open a new issue in the [Issue tracker](https://github.com/reduxjs/react-redux/issues).
* Fork the repo.
* Create a new feature branch based off the `master` branch.
* Make sure all tests pass and there are no linting errors.
* Submit a pull request, referencing any issues it addresses.
- Open a new issue in the [Issue tracker](https://github.com/reduxjs/react-redux/issues).
- Fork the repo.
- Create a new feature branch based off the `master` branch.
- Make sure all tests pass and there are no linting errors.
- Submit a pull request, referencing any issues it addresses.

Please try to keep your pull request focused in scope and avoid including unrelated commits.

Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
React Redux
=========================
# React Redux

Official React bindings for [Redux](https://github.com/reduxjs/redux).
Performant and flexible.

[![build status](https://img.shields.io/travis/reduxjs/react-redux/master.svg?style=flat-square)](https://travis-ci.org/reduxjs/react-redux) [![npm version](https://img.shields.io/npm/v/react-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-redux)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/reduxjs/react-redux/CI?style=flat-square) [![npm version](https://img.shields.io/npm/v/react-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-redux)
[![npm downloads](https://img.shields.io/npm/dm/react-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-redux)
[![redux channel on discord](https://img.shields.io/badge/discord-redux@reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com)


## Installation

### Using Create React App
Expand All @@ -35,18 +33,17 @@ yarn add react-redux

You'll also need to [install Redux](https://redux.js.org/introduction/installation) and [set up a Redux store](https://redux.js.org/recipes/configuring-your-store/) in your app.

This assumes that you’re using [npm](http://npmjs.com/) package manager
with a module bundler like [Webpack](https://webpack.js.org/) or
[Browserify](http://browserify.org/) to consume [CommonJS
This assumes that you’re using [npm](http://npmjs.com/) package manager
with a module bundler like [Webpack](https://webpack.js.org/) or
[Browserify](http://browserify.org/) to consume [CommonJS
modules](https://webpack.js.org/api/module-methods/#commonjs).

If you don’t yet use [npm](http://npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `ReactRedux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/react-redux). We *don’t* recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](http://npmjs.com/).
If you don’t yet use [npm](http://npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `ReactRedux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/react-redux). We _don’t_ recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](http://npmjs.com/).

## React Native

As of React Native 0.18, React Redux 5.x should work with React Native. If you have any issues with React Redux 5.x on React Native, run `npm ls react` and make sure you don’t have a duplicate React installation in your `node_modules`. We recommend that you use `npm@3.x` which is better at avoiding these kinds of issues.


## Documentation

The React Redux docs are now published at **https://react-redux.js.org** .
Expand All @@ -55,9 +52,9 @@ We're currently expanding and rewriting our docs content - check back soon for m

## How Does It Work?

We do a deep dive on how React Redux works in [this readthesource episode](https://www.youtube.com/watch?v=VJ38wSFbM3A).
We do a deep dive on how React Redux works in [this readthesource episode](https://www.youtube.com/watch?v=VJ38wSFbM3A).

Also, the post [The History and Implementation of React-Redux](https://blog.isquaredsoftware.com/2018/11/react-redux-history-implementation/)
Also, the post [The History and Implementation of React-Redux](https://blog.isquaredsoftware.com/2018/11/react-redux-history-implementation/)
explains what it does, how it works, and how the API and implementation have evolved over time.

Enjoy!
Expand Down
11 changes: 9 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
[build]
base = "website"
publish = "website/build"
command = "npm run build && cp _redirects ./build"
command = "yarn build && cp _redirects ./build"
ignore = "git diff --quiet HEAD^ HEAD -- ../docs/ ."

[build.environment]
NODE_VERSION = "14"
NODE_OPTIONS = "--max_old_space_size=4096"
NETLIFY_USE_YARN = "true"
YARN_VERSION = "1.22.10"


[[plugins]]
package = "netlify-plugin-cache"
[plugins.inputs]
paths = [
"node_modules/.cache",
"website/node_modules/.cache"
"website/node_modules/.cache",
".yarn/.cache"
]

Loading

0 comments on commit c16d3c1

Please sign in to comment.