-
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 e33e49b
Showing
136 changed files
with
25,271 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,8 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], | ||
"plugins": [ | ||
"@babel/plugin-transform-class-properties", | ||
"@babel/plugin-transform-object-rest-spread", | ||
"@babel/plugin-syntax-dynamic-import" | ||
] | ||
} |
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,12 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_size = 4 | ||
indent_style = space | ||
max_line_length = 120 | ||
|
||
[*.{scss,css,yml,yaml}] | ||
indent_size = 2 |
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,49 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 2023, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"/node_modules/**/*", | ||
"/^.*/", | ||
"webpack.config.js", | ||
"commitlint.config.js" | ||
], | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
}, | ||
"plugins": [ | ||
"jest", | ||
"@typescript-eslint" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"eslint-config-prettier" | ||
], | ||
"rules": { | ||
"no-console": "off", | ||
"strict": [ | ||
"error", | ||
"never" | ||
], | ||
"jest/valid-expect": "error", | ||
"jest/no-focused-tests": "error", | ||
"jest/no-disabled-tests": "warn", | ||
"jest/no-identical-title": "error", | ||
"jest/prefer-to-have-length": "warn", | ||
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], | ||
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], | ||
"@typescript-eslint/no-explicit-any": "warn" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
} | ||
} |
Validating CODEOWNERS 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 @@ | ||
* @akashahmad |
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,108 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [main, develop] | ||
push: | ||
branches: [main, develop] | ||
|
||
jobs: | ||
lint-and-test: | ||
env: | ||
CI: true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📦 Checkout Github Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📊 Read .nvmrc | ||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" | ||
id: nvm | ||
|
||
- name: 🛠️ Setup Node.js and NPM | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ steps.nvm.outputs.NVMRC }}" | ||
|
||
- name: 🔃 Cache or restore deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
- name: 📥 Download dependencies | ||
run: npm install | ||
|
||
- name: ⚙️ Run Lint Script | ||
run: npm run lint | ||
|
||
- name: 🧪 Run Tests | ||
run: npm run test:ci | ||
|
||
- name: 📤 Upload code coverage to artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-coverage-report | ||
path: coverage | ||
|
||
build-and-publish: | ||
needs: lint-and-test | ||
env: | ||
CI: true | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 📦 Checkout Github Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📊 Read .nvmrc | ||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" | ||
id: nvm | ||
|
||
- name: 🛠️ Setup Node.js and NPM | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "${{ steps.nvm.outputs.NVMRC }}" | ||
|
||
- name: 🔃 Cache or restore deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
- name: 📥 Download dependencies | ||
run: npm install | ||
|
||
- name: ⚙️ Build Components | ||
run: npm run compile | ||
|
||
- name: 📤 Upload build files to artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: library-build | ||
path: lib | ||
|
||
- name: 🚀 Semantic Release on NPM & Github | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
branch: main | ||
extra_plugins: | | ||
conventional-changelog-conventionalcommits | ||
@semantic-release/commit-analyzer | ||
@semantic-release/release-notes-generator | ||
@semantic-release/npm | ||
@semantic-release/git | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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,21 @@ | ||
node_modules/ | ||
|
||
# Build | ||
lib/ | ||
|
||
# Yarn | ||
.yarn-error.log | ||
package-lock.json | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# Test | ||
coverage/ | ||
|
||
# Storybook | ||
storybook-static/ |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "$1" |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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 @@ | ||
{ | ||
"*.ts": ["prettier --write", "eslint"], | ||
"*.tsx": ["prettier --write", "eslint"], | ||
"*.md": ["prettier --write"], | ||
"*.spec.tsx": ["jest"], | ||
"*.spec.ts": ["jest"], | ||
"*.json": ["prettier --write"], | ||
"*.css": ["stylelint"] | ||
} |
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 @@ | ||
registry=https://registry.npmjs.org/ | ||
package-lock=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 @@ | ||
v18.18.2 |
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 @@ | ||
*.scss | ||
*.less | ||
.husky/ | ||
.yarn/ | ||
yarn.lock | ||
*.md | ||
.github/ | ||
.storybook/ | ||
.yarn/ | ||
scripts/ | ||
|
||
## file extensions | ||
*.* | ||
!*.css | ||
!*.js | ||
!*.json | ||
!*.jsx | ||
!*.less | ||
!*.md | ||
!*.mdx | ||
!*.ts | ||
!*.tsx | ||
!*.yml | ||
LICENSE | ||
|
||
# gitignore | ||
node_modules/ | ||
lib/ | ||
.yarn-error.log | ||
package-lock.json | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
coverage/ | ||
storybook-static/ |
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,14 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"arrowParens": "avoid", | ||
"overrides": [ | ||
{ | ||
"files": ["*.yml", "*.yaml"], | ||
"options": { | ||
"tabWidth": 2 | ||
} | ||
} | ||
] | ||
} |
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,58 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
|
||
import { join, dirname } from "path"; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, "package.json"))); | ||
} | ||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
getAbsolutePath("@storybook/addon-links"), | ||
getAbsolutePath("@storybook/addon-essentials"), | ||
getAbsolutePath("@storybook/addon-interactions"), | ||
{ | ||
name: "@storybook/addon-storysource", | ||
options: { | ||
loaderOptions: { | ||
injectStoryParameters: false, | ||
}, | ||
}, | ||
}, | ||
], | ||
framework: { | ||
name: getAbsolutePath("@storybook/react-webpack5"), | ||
options: { | ||
fastRefresh: true, | ||
}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
// Require to process tailwind styles | ||
webpackFinal: async config => { | ||
if (config.module && config.module.rules) { | ||
config.module.rules.push({ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: "postcss-loader", | ||
options: { | ||
postcssOptions: { | ||
plugins: [require("tailwindcss"), require("autoprefixer")], | ||
}, | ||
}, | ||
}, | ||
], | ||
}); | ||
} | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
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,17 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
import "../src/styles/storybook.css"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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 @@ | ||
coverage/ |
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 @@ | ||
{ | ||
"css.validate": false, | ||
"less.validate": false, | ||
"scss.validate": false | ||
} |
Oops, something went wrong.