Skip to content
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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.yml

This file was deleted.

16 changes: 10 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ updates:
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-npm-dependencies:
patterns:
- "*"
npm-all:
patterns: ["*"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
all-github-actions-dependencies:
patterns:
- "*"
github-actions-all:
patterns: ["*"]
26 changes: 16 additions & 10 deletions .github/workflows/nodeci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Node CI

# На каждое событие ровно один workflow: здесь нет release-please, поэтому
# main проверяет Node CI.
on:
push:
branches:
Expand All @@ -14,19 +16,23 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [26.x]

steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version}}
uses: actions/setup-node@v6
- uses: actions/checkout@v7

# pnpm ставится до setup-node: тот с cache: pnpm ищет уже существующий
# бинарь, чтобы вычислить путь к store, и иначе падает с
# «Unable to locate executable file: pnpm».
- uses: pnpm/action-setup@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version}}
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install
run: make install
- name: Run linter
run: make lint-frontend
- name: Build
run: make build
- name: Run tests
run: make test
run: make lint
23 changes: 23 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Title

# Заголовок PR обязан быть conventional commit: при squash-мерже он становится
# сообщением коммита, а по нему release-please определяет разряд версии.
# Отдельные коммиты ветки намеренно не проверяются.
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .oxfmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Что oxfmt не форматирует. Файл нужен потому, что без --ignore-path oxfmt читает
# .gitignore текущего каталога, а в ките в .gitignore лежат exercises/, courses/ и
# projects/ целиком: запущенный из корня oxfmt тогда молча пропускает весь контент,
# и это неотличимо от «всё уже отформатировано».
#
# Список повторяет ignorePatterns из .oxlintrc.json: линт и формат должны видеть
# одни и те же файлы.
node_modules/
# oxfmt форматирует не только js/ts: на spec.yml упражнения он снимает пустую
# строку, а package.json переписывает в свой вид. YAML и JSON в ките ведут другие
# инструменты (yamlfmt через mdsf, npm сам), поэтому здесь только js/ts.
*.yml
*.yaml
*.json
*.jsonc
*.css
*.md
npm-cache/
vendor/
dist/
build/
coverage/
.venv/
__snapshots__/
36 changes: 36 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"unicorn",
"oxc",
"import",
"promise",
"node",
"jsdoc",
"vitest",
"react",
"react-perf",
"jsx-a11y",
"vue"
],
"categories": {
"correctness": "error"
},
"rules": {},
"env": {
"builtin": true,
"browser": true,
"node": true
},
"ignorePatterns": [
"**/node_modules/**",
"**/npm-cache/**",
"**/vendor/**",
"**/dist/**",
"**/build/**",
"**/coverage/**",
"**/.venv/**",
"**/__snapshots__/**"
]
}
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ start-frontend:
make -C frontend start

start-backend:
npx start-server
pnpm exec start-server

start:
make start-backend & make start-frontend
Expand All @@ -14,10 +14,12 @@ lint-frontend:
make -C frontend lint

build:
DISABLE_ESLINT_PLUGIN=true npm run build
DISABLE_ESLINT_PLUGIN=true pnpm run build

test:
npx playwright test

install:
npm ci
pnpm install --frozen-lockfile

lint:
pnpm --silent run lint
pnpm --silent run format:check
32 changes: 16 additions & 16 deletions __tests__/example.spec.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// @ts-check
//
const { test, expect } = require('@playwright/test');
const { test, expect } = require("@playwright/test");

test('wrong login', async ({ page }) => {
await page.goto('http://localhost:5001/');
test("wrong login", async ({ page }) => {
await page.goto("http://localhost:5001/");

expect(page.getByText(/Нет аккаунта?/)).toBeVisible();
expect(page.getByAltText(/Войти/)).toBeVisible();
expect(page.getByText(/Регистрация/)).toBeVisible();
expect(await page.getByText(/Войти/).count()).toEqual(2);

await page.locator('#username').fill('test');
await page.locator('#password').fill('test');
await page.getByRole('button', { name: 'Войти' }).click();
await page.locator("#username").fill("test");
await page.locator("#password").fill("test");
await page.getByRole("button", { name: "Войти" }).click();
expect(await page.getByText(/Скрытая страница!/).count()).toEqual(0);
expect(page.getByText(/Неверные имя пользователя или пароль/)).toBeVisible();
});

test('registration page, success login', async ({ page }) => {
await page.goto('http://localhost:5001/');
test("registration page, success login", async ({ page }) => {
await page.goto("http://localhost:5001/");

await page.getByText(/Регистрация/).click();
expect(page.getByLabel(/Имя пользователя/)).toBeVisible();
Expand All @@ -27,16 +27,16 @@ test('registration page, success login', async ({ page }) => {
expect(page.getByText(/Регистрация/)).toBeVisible();
expect(page.getByAltText(/Регистрация/)).toBeVisible();

await page.locator('#username').fill('playwright');
await page.locator('#password').fill('password');
await page.locator('#confirmPassword').fill('password');
await page.getByRole('button', { name: 'Зарегистрироваться' }).click();
await page.locator("#username").fill("playwright");
await page.locator("#password").fill("password");
await page.locator("#confirmPassword").fill("password");
await page.getByRole("button", { name: "Зарегистрироваться" }).click();
expect(page.getByText(/Скрытая страница!/)).toBeVisible();

await page.getByRole('button', { name: 'Выйти' }).click();
await page.getByRole("button", { name: "Выйти" }).click();

await page.locator('#username').fill('admin');
await page.locator('#password').fill('admin');
await page.getByRole('button', { name: 'Войти' }).click();
await page.locator("#username").fill("admin");
await page.locator("#password").fill("admin");
await page.getByRole("button", { name: "Войти" }).click();
expect(page.getByText(/Скрытая страница!/)).toBeVisible();
});
24 changes: 24 additions & 0 deletions frontend/.oxfmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Что oxfmt не форматирует. Файл нужен потому, что без --ignore-path oxfmt читает
# .gitignore текущего каталога, а в ките в .gitignore лежат exercises/, courses/ и
# projects/ целиком: запущенный из корня oxfmt тогда молча пропускает весь контент,
# и это неотличимо от «всё уже отформатировано».
#
# Список повторяет ignorePatterns из .oxlintrc.json: линт и формат должны видеть
# одни и те же файлы.
node_modules/
# oxfmt форматирует не только js/ts: на spec.yml упражнения он снимает пустую
# строку, а package.json переписывает в свой вид. YAML и JSON в ките ведут другие
# инструменты (yamlfmt через mdsf, npm сам), поэтому здесь только js/ts.
*.yml
*.yaml
*.json
*.jsonc
*.css
*.md
npm-cache/
vendor/
dist/
build/
coverage/
.venv/
__snapshots__/
36 changes: 36 additions & 0 deletions frontend/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"unicorn",
"oxc",
"import",
"promise",
"node",
"jsdoc",
"vitest",
"react",
"react-perf",
"jsx-a11y",
"vue"
],
"categories": {
"correctness": "error"
},
"rules": {},
"env": {
"builtin": true,
"browser": true,
"node": true
},
"ignorePatterns": [
"**/node_modules/**",
"**/npm-cache/**",
"**/vendor/**",
"**/dist/**",
"**/build/**",
"**/coverage/**",
"**/.venv/**",
"**/__snapshots__/**"
]
}
Loading