Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
webguru11124 committed Jun 23, 2023
0 parents commit 7e2b02e
Show file tree
Hide file tree
Showing 463 changed files with 70,263 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc
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"
}
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_BASE_URL=
VITE_PROPEL_AUTH_URL=
7 changes: 7 additions & 0 deletions .eslintignore
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
80 changes: 80 additions & 0 deletions .eslintrc.cjs
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']
}
]
};
31 changes: 31 additions & 0 deletions .gitignore
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
4 changes: 4 additions & 0 deletions .husky/commit-msg
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"
4 changes: 4 additions & 0 deletions .husky/pre-commit
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
4 changes: 4 additions & 0 deletions .husky/pre-push
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'
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
# Ignore artifacts:
build
coverage
dist
scripts
src/__generated
10 changes: 10 additions & 0 deletions .prettierrc
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"
}
42 changes: 42 additions & 0 deletions .storybook/main.cjs
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')
}
}
});
}
};
14 changes: 14 additions & 0 deletions .storybook/preview-head.html
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>
15 changes: 15 additions & 0 deletions .storybook/preview.cjs
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];
13 changes: 13 additions & 0 deletions .storybook/withTailwindTheme.decorator.tsx
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>
);
};
132 changes: 132 additions & 0 deletions README.md
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).
Loading

0 comments on commit 7e2b02e

Please sign in to comment.