Skip to content

Commit 51997ae

Browse files
authored
Update (#57)
* chore(deps,tooling): upgrade deps and replace add-new-post CLI with shell script - Upgrade React 18→19, Gatsby 5.14→5.16, ESLint 9→10, Jest 29→30 - Replace add-new-post TypeScript CLI with scripts/add-new-post.sh - Remove .eslintrc.js, src/utilities/cli.ts, tsconfig.cli.json - Add prettier-plugin-sh, simplify .prettierignore, update lint-staged * refactor: update ESLint configuration and improve TypeScript support - Adjust parser options to allow default projects for JavaScript files. - Expand TypeScript file matching to include .tsx files. - Disable specific TypeScript rules until parser options are reliably set. - Refactor various components to use interfaces instead of types for better consistency. - Clean up image markdown formatting in blog posts and add new posts for "Poor animals" in both English and Russian. * feat: add images and update titles for "Poor animals" blog post - Added five new images related to the blog post. - Updated the post titles in both English and Russian to include "RIP". * feat: implement BitTorrent visualization component - Added a new visualization component for BitTorrent using Processing.js. - Implemented peer and connection management, including adding/removing peers and visual representation of data transfer. - Enhanced user interaction with keyboard controls for adding/removing peers and seeders. - Introduced a graphical representation of peers and their data bits, improving the overall user experience. * refactor: rename and restructure BitTorrent visualization classes - Renamed `Bit` class to `Piece` and `Kibble` class to `PieceTransfer` for clarity. - Updated connection management to handle pieces instead of bits, improving code readability. - Refactored methods to create and draw pieces, enhancing the visualization logic. - Adjusted peer management to track pieces instead of bits, streamlining data handling. * feat: enhance user interaction in BitTorrent visualization - Added mouse interaction for selecting peers and adding/removing them based on clicks. - Implemented a function to check if a mouse click is within a peer's visual representation. - Improved user experience by allowing right-click to add seeders and left-click to add peers.
1 parent 01e7010 commit 51997ae

42 files changed

Lines changed: 5040 additions & 5837 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Whitespace-only changes.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ __generated__/
77
node_modules/
88
public/
99

10-
1110
# Yarn
1211

1312
.yarn/*

.prettierignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
/*
2-
!**/*.js*
3-
!**/*.json
4-
!**/*.ts*
5-
!**/*.yml
6-
!**/*.yaml
7-
!src
1+
package-lock.json

eslint.config.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ module.exports = tseslint.config(
1111
...tseslint.configs.stylisticTypeChecked,
1212
{
1313
languageOptions: {
14-
parserOptions: { projectService: { allowDefaultProject: ['*.js', '*.ts'] }, tsconfigRootDir: __dirname },
14+
parserOptions: {
15+
projectService: { allowDefaultProject: ['*.js'] },
16+
tsconfigRootDir: __dirname,
17+
},
1518
},
1619
},
1720
{
18-
files: ['**/*.ts'],
19-
languageOptions: { globals: { ...globals.browser, ...globals.builtin } },
21+
files: ['**/*.ts', '**/*.tsx'],
22+
languageOptions: {
23+
globals: { ...globals.browser, ...globals.builtin },
24+
},
2025
name: 'TypeScript',
21-
plugins: { perfectionist },
26+
rules: {
27+
// Off until context.parserOptions is reliably set by the parser (projectService)
28+
'@typescript-eslint/consistent-generic-constructors': 'off',
29+
'@typescript-eslint/no-deprecated': 'off',
30+
},
2231
},
2332
{
2433
...tseslint.configs.disableTypeChecked,
@@ -29,9 +38,16 @@ module.exports = tseslint.config(
2938
{
3039
...tseslint.configs.disableTypeChecked,
3140
files: ['**/*.config.js'],
32-
languageOptions: { globals: { ...globals.builtin, ...globals.node } },
41+
languageOptions: {
42+
globals: { ...globals.builtin, ...globals.node },
43+
parserOptions: { program: null, project: false, projectService: false },
44+
},
3345
name: 'JavaScript configs',
34-
rules: { '@typescript-eslint/no-require-imports': 'off', '@typescript-eslint/no-unsafe-assignment': 'off' },
46+
rules: {
47+
...tseslint.configs.disableTypeChecked.rules,
48+
'@typescript-eslint/no-require-imports': 'off',
49+
'@typescript-eslint/no-unsafe-assignment': 'off',
50+
},
3551
},
3652
{
3753
...tseslint.configs.disableTypeChecked,

gatsby-node.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const onCreateBabelConfig: GatsbyNode['onCreateBabelConfig'] = (gatsbyNod
1616
};
1717

1818
export const createPages: GatsbyNode['createPages'] = (args) => {
19-
// eslint-disable-next-line @typescript-eslint/unbound-method
2019
const {
2120
actions: { createPage },
2221
graphql,
@@ -75,7 +74,7 @@ export const createPages: GatsbyNode['createPages'] = (args) => {
7574

7675
const next = index === 0 ? null : groupedByTypeAndLanguage?.[EDGE_TYPES.POST]?.[langKey]?.[index - 1]?.node;
7776
const previous =
78-
index === groupedByTypeAndLanguage?.[EDGE_TYPES.POST]?.[langKey]?.length ?? 0 - 1
77+
(index === groupedByTypeAndLanguage?.[EDGE_TYPES.POST]?.[langKey]?.length ?? 0 - 1)
7978
? null
8079
: groupedByTypeAndLanguage?.[EDGE_TYPES.POST]?.[langKey]?.[index + 1]?.node;
8180

lint-staged.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2-
'*': ['eslint --debug --fix', 'prettier --log-level debug --write'],
2+
'*': ['eslint --debug --fix'],
3+
'*.{js,jsx,ts,tsx,mjs,cjs,json,json5,css,scss,less,html,md,mdx,yml,yaml,graphql,gql,vue,sh}': [
4+
'prettier --log-level debug --write',
5+
],
36
};

0 commit comments

Comments
 (0)