Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(common): add common in 'mon-domifa' #3036

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ jobs:
- name: Set up Yarn cache
uses: c-hive/gha-yarn-cache@v2

- name: Install dependencies
run: |
yarn --immutable

- name: Install dependencies
run: yarn workspaces focus @domifa/portail-usagers

- name: Run front-end tests
- name: Build common dependencies
run: yarn workspace @domifa/common build

- name: Run "Mon DomiFa" tests
run: yarn workspace @domifa/portail-usagers test --coverage --detectOpenHandles --forceExit

- name: Archive code coverage
Expand All @@ -141,13 +140,21 @@ jobs:
with:
node-version: "16.19"

- name: Change TimeZone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Paris"

- name: Set up Yarn cache
uses: c-hive/gha-yarn-cache@v2

- name: Install dependencies
run: yarn workspaces focus @domifa/portail-admins

- name: Run front-end tests
- name: Build common dependencies
run: yarn workspace @domifa/common build

- name: Run "Portail Admin" tests
run: yarn workspace @domifa/portail-admins test --coverage --detectOpenHandles --forceExit

- name: Archive code coverage
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@babel/runtime": "^7.22.15",
"@babel/runtime": "^7.23.2",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@socialgouv/sre-secrets": "^1.14.5",
Expand Down
52 changes: 26 additions & 26 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@domifa/common": "workspace:^",
"@faker-js/faker": "^8.1.0",
"@faker-js/faker": "^8.2.0",
"@nestjs/axios": "^3.0.1",
"@nestjs/common": "^10.0.5",
"@nestjs/core": "^10.0.5",
Expand All @@ -47,17 +47,17 @@
"@nestjs/terminus": "^10.0.1",
"@nestjs/testing": "^10.0.5",
"@ntegral/nestjs-sentry": "^4.0.0",
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/core": "^1.17.0",
"@opentelemetry/instrumentation-express": "^0.33.0",
"@opentelemetry/instrumentation-http": "^0.44.0",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.0",
"@opentelemetry/instrumentation-net": "^0.32.0",
"@opentelemetry/instrumentation-pg": "^0.36.0",
"@opentelemetry/sdk-node": "^0.44.0",
"@opentelemetry/semantic-conventions": "^1.17.0",
"@sentry/node": "^7.76.0",
"@sentry/opentelemetry-node": "^7.76.0",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/core": "^1.18.1",
"@opentelemetry/instrumentation-express": "^0.33.2",
"@opentelemetry/instrumentation-http": "^0.45.1",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.2",
"@opentelemetry/instrumentation-net": "^0.32.2",
"@opentelemetry/instrumentation-pg": "^0.36.2",
"@opentelemetry/sdk-node": "^0.45.1",
"@opentelemetry/semantic-conventions": "^1.18.1",
"@sentry/node": "^7.79.0",
"@sentry/opentelemetry-node": "^7.79.0",
"@socialgouv/streaming-file-encryption": "^1.1.0",
"@types/source-map-support": "^0.5.4",
"axios": "^1.4.0",
Expand All @@ -83,14 +83,14 @@
"nodemailer": "^6.9.1",
"nunjucks": "^3.2.3",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"passport-jwt": "^4.0.1",
"pg": "^8.7.1",
"pino": "^8.7.0",
"pino-pretty": "^10.0.1",
"pino-std-serializers": "^6.1.0",
"pizzip": "^3.0.6",
"reflect-metadata": "^0.1.13",
"rimraf": "^5.0.0",
"rimraf": "^5.0.5",
"rxjs": "^7.6.0",
"sanitize-filename": "^1.6.3",
"sanitize-html": "^2.11.0",
Expand All @@ -102,23 +102,23 @@
"typeorm": "^0.3.17",
"uuid": "^9.0.1",
"xlsx": "^0.18.5",
"yup": "^0.32.9",
"yup": "^0.32.11",
"yup-phone": "^1.3.2"
},
"devDependencies": {
"@nestjs/cli": "^10.1.1",
"@socialgouv/eslint-config-typescript": "^1.131.0",
"@types/bcryptjs": "^2.4.5",
"@types/compression": "^1.7.4",
"@types/bcryptjs": "^2.4.6",
"@types/compression": "^1.7.5",
"@types/cron": "^2.0.1",
"@types/dotenv": "^8.2.0",
"@types/email-templates": "^10.0.2",
"@types/express": "4.17.20",
"@types/faker": "^6.6.8",
"@types/fs-extra": "^11.0.2",
"@types/geojson": "^7946.0.10",
"@types/jest": "^29.2.4",
"@types/lodash.isequal": "^4.5.6",
"@types/faker": "^6.6.9",
"@types/fs-extra": "^11.0.4",
"@types/geojson": "^7946.0.13",
"@types/jest": "^29.5.8",
"@types/lodash.isequal": "^4.5.8",
"@types/multer": "^1.4.6",
"@types/node": "^20.3.3",
"@types/node-pdftk": "^2.1.6",
Expand All @@ -134,10 +134,10 @@
"@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.50.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"lint-staged": "^15.0.0",
Expand All @@ -149,7 +149,7 @@
"ts-jest": "^29.1.1",
"ts-node": "10.9.1",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "4.9.5"
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Telephone } from "./../telephone/Telephone.type";
import { UsagerOptions } from "..";
import { AppEntity } from "../_core";
import {
UsagerRdv,
UsagerSexe,
UsagerLastInteraction,
UsagerAyantDroit,
UsagerDecision,
UsagerOptions,
UsagerTypeDom,
} from "..";
import { AppEntity } from "../_core";
import { UsagerRdv, UsagerSexe, UsagerLastInteraction } from "@domifa/common";
} from "@domifa/common";

