Skip to content

Commit e0bacb9

Browse files
author
Daniil Yankouski
authored
Merge pull request #11 from qDanik/setup/vite
Move react to cdn using vite
2 parents 1783939 + 9d443e6 commit e0bacb9

25 files changed

+1461
-282
lines changed

.vite/plugins.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ import reactRefresh from '@vitejs/plugin-react-refresh';
22
import viteCompression from 'vite-plugin-compression';
33
import reactSvgPlugin from 'vite-plugin-react-svg';
44
import tsconfigPaths from 'vite-tsconfig-paths';
5+
import importToCDN, { autoComplete } from 'vite-plugin-cdn-import'
56

67
const BasePlugins = [
8+
importToCDN({
9+
modules: [
10+
autoComplete('react'),
11+
autoComplete('react-dom')
12+
],
13+
}),
714
tsconfigPaths(),
815
reactSvgPlugin({
916
defaultExport: 'component',
@@ -22,11 +29,11 @@ const BasePlugins = [
2229
}),
2330
];
2431

25-
export const DevPlugins = [reactRefresh(), ...BasePlugins];
32+
export const DevPlugins = [...BasePlugins, reactRefresh()];
2633

2734
export const BuildPlugins = [
35+
...BasePlugins,
2836
viteCompression({
2937
filter: (file: string): boolean => file.includes('.js'),
3038
}),
31-
...BasePlugins,
3239
];

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,21 @@ In the project directory, you can run:
150150

151151
### Namings
152152

153-
`Folder Namings`: Use `kebab-case` format
154-
`File Namings`: Alls files should include target name like (auth) and implementation responsibility like (component, helper, styles) as result we should receive (auth.component.ts, auth.store.ts, auth.styles.ts and etc.)
155-
`Hooks`: Starting with keyword `use` and using format `camelCase` (useSomeHook)
156-
`Constants`: CONSTANT_CASE, SCREAMING_KEBAB_CASE
153+
- `Folder Namings`: Use `kebab-case` format
154+
- `File Namings`: Alls files should include target name like (auth) and implementation responsibility like (component, helper, styles) as result we should receive (auth.component.ts, auth.store.ts, auth.styles.ts and etc.)
155+
- `Hooks`: Starting with keyword `use` and using format `camelCase` (useSomeHook)
156+
- `Constants`: CONSTANT_CASE, SCREAMING_KEBAB_CASE
157157
`Functions, Variables, class Methods or Properties`: camelCase (token, userName, getUser, findUser)
158-
`Classes, Types, Interfaces, Enums`: PascalCase (AuthService, AuthRepository, UserMapper, AppStore)
159-
`Private Properties or Methods`: Starting with `underline` and using format `camelCase` (\_userName, \_email, \_someDataName)
158+
- `Classes, Types, Interfaces, Enums`: PascalCase (AuthService, AuthRepository, UserMapper, AppStore)
159+
- `Private Properties or Methods`: Starting with `underline` and using format `camelCase` (\_userName, \_email, \_someDataName)
160160

161161
### App Layers
162162

163-
`Domain Layer`: Shouldn't has intersections with UI layer. How we should communicate with Domain? We should include our domain implementations into our Containers and inject these implementations into our components using `useInjection` hook from `IoC`. All containers type must be declared in implementation file using generic `ServiceIdentifier<T>` from containers/typings. (ex. const AuthServiceType: ServiceIdentifier<AuthUseCase> = Symbol('AuthService')) we do not have dependencies on `implementations` like (AuthService or AuthUseCaseImpl), only on the `interfaces` (AuthUseCase).
164-
`Core layer`: Contains main part of application which can will be included in container layer. `Store` also should be included in container as `singleton`.
165-
`Container Layer`: It is 'bridge' between all layers
166-
`UI Layer`: Is responsible for the UI part, for everything that user can see in his browser
163+
- `Domain Layer`: Shouldn't has intersections with UI layer. How we should communicate with Domain? We should include our domain implementations into our Containers and inject these implementations into our components using `useInjection` hook from `IoC`. All containers type must be declared in implementation file using generic `ServiceIdentifier<T>` from containers/typings. (ex. const AuthServiceType: ServiceIdentifier<AuthUseCase> = Symbol('AuthService')) we do not have dependencies on `implementations` like (AuthService or AuthUseCaseImpl), only on the `interfaces` (AuthUseCase).
164+
- `Core layer`: Contains main part of application which can will be included in container layer. `Store` also should be included in container as `singleton`.
165+
- `Container Layer`: It is 'bridge' between all layers
166+
- `UI Layer`: Is responsible for the UI part, for everything that user can see in his browser
167+
### Folder Describes
167168

168169
- `.husky/` - husky config files.
169170
- `.webpack/` - webpack config files.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@types/react-dom": "17.0.0",
2525
"@types/react-router": "5.1.11",
2626
"@types/react-router-dom": "5.1.7",
27+
"@vanilla-extract/css": "^1.0.0",
2728
"@types/styled-components": "5.1.7",
2829
"axios": "0.21.1",
2930
"date-fns": "2.17.0",
@@ -49,6 +50,7 @@
4950
"@types/jest": "^26.0.23",
5051
"@typescript-eslint/eslint-plugin": "4.14.2",
5152
"@typescript-eslint/parser": "4.14.2",
53+
"@vanilla-extract/vite-plugin": "^1.0.0",
5254
"@vitejs/plugin-react-refresh": "^1.3.3",
5355
"dotenv": "^8.2.0",
5456
"esbuild": "^0.11.20",
@@ -72,6 +74,8 @@
7274
"ts-node": "^9.1.1",
7375
"typescript": "4.1.3",
7476
"vite": "^2.3.7",
77+
"vite-plugin-cdn-import": "^0.3.2",
78+
"vite-plugin-compress": "^2.1.0",
7579
"vite-plugin-compression": "^0.2.5",
7680
"vite-plugin-react-svg": "^0.2.0",
7781
"vite-tsconfig-paths": "^3.3.13"

src/domain/Auth/entities/auth.entity.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/domain/Auth/index.ts

Whitespace-only changes.

src/domain/Auth/repository/auth.repo.ts

Whitespace-only changes.

src/domain/Auth/services/auth.service.ts

Whitespace-only changes.

src/domain/Auth/usecase/auth.use-case.ts

Whitespace-only changes.

src/ui/components/common/Box/box.component.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/ui/components/common/Box/box.styles.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)