Skip to content

Commit 833e2c4

Browse files
authored
docs: add CODE_OF_CONDUCT and CONTRIBUTING guidelines (#28)
1 parent 19ee847 commit 833e2c4

3 files changed

Lines changed: 139 additions & 22 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
# Contributor Covenant 3.0 Code of Conduct
3+
4+
## Our Pledge
5+
6+
We pledge to make our community welcoming, safe, and equitable for all.
7+
8+
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
9+
10+
## Encouraged Behaviors
11+
12+
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
13+
14+
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
15+
16+
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
17+
2. Engaging **kindly and honestly** with others.
18+
3. Respecting **different viewpoints** and experiences.
19+
4. **Taking responsibility** for our actions and contributions.
20+
5. Gracefully giving and accepting **constructive feedback**.
21+
6. Committing to **repairing harm** when it occurs.
22+
7. Behaving in other ways that promote and sustain the **well-being of our community**.
23+
24+
25+
## Restricted Behaviors
26+
27+
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
28+
29+
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
30+
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
31+
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
32+
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
33+
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
34+
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
35+
7. Behaving in other ways that **threaten the well-being** of our community.
36+
37+
### Other Restrictions
38+
39+
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
40+
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
41+
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
42+
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
43+
44+
45+
## Reporting an Issue
46+
47+
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
48+
49+
When an incident does occur, it is important to report it promptly. To report a possible violation, **hola.brikev@gmail.com**
50+
51+
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
52+
53+
54+
## Addressing and Repairing Harm
55+
56+
Violations may result in actions such as:
57+
58+
1. A private warning.
59+
2. Temporary or permanent removal from project spaces (issues, PRs, discussions).
60+
61+
Enforcement decisions will prioritize community safety and fairness.
62+
63+
## Scope
64+
65+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other 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.
66+
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
71+
72+
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
73+
74+
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
75+

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Contributing to twd-js
2+
3+
Thanks for your interest in twd-js. TWD (Testing Web Development) is a library designed to seamlessly integrate testing into your web development workflow. It streamlines the process of writing, running, and managing tests directly in your application, with a modern UI and powerful mocking capabilities.
4+
5+
## Contributions
6+
7+
twd-js welcomes contributions from everyone.
8+
9+
Contributions to twd-js should be made in the form of GitHub pull requests. Each pull request will be reviewed by a core contributor [@kevinccbsg](https://github.com/kevinccbsg) and either landed in the main tree or given feedback for changes that would be required.
10+
11+
## Getting Started
12+
13+
twd-js's [open issues are here](https://github.com/BRIKEV/twd/issues).
14+
15+
You can clone this repository and run this command to start using developing this package.
16+
17+
```
18+
npm install
19+
```
20+
21+
If you want to test it you can add a new test in [this folder](https://github.com/BRIKEV/twd/tree/main/test) or you can create a new example [here](https://github.com/BRIKEV/twd/tree/main/examples).
22+
23+
To execute package's tests you have run this command:
24+
25+
```
26+
npm test
27+
```
28+
29+
## Pull Request Checklist
30+
31+
- [Check validations](https://github.com/BRIKEV/twd/actions?query=workflow%3ABuild) should pass. This one includes linting and testing.
32+
33+
- Commits should be as small as possible, while ensuring that each commit is
34+
correct independently (i.e., each commit should compile and pass tests).
35+
36+
- If your patch is not getting reviewed or you need a specific person to review
37+
it, you can @-reply a reviewer asking for a review in the pull request or a
38+
comment.
39+
40+
41+
## Conduct
42+
43+
We follow the [twd-js Code of Conduct](https://github.com/BRIKEV/twd/blob/main/CODE_OF_CONDUCT.md).
44+
45+
All code in this repository is under [MIT License](https://github.com/BRIKEV/twd/blob/main/LICENSE.md).

README.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
> ⚠️ This is a **beta release** – expect frequent updates and possible breaking changes.
1010
11-
1211
TWD (Testing Web Development) is a library designed to seamlessly integrate testing into your web development workflow. It streamlines the process of writing, running, and managing tests directly in your application, with a modern UI and powerful mocking capabilities.
1312

1413
Currently, TWD supports React, with plans to add more frameworks soon.
@@ -39,23 +38,22 @@ yarn add twd-js
3938
pnpm add twd-js
4039
```
4140

42-
4341
## Quick Start
4442

4543
1. **Add the TWD Sidebar to your React app:**
4644

4745
```tsx
48-
import { StrictMode } from 'react';
49-
import { createRoot } from 'react-dom/client';
50-
import App from './App';
51-
import './index.css';
52-
import { TWDSidebar } from 'twd-js';
46+
import { StrictMode } from "react";
47+
import { createRoot } from "react-dom/client";
48+
import App from "./App";
49+
import "./index.css";
50+
import { TWDSidebar } from "twd-js";
5351

54-
createRoot(document.getElementById('root')!).render(
52+
createRoot(document.getElementById("root")!).render(
5553
<StrictMode>
5654
<App />
5755
<TWDSidebar />
58-
</StrictMode>,
56+
</StrictMode>
5957
);
6058
```
6159

@@ -87,17 +85,18 @@ pnpm add twd-js
8785
- With Vite:
8886

8987
```ts
90-
import { twd } from "twd-js";
88+
import { twd } from "twd-js";
9189
// src/loadTests.ts
92-
import.meta.glob("./**/*.twd.test.ts", { eager: true });
90+
import.meta.glob("./**/*.twd.test.ts", { eager: true });
9391
// Initialize request mocking once
94-
twd.initRequestMocking()
95-
.then(() => {
96-
console.log("Request mocking initialized");
97-
})
98-
.catch((err) => {
99-
console.error("Error initializing request mocking:", err);
100-
});
92+
twd
93+
.initRequestMocking()
94+
.then(() => {
95+
console.log("Request mocking initialized");
96+
})
97+
.catch((err) => {
98+
console.error("Error initializing request mocking:", err);
99+
});
101100
// No need to export anything
102101
```
103102

@@ -112,7 +111,7 @@ pnpm add twd-js
112111
Import `loadTests.ts` in your main entry (e.g., `main.tsx`):
113112

114113
```tsx
115-
import './loadTests';
114+
import "./loadTests";
116115
```
117116

118117
4. **Run your app and open the TWD sidebar** to see and run your tests in the browser.
@@ -121,23 +120,21 @@ pnpm add twd-js
121120

122121
## Mock Service Worker (API Mocking)
123122

124-
125123
TWD provides a CLI to easily set up a mock service worker for API/request mocking in your app. You do **not** need to manually register the service worker in your appTWD handles this automatically when you use `twd.initRequestMocking()` in your tests.
126124

127125
### Install the mock service worker
128126

129127
Run the following command in your project root:
130128

131129
```bash
132-
npx twd-mock init <public-dir> [--save]
130+
npx twd-js init <public-dir> [--save]
133131
```
134132

135133
- Replace `<public-dir>` with the path to your app's public/static directory (e.g., `public/` or `dist/`).
136134
- Use `--save` to print a registration snippet for your app.
137135

138136
This will copy `mock-sw.js` to your public directory.
139137

140-
141138
### How to use request mocking in your tests
142139

143140
Just call `await twd.initRequestMocking()` at the start of your test, then use `twd.mockRequest` to define your mocks. Example:

0 commit comments

Comments
 (0)