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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ updates:
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
npm-all:
patterns: ["*"]
Expand All @@ -14,6 +17,9 @@ updates:
schedule:
interval: "monthly"
open-pull-requests-limit: 1
labels: ["dependencies", "automated"]
commit-message:
prefix: "chore"
groups:
github-actions-all:
patterns: ["*"]
22 changes: 16 additions & 6 deletions .github/workflows/nodeci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Node CI

# Только на пулреквестах. На main проверки идут внутри Release Please, чтобы
# мерж давал ровно один прогон, а не два workflow на один и тот же коммит.
on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -12,13 +11,24 @@ jobs:
build:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v7
- name: Use Node.js

# 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: '26.x'
cache: 'npm'
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install
run: make install
- name: Run linter
Expand Down
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 }}
46 changes: 46 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
release-type: node

- uses: actions/checkout@v7
if: ${{ steps.release.outputs.release_created }}

- uses: pnpm/action-setup@v6
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v7
if: ${{ steps.release.outputs.release_created }}
with:
node-version: '26.x'
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: make install
if: ${{ steps.release.outputs.release_created }}

- run: make lint
if: ${{ steps.release.outputs.release_created }}

- run: make test
if: ${{ steps.release.outputs.release_created }}

- run: make publish
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_COM }}
26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

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__/**"
]
}
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
install:
npm install
pnpm install

docs:
mkdir -p docs
npm run documentation -- build index.js -f md > docs/README.md
pnpm --silent run documentation -- build index.js -f md > docs/README.md

test:
npm test -s
pnpm --silent test

lint:
npx biome check .
pnpm --silent run lint
pnpm --silent run format:check

publish:
npm publish --access public
pnpm publish --access public --no-git-checks

.PHONY: test docs
28 changes: 14 additions & 14 deletions __tests__/test.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
// @ts-ckeck

import * as list from '@hexlet/pairs-data';
import { attach, contents, typeTag } from '../index.js';
import * as list from "@hexlet/pairs-data";
import { attach, contents, typeTag } from "../index.js";

describe('Types', () => {
it('#attach', () => {
const data = 'text, pair, list or others';
const typeData = attach('typeName', data);
expect(typeTag(typeData)).toBe('typeName');
expect(contents(typeData)).toBe('text, pair, list or others');
describe("Types", () => {
it("#attach", () => {
const data = "text, pair, list or others";
const typeData = attach("typeName", data);
expect(typeTag(typeData)).toBe("typeName");
expect(contents(typeData)).toBe("text, pair, list or others");
});

it('#typeTag', () => {
it("#typeTag", () => {
const data = list.l();
const typeData = attach('typeName', data);
expect(typeTag(typeData)).toBe('typeName');
const typeData = attach("typeName", data);
expect(typeTag(typeData)).toBe("typeName");
});

it('#contents', () => {
it("#contents", () => {
const data = list.l(2, 3, 4);
const typeData = attach('', data);
expect(list.toString(contents(typeData))).toBe('(2, 3, 4)');
const typeData = attach("", data);
expect(list.toString(contents(typeData))).toBe("(2, 3, 4)");
});
});
36 changes: 0 additions & 36 deletions biome.json

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-ckeck

import * as pairs from '@hexlet/pairs';
import * as pairs from "@hexlet/pairs";

/**
* Tagged data constructor
Expand Down
Loading