From 4d83f60b897971613ad9e5eb757e2946bbbb24c3 Mon Sep 17 00:00:00 2001 From: Magak Emmanuel Date: Tue, 8 Oct 2024 15:54:31 +0300 Subject: [PATCH 1/6] fixed build issues die to eslint --- apps/frontend-next/eslint.config.js | 26 ++++++++++---------------- apps/frontend-next/pages/index.tsx | 2 +- apps/frontend-next/postcss.config.js | 2 ++ apps/frontend-next/project.json | 15 +++++++++++++++ apps/frontend-next/tailwind.config.js | 4 ++++ 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/apps/frontend-next/eslint.config.js b/apps/frontend-next/eslint.config.js index 2ba8e07..979f8c2 100644 --- a/apps/frontend-next/eslint.config.js +++ b/apps/frontend-next/eslint.config.js @@ -9,27 +9,21 @@ const compat = new FlatCompat({ module.exports = [ ...compat.extends( - 'plugin:@nx/react-typescript', - 'next', - 'next/core-web-vitals' + 'plugin:@nx/react-typescript' + // 'next', + // 'next/core-web-vitals' ), ...baseConfig, { files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], rules: { - '@next/next/no-html-link-for-pages': [ - 'error', - 'apps/frontend-next/pages', - ], + '@typescript-eslint/no-require-imports': 'off', + 'import/extensions': 'off', + 'import/no-unresolved': 'off', + }, + languageOptions: { + parserOptions: { project: ['apps/frontend-next/tsconfig.json'] }, }, - }, - { - files: ['**/*.ts', '**/*.tsx'], - rules: {}, - }, - { - files: ['**/*.js', '**/*.jsx'], - rules: {}, }, ...compat.config({ env: { jest: true } }).map((config) => ({ ...config, @@ -38,5 +32,5 @@ module.exports = [ ...config.rules, }, })), - { ignores: ['.next/**/*'] }, + { ignores: ['!**/*', '**/.next/*', '**/jest.config.ts'] }, ] diff --git a/apps/frontend-next/pages/index.tsx b/apps/frontend-next/pages/index.tsx index 6ca7247..03a48af 100644 --- a/apps/frontend-next/pages/index.tsx +++ b/apps/frontend-next/pages/index.tsx @@ -10,7 +10,7 @@ export function Index() {

- Hello there, + Hello there, Welcome frontend-next 👋

diff --git a/apps/frontend-next/postcss.config.js b/apps/frontend-next/postcss.config.js index a8f1ac9..f66cc83 100644 --- a/apps/frontend-next/postcss.config.js +++ b/apps/frontend-next/postcss.config.js @@ -1,4 +1,5 @@ const { join } = require('path') +const baseConfig = require('../../.tailwind/postcss.config') // Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build // option from your application's configuration (i.e. project.json). @@ -6,6 +7,7 @@ const { join } = require('path') // See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libraries module.exports = { + ...baseConfig, plugins: { tailwindcss: { config: join(__dirname, 'tailwind.config.js'), diff --git a/apps/frontend-next/project.json b/apps/frontend-next/project.json index bbe4165..e457445 100644 --- a/apps/frontend-next/project.json +++ b/apps/frontend-next/project.json @@ -5,12 +5,27 @@ "projectType": "application", "tags": [], "targets": { + "build": { + "executor": "@nx/next:build", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "outputPath": "dist/frontend-next" + } + }, "test": { "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { "jestConfig": "apps/frontend-next/jest.config.ts" } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/frontend-next/**/*.{ts,js,tsx,jsx}"] + } } } } diff --git a/apps/frontend-next/tailwind.config.js b/apps/frontend-next/tailwind.config.js index 7f2bd16..5cd6fb3 100644 --- a/apps/frontend-next/tailwind.config.js +++ b/apps/frontend-next/tailwind.config.js @@ -1,15 +1,19 @@ const { createGlobPatternsForDependencies } = require('@nx/react/tailwind') const { join } = require('path') +const baseConfig = require('../../.tailwind/tailwind.config') + /** @type {import('tailwindcss').Config} */ module.exports = { content: [ join( __dirname, '{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}' + // TODO: add ui-kit-react ), ...createGlobPatternsForDependencies(__dirname), ], + presets: [baseConfig], theme: { extend: {}, }, From 80277604df2943d2e81d9ef4ed78b49e85005c2e Mon Sep 17 00:00:00 2001 From: Magak Emmanuel Date: Tue, 8 Oct 2024 15:54:58 +0300 Subject: [PATCH 2/6] fixing ui-kit, frontwnd-vue code --- .gitignore | 4 ++-- .tailwind/tailwind.theme.js | 1 + README.md | 4 ++-- apps/frontend-vue/project.json | 16 +++---------- apps/frontend-vue/src/components/Register.vue | 3 +-- apps/frontend-vue/tailwind.config.js | 8 +++---- apps/frontend-vue/vite.config.ts | 10 +++++++- libs/{ui-kit => ui-kit-vue}/.babelrc | 0 .../{ui-kit => ui-kit-vue}/.storybook/main.js | 18 +++++++-------- .../.storybook/preview.js | 4 ++-- libs/ui-kit-vue/.tailwind/postcss.config.js | 12 ++++++++++ .../.tailwind/tailwind.config.js | 6 ++--- libs/ui-kit-vue/README.md | 11 +++++++++ libs/{ui-kit => ui-kit-vue}/eslint.config.js | 2 +- libs/ui-kit-vue/jest.config.ts | 15 ++++++++++++ libs/{ui-kit => ui-kit-vue}/package.json | 2 +- libs/{ui-kit => ui-kit-vue}/project.json | 17 ++++++++------ libs/ui-kit-vue/src/index.ts | 6 +++++ .../lib/components/CustomButton/ButtonText.ts | 0 .../CustomButton/CustomButton.stories.ts | 20 ++++++++-------- .../components/CustomButton/CustomButton.vue | 0 .../src/lib/components/CustomButton/index.ts | 3 +++ .../src/lib/components/Input/Input.stories.ts | 22 +++++++++--------- .../src/lib/components/Input/Input.vue | 2 +- .../src/lib/components/Input/index.ts | 3 +++ .../src/stories/Button/Button.stories.js | 22 +++++++++--------- .../src/stories/Button/Button.vue | 0 .../src/stories/Button/button.css | 0 libs/ui-kit-vue/src/stories/Button/index.ts | 3 +++ .../src/stories/Header/Header.stories.js | 8 +++---- .../src/stories/Header/Header.vue | 0 .../src/stories/Header/header.css | 0 libs/ui-kit-vue/src/stories/Header/index.ts | 3 +++ .../src/stories/Page/Page.stories.js | 12 +++++----- .../src/stories/Page/Page.vue | 0 libs/ui-kit-vue/src/stories/Page/index.ts | 3 +++ .../src/stories/Page/page.css | 0 .../src/stories/assets/code-brackets.svg | 0 .../src/stories/assets/colors.svg | 0 .../src/stories/assets/comments.svg | 0 .../src/stories/assets/direction.svg | 0 .../src/stories/assets/flow.svg | 0 .../src/stories/assets/plugin.svg | 0 .../src/stories/assets/repo.svg | 0 .../src/stories/assets/stackalt.svg | 0 libs/{ui-kit => ui-kit-vue}/tsconfig.json | 0 libs/{ui-kit => ui-kit-vue}/tsconfig.lib.json | 0 .../{ui-kit => ui-kit-vue}/tsconfig.spec.json | 0 libs/ui-kit/.tailwind/postcss.config.js | 12 ---------- libs/ui-kit/README.md | 11 --------- libs/ui-kit/jest.config.ts | 15 ------------ libs/ui-kit/src/index.ts | 6 ----- .../src/lib/components/CustomButton/index.ts | 3 --- libs/ui-kit/src/lib/components/Input/index.ts | 3 --- libs/ui-kit/src/stories/Button/index.ts | 3 --- libs/ui-kit/src/stories/Header/index.ts | 3 --- libs/ui-kit/src/stories/Page/index.ts | 3 --- nx.json | 19 ++++++++------- package.json | 10 ++++---- tsconfig.base.json | 2 +- yarn.lock | 23 ++++++++++++++++++- 61 files changed, 189 insertions(+), 164 deletions(-) rename libs/{ui-kit => ui-kit-vue}/.babelrc (100%) rename libs/{ui-kit => ui-kit-vue}/.storybook/main.js (59%) rename libs/{ui-kit => ui-kit-vue}/.storybook/preview.js (59%) create mode 100644 libs/ui-kit-vue/.tailwind/postcss.config.js rename libs/{ui-kit => ui-kit-vue}/.tailwind/tailwind.config.js (57%) create mode 100644 libs/ui-kit-vue/README.md rename libs/{ui-kit => ui-kit-vue}/eslint.config.js (97%) create mode 100644 libs/ui-kit-vue/jest.config.ts rename libs/{ui-kit => ui-kit-vue}/package.json (94%) rename libs/{ui-kit => ui-kit-vue}/project.json (74%) create mode 100644 libs/ui-kit-vue/src/index.ts rename libs/{ui-kit => ui-kit-vue}/src/lib/components/CustomButton/ButtonText.ts (100%) rename libs/{ui-kit => ui-kit-vue}/src/lib/components/CustomButton/CustomButton.stories.ts (85%) rename libs/{ui-kit => ui-kit-vue}/src/lib/components/CustomButton/CustomButton.vue (100%) create mode 100644 libs/ui-kit-vue/src/lib/components/CustomButton/index.ts rename libs/{ui-kit => ui-kit-vue}/src/lib/components/Input/Input.stories.ts (82%) rename libs/{ui-kit => ui-kit-vue}/src/lib/components/Input/Input.vue (93%) create mode 100644 libs/ui-kit-vue/src/lib/components/Input/index.ts rename libs/{ui-kit => ui-kit-vue}/src/stories/Button/Button.stories.js (78%) rename libs/{ui-kit => ui-kit-vue}/src/stories/Button/Button.vue (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/Button/button.css (100%) create mode 100644 libs/ui-kit-vue/src/stories/Button/index.ts rename libs/{ui-kit => ui-kit-vue}/src/stories/Header/Header.stories.js (87%) rename libs/{ui-kit => ui-kit-vue}/src/stories/Header/Header.vue (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/Header/header.css (100%) create mode 100644 libs/ui-kit-vue/src/stories/Header/index.ts rename libs/{ui-kit => ui-kit-vue}/src/stories/Page/Page.stories.js (73%) rename libs/{ui-kit => ui-kit-vue}/src/stories/Page/Page.vue (100%) create mode 100644 libs/ui-kit-vue/src/stories/Page/index.ts rename libs/{ui-kit => ui-kit-vue}/src/stories/Page/page.css (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/code-brackets.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/colors.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/comments.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/direction.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/flow.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/plugin.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/repo.svg (100%) rename libs/{ui-kit => ui-kit-vue}/src/stories/assets/stackalt.svg (100%) rename libs/{ui-kit => ui-kit-vue}/tsconfig.json (100%) rename libs/{ui-kit => ui-kit-vue}/tsconfig.lib.json (100%) rename libs/{ui-kit => ui-kit-vue}/tsconfig.spec.json (100%) delete mode 100644 libs/ui-kit/.tailwind/postcss.config.js delete mode 100644 libs/ui-kit/README.md delete mode 100644 libs/ui-kit/jest.config.ts delete mode 100644 libs/ui-kit/src/index.ts delete mode 100644 libs/ui-kit/src/lib/components/CustomButton/index.ts delete mode 100644 libs/ui-kit/src/lib/components/Input/index.ts delete mode 100644 libs/ui-kit/src/stories/Button/index.ts delete mode 100644 libs/ui-kit/src/stories/Header/index.ts delete mode 100644 libs/ui-kit/src/stories/Page/index.ts diff --git a/.gitignore b/.gitignore index c7e94b6..ddae66a 100644 --- a/.gitignore +++ b/.gitignore @@ -37,7 +37,7 @@ testem.log # System Files .DS_Store Thumbs.db -/libs/ui-kit/storybook-static/ +/libs/ui-kit-vue/storybook-static/ apps/frontend-vue/.env infrastructure/.env .nx-cache @@ -47,4 +47,4 @@ apps/api/src/generated # Next.js .next -out \ No newline at end of file +out diff --git a/.tailwind/tailwind.theme.js b/.tailwind/tailwind.theme.js index 12f6881..ce53256 100644 --- a/.tailwind/tailwind.theme.js +++ b/.tailwind/tailwind.theme.js @@ -14,5 +14,6 @@ export const tailwindTheme = { 'primary-600': '#1C64F2', 'primary-700': '#1A56DB', 'primary-800': '#1E429F', + secondary: '#FFD04D', }, } diff --git a/README.md b/README.md index 6854ea1..9d77dc6 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,13 @@ apps/ - frontend-vue - vue -- frontend-react - react +- frontend-next - react - api - graphQL, postgress - api-mongo - node, mongoDB libs/ -- ui-kit +- ui-kit-vue infrastructure/ diff --git a/apps/frontend-vue/project.json b/apps/frontend-vue/project.json index e75f268..79a8ccc 100644 --- a/apps/frontend-vue/project.json +++ b/apps/frontend-vue/project.json @@ -6,7 +6,7 @@ "tags": [], "targets": { "build": { - "executor": "@nxext/vite:build", + "executor": "@nx/vite:build", "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { @@ -14,20 +14,10 @@ "baseHref": "/", "configFile": "apps/frontend-vue/vite.config.ts", "postcssConfig": "apps/frontend-vue/postcss.config.js" - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "apps/frontend-vue/src/environments/environment.ts", - "with": "apps/frontend-vue/src/environments/environment.prod.ts" - } - ] - } } }, "serve": { - "executor": "@nxext/vite:dev", + "executor": "@nx/vite:serve", "options": { "outputPath": "dist/apps/frontend-vue", "baseHref": "/", @@ -53,7 +43,7 @@ } }, "test": { - "executor": "@nxext/vitest:vitest", + "executor": "@nx/vite:vitest", "options": { "vitestConfig": "apps/frontend-vue/vitest.config.ts" } diff --git a/apps/frontend-vue/src/components/Register.vue b/apps/frontend-vue/src/components/Register.vue index 4ed53a1..7f9ad9f 100644 --- a/apps/frontend-vue/src/components/Register.vue +++ b/apps/frontend-vue/src/components/Register.vue @@ -1,6 +1,5 @@