Skip to content

Commit

Permalink
feat: initial commit (#12)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: v1.0.0
  • Loading branch information
phuctm97 authored Apr 27, 2022
1 parent 625d937 commit 7185dd7
Show file tree
Hide file tree
Showing 16 changed files with 4,676 additions and 38 deletions.
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
interval: monthly
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [master]

jobs:
build-release:
name: Build/Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
cache: yarn
- run: yarn install --frozen-lockfile
- name: Run yarn commitlint --from=head_commit.message
run: echo "${{ github.event.head_commit.message }}" | yarn commitlint
- run: yarn prettier --check .
- run: yarn cspell --no-must-find-files '**'
- run: yarn semantic-release --branches ${{ github.ref_name }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/pr-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR / Metadata

on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened, edited]

permissions:
pull-requests: write
contents: write

jobs:
validate-metadata:
name: Validate metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
cache: yarn
- run: yarn install --frozen-lockfile
- name: Run yarn commitlint --from=pull_request.title
run: echo "${{ github.event.pull_request.title }}" | yarn commitlint
auto-merge:
name: Auto-merge
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: dependabot/[email protected]
id: dependabot-metadata
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }}
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/pr-sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR / Sources

on:
pull_request:
branches: [master]

jobs:
validate-sources:
name: Validate sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn prettier --check .
- run: yarn cspell --no-must-find-files '**'
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
# Node.js
/node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
node_modules
.DS_Store
.AppleDouble
.LSOverride
logs
*.log
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["esbenp.prettier-vscode"]
"recommendations": [
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"vivaxy.vscode-conventional-commits"
]
}
16 changes: 8 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
// Code style
"javascript.suggestionActions.enabled": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,

// Misc
"files.exclude": {
"node_modules/": true,
"yarn.lock": true
}
"node_modules": true,
"yarn.lock": true,
".husky": true
},
"conventionalCommits.gitmoji": false
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 Minh-Phuc Tran
Copyright (c) 2020-2022 Minh-Phuc Tran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

TailwindCSS utility to override background fill color using `box-shadow`, is especially useful to style autocompleted form fields with [tailwindcss-autofill] because `background-color` won't work.

## Requirements

- Node.js 12+

- TailwindCSS 2+

## Install

```bash
Expand Down Expand Up @@ -42,11 +48,29 @@ Style your components using `shadow-fill-{color}`, e.g. `shadow-fill-gray-100`,
<input className="shadow-fill-white dark:shadow-fill-black" />
```

## Requirements
## Contributing

- Node.js 12+
### Requirements

- Node 12+

- Yarn 1.22+

### Setup

1. Install requirements

2. Clone the repository

3. Run `yarn` to install dependencies

### Develop

- Commit adhering to [Angular commit convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit), use `yarn commit` or [Code conventional commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) to commit interactively

- Submit a PR and make sure required status checks pass

- TailwindCSS 2
- When a PR is merged or code is pushed to `master`, Github automatically builds and publishes a new release if there're relevant changes

---

Expand Down
4 changes: 4 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: ["@commitlint/config-angular"],
ignores: [(commit) => /^build\((deps|deps-dev)\): bump/.test(commit)],
};
4 changes: 4 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"words": ["commitlint", "minh-phuc", "phuctm", "tailwindcss"],
"ignorePaths": ["package.json", "cspell.json", ".vscode"]
}
3 changes: 3 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"*": ["prettier --write --ignore-unknown", "cspell --no-must-find-files"],
};
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "tailwindcss-shadow-fill",
"version": "0.1.0",
"private": false,
"license": "MIT",
"description": "🎨 TailwindCSS utility to override background fill color using shadow.",
"keywords": [
"tailwindcss",
Expand All @@ -9,28 +11,32 @@
"tailwindcss-utility"
],
"repository": "https://github.com/phuctm97/tailwindcss-shadow-fill",
"main": "index.js",
"files": [
"index.js"
],
"author": {
"name": "Minh-Phuc Tran",
"email": "[email protected]",
"url": "https://phuctm97.com"
},
"license": "MIT",
"private": false,
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"style:check": "prettier --check .",
"style:format": "prettier --write ."
"prepare": "husky install"
},
"dependencies": {
"flatten-tailwindcss-theme": "^0.1.1"
},
"peerDependencies": {
"tailwindcss": "^2.0.2"
"tailwindcss": ">=2.0.0"
},
"devDependencies": {
"prettier": "^2.4.1"
"@commitlint/cli": "^16.2.3",
"@commitlint/config-angular": "^16.2.3",
"@commitlint/prompt-cli": "^16.2.3",
"cspell": "^5.19.7",
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2",
"semantic-release": "^19.0.2"
}
}
Loading

0 comments on commit 7185dd7

Please sign in to comment.