Skip to content

Commit

Permalink
Merge pull request #5489 from reactioncommerce/release-v2.2.0
Browse files Browse the repository at this point in the history
Release v2.2.0
  • Loading branch information
willopez authored Aug 29, 2019
2 parents 746f5ac + 7547e40 commit f1880a2
Show file tree
Hide file tree
Showing 940 changed files with 7,598 additions and 16,905 deletions.
62 changes: 0 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,6 @@ jobs:
command: |
npm run lint -- --quiet
eslint-changed-files:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- reaction-v2-node-modules-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- reaction-v2-node-modules-{{ .Branch }}
- reaction-v2-node-modules-master
- run:
name: Run Lint for Changed Files
command: .circleci/eslint-changed-files.sh

graphql-lint:
<<: *defaults
steps:
Expand Down Expand Up @@ -305,46 +292,6 @@ jobs:
command: |
hadolint Dockerfile
snyk-security:
<<: *defaults
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
keys:
- reaction-v2-node-modules-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- reaction-v2-node-modules-{{ .Branch }}
- reaction-v2-node-modules-master
- run:
name: Snyk Test
command: |
CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" # Determine PR number from pull request link
if [[ -v CIRCLE_PR_NUMBER ]] && [ -n ${CIRCLE_PR_NUMBER} ]; then
url="https://api.github.com/repos/${DOCKER_REPOSITORY}/pulls/$CIRCLE_PR_NUMBER" # Get PR from github API
TARGET_BRANCH=$(curl "$url" | jq '.base.ref' | tr -d '"') # Determine target/base branch from API response
fi
if [ -z "${TARGET_BRANCH}" ] || [ ${TARGET_BRANCH} == "null" ]; then
echo "Not a PR. Skipping Snyk."
exit 0
fi
# If target branch does not exist or is master, run snyk tests
if [ ${TARGET_BRANCH} == "master" ] || [ -z "${TARGET_BRANCH/[ ]*\n/}" ]; then
PATH=$PATH:$CIRCLE_WORKING_DIRECTORY/node_modules/.bin && \
snyk test
else
# If package.json is different from the base branch, run snyk
if git diff origin/$CIRCLE_BRANCH..origin/$TARGET_BRANCH package.json | grep diff; then
echo "package.json different. Running Snyk."
PATH=$PATH:$CIRCLE_WORKING_DIRECTORY/node_modules/.bin && \
snyk test
else
echo "package.json identical to target branch. Skipping Snyk."
fi
fi
workflows:
version: 2
build_and_test:
Expand All @@ -363,16 +310,11 @@ workflows:
- eslint:
requires:
- build
- eslint-changed-files:
requires:
- build
- graphql-lint:
requires:
- build
- docker-build:
context: reaction-build-read
requires:
- snyk-security
- docker-push:
context: reaction-publish-docker
requires:
Expand All @@ -385,7 +327,3 @@ workflows:
filters:
branches:
only: /^master$/
- snyk-security:
context: reaction-validation
requires:
- build
44 changes: 0 additions & 44 deletions .circleci/eslint-changed-files.sh

This file was deleted.

8 changes: 4 additions & 4 deletions .reaction/scripts/appSetup.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Log from "./logger";
import loadPlugins from "./loadPlugins";
import loadStyles from "./loadStyles";
import provisionAssets from "./provisionAssets";
import Log from "./logger.mjs";
import loadPlugins from "./loadPlugins.mjs";
import loadStyles from "./loadStyles.mjs";
import provisionAssets from "./provisionAssets.mjs";

