@thepalaceproject/circulation-admin 1.41.0-post.34 → 1.41.0-post.35
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/CLAUDE.md +2 -2
- package/README.md +1 -1
- package/eslint.config.mjs +3 -0
- package/package.json +6 -9
- package/tests/browser/commands/goHome.js +3 -4
- package/tests/jest/components/InventoryReportRequestModal.test.tsx +3 -3
- package/webpack.dev-server.config.js +1 -1
- package/webpack.dev.config.js +3 -3
- package/webpack.prod.config.js +4 -4
- package/tslint.json +0 -56
package/CLAUDE.md
CHANGED
|
@@ -14,7 +14,7 @@ Built on `@thepalaceproject/web-opds-client` which provides the base OPDS catalo
|
|
|
14
14
|
npm run dev # Watch build (for use with local Circulation Manager)
|
|
15
15
|
npm run dev-server -- --env=backend=https://your-cm-url # Dev server against remote backend
|
|
16
16
|
npm run prod # Production build
|
|
17
|
-
npm run lint # Run
|
|
17
|
+
npm run lint # Run ESLint (lint:js) + sass-lint
|
|
18
18
|
npm run lint:js # Run ESLint over the whole tree (eslint . --max-warnings 0)
|
|
19
19
|
npm test # Full test suite (mocha legacy + jest)
|
|
20
20
|
npm run test-jest # Jest tests only
|
|
@@ -71,7 +71,7 @@ The dev server can also read the backend URL from `.env` or `.env.local` with `B
|
|
|
71
71
|
## Code Style
|
|
72
72
|
|
|
73
73
|
- Prettier: double quotes, semicolons, trailing commas (es5), 80 char width
|
|
74
|
-
- ESLint (flat config, `eslint.config.mjs`) with `jsx-a11y/strict` — runs on the whole tree in CI via `npm run lint:js` (`eslint . --max-warnings 0`, so warnings fail the build) and on staged files via the husky pre-commit hook.
|
|
74
|
+
- ESLint (flat config, `eslint.config.mjs`) with `jsx-a11y/strict` — runs on the whole tree in CI via `npm run lint:js` (`eslint . --max-warnings 0`, so warnings fail the build) and on staged files via the husky pre-commit hook. `npm run lint` runs ESLint (`lint:js`) followed by sass-lint.
|
|
75
75
|
- `@typescript-eslint/no-explicit-any` is disabled (any is allowed)
|
|
76
76
|
- Prefer template literals over string concatenation for building strings with variables
|
|
77
77
|
- When an arrow function only passes its arguments through to another function with the same signature, pass the function directly instead of wrapping it (e.g., `onClick: this.handleClick` not `onClick: (e) => this.handleClick(e)`)
|
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ publish the release. The GitHub Actions workflow will automatically build, test,
|
|
|
118
118
|
|
|
119
119
|
## Accessibility
|
|
120
120
|
|
|
121
|
-
In order to develop user interfaces that are accessible to everyone, there are tools added to the workflow. Besides the
|
|
121
|
+
In order to develop user interfaces that are accessible to everyone, there are tools added to the workflow. Besides the ESLint `jsx-a11y` plugin, `react-axe` is also installed for local development. Using that module while running the app uses a lot of resources so it should be only when specifically testing for accessibility and not while actively developing new features or fixing bugs.
|
|
122
122
|
|
|
123
123
|
In order to run the app with `react-axe`, run `npm run dev-test-axe`. This will add a local global variable `process.env.TEST_AXE` (through webpack) that will trigger `react-axe` in `/src/index.tsx`. The output will be seen in the _browser's_ console terminal.
|
|
124
124
|
|
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
|
@@ -14,14 +14,13 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"prepublish": "npm run prod",
|
|
17
|
-
"lint": "
|
|
17
|
+
"lint": "npm run lint:js && sass-lint -c .sass-lint.yml -v -q",
|
|
18
18
|
"lint:js": "eslint . --max-warnings 0",
|
|
19
|
-
"test-js": "
|
|
20
|
-
"test-js-file": "
|
|
19
|
+
"test-js": "tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js",
|
|
20
|
+
"test-js-file": "tsc && cp -r src/stylesheets lib && cp -r src/images lib && mocha --require lib/testHelper.js",
|
|
21
21
|
"test-js-list": "mocha --require lib/testHelper.js lib/__tests__/*.js lib/**/__tests__/*.js lib/**/**/__tests__/*.js --reporter ./testReporter.js",
|
|
22
|
-
"test-ts": "
|
|
23
|
-
"test-file-ts": "
|
|
24
|
-
"test-file-ts-nolint": "mocha -r ts-node/register --require src/testHelper.ts",
|
|
22
|
+
"test-ts": "mocha -r ts-node/register --require src/testHelper.ts src/__tests__/*.ts* src/**/__tests__/*.ts* src/**/**/__tests__/*.ts*",
|
|
23
|
+
"test-file-ts": "mocha -r ts-node/register --require src/testHelper.ts",
|
|
25
24
|
"test": "npm run test-ts && npm run test-jest",
|
|
26
25
|
"test-file": "npm run test-file-ts",
|
|
27
26
|
"test-browser": "npm run test-chrome && npm run test-firefox",
|
|
@@ -134,8 +133,6 @@
|
|
|
134
133
|
"ts-jest": "^29.2.6",
|
|
135
134
|
"ts-loader": "^9.5.2",
|
|
136
135
|
"ts-node": "^10.9.2",
|
|
137
|
-
"tslint": "^6.1.3",
|
|
138
|
-
"tslint-react-a11y": "^1.1.0",
|
|
139
136
|
"typedoc": "^0.28.19",
|
|
140
137
|
"typescript": "^5.7.3",
|
|
141
138
|
"typescript-eslint": "^8.60.1",
|
|
@@ -155,5 +152,5 @@
|
|
|
155
152
|
"*.{js,jsx,ts,tsx,css,md}": "prettier --write",
|
|
156
153
|
"*.{js,css,md}": "prettier --write"
|
|
157
154
|
},
|
|
158
|
-
"version": "1.41.0-post.
|
|
155
|
+
"version": "1.41.0-post.35"
|
|
159
156
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
const bookSelector = ".lane-books li:first-child a";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @method goHome
|
|
5
5
|
* @api command
|
|
6
6
|
* @description This custom command navigates the user to the home page.
|
|
7
7
|
*/
|
|
8
|
-
exports.command = function() {
|
|
9
|
-
return this
|
|
10
|
-
.url(this.globals.homeUrl)
|
|
8
|
+
exports.command = function () {
|
|
9
|
+
return this.url(this.globals.homeUrl)
|
|
11
10
|
.waitForElementVisible(bookSelector, 5000)
|
|
12
11
|
.verify.noError();
|
|
13
12
|
};
|
|
@@ -88,7 +88,7 @@ describe("InventoryReportRequestModal", () => {
|
|
|
88
88
|
() => useReportInfo(show, API_ENDPOINT_PARAMS),
|
|
89
89
|
{ wrapper }
|
|
90
90
|
);
|
|
91
|
-
await waitFor(() => result.current.fetchStatus
|
|
91
|
+
await waitFor(() => result.current.fetchStatus === "idle");
|
|
92
92
|
const { isSuccess, isError, error, collections } = result.current;
|
|
93
93
|
|
|
94
94
|
expect(mock_info_api).toHaveBeenCalledWith(API_ENDPOINT_PARAMS);
|
|
@@ -107,7 +107,7 @@ describe("InventoryReportRequestModal", () => {
|
|
|
107
107
|
() => useReportInfo(show, API_ENDPOINT_PARAMS),
|
|
108
108
|
{ wrapper }
|
|
109
109
|
);
|
|
110
|
-
await waitFor(() => result.current.fetchStatus
|
|
110
|
+
await waitFor(() => result.current.fetchStatus === "idle");
|
|
111
111
|
const { isSuccess, isError, error, collections } = result.current;
|
|
112
112
|
|
|
113
113
|
expect(mock_info_api).not.toHaveBeenCalled();
|
|
@@ -127,7 +127,7 @@ describe("InventoryReportRequestModal", () => {
|
|
|
127
127
|
() => useReportInfo(show, API_ENDPOINT_PARAMS),
|
|
128
128
|
{ wrapper }
|
|
129
129
|
);
|
|
130
|
-
await waitFor(() => result.current.fetchStatus
|
|
130
|
+
await waitFor(() => result.current.fetchStatus === "idle");
|
|
131
131
|
const { isSuccess, isError, error, collections } = result.current;
|
|
132
132
|
|
|
133
133
|
expect(mock_info_api).toHaveBeenCalledWith(API_ENDPOINT_PARAMS);
|
|
@@ -85,7 +85,7 @@ module.exports = (env) => {
|
|
|
85
85
|
if (redirectParam) {
|
|
86
86
|
const redirectUrl = new URL(redirectParam);
|
|
87
87
|
|
|
88
|
-
if (redirectUrl.host
|
|
88
|
+
if (redirectUrl.host === backendUrl.host) {
|
|
89
89
|
redirectUrl.protocol = "http";
|
|
90
90
|
redirectUrl.host = requestHost;
|
|
91
91
|
|
package/webpack.dev.config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { merge } = require(
|
|
2
|
-
const common = require(
|
|
1
|
+
const { merge } = require("webpack-merge");
|
|
2
|
+
const common = require("./webpack.common.js");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const config = merge(common, {
|
|
5
5
|
mode: "development",
|
|
6
6
|
devtool: "eval-source-map",
|
|
7
7
|
});
|
package/webpack.prod.config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const { merge } = require(
|
|
2
|
-
const common = require(
|
|
1
|
+
const { merge } = require("webpack-merge");
|
|
2
|
+
const common = require("./webpack.common.js");
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
mode: "production"
|
|
4
|
+
const config = merge(common, {
|
|
5
|
+
mode: "production",
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
module.exports = config;
|
package/tslint.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["tslint-react-a11y"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"class-name": true,
|
|
5
|
-
"comment-format": [
|
|
6
|
-
true,
|
|
7
|
-
"check-space"
|
|
8
|
-
],
|
|
9
|
-
"indent": [
|
|
10
|
-
true,
|
|
11
|
-
"spaces"
|
|
12
|
-
],
|
|
13
|
-
"no-duplicate-variable": true,
|
|
14
|
-
"no-eval": true,
|
|
15
|
-
"no-internal-module": true,
|
|
16
|
-
"no-trailing-whitespace": true,
|
|
17
|
-
"no-var-keyword": true,
|
|
18
|
-
"one-line": [
|
|
19
|
-
true,
|
|
20
|
-
"check-open-brace",
|
|
21
|
-
"check-whitespace"
|
|
22
|
-
],
|
|
23
|
-
"quotemark": [
|
|
24
|
-
true,
|
|
25
|
-
"double",
|
|
26
|
-
"avoid-escape"
|
|
27
|
-
],
|
|
28
|
-
"semicolon": true,
|
|
29
|
-
"triple-equals": [
|
|
30
|
-
true,
|
|
31
|
-
"allow-null-check"
|
|
32
|
-
],
|
|
33
|
-
"typedef-whitespace": [
|
|
34
|
-
true,
|
|
35
|
-
{
|
|
36
|
-
"call-signature": "nospace",
|
|
37
|
-
"index-signature": "nospace",
|
|
38
|
-
"parameter": "nospace",
|
|
39
|
-
"property-declaration": "nospace",
|
|
40
|
-
"variable-declaration": "nospace"
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"variable-name": [
|
|
44
|
-
true,
|
|
45
|
-
"ban-keywords"
|
|
46
|
-
],
|
|
47
|
-
"whitespace": [
|
|
48
|
-
true,
|
|
49
|
-
"check-branch",
|
|
50
|
-
"check-decl",
|
|
51
|
-
"check-operator",
|
|
52
|
-
"check-separator",
|
|
53
|
-
"check-type"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|