-
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.
Merge pull request #4 from zolplay-cn/cali
Add cva and config packages
- Loading branch information
Showing
28 changed files
with
2,972 additions
and
137 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,39 @@ | ||
pnpm-lock.yaml | ||
|
||
# changeset | ||
.changeset/ | ||
|
||
# dependencies | ||
node_modules | ||
.pnp | ||
.pnp.js | ||
|
||
# testing | ||
coverage | ||
|
||
# next.js | ||
.next | ||
.next/ | ||
out/ | ||
|
||
# production | ||
build | ||
dist | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env | ||
.env.* | ||
|
||
# vercel | ||
.vercel | ||
|
||
README.md |
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 @@ | ||
module.exports = require('./packages/config/prettier/preset') |
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
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,7 @@ | ||
# @zolplay/config | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- Formatted code |
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,94 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
globals: { | ||
React: true, | ||
JSX: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'next', | ||
'next/core-web-vitals', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
], | ||
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'], | ||
settings: { | ||
next: { | ||
rootDir: ['apps/*/', 'packages/*/'], | ||
}, | ||
}, | ||
rules: { | ||
'@next/next/no-html-link-for-pages': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'react/display-name': 'off', | ||
'react/jsx-key': 'off', | ||
'no-unused-vars': 'off', | ||
'no-console': 'off', | ||
|
||
//#region //*=========== Unused Import =========== | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'unused-imports/no-unused-imports': 'warn', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
//#endregion //*======== Unused Import =========== | ||
|
||
//#region //*=========== Import Sort =========== | ||
'simple-import-sort/exports': 'warn', | ||
'simple-import-sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
// ext library & side effect imports | ||
['^~?\\w', '^\\u0000'], | ||
// {s}css files | ||
['^.+\\.s?css$'], | ||
// Lib and hooks | ||
['^~/lib', '^~/hooks'], | ||
// components | ||
['^~/components', '^~/container'], | ||
// zustand store | ||
['^~/store'], | ||
// Other imports | ||
['^~/'], | ||
// relative paths up until 3 level | ||
[ | ||
'^\\./?$', | ||
'^\\.(?!/?$)', | ||
'^\\.\\./?$', | ||
'^\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\./\\.\\.(?!/?$)', | ||
], | ||
['^~/types'], | ||
// other that didn't fit in | ||
['^'], | ||
], | ||
}, | ||
], | ||
//#endregion //*======== Import Sort =========== | ||
}, | ||
ignorePatterns: [ | ||
'**/*.js', | ||
'**/*.json', | ||
'node_modules', | ||
'public', | ||
'styles', | ||
'.next', | ||
'coverage', | ||
'dist', | ||
'.turbo', | ||
], | ||
} |
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,56 @@ | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
], | ||
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'], | ||
rules: { | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'no-unused-vars': 'off', | ||
'no-console': 'off', | ||
|
||
//#region //*=========== Unused Import =========== | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'unused-imports/no-unused-imports': 'warn', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
//#endregion //*======== Unused Import =========== | ||
|
||
//#region //*=========== Import Sort =========== | ||
'simple-import-sort/exports': 'warn', | ||
'simple-import-sort/imports': [ | ||
'warn', | ||
{ | ||
groups: [ | ||
// ext library & side effect imports | ||
['^~?\\w', '^\\u0000'], | ||
// Other imports | ||
['^~/'], | ||
// relative paths up until 3 level | ||
[ | ||
'^\\./?$', | ||
'^\\.(?!/?$)', | ||
'^\\.\\./?$', | ||
'^\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\.(?!/?$)', | ||
'^\\.\\./\\.\\./\\.\\./?$', | ||
'^\\.\\./\\.\\./\\.\\.(?!/?$)', | ||
], | ||
['^~/types'], | ||
// other that didn't fit in | ||
['^'], | ||
], | ||
}, | ||
], | ||
//#endregion //*======== Import Sort =========== | ||
}, | ||
} |
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,17 @@ | ||
module.exports = { | ||
...require('./preset'), | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: ['@testing-library/jest-dom'], | ||
collectCoverageFrom: [ | ||
'**/*.{js,ts,jsx,tsx}', | ||
'!**/*.d.ts', | ||
'!**/node_modules/**', | ||
], | ||
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx'], | ||
transform: { | ||
'^.+\\.tsx?$': 'esbuild-jest', | ||
'^.+\\.jsx?$': 'esbuild-jest', | ||
}, | ||
coveragePathIgnorePatterns: [], | ||
coverageThreshold: null, | ||
} |
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,4 @@ | ||
module.exports = { | ||
resetMocks: true, | ||
moduleDirectories: ['node_modules'], | ||
} |
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,29 @@ | ||
{ | ||
"name": "@zolplay/config", | ||
"version": "0.1.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"files": [ | ||
"eslint", | ||
"jest", | ||
"postcss", | ||
"prettier" | ||
], | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.32.0", | ||
"@typescript-eslint/parser": "^5.32.0", | ||
"eslint": "^8.21.0", | ||
"eslint-config-next": "^12.2.4", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-react": "^7.31.10", | ||
"eslint-plugin-simple-import-sort": "^8.0.0", | ||
"eslint-plugin-unused-imports": "^2.0.0", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.8.4" | ||
}, | ||
"peerDependencies": { | ||
"next": "^12.0.0", | ||
"react": "^17.0.2||^18.0.0", | ||
"react-dom": "^17.0.2||^18.0.0" | ||
} | ||
} |
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,7 @@ | ||
module.exports = { | ||
plugins: { | ||
'tailwindcss/nesting': {}, | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
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,4 @@ | ||
module.exports = { | ||
...require('./preset'), | ||
plugins: [require('prettier-plugin-tailwindcss')], | ||
} |
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,9 @@ | ||
module.exports = { | ||
arrowParens: 'always', | ||
semi: false, | ||
trailingComma: 'es5', | ||
singleQuote: true, | ||
jsxSingleQuote: false, | ||
tabWidth: 2, | ||
useTabs: false, | ||
} |
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 @@ | ||
module.exports = require('@zolplay/config/eslint/preset') |
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,7 @@ | ||
# @zolplay/cva | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- Formatted code |
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,9 @@ | ||
# @zolplay/cva | ||
|
||
[![npm version](https://badge.fury.io/js/%40zolplay%2Fcva.svg)](https://badge.fury.io/js/%40zolplay%2Fcva) | ||
|
||
An adapter for the awesome original package `class-variance-authority`. | ||
|
||
CSS-in-TS libraries such as [Stitches](https://stitches.dev/docs/variants) and [Vanilla Extract](https://vanilla-extract.style/documentation/) are **fantastic** options for building type-safe UI components; taking away all the worries of class names and StyleSheet composition. | ||
|
||
`cva` aims to take those pain points away, allowing you to focus on the more fun aspects of UI development. |
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,38 @@ | ||
{ | ||
"name": "@zolplay/cva", | ||
"version": "0.1.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.mjs", | ||
"license": "MIT", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "tsup src/index.ts --format cjs,esm --dts", | ||
"dev": "pnpm run build --watch", | ||
"lint": "eslint *.ts*" | ||
}, | ||
"devDependencies": { | ||
"@zolplay/config": "workspace:*", | ||
"@zolplay/tsconfig": "workspace:*", | ||
"typescript": "^4.8.4" | ||
}, | ||
"dependencies": { | ||
"class-variance-authority": "^0.2.4" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zolplay-cn/core.git" | ||
}, | ||
"keywords": [ | ||
"utils", | ||
"cva", | ||
"class-variance-authority" | ||
], | ||
"author": "Cali Castle", | ||
"bugs": { | ||
"url": "https://github.com/zolplay-cn/core/issues" | ||
}, | ||
"homepage": "https://github.com/zolplay-cn/core#readme" | ||
} |
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,2 @@ | ||
export type { VariantProps } from 'class-variance-authority' | ||
export { cva } from 'class-variance-authority' |
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,6 @@ | ||
{ | ||
"extends": "@zolplay/tsconfig/public-base.json", | ||
"compilerOptions": { | ||
"target": "ESNext" | ||
} | ||
} |
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,7 @@ | ||
# @zolplay/tsconfig | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- Formatted code |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
{ | ||
"name": "tsconfig", | ||
"version": "0.0.0", | ||
"private": true, | ||
"name": "@zolplay/tsconfig", | ||
"version": "0.1.0", | ||
"license": "MIT", | ||
"files": [ | ||
"base.json", | ||
"nextjs.json", | ||
"react-library.json", | ||
"public-base.json" | ||
] | ||
], | ||
"peerDependencies": { | ||
"typescript": "^4.5.0" | ||
} | ||
} |
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 @@ | ||
module.exports = require('@zolplay/config/eslint/preset') |
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# @zolplay/utils | ||
|
||
## 1.1.2 | ||
|
||
### Patch Changes | ||
|
||
- Formatted code | ||
|
||
## 1.1.1 | ||
|
||
### Patch Changes | ||
|
Oops, something went wrong.