From bf3f2c7ee0aa0c142a4e13897c666025ad663a61 Mon Sep 17 00:00:00 2001 From: Igor Katsuba Date: Fri, 20 Sep 2024 10:28:42 +0300 Subject: [PATCH] fix(core): exclude external libs in getSourceFiles --- .prettierrc | 5 +- docs/src/app/code-of-conduct/page.md | 48 +++++++++++ docs/src/app/coding-standards/page.md | 54 +++++++++++- docs/src/app/contribution-guide/page.md | 82 ++++++++++++++++++- docs/src/app/not-found.tsx | 13 +-- docs/src/app/providers.tsx | 6 +- docs/src/components/Button.tsx | 20 ++--- docs/src/components/Fence.tsx | 22 ++--- docs/src/components/Logo.tsx | 6 +- .../src/lib/source-file/get-source-files.ts | 8 +- 10 files changed, 213 insertions(+), 51 deletions(-) diff --git a/.prettierrc b/.prettierrc index fa14956..0545efb 100644 --- a/.prettierrc +++ b/.prettierrc @@ -10,10 +10,7 @@ } } ], - "plugins": [ - "prettier-plugin-packagejson", - "@ianvs/prettier-plugin-sort-imports" - ], + "plugins": ["prettier-plugin-packagejson", "@ianvs/prettier-plugin-sort-imports"], "importOrder": [ "", "", diff --git a/docs/src/app/code-of-conduct/page.md b/docs/src/app/code-of-conduct/page.md index e69de29..b737536 100644 --- a/docs/src/app/code-of-conduct/page.md +++ b/docs/src/app/code-of-conduct/page.md @@ -0,0 +1,48 @@ +# Code of Conduct + +As a community of developers, we strive to create a friendly, safe, and welcoming environment for +all, regardless of experience level, gender, gender identity and expression, sexual orientation, +disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit + permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are +expected to take appropriate and fair corrective action in response to any instances of unacceptable +behavior. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is +representing the project or its community. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting +the project team at [igor@katsuba.dev](mailto:igor@katsuba.dev) . All complaints will be reviewed +and investigated and will result in a response that is deemed necessary and appropriate to the +circumstances. + +## Attribution + +This Code of Conduct is adapted from the +[Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. diff --git a/docs/src/app/coding-standards/page.md b/docs/src/app/coding-standards/page.md index 950ca5e..afdace8 100644 --- a/docs/src/app/coding-standards/page.md +++ b/docs/src/app/coding-standards/page.md @@ -6,4 +6,56 @@ nextjs: description: 'Learn about the coding standards of `mutates`.' --- -WIP +# Coding Standards + +Welcome to the coding standards for the `mutates` project. This document outlines the guidelines and +best practices for contributing to the codebase. + +## General Guidelines + +- **Consistency**: Ensure that your code is consistent with the existing codebase. +- **Readability**: Write code that is easy to read and understand. +- **Documentation**: Document your code where necessary, especially for complex logic. + +## Code Style + +- **Indentation**: Use 2 spaces for indentation. +- **Line Length**: Limit lines to 100 characters. +- **Quotes**: Use single quotes for strings. +- **Semicolons**: Use semicolons at the end of statements. + +## TypeScript Specific + +- **Types**: Always define types for function parameters and return values. +- **Interfaces**: Prefer interfaces over type aliases for object shapes. +- **Enums**: Use enums for sets of related constants. + +## Example + +Here is an example of a well-formatted TypeScript function: + +```typescript +function greet(name: string): string { + return `Hello, ${name}`; +} +``` + +## Linting and Formatting + +We use ESLint and Prettier to enforce code style and formatting. Ensure that your code passes all +linting checks before submitting a pull request. + +## Commit Messages + +Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit +messages. This helps in automating the release process and generating changelogs. + +## Additional Resources + +For more detailed guidelines, refer to the following documents: + +- [Contribution Guide](/contribution-guide) +- [Frequently Asked Questions](/frequently-asked-questions) +- [Troubleshooting](/troubleshooting) + +Thank you for contributing to `mutates`! diff --git a/docs/src/app/contribution-guide/page.md b/docs/src/app/contribution-guide/page.md index 953ef69..0f7ba5e 100644 --- a/docs/src/app/contribution-guide/page.md +++ b/docs/src/app/contribution-guide/page.md @@ -6,4 +6,84 @@ nextjs: description: How to contribute to the Mutates project. --- -WIP +# Contributing to Mutates + +We're thrilled that you're interested in contributing to Mutates! This document provides guidelines +and information about how to contribute to our project. + +## Getting Started + +1. Fork the repository on GitHub. +2. Clone your fork locally: + ```bash + git clone https://github.com/your-username/mutates.git + cd mutates + ``` +3. Install dependencies: + ```bash + npm install + ``` +4. Create a branch for your contribution: + ```bash + git checkout -b feature/your-feature-name + ``` + +## Development Workflow + +1. Make your changes in the appropriate package(s). +2. Write or update tests for your changes. +3. Ensure all tests pass: + ```bash + nx affected --target=test + ``` +4. Update documentation if necessary. +5. Commit your changes with a clear and descriptive commit message. + +## Pull Request Process + +1. Push your changes to your fork on GitHub. +2. Open a pull request against the `main` branch of the Mutates repository. +3. Ensure your PR description clearly describes the problem and solution. +4. Link any relevant issues in the PR description. +5. Wait for review from maintainers. + +## Coding Standards + +- Follow the existing code style in the project. +- Use TypeScript for new code. +- Write clear, self-documenting code with appropriate comments where necessary. +- Ensure your code passes linting: + ```bash + nx affected --target=lint + ``` + +## Testing + +- Write unit tests for new functionality. +- Ensure all existing tests pass before submitting a PR. +- Aim for high test coverage for new code. + +## Documentation + +- Update relevant documentation for any new features or changes. +- Use clear and concise language in documentation. +- Include code examples where appropriate. + +## Reporting Issues + +- Use the GitHub issue tracker to report bugs or suggest features. +- Clearly describe the issue, including steps to reproduce for bugs. +- Check if the issue has already been reported before creating a new one. + +## Community and Conduct + +- Be respectful and inclusive in all interactions. +- Follow our [Code of Conduct](CODE_OF_CONDUCT.md). +- Help others in the community when you can. + +## Questions? + +If you have any questions about contributing, feel free to open an issue for discussion or reach out +to the maintainers directly. + +Thank you for contributing to Mutates! Your efforts help make this project better for everyone. diff --git a/docs/src/app/not-found.tsx b/docs/src/app/not-found.tsx index a41451d..ce42900 100644 --- a/docs/src/app/not-found.tsx +++ b/docs/src/app/not-found.tsx @@ -1,25 +1,20 @@ -import Link from 'next/link' +import Link from 'next/link'; export default function NotFound() { return (
-

- 404 -

+

404

Page not found

Sorry, we couldn’t find the page you’re looking for.

- + Go back home
- ) + ); } diff --git a/docs/src/app/providers.tsx b/docs/src/app/providers.tsx index d16b648..c03f620 100644 --- a/docs/src/app/providers.tsx +++ b/docs/src/app/providers.tsx @@ -1,11 +1,11 @@ -'use client' +'use client'; -import { ThemeProvider } from 'next-themes' +import { ThemeProvider } from 'next-themes'; export function Providers({ children }: { children: React.ReactNode }) { return ( {children} - ) + ); } diff --git a/docs/src/components/Button.tsx b/docs/src/components/Button.tsx index 068c104..a12df85 100644 --- a/docs/src/components/Button.tsx +++ b/docs/src/components/Button.tsx @@ -1,30 +1,26 @@ -import Link from 'next/link' -import clsx from 'clsx' +import clsx from 'clsx'; +import Link from 'next/link'; const variantStyles = { primary: 'rounded-full bg-sky-300 py-2 px-4 text-sm font-semibold text-slate-900 hover:bg-sky-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-300/50 active:bg-sky-500', secondary: 'rounded-full bg-slate-800 py-2 px-4 text-sm font-medium text-white hover:bg-slate-700 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/50 active:text-slate-400', -} +}; type ButtonProps = { - variant?: keyof typeof variantStyles + variant?: keyof typeof variantStyles; } & ( | React.ComponentPropsWithoutRef | (React.ComponentPropsWithoutRef<'button'> & { href?: undefined }) -) +); -export function Button({ - variant = 'primary', - className, - ...props -}: ButtonProps) { - className = clsx(variantStyles[variant], className) +export function Button({ variant = 'primary', className, ...props }: ButtonProps) { + className = clsx(variantStyles[variant], className); return typeof props.href === 'undefined' ? (