Skip to content

Commit ee251c3

Browse files
committed
docs and deps update
1 parent a3d09cf commit ee251c3

File tree

9 files changed

+605
-263
lines changed

9 files changed

+605
-263
lines changed

CODE_OF_CONDUCT.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[INSERT CONTACT METHOD].
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][mozilla coc].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[mozilla coc]: https://github.com/mozilla/diversity
131+
[faq]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,93 @@
1-
# Contributing
1+
# Contributing to Twind
2+
3+
Thanks for checking out Twind! Please read on to learn how you can help make this project even better.
4+
5+
## Ways to help
6+
7+
Regardless of your experience level, there are ways that you can help:
8+
9+
- Share the project on Twitter
10+
- Star the project on Github
11+
- Tell your friends/co-workers about Twind
12+
- Write an article about Twind on Medium, Dev, or your platform of choice
13+
- Create written or video tutorials about Twind
14+
- Report bugs or provide feedback by [creating issues](https://github.com/tw-in-js/twind)
15+
- Contribute to the source code by fixing bugs/issues or helping us build new features
16+
17+
## Ideas
18+
19+
If you think anything here sounds like a good idea and/or would like to make it happen, please [file an issue](https://github.com/tw-in-js/twind) and let us know!
20+
21+
## How to create a good bug report
22+
23+
To be able to fix issues we need to see them on our machine. This is only possible when we can reproduce the error. The easiest way to do that is narrow down the problem to specific components or combination of them. This can be done by removing as much unrelated code as possible.
24+
25+
The perfect way to do that is to make a [codesandbox](https://codesandbox.io/). That way you can easily share the problematic code and ensure that others can see the same issue you are seeing.
26+
27+
For us a [codesandbox](https://codesandbox.io/) says more than a 1000 words :tada:
28+
29+
## Local development
30+
31+
The Twind repo is a monorepo using pnpm workspaces. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/).
32+
33+
To develop and test a `twind` package:
34+
35+
1. Run `pnpm install` in `twind`'s root folder
36+
37+
2. Run `pnpm test` to run all tests
38+
39+
<details>
40+
41+
<summary>We recommend installing <a href="https://github.com/antfu/ni" rel="external">ni</a> to help switching between repos using different package managers.</summary>
42+
43+
`ni` also provides the handy `nr` command which running npm scripts easier:
44+
45+
- `ni` is equivalent to `pnpm install`
46+
- `nr test` is equivalent to `pnpm run test`
47+
48+
</details>
49+
50+
### Testing Twind against external packages
51+
52+
You may wish to test your locally-modified copy of Twind against another package that is using it. For pnpm, after building Twind, you can use [`pnpm.overrides`](https://pnpm.io/package_json#pnpmoverrides). Please note that `pnpm.overrides` must be specified in the root `package.json` and you must first list the package as a dependency in the root `package.json`:
53+
54+
```json
55+
{
56+
"dependencies": {
57+
"twind": "*"
58+
},
59+
"pnpm": {
60+
"overrides": {
61+
"twind": "link:../path/to/twind/packages/twind"
62+
}
63+
}
64+
}
65+
```
66+
67+
And re-run `pnpm install` to link the package.
68+
69+
## Pull Request Guidelines
70+
71+
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
72+
73+
- If adding a new feature:
74+
75+
- Add accompanying test case.
76+
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
77+
78+
- If fixing bug:
79+
80+
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
81+
- Provide a detailed description of the bug in the PR. Live demo preferred.
82+
- Add appropriate test coverage if applicable.
83+
84+
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
85+
86+
- Make sure tests pass!
87+
88+
- Commit messages must follow the [commit message convention](./.github/commit-convention.md) so that changelogs can be automatically generated.
89+
90+
## TODO
291

392
- how to contribute
493
- issues: templates on stackplitz, codesandbox, ...

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"format": "prettier --write --ignore-path .gitignore . '!pnpm-lock.yaml'",
2626
"check": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx --ignore-path .gitignore .",
2727
"check:fix": "npm run check -- --fix",
28-
"test": "vitest --reporter dot",
28+
"test": "vitest",
2929
"test:ui": "npm test -- --open",
30-
"test:coverage": "npm test -- --coverage",
30+
"test:coverage": "vitest run --coverage",
3131
"preinstall": "npx only-allow pnpm",
3232
"prepare": "husky install"
3333
},
@@ -36,22 +36,23 @@
3636
"@changesets/get-github-info": "^0.5.0",
3737
"@size-limit/esbuild": "^7.0.5",
3838
"@size-limit/file": "^7.0.5",
39-
"@typescript-eslint/eslint-plugin": "^5.9.0",
40-
"@typescript-eslint/parser": "^5.9.0",
41-
"@vitest/ui": "^0.0.134",
39+
"@typescript-eslint/eslint-plugin": "^5.9.1",
40+
"@typescript-eslint/parser": "^5.9.1",
41+
"@vitest/ui": "^0.0.139",
42+
"c8": "^7.11.0",
4243
"distilt": "^0.12.0",
4344
"dotenv": "^10.0.0",
4445
"eslint": "^8.6.0",
4546
"eslint-config-prettier": "^8.3.0",
4647
"eslint-plugin-prettier": "^4.0.0",
4748
"husky": "^7.0.4",
48-
"lint-staged": "^12.1.5",
49+
"lint-staged": "^12.1.7",
4950
"only-allow": "^1.0.0",
5051
"prettier": "^2.5.1",
5152
"size-limit": "^7.0.5",
5253
"tslib": "^2.3.1",
5354
"typescript": "^4.5.4",
54-
"vitest": "^0.0.134"
55+
"vitest": "^0.0.139"
5556
},
5657
"prettier": {
5758
"printWidth": 100,
@@ -100,7 +101,10 @@
100101
]
101102
},
102103
"lint-staged": {
103-
"*.{js,jsx,cjs,mjs,ts,tsx}": "eslint --cache --fix",
104+
"*.{js,jsx,cjs,mjs,ts,tsx}": [
105+
"eslint --cache --fix",
106+
"vitest related --run --silent"
107+
],
104108
"!(pnpm-lock.yaml)*": "prettier --ignore-unknown --write"
105109
}
106110
}

