@thepalaceproject/circulation-admin 1.34.3-post.6 → 1.34.3-post.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/package.json +3 -2
- package/webpack.dev-server.config.js +1 -1
package/README.md
CHANGED
|
@@ -83,11 +83,17 @@ Webpack will take care of compiling and updating any new changes made locally fo
|
|
|
83
83
|
|
|
84
84
|
This front-end may be run locally in development against a remote Circulation Manager back-end. This removes the need to build a local Circulation Manager from source in order to work on the front-end.
|
|
85
85
|
|
|
86
|
-
1.
|
|
86
|
+
1. Specify a back-end and start the dev server. You have two options:
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
- Create an `.env` or `.env.local` file in the root of the project and assign `BACKEND=https://gorgon.tpp-qa.lyrasistechnology.org`. Run `npm run dev-server`.
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Note: `dotenv -c` loads `.env.local` then `.env` in that order and will not overwrite variables set by the previous file.
|
|
91
|
+
|
|
92
|
+
- Run `npm run dev-server -- --env=backend=[url]` in this `circulation-admin` repository. Providing `--env=backend=` will override `.env` and `.env.local`.
|
|
93
|
+
|
|
94
|
+
Example: `npm run dev-server -- --env=backend=https://gorgon.tpp-qa.lyrasistechnology.org`
|
|
95
|
+
|
|
96
|
+
Note: The tortured syntax here results from going through npm and webpack. The first `--` separates arguments intended for npm from arguments intended for the script that npm runs. In this case the script executes webpack, which allows an environment object to be supplied on the command line using `--env`. Properties of the environment object are specified using the `--env=[property]=[value]` syntax.
|
|
91
97
|
|
|
92
98
|
1. Visit `http://localhost:8080/admin/`.
|
|
93
99
|
1. Log in using credentials for the CM back-end. Content from that Circulation Manager should appear.
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test-jest": "jest --verbose --roots tests/jest",
|
|
30
30
|
"test-jest-file": "jest --verbose",
|
|
31
31
|
"dev": "webpack --watch --progress --config webpack.dev.config",
|
|
32
|
-
"dev-server": "webpack serve --progress --hot --config webpack.dev-server.config",
|
|
32
|
+
"dev-server": "dotenv -c -- webpack serve --progress --hot --config webpack.dev-server.config",
|
|
33
33
|
"dev-test-axe": "TEST_AXE=true npm run dev",
|
|
34
34
|
"prod": "webpack --progress --config webpack.prod.config",
|
|
35
35
|
"build-docs": "typedoc --tsconfig tsconfig.json src"
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"colors-cli": "^1.0.27",
|
|
93
93
|
"copy-webpack-plugin": "6.4.0",
|
|
94
94
|
"css-loader": "^6.7.2",
|
|
95
|
+
"dotenv-cli": "^11.0.0",
|
|
95
96
|
"enzyme": "^3.11.0",
|
|
96
97
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
97
98
|
"eslint": "^7.0.0",
|
|
@@ -151,5 +152,5 @@
|
|
|
151
152
|
"*.{js,jsx,ts,tsx,css,md}": "prettier --write",
|
|
152
153
|
"*.{js,css,md}": "prettier --write"
|
|
153
154
|
},
|
|
154
|
-
"version": "1.34.3-post.
|
|
155
|
+
"version": "1.34.3-post.7"
|
|
155
156
|
}
|
|
@@ -36,7 +36,7 @@ const devAssetsPublicPath = "/webpack-dev-assets/";
|
|
|
36
36
|
* @returns The webpack configuration.
|
|
37
37
|
*/
|
|
38
38
|
module.exports = (env) => {
|
|
39
|
-
const
|
|
39
|
+
const backend = env?.backend ?? process.env.BACKEND;
|
|
40
40
|
|
|
41
41
|
if (!backend) {
|
|
42
42
|
console.error("Please specify the URL of a Circulation Manager back-end.");
|