Skip to content

Commit

Permalink
feat: use monorepo (Issue #157) (#616)
Browse files Browse the repository at this point in the history
Co-authored-by: Irina_Kartun <irina.kartun@gmail.com>
  • Loading branch information
mikitabut and irinakartun authored Feb 2, 2024
1 parent 8ea7553 commit 3f2e246
Show file tree
Hide file tree
Showing 496 changed files with 18,724 additions and 8,699 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ dist

.github
helm
__tests__
apps/chat-e2e/html-report
93 changes: 44 additions & 49 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,56 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic",
"prettier",
"plugin:tailwindcss/recommended",
"next/core-web-vitals"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "tailwindcss"],
"extends": ["eslint:recommended", "prettier"],
"plugins": ["@nx"],
"root": true,
"settings": {
"tailwindcss": {
"config": "./tailwind.config.js",
"callees": ["classnames", "classNames"]
}
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.*?.json"]
},
"rules": {
"react/jsx-boolean-value": ["error", "never"],
"no-empty": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-constant-condition": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"no-restricted-imports": ["error", { "paths": ["react-i18next"] }],
"tailwindcss/no-custom-classname": "error",
"tailwindcss/no-contradicting-classname": "error",
"no-restricted-globals": [
"error",
{
"name": "localStorage",
"message": "Use DataService instead."
},
{
"name": "sessionStorage",
"message": "Use DataService instead."
}
],
"no-multiple-empty-lines": ["warn", { "max": 1, "maxBOF": 0 }]
"env": {
"node": true
},
"overrides": [
{
"plugins": ["testing-library"],
"files": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
],
"no-empty": "warn",
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"no-constant-condition": "off",
"no-multiple-empty-lines": ["warn", { "max": 1, "maxBOF": 0 }]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:@nx/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic"
],
"extends": ["plugin:testing-library/react"],
"rules": {
"testing-library/await-async-queries": "error",
"testing-library/no-await-sync-queries": "error",
"testing-library/no-debugging-utils": "warn",
"testing-library/no-dom-import": "off"
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/no-explicit-any": "warn"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
}
16 changes: 10 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/test-results

# next.js
/.next/
.next
/out/
/dist

Expand Down Expand Up @@ -46,11 +46,15 @@ pnpm-lock.yaml
.vscode

# e2e
/e2e/test-results/
/e2e/allure-results/
/e2e/auth/
/e2e/html-report/
/e2e/src/testData/export/
/apps/chat-e2e/test-results/
/apps/chat-e2e/allure-results/
/apps/chat-e2e/auth/
/apps/chat-e2e/html-report/
/apps/chat-e2e/src/testData/export/

# coverage
*/coverage

# NX
.nx/cache
tmp
20 changes: 13 additions & 7 deletions .ort.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
---
excludes:
paths:
- pattern: "package-lock.json"
reason: "BUILD_TOOL_OF"
- pattern: 'package-lock.json'
reason: 'BUILD_TOOL_OF'
scopes:
- pattern: "devDependencies"
reason: "DEV_DEPENDENCY_OF"
comment: "Packages for development only."
- pattern: 'devDependencies'
reason: 'DEV_DEPENDENCY_OF'
comment: 'Packages for development only.'
license_choices:
repository_license_choices:
- given: "GPL-2.0-only OR MIT"
choice: "MIT"
- given: 'GPL-2.0-only OR MIT'
choice: 'MIT'
resolutions:
rule_violations:
- message: "No license information is available for dependency \
'NPM::union:0\\.5\\.0'\\."
reason: 'CANT_FIX_EXCEPTION'
comment: 'The dependency has MIT license in github repo'
7 changes: 5 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**/.hg
**/node_modules

.next
.next/
next.config.js
next-i18next.config.js
public
Expand All @@ -12,4 +12,7 @@ dist

.github
helm
__tests__

/coverage

/.nx/cache
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,27 @@ COPY /tools ./tools
COPY package*.json ./

# ---- Dependencies ----
FROM base AS dependencies
FROM base AS build_dependencies
RUN npm ci

# ---- Build ----
FROM dependencies AS build
FROM build_dependencies AS build
COPY . .
RUN npm run build

# ---- Only required dependencies ----
FROM build AS run_ependencies
WORKDIR /app/dist/apps/chat
COPY /tools /app/dist/apps/chat/tools
RUN npm i
RUN node tools/patch-nextjs.js

# ---- Production ----
FROM node:20-alpine AS production
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package*.json ./
COPY --from=build /app/next.config.js ./next.config.js
COPY --from=build /app/next-i18next.config.js ./next-i18next.config.js
COPY --from=build /app/startup.sh ./startup.sh
COPY --from=run_ependencies /app/dist/apps/chat ./
COPY --from=run_ependencies /app/startup.sh ./startup.sh

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
Expand Down
Loading

0 comments on commit 3f2e246

Please sign in to comment.