@zeniai/client-epic-state 5.0.66 → 5.0.67-beta0ND
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/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
- package/lib/entity/creditAgent/creditAgentState.d.ts +1 -1
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.d.ts +36 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.js +55 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.d.ts +6 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.js +27 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.d.ts +4 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.js +17 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.d.ts +51 -0
- package/lib/entity/scheduleActivityLog/scheduleActivityLogState.js +23 -0
- package/lib/epic.d.ts +11 -10
- package/lib/epic.js +12 -11
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogPayload.js +49 -0
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogReducer.js +23 -0
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogSelector.js +10 -0
- package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogState.js +19 -0
- package/lib/esm/epic.js +12 -11
- package/lib/esm/index.js +15 -13
- package/lib/esm/reducer.js +8 -2
- package/lib/esm/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +43 -0
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +1 -0
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +47 -0
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +33 -0
- package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewState.js +1 -0
- package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +4 -0
- package/lib/index.d.ts +17 -14
- package/lib/index.js +39 -34
- package/lib/reducer.d.ts +8 -2
- package/lib/reducer.js +8 -2
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.d.ts +9 -0
- package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +47 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.d.ts +8 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +2 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.d.ts +17 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +51 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.d.ts +8 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +36 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.d.ts +5 -0
- package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.js +2 -0
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +2 -1
- package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +4 -0
- package/package.json +28 -57
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateScheduleActivityLogs } from '../../entity/scheduleActivityLog/scheduleActivityLogReducer';
|
|
4
|
+
import { updateAllUsers } from '../../entity/user/userReducer';
|
|
5
|
+
import { RootState } from '../../reducer';
|
|
6
|
+
import { ZeniAPI } from '../../zeniAPI';
|
|
7
|
+
import { fetchScheduleActivityLog, updateScheduleActivityLogViewFetchStatus, updateScheduleActivityLogViewOnSuccess } from './scheduleActivityLogViewReducer';
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchScheduleActivityLog> | ReturnType<typeof updateScheduleActivityLogs> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateScheduleActivityLogViewOnSuccess> | ReturnType<typeof updateScheduleActivityLogViewFetchStatus>;
|
|
9
|
+
export declare const fetchScheduleActivityLogEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchScheduleActivityLogEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const scheduleActivityLogReducer_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogReducer");
|
|
7
|
+
const userReducer_1 = require("../../entity/user/userReducer");
|
|
8
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
9
|
+
const scheduleActivityLogViewReducer_1 = require("./scheduleActivityLogViewReducer");
|
|
10
|
+
const fetchScheduleActivityLogEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleActivityLogViewReducer_1.fetchScheduleActivityLog.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { scheduleId } = action.payload;
|
|
12
|
+
return zeniAPI
|
|
13
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${scheduleId}/activity`)
|
|
14
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
16
|
+
response.data != null &&
|
|
17
|
+
response.data.activity != null) {
|
|
18
|
+
const updateActions = [];
|
|
19
|
+
if (response.data.users != null &&
|
|
20
|
+
response.data.users.length > 0) {
|
|
21
|
+
updateActions.push((0, userReducer_1.updateAllUsers)({
|
|
22
|
+
users: response.data.users,
|
|
23
|
+
updateType: 'merge',
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
updateActions.push((0, scheduleActivityLogReducer_1.updateScheduleActivityLogs)(response.data.activity));
|
|
27
|
+
updateActions.push((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewOnSuccess)({
|
|
28
|
+
data: response.data.activity,
|
|
29
|
+
scheduleId,
|
|
30
|
+
}));
|
|
31
|
+
return (0, rxjs_1.from)(updateActions);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return (0, rxjs_1.of)((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewFetchStatus)({
|
|
35
|
+
fetchState: 'Error',
|
|
36
|
+
error: response.status,
|
|
37
|
+
scheduleId,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleActivityLogViewReducer_1.updateScheduleActivityLogViewFetchStatus)({
|
|
41
|
+
scheduleId,
|
|
42
|
+
fetchState: 'Error',
|
|
43
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'fetch schedule activity log REST API call errored out' +
|
|
44
|
+
JSON.stringify(error)),
|
|
45
|
+
}))));
|
|
46
|
+
}));
|
|
47
|
+
exports.fetchScheduleActivityLogEpic = fetchScheduleActivityLogEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScheduleActivityLogPayload } from '../../entity/scheduleActivityLog/scheduleActivityLogPayload';
|
|
2
|
+
import { UserPayload } from '../../entity/user/userPayload';
|
|
3
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
+
export interface FetchScheduleActivityLogPayload {
|
|
5
|
+
activity: ScheduleActivityLogPayload[];
|
|
6
|
+
users?: UserPayload[];
|
|
7
|
+
}
|
|
8
|
+
export type FetchScheduleActivityLogResponse = ZeniAPIResponse<FetchScheduleActivityLogPayload>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FetchState } from '../../commonStateTypes/common';
|
|
2
|
+
import { ScheduleActivityLogPayload } from '../../entity/scheduleActivityLog/scheduleActivityLogPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { ScheduleActivityLogViewState } from './scheduleActivityLogViewState';
|
|
5
|
+
export declare const initialState: ScheduleActivityLogViewState;
|
|
6
|
+
export declare const fetchScheduleActivityLog: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleId: string], {
|
|
7
|
+
scheduleId: string;
|
|
8
|
+
}, "scheduleActivityLogView/fetchScheduleActivityLog", never, never>, updateScheduleActivityLogViewOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
data: ScheduleActivityLogPayload[];
|
|
10
|
+
scheduleId: string;
|
|
11
|
+
}, "scheduleActivityLogView/updateScheduleActivityLogViewOnSuccess">, clearScheduleActivityLogView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"scheduleActivityLogView/clearScheduleActivityLogView">, updateScheduleActivityLogViewFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
+
fetchState: FetchState;
|
|
13
|
+
scheduleId: string;
|
|
14
|
+
error?: ZeniAPIStatus;
|
|
15
|
+
}, "scheduleActivityLogView/updateScheduleActivityLogViewFetchStatus">;
|
|
16
|
+
declare const _default: import("redux").Reducer<ScheduleActivityLogViewState>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.updateScheduleActivityLogViewFetchStatus = exports.clearScheduleActivityLogView = exports.updateScheduleActivityLogViewOnSuccess = exports.fetchScheduleActivityLog = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const scheduleActivityLogPayload_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogPayload");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
scheduleActivityLogIdsByScheduleId: {},
|
|
9
|
+
scheduleActivityLogFetchStateByScheduleId: {},
|
|
10
|
+
};
|
|
11
|
+
const scheduleActivityLogView = (0, toolkit_1.createSlice)({
|
|
12
|
+
name: 'scheduleActivityLogView',
|
|
13
|
+
initialState: exports.initialState,
|
|
14
|
+
reducers: {
|
|
15
|
+
fetchScheduleActivityLog: {
|
|
16
|
+
prepare(scheduleId) {
|
|
17
|
+
return {
|
|
18
|
+
payload: { scheduleId },
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
reducer(draft, action) {
|
|
22
|
+
const { scheduleId } = action.payload;
|
|
23
|
+
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
24
|
+
fetchState: 'In-Progress',
|
|
25
|
+
error: undefined,
|
|
26
|
+
};
|
|
27
|
+
draft.scheduleActivityLogIdsByScheduleId[scheduleId] = [];
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
updateScheduleActivityLogViewOnSuccess(draft, action) {
|
|
31
|
+
const { data, scheduleId } = action.payload;
|
|
32
|
+
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
33
|
+
fetchState: 'Completed',
|
|
34
|
+
error: undefined,
|
|
35
|
+
};
|
|
36
|
+
draft.scheduleActivityLogIdsByScheduleId[scheduleId] = data.map((scheduleActivityLog) => (0, scheduleActivityLogPayload_1.toScheduleActivityLogId)(scheduleActivityLog.correlation_id, scheduleActivityLog.event_type, scheduleActivityLog.data?.transaction?.line_id));
|
|
37
|
+
},
|
|
38
|
+
updateScheduleActivityLogViewFetchStatus(draft, action) {
|
|
39
|
+
const { fetchState, scheduleId, error } = action.payload;
|
|
40
|
+
draft.scheduleActivityLogFetchStateByScheduleId[scheduleId] = {
|
|
41
|
+
fetchState,
|
|
42
|
+
error,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
clearScheduleActivityLogView(draft) {
|
|
46
|
+
Object.assign(draft, exports.initialState);
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
_a = scheduleActivityLogView.actions, exports.fetchScheduleActivityLog = _a.fetchScheduleActivityLog, exports.updateScheduleActivityLogViewOnSuccess = _a.updateScheduleActivityLogViewOnSuccess, exports.clearScheduleActivityLogView = _a.clearScheduleActivityLogView, exports.updateScheduleActivityLogViewFetchStatus = _a.updateScheduleActivityLogViewFetchStatus;
|
|
51
|
+
exports.default = scheduleActivityLogView.reducer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { ScheduleActivityLog } from '../../entity/scheduleActivityLog/scheduleActivityLogState';
|
|
4
|
+
import { RootState } from '../../reducer';
|
|
5
|
+
export interface ScheduleActivityLogViewSelectorView extends SelectorView {
|
|
6
|
+
scheduleActivityLogs: ScheduleActivityLog[];
|
|
7
|
+
}
|
|
8
|
+
export declare const getScheduleActivityLogView: (state: RootState, scheduleId: ID) => ScheduleActivityLogViewSelectorView;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getScheduleActivityLogView = void 0;
|
|
4
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
+
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
6
|
+
const scheduleActivityLogSelector_1 = require("../../entity/scheduleActivityLog/scheduleActivityLogSelector");
|
|
7
|
+
exports.getScheduleActivityLogView = (0, toolkit_1.createSelector)((state) => state.scheduleActivityLogViewState, (state) => state.scheduleActivityLogState, (state) => state.userState, (_state, scheduleId) => scheduleId, (scheduleActivityLogViewState, scheduleActivityLogState, userState, scheduleId) => {
|
|
8
|
+
const fetchStateAndError = scheduleActivityLogViewState
|
|
9
|
+
.scheduleActivityLogFetchStateByScheduleId[scheduleId] ?? {
|
|
10
|
+
fetchState: 'Not-Started',
|
|
11
|
+
error: undefined,
|
|
12
|
+
};
|
|
13
|
+
const scheduleActivityLogIds = scheduleActivityLogViewState.scheduleActivityLogIdsByScheduleId[scheduleId] ?? [];
|
|
14
|
+
const rawLogs = (0, scheduleActivityLogSelector_1.getScheduleActivityLogsByIds)(scheduleActivityLogState, scheduleActivityLogIds);
|
|
15
|
+
const scheduleActivityLogs = rawLogs.map((log) => {
|
|
16
|
+
const userId = log.data?.transaction?.userId;
|
|
17
|
+
if (userId == null || log.data == null) {
|
|
18
|
+
return log;
|
|
19
|
+
}
|
|
20
|
+
const user = userState.userByUserId[userId];
|
|
21
|
+
if (user == null) {
|
|
22
|
+
return log;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...log,
|
|
26
|
+
data: {
|
|
27
|
+
...log.data,
|
|
28
|
+
user,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
...(0, reduceFetchState_1.reduceFetchState)([fetchStateAndError]),
|
|
34
|
+
scheduleActivityLogs,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../../../reducer';
|
|
4
4
|
import { fetchAccountList } from '../../../accountList/accountListReducer';
|
|
5
5
|
import { fetchClassList } from '../../../classList/classListReducer';
|
|
6
|
+
import { fetchScheduleActivityLog } from '../../../scheduleActivityLogView/scheduleActivityLogViewReducer';
|
|
6
7
|
import { fetchScheduleDetails, fetchScheduleDetailsPage } from '../scheduleDetailReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchScheduleDetailsPage>;
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchScheduleActivityLog> | ReturnType<typeof fetchScheduleDetailsPage>;
|
|
8
9
|
export declare const fetchScheduleDetailsPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -5,6 +5,7 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const accountListReducer_1 = require("../../../accountList/accountListReducer");
|
|
7
7
|
const classListReducer_1 = require("../../../classList/classListReducer");
|
|
8
|
+
const scheduleActivityLogViewReducer_1 = require("../../../scheduleActivityLogView/scheduleActivityLogViewReducer");
|
|
8
9
|
const scheduleListHelper_1 = require("../../scheduleListView/scheduleListHelper");
|
|
9
10
|
const scheduleDetailReducer_1 = require("../scheduleDetailReducer");
|
|
10
11
|
const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetailsPage.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -22,6 +23,9 @@ const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, ope
|
|
|
22
23
|
}
|
|
23
24
|
if (action.payload.selectedJeScheduleDetailId != null) {
|
|
24
25
|
scheduleDetailsActions.push((0, scheduleDetailReducer_1.fetchScheduleDetails)(action.payload.scheduleType, action.payload.selectedJeScheduleDetailId, action.payload.cacheOverride));
|
|
26
|
+
// Prefetch the schedule activity log alongside the detail page so the
|
|
27
|
+
// side panel renders instantly when the user taps the navbar icon.
|
|
28
|
+
scheduleDetailsActions.push((0, scheduleActivityLogViewReducer_1.fetchScheduleActivityLog)(action.payload.selectedJeScheduleDetailId));
|
|
25
29
|
}
|
|
26
30
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(scheduleDetailsActions));
|
|
27
31
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.67-beta0ND",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -33,34 +33,6 @@
|
|
|
33
33
|
"require": "./lib/view/*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"clean": "rimraf lib",
|
|
38
|
-
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
39
|
-
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
40
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
41
|
-
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
42
|
-
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
43
|
-
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
44
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
45
|
-
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
46
|
-
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
47
|
-
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
48
|
-
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
49
|
-
"check-version": "node ./scripts/check_version.js",
|
|
50
|
-
"prepublishOnly": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && pnpm update-slack-group-topic && pnpm run check-version && pnpm clean && pnpm build",
|
|
51
|
-
"version": "git add -A src",
|
|
52
|
-
"postversion": "git push && git push --tags",
|
|
53
|
-
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
54
|
-
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
55
|
-
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
56
|
-
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
57
|
-
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
58
|
-
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
59
|
-
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
60
|
-
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
61
|
-
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
62
|
-
"test:file": "scripts/test-file.sh"
|
|
63
|
-
},
|
|
64
36
|
"files": [
|
|
65
37
|
"lib/**/*"
|
|
66
38
|
],
|
|
@@ -131,32 +103,31 @@
|
|
|
131
103
|
"dayjs": "^1.10.7",
|
|
132
104
|
"url-parse": "^1.5.10"
|
|
133
105
|
},
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
106
|
+
"scripts": {
|
|
107
|
+
"clean": "rimraf lib",
|
|
108
|
+
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
109
|
+
"test": "pnpm test:typecheck && vitest run --typecheck",
|
|
110
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
|
111
|
+
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
112
|
+
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
113
|
+
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
114
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'Running ESLint...' && eslint . --ext .js,.jsx,.ts,.tsx\" \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
115
|
+
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
116
|
+
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
117
|
+
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
118
|
+
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
119
|
+
"check-version": "node ./scripts/check_version.js",
|
|
120
|
+
"version": "git add -A src",
|
|
121
|
+
"postversion": "git push && git push --tags",
|
|
122
|
+
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
123
|
+
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
124
|
+
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
125
|
+
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
126
|
+
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
127
|
+
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
128
|
+
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
129
|
+
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
130
|
+
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
131
|
+
"test:file": "scripts/test-file.sh"
|
|
161
132
|
}
|
|
162
|
-
}
|
|
133
|
+
}
|