Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 6 of project seed #113

Merged
merged 6 commits into from
Mar 23, 2023
Merged
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
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"test": {
"presets": ["@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
},
"plugins": ["babel-plugin-styled-components"]
}
70 changes: 59 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"parser": "@babel/eslint-parser", // Specifies the ESLint parser
"parser": "@babel/eslint-parser",
"plugins": [
"react",
"react-hooks",
"inclusive-language",
"jest",
"import",
"fp"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:jest/recommended"
],
"settings": {
"react": {
Expand All @@ -15,13 +24,13 @@
"node": true,
"es6": true
},
"plugins": ["react", "react-hooks", "inclusive-language"],
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
"@babel/preset-react",
"@babel/preset-typescript"
]
},
"ecmaFeatures": {
Expand All @@ -31,8 +40,16 @@
"sourceType": "module" // Allows for the use of imports
},
"rules": {
"prettier/prettier": ["error", {"semi": true, "singleQuote": true, "jsxSingleQuote": true, "parser": "flow"}],
"inclusive-language/use-inclusive-words": "error",
"prettier/prettier": [
2,
{
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"parser": "flow"
}
],
"inclusive-language/use-inclusive-words": 2,
"semi": [2, "always"],
"jsx-quotes": [2, "prefer-single"],
"no-console": 2,
Expand All @@ -41,16 +58,20 @@
"no-dupe-else-if": 0,
"no-setter-return": 0,
"prefer-promise-reject-errors": 0,
"import/order": 2,
"react/button-has-type": 2,
"react/default-props-match-prop-types": 2,
"react/jsx-closing-bracket-location": 2,
"react/jsx-closing-tag-location": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-curly-newline": 2,
"react/jsx-equals-spacing": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline"}],
"react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline" }],
"react/jsx-first-prop-new-line": 2,
"react/jsx-curly-brace-presence": [2, { "props": "never", "children": "never" }],
"react/jsx-curly-brace-presence": [
2,
{ "props": "never", "children": "never" }
],
"react/jsx-pascal-case": 2,
"react/jsx-props-no-multi-spaces": 2,
"react/jsx-tag-spacing": [2, { "beforeClosing": "never" }],
Expand All @@ -64,7 +85,34 @@
"react/sort-comp": 2,
"react/style-prop-object": 2,
"react/void-dom-elements-no-children": 2,
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
}
"react/function-component-definition": [
2,
{ "namedComponents": ["function-declaration", "arrow-function"] }
],
"react-hooks/rules-of-hooks": 2, // Checks rules of Hooks
"react-hooks/exhaustive-deps": 1, // Checks effect dependencies
"fp/no-mutating-methods": 1
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint"],
"rules": {
"prettier/prettier": 0,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-non-null-assertion": 0
},
// Weird behavior with no-unused-vars
// See https://stackoverflow.com/a/58513127
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
]
}
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- -----------^ Click "Preview" for a functional view! -->

## Why are you creating this Pull Request?

- [Version Release](?title=Deploy%20vX.X.X&expand=1&template=version_release.md)
- [Other](?expand=1&template=default.md)
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## What am I changing and why

_Replace with brief description of the update and why it is needed. Link to relevant issues._

## How to test
_Replace with instructions on how this change be tested/verified._
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/version_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_The PR name should be the version to be deployed (ex: v1.0.1)_

- [ ] Bump the version in the package.json or equivalent.

---

# Changelog vX.X.X

## 🎉 Features
-

## 🚀 Improvements
-

## 🐛 Fixes
-
2 changes: 1 addition & 1 deletion .github/_workflow-samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This workflow assumes that the site is served from the root of the URL (eg. devs

```
- name: Build
run: BASEURL="https://devseed.com/explorer" yarn build
run: PUBLIC_URL="https://devseed.com/explorer" yarn build

- name: Serve site from subpath
run: |
Expand Down
16 changes: 8 additions & 8 deletions .github/_workflow-samples/deploy-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'main'

env:
NODE: 16
NODE: 18
DEPLOY_BUCKET:

jobs:
Expand All @@ -18,27 +18,27 @@ jobs:

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Cache dist
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-dist
with:
path: dist
Expand All @@ -56,10 +56,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Restore dist cache
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-dist
with:
path: dist
Expand Down
18 changes: 9 additions & 9 deletions .github/_workflow-samples/deploy-surge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'main'

env:
NODE: 16
NODE: 18
SURGE_DOMAIN:

jobs:
Expand All @@ -18,27 +18,27 @@ jobs:

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Cache dist
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-dist
with:
path: dist
Expand All @@ -56,17 +56,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Restore node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}

- name: Restore dist cache
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-dist
with:
path: dist
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- ready_for_review

env:
NODE: 16
NODE: 18

jobs:
prep:
Expand All @@ -27,20 +27,20 @@ jobs:

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
Expand All @@ -55,15 +55,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
Expand All @@ -81,15 +81,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
17 changes: 14 additions & 3 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"extends": [
"stylelint-config-recommended"
"stylelint-config-standard",
"stylelint-config-styled-components"
],
"customSyntax": "postcss-styled-syntax",
"rules": {
"font-family-no-missing-generic-family-keyword": null
}
"font-family-no-missing-generic-family-keyword": null,
"no-descending-specificity": [
true,
{
"severity": "warning"
}
]
},
"ignoreFiles": [
"**/*.d.ts"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Development Seed
Copyright (c) 2023 Development Seed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading