From e63f5265fc05b5e954decd8034661da34893151a Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Fri, 3 Nov 2023 13:41:50 +0100 Subject: [PATCH 1/2] Cleaned up redux build --- README.md | 9 +++------ src/redux/api/package.json | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c9b16d9c..087dfffa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OS2Display Admin -This is an admin for OS2Display. +This is an admin for OS2Display. This is based on create-react-app. See [https://github.com/os2display/display-docs/blob/main/admin.md](https://github.com/os2display/display-docs/blob/main/admin.md) for a description of the admin. @@ -51,14 +51,11 @@ specification with Redux Toolkit. To regenerate (when the API specification has changed): ```bash -docker-compose exec node bash -cd src/redux/api - # Action: Replace api.json with the new api.json OpenAPI specification # Install and run scripts to generate ned Redux Api slices. -npm install -npm start +docker compose exec node npm --prefix src/redux/api install +docker compose exec node npm --prefix src/redux/api start ``` ## Testing with cypress diff --git a/src/redux/api/package.json b/src/redux/api/package.json index 2877434f..f37d4f79 100644 --- a/src/redux/api/package.json +++ b/src/redux/api/package.json @@ -5,10 +5,10 @@ "main": "index.js", "scripts": { "generate": "npx @rtk-incubator/rtk-query-codegen-openapi --hooks api.json > api.generated.ts", - "replace1": "sed -i 's/import { fetchBaseQuery } from .*;/import extendedBaseQuery from \"..\\/dynamic-base-query\";/g' api.generated.ts", - "replace2": "sed -i 's/baseQuery: fetchBaseQuery.*,/baseQuery: extendedBaseQuery,/g' api.generated.ts", + "//": "# Therefore we replace into a temporary file which is then renamed to the original file", + "replace": "sed 's/import { fetchBaseQuery } from .*;/import extendedBaseQuery from \"..\\/dynamic-base-query\";/g;s/baseQuery: fetchBaseQuery.*,/baseQuery: extendedBaseQuery,/g' api.generated.ts > api.generated.ts.patched && mv api.generated.ts.patched api.generated.ts", "compile": "node_modules/typescript/bin/tsc api.generated.ts", - "start": "npm run generate && npm run replace1 && npm run replace2 && npm run compile" + "start": "npm run generate && npm run replace && npm run compile" }, "author": "ITKDev", "license": "ISC", From 90c3161bc1fd83f3dfab9c604c71e9c66f22e4b4 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:05:53 +0100 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c89baf3..8657ff44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#222](https://github.com/os2display/display-admin-client/pull/222) + - Fixed redux build. + ## [1.5.0] - 2023-10-26 - [#221](https://github.com/os2display/display-admin-client/pull/221)