-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 d1e220d
Showing
63 changed files
with
11,066 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,32 @@ | ||
name: Commitlint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "push-action/**" | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
|
||
concurrency: | ||
group: commitlint-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-commits: | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node and pnpm | ||
uses: silverhand-io/actions-node-pnpm-run-steps@v4 | ||
with: | ||
pnpm-version: 9 | ||
|
||
- name: Commitlint | ||
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD | ||
|
||
- name: Commitlint on PR title | ||
run: echo '${{ github.event.pull_request.title }}' | npx commitlint |
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,28 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node and pnpm | ||
uses: silverhand-io/actions-node-pnpm-run-steps@v4 | ||
with: | ||
pnpm-version: 9 | ||
|
||
- name: Build | ||
run: pnpm -r build | ||
|
||
- name: Lint | ||
run: pnpm -r lint |
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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 @@ | ||
npx --no-install commitlint --edit "" |
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,3 @@ | ||
# Keep concurrency 1 to avoid lint-staged issue | ||
# Which may cause ALL your work LOST WITHOUT STASH | ||
FORCE_COLOR=1 pnpm -r --workspace-concurrency 1 --filter "[HEAD]" precommit |
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) 2022 Silverhand | ||
|
||
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,50 @@ | ||
# React + TypeScript + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default tseslint.config({ | ||
languageOptions: { | ||
// other options... | ||
parserOptions: { | ||
project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` | ||
- Optionally add `...tseslint.configs.stylisticTypeChecked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: | ||
|
||
```js | ||
// eslint.config.js | ||
import react from 'eslint-plugin-react' | ||
|
||
export default tseslint.config({ | ||
// Set the react version | ||
settings: { react: { version: '18.3' } }, | ||
plugins: { | ||
// Add the react plugin | ||
react, | ||
}, | ||
rules: { | ||
// other rules... | ||
// Enable its recommended rules | ||
...react.configs.recommended.rules, | ||
...react.configs['jsx-runtime'].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,11 @@ | ||
import conventional from '@commitlint/config-conventional'; | ||
import { UserConfig } from '@commitlint/types'; | ||
|
||
const config: UserConfig = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'type-enum': [2, 'always', [...conventional.rules['type-enum'][2], 'release']], | ||
}, | ||
}; | ||
|
||
export default config; |
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 @@ | ||
import js from "@eslint/js"; | ||
import reactHooks from "eslint-plugin-react-hooks"; | ||
import reactRefresh from "eslint-plugin-react-refresh"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default tseslint.config({ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ["**/*.{ts,tsx}"], | ||
ignores: ["dist"], | ||
plugins: { | ||
"react-hooks": reactHooks, | ||
"react-refresh": reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
"react-refresh/only-export-components": [ | ||
"warn", | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}); |
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,5 @@ | ||
module.exports = { | ||
'*.ts?(x)': ['eslint --cache --fix', () => 'tsc -p tsconfig.json --noEmit'], | ||
'*.scss': 'stylelint --fix', | ||
}; | ||
|
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": "root", | ||
"private": true, | ||
"type": "module", | ||
"license": "MPL-2.0", | ||
"author": "Silverhand Inc. <[email protected]>", | ||
"scripts": { | ||
"prepack": "pnpm -r prepack" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^19.0.0", | ||
"@commitlint/config-conventional": "^19.0.0", | ||
"@commitlint/types": "^19.0.0", | ||
"husky": "^9.0.11", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.3.4" | ||
}, | ||
"workspaces": { | ||
"packages": [ | ||
"packages/*" | ||
] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,53 @@ | ||
import { ForwardRefExoticComponent } from 'react'; | ||
import { HTMLProps } from 'react'; | ||
import { JSX as JSX_2 } from 'react/jsx-runtime'; | ||
import { ReactElement } from 'react'; | ||
import { ReactNode } from 'react'; | ||
import { RefAttributes } from 'react'; | ||
|
||
declare type BaseProps = Omit<HTMLProps<HTMLButtonElement>, 'type' | 'size' | 'title'> & { | ||
readonly htmlType?: 'button' | 'submit' | 'reset'; | ||
readonly type?: ButtonType; | ||
readonly size?: 'small' | 'large'; | ||
readonly isDisabled?: boolean; | ||
readonly isLoading?: boolean; | ||
readonly className?: string; | ||
readonly onClick?: React.MouseEventHandler; | ||
}; | ||
|
||
export declare const Button: ({ htmlType, type, size, children, className, isDisabled, isLoading, icon, onClick, ...rest }: Props_4) => JSX_2.Element; | ||
|
||
declare type ButtonType = 'primary' | 'secondary'; | ||
|
||
export declare const ErrorMessage: ({ className, children }: Props_3) => JSX_2.Element; | ||
|
||
export declare const InputField: ForwardRefExoticComponent<Omit<Props_2, "ref"> & RefAttributes<HTMLInputElement>>; | ||
|
||
export declare function PageLayout({ children }: Props): JSX_2.Element; | ||
|
||
declare type Props = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
declare type Props_2 = Omit<HTMLProps<HTMLInputElement>, 'prefix'> & { | ||
readonly className?: string; | ||
readonly inputFieldClassName?: string; | ||
readonly errorMessage?: string; | ||
readonly isDanger?: boolean; | ||
readonly prefix?: ReactElement; | ||
readonly isPrefixVisible?: boolean; | ||
readonly suffix?: ReactElement; | ||
readonly isSuffixFocusVisible?: boolean; | ||
readonly label?: string; | ||
}; | ||
|
||
declare type Props_3 = { | ||
readonly className?: string; | ||
readonly children?: ReactNode; | ||
}; | ||
|
||
declare type Props_4 = BaseProps & { | ||
readonly icon?: React.ReactNode; | ||
}; | ||
|
||
export { } |
Oops, something went wrong.