Skip to content

Commit 79c8917

Browse files
committed
✨ feat: upgrade node and other libs
1 parent a9c72e9 commit 79c8917

30 files changed

+2657
-2656
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/shared-build/action.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ runs:
3838
- name: Setup Node (with pnpm cache)
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: "20.13"
41+
node-version: "22.20"
4242
cache: "pnpm"
4343

4444
- name: Cache pnpm store
@@ -79,11 +79,6 @@ runs:
7979
working-directory: testproject
8080
shell: bash
8181

82-
- name: Deduplicate JS dependencies
83-
run: pnpm dedupe
84-
working-directory: testproject
85-
shell: bash
86-
8782
- name: Install Poetry
8883
run: pip install poetry==2.0.1 --upgrade
8984
working-directory: testproject
@@ -168,13 +163,6 @@ runs:
168163
working-directory: testproject/backend
169164
shell: bash
170165

171-
- name: Check migrations (dry run)
172-
run: poetry run python manage.py makemigrations --check --dry-run
173-
working-directory: testproject/backend
174-
env:
175-
DATABASE_URL: "sqlite:///"
176-
shell: bash
177-
178166
- name: Django deploy checks
179167
run: poetry run python manage.py check --deploy --fail-level WARNING
180168
working-directory: testproject/backend

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,21 @@ repos:
3333
hooks:
3434
- id: eslint
3535
name: eslint-local
36-
entry: npm run lint
36+
entry: pnpm run lint
3737
language: system
3838
types: [file]
3939
files: \.(js|jsx|ts|tsx)$
4040
exclude: >
4141
(?x)^(
4242
.+\.config\.js|
4343
.+\.setup\.js|
44-
\.eslintrc\.js
44+
openapi-ts\.config\.ts |
45+
frontend/js/api/.*
4546
)$
4647
pass_filenames: true
4748
- id: tsc
4849
name: tsc-local
49-
entry: npm run tsc
50+
entry: pnpm run tsc
5051
language: system
5152
types: [file]
5253
files: \.(ts|tsx)$
@@ -66,7 +67,7 @@ repos:
6667
pass_filenames: false
6768
- id: frontend-api
6869
name: frontend-api-local
69-
entry: npm run openapi-ts
70+
entry: pnpm run openapi-ts
7071
language: system
7172
files: backend/schema\.yml$
7273
pass_filenames: false

.prettierignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated / build directories
2+
node_modules/
3+
dist/
4+
build/
5+
coverage/
6+
7+
# Lock / package files
8+
pnpm-lock.yaml
9+
yarn.lock
10+
package-lock.json
11+
12+
# Config / bundler files
13+
webpack.config.js
14+
*.config.js
15+
*.config.cjs
16+
*.config.mjs
17+
18+
# Source maps
19+
*.map
20+
21+
# Minified files
22+
*.min.js
23+
*.min.css
24+
25+
# Test snapshots
26+
*.snap
27+
28+
# Logs / temporary
29+
*.log
30+
tmp/
31+
temp/
32+
33+
# Assets / binary files that don't need formatting
34+
*.svg
35+
*.png
36+
*.jpg
37+
*.jpeg
38+
*.woff
39+
*.woff2
40+
41+
# Ignore generated API folder by hey-api
42+
frontend/js/api/**

.prettierrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
// number of spaces per indent level
3+
tabWidth: 2,
4+
// use spaces instead of tabs
5+
useTabs: false,
6+
// print semicolons at ends of statements
7+
semi: true,
8+
// use single quote where possible
9+
singleQuote: true,
10+
// trailing commas where valid in ES5 (objects, arrays, etc)
11+
trailingComma: 'es5',
12+
// put > of a multi-line JSX tag on its own line
13+
bracketSameLine: false,
14+
// max line length
15+
printWidth: 100,
16+
// enforce line feed as end of line
17+
endOfLine: 'lf',
18+
// put the `>` of a JSX element in the last line instead of new line
19+
jsxBracketSameLine: false,
20+
// use single quotes in JSX
21+
jsxSingleQuote: false,
22+
};

eslint.config.mjs

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import { defineConfig } from "eslint/config";
2+
3+
// Import global definitions
4+
import globals from "globals";
5+
6+
import js from "@eslint/js";
7+
import tsParser from "@typescript-eslint/parser";
8+
import tsPlugin from "@typescript-eslint/eslint-plugin";
9+
import reactPlugin from "eslint-plugin-react";
10+
import reactHooksPlugin from "eslint-plugin-react-hooks";
11+
import importPlugin from "eslint-plugin-import";
12+
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
13+
import promisePlugin from "eslint-plugin-promise";
14+
import sonarjsPlugin from "eslint-plugin-sonarjs";
15+
import unicornPlugin from "eslint-plugin-unicorn";
16+
import jestPlugin from "eslint-plugin-jest";
17+
18+
export default defineConfig([
19+
// Base JS rules, with browser + node globals
20+
{
21+
...js.configs.recommended,
22+
languageOptions: {
23+
globals: {
24+
// include browser globals (window, document, etc)
25+
...globals.browser,
26+
// include node globals (process, module, require, global, etc)
27+
...globals.node,
28+
// include jest globals (describe, test, expect etc)
29+
...globals.jest,
30+
},
31+
},
32+
},
33+
34+
// TypeScript files
35+
{
36+
files: ["**/*.ts", "**/*.tsx"],
37+
languageOptions: {
38+
parser: tsParser,
39+
parserOptions: {
40+
project: "./tsconfig.json",
41+
tsconfigRootDir: new URL(".", import.meta.url).pathname,
42+
ecmaVersion: "latest",
43+
sourceType: "module",
44+
ecmaFeatures: {
45+
jsx: true,
46+
},
47+
},
48+
globals: {
49+
...globals.browser,
50+
...globals.node,
51+
...globals.jest,
52+
},
53+
},
54+
plugins: {
55+
"@typescript-eslint": tsPlugin,
56+
},
57+
rules: {
58+
// desabilitar no-undef para TS, pois TS já detecta variáveis indefinidas
59+
"no-undef": "off",
60+
"no-unused-vars": "off",
61+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
62+
},
63+
},
64+
65+
// React / JSX files
66+
{
67+
files: ["**/*.tsx", "**/*.jsx"],
68+
languageOptions: {
69+
globals: {
70+
...globals.browser,
71+
...globals.node,
72+
...globals.jest,
73+
},
74+
},
75+
plugins: {
76+
react: reactPlugin,
77+
"react-hooks": reactHooksPlugin,
78+
},
79+
rules: {
80+
"react/prop-types": "off",
81+
"react/react-in-jsx-scope": "off",
82+
},
83+
settings: {
84+
react: {
85+
version: "detect",
86+
},
87+
},
88+
},
89+
90+
// Common rules for all JS/TS/JSX/TSX
91+
{
92+
files: ["**/*.{js,ts,tsx,jsx}"],
93+
languageOptions: {
94+
globals: {
95+
...globals.browser,
96+
...globals.node,
97+
...globals.jest,
98+
},
99+
},
100+
plugins: {
101+
import: importPlugin,
102+
"jsx-a11y": jsxA11yPlugin,
103+
promise: promisePlugin,
104+
sonarjs: sonarjsPlugin,
105+
unicorn: unicornPlugin,
106+
jest: jestPlugin,
107+
},
108+
rules: {
109+
"import/order": [
110+
"warn",
111+
{
112+
groups: [
113+
"builtin",
114+
"external",
115+
"internal",
116+
"parent",
117+
"sibling",
118+
"index",
119+
"object",
120+
"type",
121+
],
122+
"newlines-between": "always",
123+
alphabetize: { order: "asc", caseInsensitive: true },
124+
},
125+
],
126+
"unicorn/prefer-module": "off",
127+
},
128+
},
129+
130+
// Ignores / files to skip
131+
{
132+
ignores: ["node_modules/", "dist/", "build/", "frontend/js/api/", "openapi-ts.config.ts"],
133+
},
134+
]);

frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine
1+
FROM node:22-alpine
22

33
WORKDIR /app/
44
ADD package.json pnpm-lock.yaml* /app/

frontend/assets/images/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
declare module "*.png" {
1+
declare module '*.png' {
22
const value: string;
33
export = value;
44
}
55

6-
declare module "*.jpg" {
6+
declare module '*.jpg' {
77
const value: string;
88
export = value;
99
}
1010

11-
declare module "*.jpeg" {
11+
declare module '*.jpeg' {
1212
const value: string;
1313
export = value;
1414
}
1515

16-
declare module "*.gif" {
16+
declare module '*.gif' {
1717
const value: string;
1818
export = value;
1919
}
2020

21-
declare module "*.svg" {
21+
declare module '*.svg' {
2222
const value: string;
2323
export = value;
2424
}

frontend/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import "tailwindcss";
1+
@import 'tailwindcss';

0 commit comments

Comments
 (0)