Skip to content

Commit

Permalink
feat(deps): remove lodash dependence
Browse files Browse the repository at this point in the history
replace dependence `lodash` to `lodash.isundefined` and ship it with bundle
  • Loading branch information
robinxb committed Jun 4, 2019
1 parent 6ff52b1 commit 3e4697f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -92,6 +92,7 @@
"@commitlint/cli": "^7.1.2",
"@commitlint/config-conventional": "^7.1.2",
"@types/jest": "^23.3.2",
"@types/lodash.isundefined": "^3.0.6",
"@types/node": "^10.11.0",
"colors": "^1.3.2",
"commitizen": "^3.0.0",
Expand All @@ -103,6 +104,7 @@
"jest-config": "^23.6.0",
"lint-staged": "^8.0.0",
"lodash.camelcase": "^4.3.0",
"lodash.isundefined": "^3.0.1",
"prettier": "^1.14.3",
"prompt": "^1.0.0",
"replace-in-file": "^3.4.2",
Expand All @@ -125,7 +127,6 @@
"typescript": "^3.0.3"
},
"dependencies": {
"lodash": "^4.17.11",
"typescript-collections": "^1.3.2"
},
"husky": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.ts
Expand Up @@ -16,7 +16,7 @@ export default {
{ file: pkg.module, format: 'es', sourcemap: true },
],
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: ['typescript-collections', 'lodash'],
external: ['typescript-collections'],
watch: {
include: 'src/**',
},
Expand Down
2 changes: 1 addition & 1 deletion src/behaviorTreeBuilder.ts
Expand Up @@ -7,7 +7,7 @@ import { IParentBehaviorTreeNode } from './iParentBehaviorTreeNode'
import { ParallelNode } from './nodes/parallelNode'
import { InverterNode } from './nodes/inverterNode'
import { SelectorNode } from './nodes/selectorNode'
import { isUndefined } from 'lodash'
import isUndefined from 'lodash.isundefined'
import { SequenceNode } from './nodes/sequenceNode'
import { ErrUnnestedTree, ErrZeroNodes, ErrorSpliceUnnested } from './errors'

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/inverterNode.ts
Expand Up @@ -2,7 +2,7 @@ import { TimeData } from '../timeData'
import { BehaviorTreeStatus } from '../behaviorTreeStatus'
import { IBehaviorTreeNode } from '../iBehaviorTreeNode'
import { IParentBehaviorTreeNode } from '../iParentBehaviorTreeNode'
import { isUndefined } from 'lodash'
import isUndefined from 'lodash.isundefined'
import { ErrInvNodeMustHaveChild, ErrInvNodeMoreThanOneChild } from '../errors'

export class InverterNode implements IParentBehaviorTreeNode {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -11,6 +11,7 @@
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declarationDir": "dist/types",
"esModuleInterop": true,
"outDir": "dist/lib",
"typeRoots": [
"node_modules/@types"
Expand Down
16 changes: 14 additions & 2 deletions yarn.lock
Expand Up @@ -982,7 +982,14 @@
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.14.tgz#37daaf78069e7948520474c87b80092ea912520a"
integrity sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==

"@types/lodash@^4.14.110":
"@types/lodash.isundefined@^3.0.6":
version "3.0.6"
resolved "https://registry.yarnpkg.com/@types/lodash.isundefined/-/lodash.isundefined-3.0.6.tgz#e8c9c4d81795671f6d8e734f649b9b7ad295d76d"
integrity sha512-gXRrZ9MahWtxusjjUAbWaxUA4vU/NxXfI9kkfsjXYnBA0YjXVtl71toGBZ0X4+L023XS8NlO3BokLXFFuLtG/Q==
dependencies:
"@types/lodash" "*"

"@types/lodash@*", "@types/lodash@^4.14.110":
version "4.14.133"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.133.tgz#430721c96da22dd1694443e68e6cec7ba1c1003d"
integrity sha512-/3JqnvPnY58GLzG3Y7fpphOhATV1DDZ/Ak3DQufjlRK5E4u+s0CfClfNFtAGBabw+jDGtRFbOZe+Z02ZMWCBNQ==
Expand Down Expand Up @@ -5204,6 +5211,11 @@ lodash.isstring@^4.0.1:
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=

lodash.isundefined@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz#23ef3d9535565203a66cefd5b830f848911afb48"
integrity sha1-I+89lTVWUgOmbO/VuDD4SJEa+0g=

lodash.map@^4.5.1:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
Expand Down Expand Up @@ -7451,7 +7463,7 @@ sax@^1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

semantic-release@^15.9.16:
semantic-release@^15.13.12:
version "15.13.12"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.13.12.tgz#1128361fc36301ef3a1ea137dd277bdddf9f68c1"
integrity sha512-YOJgG0dE2g/GTV1tx18KO2oXNT/HxPIjlcLts5hCQKthu71NnuOt/YnM+X88M3B7Ajjv+03zGxif8DVFPn3C5g==
Expand Down

0 comments on commit 3e4697f

Please sign in to comment.