|
1 | | -# Contributor Covenant Code of Conduct |
| 1 | +# Contributing to Socialify |
2 | 2 |
|
3 | | -## Our Pledge |
| 3 | +Thank you for your interest in contributing to Socialify! We welcome contributions from the community. |
4 | 4 |
|
5 | | -In the interest of fostering an open and welcoming environment, we as |
6 | | -contributors and maintainers pledge to make participation in our project and |
7 | | -our community a harassment-free experience for everyone, regardless of age, body |
8 | | -size, disability, ethnicity, sex characteristics, gender identity and expression, |
9 | | -level of experience, education, socio-economic status, nationality, personal |
10 | | -appearance, race, religion, or sexual identity and orientation. |
| 5 | +Please read and agree to our [Code of Conduct](./CODE_OF_CONDUCT.md) before contributing. |
11 | 6 |
|
12 | | -## Our Standards |
| 7 | +## Development Setup |
13 | 8 |
|
14 | | -Examples of behavior that contributes to creating a positive environment |
15 | | -include: |
| 9 | +### Prerequisites |
16 | 10 |
|
17 | | -- Using welcoming and inclusive language |
18 | | -- Being respectful of differing viewpoints and experiences |
19 | | -- Gracefully accepting constructive criticism |
20 | | -- Focusing on what is best for the community |
21 | | -- Showing empathy towards other community members |
| 11 | +- Node.js 22 (see `.nvmrc`) |
| 12 | +- pnpm package manager |
22 | 13 |
|
23 | | -Examples of unacceptable behavior by participants include: |
| 14 | +### Getting Started |
24 | 15 |
|
25 | | -- The use of sexualized language or imagery and unwelcome sexual attention or |
26 | | - advances |
27 | | -- Trolling, insulting/derogatory comments, and personal or political attacks |
28 | | -- Public or private harassment |
29 | | -- Publishing others' private information, such as a physical or electronic |
30 | | - address, without explicit permission |
31 | | -- Other conduct which could reasonably be considered inappropriate in a |
32 | | - professional setting |
| 16 | +```bash |
| 17 | +# Clone the repository (or your fork) |
| 18 | +git clone https://github.com/wei/socialify.git && cd socialify |
33 | 19 |
|
34 | | -## Our Responsibilities |
| 20 | +# Set environment variables |
| 21 | +cp .env.example .env |
| 22 | +# Edit .env and add your GITHUB_TOKEN |
35 | 23 |
|
36 | | -Project maintainers are responsible for clarifying the standards of acceptable |
37 | | -behavior and are expected to take appropriate and fair corrective action in |
38 | | -response to any instances of unacceptable behavior. |
| 24 | +# Install dependencies |
| 25 | +pnpm install |
39 | 26 |
|
40 | | -Project maintainers have the right and responsibility to remove, edit, or |
41 | | -reject comments, commits, code, wiki edits, issues, and other contributions |
42 | | -that are not aligned to this Code of Conduct, or to ban temporarily or |
43 | | -permanently any contributor for other behaviors that they deem inappropriate, |
44 | | -threatening, offensive, or harmful. |
| 27 | +# Start development server |
| 28 | +pnpm dev |
| 29 | +``` |
45 | 30 |
|
46 | | -## Scope |
| 31 | +Open http://localhost:3000 to view the app. |
47 | 32 |
|
48 | | -This Code of Conduct applies within all project spaces, and it also applies when |
49 | | -an individual is representing the project or its community in public spaces. |
50 | | -Examples of representing a project or community include using an official |
51 | | -project e-mail address, posting via an official social media account, or acting |
52 | | -as an appointed representative at an online or offline event. Representation of |
53 | | -a project may be further defined and clarified by project maintainers. |
| 33 | +### Environment Variables |
54 | 34 |
|
55 | | -## Enforcement |
| 35 | +| Variable | Required | Description | |
| 36 | +|----------|----------|-------------| |
| 37 | +| `GITHUB_TOKEN` | Yes | GitHub PAT with public repo read access. [Create one here](https://github.com/settings/personal-access-tokens/new) | |
| 38 | +| `PROJECT_URL` | No | Base URL (default: http://localhost:3000) | |
| 39 | +| `GTM_ID` | No | Google Tag Manager ID | |
56 | 40 |
|
57 | | -Instances of abusive, harassing, or otherwise unacceptable behavior may be |
58 | | -reported by contacting the project team at github@weispot.com. All |
59 | | -complaints will be reviewed and investigated and will result in a response that |
60 | | -is deemed necessary and appropriate to the circumstances. The project team is |
61 | | -obligated to maintain confidentiality with regard to the reporter of an incident. |
62 | | -Further details of specific enforcement policies may be posted separately. |
| 41 | +### Dev Container |
63 | 42 |
|
64 | | -Project maintainers who do not follow or enforce the Code of Conduct in good |
65 | | -faith may face temporary or permanent repercussions as determined by other |
66 | | -members of the project's leadership. |
| 43 | +[](https://open.vscode.dev/wei/socialify) |
67 | 44 |
|
68 | | -## Attribution |
| 45 | +If you have VS Code and Docker installed, you can [open in Dev Container](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/wei/socialify) for a pre-configured development environment. |
69 | 46 |
|
70 | | -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, |
71 | | -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html |
| 47 | +## Code Style |
72 | 48 |
|
73 | | -[homepage]: https://www.contributor-covenant.org |
| 49 | +Socialify uses [Biome](https://biomejs.dev/) for linting and formatting. |
74 | 50 |
|
75 | | -For answers to common questions about this code of conduct, see |
76 | | -https://www.contributor-covenant.org/faq |
| 51 | +```bash |
| 52 | +# Check for lint errors |
| 53 | +pnpm lint |
| 54 | + |
| 55 | +# Auto-fix lint errors |
| 56 | +pnpm lint:fix |
| 57 | +``` |
| 58 | + |
| 59 | +## Testing |
| 60 | + |
| 61 | +### Unit Tests (Jest) |
| 62 | + |
| 63 | +```bash |
| 64 | +pnpm test:unit # Run tests |
| 65 | +pnpm test:unit:watch # Run in watch mode |
| 66 | +pnpm test:unit:update-snapshots # Update snapshots |
| 67 | +``` |
| 68 | + |
| 69 | +### End-to-End Tests (Playwright) |
| 70 | + |
| 71 | +```bash |
| 72 | +# First-time setup |
| 73 | +pnpm playwright:install |
| 74 | + |
| 75 | +# Run tests |
| 76 | +pnpm test:e2e |
| 77 | + |
| 78 | +# Update snapshots |
| 79 | +pnpm test:e2e:update-snapshots |
| 80 | + |
| 81 | +# View test report |
| 82 | +pnpm test:e2e:show-report |
| 83 | +``` |
| 84 | + |
| 85 | +## Submitting Changes |
| 86 | + |
| 87 | +### Before Submitting |
| 88 | + |
| 89 | +1. Run linting: `pnpm lint` |
| 90 | +2. Run unit tests: `pnpm test:unit` |
| 91 | +3. Build the project: `pnpm build` |
| 92 | + |
| 93 | +Or run all checks at once: `pnpm verify` |
| 94 | + |
| 95 | +### Commit Messages |
| 96 | + |
| 97 | +Use gitmoji-style commit messages. Prefix the summary with an emoji and a short, present-tense description. |
| 98 | + |
| 99 | +Examples: |
| 100 | + |
| 101 | +- `✨ Add themed background options` |
| 102 | +- `🐛 Fix cache header for SVG responses` |
| 103 | +- `📝 Update contributing guide` |
| 104 | + |
| 105 | +### Changesets |
| 106 | + |
| 107 | +Every PR requires **one** changeset file describing the change: |
| 108 | + |
| 109 | +1. Run `pnpm changeset` |
| 110 | +2. Select the semantic version type (major, minor, patch) |
| 111 | +3. Enter a concise description of your change |
| 112 | +4. Commit the generated `.changeset/*.md` file with your PR |
| 113 | + |
| 114 | +Example changeset content: |
| 115 | +```markdown |
| 116 | +--- |
| 117 | +"socialify": minor |
| 118 | +--- |
| 119 | + |
| 120 | +Added new background pattern option |
| 121 | +``` |
| 122 | + |
| 123 | +### Pull Request Guidelines |
| 124 | + |
| 125 | +- Keep changes focused and minimal |
| 126 | +- Include tests for new features |
| 127 | +- Update all relevant documentation |
| 128 | +- Let maintainers know if snapshot updates are required |
| 129 | + |
| 130 | +## Project Structure |
| 131 | + |
| 132 | +See [AGENTS.md](./AGENTS.md) for detailed project structure and architecture information. |
| 133 | + |
| 134 | +## Questions? |
| 135 | + |
| 136 | +Open an issue or discussion if you have questions about contributing. |
| 137 | + |
| 138 | +Thank you for helping make Socialify better! :heart: |
0 commit comments