-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve repository with various enhancements
--- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/owenthereal/jqplay?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
1 parent
edabd9a
commit e72a172
Showing
6 changed files
with
79 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Contributing to jqplay | ||
|
||
Thank you for considering contributing to jqplay! We welcome contributions from everyone. By participating in this project, you agree to abide by our code of conduct. | ||
|
||
## How to Contribute | ||
|
||
### Reporting Bugs | ||
|
||
If you find a bug, please report it by opening an issue on our [GitHub repository](https://github.com/owenthereal/jqplay/issues). Include as much detail as possible to help us understand and reproduce the issue. | ||
|
||
### Suggesting Features | ||
|
||
We welcome feature suggestions! If you have an idea for a new feature, please open an issue on our [GitHub repository](https://github.com/owenthereal/jqplay/issues) and describe your idea in detail. | ||
|
||
### Submitting Pull Requests | ||
|
||
1. **Fork the repository**: Click the "Fork" button at the top right corner of the repository page to create a copy of the repository in your GitHub account. | ||
|
||
2. **Clone your fork**: Clone your forked repository to your local machine using the following command: | ||
```sh | ||
git clone https://github.com/<your-username>/jqplay.git | ||
cd jqplay | ||
``` | ||
|
||
3. **Create a new branch**: Create a new branch for your changes using the following command: | ||
```sh | ||
git checkout -b my-feature-branch | ||
``` | ||
|
||
4. **Make your changes**: Make your changes to the codebase. Ensure that your code follows the project's coding style and conventions. | ||
5. **Test your changes**: Run the tests to ensure that your changes do not break any existing functionality. You can run the tests using the following command: | ||
```sh | ||
npm test | ||
``` | ||
6. **Commit your changes**: Commit your changes with a descriptive commit message using the following command: | ||
```sh | ||
git commit -m "Add feature XYZ" | ||
``` | ||
7. **Push your changes**: Push your changes to your forked repository using the following command: | ||
```sh | ||
git push origin my-feature-branch | ||
``` | ||
8. **Create a pull request**: Go to the original repository on GitHub and click the "New pull request" button. Select your branch from the "compare" dropdown and click "Create pull request". Provide a detailed description of your changes in the pull request. | ||
## Code Style | ||
Please ensure that your code follows the project's coding style and conventions. We use [ESLint](https://eslint.org/) to enforce code quality and consistency. You can run the linter using the following command: | ||
```sh | ||
npm run lint | ||
``` | ||
|
||
## Testing | ||
|
||
We use [Jest](https://jestjs.io/) for testing. Please ensure that your changes are covered by tests. You can run the tests using the following command: | ||
```sh | ||
npm test | ||
``` | ||
|
||
## Code of Conduct | ||
|
||
By participating in this project, you agree to abide by our [code of conduct](CODE_OF_CONDUCT.md). Please read it to understand the expectations for behavior when interacting with the community. | ||
|
||
## Thank You! | ||
|
||
Thank you for your contributions! Your support and involvement help make jqplay better for everyone. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { ZodError } from "zod"; | ||
|
||
export const currentUnixTimestamp = () => Math.floor(new Date().getTime() / 1000); | ||
export const currentUnixTimestamp = (): number => Math.floor(new Date().getTime() / 1000); | ||
|
||
export const generateMessageId = () => Math.random().toString(36).substring(2, 9); | ||
export const generateMessageId = (): string => Math.random().toString(36).substring(2, 9); | ||
|
||
export function normalizeLineBreaks(text: string | undefined | null) { | ||
export function normalizeLineBreaks(text: string | undefined | null): string { | ||
if (!text) { | ||
return ''; | ||
} | ||
|
||
return text.replace(/\r\n|\r/g, '\n'); | ||
} | ||
|
||
export function prettifyZodError(error: ZodError) { | ||
export function prettifyZodError(error: ZodError): string { | ||
return error.errors.map(e => `${e.path.join(', ')} ${e.message}`.toLowerCase()).join(', '); | ||
} |