-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6304108
Showing
13 changed files
with
2,335 additions
and
0 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,18 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
} | ||
} |
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,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: rm package-lock.json | ||
- run: npm install | ||
- run: npm run build | ||
- run: npm test | ||
- name: Extract version from tag | ||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- run: npm version $VERSION --no-git-tag-version | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,23 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- run: rm package-lock.json | ||
- run: npm install | ||
- run: npm test |
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,19 @@ | ||
# IDE files | ||
.idea/ | ||
|
||
# Build output | ||
dist/ | ||
|
||
# Dependencies | ||
node_modules/ | ||
|
||
# Logs | ||
*.log | ||
|
||
# Environment variables | ||
.env | ||
.env.local | ||
|
||
# OS generated files | ||
.DS_Store | ||
Thumbs.db |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 TWindMerge | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,36 @@ | ||
# Git workflow commands | ||
wip: | ||
git add . | ||
git commit -m "WIP: Work in progress" | ||
git push | ||
|
||
# Install command | ||
install: | ||
npm install | ||
|
||
# Build command | ||
build: | ||
npm run build | ||
|
||
# Deploy command | ||
deploy: | ||
npm run deploy | ||
|
||
# Test command | ||
test: | ||
npm run test | ||
|
||
# Lint command | ||
lint: | ||
npm run lint | ||
|
||
# Display all available commands | ||
help: | ||
@echo "Available commands:" | ||
@echo " wip - Commit and push work in progress" | ||
@echo " install - Install dependencies" | ||
@echo " build - Build the project" | ||
@echo " deploy - Deploy the project" | ||
@echo " test - Run tests" | ||
@echo " lint - Run linter" | ||
@echo " help - Display this help message" |
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,55 @@ | ||
# TWindMerge | ||
|
||
TWindMerge is a utility for merging Tailwind CSS classes, keeping only the latest class when conflicts occur. | ||
|
||
### Demonstration: | ||
|
||
|
||
```typescript | ||
merge("text-gray-100 text-gray-50") | ||
-> "text-gray-50" | ||
merge(clsx("text-gray-100", "text-gray-50")) | ||
-> "text-gray-50" | ||
``` | ||
|
||
## Table of Contents | ||
|
||
- [TWindMerge](#TWindMerge) | ||
- [Table of Contents](#table-of-contents) | ||
- [Description](#description) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [License](#license) | ||
- [Contact](#contact) | ||
|
||
## Description | ||
|
||
TWindMerge provides a powerful solution for managing Tailwind CSS classes in dynamic environments. | ||
By keeping only the latest conflicting class, TWindMerge ensures that your styles are applied as intended, reducing unexpected visual outcomes and improving the maintainability of your codebase. | ||
|
||
|
||
## Installation | ||
|
||
```bash | ||
# Install the dependency | ||
npm install --save twindmerge | ||
|
||
``` | ||
|
||
## Usage | ||
|
||
```bash | ||
# Import and call the merge function | ||
import {merge} from 'twindmerge' | ||
<div className={merge("bg-red-200 bg-green-200")}></div> | ||
``` | ||
|
||
|
||
## License | ||
|
||
TWindMerge is released under the MIT License. See the [LICENSE](LICENSE) file for more details. | ||
|
||
## Contact | ||
|
||
For questions, suggestions, or issues related to TWindMerge, please open an issue on the GitHub repository. | ||
|
Oops, something went wrong.