Skip to content

Commit aed77e6

Browse files
author
Jose Tomas Hernandez Lopez
committed
build: merge from Nx-migration
2 parents 04ba506 + 1c42266 commit aed77e6

20 files changed

+1704
-2143
lines changed

package.json

+4-10
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,19 @@
1414
"prepare": "husky install"
1515
},
1616
"dependencies": {
17-
"@nestjs/cli": "^10.3.2",
18-
"@nestjs/jwt": "^10.2.0",
19-
"@nestjs/passport": "^10.0.3",
20-
"@nestjs/swagger": "^7.3.0",
21-
"@nestjs/typeorm": "^10.0.2",
17+
"@angular-devkit/schematics-cli": "^14.2.3",
18+
"@nestjs/cli": "^9.1.3",
2219
"@nx/devkit": "17.2.8",
2320
"@nx/plugin": "^17.2.8",
2421
"@swc/helpers": "~0.5.2",
25-
"bcrypt": "^5.1.1",
26-
"convict": "^6.2.4",
27-
"express": "^4.18.2",
22+
"fs-extra": "^11.2.0",
2823
"lodash": "^4.17.21",
2924
"passport-jwt": "^4.0.1",
3025
"prettier": "^2.8.8",
3126
"triple-beam": "^1.4.1",
3227
"tslib": "^2.6.2",
3328
"type-fest": "^4.10.2",
34-
"typescript": "^5.3.3",
35-
"winston": "^3.11.0"
29+
"typescript": "^5.3.3"
3630
},
3731
"devDependencies": {
3832
"@commitlint/cli": "^17.1.2",

packages/mailer/.eslintrc.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": ["../../.eslintrc.js"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": "error"
22+
}
23+
},
24+
{
25+
"files": ["./package.json"],
26+
"parser": "jsonc-eslint-parser",
27+
"rules": {
28+
"@nx/nx-plugin-checks": "error"
29+
}
30+
}
31+
]
32+
}

