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

fix: 修正 lodash 引入 #438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions packages/feflow-cli/src/core/command-picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import fs from 'fs';
import path from 'path';
import osEnv from 'osenv';
import _ from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import difference from 'lodash/difference';

import Feflow from '..';
import { execPlugin } from '../plugin/load-universal-plugin';
Expand Down Expand Up @@ -128,7 +129,7 @@ export class CacheController {
pluginName: string = CommandType.NATIVE_TYPE,
version = 'latest',
) {
const newCommands = _.difference(Object.keys(store), Object.keys(this.lastStore));
const newCommands = difference(Object.keys(store), Object.keys(this.lastStore));

if (!!this.lastCommand) {
if (type === CommandType.PLUGIN_TYPE) {
Expand Down Expand Up @@ -343,7 +344,7 @@ export class CacheController {
} else {
target = new TargetPlugin(type, (cmdPath || path) as string, plugin);
}
cmdList.push(_.cloneDeep(target));
cmdList.push(cloneDeep(target));
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions packages/feflow-cli/src/core/resident/update-beat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';
import semver from 'semver';
import osenv from 'osenv';
import spawn from 'cross-spawn';
import _ from 'lodash';
import isEqual from 'lodash/isEqual';
import { UpdateData, UniversalPluginUpdateMsg } from './';
import LockFile from '../../shared/lock-file';
import packageJson from '../../shared/package-json';
Expand Down Expand Up @@ -134,7 +134,7 @@ const queryPluginsUpdate = async () => {
logger.debug('tnpm plugins update information', pluginsWithName);
if (pluginsWithName.length) {
const updateData = (await updateFile.read(UPDATE_KEY)) as UpdateData;
if (!_.isEqual(updateData.latest_plugins, pluginsWithName)) {
if (!isEqual(updateData.latest_plugins, pluginsWithName)) {
const newUpdateData = {
...updateData,
latest_plugins: pluginsWithName,
Expand Down Expand Up @@ -172,7 +172,7 @@ const queryUniversalPluginsUpdate = async () => {
logger.debug('universal plugins update information', latestUniversalPlugins);
if (latestUniversalPlugins.length) {
const updateData = (await updateFile.read(UPDATE_KEY)) as UpdateData;
if (!_.isEqual(updateData.latest_universal_plugins, latestUniversalPlugins)) {
if (!isEqual(updateData.latest_universal_plugins, latestUniversalPlugins)) {
const newUpdateData = {
...updateData,
latest_universal_plugins: latestUniversalPlugins,
Expand Down
2 changes: 1 addition & 1 deletion packages/feflow-cli/src/shared/fef-error.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync } from 'fs';
import { join } from 'path';
import chalk from 'chalk';
import { get } from 'lodash';
import get from 'lodash/get';

import Feflow from '../core';
import { Config } from './file';
Expand Down