Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
fa4424f
move console run into consoleCalculator.ts
Apr 2, 2023
3be0348
update script
Apr 2, 2023
7efe286
add react to webpack
Apr 2, 2023
ac2527d
add storybook
Apr 2, 2023
3bec9a5
update storybook default files by eslint
Apr 2, 2023
03e07df
add eslint plugins
Apr 2, 2023
d7981e6
add jest coverage
Apr 2, 2023
7a88044
add tests for full coverage
Apr 2, 2023
cc2d6a9
Merge branch 'master' into second-dz-add-react-components-to-calculator
Apr 18, 2023
f31f888
add coverage
Apr 18, 2023
8707d53
add Calculator.tsx
Apr 18, 2023
c94659a
add Calculator.stories.tsx
Apr 18, 2023
52f2f9f
add Button.tsx
Apr 18, 2023
e59127b
add click
Apr 18, 2023
a7a9261
update config quotes
Apr 19, 2023
61c0360
save changes
May 21, 2023
87a3aea
add alert for number
May 21, 2023
f8b82b0
fix quotes in style
May 21, 2023
3abeef0
add component with state
May 25, 2023
e36fa27
save progress
Jun 13, 2023
c1d1752
add coverage to gitignore
Jun 13, 2023
76aad53
add idea to gitignore
Jun 13, 2023
69c7450
add coverage badger
Jun 13, 2023
849babe
add coverage badger in pull request
Jun 13, 2023
9f92f87
update request template
Jun 13, 2023
caee369
add badge
Jun 13, 2023
3308147
update badge
Jun 13, 2023
4beabda
update node yml
Jun 13, 2023
6fa9a3f
up
Jun 13, 2023
3e27944
up
Jun 13, 2023
73265e2
up
Jun 13, 2023
2e4f913
up
Jun 13, 2023
f4325ad
up
Jun 13, 2023
d223405
up
Jun 13, 2023
9af9c4c
up
Jun 13, 2023
98fda37
up
Jun 13, 2023
7784d67
up
Jun 13, 2023
c307038
up
Jun 13, 2023
c1d9fb7
up
Jun 13, 2023
e00f93f
up
Jun 13, 2023
ae047e2
up
Jun 13, 2023
94f31ff
up
Jun 13, 2023
703d0fe
up
Jun 13, 2023
7c821ba
up
Jun 13, 2023
71fe81f
Merge branch 'master' into second-dz-add-react-components-to-calculator
Jun 13, 2023
c041fe3
up
Jun 13, 2023
4699678
up
Jun 13, 2023
a843f72
up
Jun 13, 2023
21b3dbb
up
Jun 13, 2023
47bb174
up
Jun 13, 2023
2546942
up
Jun 13, 2023
a8c9502
up
Jun 13, 2023
cea7a67
up
Jun 13, 2023
d74a9f9
up
Jun 13, 2023
336dddb
up
Jun 13, 2023
b078d70
up
Jun 13, 2023
7847e0e
add react testing library
Jun 14, 2023
70dbaca
add Calculator snapshot
Jun 14, 2023
2543f61
add snapshots
Jun 14, 2023
609fc40
add Calculator test
Jun 14, 2023
c37ec48
add Button test
Jun 14, 2023
a2a1cfb
add build
Jun 14, 2023
af5fec5
add chromatic
Jun 14, 2023
cc9990f
add files
Jun 14, 2023
46d696d
Merge branch 'second-dz-add-react-components-to-calculator' into dz-c…
Jun 15, 2023
a546ae7
add state counter
Jun 15, 2023
e408942
add todos
Jun 15, 2023
f3ed45f
add handle click
Jun 15, 2023
56a60b3
add stories
Jun 15, 2023
31488c9
add components
Jun 19, 2023
557e3f0
refactor: send function
Jun 20, 2023
dee1698
create data file loader
Jun 21, 2023
410828a
add fix by comments
Jun 21, 2023
b96c4d1
add clover.xml
Jun 21, 2023
3d7db4c
update docs
Jun 21, 2023
efd71ce
Merge branch 'dz-lesson-16' into dz-lesson-18-patterns
Jun 21, 2023
9cef8e3
show xhprof & tools
Jun 21, 2023
a031006
move to scale change
Jun 22, 2023
31025e1
update scale
Jun 22, 2023
869efd1
update type
Jun 25, 2023
117983b
add router and pages
Jun 25, 2023
ef25cab
add auth page
Jun 25, 2023
2e8b48d
add protected routes
Jun 25, 2023
444da63
add protected routes
Jun 25, 2023
2283746
save redirects
Jun 25, 2023
9c0b8b1
add returned components
Jun 25, 2023
2813c12
save changes
Jun 25, 2023
9b441d3
save changes
Jul 3, 2023
4d33057
Merge branch 'dz-lesson-18-patterns' into dz-lesson-19-react-router
Jul 3, 2023
dc076ef
add auth scenarios tests
Jul 3, 2023
acdb82c
save progress
Jul 11, 2023
bc2a353
add data files
Jul 11, 2023
57ce141
add configs
Jul 11, 2023
0baa578
add files list
Jul 11, 2023
15e6b1a
get files list
Jul 12, 2023
f88f2c3
add store
Jul 12, 2023
cc56c7f
clean components
Jul 12, 2023
8e63a1f
add navigation && FileListElement.tsx
Jul 12, 2023
9ccec3f
load xhprof data to state
Jul 12, 2023
c51950b
create dot file
Jul 12, 2023
1cb6724
add getGrapvizSvg
Jul 12, 2023
7f3b8f9
move graphviz to state
Jul 17, 2023
e6742c3
add svg state
Jul 17, 2023
cb2ca13
save Start.tsx
Jul 17, 2023
ff0ff4a
update Container.tsx
Jul 17, 2023
c4a5d97
add svg params
Jul 17, 2023
34903bc
add Error.tsx
Jul 17, 2023
64e4e14
add reset reducer
Jul 17, 2023
dcb45ff
export components to files
Jul 17, 2023
c8ea431
update keys
Jul 17, 2023
387cf69
save progress
Jul 17, 2023
b7fcb6f
fix Node.tsx
Jul 17, 2023
5975253
add moved
Jul 17, 2023
a9c6197
add slashes
Jul 18, 2023
338830a
add scale block
Jul 18, 2023
3d94a7a
clean updateScale
Jul 18, 2023
ab4921d
add ThresholdBlock.tsx and fix transform
Jul 18, 2023
d9d0482
add ThresholdBlock.tsx and fix transform
Jul 23, 2023
4e84d8f
remove old
Jul 23, 2023
88d48e7
save git ignore
Jul 23, 2023
95cc677
save changes
Jul 23, 2023
d91c3ab
arrange files
Jul 23, 2023
1b9285b
add styles
Jul 23, 2023
341fc5a
save changes
Jul 23, 2023
6373381
add api & types
Jul 23, 2023
6779e9d
refactor xhprof
Jul 23, 2023
ad34a02
update ignore
Jul 23, 2023
8d7c2df
extract Canvas.tsx
Jul 23, 2023
68c91f0
add MouseWrapper
Jul 23, 2023
244e1ba
update
Jul 23, 2023
53cacea
save progress
Jul 23, 2023
455e4d5
add Panel
Jul 23, 2023
ef4fc31
add LoaderWrapper.tsx
Jul 23, 2023
a8ad03c
refactor
Jul 23, 2023
9039b7d
save styles
Jul 23, 2023
1b46dfa
update Node
Jul 23, 2023
0447127
save
Jul 23, 2023
5d011fd
update navigation
Jul 23, 2023
791752a
update navigation
Jul 23, 2023
b580dd1
update navigation
Jul 23, 2023
6933cc6
update navigation
Jul 23, 2023
977532a
fix storybook
Jul 23, 2023
92275d1
update config
Jul 24, 2023
50d0237
rename components
Jul 24, 2023
c35a832
update list
Jul 24, 2023
c018927
update list
Jul 24, 2023
9d6fcf9
update panel
Jul 25, 2023
888ddb6
add empty data file
Jul 25, 2023
886ba81
add tests config
Jul 25, 2023
a397bf0
add tests xhprof
Jul 25, 2023
7d7f665
update tests
Jul 25, 2023
524e696
save xhprof tests
Jul 25, 2023
5ccce24
add expect to xhprof tests
Jul 25, 2023
3cd4427
add expect to xhprof tests
Jul 25, 2023
c91159b
add expect to xhprof tests
Jul 25, 2023
3b8fab0
add expect to xhprof tests
Jul 25, 2023
5cc48de
add expect to xhprof tests
Jul 25, 2023
6ab79ec
add expect to xhprof tests
Jul 25, 2023
d8e1f73
update
Jul 25, 2023
486a600
add Navigation tests
Jul 25, 2023
39475cd
remove axios instance
Jul 25, 2023
7ce1fd0
add test for api
Jul 25, 2023
74c0110
revert workflows
Jul 25, 2023
18cc7ed
update tests
Jul 25, 2023
95e3427
update tests
Jul 25, 2023
1e3c743
update tests
Jul 25, 2023
3ff90fb
fix path
Jul 25, 2023
70f2867
fix style
Jul 25, 2023
d6acea7
add stories
Jul 26, 2023
cb3a89b
add Node story
Jul 26, 2023
9e5d5e9
add stryker and fix import
Jul 26, 2023
7f844e9
update return
Jul 26, 2023
56eafdb
revert docs folder
Jul 26, 2023
30c72a6
add file in docs
Jul 26, 2023
7f193c7
remove badge
Jul 26, 2023
7ece883
update webpack.config.js
Jul 26, 2023
d9de1ae
update webpack.config.js and change imports
Jul 26, 2023
bf298a8
add file for save folder
Jul 26, 2023
4a92dcb
update yml
Jul 26, 2023
28cf45c
add build
Jul 26, 2023
6db0a24
Create static.yml
dmitryplus Jul 26, 2023
5e1df2a
update
Jul 26, 2023
c626c13
update
Jul 26, 2023
21dedc8
update build
Jul 26, 2023
cbea12a
update build
Jul 26, 2023
5bf14a2
update build
Jul 26, 2023
6af0819
update build
Jul 26, 2023
7428862
update by review
Jul 27, 2023
a08e9fb
add upload file
Jul 27, 2023
6eb4836
update build
Jul 27, 2023
d199b8e
update store and fix upload file
Jul 27, 2023
28fa6cb
update build
Jul 27, 2023
a5ccdc0
update README.md
Jul 27, 2023
17a6b57
update README.md
Jul 27, 2023
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
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.history
.vscode
node_modules
docs
dist
*.config.js
src/stories
jestSetupFile.js
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

