Skip to content

Commit 48f3a26

Browse files
Merge pull request #15 from hypertrace/lodash-es
refactor: use lodash modules
2 parents 6a4df71 + 96fe58e commit 48f3a26

30 files changed

+56
-51
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting Started
22

3-
[![CircleCI](https://circleci.com/gh/hypertrace/hyperdash.svg?style=svg)](https://circleci.com/gh/hypertrace/hyperdash)
3+
[![CircleCI](https://circleci.com/gh/hypertrace/hyperdash.svg?style=shield)](https://circleci.com/gh/hypertrace/hyperdash)
44
[![codecov](https://codecov.io/gh/hypertrace/hyperdash/branch/master/graph/badge.svg)](https://codecov.io/gh/hypertrace/hyperdash)
55

66
## Prerequisites

package-lock.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"ts",
3838
"js"
3939
],
40+
"moduleNameMapper": {
41+
"^lodash-es$": "lodash"
42+
},
4043
"coveragePathIgnorePatterns": [
4144
"/node_modules/",
4245
"/test/"
@@ -89,7 +92,7 @@
8992
"@rollup/plugin-node-resolve": "^8.1.0",
9093
"@rollup/plugin-typescript": "^5.0.1",
9194
"@types/jest": "^26.0.3",
92-
"@types/lodash": "^4.14.157",
95+
"@types/lodash-es": "^4.17.3",
9396
"@types/node": "^14.0.14",
9497
"commitizen": "^4.1.2",
9598
"core-js": "3.6.5",
@@ -99,10 +102,11 @@
99102
"jest-config": "^26.1.0",
100103
"jest-html-reporter": "^3.1.3",
101104
"jest-junit": "^11.0.1",
105+
"lodash": "^4.17.15",
102106
"prettier": "^2.0.5",
103107
"pretty-quick": "^2.0.1",
104108
"rimraf": "^3.0.2",
105-
"rollup": "^2.19.0",
109+
"rollup": "^2.21.0",
106110
"rollup-plugin-commonjs": "^10.1.0",
107111
"rollup-plugin-sourcemaps": "^0.6.2",
108112
"rollup-plugin-typescript2": "^0.27.1",
@@ -115,7 +119,7 @@
115119
"typescript": "^3.9.6"
116120
},
117121
"dependencies": {
118-
"lodash": "^4.17.15"
122+
"lodash-es": "^4.17.15"
119123
},
120124
"peerDependencies": {
121125
"rxjs": "^6.5.5",

rollup.config.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// tslint:disable
2-
import { camelCase } from 'lodash';
32
import commonjs from 'rollup-plugin-commonjs';
43
import json from '@rollup/plugin-json';
54
import resolve from '@rollup/plugin-node-resolve';
@@ -12,22 +11,9 @@ const libraryName = 'hyperdash';
1211

1312
export default {
1413
input: `src/${libraryName}.ts`,
15-
output: [
16-
{
17-
file: pkg.main,
18-
name: camelCase(libraryName),
19-
format: 'umd',
20-
sourcemap: true,
21-
globals: {
22-
lodash: '_',
23-
rxjs: 'rxjs',
24-
'rxjs/operators': 'rxjs.operators'
25-
}
26-
},
27-
{ file: pkg.module, format: 'es', sourcemap: true }
28-
],
14+
output: [{ file: pkg.module, format: 'es', sourcemap: true }],
2915
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
30-
external: ['lodash', 'rxjs', 'rxjs/operators', 'core-js/es7/reflect'],
16+
external: ['lodash-es', 'rxjs', 'rxjs/operators', 'core-js/es7/reflect'],
3117
watch: {
3218
include: 'src/**'
3319
},

src/model/editor/editor-library.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNil } from 'lodash';
1+
import { isNil } from 'lodash-es';
22
import { DataSourceManager } from '../../data/data-source/manager/data-source-manager';
33
import { RendererLibrary } from '../../renderer/registration/renderer-registration';
44
import { PartialObjectMock } from '../../test/partial-object-mock';

src/model/editor/editor-library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { uniq } from 'lodash';
1+
import { uniq } from 'lodash-es';
22
import { DataSourceManager } from '../../data/data-source/manager/data-source-manager';
33
import { RendererLibrary } from '../../renderer/registration/renderer-registration';
44
import { Theme } from '../../theming/theme';

src/model/manager/model-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cloneDeepWith, without } from 'lodash';
1+
import { cloneDeepWith, without } from 'lodash-es';
22
import { Constructable } from '../../util/constructable';
33
import { Logger } from '../../util/logging/logger';
44
import { ModelApiBuilder } from '../api/builder/model-api-builder';

src/model/property/predefined/array-property-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNil } from 'lodash';
1+
import { isNil } from 'lodash-es';
22

33
export const ARRAY_PROPERTY = Object.freeze({
44
type: 'array',

src/model/property/predefined/model-property-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNil } from 'lodash';
1+
import { isNil } from 'lodash-es';
22
import { DeserializationManager } from '../../../persistence/deserialization/deserialization-manager';
33
import { ModelJson } from '../../../persistence/model-json';
44
import { Constructable } from '../../../util/constructable';

src/model/property/predefined/primitive-model-property-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNil } from 'lodash';
1+
import { isNil } from 'lodash-es';
22
import { ModelPropertyTypeInstance, PropertyValidatorFunction } from '../model-property-type-library';
33

44
const typeofValidator = (type: 'string' | 'boolean' | 'number' | 'object'): PropertyValidatorFunction => (

0 commit comments

Comments
 (0)