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

First version commit #1

Merged
merged 1 commit into from
May 17, 2024
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.js
**/*.jsx
node_modules
dist
221 changes: 221 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"extends": [
"airbnb",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:eslint-plugin-react/recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module",
"project": "./tsconfig.json"
},
"env": {
"es6": true,
"browser": true
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"unicorn",
"simple-import-sort",
"import"
],
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 135,
"tabWidth": 4,
"trailingComma": "none"
},
{
"usePrettierrc": false
}
],
"max-len": "off",
"curly": [
"error",
"all"
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-filename-extension": [
1,
{
"extensions": [
".tsx"
]
}
],
"import/prefer-default-export": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never"
}
],
"import/no-extraneous-dependencies": "off",
"unicorn/filename-case": "off",
"no-use-before-define": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"unicorn/prevent-abbreviations": "off",
"class-methods-use-this": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-plusplus": "off",
"unicorn/no-null": "off",
"no-underscore-dangle": "off",
"unicorn/no-useless-undefined": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/quotes": "off",
"@typescript-eslint/comma-dangle": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"@typescript-eslint/no-use-before-define": "off",
"react/destructuring-assignment": "off",
"react/display-name": "off",
"react/require-default-props": "off",
"naming-convention": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "function",
"format": [
"PascalCase",
"camelCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": "import",
"format": ["PascalCase", "camelCase"]
},
{
"selector": "enumMember",
"format": [
"UPPER_CASE"
]
},
{
"selector": "property",
"format": null
},
{
"selector": "typeLike",
"format": [
"PascalCase"
]
},
{
"selector": "accessor",
"format": [
"PascalCase"
]
},
{
"selector": "default",
"format": [
"camelCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
}
],
"no-restricted-syntax": "off",
"no-await-in-loop": "off",
"default-case": [
"error",
{
"commentPattern": "^skip\\sdefault$"
}
],
"consistent-return": "off",
"jsx-a11y/anchor-is-valid": "off",
"unicorn/prefer-node-protocol": "off",
"no-param-reassign": [
"error",
{
"props": false
}
],
"operator-linebreak": "off",
"jsx-props-no-spreading": "off",
"react/jsx-props-no-spreading": "off",
"unicorn/no-unreadable-array-destructuring": "off",
"unicorn/prefer-export-from": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-top-level-await": "off",
"react/function-component-definition": [
2,
{
"namedComponents": [
"function-declaration",
"arrow-function"
]
}
],
"import/no-import-module-exports": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-max-props-per-line": "off",
"no-nested-ternary": "error",
"import/order": "off",
"simple-import-sort/imports": [
"error",
{
"groups": [
["^\\u0000"],
["^react"],
["^(\\w|@reduxjs\/toolkit)"],
["^@noones"],
["^@\\w"],
["^"],
["^\\."]
]
}
],
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"no-continue": "off",
"jsx-a11y/label-has-associated-control": [
"error",
{
"required": {
"some": ["nesting", "id"]
}
}
],
"no-console": "off"
},
"settings": {
"import/resolver": {
"typescript": {}
},
"react": {
"version": "detect"
}
}
}
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: build

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run prod
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
npm-debug.log
node_modules/
dist/
tmp/
*.zip
*.iml
.idea/
37 changes: 37 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": "stylelint-config-sass-guidelines",
"plugins": ["stylelint-order"],
"rules": {
"max-nesting-depth": 5,
"selector-max-compound-selectors": 5,
"property-no-unknown": [true, {
"ignoreSelectors": ":export"
}],
"property-no-vendor-prefix": [true, {
"ignoreProperties": "box-flex"
}],
"order/order": [
[
"custom-properties",
"dollar-variables",
{
"type": "at-rule",
"name": "extend"
},
{
"type": "at-rule",
"name": "include",
"hasBlock": false
},
"declarations",
{
"type": "at-rule",
"name": "include",
"hasBlock": true
},
"rules"
]
],
"order/properties-alphabetical-order": true
}
}
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<header>

<div style="text-align: center">
<h1>Bitcoin blocks tracker</h1>

<p>Extension for track Bitcoin blocks and fees via Mempool space</p>

<a href="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension">
<img src="https://img.shields.io/github/languages/top/IvanSavoskin/bitcoin-blocks-tracker-extension?style=flat-square&logo=github" alt="GitHub top language" />
</a>
<a href="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension/workflows/build/badge.svg">
<img src="https://github.com/IvanSavoskin/bitcoin-blocks-tracker-extension/workflows/build/badge.svg" alt="Build" />
</a>
</div>

</header>

## Introduction

This extension was created to easily and conveniently track the emergence of new blocks in the Bitcoin network.
After the new block is mined, the extension notifies the user with a sound signal.
The extension also allows you to quickly monitor current commissions on the network.

Obtaining blocks and fees data is done using [mempool.space](https://mempool.space/)

## Features

- Receiving sound notification when a new block appears in the mainnet or testnet of the
Bitcoin network
- Obtaining information about current fees in the Bitcoin network
- Obtaining information about the time the last block appeared

## Local installation

### Prerequisites
1. You need to preinstall `node@^20.x`
2. Compatible `npm` must be installed
3. In the terminal, run the `npm install` command from the project folder

### Linters
To monitor the quality of the code, the project provides for the connection of linters.

#### ESLint
Rules for ESLint are specified in the `/.eslintrc` file.

Code checking using ESLint starts with the command `npm run eslint`.

#### Stylelint
Rules for Stylelint are specified in the `kalita/.stylelintrc.json` file.

Styles checking using Stylelint starts with the command `npm run stylelint`.

### Development build
Start the dev build with the command `npm run dev`.

After build, a folder `/dist` will be created with the built extension,
which can be used to add to the browser.

Each code change initiates a rebuild of the extension automatically.

During build, a source map is also added to enable the use of Chrome Dev Tools

### Production build
Start the prod build with the command `npm run prod`.

Before building, code checking is automatically run using ESLint and StyleLint.

Built project is stored in the `/dist` folder.

### Load extension to Chrome

Load `dist` directory on Chrome extension page ([instruction](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked))
4 changes: 4 additions & 0 deletions custom_typing/m4a.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.m4a" {
const content: string;
export default content;
}
4 changes: 4 additions & 0 deletions custom_typing/scss.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.scss" {
const styles: { [className: string]: string };
export default styles;
}
Loading
Loading