packages/mailer/README.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
# devon4ts_node
2-
3-
[devonfw](https://www.devonfw.com/) is a platform which provides solutions to building business applications which combine best-in-class frameworks and libraries as well as industry proven practices and code conventions. devonfw is 100% Open Source (Apache License version 2.0) since the beginning of 2018.
4-
5-
devon4ts_node is the NodeJS stack of devonfw. It allows you to build business applications (backends) using NodeJS technology in standardized way based on established best-practices.
6-
7-
![License](https://img.shields.io/npm/l/@devon4ts_node/mailer)
8-
![License](https://img.shields.io/npm/v/@devon4ts_node/mailer)
9-
![License](https://img.shields.io/librariesio/release/npm/@devon4ts_node/mailer)
10-
![License](https://img.shields.io/npm/dt/@devon4ts_node/mailer)
11-
12-
## devon4ts_node mailer
13-
14-
This package contains the devon4ts_node mailer module. This module allows you to send emails in your devon4ts_node application in a easy way.
15-
16-
## Documentation
17-
18-
You can find all documentation in our [wiki](https://github.com/devonfw/devon4ts_node/wiki).
19-
20-
## Code of conduct
21-
22-
Visit [code of conduct document](https://github.com/devonfw/.github/blob/master/CODE_OF_CONDUCT.md).
23-
24-
## Contributing guide
25-
26-
Visit [contributing guide document](https://github.com/devonfw/.github/blob/master/CONTRIBUTING.asciidoc).
27-
28-
## Key Principles
29-
30-
Visit [key principles document](https://github.com/devonfw/.github/blob/master/key-principles.asciidoc).
31-
32-
## Samples
33-
34-
- [Employee example](https://github.com/devonfw-sample/devon4ts_node-samples/tree/develop/employee): simple backend example for a employee management application.
35-
- [Components example](https://github.com/devonfw-sample/devon4ts_node/tree/develop/components-example): simple backend example which will show you the execution order of the devon4ts_node components.
36-
- [GraphQL example](https://github.com/devonfw-sample/devon4ts_node/tree/develop/graphql): simple GraphQL example with starter configuration.
37-
- [My Thai Star](https://github.com/devonfw/my-thai-star/tree/develop/node): realistic example about the management of a restaurant. This example has also a frontend and it is compatible with other devonfw stacks.
1+
# devon4ts_node
2+
3+
[devonfw](https://www.devonfw.com/) is a platform which provides solutions to building business applications which combine best-in-class frameworks and libraries as well as industry proven practices and code conventions. devonfw is 100% Open Source (Apache License version 2.0) since the beginning of 2018.
4+
5+
devon4ts_node is the NodeJS stack of devonfw. It allows you to build business applications (backends) using NodeJS technology in a standardized way based on established best-practices.
6+
7+
![License](https://img.shields.io/npm/l/@devon4ts_node/mailer)
8+
![License](https://img.shields.io/npm/v/@devon4ts_node/mailer)
9+
![License](https://img.shields.io/librariesio/release/npm/@devon4ts_node/mailer)
10+
![License](https://img.shields.io/npm/dt/@devon4ts_node/mailer)
11+
12+
## devon4ts_node mailer
13+
14+
This package contains the devon4ts_node mailer module. This module allows you to send emails in your devon4ts_node application in a easy way.
15+
16+
## Documentation
17+
18+
You can find all documentation in our [wiki](https://github.com/devonfw/devon4ts_node/wiki).
19+
20+
## Code of conduct
21+
22+
Visit [code of conduct document](https://github.com/devonfw/.github/blob/master/CODE_OF_CONDUCT.md).
23+
24+
## Contributing guide
25+
26+
Visit [contributing guide document](https://github.com/devonfw/.github/blob/master/CONTRIBUTING.asciidoc).
27+
28+
## Key Principles
29+
30+
Visit [key principles document](https://github.com/devonfw/.github/blob/master/key-principles.asciidoc).
31+
32+
## Samples
33+
34+
- [Employee example](https://devon.s2-eu.capgemini.com/gitlab/devonfw/devon4ts-samples/-/tree/master/apps/nest-employee): simple backend example for a employee management application.
35+
- [Components example](https://devon.s2-eu.capgemini.com/gitlab/devonfw/devon4ts-samples/-/tree/master/apps/nest-components): simple backend example which will show you the execution order of the devon4ts_node components.
36+
- [GraphQL example](https://devon.s2-eu.capgemini.com/gitlab/devonfw/devon4ts-samples/-/tree/master/apps/nest-graphql): simple GraphQL example with starter configuration.
37+
- [My Thai Star](https://devon.s2-eu.capgemini.com/gitlab/devonfw/my-thai-star/-/tree/develop/node): realistic example about the management of a restaurant. This example has also a frontend and it is compatible with other devonfw stacks.

packages/mailer/jest.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'mailer',
4+
preset: '../../jest.preset.js',
5+
transform: {
6+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
7+
},
8+
moduleFileExtensions: ['ts', 'js', 'html'],
9+
coverageDirectory: '../../coverage/packages/mailer',
10+
};

packages/mailer/package.json

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@devon4ts_node/mailer",
33
"version": "5.0.1",
4-
"description": "devon4ts_node module that allows you to send emails in a easy way.",
5-
"main": "dist/index.js",
4+
"description": "devon4ts_node module that allows you to send emails in an easy way.",
5+
"main": "./src/lib/index.js",
66
"scripts": {
77
"build": "rm -rf dist && tsc -p tsconfig.build.json",
88
"prepublish:npm": "npm run build",
@@ -27,15 +27,19 @@
2727
],
2828
"license": "Apache-2.0",
2929
"dependencies": {
30-
"fs-extra": "^10.1.0",
31-
"nodemailer": "^6.7.5"
30+
"fs-extra": "^11.2.0",
31+
"nodemailer": "^6.9.8",
32+
"tslib": "^2.6.2"
33+
},
34+
"devDependencies": {
35+
"@types/fs-extra": "^11.0.4"
3236
},
3337
"peerDependencies": {
34-
"@nestjs/common": "^9.0.0",
35-
"@nestjs/core": "^9.0.0",
36-
"handlebars": "^4.0.0",
37-
"reflect-metadata": "^0.1.13",
38-
"rxjs": "^7.0.0"
38+
"@nestjs/common": "^10.3.3",
39+
"@nestjs/core": "^10.3.3",
40+
"handlebars": "^4.7.8",
41+
"reflect-metadata": "^0.1.14",
42+
"rxjs": "^7.8.1"
3943
},
4044
"repository": {
4145
"type": "git",
@@ -62,5 +66,7 @@
6266
"coverageDirectory": "./coverage",
6367
"testEnvironment": "node"
6468
},
69+
"type": "commonjs",
70+
"typings": "./src/lib/index.d.ts",
6571
"gitHead": "1f351bcc0fbad70f9c25fa73a398a538ca0c8e55"
66-
}
72+
}

packages/mailer/project.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "mailer",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/mailer/src",
5+
"projectType": "library",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx/js:tsc",
9+
"outputs": ["{options.outputPath}"],
10+
"options": {
11+
"outputPath": "dist/packages/mailer",
12+
"main": "packages/mailer/src/lib/index.ts",
13+
"tsConfig": "packages/mailer/tsconfig.lib.json",
14+
"assets": [
15+
"packages/mailer/*.md",
16+
{
17+
"input": "./packages/mailer/src",
18+
"glob": "**/!(*.ts)",
19+
"output": "./src"
20+
},
21+
{
22+
"input": "./packages/mailer/src",
23+
"glob": "**/*.d.ts",
24+
"output": "./src"
25+
},
26+
{
27+
"input": "./packages/mailer",
28+
"glob": "generators.json",
29+
"output": "."
30+
},
31+
{
32+
"input": "./packages/mailer",
33+
"glob": "executors.json",
34+
"output": "."
35+
}
36+
]
37+
}
38+
},
39+
"lint": {
40+
"executor": "@nx/eslint:lint",
41+
"outputs": ["{options.outputFile}"]
42+
},
43+
"test": {
44+
"executor": "@nx/jest:jest",
45+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
46+
"options": {
47+
"jestConfig": "packages/mailer/jest.config.ts"
48+
}
49+
}
50+
},
51+
"tags": []
52+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/mailer/test/mailer.service.spec.ts packages/mailer/src/test/mailer.service.spec.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('MailerService', () => {
5555
const expected = { ...input, from: '[email protected]' };
5656

5757
service.sendPlainMail(input);
58-
expect(transporter.sendMail).toBeCalledWith(expected);
58+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
5959
});
6060

6161
it('should send a plain text email using the provided transporter providing all params', () => {
@@ -68,7 +68,7 @@ describe('MailerService', () => {
6868
const expected = { ...input, from: '[email protected]' };
6969

7070
service.sendPlainMail(input.to, input.subject, input.html);
71-
expect(transporter.sendMail).toBeCalledWith(expected);
71+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
7272
});
7373

7474
it('should send email from a handlebars template by using the provided transporter providing emailOptions object', () => {
@@ -99,7 +99,7 @@ describe('MailerService', () => {
9999
};
100100

101101
service.sendTemplateMail(input, 'test', { title: 'my title' });
102-
expect(transporter.sendMail).toBeCalledWith(expected);
102+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
103103
});
104104

105105
it('should register a template and should be ready to use', () => {
@@ -116,7 +116,7 @@ describe('MailerService', () => {
116116

117117
service.addTemplate('my-view', `My view`);
118118
service.sendTemplateMail(input, 'my-view', {});
119-
expect(transporter.sendMail).toBeCalledWith(expected);
119+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
120120
});
121121

122122
it('should register a partial and should be ready to use', () => {
@@ -134,7 +134,7 @@ describe('MailerService', () => {
134134
service.addTemplate('my-view', `{{#> my-partial }}My view{{/my-partial}}`);
135135
service.registerPartial('my-partial', `this is my partial: {{> @partial-block }}`);
136136
service.sendTemplateMail(input, 'my-view', {});
137-
expect(transporter.sendMail).toBeCalledWith(expected);
137+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
138138
});
139139

140140
it('should register a helper and should be ready to use', () => {
@@ -149,11 +149,11 @@ describe('MailerService', () => {
149149
html: `<b>My view</b>`,
150150
};
151151

152-
service.registerHelper('bold', function (options) {
152+
service.registerHelper('bold', options => {
153153
return '<b>' + options.fn(this) + '</b>';
154154
});
155155
service.addTemplate('my-view', `{{#bold}}My view{{/bold}}`);
156156
service.sendTemplateMail(input, 'my-view', {});
157-
expect(transporter.sendMail).toBeCalledWith(expected);
157+
expect(transporter.sendMail).toHaveBeenCalledWith(expected);
158158
});
159159
});

packages/mailer/tsconfig.build.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{
22
"compilerOptions": {
3-
"noImplicitThis": true,
3+
"noImplicitThis": true
44
},
55
"extends": "./tsconfig.json",
6-
"exclude": [
7-
"node_modules",
8-
"dist",
9-
"./**/*.spec.ts",
10-
"test"
11-
]
6+
"exclude": ["node_modules", "dist", "./**/*.spec.ts", "test"]
127
}

packages/mailer/tsconfig.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{
2-
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"noImplicitAny": false,
5-
"sourceMap": false,
6-
"outDir": "./dist",
7-
"baseUrl": "./",
8-
"incremental": false,
9-
"noImplicitThis": false,
10-
"types": [
11-
"node",
12-
"jest"
13-
]
14-
},
15-
"include": [
16-
"./lib/**/*",
17-
"./test/**/*"
18-
]
19-
}
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"noImplicitAny": true,
6+
"sourceMap": false,
7+
"noImplicitThis": false,
8+
"types": ["node", "jest"]
9+
},
10+
"include": ["./lib/**/*", "./test/**/*"],
11+
"references": [
12+
{
13+
"path": "./tsconfig.lib.json"
14+
},
15+
{
16+
"path": "./tsconfig.spec.json"
17+
}
18+
]
19+
}

packages/mailer/tsconfig.lib.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"declaration": true,
6+
"types": ["node"]
7+
},
8+
"include": ["src/**/*.ts"],
9+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
10+
}

packages/mailer/tsconfig.spec.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
9+
}

0 commit comments

Comments
 (0)