From e01955cfede1c1a588e98e958aff9a419b4bd89a Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Mon, 30 Sep 2024 12:20:10 +0100 Subject: [PATCH] fix: api docker container for mac users --- api/package-lock.json | 134 ++++++++++++++++++++++++++++++++++++++-- api/package.json | 4 ++ api/test/setup-tests.ts | 8 +++ 3 files changed, 140 insertions(+), 6 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index 3dadb36..03513ae 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -22,6 +22,7 @@ "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^10.0.0", "@nestjs/platform-socket.io": "^10.3.7", + "@nestjs/swagger": "^7.2.0", "@nestjs/websockets": "^10.3.7", "@resvg/resvg-js": "^2.6.2", "@tekuconcept/nestjs-csrf": "^1.1.0", @@ -59,7 +60,6 @@ "@compodoc/compodoc": "^1.1.24", "@nestjs/cli": "^10.0.0", "@nestjs/schematics": "^10.0.0", - "@nestjs/swagger": "^7.2.0", "@nestjs/testing": "^10.0.0", "@types/bcryptjs": "^2.4.6", "@types/cookie-parser": "^1.4.6", @@ -101,6 +101,10 @@ "tsconfig-paths": "^4.2.0", "tsconfig-paths-jest": "^0.0.1", "typescript": "^5.1.3" + }, + "optionalDependencies": { + "@css-inline/css-inline-linux-arm64-musl": "^0.14.1", + "@resvg/resvg-js-linux-arm64-musl": "^2.6.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3329,6 +3333,81 @@ "@css-inline/css-inline-win32-x64-msvc": "0.13.0" } }, + "node_modules/@css-inline/css-inline-darwin-arm64": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-darwin-arm64/-/css-inline-darwin-arm64-0.13.0.tgz", + "integrity": "sha512-A4QvlZdhp8v+3IHKF/UftRf5GrAVUMEHCGRuk2Dx594xn/UR4ieh+B70aMm5rfONh2hv5mlR9UcoYAkVpEQ99g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@css-inline/css-inline-darwin-x64": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-darwin-x64/-/css-inline-darwin-x64-0.13.0.tgz", + "integrity": "sha512-px9z4ypzeECMyBEtlrNzTMpA1tnw5MmMIiMkBRhb8UGRr2pOBZY3yd/eEIxWzVVSPt0aIjVDwUOJ3+d0Z+BskA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@css-inline/css-inline-linux-arm-gnueabihf": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm-gnueabihf/-/css-inline-linux-arm-gnueabihf-0.13.0.tgz", + "integrity": "sha512-+uo0coLQNgk/AKeOB8mXSRd8VIlUg38zRSB9B9q0ior9oBCDPtEdn1HuCSvWxHoOSJ8QNNk+uwbz0zW4CETzFw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@css-inline/css-inline-linux-arm64-gnu": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm64-gnu/-/css-inline-linux-arm64-gnu-0.13.0.tgz", + "integrity": "sha512-GVrsFbY5l0Hxyzxsm5S5JPGObvHm/Ybf2wZgnWBsQigxqGtr1FL535HaTwEnq6aHOpH3f08gR5Vx33gB7jG4pw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@css-inline/css-inline-linux-arm64-musl": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm64-musl/-/css-inline-linux-arm64-musl-0.14.1.tgz", + "integrity": "sha512-FzknI+st8eA8YQSdEJU9ykcM0LZjjigBuynVF5/p7hiMm9OMP8aNhWbhZ8LKJpKbZrQsxSGS4g9Vnr6n6FiSdQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@css-inline/css-inline-linux-x64-gnu": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-x64-gnu/-/css-inline-linux-x64-gnu-0.13.0.tgz", @@ -3359,6 +3438,36 @@ "node": ">= 10" } }, + "node_modules/@css-inline/css-inline-win32-x64-msvc": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-win32-x64-msvc/-/css-inline-win32-x64-msvc-0.13.0.tgz", + "integrity": "sha512-6VFhFSXp4FH+NzJhLd6fFi7jKCPvIRW+vq0tV+CPuiQ3zPzMfC9nIk8sB/1VJR8EcvBAjMV53YnacuDjRFRT9g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@css-inline/css-inline/node_modules/@css-inline/css-inline-linux-arm64-musl": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@css-inline/css-inline-linux-arm64-musl/-/css-inline-linux-arm64-musl-0.13.0.tgz", + "integrity": "sha512-V5h5+CRnE01EgoafI/kyjEcM8zvN+sKLnp17Aq9LqQfsut7mO3i72d8g/xeVC37DCLoGQFLvDCzbze2NbF2dIQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -4109,8 +4218,7 @@ "node_modules/@microsoft/tsdoc": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.0.tgz", - "integrity": "sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==", - "dev": true + "integrity": "sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==" }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.8", @@ -4703,7 +4811,6 @@ "version": "7.4.2", "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.4.2.tgz", "integrity": "sha512-Mu6TEn1M/owIvAx2B4DUQObQXqo2028R2s9rSZ/hJEgBK95+doTwS0DjmVA2wTeZTyVtXOoN7CsoM5pONBzvKQ==", - "dev": true, "dependencies": { "@microsoft/tsdoc": "^0.15.0", "@nestjs/mapped-types": "2.0.5", @@ -4884,6 +4991,21 @@ "@resvg/resvg-js-win32-x64-msvc": "2.6.2" } }, + "node_modules/@resvg/resvg-js-linux-arm64-musl": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-arm64-musl/-/resvg-js-linux-arm64-musl-2.6.2.tgz", + "integrity": "sha512-3h3dLPWNgSsD4lQBJPb4f+kvdOSJHa5PjTYVsWHxLUzH4IFTJUAnmuWpw4KqyQ3NA5QCyhw4TWgxk3jRkQxEKg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@resvg/resvg-js-linux-x64-gnu": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-x64-gnu/-/resvg-js-linux-x64-gnu-2.6.2.tgz", @@ -17531,8 +17653,7 @@ "node_modules/swagger-ui-dist": { "version": "5.17.14", "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.17.14.tgz", - "integrity": "sha512-CVbSfaLpstV65OnSjbXfVd6Sta3q3F7Cj/yYuvHMp1P90LztOLs6PfUnKEVAeiIVQt9u2SaPwv0LiH/OyMjHRw==", - "dev": true + "integrity": "sha512-CVbSfaLpstV65OnSjbXfVd6Sta3q3F7Cj/yYuvHMp1P90LztOLs6PfUnKEVAeiIVQt9u2SaPwv0LiH/OyMjHRw==" }, "node_modules/symbol-observable": { "version": "4.0.0", @@ -18192,6 +18313,7 @@ "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" diff --git a/api/package.json b/api/package.json index 7b0ca83..be94c93 100644 --- a/api/package.json +++ b/api/package.json @@ -125,6 +125,10 @@ "tsconfig-paths-jest": "^0.0.1", "typescript": "^5.1.3" }, + "optionalDependencies": { + "@css-inline/css-inline-linux-arm64-musl": "^0.14.1", + "@resvg/resvg-js-linux-arm64-musl": "^2.6.2" + }, "overrides": { "mjml": "5.0.0-alpha.4" }, diff --git a/api/test/setup-tests.ts b/api/test/setup-tests.ts index a8956b3..4eee1ce 100644 --- a/api/test/setup-tests.ts +++ b/api/test/setup-tests.ts @@ -23,3 +23,11 @@ jest.mock('connect-mongo', () => ({ }), })), })); + +jest.mock('@resvg/resvg-js', () => { + return { + Resvg: jest.fn().mockImplementation(() => ({ + render: jest.fn().mockReturnValue({ asPng: jest.fn() }), + })), + }; +});