chore: Remove optimize imports to allow vite upgrade (#5691)

This commit is contained in:
Tom Moor
2023-08-14 14:44:58 -04:00
committed by GitHub
parent a71ad43c31
commit b7bfc4bb1a
138 changed files with 207 additions and 171 deletions

View File

@@ -1,4 +1,4 @@
import { flattenDeep } from "lodash";
import flattenDeep from "lodash/flattenDeep";
import * as React from "react";
import { Optional } from "utility-types";
import { v4 as uuidv4 } from "uuid";

View File

@@ -1,6 +1,6 @@
/* eslint-disable prefer-rest-params */
/* global ga */
import { escape } from "lodash";
import escape from "lodash/escape";
import * as React from "react";
import { IntegrationService } from "@shared/types";
import env from "~/env";

View File

@@ -1,4 +1,7 @@
import { sortBy, filter, uniq, isEqual } from "lodash";
import filter from "lodash/filter";
import isEqual from "lodash/isEqual";
import sortBy from "lodash/sortBy";
import uniq from "lodash/uniq";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,5 +1,10 @@
import FuzzySearch from "fuzzy-search";
import { includes, difference, concat, filter, map, fill } from "lodash";
import concat from "lodash/concat";
import difference from "lodash/difference";
import fill from "lodash/fill";
import filter from "lodash/filter";
import includes from "lodash/includes";
import map from "lodash/map";
import { observer } from "mobx-react";
import { StarredIcon, DocumentIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { sortBy } from "lodash";
import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,6 @@
import { deburr, difference, sortBy } from "lodash";
import deburr from "lodash/deburr";
import difference from "lodash/difference";
import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { DOMParser as ProsemirrorDOMParser } from "prosemirror-model";
import { TextSelection } from "prosemirror-state";

View File

@@ -1,4 +1,4 @@
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import { observer } from "mobx-react";
import { MenuIcon } from "outline-icons";
import { transparentize } from "polished";

View File

@@ -1,4 +1,4 @@
import { escapeRegExp } from "lodash";
import escapeRegExp from "lodash/escapeRegExp";
import * as React from "react";
import replace from "string-replace-to-array";
import styled from "styled-components";

View File

@@ -1,4 +1,4 @@
import { find } from "lodash";
import find from "lodash/find";
import * as React from "react";
import { Trans, useTranslation } from "react-i18next";
import styled from "styled-components";

View File

@@ -1,4 +1,4 @@
import { times } from "lodash";
import times from "lodash/times";
import * as React from "react";
import styled from "styled-components";
import Fade from "~/components/Fade";

View File

@@ -1,4 +1,4 @@
import { isEqual } from "lodash";
import isEqual from "lodash/isEqual";
import { observable, action } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { groupBy } from "lodash";
import groupBy from "lodash/groupBy";
import { observer } from "mobx-react";
import { BackIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { isEqual } from "lodash";
import isEqual from "lodash/isEqual";
import { observer } from "mobx-react";
import { CollapsedIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,5 +1,5 @@
import invariant from "invariant";
import { find } from "lodash";
import find from "lodash/find";
import { action, observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { some } from "lodash";
import some from "lodash/some";
import { EditorState, NodeSelection, TextSelection } from "prosemirror-state";
import * as React from "react";
import createAndInsertLink from "@shared/editor/commands/createAndInsertLink";

View File

@@ -1,5 +1,5 @@
import commandScore from "command-score";
import { capitalize } from "lodash";
import capitalize from "lodash/capitalize";
import * as React from "react";
import { Trans } from "react-i18next";
import { VisuallyHidden } from "reakit/VisuallyHidden";

View File

@@ -1,5 +1,5 @@
import { useRegisterActions } from "kbar";
import { flattenDeep } from "lodash";
import flattenDeep from "lodash/flattenDeep";
import { useLocation } from "react-router-dom";
import { actionToKBar } from "~/actions";
import { Action } from "~/types";

View File

@@ -1,4 +1,4 @@
import { find } from "lodash";
import find from "lodash/find";
import * as React from "react";
import embeds, { EmbedDescriptor } from "@shared/editor/embeds";
import { IntegrationType } from "@shared/types";

View File

@@ -1,4 +1,4 @@
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import * as React from "react";
import { Minute } from "@shared/utils/time";

View File

@@ -1,4 +1,4 @@
import { noop } from "lodash";
import noop from "lodash/noop";
import React from "react";
type MenuContextType = {

View File

@@ -1,4 +1,4 @@
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import * as React from "react";
import useEventListener from "./useEventListener";
import useIsMounted from "./useIsMounted";

View File

@@ -1,6 +1,6 @@
// Based on https://github.com/rehooks/window-scroll-position which is no longer
// maintained.
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import { useState, useEffect } from "react";
import { supportsPassiveListener } from "~/utils/browser";

View File

@@ -1,4 +1,4 @@
import { pick } from "lodash";
import pick from "lodash/pick";
import { set, observable } from "mobx";
import Logger from "~/utils/Logger";
import { getFieldsForModel } from "./decorators/Field";

View File

@@ -1,4 +1,4 @@
import { trim } from "lodash";
import trim from "lodash/trim";
import { action, computed, observable, reaction, runInAction } from "mobx";
import {
CollectionPermission,

View File

@@ -1,5 +1,5 @@
import { addDays, differenceInDays } from "date-fns";
import { floor } from "lodash";
import floor from "lodash/floor";
import { action, autorun, computed, observable, set } from "mobx";
import { ExportContentType } from "@shared/types";
import type { NavigationNode } from "@shared/types";

View File

@@ -1,4 +1,4 @@
import { sortBy } from "lodash";
import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { intersection } from "lodash";
import intersection from "lodash/intersection";
import { observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { action, observable } from "mobx";
import { observer } from "mobx-react";
import { AllSelection } from "prosemirror-state";

View File

@@ -1,5 +1,5 @@
import { HocuspocusProvider, WebSocketStatus } from "@hocuspocus/provider";
import { throttle } from "lodash";
import throttle from "lodash/throttle";
import * as React from "react";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";

View File

@@ -1,5 +1,6 @@
import invariant from "invariant";
import { debounce, isEmpty } from "lodash";
import debounce from "lodash/debounce";
import isEmpty from "lodash/isEmpty";
import { observer } from "mobx-react";
import { ExpandedIcon, GlobeIcon, PadlockIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { flatten } from "lodash";
import flatten from "lodash/flatten";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { flatten } from "lodash";
import flatten from "lodash/flatten";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,4 +1,4 @@
import { find } from "lodash";
import find from "lodash/find";
import { observer } from "mobx-react";
import { BackIcon, EmailIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { isEqual } from "lodash";
import isEqual from "lodash/isEqual";
import { observable, action } from "mobx";
import { observer } from "mobx-react";
import queryString from "query-string";

View File

@@ -1,5 +1,5 @@
import { isHexColor } from "class-validator";
import { pickBy } from "lodash";
import pickBy from "lodash/pickBy";
import { observer } from "mobx-react";
import { TeamIcon } from "outline-icons";
import { useRef, useState } from "react";

View File

@@ -1,4 +1,4 @@
import { find } from "lodash";
import find from "lodash/find";
import { observer } from "mobx-react";
import * as React from "react";
import { useForm } from "react-hook-form";

View File

@@ -1,4 +1,4 @@
import { sortBy } from "lodash";
import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { PlusIcon, UserIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import {
AcademicCapIcon,

View File

@@ -1,4 +1,4 @@
import { debounce } from "lodash";
import debounce from "lodash/debounce";
import { observer } from "mobx-react";
import { CheckboxIcon, EmailIcon, PadlockIcon } from "outline-icons";
import { useState } from "react";

View File

@@ -1,4 +1,4 @@
import { find } from "lodash";
import find from "lodash/find";
import { observer } from "mobx-react";
import { BuildingBlocksIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { sortBy } from "lodash";
import sortBy from "lodash/sortBy";
import { observer } from "mobx-react";
import { LinkIcon, WarningIcon } from "outline-icons";
import * as React from "react";

View File

@@ -1,4 +1,4 @@
import { compact } from "lodash";
import compact from "lodash/compact";
import { observer } from "mobx-react";
import * as React from "react";
import { useTranslation } from "react-i18next";

View File

@@ -1,5 +1,6 @@
import invariant from "invariant";
import { lowerFirst, orderBy } from "lodash";
import lowerFirst from "lodash/lowerFirst";
import orderBy from "lodash/orderBy";
import { observable, action, computed, runInAction } from "mobx";
import { Class } from "utility-types";
import RootStore from "~/stores/RootStore";

View File

@@ -1,5 +1,8 @@
import invariant from "invariant";
import { concat, find, last, sortBy } from "lodash";
import concat from "lodash/concat";
import find from "lodash/find";
import last from "lodash/last";
import sortBy from "lodash/sortBy";
import { computed, action } from "mobx";
import {
CollectionPermission,

View File

@@ -1,5 +1,6 @@
import invariant from "invariant";
import { filter, orderBy } from "lodash";
import filter from "lodash/filter";
import orderBy from "lodash/orderBy";
import { action, runInAction, computed } from "mobx";
import Comment from "~/models/Comment";
import Document from "~/models/Document";

View File

@@ -1,5 +1,9 @@
import invariant from "invariant";
import { find, orderBy, filter, compact, omitBy } from "lodash";
import compact from "lodash/compact";
import filter from "lodash/filter";
import find from "lodash/find";
import omitBy from "lodash/omitBy";
import orderBy from "lodash/orderBy";
import { observable, action, computed, runInAction } from "mobx";
import { DateFilter, NavigationNode, PublicTeam } from "@shared/types";
import { subtractDate } from "@shared/utils/date";

View File

@@ -1,4 +1,5 @@
import { sortBy, filter } from "lodash";
import filter from "lodash/filter";
import sortBy from "lodash/sortBy";
import { computed } from "mobx";
import Event from "~/models/Event";
import BaseStore, { RPCAction } from "./BaseStore";

View File

@@ -1,4 +1,4 @@
import { orderBy } from "lodash";
import orderBy from "lodash/orderBy";
import { computed } from "mobx";
import { FileOperationType } from "@shared/types";
import FileOperation from "~/models/FileOperation";

View File

@@ -1,5 +1,5 @@
import invariant from "invariant";
import { filter } from "lodash";
import filter from "lodash/filter";
import { action, runInAction } from "mobx";
import GroupMembership from "~/models/GroupMembership";
import { PaginationParams } from "~/types";

View File

@@ -1,5 +1,5 @@
import invariant from "invariant";
import { filter } from "lodash";
import filter from "lodash/filter";
import { action, runInAction, computed } from "mobx";
import naturalSort from "@shared/utils/naturalSort";
import Group from "~/models/Group";

View File

@@ -1,4 +1,4 @@
import { filter } from "lodash";
import filter from "lodash/filter";
import { computed } from "mobx";
import { IntegrationService } from "@shared/types";
import naturalSort from "@shared/utils/naturalSort";

View File

@@ -1,5 +1,6 @@
import invariant from "invariant";
import { orderBy, sortBy } from "lodash";
import orderBy from "lodash/orderBy";
import sortBy from "lodash/sortBy";
import { action, computed, runInAction } from "mobx";
import Notification from "~/models/Notification";
import { PaginationParams } from "~/types";

View File

@@ -1,5 +1,5 @@
import invariant from "invariant";
import { filter } from "lodash";
import filter from "lodash/filter";
import { action, runInAction } from "mobx";
import BaseStore, { RPCAction } from "~/stores/BaseStore";
import RootStore from "~/stores/RootStore";

View File

@@ -1,4 +1,4 @@
import { uniqBy } from "lodash";
import uniqBy from "lodash/uniqBy";
import { computed } from "mobx";
import SearchQuery from "~/models/SearchQuery";
import BaseStore, { RPCAction } from "./BaseStore";

View File

@@ -1,5 +1,8 @@
import invariant from "invariant";
import { sortBy, filter, find, isUndefined } from "lodash";
import filter from "lodash/filter";
import find from "lodash/find";
import isUndefined from "lodash/isUndefined";
import sortBy from "lodash/sortBy";
import { action, computed } from "mobx";
import Share from "~/models/Share";
import { client } from "~/utils/ApiClient";

View File

@@ -1,4 +1,4 @@
import { orderBy } from "lodash";
import orderBy from "lodash/orderBy";
import { observable, action, computed } from "mobx";
import { v4 as uuidv4 } from "uuid";
import { Toast, ToastOptions } from "~/types";

View File

@@ -1,5 +1,6 @@
import invariant from "invariant";
import { filter, orderBy } from "lodash";
import filter from "lodash/filter";
import orderBy from "lodash/orderBy";
import { observable, computed, action, runInAction } from "mobx";
import { Role } from "@shared/types";
import User from "~/models/User";

View File

@@ -1,4 +1,7 @@
import { reduce, filter, find, orderBy } from "lodash";
import filter from "lodash/filter";
import find from "lodash/find";
import orderBy from "lodash/orderBy";
import reduce from "lodash/reduce";
import View from "~/models/View";
import BaseStore, { RPCAction } from "./BaseStore";
import RootStore from "./RootStore";

View File

@@ -1,5 +1,5 @@
import retry from "fetch-retry";
import { trim } from "lodash";
import trim from "lodash/trim";
import queryString from "query-string";
import EDITOR_VERSION from "@shared/editor/version";
import stores from "~/stores";

View File

@@ -7,7 +7,7 @@ import {
format as formatDate,
} from "date-fns";
import { TFunction } from "i18next";
import { startCase } from "lodash";
import startCase from "lodash/startCase";
import {
getCurrentDateAsString,
getCurrentDateTimeAsString,