Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'develop' into feature/reminders
  • Loading branch information
tdemin committed Jan 5, 2020
2 parents 81d4e32 + 70f5f77 commit f185436
Show file tree
Hide file tree
Showing 52 changed files with 3,585 additions and 2,253 deletions.
21 changes: 8 additions & 13 deletions .drone.yml
Expand Up @@ -9,8 +9,10 @@ steps:
commands:
- node -v
- yarn install
- yarn run eslint src
- yarn lint
when:
event:
- push
branch:
exclude:
- master
Expand All @@ -24,16 +26,9 @@ steps:
repo: registry.git.tdem.in/amber_web
registry: registry.git.tdem.in
dockerfile: Dockerfile
tags:
- ${DRONE_TAG}
- latest
when:
branch:
exclude:
- develop
- backend
- feature/*

trigger:
event:
- push
- tag
- promote
- rollback
event:
- tag
173 changes: 145 additions & 28 deletions .eslintrc.json
@@ -1,28 +1,145 @@
{
"extends": "react-app",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": "error",
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"quotes": ["warn", "double"],
"max-len": [
"error",
{
"code": 80,
"tabWidth": 4
}
]
}
}
{
// Thanks, BoresXP@github.com !
// https://gist.github.com/BoresXP/e404f16a0e153eeb6ce15ce06848f36e
"extends": ["react-app"],
"parserOptions": {
"project": "tsconfig.json",
"tsconfigRootDir": ".",
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"semi": "error",
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"quotes": ["warn", "double"],
"max-len": [
"error",
{
"code": 80,
"tabWidth": 4
}
],
"no-shadow": ["error", { "builtinGlobals": false }],
"no-duplicate-imports": ["error", { "includeExports": true }],
"no-template-curly-in-string": "error",
"block-scoped-var": "error",
"curly": ["error", "all"],
"eqeqeq": "error",
"max-classes-per-file": ["error", 2],
"no-alert": "warn",
"no-console": "warn",
"no-else-return": ["error", { "allowElseIf": false }],
"no-implicit-coercion": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-multi-spaces": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"prefer-promise-reject-errors": "error",
"no-undefined": "error",
"array-bracket-newline": ["error", { "multiline": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-style": "error",
"eol-last": "error",
"key-spacing": "error",
"keyword-spacing": "error",
"new-parens": "error",
"no-bitwise": "warn",
"no-lonely-if": "warn",
"no-multiple-empty-lines": "error",
"no-nested-ternary": "error",
"no-new-object": "error",
"no-tabs": ["error", { "allowIndentationTabs": true }],
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": "error",
"object-curly-spacing": ["error", "always"],
"semi-spacing": "error",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": ["error", "always"],
"switch-colon-spacing": "error",
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"generator-star-spacing": ["error", "after"],
"no-confusing-arrow": "error",
"no-useless-computed-key": "error",
"no-useless-rename": "error",
"object-shorthand": ["error", "always"],
"prefer-arrow-callback": "warn",
"prefer-destructuring": "error",
"rest-spread-spacing": ["error", "never"],
"template-curly-spacing": "error",
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/no-magic-numbers": [
"error",
{
"ignoreNumericLiteralTypes": true,
"ignoreEnums": true,
"enforceConst": true,
"ignoreReadonlyClassProperties": true,
"ignore": [0, 1, 2]
}
],
"@typescript-eslint/brace-style": ["error", "1tbs"],
"@typescript-eslint/quotes": [
"error",
"double",
{ "avoidEscape": true }
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never" }],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_$" }
],
"react/no-access-state-in-setstate": "error",
"react/no-danger": "error",
"react/no-this-in-sfc": "error",
"react/prefer-stateless-function": "error",
"react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
"react/jsx-no-bind": "error",
"react/jsx-no-literals": "warn",
"react/jsx-pascal-case": "error"
}
}
22 changes: 21 additions & 1 deletion .vscode/settings.json
Expand Up @@ -4,5 +4,25 @@
"files.insertFinalNewline": true,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.formatOnSave": true
"editor.formatOnSave": true,
"eslint.run": "onSave",
"eslint.autoFixOnSave": false,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
}
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -8,6 +8,7 @@ RUN yarn install

COPY public /app/public
COPY src /app/src
ARG REACT_APP_APIURI=https://amber.h.tdem.in/api/v0
RUN yarn build

FROM nginx:1.16-alpine AS release
Expand Down
38 changes: 38 additions & 0 deletions README.md
@@ -0,0 +1,38 @@
## Amber Web

The web client for [Project Amber](/tdemin/amber), made with React,
Redux, and TypeScript.

#### Running the app locally

###### Development

Simply run:

% yarn install --dev
% yarn start

Set the `REACT_APP_APIURI` environment variable in case you're testing against
a local server. It should point to the base URI for all API requests, namely
`https://amber.h.tdem.in/api`.

###### Docker

Run:

% docker build . -t amber_web
% docker run -it -p 8080:80 amber_web

If you're running your own API server, be sure to set the
`REACT_APP_APIURI` flag when building:

% docker build . -t amber_web --build-arg REACT_APP_APIURI=https://your.tld/api

#### Development

The source code of this app is formatted automatically with Prettier. Be sure
to run `yarn beautify` and `yarn lint` before sending a pull request!

#### License

This program is MIT-licensed. See [LICENSE.txt](LICENSE.txt) for details.
38 changes: 19 additions & 19 deletions package.json
@@ -1,39 +1,39 @@
{
"name": "amber_web",
"version": "0.0.1",
"version": "0.0.8",
"private": true,
"dependencies": {
"@types/jest": "24.0.18",
"@types/node": "12.7.2",
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"@types/react-redux": "^7.1.2",
"@types/react-router-dom": "^4.3.5",
"@types/jest": "^24.X",
"@types/node": "^12.12.21",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"@types/react-redux": "^7.1.5",
"@types/react-router-dom": "^5.1.3",
"axios": "^0.19.0",
"bulma": "^0.7.5",
"node-sass": "^4.12.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"bulma": "^0.8.0",
"node-sass": "^4.13.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-localization": "^1.0.15",
"react-redux": "^7.1.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.2",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"redux": "^4.0.4",
"redux-devtools-extension": "^2.13.8",
"redux-persist": "^5.10.0",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"typescript": "3.5.3"
"typescript": "3.7.4"
},
"devDependencies": {
"eslint": "^6.2.2",
"prettier": "^1.18.2"
"eslint": "^6.8.0",
"prettier": "^1.19.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"beautify": "prettier --write src/**",
"beautify": "prettier --write src/**/*.tsx src/**/*.ts",
"lint": "eslint src/**/*.ts src/**/*.tsx"
},
"browserslist": {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="theme-color" content="#ffffff" />
<meta
name="description"
content="Amber Web, a task list app."
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Expand Up @@ -20,6 +20,6 @@
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"theme_color": "#ffffff",
"background_color": "#ffffff"
}

0 comments on commit f185436

Please sign in to comment.