diff --git a/.stylelintrc b/.stylelintrc deleted file mode 100644 index 7ef8833..0000000 --- a/.stylelintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "customSyntax": "postcss-styled-syntax", - "rules": { - "custom-property-pattern": "^[a-z][a-zA-Z0-9]+$", - "declaration-block-no-duplicate-properties": true, - "no-descending-specificity": true, - "value-no-vendor-prefix": null, - "property-no-vendor-prefix": null - } -} diff --git a/@react-vite-trpc/ui/package.json b/@react-vite-trpc/ui/package.json deleted file mode 100644 index cb5557e..0000000 --- a/@react-vite-trpc/ui/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@react-vite-trpc/ui", - "version": "1.0.0", - "main": "src/index.tsx", - "types": "src/index.tsx", - "license": "MIT", - "dependencies": { - "styled-components": "^5.3.11" - }, - "devDependencies": { - "@types/react": "^18.0.17", - "@types/react-dom": "^18.0.6", - "eslint": "^7.32.0", - "@react-vite-trpc/eslint-config": "workspace:*", - "react": "^18.2.0", - "@react-vite-trpc/tsconfig": "workspace:*", - "typescript": "^4.9.5", - "@types/styled-components": "^5.1.26" - } -} diff --git a/@react-vite-trpc/ui/src/Label.tsx b/@react-vite-trpc/ui/src/Label.tsx deleted file mode 100644 index 24d7b99..0000000 --- a/@react-vite-trpc/ui/src/Label.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import styled from 'styled-components' - -type LabelProps = { - children: React.ReactNode -} - -export const Label = ({ children }: LabelProps) => {children} - -const LabelContainer = styled.div` - padding: 12px 24px; - font-size: 20px; - background-color: white; - font-family: monospace; - border-radius: 4px; - cursor: pointer; - margin-bottom: 15px; - box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); -` diff --git a/@react-vite-trpc/ui/src/index.tsx b/@react-vite-trpc/ui/src/index.tsx deleted file mode 100644 index 717144f..0000000 --- a/@react-vite-trpc/ui/src/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Label } from './Label' diff --git a/@react-vite-trpc/ui/tsconfig.json b/@react-vite-trpc/ui/tsconfig.json deleted file mode 100644 index c8853f4..0000000 --- a/@react-vite-trpc/ui/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "@react-vite-trpc/tsconfig/react.json", - "compilerOptions": { - "baseUrl": "src", - "outDir": "dist" - }, - "references": [] -} diff --git a/apps/server/.env.test-example b/apps/server/.env.test-example deleted file mode 100644 index f46533d..0000000 --- a/apps/server/.env.test-example +++ /dev/null @@ -1 +0,0 @@ -NODE_ENV=test \ No newline at end of file diff --git a/apps/server/package.json b/apps/server/package.json index e28c4c9..3e39575 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -12,15 +12,7 @@ "lint:fix": "eslint . --fix", "ts:check": "tsc -b", "check": "pnpm lint && pnpm ts:check", - "build": "tsc -b", - "test:unit": "vitest .unit.test.ts", - "test:unit:run": "pnpm test:unit --run", - "test:integration": "vitest .integration.test.ts", - "test:integration:run": "pnpm test:integration --run", - "test:e2e": "vitest .e2e.test.ts", - "test:e2e:run": "pnpm test:e2e --run", - "test:coverage": "pnpm pm2:start && vitest run --coverage && pnpm pm2:delete", - "test:coverage:preview": "pnpm test:coverage && vite preview --outDir ./coverage --open" + "build": "tsc -b" }, "dependencies": { "@trpc/server": "^10.29.1", @@ -45,10 +37,7 @@ "fs-extra": "^11.1.1", "module-alias": "^2.2.3", "nodemon": "^2.0.22", - "ts-node": "^10.9.1", - "@vitest/coverage-istanbul": "^0.34.1", "typescript": "^4.9.5", - "@trivago/prettier-plugin-sort-imports": "^4.2.0", "pm2": "^5.3.0" } } diff --git a/apps/server/src/aliases.unit.test.ts b/apps/server/src/aliases.unit.test.ts deleted file mode 100644 index 85b5bb5..0000000 --- a/apps/server/src/aliases.unit.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import fs from 'fs-extra' -import moduleAlias from 'module-alias' -import { type SpyInstance, afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -import { Aliases } from './aliases' - -describe('Aliases', () => { - let mockReadJsonSync: SpyInstance - let mockReaddirSync: SpyInstance - let mockAddAliases: SpyInstance - - beforeEach(() => { - mockReadJsonSync = vi.spyOn(fs, 'readJsonSync') - mockReaddirSync = vi.spyOn(fs, 'readdirSync') - mockAddAliases = vi.spyOn(moduleAlias, 'addAliases') - }) - - afterEach(() => { - vi.restoreAllMocks() - }) - - describe('.config', () => { - it('should configure internal packages and directories', () => { - const configInternalPackagesSpy = vi.spyOn(Aliases, 'configInternalPackages') - - const configDirectoriesSpy = vi.spyOn(Aliases, 'configDirectories') - - Aliases.config() - - expect(configInternalPackagesSpy).toHaveBeenCalled() - - expect(configDirectoriesSpy).toHaveBeenCalled() - }) - }) - - describe('.configInternalPackages', () => { - it('should read tsconfig.json file', () => { - Aliases.configInternalPackages() - - expect(mockReadJsonSync).toBeCalledWith('tsconfig.json') - }) - - it('should add aliases for internal packages', () => { - const references = [{ path: '../@react-vite-trpc/config' }] - - const tsConfig = { - extends: '', - compilerOptions: {}, - references, - } - - mockReadJsonSync.mockReturnValueOnce(tsConfig) - - Aliases.configInternalPackages() - - expect(mockAddAliases).toBeCalled() - - references.forEach(({ path }) => { - const [_, internalPackage] = path.split('@') - - const packageName = `@${internalPackage}` - - expect(mockAddAliases).toBeCalledWith({ [packageName]: `${packageName}/dist/index.js` }) - }) - }) - }) - - describe('.configDirectories', () => { - it('should read and add aliases for directories', () => { - const directories = ['core', 'env', 'middlewares', 'modules', 'testing', 'types'].map(name => ({ - name, - isDirectory: () => true, - })) - - mockReaddirSync.mockReturnValueOnce(directories) - - Aliases.configDirectories() - - expect(mockReaddirSync).toHaveBeenCalledOnce() - - expect(mockAddAliases).toBeCalled() - }) - }) -}) diff --git a/apps/server/src/trpc/api/resolvers/getRole/getRole.e2e.test.ts b/apps/server/src/trpc/api/resolvers/getRole/getRole.e2e.test.ts deleted file mode 100644 index 3759b72..0000000 --- a/apps/server/src/trpc/api/resolvers/getRole/getRole.e2e.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe } from 'node:test' -import { expect, it } from 'vitest' - -import { client } from 'trpc/client' - -describe('getRole', () => { - it('should return valid Role', async () => { - const role = await client.getRole.query() - - expect(role).toStrictEqual({ role: 'USER' }) - }) -}) diff --git a/apps/server/src/trpc/api/resolvers/getRole/getRole.integration.test.ts b/apps/server/src/trpc/api/resolvers/getRole/getRole.integration.test.ts deleted file mode 100644 index 13eceea..0000000 --- a/apps/server/src/trpc/api/resolvers/getRole/getRole.integration.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { expect, it } from 'vitest' - -it('getRole', async () => { - expect(true).toBe(true) -}) diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json index 1a0fa92..27b325e 100644 --- a/apps/server/tsconfig.json +++ b/apps/server/tsconfig.json @@ -4,11 +4,7 @@ "baseUrl": "src", "outDir": "dist" }, - "include": [ - "src", - "vite.config.ts", - "vitest.setup.ts" - ], + "include": ["src", "vite.config.ts"], "references": [ { "path": "../../@react-vite-trpc/config/tsconfig.json" diff --git a/apps/server/vitest.config.ts b/apps/server/vitest.config.ts deleted file mode 100644 index 6f22818..0000000 --- a/apps/server/vitest.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { type UserConfig, defineConfig, mergeConfig } from 'vitest/config' - -import { vitestConfig } from '../../vitest.config' - -export default mergeConfig(vitestConfig, defineConfig({}) as UserConfig) diff --git a/apps/server/vitest.setup.ts b/apps/server/vitest.setup.ts deleted file mode 100644 index e87de01..0000000 --- a/apps/server/vitest.setup.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { config } from 'dotenv' - -config({ path: '.env.test' }) diff --git a/apps/web/.prettierrc b/apps/web/.prettierrc index ec3e834..8cc1cd7 100644 --- a/apps/web/.prettierrc +++ b/apps/web/.prettierrc @@ -29,9 +29,6 @@ "^assets(.*)", - "(.*)styled$", - "(.*)styled/(.*)", - "^components/shared$", "^components(.*)", diff --git a/apps/web/cypress.config.ts b/apps/web/cypress.config.ts deleted file mode 100644 index 61dd5f1..0000000 --- a/apps/web/cypress.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'cypress' - -export default defineConfig({ - e2e: { - baseUrl: 'http://127.0.0.1:3001', - experimentalStudio: true, - supportFile: false, - }, -}) diff --git a/apps/web/cypress/e2e/Home.cy.ts b/apps/web/cypress/e2e/Home.cy.ts deleted file mode 100644 index 43959cb..0000000 --- a/apps/web/cypress/e2e/Home.cy.ts +++ /dev/null @@ -1,5 +0,0 @@ -it('Home', () => { - expect(true).to.equal(true) -}) - -export {} diff --git a/apps/web/package.json b/apps/web/package.json index 8696c1d..d4dfc1f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -8,19 +8,8 @@ "lint": "eslint .", "lint:fix": "eslint . --fix", "ts:check": "tsc -b", - "stylelint": "stylelint src/**/*.{ts,tsx,scss}", "check": "pnpm lint && pnpm ts:check && pnpm stylelint", - "build": "pnpm ts:check && vite build", - "test:unit": "vitest .unit.test.ts .unit.test.tsx", - "test:unit:run": "pnpm test:unit --run", - "test:integration": "vitest .integration.test.ts .integration.test.tsx", - "test:integration:run": "pnpm test:integration --run", - "test:e2e": "cypress run --browser chrome", - "test:e2e:run": "cypress run", - "test:coverage": "vitest run --coverage", - "test:coverage:preview": "pnpm test:coverage && vite preview --outDir ./coverage --open", - "cypress": "cypress open", - "cypress:install": "cypress install" + "build": "pnpm ts:check && vite build" }, "dependencies": { "@react-vite-trpc/ui": "workspace:*", @@ -30,32 +19,19 @@ "@trpc/server": "^10.29.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-query": "^3.39.3", - "styled-components": "^5.3.11" + "react-query": "^3.39.3" }, "devDependencies": { - "@testing-library/jest-dom": "^5.17.0", - "@testing-library/react": "^14.0.0", - "@types/testing-library__jest-dom": "^5.14.9", - "@types/jest": "^29.5.3", "@types/react": "^18.2.11", "@types/react-dom": "^18.2.4", - "cypress": "^12.17.3", - "@vitest/coverage-istanbul": "^0.34.1", - "@types/styled-components": "^5.1.26", "@vitejs/plugin-react": "^3.1.0", - "sass": "^1.63.3", "envalid": "^7.3.1", "@tanstack/router": "0.0.1-beta.139", - "postcss-styled-syntax": "^0.4.0", - "stylelint": "^15.10.2", "jsdom": "^22.1.0", "typescript": "^4.9.5", "vite": "^4.3.9", - "vitest": "^0.34.1", "vite-tsconfig-paths": "^4.2.0", "@react-vite-trpc/tsconfig": "workspace:*", - "@react-vite-trpc/eslint-config": "workspace:*", - "@trivago/prettier-plugin-sort-imports": "^4.2.0" + "@react-vite-trpc/eslint-config": "workspace:*" } } diff --git a/apps/web/src/components/core/App.tsx b/apps/web/src/components/core/App.tsx index 4bcfc89..8066fee 100644 --- a/apps/web/src/components/core/App.tsx +++ b/apps/web/src/components/core/App.tsx @@ -1,7 +1,4 @@ import { Outlet, RootRoute, Route, Router, RouterProvider } from '@tanstack/router' -import styled from 'styled-components' - -import { GlobalStyle } from 'styles' import { Home } from 'components/features' @@ -19,16 +16,7 @@ const router = new Router({ routeTree }) window.navigate = router.navigate -export const App = () => ( - - - - -) - -const AppContainer = styled.div` - height: 100%; -` +export const App = () => declare global { interface Window { diff --git a/apps/web/src/components/features/Home/Home.tsx b/apps/web/src/components/features/Home/Home.tsx index 4562346..250afcf 100644 --- a/apps/web/src/components/features/Home/Home.tsx +++ b/apps/web/src/components/features/Home/Home.tsx @@ -1,30 +1,7 @@ -import styled from 'styled-components' - -import { Label } from '@react-vite-trpc/ui' - import { trpc } from 'trpc' -import * as Styled from './styled' - export const Home = () => { const { data } = trpc.getRole.useQuery() - return ( - - - - - ) + return
Current role: {data?.role}
} - -const HomeContainer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - min-height: 100vh; - background: linear-gradient(to right, #434343, #000000); -` diff --git a/apps/web/src/components/features/Home/styled/Gif.tsx b/apps/web/src/components/features/Home/styled/Gif.tsx deleted file mode 100644 index 0da46da..0000000 --- a/apps/web/src/components/features/Home/styled/Gif.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import styled from 'styled-components' - -export const Gif = styled.img` - margin-top: 25px; -` diff --git a/apps/web/src/components/features/Home/styled/index.ts b/apps/web/src/components/features/Home/styled/index.ts deleted file mode 100644 index 79cdfdb..0000000 --- a/apps/web/src/components/features/Home/styled/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Gif } from './Gif' diff --git a/apps/web/src/components/shared/Providers.tsx b/apps/web/src/components/shared/Providers.tsx index 194e454..31236ea 100644 --- a/apps/web/src/components/shared/Providers.tsx +++ b/apps/web/src/components/shared/Providers.tsx @@ -1,12 +1,8 @@ import { QueryClientProvider } from '@tanstack/react-query' import { type PropsWithChildren } from 'react' -import { ThemeProvider } from 'styled-components' import { trpc } from 'trpc' -import { theme } from 'styles' -import 'styles/index.scss' - import { useTrpc } from 'hooks' export const Providers = ({ children }: PropsWithChildren) => { @@ -14,9 +10,7 @@ export const Providers = ({ children }: PropsWithChildren) => { return ( - - {children} - + {children} ) } diff --git a/apps/web/src/main.integration.test.tsx b/apps/web/src/main.integration.test.tsx deleted file mode 100644 index e06fc87..0000000 --- a/apps/web/src/main.integration.test.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { render } from '@testing-library/react' - -import { App } from 'components/core' - -import { Providers } from 'components/shared' - -describe('main.tsx', () => { - it('should render App within Providers', () => { - render( - - - - ) - }) -}) diff --git a/apps/web/src/main.unit.test.tsx b/apps/web/src/main.unit.test.tsx deleted file mode 100644 index e2b9826..0000000 --- a/apps/web/src/main.unit.test.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { render } from '@testing-library/react' -import { vi } from 'vitest' - -import { act } from 'react-dom/test-utils' - -describe('main.tsx', () => { - it('should call document.getElementById', async () => { - render(
) - - const spiedDocument = vi.spyOn(document, 'getElementById') - - await act(async () => { - await import('./main') - }) - - expect(spiedDocument).toBeCalled() - }) -}) diff --git a/apps/web/src/styles/globalStyle.ts b/apps/web/src/styles/globalStyle.ts deleted file mode 100644 index fb324c5..0000000 --- a/apps/web/src/styles/globalStyle.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { createGlobalStyle } from 'styled-components' - -export const GlobalStyle = createGlobalStyle`` diff --git a/apps/web/src/styles/index.scss b/apps/web/src/styles/index.scss deleted file mode 100644 index e15e86b..0000000 --- a/apps/web/src/styles/index.scss +++ /dev/null @@ -1,11 +0,0 @@ -* { - margin: 0px; - padding: 0px; - box-sizing: border-box; -} - -html, -body, -#root { - height: 100%; -} diff --git a/apps/web/src/styles/index.ts b/apps/web/src/styles/index.ts deleted file mode 100644 index c05f99f..0000000 --- a/apps/web/src/styles/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { GlobalStyle } from './globalStyle' -export { mediaQueries } from './mediaQueries' -export { theme } from './theme' diff --git a/apps/web/src/styles/mediaQueries.ts b/apps/web/src/styles/mediaQueries.ts deleted file mode 100644 index 94c30bd..0000000 --- a/apps/web/src/styles/mediaQueries.ts +++ /dev/null @@ -1,21 +0,0 @@ -const breakpoints = { - largeDesktop: '1600px', - desktop: '900px', - tablet: '768px', - smallTablet: ' 500px', - mobile: '400px', -} - -export const mediaQueries = { - largeDesktop: `(max-width: ${breakpoints.largeDesktop})`, - desktop: `(max-width: ${breakpoints.desktop})`, - tablet: `(max-width: ${breakpoints.tablet})`, - smallTablet: `(max-width: ${breakpoints.smallTablet})`, - mobile: `(max-width: ${breakpoints.mobile})`, - - minLargeDesktop: `(min-width: ${breakpoints.largeDesktop})`, - minDesktop: `(min-width: ${breakpoints.desktop})`, - minTablet: `(min-width: ${breakpoints.tablet})`, - minSmallTablet: `(min-width: ${breakpoints.smallTablet})`, - minMobile: `(min-width: ${breakpoints.mobile})`, -} diff --git a/apps/web/src/styles/theme.ts b/apps/web/src/styles/theme.ts deleted file mode 100644 index 38ce26d..0000000 --- a/apps/web/src/styles/theme.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const theme = { - colors: { - primary: '#000', - }, -} as const diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 5837ae8..3117442 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "dist", "composite": false }, - "include": ["src", "cypress", "vite.config.ts", "vitest.setup.ts"], + "include": ["src", "cypress", "vite.config.ts"], "references": [ { "path": "../server" diff --git a/apps/web/vitest.config.ts b/apps/web/vitest.config.ts deleted file mode 100644 index f50b081..0000000 --- a/apps/web/vitest.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig, mergeConfig } from 'vitest/config' - -import { vitestConfig } from '../../vitest.config' - -export default mergeConfig( - vitestConfig, - defineConfig({ - test: { - globals: true, - environment: 'jsdom', - }, - }) -) diff --git a/apps/web/vitest.setup.ts b/apps/web/vitest.setup.ts deleted file mode 100644 index 9d960f4..0000000 --- a/apps/web/vitest.setup.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as matchers from '@testing-library/jest-dom/matchers' -import { cleanup } from '@testing-library/react' -import { afterEach, expect } from 'vitest' - -expect.extend(matchers) - -afterEach(() => { - cleanup() -}) diff --git a/package.json b/package.json index a1e2508..e8bef17 100644 --- a/package.json +++ b/package.json @@ -14,31 +14,18 @@ "dev": "turbo run dev", "lint": "turbo run lint", "lint:fix": "turbo run lint:fix", - "stylelint": "turbo run stylelint", "ts:check": "turbo run ts:check", "check": "turbo run check", "build": "turbo run build", "build:lib": "turbo run build:lib", - "test:unit:run": "turbo run test:unit:run", - "test:integration:run": "turbo run test:integration:run", - "test:e2e:run": "turbo run test:e2e:run", - "test:coverage": "turbo run test:coverage", - "test:coverage:preview": "turbo run test:coverage:preview", - "cypress:install": "pnpm -F @react-vite-trpc/web cypress:install", "postinstall": "pnpm build:lib" }, "devDependencies": { "@react-vite-trpc/eslint-config": "workspace:*", - "@trivago/prettier-plugin-sort-imports": "^4.2.0", - "@types/glob": "^8.1.0", "eslint": "^8.46.0", - "glob": "^10.3.3", - "stylelint": "^15.10.2", - "ts-node": "^10.9.1", "turbo": "^1.10.12", "typescript": "^5.1.6", "vite-tsconfig-paths": "^4.2.0", - "vitest": "^0.34.1", "@swc/core": "^1.3.71" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18b821c..61b131f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,10 +100,6 @@ importers: '@react-vite-trpc/tsconfig': {} '@react-vite-trpc/ui': - dependencies: - styled-components: - specifier: ^5.3.11 - version: 5.3.11(@babel/core@7.22.9)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) devDependencies: '@react-vite-trpc/eslint-config': specifier: workspace:* diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index 4f977fb..0000000 --- a/vitest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import tsconfigPaths from 'vite-tsconfig-paths' -import { defineConfig } from 'vitest/config' - -export const vitestConfig = defineConfig({ - test: { - setupFiles: ['vitest.setup.ts'], - coverage: { - provider: 'istanbul', - reporter: ['html', 'text-summary', 'lcovonly'], - all: true, - }, - testTimeout: 15000, - }, - plugins: [tsconfigPaths()], -})