From 68bd074b6b47301837c011bbedcd337302393d1b Mon Sep 17 00:00:00 2001 From: Faris Demirovic Date: Thu, 28 Nov 2024 20:17:58 +0100 Subject: [PATCH] Fix docker compose --- package-lock.json | 112 +++++++++++++++++++--- packages/server/package.json | 5 +- packages/server/webpack/webpack.config.js | 17 +++- 3 files changed, 117 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63a20cf8..38df3db5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3164,6 +3164,19 @@ "react": ">=16.14.0" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@stylelint/postcss-css-in-js": { "version": "0.38.0", "resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.38.0.tgz", @@ -11312,6 +11325,19 @@ "tiny-inflate": "^1.0.0" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -11739,16 +11765,6 @@ "node": ">=18.0.0" } }, - "node_modules/webpack-node-externals": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz", - "integrity": "sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -12038,9 +12054,9 @@ "@types/ms": "0.7.34", "@types/node": "22.9.0", "@types/pdfmake": "0.2.9", + "copy-webpack-plugin": "^12.0.2", "ts-node": "10.9.2", - "ts-node-dev": "2.0.0", - "webpack-node-externals": "^3.0.0" + "ts-node-dev": "2.0.0" }, "engines": { "node": ">=22.10.0" @@ -12377,6 +12393,52 @@ "undici-types": "~6.19.8" } }, + "packages/server/node_modules/copy-webpack-plugin": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-12.0.2.tgz", + "integrity": "sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.1", + "globby": "^14.0.0", + "normalize-path": "^3.0.0", + "schema-utils": "^4.2.0", + "serialize-javascript": "^6.0.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "packages/server/node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/server/node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -12389,6 +12451,19 @@ "node": ">=0.10.0" } }, + "packages/server/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/server/node_modules/pdfmake": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/pdfmake/-/pdfmake-0.2.15.tgz", @@ -12421,6 +12496,19 @@ "@redis/time-series": "1.1.0" } }, + "packages/server/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/server/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/packages/server/package.json b/packages/server/package.json index a09b1c52..1fc91a8c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -8,7 +8,6 @@ "start": "ts-node-dev src/main/server.ts", "build": "webpack --config webpack/webpack.config.js", "lint": "eslint -c .eslintrc.js \"**/*.{ts,tsx}\"" - }, "engines": { "node": ">=22.10.0" @@ -32,8 +31,8 @@ "@types/ms": "0.7.34", "@types/node": "22.9.0", "@types/pdfmake": "0.2.9", + "copy-webpack-plugin": "^12.0.2", "ts-node": "10.9.2", - "ts-node-dev": "2.0.0", - "webpack-node-externals": "^3.0.0" + "ts-node-dev": "2.0.0" } } diff --git a/packages/server/webpack/webpack.config.js b/packages/server/webpack/webpack.config.js index 7d2578ac..0df81f0b 100644 --- a/packages/server/webpack/webpack.config.js +++ b/packages/server/webpack/webpack.config.js @@ -1,5 +1,5 @@ var path = require('path'); -const nodeExternals = require('webpack-node-externals'); +const CopyPlugin = require('copy-webpack-plugin'); module.exports = { entry: './src/main/server.ts', @@ -24,5 +24,18 @@ module.exports = { }, ], }, - externals: [nodeExternals()], + externals: { + canvas: 'commonjs ./canvas/canvas', + 'utf-8-validate': 'utf-8-validate', + }, + plugins: [ + new CopyPlugin({ + patterns: [ + { + from: '../../node_modules/canvas/build/Release/', + to: 'canvas', + }, + ], + }), + ], };