From f32feacca4d089075b1cf17a602d5c57ce9e6276 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 16 Feb 2023 14:25:42 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BD=20Updated=20build=20co?= =?UTF-8?q?mmand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html => index.html | 1 + package.json | 5 +++-- src/client/constants/endpoints.ts | 20 ++++++++++---------- tsconfig.json | 23 ++++++++++++----------- vite.config.js | 4 +++- yarn.lock | 9 +++++++++ 6 files changed, 38 insertions(+), 24 deletions(-) rename public/index.html => index.html (81%) diff --git a/public/index.html b/index.html similarity index 81% rename from public/index.html rename to index.html index 41a2653..43c6261 100644 --- a/public/index.html +++ b/index.html @@ -10,6 +10,7 @@
+ \ No newline at end of file diff --git a/package.json b/package.json index a23d1ca..dd1b45b 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "main": "server/index.js", "typings": "server/index.js", "scripts": { - "build": "webpack --mode production", + "build": "vite build", "start": "npm run build && npm run server", - "client": "vite serve public/", + "client": "vite", "server": "tsc -p tsconfig.server.json && node server/", "dev": "concurrently \"nodemon\" \"npm run client\"", "server-dev": "nodemon", @@ -154,6 +154,7 @@ "prettier": "^2.2.1", "react-refresh": "^0.14.0", "rimraf": "^3.0.2", + "sass": "^1.58.1", "source-map-loader": "^0.2.4", "string-similarity": "^4.0.4", "tslint": "^6.1.3", diff --git a/src/client/constants/endpoints.ts b/src/client/constants/endpoints.ts index 34aef8c..4e52efc 100644 --- a/src/client/constants/endpoints.ts +++ b/src/client/constants/endpoints.ts @@ -11,68 +11,68 @@ export const hostURIBuilder = (options: Record): string => { export const CORS_PROXY_SERVER_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "8050", apiPath: "/", }); export const COMICVINE_SERVICE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3080", apiPath: "/api/comicvine", }); export const METRON_SERVICE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3080", apiPath: "/api/metron", }); export const API_BASE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "8050", apiPath: "/api", }); export const LIBRARY_SERVICE_HOST = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3000", apiPath: ``, }); export const LIBRARY_SERVICE_BASE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3000", apiPath: "/api/library", }); export const SEARCH_SERVICE_BASE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3000", apiPath: "/api/search", }); export const SETTINGS_SERVICE_BASE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3000", apiPath: "/api/settings", }); export const IMAGETRANSFORMATION_SERVICE_BASE_URI = hostURIBuilder({ protocol: "http", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3000", apiPath: "/api/imagetransformation", }); export const SOCKET_BASE_URI = hostURIBuilder({ protocol: "ws", - host: process.env.UNDERLYING_HOSTNAME || "localhost", + host: import.meta.env.UNDERLYING_HOSTNAME || "localhost", port: "3001", apiPath: `/`, }); diff --git a/tsconfig.json b/tsconfig.json index 0af8855..38da14a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,20 +2,21 @@ "extends": "@tsconfig/node14/tsconfig.json", "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "allowSyntheticDefaultImports": true, - "noImplicitAny": false, - "target": "es2019", - "jsx": "react", - "module": "commonjs", - "sourceMap": true, - "outDir": "./dist/", + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", "resolveJsonModule": true, - "lib": ["dom", "dom.iterable", "esnext", "webworker"], - "baseUrl": ".", - "esModuleInterop": true, "isolatedModules": true, - "strict": true + "noEmit": true, + "jsx": "react-jsx" }, "settings": { "eslint.workingDirectories": [ diff --git a/vite.config.js b/vite.config.js index cdb383e..b50e60f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,9 @@ import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite'; export default defineConfig({ - publicDir: './public', + // publicDir: './public', + build: "esnext", plugins: [ // … react({ diff --git a/yarn.lock b/yarn.lock index 6d17872..80d230c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16094,6 +16094,15 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" +sass@^1.58.1: + version "1.58.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.58.1.tgz#17ab0390076a50578ed0733f1cc45429e03405f6" + integrity sha512-bnINi6nPXbP1XNRaranMFEBZWUfdW/AF16Ql5+ypRxfTvCRTTKrLsMIakyDcayUt2t/RZotmL4kgJwNH5xO+bg== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + sax@>=0.6.0: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"