export type PortailUsagerPublic = AppEntity & {
customRef: string; // valeur par défaut: 'ref'
Expand Down
7 changes: 4 additions & 3 deletions packages/backend/src/_common/model/usager/Usager.type.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { AppEntity } from "../_core/AppEntity.type";
import { UsagerAyantDroit } from "./UsagerAyantDroit.type";
import { UsagerDecision } from "./UsagerDecision.type";

import { UsagerImport } from "./UsagerImport.type";
import { UsagerNote } from "./UsagerNote.type";
import { UsagerOptions } from "./options/UsagerOptions.type";

import { UsagerTypeDom } from "./UsagerTypeDom.type";
import { Telephone } from "../telephone/Telephone.type";
import {
UsagerLastInteraction,
UsagerEntretien,
UsagerRdv,
UsagerSexe,
UsagerAyantDroit,
UsagerTypeDom,
UsagerDecision,
} from "@domifa/common";

export type Usager = AppEntity & {
Expand Down

This file was deleted.

29 changes: 0 additions & 29 deletions packages/backend/src/_common/model/usager/UsagerDecision.type.ts

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/backend/src/_common/model/usager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ export * from "./cerfa";
export * from "./history";
export * from "./options";
export * from "./Usager.type";
export * from "./UsagerAyantDroit.type";
export * from "./UsagerDecision.type";
export * from "./UsagerDoc.type";
export * from "./UsagerImport.type";
export * from "./UsagerLight.type";
export * from "./UsagerNote.type";
export * from "./UsagerTypeDom.type";

This file was deleted.

25 changes: 0 additions & 25 deletions packages/backend/src/_migrations/1699283083901-auto-migration.ts

This file was deleted.

29 changes: 0 additions & 29 deletions packages/backend/src/_migrations/1699283951968-auto-migration.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ import {
OneToOne,
Unique,
} from "typeorm";
import {
Usager,
UsagerOptions,
UsagerTypeDom,
Telephone,
UsagerAyantDroit,
UsagerDecision,
} from "../../../_common/model";
import { Usager, UsagerOptions, Telephone } from "../../../_common/model";

import { UsagerNote } from "../../../_common/model/usager/UsagerNote.type";
import { StructureTable } from "../structure/StructureTable.typeorm";
Expand All @@ -28,6 +21,9 @@ import {
UsagerRdv,
UsagerSexe,
UsagerLastInteraction,
UsagerTypeDom,
UsagerAyantDroit,
UsagerDecision,
} from "@domifa/common";

// https://typeorm.io/#/entities/column-types-for-postgres
Expand Down
Loading
Loading