├── .editorconfig
├── .env.example
├── .eslintignore
├── .eslintrc.json
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── pull_request_template.md
└── workflows
│ ├── CheckPullRequest.yml
│ └── Deploy.yml
├── .gitignore
├── .husky
├── pre-commit
└── pre-push
├── .huskyrc
├── .npmrc
├── .nvmrc
├── .nxignore
├── .prettierignore
├── .prettierrc.js
├── .stylelintrc.json
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── apps
└── main
│ ├── .env.example
│ ├── .eslintrc.json
│ ├── .stylelintrc.json
│ ├── index.html
│ ├── package.json
│ ├── postcss.config.cjs
│ ├── project.json
│ ├── src
│ ├── App.module.css
│ ├── App.tsx
│ ├── GithubApp
│ │ ├── GithubApp.tsx
│ │ ├── componets
│ │ │ ├── Header
│ │ │ │ ├── Header.module.css
│ │ │ │ ├── Header.tsx
│ │ │ │ ├── Header.types.ts
│ │ │ │ ├── LicenseSelect
│ │ │ │ │ ├── LicenseSelect.tsx
│ │ │ │ │ ├── LicenseSelect.types.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── __tests__
│ │ │ │ │ ├── Header.spec.tsx
│ │ │ │ │ └── mocks
│ │ │ │ │ │ └── result.success.json
│ │ │ │ └── index.ts
│ │ │ └── RepositoriesTable
│ │ │ │ ├── RepositoriesTable.tsx
│ │ │ │ ├── RepositoriesTable.types.ts
│ │ │ │ ├── __tests__
│ │ │ │ ├── RepositoriesTable.spec.tsx
│ │ │ │ └── mocks
│ │ │ │ │ ├── empty.success.json
│ │ │ │ │ └── result.success.json
│ │ │ │ ├── index.ts
│ │ │ │ └── utils
│ │ │ │ └── index.ts
│ │ ├── hooks
│ │ │ └── useInputTokenForGraphql.ts
│ │ ├── index.ts
│ │ ├── providers
│ │ │ └── ApolloProviderWrapper.tsx
│ │ └── utils
│ │ │ ├── __tests__
│ │ │ ├── getDateCondition.spec.ts
│ │ │ ├── getLanguageCondition.spec.ts
│ │ │ ├── getLicenseCondition.spec.ts
│ │ │ ├── getRepositoryNameCondition.spec.ts
│ │ │ └── getSortCondition.spec.ts
│ │ │ ├── getDateCondition.ts
│ │ │ ├── getLanguageCondition.ts
│ │ │ ├── getLicenseCondition.ts
│ │ │ ├── getRepositoryNameCondition.ts
│ │ │ ├── getSortCondition.ts
│ │ │ └── index.ts
│ ├── declarations.d.ts
│ ├── favicon.svg
│ └── index.tsx
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.spec.json
│ ├── vite.config.ts
│ ├── vitest.config.ts
│ └── vitest.setup.ts
├── browserslist
├── docs
├── app_screenshot_1.png
├── app_screenshot_2.png
└── app_screenshot_3.png
├── global.d.ts
├── nx.json
├── package-lock.json
├── package.json
├── packages
├── graphql
│ ├── .env.example
│ ├── .eslintrc.json
│ ├── codegen.yml
│ ├── graphql.config.yml
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── index.ts
│ │ └── lib
│ │ │ ├── generated
│ │ │ ├── fragment-matcher.ts
│ │ │ ├── generated.tsx
│ │ │ └── schema.graphql
│ │ │ └── graphql
│ │ │ ├── ListLicenses.graphql
│ │ │ └── ListRepositories.graphql
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
├── icons
│ ├── .eslintrc.json
│ ├── .svgrrc
│ ├── package.json
│ ├── project.json
│ ├── src
│ │ ├── components
│ │ │ ├── Favicon.tsx
│ │ │ └── index.ts
│ │ ├── icons
│ │ │ └── favicon.svg
│ │ └── index.ts
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ └── tsconfig.spec.json
└── ui-kit
│ ├── .eslintrc.json
│ ├── .storybook
│ ├── .eslintrc.json
│ ├── main.ts
│ └── preview.tsx
│ ├── .stylelintrc.json
│ ├── README.md
│ ├── cypress.config.ts
│ ├── cypress.d.ts
│ ├── cypress
│ ├── .eslintrc.json
│ ├── fixtures
│ │ └── example.json
│ ├── support
│ │ ├── commands.ts
│ │ ├── component-index.html
│ │ ├── component.tsx
│ │ └── e2e.ts
│ └── tsconfig.json
│ ├── package-lock.json
│ ├── package.json
│ ├── project.json
│ ├── src
│ ├── declarations.d.ts
│ ├── index.ts
│ ├── lib
│ │ ├── Button
│ │ │ ├── Button.stories.tsx
│ │ │ ├── Button.tsx
│ │ │ └── index.ts
│ │ ├── ErrorBlock
│ │ │ ├── ErrorBlock.cy.tsx
│ │ │ ├── ErrorBlock.tsx
│ │ │ ├── ErrorBlock.types.ts
│ │ │ └── index.ts
│ │ ├── Input
│ │ │ ├── Input.tsx
│ │ │ └── index.ts
│ │ ├── Loader
│ │ │ ├── Loader.module.css
│ │ │ ├── Loader.tsx
│ │ │ ├── Loader.types.ts
│ │ │ └── index.ts
│ │ ├── Pagination
│ │ │ ├── Pagination.tsx
│ │ │ ├── Pagination.types.ts
│ │ │ └── index.ts
│ │ ├── Select
│ │ │ ├── Select.tsx
│ │ │ └── index.ts
│ │ ├── Space
│ │ │ ├── Space.tsx
│ │ │ └── index.ts
│ │ └── Table
│ │ │ ├── Table.module.css
│ │ │ ├── Table.tsx
│ │ │ ├── Table.types.ts
│ │ │ └── index.ts
│ └── providers
│ │ └── index.tsx
│ ├── tsconfig.json
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ ├── tsconfig.storybook.json
│ ├── vite.config.ts
│ └── vitest.config.ts
├── tools
└── tsconfig.tools.json
├── tsconfig.base.json
└── tsconfig.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 |
12 | [*.md]
13 | max_line_length = off
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # Nx 18 enables using plugins to infer targets by default
2 | # This is disabled for existing workspaces to maintain compatibility
3 | # For more info, see: https://nx.dev/concepts/inferred-tasks
4 | NX_ADD_PLUGINS=false
5 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .husky
4 | .idea
5 | coverage
6 | generated
7 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "parserOptions": {
5 | "ecmaVersion": 13,
6 | "sourceType": "module",
7 | "ecmaFeatures": {
8 | "jsx": true,
9 | "modules": true,
10 | "experimentalObjectRestSpread": true
11 | }
12 | },
13 | "ignorePatterns": ["**/*", "node_modules"],
14 | "plugins": ["@nx"],
15 | "settings": {
16 | "react": {
17 | "pragma": "React",
18 | "fragment": "Fragment",
19 | "version": "detect"
20 | },
21 | "import/resolver": {
22 | "typescript": {
23 | "alwaysTryTypes": true
24 | }
25 | }
26 | },
27 | "overrides": [
28 | {
29 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
30 | "rules": {
31 | "@nx/enforce-module-boundaries": [
32 | "error",
33 | {
34 | "enforceBuildableLibDependency": true,
35 | "allow": [],
36 | "depConstraints": [
37 | {
38 | "sourceTag": "*",
39 | "onlyDependOnLibsWithTags": ["*"]
40 | }
41 | ]
42 | }
43 | ]
44 | }
45 | },
46 | {
47 | "files": ["*.ts", "*.tsx"],
48 | "extends": ["plugin:nimbus-clean/recommended", "plugin:@nx/typescript"],
49 | "plugins": ["react-refresh"],
50 | "rules": {
51 | "react-refresh/only-export-components": "error",
52 | "no-extra-semi": "off",
53 | // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
54 | "unicorn/filename-case": [
55 | "error",
56 | {
57 | "cases": {
58 | "pascalCase": true,
59 | "camelCase": true
60 | },
61 | "ignore": [
62 | "next-env.d.ts",
63 | "vite(st)?.config.ts",
64 | "vite-environment.d.ts",
65 | "\\.spec.ts(x)?",
66 | "\\.types.ts(x)?",
67 | "\\.stories.ts(x)?",
68 | "\\.styled.ts(x)?",
69 | "\\.styles.ts(x)?",
70 | "i18n-config.ts"
71 | ]
72 | }
73 | ]
74 | }
75 | },
76 | {
77 | "files": ["*.graphql"],
78 | "extends": "plugin:@graphql-eslint/operations-all",
79 | "rules": {
80 | "@graphql-eslint/match-document-filename": [
81 | "error",
82 | {
83 | "query": "PascalCase"
84 | }
85 | ]
86 | }
87 | }
88 | ],
89 | "env": {
90 | "es6": true,
91 | "browser": true,
92 | "node": true
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Description
2 |
3 | Please include a summary of the changes and the issue number (if applicable). Please also include relevant motivation and context.
4 |
5 | Fixes # (issue)
6 |
7 | ## Type of Change
8 |
9 | Please delete options that are not relevant.
10 |
11 | - [ ] Bug fix (non-breaking change which fixes an issue)
12 | - [ ] New feature (non-breaking change which adds functionality)
13 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14 | - [ ] Documentation update
15 |
16 | ## Checklist
17 |
18 | - [ ] I have read the [contribution guidelines](CONTRIBUTING.md)
19 | - [ ] My code follows the code style of this project
20 | - [ ] I have performed a self-review of my own code
21 | - [ ] I have commented my code, particularly in hard-to-understand areas
22 | - [ ] I have made corresponding changes to the documentation
23 | - [ ] My changes generate no new warnings
24 | - [ ] I have added tests that prove my fix is effective or that my feature works
25 | - [ ] New and existing unit tests pass locally with my changes
26 |
27 | ## Screenshots (if applicable)
28 |
29 | You can attach screenshots here to visually represent your changes (e.g., UI changes).
30 |
31 | ## Additional Notes
32 |
33 | Add any additional notes or context about the pull request here.
34 |
--------------------------------------------------------------------------------
/.github/workflows/CheckPullRequest.yml:
--------------------------------------------------------------------------------
1 | name: Code check
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | env:
8 | # Nx 18 enables using plugins to infer targets by default
9 | # This is disabled for existing workspaces to maintain compatibility
10 | # For more info, see: https://nx.dev/concepts/inferred-tasks
11 | NX_ADD_PLUGINS: false
12 | jobs:
13 | cache-and-install:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v4
17 | with:
18 | fetch-depth: 0
19 |
20 | - uses: actions/setup-node@v4
21 | with:
22 | node-version: 20.16.0
23 | cache: 'npm'
24 | cache-dependency-path: '**/package-lock.json'
25 |
26 | - name: Install dependencies
27 | run: npm ci --prefer-offline
28 |
29 | type-check:
30 | runs-on: ubuntu-latest
31 | needs:
32 | - cache-and-install
33 | steps:
34 | - uses: actions/checkout@v4
35 | with:
36 | fetch-depth: 0
37 |
38 | - uses: actions/setup-node@v4
39 | with:
40 | node-version: 20
41 | cache: 'npm'
42 | cache-dependency-path: '**/package-lock.json'
43 |
44 | - run: npm ci --prefer-offline
45 | - uses: nrwl/nx-set-shas@v4
46 |
47 | - name: type-check PR
48 | if: github.ref != 'refs/heads/main'
49 | run: npx nx affected --target=type-check --base=origin/main --head=HEAD
50 | - name: type-check Main
51 | if: github.ref == 'refs/heads/main'
52 | run: npx nx affected --target=type-check --base=origin/main~1 --head=origin/main
53 |
54 | lint:
55 | runs-on: ubuntu-latest
56 | needs:
57 | - cache-and-install
58 | steps:
59 | - uses: actions/checkout@v4
60 | with:
61 | fetch-depth: 0
62 |
63 | - uses: actions/setup-node@v4
64 | with:
65 | node-version: 20
66 | cache: 'npm'
67 | cache-dependency-path: '**/package-lock.json'
68 |
69 | - run: npm ci --prefer-offline
70 | - uses: nrwl/nx-set-shas@v4
71 |
72 | - name: lint PR
73 | if: github.ref != 'refs/heads/main'
74 | run: npx nx affected --target=lint --base=origin/main --head=HEAD
75 | - name: lint Main
76 | if: github.ref == 'refs/heads/main'
77 | run: npx nx affected --target=lint --base=origin/main~1 --head=origin/main
78 |
79 | stylelint:
80 | runs-on: ubuntu-latest
81 | needs:
82 | - cache-and-install
83 | steps:
84 | - uses: actions/checkout@v4
85 | with:
86 | fetch-depth: 0
87 |
88 | - uses: actions/setup-node@v4
89 | with:
90 | node-version: 20
91 | cache: 'npm'
92 | cache-dependency-path: '**/package-lock.json'
93 |
94 | - run: npm ci --prefer-offline
95 | - uses: nrwl/nx-set-shas@v4
96 |
97 | - name: stylelint PR
98 | if: github.ref != 'refs/heads/main'
99 | run: npx nx affected --target=stylelint --base=origin/main --head=HEAD
100 | - name: stylelint Main
101 | if: github.ref == 'refs/heads/main'
102 | run: npx nx affected --target=stylelint --base=origin/main~1 --head=origin/main
103 |
104 | test:
105 | runs-on: ubuntu-latest
106 | needs:
107 | - cache-and-install
108 | steps:
109 | - uses: actions/checkout@v4
110 | with:
111 | fetch-depth: 0
112 |
113 | - uses: actions/setup-node@v4
114 | with:
115 | node-version: 20
116 | cache: 'npm'
117 | cache-dependency-path: '**/package-lock.json'
118 |
119 | - run: npm ci --prefer-offline
120 | - uses: nrwl/nx-set-shas@v4
121 |
122 | - name: test PR
123 | if: github.ref != 'refs/heads/main'
124 | run: npx nx affected --target=test --base=origin/main --head=HEAD
125 | - name: test Main
126 | if: github.ref == 'refs/heads/main'
127 | run: npx nx affected --target=test --base=origin/main~1 --head=origin/main
128 |
129 |
--------------------------------------------------------------------------------
/.github/workflows/Deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 | on:
3 | workflow_run:
4 | workflows: ["Code check"]
5 | branches: [main]
6 | types:
7 | - completed
8 | env:
9 | VITE_GITHUB_API_ENDPOINT: https://api.github.com/graphql
10 | # Nx 18 enables using plugins to infer targets by default
11 | # This is disabled for existing workspaces to maintain compatibility
12 | # For more info, see: https://nx.dev/concepts/inferred-tasks
13 | NX_ADD_PLUGINS: false
14 | jobs:
15 | build-and-deploy:
16 | runs-on: ubuntu-latest
17 | steps:
18 | - uses: actions/checkout@v4
19 | with:
20 | fetch-depth: 0
21 |
22 | - uses: actions/setup-node@v4
23 | with:
24 | node-version: 20
25 | cache: 'npm'
26 | cache-dependency-path: '**/package-lock.json'
27 |
28 | - run: npm ci --prefer-offline
29 |
30 | - name: Install and Build 🔧
31 | run: npx nx build main
32 |
33 | - name: Deploy 🚀
34 | uses: JamesIves/github-pages-deploy-action@v4.3.0
35 | with:
36 | branch: gh-pages
37 | folder: apps/main/dist
38 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | yarn-error.log
34 | testem.log
35 | /typings
36 |
37 | # System Files
38 | .DS_Store
39 | Thumbs.db
40 | stats.html
41 | .vscode
42 | node_modules
43 | coverage
44 |
45 | .env
46 | .env.*
47 | !.env.example
48 |
49 | .nx/cache
50 | .nx/workspace-data
51 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx nx affected --target=type-check --uncommitted=true && node_modules/.bin/lint-staged
5 |
--------------------------------------------------------------------------------
/.husky/pre-push:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx nx affected --target=lint
5 | npx nx affected --target=type-check
6 |
--------------------------------------------------------------------------------
/.huskyrc:
--------------------------------------------------------------------------------
1 | # This loads nvm.sh, sets the correct PATH before running hook, and ensures the project version of Node
2 | export NVM_DIR="$HOME/.nvm"
3 |
4 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
5 |
6 | # If you have an .nvmrc file, we use the relevant node version
7 | if [ -f ".nvmrc" ]; then
8 | nvm use
9 | fi
10 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | save-exact=true
2 | legacy-peer-deps=true
3 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v20.16.0
2 |
--------------------------------------------------------------------------------
/.nxignore:
--------------------------------------------------------------------------------
1 | .vercel
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .assets
2 | .nx
3 | .idea
4 | .vscode
5 | .husky
6 | dist
7 | build
8 | coverage
9 | node_modules
10 | .vercel
11 |
12 | /.nx/cache
13 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | printWidth: 150,
3 | useTabs: false,
4 | tabWidth: 2,
5 | trailingComma: 'all',
6 | semi: false,
7 | singleQuote: true,
8 | }
9 |
--------------------------------------------------------------------------------
/.stylelintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "stylelint-config-standard",
4 | "stylelint-config-css-modules"
5 | ],
6 | "rules": {
7 | "selector-class-pattern": null
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guide
2 |
3 | Welcome to our project! We're thrilled that you're considering contributing. Here's a comprehensive guide to help you get started, tailored to the information you've provided:
4 |
5 | ## Getting Started
6 |
7 | 1. Fork the repository to your GitHub account.
8 | 2. Clone the forked repository to your local machine.
9 | 3. Run `npm install` to install the project dependencies.
10 | 4. Familiarize yourself with the project's structure and codebase.
11 |
12 | ## Branching
13 |
14 | 1. Create a new branch for your contribution: `git checkout -b feature/my-feature`.
15 | 2. Keep your branch up to date with the main branch: git pull origin main.
16 |
17 | ## Development
18 |
19 | 1. Before proceeding, read how to create a [GitHub access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
20 | 2. To configure environment variables:
21 | - Copy `cp ./packages/graphql/env.example ./packages/graphql/.env.local` and add your GitHub token as indicated in step 1.
22 | - Copy `cp ./apps/main/env.example ./apps/main/.env.local` and add your GitHub token in the same way.
23 | 3. If needed, you can generate code from the GraphQL schema using: `npm run codegen:graphql`
24 | 4. To start the application: `npm run dev`
25 | 5. Open your browser and navigate to http://localhost:3000 to view the app.
26 |
27 | ## Committing
28 |
29 | 1. Craft descriptive and concise commit messages.
30 | 2. Write in the present tense, such as "Add feature" instead of "Added feature".
31 | 3. Link to related issues using keywords like "Fixes #123".
32 |
33 | ## Pull Requests
34 |
35 | 1. Push your changes to your forked repository.
36 | 2. Create a Pull Request (PR) from your branch to the main repository's main branch.
37 | 3. Provide a clear PR title and an explanatory description of your changes.
38 | 4. Reference relevant issues using keywords like "Closes #123".
39 |
40 | ## Issues
41 |
42 | 1. Should you come across a bug or have an idea, check for existing issues. If none exist, create one.
43 | 2. Utilize the provided issue template for comprehensive details.
44 | 3. Approach feedback and suggestions with a respectful and receptive attitude.
45 |
46 | Thank you for considering contributing to our project. Your dedication contributes to its growth and quality. Enjoy the collaborative journey!
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 dipiash
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | [](https://hits.seeyoufarm.com)
3 |
4 | # NX monorepo boilerplate with React + Vite + TypeScript + Mantine
5 |
6 | ## Getting Started
7 |
8 | ### Prerequisites
9 |
10 | ```sh
11 | # Install NX
12 | npm install -g nx
13 |
14 | # Init project
15 | npm run init-project
16 | ```
17 |
18 | ### Development
19 |
20 | 1. Read [how to create GitHub access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
21 | 2. Add `.env` into `./`
22 | ```bash
23 | cp ./env.example ./.env
24 | ```
25 | 3. Add `.env.local` into `./packages/graphql/.env.local`
26 | ```bash
27 | cp ./packages/graphql/env.example ./packages/graphql/.env.local
28 | ```
29 | and add your GitHub token (see step 1)
30 | 4. Add `.env.local` to `./apps/main/.env.local`
31 | ```bash
32 | cp ./apps/main/env.example ./apps/main/.env.local
33 | ```
34 | and add your GitHub token (see step 1)
35 | 5. _[Optional step]_ Generate code from GraphQL schema
36 | ```sh
37 | npm run codegen:graphql
38 | ```
39 | 6. Start the app
40 | ```sh
41 | npm run dev
42 | ```
43 | and open the page http://localhost:3000/
44 |
45 | ### Examples
46 |
47 | - [GitHub repository list](https://dipiash.github.io/nx-vite-react-ts-mantine-boilerplate/)
48 |
49 | ### App screenshots
50 |
51 | #### Desktop version
52 |
53 |
54 |
55 |
56 |
57 | #### Mobile version
58 |
59 |
60 |
61 | ### Features
62 |
63 | - [Nx 20](https://nx.dev)
64 | - [React 18](https://reactjs.org)
65 | - [Mantine 7](https://mantine.dev/)
66 | - [Storybook 7](https://storybook.js.org/)
67 | - [TypeScript](https://www.typescriptlang.org/)
68 | - [Vite 5](https://vitejs.dev/)
69 | - [Vitest](https://vitest.dev/)
70 | - [React Testing Library](https://testing-library.com/docs/react-testing-library/intro)
71 | - [Cypress](https://www.cypress.io)
72 | - [ESLint](https://eslint.org/)
73 | - HMR (Hot Module Replacement)
74 |
75 | ## License
76 | This code is licensed under the MIT License.
77 | You can find the license file [here](/LICENSE).
78 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | We prioritize the security of our project and value the contributions of the community. If you come across a security vulnerability within our repository, we encourage you to report it responsibly. Here's how you can do that:
4 |
5 | ## Reporting a Vulnerability
6 |
7 | To report a security vulnerability, please follow these steps:
8 | 1. Create a new issue in this repository to report the vulnerability. Use a clear and descriptive title to help us understand the issue.
9 | 2. Provide detailed steps to reproduce the vulnerability, along with any additional context you can provide.
10 | 3. Avoid sharing sensitive information or data when reporting the vulnerability.
11 | 4. Our team will review the issue and respond to it as soon as possible.
12 |
--------------------------------------------------------------------------------
/apps/main/.env.example:
--------------------------------------------------------------------------------
1 | VITE_GITHUB_TOKEN=YOUR_GITHUB_TOKEN
2 | VITE_GITHUB_API_ENDPOINT=https://api.github.com/graphql
3 |
--------------------------------------------------------------------------------
/apps/main/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {},
8 | "parserOptions": {
9 | "project": ["tsconfig.*?.json"]
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/apps/main/.stylelintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.stylelintrc.json"]
3 | }
4 |
--------------------------------------------------------------------------------
/apps/main/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | GitHub repositories list
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/apps/main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "main",
3 | "type": "module"
4 | }
5 |
--------------------------------------------------------------------------------
/apps/main/postcss.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | 'postcss-preset-mantine': {},
4 | 'postcss-simple-vars': {},
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/apps/main/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "main",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "application",
5 | "sourceRoot": "apps/main/src",
6 | "tags": [],
7 | "targets": {
8 | "type-check": {
9 | "executor": "nx:run-commands",
10 | "options": {
11 | "cwd": "./apps/main",
12 | "commands": [
13 | {
14 | "command": "tsc --project tsconfig.app.json --noEmit && tsc --project tsconfig.spec.json --noEmit"
15 | }
16 | ]
17 | }
18 | },
19 | "serve": {
20 | "executor": "nx:run-commands",
21 | "options": {
22 | "cwd": "./apps/main",
23 | "commands": [
24 | {
25 | "command": "vite serve"
26 | }
27 | ]
28 | }
29 | },
30 | "preview": {
31 | "executor": "nx:run-commands",
32 | "options": {
33 | "cwd": "./apps/main",
34 | "commands": [
35 | {
36 | "command": "vite preview"
37 | }
38 | ]
39 | }
40 | },
41 | "build": {
42 | "executor": "nx:run-commands",
43 | "options": {
44 | "cwd": "./apps/main",
45 | "commands": [
46 | {
47 | "command": "vite build"
48 | }
49 | ]
50 | }
51 | },
52 | "build-serve": {
53 | "executor": "nx:run-commands",
54 | "options": {
55 | "cwd": "./apps/main",
56 | "commands": [
57 | {
58 | "command": "npx http-server dist"
59 | }
60 | ]
61 | }
62 | },
63 | "lint": {
64 | "executor": "@nx/eslint:lint",
65 | "outputs": ["{options.outputFile}"]
66 | },
67 | "stylelint": {
68 | "executor": "nx-stylelint:lint",
69 | "outputs": ["{options.outputFile}"],
70 | "options": {
71 | "lintFilePatterns": ["apps/main/src/**/*.{css}"]
72 | }
73 | },
74 | "test": {
75 | "executor": "nx:run-commands",
76 | "options": {
77 | "cwd": "./apps/main",
78 | "commands": [
79 | {
80 | "command": "vitest run --config ./vitest.config.ts --coverage --passWithNoTests"
81 | }
82 | ]
83 | }
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/apps/main/src/App.module.css:
--------------------------------------------------------------------------------
1 | .wrapper {
2 | padding: 8px;
3 | }
4 |
--------------------------------------------------------------------------------
/apps/main/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { ThemeProvider } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
2 | import React, { FC } from 'react'
3 |
4 | import { GithubApp } from './GithubApp'
5 |
6 | import '@mantine/core/styles.css'
7 | import classes from './App.module.css'
8 |
9 | const App: FC = () => (
10 |
11 |
12 |
13 |
14 |
15 | )
16 |
17 | export default App
18 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/GithubApp.tsx:
--------------------------------------------------------------------------------
1 | import { useForm } from '@mantine/form'
2 | import { useDebouncedValue } from '@mantine/hooks'
3 | import { Button } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
4 | import React from 'react'
5 |
6 | import { Header } from './componets/Header'
7 | import { RepositoriesTable } from './componets/RepositoriesTable'
8 | import { useInputTokenForGraphql } from './hooks/useInputTokenForGraphql'
9 | import { ApolloProviderWrapper } from './providers/ApolloProviderWrapper'
10 | import { getDateCondition, getLanguageCondition, getLicenseCondition, getRepositoryNameCondition, getSortCondition } from './utils'
11 |
12 | export const GithubApp = () => {
13 | const { isTokenExist, handleUpdateToken } = useInputTokenForGraphql()
14 |
15 | const form = useForm({
16 | initialValues: {
17 | license: ' ',
18 | repositoryName: '',
19 | },
20 | })
21 | const license = form.values.license
22 | const repositoryNameValue = form.values.repositoryName
23 |
24 | const [repositoryName] = useDebouncedValue(repositoryNameValue, 300)
25 |
26 | const queryString = [
27 | getSortCondition('stars', 'desc'),
28 | getLanguageCondition('JavaScript'),
29 | getDateCondition(),
30 | getLicenseCondition(license),
31 | getRepositoryNameCondition(repositoryName),
32 | ].join(' ')
33 |
34 | return (
35 |
36 |
37 |
38 | {isTokenExist && (
39 | <>
40 |
41 |
42 | >
43 | )}
44 |
45 | )
46 | }
47 |
48 | GithubApp.whyDidYouRender = true
49 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/Header.module.css:
--------------------------------------------------------------------------------
1 | .root {
2 | display: flex;
3 | box-sizing: border-box;
4 | margin-bottom: 10px;
5 | border-bottom: 1px solid #eee;
6 | }
7 |
8 | .headerItem {
9 | flex: 1;
10 | flex-direction: column;
11 | }
12 |
13 | .headerItemLeft {
14 | padding-right: 5px;
15 | }
16 |
17 | .headerItemRight {
18 | padding-left: 5px;
19 | }
20 |
21 | .headerField {
22 | width: 100%;
23 | }
24 |
25 | @media screen and (width <= 640px) {
26 | .header {
27 | flex-direction: column;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/Header.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
2 | import cx from 'clsx'
3 | import React, { FC, memo } from 'react'
4 |
5 | import { HeaderPropertiesInterface } from './Header.types'
6 | import { LicenseSelect } from './LicenseSelect'
7 |
8 | import classes from './Header.module.css'
9 |
10 | export const Header: FC = memo(({ form }) => (
11 |
12 |
13 |
21 |
22 |
23 |
24 |
25 |
26 | ))
27 |
28 | Header.displayName = 'Header'
29 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/Header.types.ts:
--------------------------------------------------------------------------------
1 | import { UseFormReturnType } from '@mantine/form'
2 |
3 | export interface HeaderPropertiesInterface {
4 | form: UseFormReturnType<{
5 | license: string
6 | repositoryName: string
7 | }>
8 | }
9 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/LicenseSelect/LicenseSelect.tsx:
--------------------------------------------------------------------------------
1 | import { useListLicensesQuery } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
2 | import { ComboboxItem, ErrorBlock, Loader, Select } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
3 | import React, { FC, useMemo } from 'react'
4 |
5 | import { LicenseSelectPropertiesInterface } from './LicenseSelect.types'
6 |
7 | const firstEmptyComboboxItem: ComboboxItem[] = [{ label: '--- Not Selected ---', value: ' ' }]
8 |
9 | export const LicenseSelect: FC = ({ ...rest }) => {
10 | const { data, error, loading } = useListLicensesQuery()
11 |
12 | const preparedLicenses = useMemo(() => {
13 | const preparedOriginalLicenses =
14 | data?.licenses
15 | .map((license) =>
16 | license
17 | ? ({
18 | label: license.name,
19 | value: license.key,
20 | } as ComboboxItem)
21 | : undefined,
22 | )
23 | .filter((license): license is ComboboxItem => license !== undefined) || []
24 |
25 | return [...firstEmptyComboboxItem, ...preparedOriginalLicenses]
26 | }, [data])
27 |
28 | if (error) {
29 | return
30 | }
31 |
32 | return (
33 |
34 |
43 |
44 | )
45 | }
46 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/LicenseSelect/LicenseSelect.types.ts:
--------------------------------------------------------------------------------
1 | export interface LicenseSelectPropertiesInterface {
2 | className?: string
3 | onChange: (value: null | string) => void
4 | }
5 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/LicenseSelect/index.ts:
--------------------------------------------------------------------------------
1 | export { LicenseSelect } from './LicenseSelect'
2 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/__tests__/Header.spec.tsx:
--------------------------------------------------------------------------------
1 | import { MockedProvider, MockedResponse } from '@apollo/react-testing'
2 | import { useForm } from '@mantine/form'
3 | import { ListLicensesDocument } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
4 | import { ThemeProvider } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
5 | import { act, fireEvent, render, renderHook, screen } from '@testing-library/react'
6 | import { userEvent } from '@testing-library/user-event'
7 | import React from 'react'
8 | import { describe, expect, it } from 'vitest'
9 |
10 | import { Header } from '../index'
11 | import licensesListMockDataSuccess from './mocks/result.success.json'
12 |
13 | const mocks: {
14 | error: readonly MockedResponse[]
15 | success: readonly MockedResponse[]
16 | } = {
17 | error: [
18 | {
19 | error: new Error('An error occurred'),
20 | request: {
21 | query: ListLicensesDocument,
22 | },
23 | },
24 | ],
25 | success: [
26 | {
27 | request: {
28 | query: ListLicensesDocument,
29 | },
30 | result: {
31 | data: licensesListMockDataSuccess,
32 | },
33 | },
34 | ],
35 | }
36 |
37 | describe('Header', () => {
38 | it('success render', async () => {
39 | const user = userEvent.setup()
40 |
41 | const { result: formHookReference } = renderHook(() =>
42 | useForm<{
43 | license: string
44 | repositoryName: string
45 | }>({
46 | initialValues: {
47 | license: '',
48 | repositoryName: '',
49 | },
50 | }),
51 | )
52 |
53 | render(
54 |
55 |
56 |
57 |
58 | ,
59 | )
60 |
61 | await act(() => new Promise((resolve) => setTimeout(resolve, 0))) // wait for response
62 |
63 | const elementLoading = screen.getByTestId('licenses-select-loading')
64 |
65 | expect(elementLoading).toBeInTheDocument()
66 |
67 | // Change value in select element
68 | const selectElement = screen.getByTestId('licenses-select')
69 |
70 | expect(selectElement).toBeInTheDocument()
71 | expect(selectElement).toHaveValue('')
72 |
73 | await user.click(selectElement)
74 | await user.click(screen.getByText('MIT License'))
75 |
76 | expect(formHookReference.current.values.license).toBe('mit')
77 |
78 | // Change text in input field
79 | const inputElement = screen.getByTestId('search-by-name')
80 |
81 | expect(inputElement).toBeTruthy()
82 | expect(inputElement).toHaveValue('')
83 |
84 | fireEvent.input(inputElement, { target: { value: 'react' } })
85 | expect(formHookReference.current.values.repositoryName).toBe('react')
86 | })
87 |
88 | it('error render', async () => {
89 | const { result: formHookReference } = renderHook(() =>
90 | useForm<{
91 | license: string
92 | repositoryName: string
93 | }>({
94 | initialValues: {
95 | license: '',
96 | repositoryName: '',
97 | },
98 | }),
99 | )
100 |
101 | render(
102 |
103 |
104 |
105 |
106 | ,
107 | )
108 |
109 | await act(() => new Promise((resolve) => setTimeout(resolve, 0))) // wait for response
110 |
111 | expect(screen.getByText('Search by repo name')).toBeVisible()
112 | expect(screen.getByText('Licenses loading error.')).toBeVisible()
113 | })
114 | })
115 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/__tests__/mocks/result.success.json:
--------------------------------------------------------------------------------
1 | {
2 | "licenses": [
3 | {
4 | "id": "MDc6TGljZW5zZTE=",
5 | "name": "GNU Affero General Public License v3.0",
6 | "key": "agpl-3.0",
7 | "__typename": "License"
8 | },
9 | {
10 | "id": "MDc6TGljZW5zZTI=",
11 | "name": "Apache License 2.0",
12 | "key": "apache-2.0",
13 | "__typename": "License"
14 | },
15 | {
16 | "id": "MDc6TGljZW5zZTQ=",
17 | "name": "BSD 2-Clause \"Simplified\" License",
18 | "key": "bsd-2-clause",
19 | "__typename": "License"
20 | },
21 | {
22 | "id": "MDc6TGljZW5zZTU=",
23 | "name": "BSD 3-Clause \"New\" or \"Revised\" License",
24 | "key": "bsd-3-clause",
25 | "__typename": "License"
26 | },
27 | {
28 | "id": "MDc6TGljZW5zZTMy",
29 | "name": "Eclipse Public License 2.0",
30 | "key": "epl-2.0",
31 | "__typename": "License"
32 | },
33 | {
34 | "id": "MDc6TGljZW5zZTg=",
35 | "name": "GNU General Public License v2.0",
36 | "key": "gpl-2.0",
37 | "__typename": "License"
38 | },
39 | {
40 | "id": "MDc6TGljZW5zZTk=",
41 | "name": "GNU General Public License v3.0",
42 | "key": "gpl-3.0",
43 | "__typename": "License"
44 | },
45 | {
46 | "id": "MDc6TGljZW5zZTEx",
47 | "name": "GNU Lesser General Public License v2.1",
48 | "key": "lgpl-2.1",
49 | "__typename": "License"
50 | },
51 | {
52 | "id": "MDc6TGljZW5zZTEy",
53 | "name": "GNU Lesser General Public License v3.0",
54 | "key": "lgpl-3.0",
55 | "__typename": "License"
56 | },
57 | {
58 | "id": "MDc6TGljZW5zZTEz",
59 | "name": "MIT License",
60 | "key": "mit",
61 | "__typename": "License"
62 | },
63 | {
64 | "id": "MDc6TGljZW5zZTE0",
65 | "name": "Mozilla Public License 2.0",
66 | "key": "mpl-2.0",
67 | "__typename": "License"
68 | },
69 | {
70 | "id": "MDc6TGljZW5zZTE1",
71 | "name": "The Unlicense",
72 | "key": "unlicense",
73 | "__typename": "License"
74 | }
75 | ]
76 | }
77 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/Header/index.ts:
--------------------------------------------------------------------------------
1 | export { Header } from './Header'
2 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/RepositoriesTable.tsx:
--------------------------------------------------------------------------------
1 | import { SearchResultItemEdge, useListRepositoriesQuery } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
2 | import { ErrorBlock, Loader, Pagination, Space, Table } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
3 | import React, { FC, useMemo } from 'react'
4 |
5 | import { RepositoriesTablePropertiesInterface, RepositoryDataInterface } from './RepositoriesTable.types'
6 | import { enhancedFetchMore, getPaginationParameters } from './utils'
7 |
8 | export const RepositoriesTable: FC = ({ limit = 10, queryString }) => {
9 | const { data, error, fetchMore, loading } = useListRepositoriesQuery({
10 | variables: {
11 | first: limit,
12 | queryString: queryString,
13 | },
14 | })
15 |
16 | const resultData = useMemo(() => (data?.search.edges || []) as SearchResultItemEdge[], [data])
17 |
18 | const tableColumns = {
19 | name: 'Name',
20 | date: 'Date',
21 | license: 'License',
22 | stars: 'Stars',
23 | }
24 |
25 | const tableData = useMemo(
26 | () =>
27 | resultData
28 | .map(({ node }) =>
29 | node?.__typename === 'Repository'
30 | ? {
31 | name: node?.name,
32 | date: node?.createdAt,
33 | key: node?.id,
34 | license: node?.licenseInfo?.name,
35 | stars: node?.stargazers?.totalCount,
36 | }
37 | : (undefined as unknown as RepositoryDataInterface),
38 | )
39 | .filter((node): node is RepositoryDataInterface => node != undefined),
40 | [resultData],
41 | )
42 |
43 | const tableError = error ? : false
44 |
45 | const paginationParameters = getPaginationParameters(data?.search.pageInfo)
46 |
47 | return (
48 |
49 |
50 |
51 |
55 | enhancedFetchMore({
56 | cursorAfter: paginationParameters.cursorAfter,
57 | limit,
58 | queryString,
59 | fetchMore,
60 | })
61 | }
62 | onPrevClick={() =>
63 | enhancedFetchMore({
64 | cursorBefore: paginationParameters.cursorBefore,
65 | limit,
66 | queryString,
67 | fetchMore,
68 | })
69 | }
70 | />
71 |
72 | )
73 | }
74 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/RepositoriesTable.types.ts:
--------------------------------------------------------------------------------
1 | import { Scalars } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
2 |
3 | export interface RepositoriesTablePropertiesInterface {
4 | limit: number
5 | queryString: string
6 | }
7 |
8 | export interface RepositoryDataInterface {
9 | date: Scalars['DateTime']
10 | key: Scalars['ID']
11 | license: string
12 | name: string
13 | stars: number
14 | }
15 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/__tests__/RepositoriesTable.spec.tsx:
--------------------------------------------------------------------------------
1 | import { MockedProvider } from '@apollo/client/testing'
2 | import { ListRepositoriesDocument } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
3 | import { ThemeProvider } from '@nx-vite-react-ts-mantine-boilerplate/ui-kit'
4 | import { act, render, screen } from '@testing-library/react'
5 | import React from 'react'
6 | import { describe, expect, it } from 'vitest'
7 |
8 | import { getDateCondition, getLanguageCondition, getLicenseCondition, getRepositoryNameCondition, getSortCondition } from '../../../utils'
9 | import { RepositoriesTable } from '../index'
10 | import repositoriesListMockDataEmpty from './mocks/empty.success.json'
11 | import repositoriesListMockDataSuccess from './mocks/result.success.json'
12 |
13 | const queryString = [
14 | getSortCondition('stars'),
15 | getLanguageCondition('JavaScript'),
16 | getDateCondition(),
17 | getLicenseCondition(),
18 | getRepositoryNameCondition,
19 | ].join(' ')
20 | const limitItems = 10
21 |
22 | const mocks = {
23 | empty: [
24 | {
25 | request: {
26 | query: ListRepositoriesDocument,
27 | variables: {
28 | first: limitItems,
29 | queryString,
30 | },
31 | },
32 | result: {
33 | data: repositoriesListMockDataEmpty,
34 | },
35 | },
36 | ],
37 | error: [
38 | {
39 | error: new Error('An error occurred'),
40 | request: {
41 | query: ListRepositoriesDocument,
42 | },
43 | },
44 | ],
45 | success: [
46 | {
47 | request: {
48 | query: ListRepositoriesDocument,
49 | variables: {
50 | first: limitItems,
51 | queryString,
52 | },
53 | },
54 | result: {
55 | data: repositoriesListMockDataSuccess,
56 | },
57 | },
58 | ],
59 | }
60 |
61 | describe('RepositoriesTable', () => {
62 | it('Render loading state', async () => {
63 | render(
64 |
65 |
66 |
67 |
68 | ,
69 | )
70 |
71 | expect(screen.getByText('Loading...')).toBeTruthy()
72 | })
73 |
74 | it('Render empty state', async () => {
75 | render(
76 |
77 |
78 |
79 |
80 | ,
81 | )
82 |
83 | await act(() => new Promise((resolve) => setTimeout(resolve, 0)))
84 |
85 | expect(screen.getByText('No data')).toBeTruthy()
86 | })
87 |
88 | it('Render with success response', async () => {
89 | render(
90 |
91 |
92 |
93 |
94 | ,
95 | )
96 |
97 | await act(() => new Promise((resolve) => setTimeout(resolve, 0)))
98 |
99 | expect(screen.getByText('nextjs-lit-token-gating')).toBeTruthy()
100 | })
101 |
102 | it('Render error', async () => {
103 | render(
104 |
105 |
106 |
107 |
108 | ,
109 | )
110 |
111 | await act(() => new Promise((resolve) => setTimeout(resolve, 0)))
112 |
113 | expect(screen.getByText('Repositories list loading error.')).toBeTruthy()
114 | })
115 | })
116 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/__tests__/mocks/empty.success.json:
--------------------------------------------------------------------------------
1 | {
2 | "search": {
3 | "edges": [],
4 | "pageInfo": {
5 | "endCursor": "Y3Vyc29yOjEw",
6 | "hasNextPage": false,
7 | "hasPreviousPage": false,
8 | "startCursor": "Y3Vyc29yOjE=",
9 | "__typename": "PageInfo"
10 | },
11 | "repositoryCount": 0,
12 | "__typename": "SearchResultItemConnection"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/__tests__/mocks/result.success.json:
--------------------------------------------------------------------------------
1 | {
2 | "search": {
3 | "edges": [
4 | {
5 | "cursor": "Y3Vyc29yOjE=",
6 | "node": {
7 | "createdAt": "2022-05-03T12:25:10Z",
8 | "id": "R_kgDOHRlXnw",
9 | "licenseInfo": null,
10 | "name": "DeathNote",
11 | "stargazers": { "totalCount": 52, "__typename": "StargazerConnection" },
12 | "updatedAt": "2022-05-03T17:21:29Z",
13 | "__typename": "Repository"
14 | },
15 | "__typename": "SearchResultItemEdge"
16 | },
17 | {
18 | "cursor": "Y3Vyc29yOjI=",
19 | "node": {
20 | "createdAt": "2022-05-01T23:03:39Z",
21 | "id": "R_kgDOHREfig",
22 | "licenseInfo": null,
23 | "name": "nextjs-lit-token-gating",
24 | "stargazers": { "totalCount": 13, "__typename": "StargazerConnection" },
25 | "updatedAt": "2022-05-03T00:25:42Z",
26 | "__typename": "Repository"
27 | },
28 | "__typename": "SearchResultItemEdge"
29 | },
30 | {
31 | "cursor": "Y3Vyc29yOjM=",
32 | "node": {
33 | "createdAt": "2022-05-02T15:36:14Z",
34 | "id": "R_kgDOHRS9Aw",
35 | "licenseInfo": null,
36 | "name": "codetv",
37 | "stargazers": { "totalCount": 8, "__typename": "StargazerConnection" },
38 | "updatedAt": "2022-05-03T13:09:54Z",
39 | "__typename": "Repository"
40 | },
41 | "__typename": "SearchResultItemEdge"
42 | },
43 | {
44 | "cursor": "Y3Vyc29yOjQ=",
45 | "node": {
46 | "createdAt": "2022-05-02T05:28:35Z",
47 | "id": "R_kgDOHRIezg",
48 | "licenseInfo": { "id": "MDc6TGljZW5zZTEz", "name": "MIT License", "__typename": "License" },
49 | "name": "KeyboardOverlay",
50 | "stargazers": { "totalCount": 7, "__typename": "StargazerConnection" },
51 | "updatedAt": "2022-05-03T17:38:15Z",
52 | "__typename": "Repository"
53 | },
54 | "__typename": "SearchResultItemEdge"
55 | },
56 | {
57 | "cursor": "Y3Vyc29yOjU=",
58 | "node": {
59 | "createdAt": "2022-05-03T00:08:34Z",
60 | "id": "R_kgDOHRa3QQ",
61 | "licenseInfo": null,
62 | "name": "lsp-bridge",
63 | "stargazers": { "totalCount": 8, "__typename": "StargazerConnection" },
64 | "updatedAt": "2022-05-03T16:54:04Z",
65 | "__typename": "Repository"
66 | },
67 | "__typename": "SearchResultItemEdge"
68 | },
69 | {
70 | "cursor": "Y3Vyc29yOjY=",
71 | "node": {
72 | "createdAt": "2022-05-03T06:19:03Z",
73 | "id": "R_kgDOHRfKNg",
74 | "licenseInfo": null,
75 | "name": "42cabi_admin",
76 | "stargazers": { "totalCount": 7, "__typename": "StargazerConnection" },
77 | "updatedAt": "2022-05-03T13:26:20Z",
78 | "__typename": "Repository"
79 | },
80 | "__typename": "SearchResultItemEdge"
81 | },
82 | {
83 | "cursor": "Y3Vyc29yOjc=",
84 | "node": {
85 | "createdAt": "2022-05-02T08:27:15Z",
86 | "id": "R_kgDOHRLHsg",
87 | "licenseInfo": null,
88 | "name": "dockery",
89 | "stargazers": { "totalCount": 5, "__typename": "StargazerConnection" },
90 | "updatedAt": "2022-05-03T03:17:17Z",
91 | "__typename": "Repository"
92 | },
93 | "__typename": "SearchResultItemEdge"
94 | },
95 | {
96 | "cursor": "Y3Vyc29yOjg=",
97 | "node": {
98 | "createdAt": "2022-05-01T21:31:30Z",
99 | "id": "R_kgDOHRDnUQ",
100 | "licenseInfo": null,
101 | "name": "slack-run-code",
102 | "stargazers": { "totalCount": 5, "__typename": "StargazerConnection" },
103 | "updatedAt": "2022-05-02T05:51:34Z",
104 | "__typename": "Repository"
105 | },
106 | "__typename": "SearchResultItemEdge"
107 | },
108 | {
109 | "cursor": "Y3Vyc29yOjk=",
110 | "node": {
111 | "createdAt": "2022-05-01T03:11:07Z",
112 | "id": "R_kgDOHQ2k8Q",
113 | "licenseInfo": null,
114 | "name": "fogex",
115 | "stargazers": { "totalCount": 5, "__typename": "StargazerConnection" },
116 | "updatedAt": "2022-05-03T10:08:09Z",
117 | "__typename": "Repository"
118 | },
119 | "__typename": "SearchResultItemEdge"
120 | },
121 | {
122 | "cursor": "Y3Vyc29yOjEw",
123 | "node": {
124 | "createdAt": "2022-05-02T02:16:44Z",
125 | "id": "R_kgDOHRGYfA",
126 | "licenseInfo": null,
127 | "name": "commit-date-change",
128 | "stargazers": { "totalCount": 4, "__typename": "StargazerConnection" },
129 | "updatedAt": "2022-05-02T04:30:38Z",
130 | "__typename": "Repository"
131 | },
132 | "__typename": "SearchResultItemEdge"
133 | }
134 | ],
135 | "pageInfo": {
136 | "endCursor": "Y3Vyc29yOjEw",
137 | "hasNextPage": true,
138 | "hasPreviousPage": false,
139 | "startCursor": "Y3Vyc29yOjE=",
140 | "__typename": "PageInfo"
141 | },
142 | "repositoryCount": 39120,
143 | "__typename": "SearchResultItemConnection"
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/index.ts:
--------------------------------------------------------------------------------
1 | export { RepositoriesTable } from './RepositoriesTable'
2 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/componets/RepositoriesTable/utils/index.ts:
--------------------------------------------------------------------------------
1 | import { PageInfo } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
2 |
3 | export const enhancedFetchMore = ({
4 | cursorAfter,
5 | cursorBefore,
6 | limit,
7 | queryString,
8 | fetchMore,
9 | }: {
10 | cursorAfter?: string
11 | cursorBefore?: string
12 | limit: number
13 | queryString: string
14 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
15 | fetchMore: any
16 | }) =>
17 | fetchMore({
18 | notifyOnNetworkStatusChange: true,
19 | variables: {
20 | cursorAfter: cursorAfter,
21 | cursorBefore: cursorBefore,
22 | first: cursorAfter ? limit || 10 : undefined,
23 | last: cursorBefore ? limit || 10 : undefined,
24 | queryString: queryString,
25 | },
26 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
27 | updateQuery: (previous: any, { fetchMoreResult }: { fetchMoreResult: any }) => {
28 | if (!fetchMoreResult) {
29 | return previous
30 | }
31 |
32 | return fetchMoreResult
33 | },
34 | })
35 |
36 | export const getPaginationParameters = (pageInfo?: PageInfo) => ({
37 | cursorAfter: pageInfo?.endCursor ?? '',
38 | cursorBefore: pageInfo?.startCursor ?? '',
39 | isNextDisabled: !pageInfo?.hasNextPage,
40 | isPreviousDisabled: !pageInfo?.hasPreviousPage,
41 | })
42 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/hooks/useInputTokenForGraphql.ts:
--------------------------------------------------------------------------------
1 | import { useCallback } from 'react'
2 |
3 | export const useInputTokenForGraphql = () => {
4 | const isTokenExist = Boolean(import.meta.env.VITE_GITHUB_TOKEN || localStorage.getItem('token'))
5 |
6 | const handleUpdateToken = useCallback(() => {
7 | const token = prompt('Введите ваш personal-access-token от Github, чтобы начать взаимодействие с API')
8 |
9 | localStorage.setItem('token', token ?? '')
10 | globalThis.location.reload()
11 | }, [])
12 |
13 | if (!isTokenExist) {
14 | handleUpdateToken()
15 | }
16 |
17 | return { isTokenExist, handleUpdateToken }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/index.ts:
--------------------------------------------------------------------------------
1 | export { GithubApp } from './GithubApp'
2 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/providers/ApolloProviderWrapper.tsx:
--------------------------------------------------------------------------------
1 | import { ApolloClient, ApolloProvider, createHttpLink, from, InMemoryCache } from '@apollo/client'
2 | import { setContext } from '@apollo/client/link/context'
3 | import { introspectionResult } from '@nx-vite-react-ts-mantine-boilerplate/graphql'
4 | import React, { FC, PropsWithChildren } from 'react'
5 |
6 | const httpLink = createHttpLink({
7 | uri: import.meta.env.VITE_GITHUB_API_ENDPOINT,
8 | })
9 |
10 | const authLink = setContext((_, { headers }) => {
11 | const token = import.meta.env.VITE_GITHUB_TOKEN || localStorage.getItem('token')
12 |
13 | return {
14 | headers: {
15 | ...headers,
16 | authorization: token ? `Bearer ${token}` : '',
17 | },
18 | }
19 | })
20 |
21 | const gqlClient = new ApolloClient({
22 | cache: new InMemoryCache({
23 | possibleTypes: introspectionResult.possibleTypes,
24 | }),
25 | link: from([authLink, httpLink]),
26 | uri: import.meta.env.VITE_GITHUB_API_ENDPOINT,
27 | })
28 |
29 | export const ApolloProviderWrapper: FC>> = ({ children }) => (
30 | {children}
31 | )
32 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/__tests__/getDateCondition.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from 'vitest'
2 |
3 | import { getDateCondition } from '../getDateCondition'
4 |
5 | type DateVariantType = number | string | undefined
6 |
7 | describe('getDateCondition', () => {
8 | let year: DateVariantType
9 | let month: DateVariantType
10 | let day: DateVariantType
11 |
12 | beforeEach(() => {
13 | const date = new Date()
14 |
15 | date.setDate(1)
16 |
17 | year = date.getFullYear()
18 |
19 | month = date.getMonth() + 1
20 | month = month > 9 ? month : `0${month}`
21 |
22 | day = date.getDate()
23 | day = day > 9 ? day : `0${day}`
24 | })
25 |
26 | it('getDateCondition =>', () => {
27 | const getDateSearchDefault = getDateCondition()
28 |
29 | expect(getDateSearchDefault).toBe(`created:>=${year}-${month}-${day}`)
30 | })
31 |
32 | it('getDateCondition <=', () => {
33 | const getDateSearchLate = getDateCondition('<=')
34 |
35 | expect(getDateSearchLate).toBe(`created:<=${year}-${month}-${day}`)
36 | })
37 |
38 | it('getDateCondition <= and date exists with month < 10', () => {
39 | const getDateSearchLate = getDateCondition('<=', new Date('2022-06-01'))
40 |
41 | expect(getDateSearchLate).toBe(`created:<=2022-06-01`)
42 | })
43 |
44 | it('getDateCondition <= and date exists with day < 10', () => {
45 | const getDateSearchLate = getDateCondition('<=', new Date('2022-11-10'))
46 |
47 | expect(getDateSearchLate).toBe(`created:<=2022-11-01`)
48 | })
49 |
50 | it('getDateCondition <= and date exists with day < 10 and month < 10', () => {
51 | const getDateSearchLate = getDateCondition('<=', new Date('2022-06-09'))
52 |
53 | expect(getDateSearchLate).toBe(`created:<=2022-06-01`)
54 | })
55 | })
56 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/__tests__/getLanguageCondition.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from 'vitest'
2 |
3 | import { getLanguageCondition } from '../getLanguageCondition'
4 |
5 | describe('getLanguageCondition', () => {
6 | it('getLanguageCondition without params', () => {
7 | expect(getLanguageCondition()).toBe('')
8 | })
9 |
10 | it('getLanguageCondition with empty param', () => {
11 | expect(getLanguageCondition('')).toBe('')
12 | })
13 |
14 | it('getLanguageCondition with field param and default sortBy', () => {
15 | expect(getLanguageCondition('JavaScript')).toBe('language:JavaScript')
16 | })
17 | })
18 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/__tests__/getLicenseCondition.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from 'vitest'
2 |
3 | import { getLicenseCondition } from '../getLicenseCondition'
4 |
5 | describe('getLicenseCondition', () => {
6 | it('getLicenseCondition without params', () => {
7 | expect(getLicenseCondition()).toBe('')
8 | })
9 |
10 | it('getLicenseCondition with empty param', () => {
11 | expect(getLicenseCondition('')).toBe('')
12 | })
13 |
14 | it('getLicenseCondition with valid param', () => {
15 | expect(getLicenseCondition('mit')).toBe('license:mit')
16 | })
17 | })
18 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/__tests__/getRepositoryNameCondition.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from 'vitest'
2 |
3 | import { getRepositoryNameCondition } from '../getRepositoryNameCondition'
4 |
5 | describe('getRepositoryNameCondition', () => {
6 | it('getRepositoryNameCondition without params', () => {
7 | expect(getRepositoryNameCondition()).toBe('')
8 | })
9 |
10 | it('getRepositoryNameCondition with empty param', () => {
11 | expect(getRepositoryNameCondition('')).toBe('')
12 | })
13 |
14 | it('getRepositoryNameCondition with valid param', () => {
15 | expect(getRepositoryNameCondition('react')).toBe('react in:name')
16 | })
17 | })
18 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/__tests__/getSortCondition.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from 'vitest'
2 |
3 | import { getSortCondition } from '../getSortCondition'
4 |
5 | describe('getSortCondition', () => {
6 | it('getSortCondition with empty param', () => {
7 | expect(getSortCondition('')).toBe('')
8 | })
9 |
10 | it('getSortCondition with field param and default sortBy', () => {
11 | expect(getSortCondition('stars')).toBe('sort:stars-desc')
12 | })
13 |
14 | it('getSortCondition with field param and sort by asc', () => {
15 | expect(getSortCondition('stars', 'asc')).toBe('sort:stars-asc')
16 | })
17 | })
18 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/getDateCondition.ts:
--------------------------------------------------------------------------------
1 | export const getDateCondition = (condition = '>=', date = new Date()) => {
2 | date.setDate(1)
3 |
4 | const year = date.getFullYear()
5 |
6 | let month: number | string = date.getMonth() + 1
7 |
8 | month = month > 9 ? month : `0${month}`
9 |
10 | let day: number | string = date.getDate()
11 |
12 | day = day > 9 ? day : `0${day}`
13 |
14 | return `created:${condition}${year}-${month}-${day}`
15 | }
16 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/getLanguageCondition.ts:
--------------------------------------------------------------------------------
1 | export const getLanguageCondition = (lang?: string) => {
2 | if (!lang) {
3 | return ''
4 | }
5 |
6 | return `language:${lang}`
7 | }
8 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/getLicenseCondition.ts:
--------------------------------------------------------------------------------
1 | export const getLicenseCondition = (license?: string) => {
2 | if (!license || license === ' ') {
3 | return ''
4 | }
5 |
6 | return `license:${license}`
7 | }
8 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/getRepositoryNameCondition.ts:
--------------------------------------------------------------------------------
1 | export const getRepositoryNameCondition = (repositoryName?: string) => (repositoryName ? `${repositoryName} in:name` : '')
2 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/getSortCondition.ts:
--------------------------------------------------------------------------------
1 | export const getSortCondition = (field: string, sortBy: 'asc' | 'desc' = 'desc') => {
2 | if (!field) {
3 | return ''
4 | }
5 |
6 | return `sort:${field}-${sortBy}`
7 | }
8 |
--------------------------------------------------------------------------------
/apps/main/src/GithubApp/utils/index.ts:
--------------------------------------------------------------------------------
1 | export { getDateCondition } from './getDateCondition'
2 | export { getLanguageCondition } from './getLanguageCondition'
3 | export { getLicenseCondition } from './getLicenseCondition'
4 | export { getRepositoryNameCondition } from './getRepositoryNameCondition'
5 | export { getSortCondition } from './getSortCondition'
6 |
--------------------------------------------------------------------------------
/apps/main/src/declarations.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.css' {
2 | const content: Record
3 | export default content
4 | }
5 |
--------------------------------------------------------------------------------
/apps/main/src/favicon.svg:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/apps/main/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { createRoot } from 'react-dom/client'
3 | import { BrowserRouter } from 'react-router-dom'
4 |
5 | import App from './App'
6 |
7 | const container = document.querySelector('#root')
8 | const root = createRoot(container as Element)
9 |
10 | root.render(
11 |
12 |
13 |
14 |
15 | ,
16 | )
17 |
--------------------------------------------------------------------------------
/apps/main/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "exclude": [
8 | "**/*.spec.ts",
9 | "**/*.spec.tsx",
10 | "**/*.spec.js",
11 | "**/*.spec.jsx"
12 | ],
13 | "include": [
14 | "src/**/*",
15 | "../../global.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/apps/main/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "target": "ESNext",
5 | "useDefineForClassFields": true,
6 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
7 | "allowJs": false,
8 | "skipLibCheck": true,
9 | "esModuleInterop": true,
10 | "allowSyntheticDefaultImports": true,
11 | "strict": true,
12 | "forceConsistentCasingInFileNames": true,
13 | "module": "ESNext",
14 | "moduleResolution": "Node",
15 | "resolveJsonModule": true,
16 | "isolatedModules": true,
17 | "noEmit": true,
18 | "jsx": "react"
19 | },
20 | "files": [
21 | "../../node_modules/@nx/react/typings/image.d.ts"
22 | ],
23 | "references": [
24 | {
25 | "path": "./tsconfig.app.json"
26 | },
27 | {
28 | "path": "./tsconfig.spec.json"
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/apps/main/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["jest", "node"]
6 | },
7 | "include": [
8 | "**/*.spec.ts",
9 | "**/*.spec.tsx",
10 | "**/*.spec.js",
11 | "**/*.spec.jsx",
12 | "**/*.d.ts",
13 | "vitest.setup.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/apps/main/vite.config.ts:
--------------------------------------------------------------------------------
1 | import path from 'node:path'
2 |
3 | import react from '@vitejs/plugin-react-swc'
4 | import analyze from 'rollup-plugin-analyzer'
5 | import visualizer from 'rollup-plugin-visualizer'
6 | import { defineConfig } from 'vite'
7 | import tsconfigPaths from 'vite-tsconfig-paths'
8 |
9 | const isDevelopment = Boolean(process.env.DEV ?? process.env.NODE_ENV === 'development')
10 | const isAnalyzeEnabled = Boolean(process.env.ANALYZE)
11 | const isNoMinify = Boolean(process.env.NO_MINIFY)
12 | const isSourceMapsEnabled = Boolean(process.env.SOURCE_MAPS)
13 |
14 | // https://vitejs.dev/config/
15 | export default defineConfig({
16 | base: './',
17 | build: {
18 | minify: isNoMinify ? false : 'esbuild',
19 | rollupOptions: {
20 | output: {
21 | manualChunks: (id) => {
22 | if (id.includes('mantine')) {
23 | return '@mantine'
24 | }
25 |
26 | if (id.includes('node_modules')) {
27 | return 'vendor'
28 | }
29 | },
30 | },
31 | plugins: isAnalyzeEnabled
32 | ? ([
33 | analyze(),
34 | visualizer({
35 | brotliSize: true,
36 | filename: path.join(__dirname, 'dist/stats/stats.html'),
37 | gzipSize: true,
38 | open: isDevelopment,
39 | projectRoot: path.join(__dirname),
40 | }),
41 | ] as unknown as any) // eslint-disable-line @typescript-eslint/no-explicit-any
42 | : [],
43 | },
44 | sourcemap: isSourceMapsEnabled,
45 | },
46 | plugins: [tsconfigPaths(), react()],
47 | server: {
48 | host: false,
49 | port: 3000,
50 | },
51 | })
52 |
--------------------------------------------------------------------------------
/apps/main/vitest.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { defineConfig, mergeConfig } from 'vite'
3 |
4 | import baseConfig from './vite.config'
5 |
6 | export default mergeConfig(
7 | baseConfig,
8 | defineConfig({
9 | test: {
10 | environment: 'jsdom',
11 | globals: true,
12 | setupFiles: ['./vitest.setup.ts'],
13 | },
14 | }),
15 | )
16 |
--------------------------------------------------------------------------------
/apps/main/vitest.setup.ts:
--------------------------------------------------------------------------------
1 | import { vitest } from 'vitest'
2 | import '@testing-library/jest-dom'
3 |
4 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5 | // @ts-ignore
6 | globalThis.IS_REACT_ACT_ENVIRONMENT = true
7 |
8 | globalThis.ResizeObserver =
9 | globalThis.ResizeObserver =
10 | globalThis.ResizeObserver =
11 | globalThis.ResizeObserver ||
12 | vitest.fn().mockImplementation(() => ({
13 | disconnect: vitest.fn(),
14 | observe: vitest.fn(),
15 | unobserve: vitest.fn(),
16 | }))
17 |
18 | globalThis.matchMedia =
19 | globalThis.matchMedia =
20 | globalThis.matchMedia =
21 | globalThis.matchMedia ||
22 | vitest.fn().mockImplementation((query) => ({
23 | dispatchEvent: vitest.fn(),
24 | matches: false,
25 | media: query,
26 | addEventListener: vitest.fn(),
27 | addListener: vitest.fn(),
28 | onchange: null,
29 | removeEventListener: vitest.fn(),
30 | removeListener: vitest.fn(),
31 | }))
32 |
33 | globalThis.matchMedia =
34 | globalThis.matchMedia =
35 | globalThis.matchMedia =
36 | globalThis.matchMedia ||
37 | vitest.fn().mockImplementation((query) => ({
38 | dispatchEvent: vitest.fn(),
39 | matches: false,
40 | media: query,
41 | addEventListener: vitest.fn(),
42 | addListener: vitest.fn(),
43 | onchange: null,
44 | removeEventListener: vitest.fn(),
45 | removeListener: vitest.fn(),
46 | }))
47 |
48 | const { getComputedStyle } = globalThis
49 |
50 | globalThis.getComputedStyle = (elt) => getComputedStyle(elt)
51 |
--------------------------------------------------------------------------------
/browserslist:
--------------------------------------------------------------------------------
1 | > 5%
2 | Last 2 versions
3 |
--------------------------------------------------------------------------------
/docs/app_screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dipiash/nx-vite-react-ts-mantine-boilerplate/70dc2f21a7c512606efa3c7cdc171466055c793f/docs/app_screenshot_1.png
--------------------------------------------------------------------------------
/docs/app_screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dipiash/nx-vite-react-ts-mantine-boilerplate/70dc2f21a7c512606efa3c7cdc171466055c793f/docs/app_screenshot_2.png
--------------------------------------------------------------------------------
/docs/app_screenshot_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dipiash/nx-vite-react-ts-mantine-boilerplate/70dc2f21a7c512606efa3c7cdc171466055c793f/docs/app_screenshot_3.png
--------------------------------------------------------------------------------
/global.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 | ///
5 | ///
6 |
7 | declare global {
8 | interface ImportMetaEnv {
9 | readonly VITE_GITHUB_TOKEN: string
10 | readonly VITE_GITHUB_API_ENDPOINT: string
11 | }
12 |
13 | interface ImportMeta {
14 | readonly env: ImportMetaEnv
15 | }
16 |
17 | namespace Cypress {
18 | interface Chainable {
19 | login(email: string, password: string): void
20 | matchImageSnapshot(snapshotName?: string): void
21 | }
22 | }
23 | }
24 |
25 | export {}
26 |
--------------------------------------------------------------------------------
/nx.json:
--------------------------------------------------------------------------------
1 | {
2 | "tasksRunnerOptions": {
3 | "default": {
4 | "runner": "@nx/workspace/tasks-runners/default",
5 | "options": {}
6 | }
7 | },
8 | "extends": "nx/presets/core.json",
9 | "workspaceLayout": {
10 | "appsDir": "apps",
11 | "libsDir": "packages"
12 | },
13 | "generators": {
14 | "@nx/react": {
15 | "application": {
16 | "linter": "eslint",
17 | "babel": true
18 | },
19 | "component": {},
20 | "library": {
21 | "linter": "eslint"
22 | }
23 | }
24 | },
25 | "defaultProject": "main",
26 | "namedInputs": {
27 | "default": ["{projectRoot}/**/*", "sharedGlobals"],
28 | "sharedGlobals": [
29 | "{workspaceRoot}/workspace.json",
30 | "{workspaceRoot}/tsconfig.base.json",
31 | "{workspaceRoot}/tsconfig.json",
32 | "{workspaceRoot}/nx.json",
33 | "{workspaceRoot}/babel.config.json",
34 | "{workspaceRoot}/workspace.json",
35 | "{workspaceRoot}/tsconfig.base.json",
36 | "{workspaceRoot}/tsconfig.json",
37 | "{workspaceRoot}/nx.json"
38 | ],
39 | "production": [
40 | "default",
41 | "!{projectRoot}/.eslintrc.json",
42 | "!{projectRoot}/.storybook/**/*",
43 | "!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
44 | "!{projectRoot}/tsconfig.storybook.json",
45 | "!{projectRoot}/cypress/**/*",
46 | "!{projectRoot}/**/*.cy.[jt]s?(x)",
47 | "!{projectRoot}/cypress.config.[jt]s"
48 | ]
49 | },
50 | "targetDefaults": {
51 | "build": {
52 | "inputs": ["production", "^production"],
53 | "cache": true
54 | },
55 | "e2e": {
56 | "inputs": ["default", "^production"],
57 | "cache": true
58 | },
59 | "storybook:build": {
60 | "inputs": ["default", "^production", "{workspaceRoot}/.storybook/**/*"]
61 | },
62 | "test": {
63 | "cache": true
64 | },
65 | "type-check": {
66 | "cache": true
67 | },
68 | "@nx/eslint:lint": {
69 | "inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
70 | "cache": true
71 | }
72 | },
73 | "$schema": "./node_modules/nx/schemas/nx-schema.json",
74 | "defaultBase": "main",
75 | "useLegacyCache": true,
76 | "plugins": [
77 | {
78 | "plugin": "@nx/cypress/plugin",
79 | "options": {
80 | "targetName": "e2e",
81 | "openTargetName": "open-cypress",
82 | "componentTestingTargetName": "component-test",
83 | "ciTargetName": "e2e-ci"
84 | }
85 | }
86 | ]
87 | }
88 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nx-vite-react-ts-mantine-boilerplate",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "init": "npm run clean:all && npm install && npm run build:icons",
7 | "dev": "nx serve main",
8 | "dev:storybook": "nx storybook ui-kit",
9 | "build:app": "nx build main",
10 | "build:storybook": "nx storybook:build ui-kit",
11 | "build:icons": "nx build icons",
12 | "serve:app": "nx preview main",
13 | "serve:storybook": "nx storybook:serve ui-kit",
14 | "lint": "nx run-many --target=lint --all",
15 | "lint:fix": "nx run-many --target=lint --all --fix",
16 | "lint:type-check": "nx run-many --target=type-check --all",
17 | "lint:stylelint": "nx run-many --target=stylelint --all --fix",
18 | "test": "VITEST=true nx run-many --target=test --all",
19 | "test:e2e:storybook": "VITEST=true nx e2e ui-kit",
20 | "codegen:graphql": "nx codegen graphql",
21 | "clean:node-modules": "rm -rf node_modules && rm -rf packages/*/node_modules",
22 | "clean:dist": "rm -rf packages/*/build && rm -rf packages/*/dist",
23 | "clean:coverage": "rm -rf packages/*/coverage",
24 | "clean:icons": "rm -rf packages/icons/src/components",
25 | "clean:all": "npm run clean:node-modules && npm run clean:dist && npm run clean:coverage && npm run clean:icons",
26 | "upgrade:nx": "nx migrate latest && npm install && nx migrate --run-migrations --if-exists && rm -rf migrations.json",
27 | "upgrade:storybook": "storybook upgrade",
28 | "prepare": "husky"
29 | },
30 | "private": true,
31 | "engines": {
32 | "node": "20.x"
33 | },
34 | "lint-staged": {
35 | "**/*.{js,jsx,ts,tsx}": [
36 | "nx affected --target=lint --fix=true --uncommitted=true",
37 | "nx affected --target=stylelint --fix=true --uncommitted=true"
38 | ]
39 | },
40 | "devDependencies": {
41 | "@apollo/client": "3.10.4",
42 | "@apollo/react-testing": "4.0.0",
43 | "@base2/pretty-print-object": "1.0.2",
44 | "@chromatic-com/storybook": "1",
45 | "@graphql-codegen/cli": "5.0.2",
46 | "@graphql-codegen/fragment-matcher": "5.0.2",
47 | "@graphql-codegen/near-operation-file-preset": "3.0.0",
48 | "@graphql-codegen/schema-ast": "4.0.2",
49 | "@graphql-codegen/typescript-operations": "4.2.0",
50 | "@graphql-codegen/typescript-react-apollo": "4.3.0",
51 | "@graphql-eslint/eslint-plugin": "3.20.1",
52 | "@nx/cypress": "20.0.3",
53 | "@nx/devkit": "20.0.3",
54 | "@nx/eslint-plugin": "20.0.3",
55 | "@nx/js": "20.0.3",
56 | "@nx/node": "20.0.3",
57 | "@nx/react": "20.0.3",
58 | "@nx/storybook": "20.0.3",
59 | "@nx/web": "20.0.3",
60 | "@nx/workspace": "20.0.3",
61 | "@storybook/addon-essentials": "^8.3.6",
62 | "@storybook/addon-interactions": "8.3.6",
63 | "@storybook/core-server": "^8.3.6",
64 | "@storybook/react": "^8.3.6",
65 | "@storybook/react-vite": "^8.3.6",
66 | "@svgr/cli": "8.1.0",
67 | "@svgr/plugin-svgo": "8.1.0",
68 | "@svgr/webpack": "8.1.0",
69 | "@testing-library/jest-dom": "6.4.5",
70 | "@testing-library/react": "15.0.7",
71 | "@testing-library/user-event": "14.5.2",
72 | "@types/bluebird": "3.5.42",
73 | "@types/jest": "29.5.12",
74 | "@types/node": "20.12.12",
75 | "@types/react": "18.3.2",
76 | "@types/react-dom": "18.3.0",
77 | "@types/react-is": "18.3.0",
78 | "@types/react-router-dom": "5.3.3",
79 | "@typescript-eslint/eslint-plugin": "8.15.0",
80 | "@typescript-eslint/parser": "7.9.0",
81 | "@vitejs/plugin-react-swc": "3.6.0",
82 | "@vitest/coverage-v8": "1.6.0",
83 | "@vitest/ui": "1.6.0",
84 | "@welldone-software/why-did-you-render": "8.0.1",
85 | "babel-loader": "9.1.3",
86 | "cypress": "13.15.0",
87 | "esbuild": "0.21.2",
88 | "eslint": "8.57.1",
89 | "eslint-config-prettier": "9.1.0",
90 | "eslint-import-resolver-typescript": "3.6.3",
91 | "eslint-plugin-cypress": "3.2.0",
92 | "eslint-plugin-import": "2.31.0",
93 | "eslint-plugin-jsx-a11y": "6.10.2",
94 | "eslint-plugin-nimbus-clean": "2.0.0",
95 | "eslint-plugin-perfectionist": "3.9.1",
96 | "eslint-plugin-prettier": "5.2.1",
97 | "eslint-plugin-promise": "7.1.0",
98 | "eslint-plugin-react": "7.37.2",
99 | "eslint-plugin-react-hooks": "5.0.0",
100 | "eslint-plugin-react-refresh": "0.4.14",
101 | "eslint-plugin-simple-import-sort": "12.1.0",
102 | "eslint-plugin-sonarjs": "2.0.4",
103 | "eslint-plugin-storybook": "0.10.1",
104 | "eslint-plugin-testing-library": "6.4.0",
105 | "eslint-plugin-unicorn": "56.0.0",
106 | "husky": "9.1.6",
107 | "jsdom": "24.0.0",
108 | "lint-staged": "15.2.2",
109 | "nx": "20.0.3",
110 | "nx-stylelint": "18.0.0",
111 | "postcss": "8.4.38",
112 | "postcss-preset-mantine": "1.15.0",
113 | "postcss-simple-vars": "7.0.1",
114 | "postcss-syntax": "0.36.2",
115 | "prettier": "3.3.3",
116 | "react-scripts": "5.0.1",
117 | "rollup-plugin-analyzer": "4.0.0",
118 | "rollup-plugin-visualizer": "5.12.0",
119 | "storybook": "8.3.6",
120 | "stylelint": "16.5.0",
121 | "stylelint-config-css-modules": "4.4.0",
122 | "stylelint-config-standard": "36.0.0",
123 | "tslib": "2.6.2",
124 | "url-loader": "4.1.1",
125 | "vite": "5.4.10",
126 | "vite-dts": "1.0.4",
127 | "vite-tsconfig-paths": "4.3.2",
128 | "vitest": "1.6.0"
129 | },
130 | "dependencies": {
131 | "@eslint/js": "9.15.0",
132 | "@mantine/core": "7.13.3",
133 | "@mantine/form": "7.13.3",
134 | "@mantine/hooks": "7.13.3",
135 | "@tabler/icons-react": "3.3.0",
136 | "clsx": "2.1.1",
137 | "globals": "15.12.0",
138 | "graphql": "16.8.1",
139 | "graphql-tag": "2.12.6",
140 | "react": "18.3.1",
141 | "react-dom": "18.3.1",
142 | "react-hook-form": "7.51.4",
143 | "react-is": "18.3.1",
144 | "react-router-dom": "6.23.1",
145 | "ts-toolbelt": "9.6.0",
146 | "typescript": "5.5.4",
147 | "typescript-eslint": "8.15.0"
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/packages/graphql/.env.example:
--------------------------------------------------------------------------------
1 | GITHUB_TOKEN=YOUR_GITHUB_TOKEN
2 | GITHUB_API_ENDPOINT=https://api.github.com/graphql
3 |
--------------------------------------------------------------------------------
/packages/graphql/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "**/*/generated.tsx", "**/*/schema.graphql"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx"],
7 | "rules": {},
8 | "parserOptions": {
9 | "project": ["tsconfig.*?.json"]
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/graphql/codegen.yml:
--------------------------------------------------------------------------------
1 | overwrite: true
2 | schema:
3 | - ${GITHUB_API_ENDPOINT}:
4 | headers:
5 | Authorization: bearer ${GITHUB_TOKEN}
6 | User-Agent: nx-vite-react-ts-mantine-boilerplate
7 | documents: 'src/lib/graphql/**/*.graphql'
8 | generates:
9 | src/lib/generated/fragment-matcher.ts:
10 | plugins:
11 | - fragment-matcher
12 | src/lib/generated/schema.graphql:
13 | plugins:
14 | - schema-ast
15 | src/lib/generated/generated.tsx:
16 | plugins:
17 | - "typescript"
18 | - "typescript-operations"
19 | - "typescript-react-apollo"
20 | config:
21 | withHooks: true
22 | withComponent: false
23 | withHOC: false
24 |
--------------------------------------------------------------------------------
/packages/graphql/graphql.config.yml:
--------------------------------------------------------------------------------
1 | schema: "src/lib/generated/schema.graphql"
2 | documents: "src/lib/graphql/**/*.graphql"
3 |
--------------------------------------------------------------------------------
/packages/graphql/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nx-vite-react-ts-mantine-boilerplate/graphql"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/graphql/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "graphql",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "packages/graphql/src",
5 | "projectType": "library",
6 | "tags": [],
7 | "targets": {
8 | "lint": {
9 | "executor": "@nx/eslint:lint",
10 | "outputs": ["{options.outputFile}"]
11 | },
12 | "codegen": {
13 | "executor": "nx:run-commands",
14 | "options": {
15 | "cwd": "./packages/graphql",
16 | "commands": [
17 | {
18 | "command": "DOTENV_CONFIG_PATH=\"./.env.local\" graphql-codegen --require dotenv/config --config ./codegen.yml"
19 | }
20 | ]
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/graphql/src/index.ts:
--------------------------------------------------------------------------------
1 | export { default as introspectionResult } from './lib/generated/fragment-matcher'
2 | export * from './lib/generated/generated'
3 |
--------------------------------------------------------------------------------
/packages/graphql/src/lib/generated/fragment-matcher.ts:
--------------------------------------------------------------------------------
1 |
2 | export interface PossibleTypesResultData {
3 | possibleTypes: {
4 | [key: string]: string[]
5 | }
6 | }
7 | const result: PossibleTypesResultData = {
8 | "possibleTypes": {
9 | "Actor": [
10 | "Bot",
11 | "EnterpriseUserAccount",
12 | "Mannequin",
13 | "Organization",
14 | "User"
15 | ],
16 | "AnnouncementBanner": [
17 | "Enterprise",
18 | "Organization"
19 | ],
20 | "Assignable": [
21 | "Issue",
22 | "PullRequest"
23 | ],
24 | "Assignee": [
25 | "Bot",
26 | "Mannequin",
27 | "Organization",
28 | "User"
29 | ],
30 | "AuditEntry": [
31 | "MembersCanDeleteReposClearAuditEntry",
32 | "MembersCanDeleteReposDisableAuditEntry",
33 | "MembersCanDeleteReposEnableAuditEntry",
34 | "OauthApplicationCreateAuditEntry",
35 | "OrgAddBillingManagerAuditEntry",
36 | "OrgAddMemberAuditEntry",
37 | "OrgBlockUserAuditEntry",
38 | "OrgConfigDisableCollaboratorsOnlyAuditEntry",
39 | "OrgConfigEnableCollaboratorsOnlyAuditEntry",
40 | "OrgCreateAuditEntry",
41 | "OrgDisableOauthAppRestrictionsAuditEntry",
42 | "OrgDisableSamlAuditEntry",
43 | "OrgDisableTwoFactorRequirementAuditEntry",
44 | "OrgEnableOauthAppRestrictionsAuditEntry",
45 | "OrgEnableSamlAuditEntry",
46 | "OrgEnableTwoFactorRequirementAuditEntry",
47 | "OrgInviteMemberAuditEntry",
48 | "OrgInviteToBusinessAuditEntry",
49 | "OrgOauthAppAccessApprovedAuditEntry",
50 | "OrgOauthAppAccessBlockedAuditEntry",
51 | "OrgOauthAppAccessDeniedAuditEntry",
52 | "OrgOauthAppAccessRequestedAuditEntry",
53 | "OrgOauthAppAccessUnblockedAuditEntry",
54 | "OrgRemoveBillingManagerAuditEntry",
55 | "OrgRemoveMemberAuditEntry",
56 | "OrgRemoveOutsideCollaboratorAuditEntry",
57 | "OrgRestoreMemberAuditEntry",
58 | "OrgUnblockUserAuditEntry",
59 | "OrgUpdateDefaultRepositoryPermissionAuditEntry",
60 | "OrgUpdateMemberAuditEntry",
61 | "OrgUpdateMemberRepositoryCreationPermissionAuditEntry",
62 | "OrgUpdateMemberRepositoryInvitationPermissionAuditEntry",
63 | "PrivateRepositoryForkingDisableAuditEntry",
64 | "PrivateRepositoryForkingEnableAuditEntry",
65 | "RepoAccessAuditEntry",
66 | "RepoAddMemberAuditEntry",
67 | "RepoAddTopicAuditEntry",
68 | "RepoArchivedAuditEntry",
69 | "RepoChangeMergeSettingAuditEntry",
70 | "RepoConfigDisableAnonymousGitAccessAuditEntry",
71 | "RepoConfigDisableCollaboratorsOnlyAuditEntry",
72 | "RepoConfigDisableContributorsOnlyAuditEntry",
73 | "RepoConfigDisableSockpuppetDisallowedAuditEntry",
74 | "RepoConfigEnableAnonymousGitAccessAuditEntry",
75 | "RepoConfigEnableCollaboratorsOnlyAuditEntry",
76 | "RepoConfigEnableContributorsOnlyAuditEntry",
77 | "RepoConfigEnableSockpuppetDisallowedAuditEntry",
78 | "RepoConfigLockAnonymousGitAccessAuditEntry",
79 | "RepoConfigUnlockAnonymousGitAccessAuditEntry",
80 | "RepoCreateAuditEntry",
81 | "RepoDestroyAuditEntry",
82 | "RepoRemoveMemberAuditEntry",
83 | "RepoRemoveTopicAuditEntry",
84 | "RepositoryVisibilityChangeDisableAuditEntry",
85 | "RepositoryVisibilityChangeEnableAuditEntry",
86 | "TeamAddMemberAuditEntry",
87 | "TeamAddRepositoryAuditEntry",
88 | "TeamChangeParentTeamAuditEntry",
89 | "TeamRemoveMemberAuditEntry",
90 | "TeamRemoveRepositoryAuditEntry"
91 | ],
92 | "AuditEntryActor": [
93 | "Bot",
94 | "Organization",
95 | "User"
96 | ],
97 | "BranchActorAllowanceActor": [
98 | "App",
99 | "Team",
100 | "User"
101 | ],
102 | "BypassActor": [
103 | "App",
104 | "Team"
105 | ],
106 | "Claimable": [
107 | "Mannequin",
108 | "User"
109 | ],
110 | "Closable": [
111 | "Discussion",
112 | "Issue",
113 | "Milestone",
114 | "Project",
115 | "ProjectV2",
116 | "PullRequest"
117 | ],
118 | "Closer": [
119 | "Commit",
120 | "ProjectV2",
121 | "PullRequest"
122 | ],
123 | "Comment": [
124 | "CommitComment",
125 | "Discussion",
126 | "DiscussionComment",
127 | "GistComment",
128 | "Issue",
129 | "IssueComment",
130 | "PullRequest",
131 | "PullRequestReview",
132 | "PullRequestReviewComment",
133 | "TeamDiscussion",
134 | "TeamDiscussionComment"
135 | ],
136 | "Contribution": [
137 | "CreatedCommitContribution",
138 | "CreatedIssueContribution",
139 | "CreatedPullRequestContribution",
140 | "CreatedPullRequestReviewContribution",
141 | "CreatedRepositoryContribution",
142 | "JoinedGitHubContribution",
143 | "RestrictedContribution"
144 | ],
145 | "CreatedIssueOrRestrictedContribution": [
146 | "CreatedIssueContribution",
147 | "RestrictedContribution"
148 | ],
149 | "CreatedPullRequestOrRestrictedContribution": [
150 | "CreatedPullRequestContribution",
151 | "RestrictedContribution"
152 | ],
153 | "CreatedRepositoryOrRestrictedContribution": [
154 | "CreatedRepositoryContribution",
155 | "RestrictedContribution"
156 | ],
157 | "Deletable": [
158 | "CommitComment",
159 | "Discussion",
160 | "DiscussionComment",
161 | "GistComment",
162 | "Issue",
163 | "IssueComment",
164 | "PullRequestReview",
165 | "PullRequestReviewComment",
166 | "TeamDiscussion",
167 | "TeamDiscussionComment"
168 | ],
169 | "DeploymentReviewer": [
170 | "Team",
171 | "User"
172 | ],
173 | "EnterpriseAuditEntryData": [
174 | "MembersCanDeleteReposClearAuditEntry",
175 | "MembersCanDeleteReposDisableAuditEntry",
176 | "MembersCanDeleteReposEnableAuditEntry",
177 | "OrgInviteToBusinessAuditEntry",
178 | "PrivateRepositoryForkingDisableAuditEntry",
179 | "PrivateRepositoryForkingEnableAuditEntry",
180 | "RepositoryVisibilityChangeDisableAuditEntry",
181 | "RepositoryVisibilityChangeEnableAuditEntry"
182 | ],
183 | "EnterpriseMember": [
184 | "EnterpriseUserAccount",
185 | "User"
186 | ],
187 | "GitObject": [
188 | "Blob",
189 | "Commit",
190 | "Tag",
191 | "Tree"
192 | ],
193 | "GitSignature": [
194 | "GpgSignature",
195 | "SmimeSignature",
196 | "SshSignature",
197 | "UnknownSignature"
198 | ],
199 | "HovercardContext": [
200 | "GenericHovercardContext",
201 | "OrganizationTeamsHovercardContext",
202 | "OrganizationsHovercardContext",
203 | "ReviewStatusHovercardContext",
204 | "ViewerHovercardContext"
205 | ],
206 | "IpAllowListOwner": [
207 | "App",
208 | "Enterprise",
209 | "Organization"
210 | ],
211 | "IssueOrPullRequest": [
212 | "Issue",
213 | "PullRequest"
214 | ],
215 | "IssueTimelineItem": [
216 | "AssignedEvent",
217 | "ClosedEvent",
218 | "Commit",
219 | "CrossReferencedEvent",
220 | "DemilestonedEvent",
221 | "IssueComment",
222 | "LabeledEvent",
223 | "LockedEvent",
224 | "MilestonedEvent",
225 | "ReferencedEvent",
226 | "RenamedTitleEvent",
227 | "ReopenedEvent",
228 | "SubscribedEvent",
229 | "TransferredEvent",
230 | "UnassignedEvent",
231 | "UnlabeledEvent",
232 | "UnlockedEvent",
233 | "UnsubscribedEvent",
234 | "UserBlockedEvent"
235 | ],
236 | "IssueTimelineItems": [
237 | "AddedToProjectEvent",
238 | "AssignedEvent",
239 | "ClosedEvent",
240 | "CommentDeletedEvent",
241 | "ConnectedEvent",
242 | "ConvertedNoteToIssueEvent",
243 | "ConvertedToDiscussionEvent",
244 | "CrossReferencedEvent",
245 | "DemilestonedEvent",
246 | "DisconnectedEvent",
247 | "IssueComment",
248 | "LabeledEvent",
249 | "LockedEvent",
250 | "MarkedAsDuplicateEvent",
251 | "MentionedEvent",
252 | "MilestonedEvent",
253 | "MovedColumnsInProjectEvent",
254 | "PinnedEvent",
255 | "ReferencedEvent",
256 | "RemovedFromProjectEvent",
257 | "RenamedTitleEvent",
258 | "ReopenedEvent",
259 | "SubscribedEvent",
260 | "TransferredEvent",
261 | "UnassignedEvent",
262 | "UnlabeledEvent",
263 | "UnlockedEvent",
264 | "UnmarkedAsDuplicateEvent",
265 | "UnpinnedEvent",
266 | "UnsubscribedEvent",
267 | "UserBlockedEvent"
268 | ],
269 | "Labelable": [
270 | "Discussion",
271 | "Issue",
272 | "PullRequest"
273 | ],
274 | "Lockable": [
275 | "Discussion",
276 | "Issue",
277 | "PullRequest"
278 | ],
279 | "MemberStatusable": [
280 | "Organization",
281 | "Team"
282 | ],
283 | "Migration": [
284 | "RepositoryMigration"
285 | ],
286 | "MilestoneItem": [
287 | "Issue",
288 | "PullRequest"
289 | ],
290 | "Minimizable": [
291 | "CommitComment",
292 | "DiscussionComment",
293 | "GistComment",
294 | "IssueComment",
295 | "PullRequestReview",
296 | "PullRequestReviewComment"
297 | ],
298 | "Node": [
299 | "AddedToMergeQueueEvent",
300 | "AddedToProjectEvent",
301 | "App",
302 | "AssignedEvent",
303 | "AutoMergeDisabledEvent",
304 | "AutoMergeEnabledEvent",
305 | "AutoRebaseEnabledEvent",
306 | "AutoSquashEnabledEvent",
307 | "AutomaticBaseChangeFailedEvent",
308 | "AutomaticBaseChangeSucceededEvent",
309 | "BaseRefChangedEvent",
310 | "BaseRefDeletedEvent",
311 | "BaseRefForcePushedEvent",
312 | "Blob",
313 | "Bot",
314 | "BranchProtectionRule",
315 | "BypassForcePushAllowance",
316 | "BypassPullRequestAllowance",
317 | "CWE",
318 | "CheckRun",
319 | "CheckSuite",
320 | "ClosedEvent",
321 | "CodeOfConduct",
322 | "CommentDeletedEvent",
323 | "Commit",
324 | "CommitComment",
325 | "CommitCommentThread",
326 | "Comparison",
327 | "ConnectedEvent",
328 | "ConvertToDraftEvent",
329 | "ConvertedNoteToIssueEvent",
330 | "ConvertedToDiscussionEvent",
331 | "CrossReferencedEvent",
332 | "DemilestonedEvent",
333 | "DependencyGraphManifest",
334 | "DeployKey",
335 | "DeployedEvent",
336 | "Deployment",
337 | "DeploymentEnvironmentChangedEvent",
338 | "DeploymentReview",
339 | "DeploymentStatus",
340 | "DisconnectedEvent",
341 | "Discussion",
342 | "DiscussionCategory",
343 | "DiscussionComment",
344 | "DiscussionPoll",
345 | "DiscussionPollOption",
346 | "DraftIssue",
347 | "Enterprise",
348 | "EnterpriseAdministratorInvitation",
349 | "EnterpriseIdentityProvider",
350 | "EnterpriseRepositoryInfo",
351 | "EnterpriseServerInstallation",
352 | "EnterpriseServerUserAccount",
353 | "EnterpriseServerUserAccountEmail",
354 | "EnterpriseServerUserAccountsUpload",
355 | "EnterpriseUserAccount",
356 | "Environment",
357 | "ExternalIdentity",
358 | "Gist",
359 | "GistComment",
360 | "HeadRefDeletedEvent",
361 | "HeadRefForcePushedEvent",
362 | "HeadRefRestoredEvent",
363 | "IpAllowListEntry",
364 | "Issue",
365 | "IssueComment",
366 | "Label",
367 | "LabeledEvent",
368 | "Language",
369 | "License",
370 | "LinkedBranch",
371 | "LockedEvent",
372 | "Mannequin",
373 | "MarkedAsDuplicateEvent",
374 | "MarketplaceCategory",
375 | "MarketplaceListing",
376 | "MemberFeatureRequestNotification",
377 | "MembersCanDeleteReposClearAuditEntry",
378 | "MembersCanDeleteReposDisableAuditEntry",
379 | "MembersCanDeleteReposEnableAuditEntry",
380 | "MentionedEvent",
381 | "MergeQueue",
382 | "MergeQueueEntry",
383 | "MergedEvent",
384 | "MigrationSource",
385 | "Milestone",
386 | "MilestonedEvent",
387 | "MovedColumnsInProjectEvent",
388 | "OIDCProvider",
389 | "OauthApplicationCreateAuditEntry",
390 | "OrgAddBillingManagerAuditEntry",
391 | "OrgAddMemberAuditEntry",
392 | "OrgBlockUserAuditEntry",
393 | "OrgConfigDisableCollaboratorsOnlyAuditEntry",
394 | "OrgConfigEnableCollaboratorsOnlyAuditEntry",
395 | "OrgCreateAuditEntry",
396 | "OrgDisableOauthAppRestrictionsAuditEntry",
397 | "OrgDisableSamlAuditEntry",
398 | "OrgDisableTwoFactorRequirementAuditEntry",
399 | "OrgEnableOauthAppRestrictionsAuditEntry",
400 | "OrgEnableSamlAuditEntry",
401 | "OrgEnableTwoFactorRequirementAuditEntry",
402 | "OrgInviteMemberAuditEntry",
403 | "OrgInviteToBusinessAuditEntry",
404 | "OrgOauthAppAccessApprovedAuditEntry",
405 | "OrgOauthAppAccessBlockedAuditEntry",
406 | "OrgOauthAppAccessDeniedAuditEntry",
407 | "OrgOauthAppAccessRequestedAuditEntry",
408 | "OrgOauthAppAccessUnblockedAuditEntry",
409 | "OrgRemoveBillingManagerAuditEntry",
410 | "OrgRemoveMemberAuditEntry",
411 | "OrgRemoveOutsideCollaboratorAuditEntry",
412 | "OrgRestoreMemberAuditEntry",
413 | "OrgUnblockUserAuditEntry",
414 | "OrgUpdateDefaultRepositoryPermissionAuditEntry",
415 | "OrgUpdateMemberAuditEntry",
416 | "OrgUpdateMemberRepositoryCreationPermissionAuditEntry",
417 | "OrgUpdateMemberRepositoryInvitationPermissionAuditEntry",
418 | "Organization",
419 | "OrganizationIdentityProvider",
420 | "OrganizationInvitation",
421 | "OrganizationMigration",
422 | "Package",
423 | "PackageFile",
424 | "PackageTag",
425 | "PackageVersion",
426 | "PinnedDiscussion",
427 | "PinnedEnvironment",
428 | "PinnedEvent",
429 | "PinnedIssue",
430 | "PrivateRepositoryForkingDisableAuditEntry",
431 | "PrivateRepositoryForkingEnableAuditEntry",
432 | "Project",
433 | "ProjectCard",
434 | "ProjectColumn",
435 | "ProjectV2",
436 | "ProjectV2Field",
437 | "ProjectV2Item",
438 | "ProjectV2ItemFieldDateValue",
439 | "ProjectV2ItemFieldIterationValue",
440 | "ProjectV2ItemFieldNumberValue",
441 | "ProjectV2ItemFieldSingleSelectValue",
442 | "ProjectV2ItemFieldTextValue",
443 | "ProjectV2IterationField",
444 | "ProjectV2SingleSelectField",
445 | "ProjectV2View",
446 | "ProjectV2Workflow",
447 | "PublicKey",
448 | "PullRequest",
449 | "PullRequestCommit",
450 | "PullRequestCommitCommentThread",
451 | "PullRequestReview",
452 | "PullRequestReviewComment",
453 | "PullRequestReviewThread",
454 | "PullRequestThread",
455 | "Push",
456 | "PushAllowance",
457 | "Reaction",
458 | "ReadyForReviewEvent",
459 | "Ref",
460 | "ReferencedEvent",
461 | "Release",
462 | "ReleaseAsset",
463 | "RemovedFromMergeQueueEvent",
464 | "RemovedFromProjectEvent",
465 | "RenamedTitleEvent",
466 | "ReopenedEvent",
467 | "RepoAccessAuditEntry",
468 | "RepoAddMemberAuditEntry",
469 | "RepoAddTopicAuditEntry",
470 | "RepoArchivedAuditEntry",
471 | "RepoChangeMergeSettingAuditEntry",
472 | "RepoConfigDisableAnonymousGitAccessAuditEntry",
473 | "RepoConfigDisableCollaboratorsOnlyAuditEntry",
474 | "RepoConfigDisableContributorsOnlyAuditEntry",
475 | "RepoConfigDisableSockpuppetDisallowedAuditEntry",
476 | "RepoConfigEnableAnonymousGitAccessAuditEntry",
477 | "RepoConfigEnableCollaboratorsOnlyAuditEntry",
478 | "RepoConfigEnableContributorsOnlyAuditEntry",
479 | "RepoConfigEnableSockpuppetDisallowedAuditEntry",
480 | "RepoConfigLockAnonymousGitAccessAuditEntry",
481 | "RepoConfigUnlockAnonymousGitAccessAuditEntry",
482 | "RepoCreateAuditEntry",
483 | "RepoDestroyAuditEntry",
484 | "RepoRemoveMemberAuditEntry",
485 | "RepoRemoveTopicAuditEntry",
486 | "Repository",
487 | "RepositoryInvitation",
488 | "RepositoryMigration",
489 | "RepositoryRule",
490 | "RepositoryRuleset",
491 | "RepositoryRulesetBypassActor",
492 | "RepositoryTopic",
493 | "RepositoryVisibilityChangeDisableAuditEntry",
494 | "RepositoryVisibilityChangeEnableAuditEntry",
495 | "RepositoryVulnerabilityAlert",
496 | "ReviewDismissalAllowance",
497 | "ReviewDismissedEvent",
498 | "ReviewRequest",
499 | "ReviewRequestRemovedEvent",
500 | "ReviewRequestedEvent",
501 | "SavedReply",
502 | "SecurityAdvisory",
503 | "SponsorsActivity",
504 | "SponsorsListing",
505 | "SponsorsListingFeaturedItem",
506 | "SponsorsTier",
507 | "Sponsorship",
508 | "SponsorshipNewsletter",
509 | "Status",
510 | "StatusCheckRollup",
511 | "StatusContext",
512 | "SubscribedEvent",
513 | "Tag",
514 | "Team",
515 | "TeamAddMemberAuditEntry",
516 | "TeamAddRepositoryAuditEntry",
517 | "TeamChangeParentTeamAuditEntry",
518 | "TeamDiscussion",
519 | "TeamDiscussionComment",
520 | "TeamRemoveMemberAuditEntry",
521 | "TeamRemoveRepositoryAuditEntry",
522 | "Topic",
523 | "TransferredEvent",
524 | "Tree",
525 | "UnassignedEvent",
526 | "UnlabeledEvent",
527 | "UnlockedEvent",
528 | "UnmarkedAsDuplicateEvent",
529 | "UnpinnedEvent",
530 | "UnsubscribedEvent",
531 | "User",
532 | "UserBlockedEvent",
533 | "UserContentEdit",
534 | "UserList",
535 | "UserStatus",
536 | "VerifiableDomain",
537 | "Workflow",
538 | "WorkflowRun",
539 | "WorkflowRunFile"
540 | ],
541 | "OauthApplicationAuditEntryData": [
542 | "OauthApplicationCreateAuditEntry",
543 | "OrgOauthAppAccessApprovedAuditEntry",
544 | "OrgOauthAppAccessBlockedAuditEntry",
545 | "OrgOauthAppAccessDeniedAuditEntry",
546 | "OrgOauthAppAccessRequestedAuditEntry",
547 | "OrgOauthAppAccessUnblockedAuditEntry"
548 | ],
549 | "OrgRestoreMemberAuditEntryMembership": [
550 | "OrgRestoreMemberMembershipOrganizationAuditEntryData",
551 | "OrgRestoreMemberMembershipRepositoryAuditEntryData",
552 | "OrgRestoreMemberMembershipTeamAuditEntryData"
553 | ],
554 | "OrganizationAuditEntry": [
555 | "MembersCanDeleteReposClearAuditEntry",
556 | "MembersCanDeleteReposDisableAuditEntry",
557 | "MembersCanDeleteReposEnableAuditEntry",
558 | "OauthApplicationCreateAuditEntry",
559 | "OrgAddBillingManagerAuditEntry",
560 | "OrgAddMemberAuditEntry",
561 | "OrgBlockUserAuditEntry",
562 | "OrgConfigDisableCollaboratorsOnlyAuditEntry",
563 | "OrgConfigEnableCollaboratorsOnlyAuditEntry",
564 | "OrgCreateAuditEntry",
565 | "OrgDisableOauthAppRestrictionsAuditEntry",
566 | "OrgDisableSamlAuditEntry",
567 | "OrgDisableTwoFactorRequirementAuditEntry",
568 | "OrgEnableOauthAppRestrictionsAuditEntry",
569 | "OrgEnableSamlAuditEntry",
570 | "OrgEnableTwoFactorRequirementAuditEntry",
571 | "OrgInviteMemberAuditEntry",
572 | "OrgInviteToBusinessAuditEntry",
573 | "OrgOauthAppAccessApprovedAuditEntry",
574 | "OrgOauthAppAccessBlockedAuditEntry",
575 | "OrgOauthAppAccessDeniedAuditEntry",
576 | "OrgOauthAppAccessRequestedAuditEntry",
577 | "OrgOauthAppAccessUnblockedAuditEntry",
578 | "OrgRemoveBillingManagerAuditEntry",
579 | "OrgRemoveMemberAuditEntry",
580 | "OrgRemoveOutsideCollaboratorAuditEntry",
581 | "OrgRestoreMemberAuditEntry",
582 | "OrgUnblockUserAuditEntry",
583 | "OrgUpdateDefaultRepositoryPermissionAuditEntry",
584 | "OrgUpdateMemberAuditEntry",
585 | "OrgUpdateMemberRepositoryCreationPermissionAuditEntry",
586 | "OrgUpdateMemberRepositoryInvitationPermissionAuditEntry",
587 | "PrivateRepositoryForkingDisableAuditEntry",
588 | "PrivateRepositoryForkingEnableAuditEntry",
589 | "RepoAccessAuditEntry",
590 | "RepoAddMemberAuditEntry",
591 | "RepoAddTopicAuditEntry",
592 | "RepoArchivedAuditEntry",
593 | "RepoChangeMergeSettingAuditEntry",
594 | "RepoConfigDisableAnonymousGitAccessAuditEntry",
595 | "RepoConfigDisableCollaboratorsOnlyAuditEntry",
596 | "RepoConfigDisableContributorsOnlyAuditEntry",
597 | "RepoConfigDisableSockpuppetDisallowedAuditEntry",
598 | "RepoConfigEnableAnonymousGitAccessAuditEntry",
599 | "RepoConfigEnableCollaboratorsOnlyAuditEntry",
600 | "RepoConfigEnableContributorsOnlyAuditEntry",
601 | "RepoConfigEnableSockpuppetDisallowedAuditEntry",
602 | "RepoConfigLockAnonymousGitAccessAuditEntry",
603 | "RepoConfigUnlockAnonymousGitAccessAuditEntry",
604 | "RepoCreateAuditEntry",
605 | "RepoDestroyAuditEntry",
606 | "RepoRemoveMemberAuditEntry",
607 | "RepoRemoveTopicAuditEntry",
608 | "RepositoryVisibilityChangeDisableAuditEntry",
609 | "RepositoryVisibilityChangeEnableAuditEntry",
610 | "TeamAddMemberAuditEntry",
611 | "TeamAddRepositoryAuditEntry",
612 | "TeamChangeParentTeamAuditEntry",
613 | "TeamRemoveMemberAuditEntry",
614 | "TeamRemoveRepositoryAuditEntry"
615 | ],
616 | "OrganizationAuditEntryData": [
617 | "MembersCanDeleteReposClearAuditEntry",
618 | "MembersCanDeleteReposDisableAuditEntry",
619 | "MembersCanDeleteReposEnableAuditEntry",
620 | "OauthApplicationCreateAuditEntry",
621 | "OrgAddBillingManagerAuditEntry",
622 | "OrgAddMemberAuditEntry",
623 | "OrgBlockUserAuditEntry",
624 | "OrgConfigDisableCollaboratorsOnlyAuditEntry",
625 | "OrgConfigEnableCollaboratorsOnlyAuditEntry",
626 | "OrgCreateAuditEntry",
627 | "OrgDisableOauthAppRestrictionsAuditEntry",
628 | "OrgDisableSamlAuditEntry",
629 | "OrgDisableTwoFactorRequirementAuditEntry",
630 | "OrgEnableOauthAppRestrictionsAuditEntry",
631 | "OrgEnableSamlAuditEntry",
632 | "OrgEnableTwoFactorRequirementAuditEntry",
633 | "OrgInviteMemberAuditEntry",
634 | "OrgInviteToBusinessAuditEntry",
635 | "OrgOauthAppAccessApprovedAuditEntry",
636 | "OrgOauthAppAccessBlockedAuditEntry",
637 | "OrgOauthAppAccessDeniedAuditEntry",
638 | "OrgOauthAppAccessRequestedAuditEntry",
639 | "OrgOauthAppAccessUnblockedAuditEntry",
640 | "OrgRemoveBillingManagerAuditEntry",
641 | "OrgRemoveMemberAuditEntry",
642 | "OrgRemoveOutsideCollaboratorAuditEntry",
643 | "OrgRestoreMemberAuditEntry",
644 | "OrgRestoreMemberMembershipOrganizationAuditEntryData",
645 | "OrgUnblockUserAuditEntry",
646 | "OrgUpdateDefaultRepositoryPermissionAuditEntry",
647 | "OrgUpdateMemberAuditEntry",
648 | "OrgUpdateMemberRepositoryCreationPermissionAuditEntry",
649 | "OrgUpdateMemberRepositoryInvitationPermissionAuditEntry",
650 | "PrivateRepositoryForkingDisableAuditEntry",
651 | "PrivateRepositoryForkingEnableAuditEntry",
652 | "RepoAccessAuditEntry",
653 | "RepoAddMemberAuditEntry",
654 | "RepoAddTopicAuditEntry",
655 | "RepoArchivedAuditEntry",
656 | "RepoChangeMergeSettingAuditEntry",
657 | "RepoConfigDisableAnonymousGitAccessAuditEntry",
658 | "RepoConfigDisableCollaboratorsOnlyAuditEntry",
659 | "RepoConfigDisableContributorsOnlyAuditEntry",
660 | "RepoConfigDisableSockpuppetDisallowedAuditEntry",
661 | "RepoConfigEnableAnonymousGitAccessAuditEntry",
662 | "RepoConfigEnableCollaboratorsOnlyAuditEntry",
663 | "RepoConfigEnableContributorsOnlyAuditEntry",
664 | "RepoConfigEnableSockpuppetDisallowedAuditEntry",
665 | "RepoConfigLockAnonymousGitAccessAuditEntry",
666 | "RepoConfigUnlockAnonymousGitAccessAuditEntry",
667 | "RepoCreateAuditEntry",
668 | "RepoDestroyAuditEntry",
669 | "RepoRemoveMemberAuditEntry",
670 | "RepoRemoveTopicAuditEntry",
671 | "RepositoryVisibilityChangeDisableAuditEntry",
672 | "RepositoryVisibilityChangeEnableAuditEntry",
673 | "TeamAddMemberAuditEntry",
674 | "TeamAddRepositoryAuditEntry",
675 | "TeamChangeParentTeamAuditEntry",
676 | "TeamRemoveMemberAuditEntry",
677 | "TeamRemoveRepositoryAuditEntry"
678 | ],
679 | "OrganizationOrUser": [
680 | "Organization",
681 | "User"
682 | ],
683 | "PackageOwner": [
684 | "Organization",
685 | "Repository",
686 | "User"
687 | ],
688 | "PermissionGranter": [
689 | "Organization",
690 | "Repository",
691 | "Team"
692 | ],
693 | "PinnableItem": [
694 | "Gist",
695 | "Repository"
696 | ],
697 | "ProfileOwner": [
698 | "Organization",
699 | "User"
700 | ],
701 | "ProjectCardItem": [
702 | "Issue",
703 | "PullRequest"
704 | ],
705 | "ProjectOwner": [
706 | "Organization",
707 | "Repository",
708 | "User"
709 | ],
710 | "ProjectV2Actor": [
711 | "Team",
712 | "User"
713 | ],
714 | "ProjectV2FieldCommon": [
715 | "ProjectV2Field",
716 | "ProjectV2IterationField",
717 | "ProjectV2SingleSelectField"
718 | ],
719 | "ProjectV2FieldConfiguration": [
720 | "ProjectV2Field",
721 | "ProjectV2IterationField",
722 | "ProjectV2SingleSelectField"
723 | ],
724 | "ProjectV2ItemContent": [
725 | "DraftIssue",
726 | "Issue",
727 | "PullRequest"
728 | ],
729 | "ProjectV2ItemFieldValue": [
730 | "ProjectV2ItemFieldDateValue",
731 | "ProjectV2ItemFieldIterationValue",
732 | "ProjectV2ItemFieldLabelValue",
733 | "ProjectV2ItemFieldMilestoneValue",
734 | "ProjectV2ItemFieldNumberValue",
735 | "ProjectV2ItemFieldPullRequestValue",
736 | "ProjectV2ItemFieldRepositoryValue",
737 | "ProjectV2ItemFieldReviewerValue",
738 | "ProjectV2ItemFieldSingleSelectValue",
739 | "ProjectV2ItemFieldTextValue",
740 | "ProjectV2ItemFieldUserValue"
741 | ],
742 | "ProjectV2ItemFieldValueCommon": [
743 | "ProjectV2ItemFieldDateValue",
744 | "ProjectV2ItemFieldIterationValue",
745 | "ProjectV2ItemFieldNumberValue",
746 | "ProjectV2ItemFieldSingleSelectValue",
747 | "ProjectV2ItemFieldTextValue"
748 | ],
749 | "ProjectV2Owner": [
750 | "Issue",
751 | "Organization",
752 | "PullRequest",
753 | "User"
754 | ],
755 | "ProjectV2Recent": [
756 | "Organization",
757 | "Repository",
758 | "User"
759 | ],
760 | "PullRequestTimelineItem": [
761 | "AssignedEvent",
762 | "BaseRefDeletedEvent",
763 | "BaseRefForcePushedEvent",
764 | "ClosedEvent",
765 | "Commit",
766 | "CommitCommentThread",
767 | "CrossReferencedEvent",
768 | "DemilestonedEvent",
769 | "DeployedEvent",
770 | "DeploymentEnvironmentChangedEvent",
771 | "HeadRefDeletedEvent",
772 | "HeadRefForcePushedEvent",
773 | "HeadRefRestoredEvent",
774 | "IssueComment",
775 | "LabeledEvent",
776 | "LockedEvent",
777 | "MergedEvent",
778 | "MilestonedEvent",
779 | "PullRequestReview",
780 | "PullRequestReviewComment",
781 | "PullRequestReviewThread",
782 | "ReferencedEvent",
783 | "RenamedTitleEvent",
784 | "ReopenedEvent",
785 | "ReviewDismissedEvent",
786 | "ReviewRequestRemovedEvent",
787 | "ReviewRequestedEvent",
788 | "SubscribedEvent",
789 | "UnassignedEvent",
790 | "UnlabeledEvent",
791 | "UnlockedEvent",
792 | "UnsubscribedEvent",
793 | "UserBlockedEvent"
794 | ],
795 | "PullRequestTimelineItems": [
796 | "AddedToMergeQueueEvent",
797 | "AddedToProjectEvent",
798 | "AssignedEvent",
799 | "AutoMergeDisabledEvent",
800 | "AutoMergeEnabledEvent",
801 | "AutoRebaseEnabledEvent",
802 | "AutoSquashEnabledEvent",
803 | "AutomaticBaseChangeFailedEvent",
804 | "AutomaticBaseChangeSucceededEvent",
805 | "BaseRefChangedEvent",
806 | "BaseRefDeletedEvent",
807 | "BaseRefForcePushedEvent",
808 | "ClosedEvent",
809 | "CommentDeletedEvent",
810 | "ConnectedEvent",
811 | "ConvertToDraftEvent",
812 | "ConvertedNoteToIssueEvent",
813 | "ConvertedToDiscussionEvent",
814 | "CrossReferencedEvent",
815 | "DemilestonedEvent",
816 | "DeployedEvent",
817 | "DeploymentEnvironmentChangedEvent",
818 | "DisconnectedEvent",
819 | "HeadRefDeletedEvent",
820 | "HeadRefForcePushedEvent",
821 | "HeadRefRestoredEvent",
822 | "IssueComment",
823 | "LabeledEvent",
824 | "LockedEvent",
825 | "MarkedAsDuplicateEvent",
826 | "MentionedEvent",
827 | "MergedEvent",
828 | "MilestonedEvent",
829 | "MovedColumnsInProjectEvent",
830 | "PinnedEvent",
831 | "PullRequestCommit",
832 | "PullRequestCommitCommentThread",
833 | "PullRequestReview",
834 | "PullRequestReviewThread",
835 | "PullRequestRevisionMarker",
836 | "ReadyForReviewEvent",
837 | "ReferencedEvent",
838 | "RemovedFromMergeQueueEvent",
839 | "RemovedFromProjectEvent",
840 | "RenamedTitleEvent",
841 | "ReopenedEvent",
842 | "ReviewDismissedEvent",
843 | "ReviewRequestRemovedEvent",
844 | "ReviewRequestedEvent",
845 | "SubscribedEvent",
846 | "TransferredEvent",
847 | "UnassignedEvent",
848 | "UnlabeledEvent",
849 | "UnlockedEvent",
850 | "UnmarkedAsDuplicateEvent",
851 | "UnpinnedEvent",
852 | "UnsubscribedEvent",
853 | "UserBlockedEvent"
854 | ],
855 | "PushAllowanceActor": [
856 | "App",
857 | "Team",
858 | "User"
859 | ],
860 | "Reactable": [
861 | "CommitComment",
862 | "Discussion",
863 | "DiscussionComment",
864 | "Issue",
865 | "IssueComment",
866 | "PullRequest",
867 | "PullRequestReview",
868 | "PullRequestReviewComment",
869 | "Release",
870 | "TeamDiscussion",
871 | "TeamDiscussionComment"
872 | ],
873 | "Reactor": [
874 | "Bot",
875 | "Mannequin",
876 | "Organization",
877 | "User"
878 | ],
879 | "ReferencedSubject": [
880 | "Issue",
881 | "PullRequest"
882 | ],
883 | "RenamedTitleSubject": [
884 | "Issue",
885 | "PullRequest"
886 | ],
887 | "RepositoryAuditEntryData": [
888 | "OrgRestoreMemberMembershipRepositoryAuditEntryData",
889 | "PrivateRepositoryForkingDisableAuditEntry",
890 | "PrivateRepositoryForkingEnableAuditEntry",
891 | "RepoAccessAuditEntry",
892 | "RepoAddMemberAuditEntry",
893 | "RepoAddTopicAuditEntry",
894 | "RepoArchivedAuditEntry",
895 | "RepoChangeMergeSettingAuditEntry",
896 | "RepoConfigDisableAnonymousGitAccessAuditEntry",
897 | "RepoConfigDisableCollaboratorsOnlyAuditEntry",
898 | "RepoConfigDisableContributorsOnlyAuditEntry",
899 | "RepoConfigDisableSockpuppetDisallowedAuditEntry",
900 | "RepoConfigEnableAnonymousGitAccessAuditEntry",
901 | "RepoConfigEnableCollaboratorsOnlyAuditEntry",
902 | "RepoConfigEnableContributorsOnlyAuditEntry",
903 | "RepoConfigEnableSockpuppetDisallowedAuditEntry",
904 | "RepoConfigLockAnonymousGitAccessAuditEntry",
905 | "RepoConfigUnlockAnonymousGitAccessAuditEntry",
906 | "RepoCreateAuditEntry",
907 | "RepoDestroyAuditEntry",
908 | "RepoRemoveMemberAuditEntry",
909 | "RepoRemoveTopicAuditEntry",
910 | "TeamAddRepositoryAuditEntry",
911 | "TeamRemoveRepositoryAuditEntry"
912 | ],
913 | "RepositoryDiscussionAuthor": [
914 | "Organization",
915 | "User"
916 | ],
917 | "RepositoryDiscussionCommentAuthor": [
918 | "Organization",
919 | "User"
920 | ],
921 | "RepositoryInfo": [
922 | "Repository"
923 | ],
924 | "RepositoryNode": [
925 | "CommitComment",
926 | "CommitCommentThread",
927 | "DependabotUpdate",
928 | "Discussion",
929 | "DiscussionCategory",
930 | "Issue",
931 | "IssueComment",
932 | "PinnedDiscussion",
933 | "PullRequest",
934 | "PullRequestCommitCommentThread",
935 | "PullRequestReview",
936 | "PullRequestReviewComment",
937 | "RepositoryVulnerabilityAlert"
938 | ],
939 | "RepositoryOwner": [
940 | "Organization",
941 | "User"
942 | ],
943 | "RequestedReviewer": [
944 | "Bot",
945 | "Mannequin",
946 | "Team",
947 | "User"
948 | ],
949 | "RequirableByPullRequest": [
950 | "CheckRun",
951 | "StatusContext"
952 | ],
953 | "ReviewDismissalAllowanceActor": [
954 | "App",
955 | "Team",
956 | "User"
957 | ],
958 | "RuleParameters": [
959 | "BranchNamePatternParameters",
960 | "CodeScanningParameters",
961 | "CommitAuthorEmailPatternParameters",
962 | "CommitMessagePatternParameters",
963 | "CommitterEmailPatternParameters",
964 | "FileExtensionRestrictionParameters",
965 | "FilePathRestrictionParameters",
966 | "MaxFilePathLengthParameters",
967 | "MaxFileSizeParameters",
968 | "PullRequestParameters",
969 | "RequiredDeploymentsParameters",
970 | "RequiredStatusChecksParameters",
971 | "TagNamePatternParameters",
972 | "UpdateParameters",
973 | "WorkflowsParameters"
974 | ],
975 | "RuleSource": [
976 | "Organization",
977 | "Repository"
978 | ],
979 | "SearchResultItem": [
980 | "App",
981 | "Discussion",
982 | "Issue",
983 | "MarketplaceListing",
984 | "Organization",
985 | "PullRequest",
986 | "Repository",
987 | "User"
988 | ],
989 | "Sponsor": [
990 | "Organization",
991 | "User"
992 | ],
993 | "Sponsorable": [
994 | "Organization",
995 | "User"
996 | ],
997 | "SponsorableItem": [
998 | "Organization",
999 | "User"
1000 | ],
1001 | "SponsorsListingFeatureableItem": [
1002 | "Repository",
1003 | "User"
1004 | ],
1005 | "Starrable": [
1006 | "Gist",
1007 | "Repository",
1008 | "Topic"
1009 | ],
1010 | "StatusCheckRollupContext": [
1011 | "CheckRun",
1012 | "StatusContext"
1013 | ],
1014 | "Subscribable": [
1015 | "Commit",
1016 | "Discussion",
1017 | "Issue",
1018 | "PullRequest",
1019 | "Repository",
1020 | "Team",
1021 | "TeamDiscussion"
1022 | ],
1023 | "SubscribableThread": [
1024 | "Issue"
1025 | ],
1026 | "TeamAuditEntryData": [
1027 | "OrgRestoreMemberMembershipTeamAuditEntryData",
1028 | "TeamAddMemberAuditEntry",
1029 | "TeamAddRepositoryAuditEntry",
1030 | "TeamChangeParentTeamAuditEntry",
1031 | "TeamRemoveMemberAuditEntry",
1032 | "TeamRemoveRepositoryAuditEntry"
1033 | ],
1034 | "TopicAuditEntryData": [
1035 | "RepoAddTopicAuditEntry",
1036 | "RepoRemoveTopicAuditEntry"
1037 | ],
1038 | "UniformResourceLocatable": [
1039 | "Bot",
1040 | "CheckRun",
1041 | "ClosedEvent",
1042 | "Commit",
1043 | "ConvertToDraftEvent",
1044 | "CrossReferencedEvent",
1045 | "Gist",
1046 | "Issue",
1047 | "Mannequin",
1048 | "MergedEvent",
1049 | "Milestone",
1050 | "Organization",
1051 | "PullRequest",
1052 | "PullRequestCommit",
1053 | "ReadyForReviewEvent",
1054 | "Release",
1055 | "Repository",
1056 | "RepositoryTopic",
1057 | "ReviewDismissedEvent",
1058 | "TeamDiscussion",
1059 | "TeamDiscussionComment",
1060 | "User",
1061 | "Workflow",
1062 | "WorkflowRun",
1063 | "WorkflowRunFile"
1064 | ],
1065 | "Updatable": [
1066 | "CommitComment",
1067 | "Discussion",
1068 | "DiscussionComment",
1069 | "GistComment",
1070 | "Issue",
1071 | "IssueComment",
1072 | "Project",
1073 | "ProjectV2",
1074 | "PullRequest",
1075 | "PullRequestReview",
1076 | "PullRequestReviewComment",
1077 | "TeamDiscussion",
1078 | "TeamDiscussionComment"
1079 | ],
1080 | "UpdatableComment": [
1081 | "CommitComment",
1082 | "DiscussionComment",
1083 | "GistComment",
1084 | "Issue",
1085 | "IssueComment",
1086 | "PullRequest",
1087 | "PullRequestReview",
1088 | "PullRequestReviewComment",
1089 | "TeamDiscussion",
1090 | "TeamDiscussionComment"
1091 | ],
1092 | "UserListItems": [
1093 | "Repository"
1094 | ],
1095 | "VerifiableDomainOwner": [
1096 | "Enterprise",
1097 | "Organization"
1098 | ],
1099 | "Votable": [
1100 | "Discussion",
1101 | "DiscussionComment"
1102 | ]
1103 | }
1104 | };
1105 | export default result;
1106 |
--------------------------------------------------------------------------------
/packages/graphql/src/lib/graphql/ListLicenses.graphql:
--------------------------------------------------------------------------------
1 | query ListLicenses {
2 | licenses {
3 | id
4 | key
5 | name
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/graphql/src/lib/graphql/ListRepositories.graphql:
--------------------------------------------------------------------------------
1 | query ListRepositories($cursorAfter: String, $cursorBefore: String, $first: Int, $last: Int, $queryString: String!) {
2 | search(after: $cursorAfter, before: $cursorBefore, first: $first, last: $last, query: $queryString, type: REPOSITORY) {
3 | edges {
4 | cursor
5 | node {
6 | ... on Repository {
7 | createdAt
8 | id
9 | licenseInfo {
10 | id
11 | name
12 | }
13 | name
14 | stargazers {
15 | totalCount
16 | }
17 | updatedAt
18 | }
19 | }
20 | }
21 | pageInfo {
22 | endCursor
23 | hasNextPage
24 | hasPreviousPage
25 | startCursor
26 | }
27 | repositoryCount
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/graphql/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "react-jsx",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "strict": true,
10 | "noImplicitOverride": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true
13 | },
14 | "files": [],
15 | "include": [],
16 | "exclude": ["node_modules"],
17 | "references": [
18 | {
19 | "path": "./tsconfig.lib.json"
20 | },
21 | {
22 | "path": "./tsconfig.spec.json"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/packages/graphql/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["node"]
6 | },
7 | "files": ["../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/image.d.ts"],
8 | "exclude": ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.tsx", "**/*.test.tsx", "**/*.spec.js", "**/*.test.js", "**/*.spec.jsx", "**/*.test.jsx"],
9 | "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/graphql/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.test.ts",
10 | "**/*.spec.ts",
11 | "**/*.test.tsx",
12 | "**/*.spec.tsx",
13 | "**/*.test.js",
14 | "**/*.spec.js",
15 | "**/*.test.jsx",
16 | "**/*.spec.jsx",
17 | "**/*.d.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/icons/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*", "node_modules/**"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/icons/.svgrrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": ["@svgr/plugin-svgo"]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/icons/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nx-vite-react-ts-mantine-boilerplate/icons"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/icons/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "icons",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "packages/icons/src",
5 | "projectType": "library",
6 | "tags": [],
7 | "targets": {
8 | "svgr": {
9 | "executor": "nx:run-commands",
10 | "options": {
11 | "cwd": "./packages/icons",
12 | "command": "npx @svgr/cli --typescript -d ./src/components -- ./src/icons"
13 | }
14 | },
15 | "tsc": {
16 | "executor": "nx:run-commands",
17 | "options": {
18 | "cwd": "./packages/icons",
19 | "command": "tsc -p tsconfig.lib.json"
20 | }
21 | },
22 | "build": {
23 | "executor": "nx:run-commands",
24 | "options": {
25 | "cwd": "./packages/icons",
26 | "command": "rm -rf ./src/components && nx run icons:svgr"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/icons/src/components/Favicon.tsx:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/icons/src/components/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Favicon } from './Favicon'
2 |
--------------------------------------------------------------------------------
/packages/icons/src/icons/favicon.svg:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/packages/icons/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './components'
2 |
--------------------------------------------------------------------------------
/packages/icons/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "react-jsx",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "strict": true,
10 | "noImplicitOverride": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true
13 | },
14 | "files": [],
15 | "include": [],
16 | "references": [
17 | {
18 | "path": "./tsconfig.lib.json"
19 | },
20 | {
21 | "path": "./tsconfig.spec.json"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/packages/icons/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "build",
5 | "module": "esnext",
6 | "target": "es5",
7 | "skipLibCheck": true,
8 | "rootDir": "./src",
9 | "baseUrl": "./src"
10 | },
11 | "include": ["src"]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/icons/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "**/*.test.ts",
10 | "**/*.spec.ts",
11 | "**/*.test.tsx",
12 | "**/*.spec.tsx",
13 | "**/*.test.js",
14 | "**/*.spec.js",
15 | "**/*.test.jsx",
16 | "**/*.spec.jsx",
17 | "**/*.d.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/packages/ui-kit/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json", "plugin:storybook/recommended"],
3 | "ignorePatterns": ["!**/*", "node_modules/**"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx"],
7 | "rules": {},
8 | "parserOptions": {
9 | "project": ["packages/ui-kit/tsconfig.*?.json", "packages/ui-kit/cypress/tsconfig.json"]
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/ui-kit/.storybook/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../.eslintrc.json", "plugin:storybook/recommended"],
3 | "ignorePatterns": ["!**/*", "node_modules/**"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx"],
7 | "rules": {},
8 | "parserOptions": {
9 | "project": ["../tsconfig.*.json"]
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/ui-kit/.storybook/main.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | addons: ['@chromatic-com/storybook', '@storybook/addon-essentials'],
3 | core: {
4 | disableTelemetry: true,
5 | },
6 | framework: {
7 | name: '@storybook/react-vite',
8 | options: {},
9 | },
10 | stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx)'],
11 | typescript: {
12 | reactDocgen: 'react-docgen-typescript',
13 | },
14 | }
15 |
--------------------------------------------------------------------------------
/packages/ui-kit/.storybook/preview.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { Preview } from '@storybook/react'
4 |
5 | import { ThemeProvider } from '../src/providers'
6 |
7 | import '@mantine/core/styles.css'
8 |
9 | const preview: Preview = {
10 | decorators: [(renderStory) => {renderStory()}],
11 |
12 | parameters: {
13 | controls: {
14 | matchers: {
15 | color: /(background|color)$/i,
16 | date: /Date$/,
17 | },
18 | },
19 | },
20 | tags: ['autodocs'],
21 | }
22 |
23 | export default preview
24 |
--------------------------------------------------------------------------------
/packages/ui-kit/.stylelintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.stylelintrc.json"]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/ui-kit/README.md:
--------------------------------------------------------------------------------
1 | # ui-kit
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Running unit tests
6 |
7 | Run `nx test ui-kit` to execute the unit tests via [Jest](https://jestjs.io).
8 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'cypress'
2 |
3 | import viteConfig from './vite.config'
4 |
5 | export default defineConfig({
6 | component: {
7 | devServer: {
8 | bundler: 'vite',
9 | framework: 'react',
10 | viteConfig,
11 | },
12 | specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}',
13 | },
14 | })
15 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { mount } from 'cypress/react'
3 |
4 | // Augment the Cypress namespace to include type definitions for
5 | // your custom command.
6 | // Alternatively, can be defined in cypress/support/component.d.ts
7 | // with a at the top of your spec.
8 | declare global {
9 | namespace Cypress {
10 | // eslint-disable-next-line @typescript-eslint/naming-convention
11 | interface Chainable {
12 | mount: typeof mount
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../../.eslintrc.json", "plugin:storybook/recommended"],
3 | "ignorePatterns": ["!**/*", "node_modules/**"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx"],
7 | "rules": {}
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io",
4 | "body": "Fixtures are a great way to mock data for responses to routes"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/support/commands.ts:
--------------------------------------------------------------------------------
1 | ///
2 | // ***********************************************
3 | // This example commands.ts shows you how to
4 | // create various custom commands and overwrite
5 | // existing commands.
6 | //
7 | // For more comprehensive examples of custom
8 | // commands please read more here:
9 | // https://on.cypress.io/custom-commands
10 | // ***********************************************
11 | //
12 | //
13 | // -- This is a parent command --
14 | // Cypress.Commands.add('login', (email, password) => { ... })
15 | //
16 | //
17 | // -- This is a child command --
18 | // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19 | //
20 | //
21 | // -- This is a dual command --
22 | // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23 | //
24 | //
25 | // -- This will overwrite an existing command --
26 | // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27 | //
28 | // declare global {
29 | // namespace Cypress {
30 | // interface Chainable {
31 | // login(email: string, password: string): Chainable
32 | // drag(subject: string, options?: Partial): Chainable
33 | // dismiss(subject: string, options?: Partial): Chainable
34 | // visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable
35 | // }
36 | // }
37 | // }
38 |
39 | // Prevent TypeScript from reading file as legacy script
40 | export {}
41 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/support/component-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Components App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/support/component.tsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-namespace */
2 | // ***********************************************************
3 | // This example support/component.ts is processed and
4 | // loaded automatically before your test files.
5 | //
6 | // This is a great place to put global configuration and
7 | // behavior that modifies Cypress.
8 | //
9 | // You can change the location of this file or turn off
10 | // automatically serving support files with the
11 | // 'supportFile' configuration option.
12 | //
13 | // You can read more here:
14 | // https://on.cypress.io/configuration
15 | // ***********************************************************
16 | import React, { ReactNode } from 'react'
17 |
18 | // Import commands.js using ES2015 syntax:
19 | import './commands'
20 |
21 | // Alternatively you can use CommonJS syntax:
22 | // require('./commands')
23 |
24 | import { mount } from 'cypress/react18'
25 |
26 | import { ThemeProvider } from '../../src/providers'
27 |
28 | // Augment the Cypress namespace to include type definitions for
29 | // your custom command.
30 | // Alternatively, can be defined in cypress/support/component.d.ts
31 | // with a at the top of your spec.
32 | declare global {
33 | namespace Cypress {
34 | interface Chainable {
35 | mount: typeof mount
36 | }
37 | }
38 | }
39 |
40 | Cypress.Commands.add('mount', (component: ReactNode, options = {}) => {
41 | const wrapped = {component}
42 |
43 | return mount(wrapped, options)
44 | })
45 |
46 | // Example use:
47 | // cy.mount()
48 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/support/e2e.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/e2e.ts is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
21 |
--------------------------------------------------------------------------------
/packages/ui-kit/cypress/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["es5", "dom"],
5 | "types": ["cypress", "node"],
6 | "esModuleInterop": true,
7 | "strictNullChecks": true,
8 | "jsx": "react-jsx"
9 | },
10 | "include": ["**/*.ts", "**/*.tsx", "support/component.tsx", "../src/**/*.cy.ts", "../src/**/*.cy.tsx"]
11 | }
12 |
--------------------------------------------------------------------------------
/packages/ui-kit/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ui-kit",
3 | "lockfileVersion": 2,
4 | "requires": true,
5 | "packages": {
6 | "": {
7 | "name": "ui-kit"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui-kit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@nx-vite-react-ts-mantine-boilerplate/ui-kit"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/ui-kit/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ui-kit",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "packages/ui-kit/src",
5 | "projectType": "library",
6 | "tags": [],
7 | "targets": {
8 | "type-check": {
9 | "executor": "nx:run-commands",
10 | "options": {
11 | "cwd": "./packages/ui-kit",
12 | "commands": [
13 | {
14 | "command": "tsc --project tsconfig.lib.json --noEmit && tsc --project tsconfig.spec.json --noEmit"
15 | }
16 | ]
17 | }
18 | },
19 | "e2e": {
20 | "executor": "nx:run-commands",
21 | "options": {
22 | "cwd": "./packages/ui-kit",
23 | "commands": [
24 | {
25 | "command": "cypress run --component --config-file=cypress.config.ts"
26 | }
27 | ]
28 | }
29 | },
30 | "build": {
31 | "executor": "nx:run-commands",
32 | "options": {
33 | "cwd": "./packages/ui-kit",
34 | "commands": [
35 | {
36 | "command": "vite build --emptyOutDir"
37 | }
38 | ]
39 | }
40 | },
41 | "lint": {
42 | "executor": "@nx/eslint:lint",
43 | "outputs": ["{options.outputFile}"]
44 | },
45 | "stylelint": {
46 | "executor": "nx-stylelint:lint",
47 | "outputs": ["{options.outputFile}"],
48 | "options": {
49 | "lintFilePatterns": ["packages/ui-kit/**/*.{css}"]
50 | }
51 | },
52 | "test": {
53 | "executor": "nx:run-commands",
54 | "options": {
55 | "cwd": "./packages/ui-kit",
56 | "commands": [
57 | {
58 | "command": "vitest run --config ./vitest.config.ts --coverage --passWithNoTests"
59 | }
60 | ]
61 | }
62 | },
63 | "storybook": {
64 | "executor": "@nx/storybook:storybook",
65 | "options": {
66 | "port": 4400,
67 | "configDir": "packages/ui-kit/.storybook"
68 | },
69 | "configurations": {
70 | "ci": {
71 | "quiet": true
72 | }
73 | }
74 | },
75 | "storybook:build": {
76 | "executor": "@nx/storybook:build",
77 | "outputs": ["{options.outputDir}"],
78 | "options": {
79 | "configDir": "packages/ui-kit/.storybook",
80 | "outputDir": "packages/ui-kit/dist/storybook"
81 | },
82 | "configurations": {
83 | "ci": {
84 | "quiet": true
85 | }
86 | }
87 | },
88 | "storybook:serve": {
89 | "executor": "nx:run-commands",
90 | "options": {
91 | "cwd": "./packages/ui-kit",
92 | "commands": [
93 | {
94 | "command": "npx http-server dist -o /storybook"
95 | }
96 | ]
97 | }
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/declarations.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.module.css' {
2 | const content: Record
3 | export default content
4 | }
5 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/index.ts:
--------------------------------------------------------------------------------
1 | export { Button } from './lib/Button'
2 | export { ErrorBlock } from './lib/ErrorBlock'
3 | export { Input } from './lib/Input'
4 | export { Loader } from './lib/Loader'
5 | export { Pagination } from './lib/Pagination'
6 | export { Select } from './lib/Select'
7 | export { Space } from './lib/Space'
8 | export { Table } from './lib/Table'
9 | export { ThemeProvider } from './providers'
10 | export type { ComboboxItem } from '@mantine/core'
11 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Button/Button.stories.tsx:
--------------------------------------------------------------------------------
1 | import { Meta, StoryObj } from '@storybook/react'
2 |
3 | import { Button as ButtonC } from './Button'
4 |
5 | export default {
6 | title: 'Button/ButtonDefault',
7 | component: ButtonC,
8 | } as Meta
9 |
10 | export const Button: StoryObj = {
11 | args: {
12 | children: 'Button',
13 | },
14 | }
15 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Button/Button.tsx:
--------------------------------------------------------------------------------
1 | export { Button } from '@mantine/core'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Button/index.ts:
--------------------------------------------------------------------------------
1 | export { Button } from './Button'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/ErrorBlock/ErrorBlock.cy.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { ErrorBlock } from './ErrorBlock'
4 |
5 | describe('', () => {
6 | it('renders', () => {
7 | cy.mount()
8 | })
9 | })
10 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/ErrorBlock/ErrorBlock.tsx:
--------------------------------------------------------------------------------
1 | import { Alert } from '@mantine/core'
2 | import { IconAlertCircle } from '@tabler/icons-react'
3 | import React, { FC, memo } from 'react'
4 |
5 | import { ErrorBlockPropertiesInterface } from './ErrorBlock.types'
6 |
7 | export const ErrorBlock: FC = memo(({ text = 'Error' }) => (
8 | }>
9 | {text}
10 |
11 | ))
12 |
13 | ErrorBlock.displayName = 'Error'
14 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/ErrorBlock/ErrorBlock.types.ts:
--------------------------------------------------------------------------------
1 | import { ReactNode } from 'react'
2 |
3 | export interface ErrorBlockPropertiesInterface {
4 | text: ReactNode
5 | }
6 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/ErrorBlock/index.ts:
--------------------------------------------------------------------------------
1 | export { ErrorBlock } from './ErrorBlock'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Input/Input.tsx:
--------------------------------------------------------------------------------
1 | export { TextInput as Input } from '@mantine/core'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Input/index.ts:
--------------------------------------------------------------------------------
1 | export { Input } from './Input'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Loader/Loader.module.css:
--------------------------------------------------------------------------------
1 | .root {
2 | position: relative;
3 | }
4 |
5 | .overlay {}
6 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Loader/Loader.tsx:
--------------------------------------------------------------------------------
1 | import { LoadingOverlay, VisuallyHidden } from '@mantine/core'
2 | import React, { FC, PropsWithChildren } from 'react'
3 |
4 | import { LoaderPropertiesInterface } from './Loader.types'
5 |
6 | import classes from './Loader.module.css'
7 |
8 | export const Loader: FC> = ({ children, loading, ...rest }) => (
9 |
10 |
11 | Loading...
12 | {children}
13 |
14 | )
15 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Loader/Loader.types.ts:
--------------------------------------------------------------------------------
1 | export interface LoaderPropertiesInterface {
2 | loading: boolean
3 | }
4 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Loader/index.ts:
--------------------------------------------------------------------------------
1 | export { Loader } from './Loader'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Pagination/Pagination.tsx:
--------------------------------------------------------------------------------
1 | import { Group } from '@mantine/core'
2 | import React, { FC } from 'react'
3 |
4 | import { Button } from '../Button'
5 | import { PaginationPropertiesInterface } from './Pagination.types'
6 |
7 | export const Pagination: FC = ({
8 | isNextDisabled = false,
9 | isPrevDisabled: isPreviousDisabled = true,
10 | onNextClick,
11 | onPrevClick,
12 | }) => (
13 |
14 |
17 |
20 |
21 | )
22 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Pagination/Pagination.types.ts:
--------------------------------------------------------------------------------
1 | export interface PaginationPropertiesInterface {
2 | isNextDisabled: boolean
3 | isPrevDisabled: boolean
4 | onNextClick: () => void
5 | onPrevClick: () => void
6 | }
7 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Pagination/index.ts:
--------------------------------------------------------------------------------
1 | export { Pagination } from './Pagination'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Select/Select.tsx:
--------------------------------------------------------------------------------
1 | export { Select } from '@mantine/core'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Select/index.ts:
--------------------------------------------------------------------------------
1 | export { Select } from './Select'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Space/Space.tsx:
--------------------------------------------------------------------------------
1 | export { Space } from '@mantine/core'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Space/index.ts:
--------------------------------------------------------------------------------
1 | export { Space } from './Space'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Table/Table.module.css:
--------------------------------------------------------------------------------
1 | .root {
2 | width: 100%;
3 | margin: 0;
4 | padding: 0;
5 | border: 1px solid #ccc;
6 | }
7 |
8 | .thead {
9 | display: flex;
10 | width: 100%;
11 | font-weight: bold;
12 | }
13 |
14 | .tr {
15 | display: flex;
16 | flex: 1;
17 | padding: 5px;
18 | border: 1px solid #ddd;
19 | }
20 |
21 | .thead .tr {
22 | background-color: rgba(192 221 220 / 53%) !important;
23 | }
24 |
25 | .tr:nth-of-type(2n + 1) {
26 | background-color: #f8f8f8;
27 | }
28 |
29 | .th,
30 | .td {
31 | flex: 1;
32 | padding: 5px;
33 | text-align: center;
34 | }
35 |
36 | .th {
37 | text-transform: uppercase;
38 | }
39 |
40 | .tbody {
41 | width: 100%;
42 | overflow-y: scroll;
43 | }
44 |
45 | @media screen and (width <= 600px) {
46 | .table {
47 | border: 0;
48 | }
49 |
50 | .thead {
51 | position: absolute;
52 | width: 1px;
53 | height: 1px;
54 | margin: -1px;
55 | padding: 0;
56 | overflow: hidden;
57 | border: none;
58 | clip: rect(0 0 0 0);
59 | }
60 |
61 | .tr {
62 | display: block;
63 | margin-bottom: 5px;
64 | border-bottom: 3px solid #ddd;
65 | }
66 |
67 | .td {
68 | display: block;
69 | text-align: right;
70 | border-bottom: 1px solid #ddd;
71 | }
72 |
73 | .td::before {
74 | float: left;
75 | font-weight: bold;
76 | text-transform: uppercase;
77 | content: attr(data-label);
78 | }
79 |
80 | .td:last-child {
81 | border-bottom: 0;
82 | }
83 | }
84 |
85 | .empty {
86 | display: flex;
87 | align-items: center;
88 | justify-content: center;
89 | width: 100%;
90 | height: 100%;
91 | color: green;
92 | }
93 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Table/Table.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC, useMemo } from 'react'
2 |
3 | import { TablePropertiesInterface } from './Table.types'
4 |
5 | import classes from './Table.module.css'
6 |
7 | export const Table: FC = ({ columns = {}, data = [], error = false }) => {
8 | const columnKeys = useMemo(() => Object.keys(columns), [columns])
9 |
10 | return (
11 |
12 |
13 |
14 | {columnKeys.map((key) => (
15 |
16 | {columns[key]}
17 |
18 | ))}
19 |
20 |
21 |
22 | {error ?? undefined}
23 | {!error && (!data || data.length === 0) &&
No data
}
24 | {data.map((item) => (
25 |
26 | {columnKeys.map((key) => (
27 |
28 | {item[key] || '---'}
29 |
30 | ))}
31 |
32 | ))}
33 |
34 |
35 | )
36 | }
37 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Table/Table.types.ts:
--------------------------------------------------------------------------------
1 | export interface TablePropertiesInterface {
2 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
3 | columns: Record
4 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
5 | data: any[]
6 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
7 | error: any
8 | }
9 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/lib/Table/index.ts:
--------------------------------------------------------------------------------
1 | export { Table } from './Table'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/src/providers/index.tsx:
--------------------------------------------------------------------------------
1 | export { MantineProvider as ThemeProvider } from '@mantine/core'
2 |
--------------------------------------------------------------------------------
/packages/ui-kit/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "jsx": "react",
5 | "allowJs": true,
6 | "esModuleInterop": true,
7 | "allowSyntheticDefaultImports": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "strict": true,
10 | "noImplicitOverride": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true
13 | },
14 | "files": [],
15 | "include": [],
16 | "references": [
17 | {
18 | "path": "./tsconfig.lib.json"
19 | },
20 | {
21 | "path": "./tsconfig.spec.json"
22 | },
23 | {
24 | "path": "./tsconfig.storybook.json"
25 | },
26 | {
27 | "path": "./cypress/tsconfig.json"
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/packages/ui-kit/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "types": ["cypress", "jest", "node"]
6 | },
7 | "files": ["../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/image.d.ts"],
8 | "exclude": [
9 | "**/*.cy.ts",
10 | "**/*.cy.tsx",
11 | "**/*.spec.ts",
12 | "**/*.test.ts",
13 | "**/*.spec.tsx",
14 | "**/*.test.tsx",
15 | "**/*.spec.js",
16 | "**/*.test.js",
17 | "**/*.spec.jsx",
18 | "**/*.test.jsx",
19 | "**/*.stories.ts",
20 | "**/*.stories.js",
21 | "**/*.stories.jsx",
22 | "**/*.stories.tsx",
23 | "cypress/**/*"
24 | ],
25 | "include": ["src/**/*", "**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "../../global.d.ts"]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/ui-kit/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["cypress", "jest", "node" ]
7 | },
8 | "include": [
9 | "src",
10 | "**/*.cy.ts",
11 | "**/*.cy.tsx",
12 | "**/*.test.ts",
13 | "**/*.spec.ts",
14 | "**/*.test.tsx",
15 | "**/*.spec.tsx",
16 | "**/*.test.js",
17 | "**/*.spec.js",
18 | "**/*.test.jsx",
19 | "**/*.spec.jsx",
20 | "**/*.d.ts",
21 | "cypress/**/*.ts",
22 | "cypress.config.ts",
23 | "cypress.d.ts",
24 | "../../global.d.ts"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/ui-kit/tsconfig.storybook.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "emitDecoratorMetadata": true,
5 | "outDir": ""
6 | },
7 | "files": ["../../node_modules/@nx/react/typings/image.d.ts"],
8 | "exclude": ["src/**/*.spec.ts", "src/**/*.spec.js", "src/**/*.spec.tsx", "src/**/*.spec.jsx"],
9 | "include": ["src/**/*", ".storybook/*.js", ".storybook/*.ts", ".storybook/*.jsx", ".storybook/*.tsx"]
10 | }
11 |
--------------------------------------------------------------------------------
/packages/ui-kit/vite.config.ts:
--------------------------------------------------------------------------------
1 | import path from 'node:path'
2 |
3 | import react from '@vitejs/plugin-react-swc'
4 | import { defineConfig } from 'vite'
5 | import dts from 'vite-dts'
6 |
7 | const isExternal = (id: string) => !id.startsWith('.') && !path.isAbsolute(id)
8 |
9 | export default defineConfig({
10 | build: {
11 | lib: {
12 | entry: path.resolve(__dirname, 'src/index.ts'),
13 | formats: ['es'],
14 | },
15 | rollupOptions: {
16 | external: isExternal,
17 | },
18 | },
19 | plugins: [dts(), react()],
20 | })
21 |
--------------------------------------------------------------------------------
/packages/ui-kit/vitest.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { defineConfig, mergeConfig } from 'vite'
3 |
4 | import baseConfig from './vite.config'
5 |
6 | export default mergeConfig(
7 | baseConfig,
8 | defineConfig({
9 | test: {
10 | environment: 'jsdom',
11 | globals: true,
12 | },
13 | }),
14 | )
15 |
--------------------------------------------------------------------------------
/tools/tsconfig.tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc/tools",
5 | "rootDir": ".",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": ["node"],
9 | "importHelpers": false
10 | },
11 | "include": ["**/*.ts"]
12 | }
13 |
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "jsx": "react",
5 | "rootDir": ".",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "moduleResolution": "node",
9 | "emitDecoratorMetadata": true,
10 | "experimentalDecorators": true,
11 | "useDefineForClassFields": true,
12 | "importHelpers": true,
13 | "target": "es2015",
14 | "module": "esnext",
15 | "lib": ["es2017", "dom"],
16 | "skipLibCheck": true,
17 | "skipDefaultLibCheck": true,
18 | "allowSyntheticDefaultImports": true,
19 | "resolveJsonModule": true,
20 | "strictNullChecks": true,
21 | "strict": true,
22 | "baseUrl": "./packages",
23 | "paths": {
24 | "@nx-vite-react-ts-mantine-boilerplate/graphql": ["graphql/src"],
25 | "@nx-vite-react-ts-mantine-boilerplate/icons": ["icons/src"],
26 | "@nx-vite-react-ts-mantine-boilerplate/ui-kit": ["ui-kit/src"]
27 | }
28 | },
29 | "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "global.d.ts"],
30 | "exclude": ["node_modules", "tmp", "dist", "coverage"],
31 | }
32 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.base.json"
3 | }
4 |
--------------------------------------------------------------------------------