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

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22, 24, 25]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build package
run: npm run build

- name: Run test coverage
if: matrix.node-version == 24
run: npm run test:coverage

- name: Upload coverage reports
if: matrix.node-version == 24
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
29 changes: 0 additions & 29 deletions .github/workflows/node.js.yml

This file was deleted.

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

on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Version to publish (leave empty to use package.json version)'
required: false

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

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

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

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Build package
run: npm run build

- name: Update version (if specified)
if: github.event.inputs.version != ''
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
node_modules
node_modules
dist
*.log
.DS_Store
coverage
.vite
tanach.cjs
110 changes: 110 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Contributing to Tanach API

Thank you for your interest in contributing to the Tanach API! This document provides guidelines and instructions for contributing.

## Development Setup

1. **Fork and clone the repository**
```bash
git clone https://github.com/ShafehOrg/tanach.git
cd tanach
```

2. **Install dependencies**
```bash
npm install
```

3. **Run tests**
```bash
npm test
```

4. **Build the project**
```bash
npm run build
```

## Making Changes

1. **Create a branch**
```bash
git checkout -b feature/your-feature-name
```

2. **Make your changes**
- Write clean, maintainable code
- Follow TypeScript best practices
- Add tests for new features
- Update documentation as needed

3. **Test your changes**
```bash
npm test
npm run build
```

4. **Commit your changes**
```bash
git add .
git commit -m "Description of your changes"
```

5. **Push and create a pull request**
```bash
git push origin feature/your-feature-name
```

## Code Style

- Use TypeScript for all new code
- Follow the existing code style
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions focused and small

## Testing

- All new features must include tests
- Maintain or improve code coverage
- Run `npm run test:coverage` to check coverage
- Tests are written using Vitest

## Pull Request Process

1. Ensure all tests pass
2. Update the README.md if needed
3. Update the CHANGELOG.md (if exists)
4. Request review from maintainers
5. Address any feedback

## Data Updates

If you need to update the Tanach data:

1. Modify the source data in `tanach.js`
2. Run the conversion script:
```bash
npm run convert
```
3. Rebuild and test:
```bash
npm run build
npm test
```

## Reporting Issues

- Use the GitHub issue tracker
- Provide a clear description
- Include steps to reproduce
- Add relevant code examples
- Specify your environment (Node.js version, OS, etc.)

## Questions?

Feel free to open an issue for any questions or concerns!

## License

By contributing, you agree that your contributions will be licensed under the ISC License.
Loading