какие есть причины для исключения эти файлов?

78 changes: 47 additions & 31 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
{
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"parser": "flow",
"printWidth": 80,
"tabWidth": 4,
"useTabs": false
}
],
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "react-hooks"],
"extends": ["airbnb", "prettier", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"sourceType": "module"
},
"settings": {
"import/resolver": {
"node": {
"paths": ["."],
"extensions": [".ts", ".tsx"]
}
],
"@typescript-eslint/no-inferrable-types": 0,

"indent": ["error", 4, {"SwitchCase": 1}]

}
},
"parserOptions": {
"sourceType": "module",
"parser": "babel-eslint",
"ecmaVersion": 2018
"globals": {
"document": true,
"navigator": true,
"cy": true,
"fetch": true,
"requestAnimationFrame": true,
"cancelAnimationFrame": true,
"window": true
},
"env": { "jest": true },
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-unused-vars": "on",
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true, "caughtErrors": "none", "args": "after-used" }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-empty-function": "on",
"prettier/prettier": ["error"],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"no-plusplus": 0,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. хотелось бы в рамках одного файла единообразия (где-то "error", где-то ["error"] , где-то [2,...] - зачем так?

  2. не до конца понятно почему выключены некоторые правила (например no-empty-function, no-unused-vars)

"no-bitwise": 0,
"import/prefer-default-export": 0,
"arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": false }],
"@typescript-eslint/lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
"react/jsx-props-no-spreading": 0,
"import/extensions": 0,
"react/prop-types": 0,
"import/no-unresolved": 0,
"react/jsx-filename-extension": [2, { "extensions": [".ts", ".tsx", ".js", ".jsx"] }],
"react/function-component-definition": 0
}
}
}
82 changes: 82 additions & 0 deletions .github/workflows/_jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
## Sample workflow for building and deploying a Jekyll site to GitHub Pages
#name: Deploy Jekyll with GitHub Pages dependencies preinstalled
#
#on:
# # Runs on pushes targeting the default branch
# push:
# branches: ["master", "project"]
#
# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
#
## Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
#permissions:
# contents: read
# pages: write
# id-token: write
#
## Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
## However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
#concurrency:
# group: "pages"
# cancel-in-progress: false
#
#jobs:
#
## test:
## runs-on: ubuntu-latest
## steps:
## - uses: actions/checkout@v3
## - uses: actions/setup-node@v3
## - name: Install
## run: npm install
## - name: Test and Coverage
## run: npm run coverage
#
# # Build job
## build:
## runs-on: ubuntu-latest
### needs: test
## steps:
## - name: Checkout
## uses: actions/checkout@v3
## - name: Setup Pages
## uses: actions/configure-pages@v3
## - name: Build with Jekyll
## uses: actions/jekyll-build-pages@v1
## with:
## source: ./docs
## destination: ./_site
## - name: Upload artifact
## uses: actions/upload-pages-artifact@v1
#
# # Deployment job
# deploy:
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
## needs: build
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v2
#
## badge:
## runs-on: ubuntu-latest
## needs: deploy
## steps:
## # Your original steps
## - uses: actions/checkout@v3
## - uses: actions/setup-node@v3
## - name: Install
## run: npm install
## - name: Test and Coverage
## run: npm run coverage
##
## # Add this
## - name: Update Coverage Badge
## # GitHub actions: default branch variable
## # https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
## # if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
## uses: we-cli/coverage-badge-action@main
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches: ["project"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -22,30 +22,22 @@ concurrency:
cancel-in-progress: false

jobs:
# Build job
build:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.history
.vscode
node_modules
dist
node_modules/
.idea/
dist/
.jest/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а что это за папка?

.DS_Store

# stryker temp files
.stryker-tmp
4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
4 changes: 0 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
.history
.vscode
node_modules
dist
*.config.js
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "auto",
"printWidth": 120
}
18 changes: 18 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
"stories": [
"../src/Components/*.stories.mdx",
"../src/Components/*.stories.@(js|jsx|ts|tsx)",
"../src/Components/*/*.stories.mdx",
"../src/Components/*/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
'@storybook/preset-scss'
],
"framework": "@storybook/react",
"core": {
"builder": "@storybook/builder-webpack5"
}
}
11 changes: 11 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '!style-loader!css-loader!sass-loader!../src/Styles/index.sass';

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
19 changes: 4 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
# OTUS: React.js Developer, домашние задания Плющенков Дмитрий
[![cov](https://dmitryplus.github.io/otus_react_dz/badges/coverage.svg)](https://github.com/dmitryplus/otus_react_dz/actions)

## Консольный калькулятор:
Используемая конфигурация:
* Babel
* Webpack
* Typescript
* Eslint
* Jest
* Prepush hooks / husky

## Запуск в консоли
# Xhprof React Graph

`npm run calc`

Возможные операции: * / + - ( )
Рабочий вариант проекта доступен по адресу

## Запуск тестов

`npm run test`
https://dmitryplus.github.io/otus_react_dz/
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-react',
'@babel/preset-typescript'
]
};
Loading