Skip to content

Commit 48e29b7

Browse files
committed
First version commit
1 parent 1604d06 commit 48e29b7

34 files changed

+9341
-0
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.js
2+
**/*.jsx
3+
node_modules
4+
dist

.eslintrc

+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
{
2+
"extends": [
3+
"airbnb",
4+
"airbnb-typescript",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:eslint-plugin-react/recommended",
7+
"plugin:unicorn/recommended",
8+
"plugin:prettier/recommended"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaFeatures": {
13+
"experimentalObjectRestSpread": true,
14+
"jsx": true
15+
},
16+
"sourceType": "module",
17+
"project": "./tsconfig.json"
18+
},
19+
"env": {
20+
"es6": true,
21+
"browser": true
22+
},
23+
"plugins": [
24+
"@typescript-eslint",
25+
"react",
26+
"react-hooks",
27+
"unicorn",
28+
"simple-import-sort",
29+
"import"
30+
],
31+
"rules": {
32+
"prettier/prettier": [
33+
"error",
34+
{
35+
"printWidth": 135,
36+
"tabWidth": 4,
37+
"trailingComma": "none"
38+
},
39+
{
40+
"usePrettierrc": false
41+
}
42+
],
43+
"max-len": "off",
44+
"curly": [
45+
"error",
46+
"all"
47+
],
48+
"react-hooks/rules-of-hooks": "error",
49+
"react-hooks/exhaustive-deps": "warn",
50+
"react/jsx-filename-extension": [
51+
1,
52+
{
53+
"extensions": [
54+
".tsx"
55+
]
56+
}
57+
],
58+
"import/prefer-default-export": "off",
59+
"import/extensions": [
60+
"error",
61+
"ignorePackages",
62+
{
63+
"ts": "never",
64+
"tsx": "never"
65+
}
66+
],
67+
"import/no-extraneous-dependencies": "off",
68+
"unicorn/filename-case": "off",
69+
"no-use-before-define": "off",
70+
"@typescript-eslint/explicit-module-boundary-types": "off",
71+
"unicorn/prevent-abbreviations": "off",
72+
"class-methods-use-this": "off",
73+
"@typescript-eslint/ban-ts-comment": "off",
74+
"@typescript-eslint/no-explicit-any": "off",
75+
"no-plusplus": "off",
76+
"unicorn/no-null": "off",
77+
"no-underscore-dangle": "off",
78+
"unicorn/no-useless-undefined": "off",
79+
"@typescript-eslint/indent": "off",
80+
"@typescript-eslint/quotes": "off",
81+
"@typescript-eslint/comma-dangle": "off",
82+
"react/jsx-indent": "off",
83+
"react/jsx-indent-props": "off",
84+
"@typescript-eslint/no-use-before-define": "off",
85+
"react/destructuring-assignment": "off",
86+
"react/display-name": "off",
87+
"react/require-default-props": "off",
88+
"naming-convention": "off",
89+
"@typescript-eslint/naming-convention": [
90+
"error",
91+
{
92+
"selector": "variable",
93+
"format": [
94+
"camelCase",
95+
"UPPER_CASE",
96+
"PascalCase"
97+
],
98+
"leadingUnderscore": "allow",
99+
"trailingUnderscore": "allow"
100+
},
101+
{
102+
"selector": "function",
103+
"format": [
104+
"PascalCase",
105+
"camelCase"
106+
],
107+
"leadingUnderscore": "allow",
108+
"trailingUnderscore": "allow"
109+
},
110+
{
111+
"selector": "import",
112+
"format": ["PascalCase", "camelCase"]
113+
},
114+
{
115+
"selector": "enumMember",
116+
"format": [
117+
"UPPER_CASE"
118+
]
119+
},
120+
{
121+
"selector": "property",
122+
"format": null
123+
},
124+
{
125+
"selector": "typeLike",
126+
"format": [
127+
"PascalCase"
128+
]
129+
},
130+
{
131+
"selector": "accessor",
132+
"format": [
133+
"PascalCase"
134+
]
135+
},
136+
{
137+
"selector": "default",
138+
"format": [
139+
"camelCase"
140+
],
141+
"leadingUnderscore": "allow",
142+
"trailingUnderscore": "allow"
143+
}
144+
],
145+
"no-restricted-syntax": "off",
146+
"no-await-in-loop": "off",
147+
"default-case": [
148+
"error",
149+
{
150+
"commentPattern": "^skip\\sdefault$"
151+
}
152+
],
153+
"consistent-return": "off",
154+
"jsx-a11y/anchor-is-valid": "off",
155+
"unicorn/prefer-node-protocol": "off",
156+
"no-param-reassign": [
157+
"error",
158+
{
159+
"props": false
160+
}
161+
],
162+
"operator-linebreak": "off",
163+
"jsx-props-no-spreading": "off",
164+
"react/jsx-props-no-spreading": "off",
165+
"unicorn/no-unreadable-array-destructuring": "off",
166+
"unicorn/prefer-export-from": "off",
167+
"unicorn/prefer-module": "off",
168+
"unicorn/prefer-top-level-await": "off",
169+
"react/function-component-definition": [
170+
2,
171+
{
172+
"namedComponents": [
173+
"function-declaration",
174+
"arrow-function"
175+
]
176+
}
177+
],
178+
"import/no-import-module-exports": "off",
179+
"react/jsx-uses-react": "off",
180+
"react/react-in-jsx-scope": "off",
181+
"react/jsx-max-props-per-line": "off",
182+
"no-nested-ternary": "error",
183+
"import/order": "off",
184+
"simple-import-sort/imports": [
185+
"error",
186+
{
187+
"groups": [
188+
["^\\u0000"],
189+
["^react"],
190+
["^(\\w|@reduxjs\/toolkit)"],
191+
["^@noones"],
192+
["^@\\w"],
193+
["^"],
194+
["^\\."]
195+
]
196+
}
197+
],
198+
"simple-import-sort/exports": "error",
199+
"import/first": "error",
200+
"import/newline-after-import": "error",
201+
"import/no-duplicates": "error",
202+
"no-continue": "off",
203+
"jsx-a11y/label-has-associated-control": [
204+
"error",
205+
{
206+
"required": {
207+
"some": ["nesting", "id"]
208+
}
209+
}
210+
],
211+
"no-console": "off"
212+
},
213+
"settings": {
214+
"import/resolver": {
215+
"typescript": {}
216+
},
217+
"react": {
218+
"version": "detect"
219+
}
220+
}
221+
}

.github/workflows/build.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: build
5+
6+
on:
7+
push:
8+
branches: [ master, develop ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [20.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm install
29+
- run: npm run prod

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
npm-debug.log
2+
node_modules/
3+
dist/
4+
tmp/
5+
*.zip
6+
*.iml
7+
.idea/

.stylelintrc.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"extends": "stylelint-config-sass-guidelines",
3+
"plugins": ["stylelint-order"],
4+
"rules": {
5+
"max-nesting-depth": 5,
6+
"selector-max-compound-selectors": 5,
7+
"property-no-unknown": [true, {
8+
"ignoreSelectors": ":export"
9+
}],
10+
"property-no-vendor-prefix": [true, {
11+
"ignoreProperties": "box-flex"
12+
}],
13+
"order/order": [
14+
[
15+
"custom-properties",
16+
"dollar-variables",
17+
{
18+
"type": "at-rule",
19+
"name": "extend"
20+
},
21+
{
22+
"type": "at-rule",
23+
"name": "include",
24+
"hasBlock": false
25+
},
26+
"declarations",
27+
{
28+
"type": "at-rule",
29+
"name": "include",
30+
"hasBlock": true
31+
},
32+
"rules"
33+
]
34+
],
35+
"order/properties-alphabetical-order": true
36+
}
37+
}

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<header>
2+
3+
<div style="text-align: center">
4+
<h1>Bitcoin blocks tracker</h1>
5+
6+
<p>Extension for track Bitcoin blocks and fees via Mempool space</p>
7+
8+
<a href="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension">
9+
<img src="https://img.shields.io/github/languages/top/IvanSavoskin/bitcoin-blocks-tracker-extension?style=flat-square&logo=github" alt="GitHub top language" />
10+
</a>
11+
<a href="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension/workflows/build/badge.svg">
12+
<img src="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension/workflows/build/badge.svg" alt="Build" />
13+
</a>
14+
</div>
15+
16+
</header>
17+
18+
## Introduction
19+
20+
This extension was created to easily and conveniently track the emergence of new blocks in the Bitcoin network.
21+
After the new block is mined, the extension notifies the user with a sound signal.
22+
The extension also allows you to quickly monitor current commissions on the network.
23+
24+
Obtaining blocks and fees data is done using [mempool.space](https://mempool.space/)
25+
26+
## Features
27+
28+
- Receiving sound notification when a new block appears in the mainnet or testnet of the
29+
Bitcoin network
30+
- Obtaining information about current fees in the Bitcoin network
31+
- Obtaining information about the time the last block appeared
32+
33+
## Local installation
34+
35+
### Prerequisites
36+
1. You need to preinstall `node@^20.x`
37+
2. Compatible `npm` must be installed
38+
3. In the terminal, run the `npm install` command from the project folder
39+
40+
### Linters
41+
To monitor the quality of the code, the project provides for the connection of linters.
42+
43+
#### ESLint
44+
Rules for ESLint are specified in the `/.eslintrc` file.
45+
46+
Code checking using ESLint starts with the command `npm run eslint`.
47+
48+
#### Stylelint
49+
Rules for Stylelint are specified in the `kalita/.stylelintrc.json` file.
50+
51+
Styles checking using Stylelint starts with the command `npm run stylelint`.
52+
53+
### Development build
54+
Start the dev build with the command `npm run dev`.
55+
56+
After build, a folder `/dist` will be created with the built extension,
57+
which can be used to add to the browser.
58+
59+
Each code change initiates a rebuild of the extension automatically.
60+
61+
During build, a source map is also added to enable the use of Chrome Dev Tools
62+
63+
### Production build
64+
Start the prod build with the command `npm run prod`.
65+
66+
Before building, code checking is automatically run using ESLint and StyleLint.
67+
68+
Built project is stored in the `/dist` folder.
69+
70+
### Load extension to Chrome
71+
72+
Load `dist` directory on Chrome extension page ([instruction](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked))

custom_typing/m4a.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module "*.m4a" {
2+
const content: string;
3+
export default content;
4+
}

custom_typing/scss.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module "*.scss" {
2+
const styles: { [className: string]: string };
3+
export default styles;
4+
}

0 commit comments

Comments
 (0)