tailwind-variants 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.commitlintrc.cjs +17 -0
- package/.editorconfig +9 -0
- package/.eslintignore +14 -0
- package/.eslintrc.json +70 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
- package/.github/assets/isotipo.png +0 -0
- package/.github/pull_request_template.md +27 -0
- package/.github/workflows/ci.yml +32 -0
- package/.github/workflows/commitlint.yml +34 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +9 -0
- package/.lintstagedrc.cjs +27 -0
- package/.nvmrc +1 -0
- package/.prettierignore +11 -0
- package/.prettierrc.json +12 -0
- package/CODE_OF_CONDUCT.md +46 -0
- package/CONTRIBUTING.md +64 -0
- package/clean-package.config.json +15 -0
- package/copy-types.cjs +36 -0
- package/jest.config.js +13 -0
- package/package.json +10 -14
- package/package.json.backup +103 -0
- package/pnpm-lock.yaml +6663 -0
- package/src/__tests__/transformer.test.ts +33 -0
- package/src/__tests__/tv.test.ts +1019 -0
- package/src/__tests__/utils.test.ts +18 -0
- package/src/config.d.ts +16 -0
- package/src/index.d.ts +83 -0
- package/src/index.js +207 -0
- package/src/transformer.d.ts +5 -0
- package/src/transformer.js +109 -0
- package/src/utils.d.ts +29 -0
- package/src/utils.js +48 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const conventional = require("@commitlint/config-conventional");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ["@commitlint/config-conventional"],
|
|
5
|
+
plugins: ["commitlint-plugin-function-rules"],
|
|
6
|
+
helpUrl:
|
|
7
|
+
"https://github.com/jrgarciadev/tailwind-variants/blob/main/CONTRIBUTING.MD#commit-convention",
|
|
8
|
+
rules: {
|
|
9
|
+
...conventional.rules,
|
|
10
|
+
"type-enum": [
|
|
11
|
+
2,
|
|
12
|
+
"always",
|
|
13
|
+
["feat", "feature", "fix", "refactor", "docs", "build", "test", "ci", "chore"],
|
|
14
|
+
],
|
|
15
|
+
"function-rules/header-max-length": [0],
|
|
16
|
+
},
|
|
17
|
+
};
|
package/.editorconfig
ADDED
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/eslintrc.json",
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": false,
|
|
5
|
+
"es2021": true,
|
|
6
|
+
"node": true
|
|
7
|
+
},
|
|
8
|
+
"extends": [
|
|
9
|
+
"plugin:prettier/recommended"
|
|
10
|
+
],
|
|
11
|
+
"plugins": ["prettier", "import", "@typescript-eslint"],
|
|
12
|
+
"parser": "@typescript-eslint/parser",
|
|
13
|
+
"parserOptions": {
|
|
14
|
+
"ecmaFeatures": {
|
|
15
|
+
"jsx": true
|
|
16
|
+
},
|
|
17
|
+
"ecmaVersion": 12,
|
|
18
|
+
"sourceType": "module"
|
|
19
|
+
},
|
|
20
|
+
"settings": {
|
|
21
|
+
"react": {
|
|
22
|
+
"version": "detect"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"rules": {
|
|
26
|
+
"no-console": "warn",
|
|
27
|
+
"prettier/prettier": "warn",
|
|
28
|
+
"@typescript-eslint/no-unused-vars": [
|
|
29
|
+
"warn",
|
|
30
|
+
{
|
|
31
|
+
"args": "after-used",
|
|
32
|
+
"ignoreRestSiblings": false,
|
|
33
|
+
"argsIgnorePattern": "^_.*?$"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"import/order": [
|
|
37
|
+
"warn",
|
|
38
|
+
{
|
|
39
|
+
"groups": [
|
|
40
|
+
"type",
|
|
41
|
+
"builtin",
|
|
42
|
+
"object",
|
|
43
|
+
"external",
|
|
44
|
+
"internal",
|
|
45
|
+
"parent",
|
|
46
|
+
"sibling",
|
|
47
|
+
"index"
|
|
48
|
+
],
|
|
49
|
+
"pathGroups": [
|
|
50
|
+
{
|
|
51
|
+
"pattern": "~/**",
|
|
52
|
+
"group": "external",
|
|
53
|
+
"position": "after"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"newlines-between": "always"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"padding-line-between-statements": [
|
|
60
|
+
"warn",
|
|
61
|
+
{"blankLine": "always", "prev": "*", "next": "return"},
|
|
62
|
+
{"blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
|
|
63
|
+
{
|
|
64
|
+
"blankLine": "any",
|
|
65
|
+
"prev": ["const", "let", "var"],
|
|
66
|
+
"next": ["const", "let", "var"]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ""
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
|
|
11
|
+
If your issue doesn't follow the templates provided, it will be closed without
|
|
12
|
+
comment – no exceptions.
|
|
13
|
+
|
|
14
|
+
For feature requests, please create a "Discussion" with the category "Ideas":
|
|
15
|
+
https://github.com/jrgarciadev/tailwind-variants/discussions/new
|
|
16
|
+
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
**Describe the bug**
|
|
20
|
+
A clear and concise description of what the bug is.
|
|
21
|
+
|
|
22
|
+
**To Reproduce**
|
|
23
|
+
Steps to reproduce the behavior:
|
|
24
|
+
|
|
25
|
+
1. Go to '...'
|
|
26
|
+
2. Click on '....'
|
|
27
|
+
3. Scroll down to '....'
|
|
28
|
+
4. See error
|
|
29
|
+
|
|
30
|
+
**Expected behavior**
|
|
31
|
+
A clear and concise description of what you expected to happen.
|
|
32
|
+
|
|
33
|
+
**Screenshots**
|
|
34
|
+
If applicable, add screenshots to help explain your problem.
|
|
35
|
+
|
|
36
|
+
**Desktop (please complete the following information):**
|
|
37
|
+
|
|
38
|
+
- OS: [e.g. iOS]
|
|
39
|
+
- Browser [e.g. chrome, safari]
|
|
40
|
+
- Version [e.g. 22]
|
|
41
|
+
|
|
42
|
+
**Smartphone (please complete the following information):**
|
|
43
|
+
|
|
44
|
+
- Device: [e.g. iPhone6]
|
|
45
|
+
- OS: [e.g. iOS8.1]
|
|
46
|
+
- Browser [e.g. stock browser, safari]
|
|
47
|
+
- Version [e.g. 22]
|
|
48
|
+
|
|
49
|
+
**Additional context**
|
|
50
|
+
Add any other context about the problem here.
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!-- Thank you for contributing! -->
|
|
2
|
+
|
|
3
|
+
### Description
|
|
4
|
+
|
|
5
|
+
<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
|
|
6
|
+
|
|
7
|
+
### Additional context
|
|
8
|
+
|
|
9
|
+
<!-- e.g. is there anything you'd like reviewers to focus on? -->
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### What is the purpose of this pull request?
|
|
14
|
+
|
|
15
|
+
<!-- (put an "X" next to an item) -->
|
|
16
|
+
|
|
17
|
+
- [ ] Bug fix
|
|
18
|
+
- [ ] New Feature
|
|
19
|
+
- [ ] Documentation update
|
|
20
|
+
- [ ] Other
|
|
21
|
+
|
|
22
|
+
### Before submitting the PR, please make sure you do the following
|
|
23
|
+
|
|
24
|
+
- [ ] Read the [Contributing Guidelines](https://github.com/jrgarciadev/tailwind-variants/blob/main/CONTRIBUTING.md).
|
|
25
|
+
- [ ] Follow the [Style Guide](https://github.com/jrgarciadev/tailwind-variants/blob/main/CONTRIBUTING.md#style-guide).
|
|
26
|
+
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
|
|
27
|
+
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
npm:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
script: [lint, test, build]
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout Codebase
|
|
18
|
+
uses: actions/checkout@v3
|
|
19
|
+
- name: Setup Pnpm
|
|
20
|
+
uses: pnpm/action-setup@v2
|
|
21
|
+
with:
|
|
22
|
+
run_install: false
|
|
23
|
+
- name: Setup Node
|
|
24
|
+
uses: actions/setup-node@v3
|
|
25
|
+
with:
|
|
26
|
+
cache: "pnpm"
|
|
27
|
+
check-latest: true
|
|
28
|
+
node-version-file: ".nvmrc"
|
|
29
|
+
- name: Install Dependencies
|
|
30
|
+
run: pnpm install --frozen-lockfile
|
|
31
|
+
- name: Run Script ${{ matrix.script }}
|
|
32
|
+
run: pnpm ${{ matrix.script }}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: commitlint
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
commitlint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout Codebase
|
|
10
|
+
uses: actions/checkout@v3
|
|
11
|
+
with:
|
|
12
|
+
fetch-depth: 0
|
|
13
|
+
- name: Setup pnpm
|
|
14
|
+
uses: pnpm/action-setup@v2
|
|
15
|
+
with:
|
|
16
|
+
run_install: false
|
|
17
|
+
- name: Setup Node
|
|
18
|
+
uses: actions/setup-node@v3
|
|
19
|
+
with:
|
|
20
|
+
cache: "pnpm"
|
|
21
|
+
check-latest: true
|
|
22
|
+
node-version-file: ".nvmrc"
|
|
23
|
+
- name: Install Dependencies
|
|
24
|
+
run: pnpm install --frozen-lockfile
|
|
25
|
+
- name: Run Commitlint
|
|
26
|
+
id: run_commitlint
|
|
27
|
+
uses: wagoid/commitlint-github-action@v5
|
|
28
|
+
with:
|
|
29
|
+
configFile: .commitlintrc.cjs
|
|
30
|
+
env:
|
|
31
|
+
NODE_PATH: ${{ github.workspace }}/node_modules
|
|
32
|
+
- name: Show Outputs
|
|
33
|
+
if: ${{ always() }}
|
|
34
|
+
run: echo ${{ toJSON(steps.run_commitlint.outputs.results) }}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const {relative} = require("path");
|
|
2
|
+
|
|
3
|
+
const {ESLint} = require("eslint");
|
|
4
|
+
|
|
5
|
+
const removeIgnoredFiles = async (files) => {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
const eslint = new ESLint();
|
|
8
|
+
const relativePaths = files.map((file) => relative(cwd, file));
|
|
9
|
+
const isIgnored = await Promise.all(relativePaths.map((file) => eslint.isPathIgnored(file)));
|
|
10
|
+
const filteredFiles = files.filter((_, i) => !isIgnored[i]);
|
|
11
|
+
|
|
12
|
+
return filteredFiles.join(" ");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
// *.!(js|ts|jsx|tsx|d.ts)
|
|
17
|
+
"**/*.{js,cjs,mjs,ts,jsx,tsx,json,md}": async (files) => {
|
|
18
|
+
const filesToLint = await removeIgnoredFiles(files);
|
|
19
|
+
|
|
20
|
+
return [`prettier --config .prettierrc.json --ignore-path --write ${filesToLint}`];
|
|
21
|
+
},
|
|
22
|
+
"**/*.{js,cjs,mjs,ts,jsx,tsx}": async (files) => {
|
|
23
|
+
const filesToLint = await removeIgnoredFiles(files);
|
|
24
|
+
|
|
25
|
+
return [`eslint -c .eslintrc.json --max-warnings=0 --fix ${filesToLint}`];
|
|
26
|
+
},
|
|
27
|
+
};
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
16.x
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/prettierrc.json",
|
|
3
|
+
"tabWidth": 2,
|
|
4
|
+
"printWidth": 100,
|
|
5
|
+
"semi": true,
|
|
6
|
+
"useTabs": false,
|
|
7
|
+
"singleQuote": false,
|
|
8
|
+
"bracketSpacing": false,
|
|
9
|
+
"endOfLine": "auto",
|
|
10
|
+
"arrowParens": "always",
|
|
11
|
+
"trailingComma": "all"
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
+
|
|
11
|
+
- Using welcoming and inclusive language
|
|
12
|
+
- Being respectful of differing viewpoints and experiences
|
|
13
|
+
- Gracefully accepting constructive criticism
|
|
14
|
+
- Focusing on what is best for the community
|
|
15
|
+
- Showing empathy towards other community members
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior by participants include:
|
|
18
|
+
|
|
19
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Our Responsibilities
|
|
26
|
+
|
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
+
|
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at jrgarciadev@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
+
|
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
+
|
|
41
|
+
## Attribution
|
|
42
|
+
|
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
|
44
|
+
|
|
45
|
+
[homepage]: http://contributor-covenant.org
|
|
46
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Welcome, and thanks for your interest in contributing! Please take a moment to review the following:
|
|
4
|
+
|
|
5
|
+
## Style Guide
|
|
6
|
+
|
|
7
|
+
- **Commits** follow the ["Conventional Commits" specification](https://www.conventionalcommits.org/en/v1.0.0/). This allows for changelogs to be generated automatically upon release.
|
|
8
|
+
- **Code** is formatted via [Prettier](https://prettier.io/)
|
|
9
|
+
- **JavaScript** is written as [TypeScript](https://www.typescriptlang.org/) where possible.
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
12
|
+
|
|
13
|
+
### Setup
|
|
14
|
+
|
|
15
|
+
1. [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) and clone to your machine.
|
|
16
|
+
2. Create a new branch with your contribution.
|
|
17
|
+
3. Install [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) on your machine.
|
|
18
|
+
4. In the repo, install dependencies via:
|
|
19
|
+
```sh
|
|
20
|
+
pnpm i
|
|
21
|
+
```
|
|
22
|
+
5. Voilà, you're ready to go!
|
|
23
|
+
|
|
24
|
+
### Scripts
|
|
25
|
+
|
|
26
|
+
- `pnpm dev` – runs jest, watching for file changes
|
|
27
|
+
- `pnpm build` – production build
|
|
28
|
+
- `pnpm check` – type checks
|
|
29
|
+
- `pnpm test`
|
|
30
|
+
|
|
31
|
+
### Commit Convention
|
|
32
|
+
|
|
33
|
+
Before you create a Pull Request, please check whether your commits comply with
|
|
34
|
+
the commit conventions used in this repository.
|
|
35
|
+
|
|
36
|
+
When you create a commit we kindly ask you to follow the convention
|
|
37
|
+
`category(scope or module): message` in your commit message while using one of
|
|
38
|
+
the following categories:
|
|
39
|
+
|
|
40
|
+
- `feat / feature`: all changes that introduce completely new code or new
|
|
41
|
+
features
|
|
42
|
+
- `fix`: changes that fix a bug (ideally you will additionally reference an
|
|
43
|
+
issue if present)
|
|
44
|
+
- `refactor`: any code related change that is not a fix nor a feature
|
|
45
|
+
- `build`: all changes regarding the build of the software, changes to
|
|
46
|
+
dependencies or the addition of new dependencies
|
|
47
|
+
- `test`: all changes regarding tests (adding new tests or changing existing
|
|
48
|
+
ones)
|
|
49
|
+
- `ci`: all changes regarding the configuration of continuous integration (i.e.
|
|
50
|
+
github actions, ci system)
|
|
51
|
+
- `chore`: all changes to the repository that do not fit into any of the above
|
|
52
|
+
categories
|
|
53
|
+
|
|
54
|
+
e.g. `feat(components): add new prop to the avatar component`
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
If you are interested in the detailed specification you can visit
|
|
58
|
+
https://www.conventionalcommits.org/ or check out the
|
|
59
|
+
[Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines).
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## Releases
|
|
63
|
+
|
|
64
|
+
A trade-off with using a personal repo is that permissions are fairly locked-down. In the mean-time releases will be made manually by the project owner.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"remove": ["tsup", "packageManager"],
|
|
3
|
+
"replace": {
|
|
4
|
+
"main": "dist/index.cjs",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/index.cjs",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./types/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/copy-types.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
const srcPath = path.join(__dirname, "src");
|
|
5
|
+
const typesPath = path.join(__dirname, "dist");
|
|
6
|
+
|
|
7
|
+
// Check if the "types" folder exists, if not, create it
|
|
8
|
+
if (!fs.existsSync(typesPath)) {
|
|
9
|
+
fs.mkdirSync(typesPath);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Read the files in the "src" folder
|
|
13
|
+
fs.readdir(srcPath, (err, files) => {
|
|
14
|
+
if (err) {
|
|
15
|
+
console.error(err);
|
|
16
|
+
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Iterate through the files in the "src" folder
|
|
21
|
+
files.forEach((file) => {
|
|
22
|
+
// Check if the file is a .d.ts file
|
|
23
|
+
if (file.endsWith(".d.ts")) {
|
|
24
|
+
// Construct the source and destination file paths
|
|
25
|
+
const srcFile = path.join(srcPath, file);
|
|
26
|
+
const destFile = path.join(typesPath, file);
|
|
27
|
+
|
|
28
|
+
// Copy the file
|
|
29
|
+
fs.copyFile(srcFile, destFile, (err) => {
|
|
30
|
+
if (err) {
|
|
31
|
+
console.error(err);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwind-variants",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "🦄 Tailwindcss first-class variant API",
|
|
5
5
|
"author": "Junior Garcia <jrgarciadev@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "dist/index.cjs",
|
|
19
|
-
"
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
20
|
"sideEffects": false,
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"require": "./dist/index.cjs",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"types": "./types/index.d.ts"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
24
28
|
"scripts": {
|
|
25
29
|
"build": "tsup && node copy-types.cjs",
|
|
26
30
|
"dev": "pnpm build:fast -- --watch",
|
|
@@ -80,13 +84,5 @@
|
|
|
80
84
|
"node": ">=16.x",
|
|
81
85
|
"pnpm": ">=7.x"
|
|
82
86
|
},
|
|
83
|
-
"module": "dist/index.js"
|
|
84
|
-
"types": "dist/index.d.ts",
|
|
85
|
-
"exports": {
|
|
86
|
-
".": {
|
|
87
|
-
"require": "./dist/index.cjs",
|
|
88
|
-
"import": "./dist/index.js",
|
|
89
|
-
"types": "./types/index.d.ts"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
87
|
+
"module": "dist/index.js"
|
|
92
88
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tailwind-variants",
|
|
3
|
+
"version": "0.0.21",
|
|
4
|
+
"description": "🦄 Tailwindcss first-class variant API",
|
|
5
|
+
"author": "Junior Garcia <jrgarciadev@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/nextui-org/tailwind-variants"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/nextui-org/tailwind-variants/issues"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "dist/index.cjs",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./dist/*": "./dist/*",
|
|
27
|
+
"./transformer": {
|
|
28
|
+
"types": "./dist/transformer.d.ts",
|
|
29
|
+
"default": "./dist/transformer.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup && node copy-types.cjs",
|
|
34
|
+
"dev": "pnpm build:fast -- --watch",
|
|
35
|
+
"clean": "rimraf dist .turbo",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"dry-run": "node ./scripts/dry-run.js",
|
|
38
|
+
"prepack": "clean-package",
|
|
39
|
+
"postpack": "clean-package restore",
|
|
40
|
+
"lint": "eslint -c .eslintrc.json ./src/**/*.{ts,tsx}",
|
|
41
|
+
"lint:fix": "eslint --fix -c .eslintrc.json ./src/**/*.{ts,tsx}",
|
|
42
|
+
"test": "jest --verbose"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"tailwind-merge": "^1.8.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@commitlint/cli": "^17.2.0",
|
|
49
|
+
"@commitlint/config-conventional": "^17.2.0",
|
|
50
|
+
"@swc-node/jest": "^1.5.2",
|
|
51
|
+
"@swc/cli": "0.1.57",
|
|
52
|
+
"@swc/core": "1.2.198",
|
|
53
|
+
"@types/jest": "28.1.1",
|
|
54
|
+
"@types/node": "^18.11.18",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
|
56
|
+
"@typescript-eslint/parser": "^5.42.0",
|
|
57
|
+
"clean-package": "2.1.1",
|
|
58
|
+
"eslint": "^7.29.0",
|
|
59
|
+
"eslint-config-prettier": "^8.2.0",
|
|
60
|
+
"eslint-config-ts-lambdas": "^1.2.3",
|
|
61
|
+
"eslint-import-resolver-typescript": "^2.4.0",
|
|
62
|
+
"eslint-loader": "^4.0.2",
|
|
63
|
+
"eslint-plugin-import": "^2.26.0",
|
|
64
|
+
"eslint-plugin-jest": "^24.3.6",
|
|
65
|
+
"eslint-plugin-node": "^11.1.0",
|
|
66
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
67
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
68
|
+
"prettier": "^2.2.1",
|
|
69
|
+
"prettier-eslint": "^12.0.0",
|
|
70
|
+
"prettier-eslint-cli": "^5.0.1",
|
|
71
|
+
"jest": "28.1.1",
|
|
72
|
+
"ts-node": "^10.9.1",
|
|
73
|
+
"tslib": "^2.4.1",
|
|
74
|
+
"tsup": "6.4.0",
|
|
75
|
+
"typescript": "4.6.2",
|
|
76
|
+
"webpack": "^5.53.0"
|
|
77
|
+
},
|
|
78
|
+
"keywords": [
|
|
79
|
+
"tailwindcss",
|
|
80
|
+
"classes",
|
|
81
|
+
"responsive",
|
|
82
|
+
"zero-runtime",
|
|
83
|
+
"variants",
|
|
84
|
+
"styled",
|
|
85
|
+
"styles"
|
|
86
|
+
],
|
|
87
|
+
"tsup": {
|
|
88
|
+
"clean": true,
|
|
89
|
+
"minify": true,
|
|
90
|
+
"treeshake": true,
|
|
91
|
+
"entry": ["src/*.js"],
|
|
92
|
+
"target": "es2019",
|
|
93
|
+
"format": [
|
|
94
|
+
"cjs",
|
|
95
|
+
"esm"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"packageManager": "pnpm@7.14.2",
|
|
99
|
+
"engines": {
|
|
100
|
+
"node": ">=16.x",
|
|
101
|
+
"pnpm": ">=7.x"
|
|
102
|
+
}
|
|
103
|
+
}
|