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
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: tests/audit

on:
push:
branches:
- master
pull_request:

jobs:
audit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm audit --parseable --production --audit-level=moderate

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 24.x, 25.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --omit=optional
env:
CI: true
- run: npm run test

lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --omit=optional
env:
CI: true
- run: npm run lint

coveralls:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-optional
env:
CI: true
- run: npm run test:coverage
- name: Submit to Coveralls
uses: coverallsapp/github-action@v2
36 changes: 0 additions & 36 deletions .github/workflows/npm_build.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/npm_test_coverage.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish to NPM

on:
push:
tags:
- 'v*.*.*'

permissions:
id-token: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Upgrade npm
run: npm i -g npm@latest

- name: Install dependencies
run: npm ci --no-optional

- name: Publish pre-release to NPM
if: contains(github.ref_name, '-')
run: npm publish --provenance --tag next

- name: Publish release to NPM
if: "!contains(github.ref_name, '-')"
run: npm publish --provenance
1 change: 1 addition & 0 deletions AGENTS.md
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
# [1.7.0-3](https://github.com/snatalenko/declarative-mapper/compare/v1.7.0-2...v1.7.0-3) (2026-03-03)


### Documentation

* Fix tests workflow badge ([e02d95f](https://github.com/snatalenko/declarative-mapper/commit/e02d95f1e6b05b039a1f1555d150ce4963d7e511))


# [1.7.0-2](https://github.com/snatalenko/declarative-mapper/compare/v1.7.0-1...v1.7.0-2) (2026-03-03)


### Refactoring

* Remove unused default parameters from inner functions ([2ce8aa4](https://github.com/snatalenko/declarative-mapper/commit/2ce8aa4038c9bec7ee2281152a9d4199491f8076))


# [1.7.0-1](https://github.com/snatalenko/declarative-mapper/compare/v1.7.0-0...v1.7.0-1) (2026-03-03)


### Tests

* Add missing tests to improve coverage ([8b3606a](https://github.com/snatalenko/declarative-mapper/commit/8b3606add20870c6256bc6e18583bb3f037d4047))


# [1.7.0-0](https://github.com/snatalenko/declarative-mapper/compare/v1.6.4...v1.7.0-0) (2026-03-03)


### Features

* Support template-based dynamic output keys ([7ff2070](https://github.com/snatalenko/declarative-mapper/commit/7ff207027262225063dc34609907811a2dc6f3ce))

### Changes

* Apache 2.0 license ([f200a2a](https://github.com/snatalenko/declarative-mapper/commit/f200a2a88f1a3b394276b62c39a46588b615fe43))

### Refactoring

* Cleanup types; use imports with TS extensions ([2ed24bc](https://github.com/snatalenko/declarative-mapper/commit/2ed24bc70855313c28d086261ccaae1e74bbb412))

### Documentation

* Add contributing guidelines and development setup instructions ([7361601](https://github.com/snatalenko/declarative-mapper/commit/7361601adce8bda1a0a3ccdb083c924405e15523))

### Tests

* Add missing tests to improve coverage ([851e673](https://github.com/snatalenko/declarative-mapper/commit/851e67314ca77b9be910bade56e3763018f85720))
* Allow running individual tests with `npm t` ([adb76a4](https://github.com/snatalenko/declarative-mapper/commit/adb76a46b09ba6780745d78dde12598846dc6e1e))

### Build System

* Add automatic pre-release tags cleanup ([2477330](https://github.com/snatalenko/declarative-mapper/commit/2477330ba96f90dccb70c415958d89e45a49aee3))
* Add pre-release publishing script ([7448cfc](https://github.com/snatalenko/declarative-mapper/commit/7448cfcc47f416f820db453bd4afd7c5e3436886))
* Add eslint ([f6b5b4b](https://github.com/snatalenko/declarative-mapper/commit/f6b5b4b6d47d9a83e1225d3d4c2649b80c73b2d0))
* Add separate CJS and ESM builds ([bce1531](https://github.com/snatalenko/declarative-mapper/commit/bce1531c8cd21cdb04837e622f4028eecb4b82fa))
* Update dev dependencies ([24b1d4c](https://github.com/snatalenko/declarative-mapper/commit/24b1d4cde4fb5650e9d495600a27c02c6e41000a))


## [1.6.4](https://github.com/snatalenko/declarative-mapper/compare/v1.6.3...v1.6.4) (2025-07-25)


Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
78 changes: 78 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Contributing

Thanks for taking the time to contribute!

## Development setup

Prerequisites:

- Node.js 16+
- npm

Clone and install:

```bash
git clone git@github.com:snatalenko/declarative-mapper.git
cd declarative-mapper
npm ci
```

## Project structure

- `src/` - mapper runtime and public APIs
- `tests/unit/` - Jest tests
- `tests/unit/data/` - test fixtures
- `schemas/` - JSON schemas
- `scripts/changelog/` - changelog templates/config
- `dist/` and `types/` - generated build output

## Common tasks

```bash
npm run cleanup # Remove dist/, types/, coverage/
npm test
npm run test:coverage # Run tests with coverage report
npm run lint # Run ESLint
npm run build # Build both ESM and CJS outputs
npm run build:esm # Build ESM only (generates dist/esm/ and types/)
npm run build:cjs # Build CJS only (generates dist/cjs/)
```

### Running a single test file

```bash
npm test tests/unit/mappingSchema.test.ts
```

## Code style

Code style and formatting are enforced via [EditorConfig](https://editorconfig.org) ([.editorconfig](.editorconfig)) and [ESLint](https://eslint.org) ([eslint.config.mjs](eslint.config.mjs)).

- **Indentation:** Tabs (not spaces)
- **Quotes:** Single quotes
- **Semicolons:** Required
- **Brace style:** Stroustrup
- **No `console.log`** in production code
- **No trailing commas**
- **Line length:** Warn at 120 chars
- **Type-only imports:** Use the `type` keyword for imports that are only used as types
- **`.ts` file extensions in imports:** Always use explicit `.ts` extensions in relative import paths

## Commits and pull requests

- Keep commits focused and include tests for behavior changes
- For PRs, include a short problem/solution summary and link the related issue (if any)
- Use one of the following prefixes for the commit messages:
- `New:`, `Feat:` - New functionality
- `Change:` - Change to existing behavior
- `Fix:`, `Fixes:` - Bug-fix
- `Perf:` - Performance improvement
- `Security:` - Fix of a security issue
- `Docs:` - Documentation
- `Tests:` - Tests
- `Build:`, `CI:` - Build scripts change
- `Chore:`, `Internal Fix:` - Internal changes or fixes of not-yet-released functionality

## Licensing

By contributing, you agree that your contributions are licensed under the project license.
Loading