packages/preset-autoprefix/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
}
7070
},
7171
"devDependencies": {
72-
"@twind/core": "1.0.0-next.5"
72+
"@twind/core": "workspace:1.0.0-next.5"
7373
},
7474
"scripts": {
7575
"build": "distilt",

packages/preset-mini/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
}
6363
},
6464
"devDependencies": {
65-
"@twind/core": "1.0.0-next.5",
66-
"@twind/preset-tailwind": "1.0.0-next.5"
65+
"@twind/core": "workspace:1.0.0-next.5",
66+
"@twind/preset-tailwind": "workspace:1.0.0-next.5"
6767
},
6868
"scripts": {
6969
"build": "distilt",

packages/preset-tailwind/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
}
5252
},
5353
"devDependencies": {
54-
"@twind/core": "1.0.0-next.5"
54+
"@twind/core": "workspace:1.0.0-next.5"
5555
},
5656
"scripts": {
5757
"build": "distilt",

packages/runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"devDependencies": {
63-
"@twind/core": "1.0.0-next.5"
63+
"@twind/core": "workspace:1.0.0-next.5"
6464
},
6565
"scripts": {
6666
"build": "distilt",

packages/twind/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@
9191
"@twind/preset-tailwind"
9292
],
9393
"dependencies": {
94-
"@twind/core": "1.0.0-next.5",
95-
"@twind/runtime": "1.0.0-next.5",
96-
"@twind/preset-autoprefix": "1.0.0-next.5",
97-
"@twind/preset-mini": "1.0.0-next.5",
98-
"@twind/preset-tailwind": "1.0.0-next.5"
94+
"@twind/core": "workspace:1.0.0-next.5",
95+
"@twind/preset-autoprefix": "workspace:1.0.0-next.5",
96+
"@twind/preset-mini": "workspace:1.0.0-next.5",
97+
"@twind/preset-tailwind": "workspace:1.0.0-next.5",
98+
"@twind/runtime": "workspace:1.0.0-next.5"
9999
},
100100
"peerDependencies": {
101101
"typescript": "^4.4.0"

0 commit comments

Comments
 (0)