-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7e2b02e
Showing
463 changed files
with
70,263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"helpUrl": "https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VITE_BASE_URL= | ||
VITE_PROPEL_AUTH_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
scripts/ | ||
node_modules/ | ||
dist/ | ||
build/ | ||
*.config.js | ||
src/__generated/ | ||
src/gql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true | ||
}, | ||
extends: [ | ||
'plugin:react/recommended', | ||
'airbnb', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier/prettier', | ||
'plugin:prettier/recommended', | ||
'plugin:import/recommended' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true | ||
}, | ||
ecmaVersion: 'latest', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['react', '@typescript-eslint', 'react-hooks', 'testing-library'], | ||
rules: { | ||
semi: [2, 'always'], | ||
'react/destructuring-assignment': 0, | ||
'react/function-component-definition': 0, | ||
'react/react-in-jsx-scope': 0, | ||
'react/jsx-no-useless-fragment': 0, | ||
'react/jsx-props-no-spreading': 0, | ||
'react/no-array-index-key': 0, | ||
'import/no-extraneous-dependencies': 0, | ||
'import/prefer-default-export': 0, | ||
'no-param-reassign': 0, | ||
'jsx-a11y/label-has-associated-control': 0, | ||
'jsx-a11y/click-events-have-key-events': 0, | ||
'jsx-a11y/interactive-supports-focus': 0, | ||
'import/no-cycle': 0, | ||
'no-plusplus': 0, | ||
'react/prop-types': 0, | ||
'react/button-has-type': 0, | ||
'react/no-unused-prop-types': 0, | ||
'global-require': 0, | ||
'no-nested-ternary': 0, | ||
'no-else-return': 0, | ||
'array-callback-return': 0, | ||
'no-use-before-define': 'off', | ||
'@typescript-eslint/no-use-before-define': ['error'], | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
'react/require-default-props': 'off', | ||
'react/jsx-filename-extension': ['warn', { extensions: ['.tsx'] }], | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'no-console': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'import/extensions': [ | ||
'error', | ||
'ignorePackages', | ||
{ | ||
ts: 'never', | ||
tsx: 'never' | ||
} | ||
] | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'] | ||
}, | ||
typescript: {} | ||
} | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/tests/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], | ||
extends: ['plugin:testing-library/react'] | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
build | ||
src/gql | ||
src/__generated | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
.vscode | ||
.eslintcache | ||
graphql.schema.json | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn run lint:fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo 'An ideal pre-push hook will be yarn run test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
# Ignore artifacts: | ||
build | ||
coverage | ||
dist | ||
scripts | ||
src/__generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"singleQuote": true, | ||
"jsxSingleQuote": true, | ||
"semi": true, | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const { mergeConfig } = require('vite'); | ||
const { resolve } = require('path'); | ||
|
||
module.exports = { | ||
// other storybook options..., | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions' | ||
], | ||
framework: '@storybook/react', | ||
core: { | ||
builder: '@storybook/builder-vite' | ||
}, | ||
features: { | ||
storyStoreV7: true | ||
}, | ||
async viteFinal(config, options) { | ||
return mergeConfig(config, { | ||
publicPath: '/storybook/', | ||
resolve: { | ||
alias: { | ||
Assets: resolve(__dirname, './../src/assets'), | ||
Components: resolve(__dirname, './../src/components'), | ||
Elements: resolve(__dirname, './../src/elements'), | ||
Features: resolve(__dirname, './../src/features'), | ||
Hooks: resolve(__dirname, './../src/hooks'), | ||
Libs: resolve(__dirname, './../src/libs'), | ||
Pages: resolve(__dirname, './../src/pages'), | ||
Routes: resolve(__dirname, './../src/routes'), | ||
Services: resolve(__dirname, './../src/services'), | ||
State: resolve(__dirname, './../src/state'), | ||
Stories: resolve(__dirname, './../src/stories'), | ||
Tests: resolve(__dirname, './../src/tests'), | ||
Types: resolve(__dirname, './../src/types'), | ||
Utils: resolve(__dirname, './../src/utils') | ||
} | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- ./storybook/preview-head.html --> | ||
<link href="./../src/tailwind.css" rel="stylesheet" /> | ||
|
||
<!-- Temporary fix for 7.0 beta --> | ||
<style> | ||
html { | ||
/* background-color: #f9fafb; */ | ||
background-color: white; | ||
} | ||
</style> | ||
|
||
<script> | ||
window.global = window; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'tailwindcss/tailwind.css'; | ||
|
||
import { withTailwindTheme } from './withTailwindTheme.decorator'; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/ | ||
} | ||
} | ||
}; | ||
|
||
export const decorators = [withTailwindTheme]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// .storybook/withTailwindTheme.decorator.js | ||
|
||
import React from 'react'; | ||
import { QueryClientProvider } from '@tanstack/react-query'; | ||
import { queryClient } from '../src/services'; | ||
|
||
export const withTailwindTheme = (Story, context) => { | ||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<Story /> | ||
</QueryClientProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# This repo has been deprecated and merged into the Edvise monorepo. It is no longer actively maintained as of March 10, 2023. | ||
|
||
# Naming convention | ||
|
||
## files/folder | ||
|
||
### folders: kebab-case | ||
|
||
### components: PascalCase e.g LessonCard.tsx | ||
|
||
### hooks: useFoo e.g 'useLocalStorage' | ||
|
||
# Folder Purpose | ||
|
||
## src/assets/ | ||
|
||
- for images, icons | ||
|
||
## src/components/ | ||
|
||
- for JSX components | ||
- if component is too big, break down into elements | ||
|
||
## src/elements/ | ||
|
||
- for JSX elements that make up components in src/components | ||
|
||
## src/feature/ | ||
|
||
- for logically grouping feature resources | ||
- potentially has the following : | ||
- src/features/foo/components/ | ||
- src/features/foo/state/ | ||
- src/features/foo/types/ | ||
- src/features/foo/utils/ | ||
- src/features/foo/hooks/ | ||
- for feature specific hooks | ||
- src/features/foo/index.ts | ||
- for exporting whichever of the above folder/file | ||
|
||
## src/hooks/ | ||
|
||
- for custom hooks | ||
- naming: useFoo.ts(x) | ||
|
||
## src/libs/ | ||
|
||
- for wrapping libraries that we use in the app | ||
|
||
## src/pages/ | ||
|
||
- for the higher order components that render each page | ||
- naming | ||
- must match the url | ||
- must be kebab-case | ||
- must export as default | ||
|
||
## src/routes/ | ||
|
||
- for route configuration | ||
- src/routes/index.tsx | ||
- can specify new route in here | ||
- src.routes/Layout.tsx | ||
- can specify new layout in here | ||
|
||
## src/services | ||
|
||
- for api fetchers configuration | ||
- caching implementation | ||
- for other services | ||
|
||
## src/state/ | ||
|
||
- for central state configuration | ||
- src/state/atom/ | ||
- we're using jotai atomic state management | ||
- src/state/atom/index.ts | ||
- export all atoms | ||
|
||
## src/stories/ | ||
|
||
- should share same assets folder as src/assets/ | ||
- for everything storybook | ||
- src/components/ | ||
- src/elements/ | ||
- src/pages/ | ||
- src/mvp/ | ||
- src/mvp/components | ||
- src/mvp/elements | ||
- src/mvp/pages | ||
|
||
## src/tests/ | ||
|
||
- For testing, Vitest and React testing Library. | ||
- Run `yarn run test` | ||
|
||
## src/types/ | ||
|
||
- for central type | ||
- widely shared types | ||
|
||
## src/utils/ | ||
|
||
- for central util functions | ||
- widely shared utils | ||
|
||
# Automations | ||
|
||
- husky does not automatically install, so run `yarn run prepare` to get started | ||
- you may choose to manually run the linting script: | ||
- `yarn run lint:fix` | ||
- `yarn run prettier:fix` | ||
- `yarn run lint` | ||
- etc (refer to `package.json`) | ||
|
||
# Other Commands | ||
|
||
- `yarn storybook` | ||
- `yarn run dev` | ||
- `yarn graphql-codegen --watch` | ||
|
||
PS: Please ensure to fix all lint issues associated with your changes before making a PR. Happy Hacking! | ||
|
||
Follow this workflow before creating a PR: | ||
|
||
- `git log --oneline` (view NUMBER of commits if multiple) | ||
- `git rebase -i HEAD~<NUMBER>` (converge multiple commits before PR. Fixup most recent into the oldest) | ||
- `git checkout main` | ||
- `git pull` (In case anyone merged something ahead of you) | ||
- `git checkout -` (go back to your feature branch) | ||
- `git rebase main` (packs your commit on top of the main history. Do this before making PR). | ||
- `git push` (ensure the pre-commit, commitlint and pre-push scripts are executed). |
Oops, something went wrong.