Skip to content
Closed
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
18 changes: 18 additions & 0 deletions .github/tools/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
echo "Verifying that all packages have the same major and minor version (patch version can be different)..."
version_base=$(cat package.json | jq '.version' --raw-output)
version_base=${version_base%.*}
echo "Base Version: $version_base"

find . -name "package.json" -type f -not -path "*/node_modules/*" -not -path "*/.next/*" -not -path "*/state/*" | sort | while read -r file; do
name_pkg=$(cat $file | jq '.name' --raw-output)
full_version_pkg=$(cat $file | jq '.version' --raw-output)
version_pkg="${full_version_pkg%.*}"

if [ "$version_base" != "$version_pkg" ]; then
echo "- $name_pkg: mismatch! (at $full_version_pkg)"
exit 1
else
echo "- $name_pkg: correct ($full_version_pkg)"
fi
done
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
strategy:
max-parallel: 1 # has to be 1 (one) as there are dependencies between the published packages
Expand All @@ -33,6 +33,7 @@ jobs:
- name: Publish Packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ matrix.package }}
echo "-- @krmx/${{ matrix.package }} --"
Expand Down Expand Up @@ -81,4 +82,8 @@ jobs:

# Publish the package
npm publish --provenance --access public

# Create a new tag for the published version of the package
git tag -a "${{ matrix.package }}@v$LOCAL_VERSION" -m "${{ matrix.package }}@v$LOCAL_VERSION"
git push origin "${{ matrix.package }}@v$LOCAL_VERSION"
fi
31 changes: 31 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,34 @@ jobs:
node-version: '22.x'
- name: Validate Packages
run: npm run validate

# Test tag creation and push
- name: Test Tag Push
run: |
# Set Git identity for the tag
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# Create a test tag with timestamp to ensure uniqueness
TIMESTAMP=$(date +%s)
TEST_TAG="test-tag-${TIMESTAMP}"

echo "Creating test tag: ${TEST_TAG}"
git tag -a "${TEST_TAG}" -m "Test tag ${TEST_TAG}"

# Push the tag using explicit credentials
echo "Pushing test tag to origin..."
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git "${TEST_TAG}"

# Verify tag was pushed successfully
echo "Tag pushed successfully!"
sleep 15 # Wait for a few seconds to ensure the tag is available

# Delete the tag both locally and remotely
echo "Deleting test tag..."
git tag -d "${TEST_TAG}"
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git :refs/tags/${TEST_TAG}

echo "Tag test completed successfully!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 1 addition & 19 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,5 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check versions
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "Verifying that all packages have the same major and minor version (patch version can be different)..."
version_base=$(cat package.json | jq '.version' --raw-output)
version_base=${version_base%.*}
echo "Base Version: $version_base"

find . -name "package.json" -type f -not -path "*/node_modules/*" -not -path "*/.next/*" -not -path "*/state/*" | sort | while read -r file; do
name_pkg=$(cat $file | jq '.name' --raw-output)
version_pkg=$(cat $file | jq '.version' --raw-output)
version_pkg="${version_pkg%.*}"

if [ "$version_base" != "$version_pkg" ]; then
echo "- $name_pkg: mismatch! (at $version_pkg)"
exit 1
else
echo "- $name_pkg: correct"
fi
done
.github/tools/version.sh
132 changes: 132 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[this form](https://www.simonkarman.nl/contact).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
73 changes: 73 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributing Guidelines

Thank you for your interest in contributing to our project! This document provides guidelines and instructions for contributors to help maintain code quality and ensure smooth collaboration.

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/yourusername/krmx.git`
3. Create a new branch: `git checkout -b feature/your-feature-name`
4. Run `npm install` to install dependencies
5. Make your changes
6. Test your changes thoroughly (run `npm run validate`)
7. Write documentation for your changes
8. Push your branch to your fork: `git push origin feature/your-feature-name`
9. Create a pull request to the main repository
10. Wait for your PR to be reviewed by maintainers

### Reporting Bugs

If you find a bug, please create an issue following these steps:
1. Check if the bug has already been reported
2. Include a clear title and description
3. Add steps to reproduce the bug
4. Include expected and actual behavior
5. Add relevant system information

### Pull Requests

When submitting a pull request:
1. Update documentation as needed
2. Add tests for new features
3. Follow the existing code style
4. Keep your changes focused and atomic
5. Link any related issues
6. Write a clear PR description

## Development Process
After installing the project with `npm install`, linting and tests will run automatically on every commit. Make sure that all steps succeeded before submitting a PR.

### Testing

- Write tests for new features
- Ensure all tests pass before submitting
- Update existing tests as needed
- Include both unit and integration tests where appropriate

## Documentation

- Update README.md if needed
- Document new features in the [docs](./docs) directory
- Update API documentation
- Include inline documentation for complex code
- Add examples for new functionality

## Review Process

1. Maintainers will review your PR
2. Address any requested changes
3. Once approved, your PR will be merged
4. Your contribution will be acknowledged

## Questions?

If you have questions:
1. Check existing documentation
2. Search closed issues
3. Open a new issue with the question label
4. Join our community chat/forum

## License
By contributing, you agree that your contributions will be licensed under the [project's license](./LICENSE).

Thank you for contributing to our project! Your efforts help make this project better for everyone.
Loading
Loading