Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): use the lodash-es dependency #2678

Merged
merged 8 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 23 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
"@typed-mxgraph/typed-mxgraph": "~1.0.7",
"entities": "~4.3.1",
"fast-xml-parser": "4.2.2",
"lodash.debounce": "~4.0.8",
"lodash.throttle": "~4.1.1",
"lodash-es": "~4.17.21",
"mxgraph": "4.2.2",
"strnum": "1.0.5"
},
Expand All @@ -108,8 +107,7 @@
"@rollup/plugin-terser": "~0.4.3",
"@types/debug": "~4.1.7",
"@types/jest-image-snapshot": "~6.1.0",
"@types/lodash.debounce": "~4.0.7",
"@types/lodash.throttle": "~4.1.7",
"@types/lodash-es": "~4.17.7",
"@types/minimist": "~1.2.2",
"@typescript-eslint/eslint-plugin": "~5.59.6",
"@typescript-eslint/parser": "~5.59.6",
Expand Down
3 changes: 1 addition & 2 deletions src/component/mxgraph/BpmnGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ limitations under the License.
import type { FitOptions, ZoomConfiguration } from '../options';
import { FitType } from '../options';
import { ensurePositiveValue, ensureValidZoomConfiguration } from '../helpers/validators';
import debounce from 'lodash.debounce';
import throttle from 'lodash.throttle';
import { debounce, throttle } from 'lodash-es';
import { mxgraph } from './initializer';
import type { mxCellState, mxGraphView, mxPoint } from 'mxgraph';

Expand Down
9 changes: 8 additions & 1 deletion test/integration/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ module.exports = {
},
],
},
moduleNameMapper,
moduleNameMapper: {
...moduleNameMapper,
// Hack to use lodash instead of lodash-es in integration tests.
// This is only to resolve the import, otherwise Jest fails to parse the lodash-es files.
// For more details, see https://github.com/process-analytics/bpmn-visualization-js/pull/2678
// The lodash code is not called in integration tests, so changing the lodash implementation in used in not an issue.
'^lodash-es$': 'lodash',
},
collectCoverageFrom: ['src/**/*.{ts,js}'],
coveragePathIgnorePatterns: ['/src/model/'],
coverageReporters: ['lcov', 'text-summary'],
Expand Down
4 changes: 2 additions & 2 deletions test/unit/component/mxgraph/overlay/OverlayConverter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ limitations under the License.

import { OverlayConverter } from '@lib/component/mxgraph/overlay/OverlayConverter';
import type { MxGraphCustomOverlayPosition } from '@lib/component/mxgraph/overlay/custom-overlay';
import type { Overlay, OverlayPosition } from '@lib/bpmn-visualization';
import { StyleDefault } from '@lib/bpmn-visualization';
import { StyleDefault } from '@lib/component/mxgraph/style';
import type { Overlay, OverlayPosition } from '@lib/component/registry/types';

describe('overlay converter', () => {
const overlayConverter = new OverlayConverter();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/component/mxgraph/renderer/StyleComputer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import ShapeBpmnElement, {
ShapeBpmnStartEvent,
ShapeBpmnSubProcess,
} from '@lib/model/bpmn/internal/shape/ShapeBpmnElement';
import type { BpmnEventKind, GlobalTaskKind } from '@lib/bpmn-visualization';
import type { BpmnEventKind, GlobalTaskKind } from '@lib/model/bpmn/internal';
import {
AssociationDirectionKind,
MessageVisibleKind,
Expand All @@ -39,7 +39,7 @@ import {
ShapeBpmnEventDefinitionKind,
ShapeBpmnMarkerKind,
ShapeBpmnSubProcessKind,
} from '@lib/bpmn-visualization';
} from '@lib/model/bpmn/internal';
import Label, { Font } from '@lib/model/bpmn/internal/Label';
import { Edge } from '@lib/model/bpmn/internal/edge/edge';
import { AssociationFlow, MessageFlow, SequenceFlow } from '@lib/model/bpmn/internal/edge/flows';
Expand Down