Skip to content

Commit

Permalink
Merge pull request #1184 from ONEARMY/master
Browse files Browse the repository at this point in the history
v1.5
  • Loading branch information
chrismclarke authored Jul 6, 2021
2 parents 900cc63 + c314978 commit ebcd806
Show file tree
Hide file tree
Showing 282 changed files with 46,183 additions and 33,301 deletions.
405 changes: 405 additions & 0 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_PLATFORM_VERSION=$npm_package_version
FAST_REFRESH=false
27 changes: 20 additions & 7 deletions .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
// https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project

{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
"prettier" // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"prettier/prettier": "warn",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-use-before-define": "off",
"no-useless-escape": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/camelcase": "warn",
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
// NOTE - typings throughout the platform are fairly inconsistent, hence the wide range of rules
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
{
"selector": "classMethod",
"format": ["camelCase"],
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/no-deprecated": "warn",
"react/no-unescaped-entities": "off",
"react/jsx-no-target-blank": "warn",
"react/display-name": "warn",
// as of v17 no longer required
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-empty-interface": "off",
"react/prop-types": "off",
"react/no-unknown-property": "warn",
"@typescript-eslint/no-var-requires": "off",
Expand Down
23 changes: 16 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
PR Checklist

- [ ] - Latest `master` branch merged
- [ ] - PR title descriptive (can be used in release notes)

PR Type

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

PR Checklist

- [ ] - Latest `master` branch merged
- [ ] - PR title descriptive (can be used in release notes)
- [ ] - Passes Tests

## Description

_What this PR does_

## Git Issues

_Closes #_
Closes #

## Screenshots/Videos

_If useful, provide screenshot or capture to highlight main changes_

---

## What happens next?

Thanks for the contribution! We try to make sure all PRs are reviewed ahead of a monthly dev call (first Monday of the month, open to all!).

If the PR is working as intended it'll be merged and included in the next platform release, if not changes will be requested and re-reviewed once updated.

If you need more immediate feedback you can try reaching out on slack in the `platform-dev` channel.
21 changes: 14 additions & 7 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
types: [labeled, synchronize]
# Only create a preview if changes have been made to the main src code or backend functions
paths:
- 'src/**'
- 'functions/**'
- "src/**"
- "functions/**"
jobs:
build_and_preview:
# NOTE - as we are going to check out and build from forks we also need to add manual
Expand All @@ -22,13 +22,20 @@ jobs:
with:
# pull the repo from the pull request source, not the default local repo
ref: ${{ github.event.pull_request.head.sha }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# Setup yarn 2 cache: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Setup Cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install npm dependencies
run: yarn install
run: yarn install --immutable
- name: Build for Preview
run: npm run build
env:
Expand All @@ -39,9 +46,9 @@ jobs:
REACT_APP_SITE_VARIANT: preview
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
repoToken: "${{ secrets.GITHUB_TOKEN }}"
# the details of the service account need to be populated to github secrets
# these must match the target projectId account
firebaseServiceAccount: '${{ secrets.ONEARMY_NEXT_FIREBASE_SERVICE_ACCOUNT }}'
firebaseServiceAccount: "${{ secrets.ONEARMY_NEXT_FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d
projectId: onearmy-next
15 changes: 11 additions & 4 deletions .github/workflows/reset-staging-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Reset Staging Site
on:
# Run weekly on a Sunday at 02:00
schedule:
- cron: '0 0 * * SUN'
- cron: "0 0 * * SUN"
# Allow the script to be triggered directly from GitHub
workflow_dispatch:
jobs:
Expand All @@ -21,13 +21,20 @@ jobs:
uses:
google-github-actions/setup-gcloud@master
# skipping setting a service account here as we'll load from json during script
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# Setup yarn 2 cache: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Setup Cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install npm dependencies
run: yarn install
run: yarn install --immutable
- name: Install global dependencies
run: npm i -g firebase-tools ts-node
- name: Populate service account json
Expand Down
17 changes: 11 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules

# testing
/coverage
cypress/videos
cypress/coverage
cypress/screenshots
cypress/fixtures/seed/*.rej
cypress/build

functions/service.json
functions/backup.json

Expand Down Expand Up @@ -37,4 +33,13 @@ yarn-error.log*
functions/firebase-debug.log
.env-*

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

*.tsbuildinfo
2 changes: 0 additions & 2 deletions .storybook/addons.js

This file was deleted.

17 changes: 0 additions & 17 deletions .storybook/config.js

This file was deleted.

8 changes: 0 additions & 8 deletions .storybook/presets.js

This file was deleted.

19 changes: 0 additions & 19 deletions .storybook/webpack.config.js

This file was deleted.

21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
###############################################################################################################
# DEPRECATED
# Previously we used travis-ci for all builds, but now use circlci
# Code is retained mostly for reference and will likely need updates in needed again in future
###############################################################################################################

language: node_js
node_js:
- '12'
- "12"
dist: xenial
cache:
# cache both yarn (.cache) and npm (for global installs)
# cache yarn cache and cypress binary
yarn: true
directories:
- ./.yarn/cache
- ~/.cache
- ~/.npm
addons:
chrome: stable
firefox: latest
Expand All @@ -25,12 +31,16 @@ env:
- DEBUG=True
- MOZ_HEADLESS=1
install:
- yarn install --frozen-lockfile --silent
# fix ENOSPC: System limit for number of file wathcers reached bug
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- yarn install --immutable
# add the current github branch as an environment variable
before_script:
- echo "MATRIX=$MATRIX_VAR"
- export REACT_APP_BRANCH=$TRAVIS_BRANCH
- echo "REACT_APP_BRANCH=$REACT_APP_BRANCH"
- export CI_BUILD_ID=$TRAVIS_BUILD_ID
- echo "CI_BUILD_ID=$CI_BUILD_ID"

###############################################################################################################
# E2E Tests (cypress)
Expand All @@ -39,6 +49,8 @@ before_script:
# see https://docs.travis-ci.com/user/build-matrix/#job-uniqueness-and-duplicate-jobs
# and https://medium.com/@tommyvn/travis-yml-dry-with-anchors-8b6a3ac1b027
_test_defaults: &_test_defaults
if: (branch = master OR branch = production) AND type = push
# Skip tests on PRs (currently handled by circleci)
script:
- echo "group=$CI_GROUP browser=$CI_BROWSER"
- export TZ=UTC
Expand All @@ -55,6 +67,7 @@ _predeploy_defaults: &_predeploy_defaults
- export FIREBASE_TOKEN=$(if [ "$TRAVIS_BRANCH" == "production" ]; then echo "$FIREBASE_PRODUCTION_TOKEN"; else echo "$FIREBASE_STAGING_TOKEN"; fi)
# Jobs run in parallel, so split chrome and firefox tests running each across 2 machines.
# CI_NODE var just ensures job env unique (otherwise won't run), others are passed to default script

jobs:
include:
# Test - Run 4 test stages in parallel
Expand Down
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-2.4.1.cjs

Large diffs are not rendered by default.

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

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

yarnPath: .yarn/releases/yarn-2.4.1.cjs

# Default do not hoist to a shared node_modules folder
# Whilst less efficient it generally helps prevent conflicts etc.
nmHoistingLimits: "workspaces"
56 changes: 56 additions & 0 deletions BOUNTIES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Feature Bounties
As a way of saying thanks to developers for their time, we've implemented a small bounty system to reward feature development.

## How much are they?
We currently have 3 bounty levels

| Level | Amount | It should take... | E.g. |
|---|---|---|---|
| 1 | €20 | Roughly 1-2 hours work for a junior/intermediate developer | Small bugfixes, UI tweaks |
| 2 | €40 | Roughly 3-5 hours work for an intermediate/senior developer | Minor feature, e.g. Howto search |
| 3 | €85 | Roughly 6+ hours work for a more senior developer | Major feature, e.g. Research module |

----

## How do I find bounty issues?
Simply go to the `Issues` page on github and look for issues with labelled with [Bounty](https://github.com/ONEARMY/community-platform/labels/bounty).

_Note_ - the exact bounty level is not included as knowing in advance how much work will be involved is hard! Instead we assign levels collectively on the monthly developer call.

----

## How do I claim them?

### Step 1 - Assigned the issue
Drop a message in the issue thread to say that you are interested taking it on. If the issue is already assigned, or we think it might be too much for a new or individual contributor we might suggest looking at other issues instead. Otherwise it's all yours :D

### Step 2 - Do the work
Once assigned try to complete the issue within the next month. Once complete make a PR, which will get reviewed and merged (maybe with some minor edits requested, or new issues created for future dev work)

### Step 3 - Register on open collective
We handle payments through [Open Collective](https://opencollective.com/onearmy). Follow the link and register as a contributor to the project. You can add your paypal or bank details there which will be used to

### Step 4 - (optional) Join our monthly dev call
If you want more feedback on the issue or suggested bounty levels, we have a monthly call welcome for all developers to join. After the call we will finalise the bounties and organise the admin.

### Step 5 - Receive payment

----
## What if I don't want the bounty?
No problem, if we haven't heard anything from you we'll just keep a record of the bounty and try reach out to see what you would like done with it.

If you just want the bounty to go back in to the community program we can do that, or if you want the bounty to be contributed to somewhere else (e.g. another charity or social cause) then we can also try make arrangements with you.

---
## What if I want to contribute in other ways?
That's awesome! As well as the bounty system we also encourage anyone interested to join our Core Developers or Maintainers team.

These roles include tasks like:
- Code reviews
- Code quality improvements
- Devops and general optimisations
- Security and general updates
- Documentation
- Issue management

There is a separate hourly payscale for these roles, aimed at developers who help a bit more consistently at around 2-3h per week. If you're interested in these roles then feel free to reach out on slack or during the monthly dev call.
Loading

0 comments on commit ebcd806

Please sign in to comment.