Skip to content

Commit

Permalink
Merge pull request #222 from os2display/feature/redux
Browse files Browse the repository at this point in the history
Cleaned up redux build
  • Loading branch information
tuj authored Nov 9, 2023
2 parents facb1f4 + 90c3161 commit 189b9f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/redux/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 189b9f2

Please sign in to comment.