export default function appSetup() {
let start, sec, ns;
Expand Down
2 changes: 1 addition & 1 deletion .reaction/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import appSetup from "./appSetup";
import appSetup from "./appSetup.mjs";

appSetup();
8 changes: 4 additions & 4 deletions .reaction/scripts/fs.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fs from 'fs';
import path from 'path';
import Log from './logger';
import Log from './logger.mjs';

/**
* Synchronously check if a file or directory exists
* @param {String} searchPath - path to file or directory
* @return {Boolean} - returns true if file or directory exists
* @returns {Boolean} - returns true if file or directory exists
*/
export function exists(searchPath) {
try {
Expand All @@ -19,7 +19,7 @@ export function exists(searchPath) {
/**
* Synchronously check if a file or directory is empty or doesn't exist
* @param {String} searchPath - path to file or directory
* @return {Boolean} returns true if file or directory is empty or missing
* @returns {Boolean} returns true if file or directory is empty or missing
*/
export function isEmptyOrMissing(searchPath) {
let stat;
Expand All @@ -40,7 +40,7 @@ export function isEmptyOrMissing(searchPath) {
/**
* Get an array of directory names in a given path
* @param {String} dir - path to a directory
* @return {Array} returns an array of directory names
* @returns {Array} returns an array of directory names
*/
export function getDirectories(dir) {
try {
Expand Down
10 changes: 5 additions & 5 deletions .reaction/scripts/loadPlugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import fs from 'fs';
import path from 'path';
import childProcess from 'child_process';
import _ from 'lodash';
import Log from './logger';
import { exists, getDirectories } from './fs';
import pluginConfig from "../pluginConfig";
import Log from './logger.mjs';
import { exists, getDirectories } from './fs.mjs';
import pluginConfig from "../pluginConfig.js";

// add a message to the top of the plugins import file
const importFileMessage = `
Expand All @@ -19,7 +19,7 @@ const importFileMessage = `
* Create a plugin imports file on client or server
* @param {String} file - absolute path to file to write
* @param {Array} imports - array of import path strings
* @return {Boolean} returns true if no error
* @returns {Boolean} returns true if no error
*/
function generateImportsFile(file, imports) {
// create/reset imports file
Expand All @@ -46,7 +46,7 @@ function generateImportsFile(file, imports) {
/**
* Import Reaction plugins
* @param {String} baseDirPath - path to a plugins sub-directory (core/included/custom)
* @return {Object} - returns object with client, server, and registry path arrays
* @returns {Object} - returns object with client, server, and registry path arrays
*/
function getImportPaths(baseDirPath) {

Expand Down
8 changes: 4 additions & 4 deletions .reaction/scripts/loadStyles.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import path from 'path';
import Log from './logger';
import { exists, getDirectories } from './fs';
import Log from './logger.mjs';
import { exists, getDirectories } from './fs.mjs';

// add a message to the top of the plugins import file
const importFileMessage = `
Expand All @@ -16,7 +16,7 @@ const importFileMessage = `
* Create a plugin imports file on client or server
* @param {String} file - absolute path to file to write
* @param {Array} imports - array of import path strings
* @return {Boolean} returns true if no error
* @returns {Boolean} returns true if no error
*/
function generateImportsFile(file, imports) {
// Don't create a file if there is nothing to import.
Expand Down Expand Up @@ -48,7 +48,7 @@ function generateImportsFile(file, imports) {
/**
* Import Reaction plugins
* @param {String} baseDirPath - path to a plugins sub-directory (core/included/custom)
* @return {Object} - returns object with client, server, and registry path arrays
* @returns {Object} - returns object with client, server, and registry path arrays
*/
function getImportPaths(baseDirPath) {

Expand Down
4 changes: 2 additions & 2 deletions .reaction/scripts/provisionAssets.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs-extra';
import path from 'path';
import rimraf from 'rimraf';
import Log from './logger';
import { exists, getDirectories } from './fs';
import Log from './logger.mjs';
import { exists, getDirectories } from './fs.mjs';


/**
Expand Down
4 changes: 2 additions & 2 deletions .reaction/scripts/run.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Assumes Node 8.x
import _ from "lodash";
import childProcess from "child_process";
import Log from "./logger";
import appSetup from "./appSetup";
import Log from "./logger.mjs";
import appSetup from "./appSetup.mjs";

function run() {
appSetup();
Expand Down
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,102 @@
# v2.2.0

Reaction v2.2.0 adds minor features and performance enhancements, fixes bugs and contains no breaking changes since v2.1.0.

This release is being coordinated with `reaction-platform` and is designed to work with `v2.2.0` of `example-storefront` and `reaction-hydra`.

## Notable changes

### Elimination of all `eslint` warnings

The Reaction code base is now clean of all `eslint` warnings. Going forward, all `eslint` rules have been changed to `error`, and CI will fail if any are present.

### Product filtering by CSV

Admins can filter products by uploading a CSV in the product admin.

### Introduce Apollo hooks

Apollo has been updated to v3.0.0, which introduces GraphQL hooks into Reaction.

### Updated Orders Admin UI

The new Orders UI allows is completely GraphQL based and allows for updates to multiple fulfillment groups on each order.

![image](https://user-images.githubusercontent.com/4482263/63883915-12d30580-c98a-11e9-8484-debd9eda34ab.png)

### Remove Snyk as a CI step

Snyk was unable to work with PR's from forked repositories, which in turn caused every contribution to fail the CI check. We have removed Snyk as a blocking CI check because of this, and will run it locally on a schedule to still see which packages are in need of an update.

## Feature

- feat: add offset for pagination with tests ([#5228](https://github.com/reactioncommerce/reaction/pull/5228))
- feat: bulk actions UI updates ([#5461](https://github.com/reactioncommerce/reaction/pull/5461))
- feat: add refunds GraphQL query ([#5352](https://github.com/reactioncommerce/reaction/pull/5352))
- feat: #5366 show filter count ([#5395](https://github.com/reactioncommerce/reaction/pull/5395))
- feat: #5379 integrate catalyst button ([#5406](https://github.com/reactioncommerce/reaction/pull/5406))
- feat: add bulk mutations to manage products and tags ([#5404](https://github.com/reactioncommerce/reaction/pull/5404))
- feat: remove startup template import ([#5430](https://github.com/reactioncommerce/reaction/pull/5430))
- feat: add new setting to allow / disallow custom user locale lookup ([#5444](https://github.com/reactioncommerce/reaction/pull/5444))
- feat: add isvisible/hidden icons ([#5407](https://github.com/reactioncommerce/reaction/pull/5407))
- feat: Part I: An admin user can filter products by uploaded CSV ([#5451](https://github.com/reactioncommerce/reaction/pull/5451))

## Fixes

- fix: style the product table as close as possible ([#5468](https://github.com/reactioncommerce/reaction/pull/5468))
- fix: console warnings ([#5463](https://github.com/reactioncommerce/reaction/pull/5463))
- fix: update comp-lib to fix broken components ([#5475](https://github.com/reactioncommerce/reaction/pull/5475))
- fix: add check against missing riskLevel field, and missing string in capitalization function ([#5452](https://github.com/reactioncommerce/reaction/pull/5452))
- fix: partial product publish error ([#5433](https://github.com/reactioncommerce/reaction/pull/5433))
- fix: popover z-index ([#5437](https://github.com/reactioncommerce/reaction/pull/5437))
- fix: issues with refund queries ([#5422](https://github.com/reactioncommerce/reaction/pull/5422))
- fix: load account into context during surcharges ([#5466](https://github.com/reactioncommerce/reaction/pull/5466))
- fix: Correct index migration ([#5408](https://github.com/reactioncommerce/reaction/pull/5408))

## Chores

- chore: add redirect for blank route ([#5439](https://github.com/reactioncommerce/reaction/pull/5439))
- chore: update vulnerable packages ([#5470](https://github.com/reactioncommerce/reaction/pull/5470))
- chore: update reaction to use reaction-eslint-rules v2.1.0 ([#5445](https://github.com/reactioncommerce/reaction/pull/5445))
- chore: remove unused shop.appVersion ([#5429](https://github.com/reactioncommerce/reaction/pull/5429))
- chore: update bodyParser to use individual method ([#5435](https://github.com/reactioncommerce/reaction/pull/5435))
- chore: use file extensions for node 12 compatibility ([#5415](https://github.com/reactioncommerce/reaction/pull/5415))
- chore: remove snyk as a CI task ([#5403](https://github.com/reactioncommerce/reaction/pull/5403))
- chore: Update Apollo packages to support hooks ([#5427](https://github.com/reactioncommerce/reaction/pull/5427))
- chore: update catalyst sidebar font and color styles ([#5494](https://github.com/reactioncommerce/reaction/pull/5494))

## Refactors

- refactor: use SplitButton from Catalyst instead of ConrifmButton ([#5469](https://github.com/reactioncommerce/reaction/pull/5469))
- refactor: Rewrite addAccountToGroup to not call through to Meteor method ([#5431](https://github.com/reactioncommerce/reaction/pull/5431))
- refactor: after-publish cart updates for speed ([#5477](https://github.com/reactioncommerce/reaction/pull/5477))
- refactor: order invoice print layout ([#5476](https://github.com/reactioncommerce/reaction/pull/5476))
- refactor: update Reaction Admin Orders panel ([#5158](https://github.com/reactioncommerce/reaction/pull/5158))
- refactor: payments-stripe to only use getStripeInstanceForShop ([#4951](https://github.com/reactioncommerce/reaction/pull/4951))
- refactor: add tag permissions to allow non-owner to edit ([#5436](https://github.com/reactioncommerce/reaction/pull/5436))
- refactor: refunds section of Orders 2.0 ([#5405](https://github.com/reactioncommerce/reaction/pull/5405))
- refactor: move filter outside of admin check ([#5434](https://github.com/reactioncommerce/reaction/pull/5434))
- refactor: use Accounts collection instead of Meteor.users to get admin accounts ([#5432](https://github.com/reactioncommerce/reaction/pull/5432))
- refactor: Remove legacy social plugin, PDP, product grid and WYSIWYG code ([#5394](https://github.com/reactioncommerce/reaction/pull/5394))
- refactor: expanded product admin permissions ([#5428](https://github.com/reactioncommerce/reaction/pull/5428))

## Style

- style: update jsdoc to always use `returns` instead of `return` ([#5447](https://github.com/reactioncommerce/reaction/pull/5447))
- style: ESLint errors and warnings === 0 ([#5450](https://github.com/reactioncommerce/reaction/pull/5450))

## Tests

- test: add integration test for primaryShop query ([#5459](https://github.com/reactioncommerce/reaction/pull/5459))

## Breaking Changes

None

## Contributors

Thanks to @cmbirk, @loan-laux and @rattrayalex-stripe for contributing to this release! 🎉

# v2.1.0

Reaction v2.1.0 adds minor features and performance enhancements, fixes bugs and contains no breaking changes since v2.0.0.
Expand Down
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const fs = require("fs");
* Meteor currently only loads Babel config through .babelrc or package.json. So, in order to support Babel transpiling
* of Jest tests, we load the babel config defined in package.json and export it here.
* See this Github comment: https://github.com/facebook/jest/issues/6053#issuecomment-383632515
* @param {Object} api api data object
* @returns {Object} babel formatted package.json
*/
module.exports = function (api) {
api.cache(false);
Expand Down
Loading

0 comments on commit f1880a2

Please sign in to comment.