Skip to content

Commit

Permalink
Use react-app-rewired and react-app-rewire-alias for DevX
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Holinshead committed Jan 18, 2024
1 parent 5d05d3e commit 0bd50b3
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 138 deletions.
1 change: 1 addition & 0 deletions python/src/aiconfig/editor/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@types/",
"build/",
"node_modules/",
"config-overrides.js",
"public/",
"postbuild.js"
]
Expand Down
5 changes: 5 additions & 0 deletions python/src/aiconfig/editor/client/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { alias, configPaths } = require("react-app-rewire-alias");

const aliasMap = configPaths("./tsconfig.paths.json");

module.exports = alias(aliasMap);
8 changes: 5 additions & 3 deletions python/src/aiconfig/editor/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"postbuild": "node postbuild.js",
"test": "react-scripts test",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"lint": "eslint . --max-warnings=0"
},
Expand Down Expand Up @@ -45,6 +45,8 @@
"eslint": "^8",
"eslint-config-next": "14.0.2",
"eslint-plugin-react-hooks": "^4.6.0",
"react-app-rewire-alias": "^1.1.7",
"react-app-rewired": "^2.2.1",
"typescript": "^5"
}
}
1 change: 1 addition & 0 deletions python/src/aiconfig/editor/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "./tsconfig.paths.json",
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
Expand Down
8 changes: 8 additions & 0 deletions python/src/aiconfig/editor/client/tsconfig.paths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"aiconfig-editor/*": ["aiconfig-editor/src/*"]
}
}
}
17 changes: 17 additions & 0 deletions python/src/aiconfig/editor/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9332,6 +9332,18 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"

react-app-rewire-alias@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/react-app-rewire-alias/-/react-app-rewire-alias-1.1.7.tgz#c308a1cb5337cfdda92a60f6f157093c5237df5b"
integrity sha512-vn4xU3E/wzh2/fGxda9ZQ6CtW2XdZB/WxAgNOdNPyUcX3hA3mh+kCRGwo19gSjzeTPpoZQwZRblHabLr6mwOTw==

react-app-rewired@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-2.2.1.tgz#84901ee1e3f26add0377ebec0b41bcdfce9fc211"
integrity sha512-uFQWTErXeLDrMzOJHKp0h8P1z0LV9HzPGsJ6adOtGlA/B9WfT6Shh4j2tLTTGlXOfiVx6w6iWpp7SOC5pvk+gA==
dependencies:
semver "^5.6.0"

react-dev-utils@^12.0.1:
version "12.0.1"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-12.0.1.tgz#ba92edb4a1f379bd46ccd6bcd4e7bc398df33e73"
Expand Down Expand Up @@ -9953,6 +9965,11 @@ selfsigned@^2.1.1:
"@types/node-forge" "^1.3.0"
node-forge "^1"

semver@^5.6.0:
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==

semver@^6.0.0, semver@^6.3.0, semver@^6.3.1:
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
Expand Down
6 changes: 3 additions & 3 deletions python/src/aiconfig/editor/server/static/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"files": {
"main.js": "/static/js/main.975ff801.js",
"main.js": "/static/js/main.19541bdf.js",
"index.html": "/index.html",
"main.975ff801.js.map": "/static/js/main.975ff801.js.map"
"main.19541bdf.js.map": "/static/js/main.19541bdf.js.map"
},
"entrypoints": [
"static/js/main.975ff801.js"
"static/js/main.19541bdf.js"
]
}
2 changes: 1 addition & 1 deletion python/src/aiconfig/editor/server/static/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>AIConfig Editor</title><script defer="defer" src="/static/js/main.975ff801.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>AIConfig Editor</title><script defer="defer" src="/static/js/main.19541bdf.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

0 comments on commit 0bd50b3

Please sign in to comment.