From 3a826b43a2ee3078bcd06ae9c4beda0e2370760b Mon Sep 17 00:00:00 2001 From: Vladislav Shkodin Date: Sun, 30 May 2021 18:49:33 +0200 Subject: [PATCH] refactor: convert absolute imports to relative ones (#5438) --- .eslintrc.js | 26 ++++++++-- babel.config.js | 49 ------------------- package.json | 1 - .../src/__tests__/backend.spec.js | 4 +- .../__tests__/editorialWorkflow.spec.js | 10 ++-- .../src/actions/__tests__/entries.spec.js | 8 +-- .../actions/__tests__/mediaLibrary.spec.js | 2 +- .../src/actions/collections.ts | 2 +- packages/netlify-cms-core/src/bootstrap.js | 22 ++++----- .../src/components/App/App.js | 22 ++++----- .../src/components/App/Header.js | 2 +- .../src/components/Collection/Collection.js | 2 +- .../Collection/Entries/EntriesCollection.js | 4 +- .../Collection/Entries/EntriesSearch.js | 4 +- .../Collection/Entries/EntryCard.js | 8 +-- .../Collection/Entries/EntryListing.js | 2 +- .../src/components/Collection/Sidebar.js | 2 +- .../components/Collection/ViewStyleControl.js | 2 +- .../Collection/__tests__/Sidebar.spec.js | 2 +- .../src/components/Editor/Editor.js | 17 +++---- .../Editor/EditorControlPane/EditorControl.js | 13 +++-- .../Editor/EditorControlPane/Widget.js | 2 +- .../EditorPreviewPane/EditorPreviewPane.js | 12 ++--- .../src/components/Editor/EditorToolbar.js | 4 +- .../Editor/__tests__/Editor.spec.js | 2 +- .../src/components/Editor/withWorkflow.js | 8 +-- .../src/components/EditorWidgets/index.js | 2 +- .../components/MediaLibrary/MediaLibrary.js | 4 +- .../MediaLibrary/MediaLibraryButtons.js | 2 +- .../MediaLibrary/MediaLibraryModal.js | 2 +- .../src/components/UI/SettingsDropdown.js | 2 +- .../src/components/UI/index.js | 1 + .../src/components/Workflow/Workflow.js | 8 +-- .../src/components/Workflow/WorkflowList.js | 6 +-- .../src/constants/configSchema.js | 4 +- packages/netlify-cms-core/src/index.js | 2 +- .../providers/algolia/implementation.js | 4 +- .../providers/assetStore/implementation.js | 2 +- packages/netlify-cms-core/src/lib/registry.js | 2 +- packages/netlify-cms-core/src/mediaLibrary.ts | 2 +- .../src/reducers/__tests__/entryDraft.spec.js | 2 +- .../reducers/__tests__/mediaLibrary.spec.js | 16 +++--- .../netlify-cms-core/src/reducers/cursors.js | 2 +- .../src/reducers/entryDraft.js | 4 +- packages/netlify-cms-core/src/redux/index.ts | 2 +- .../netlify-cms-core/src/routing/history.ts | 2 +- yarn.lock | 36 -------------- 47 files changed, 136 insertions(+), 203 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ee9d2175..589ef62a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,10 @@ +const fs = require('fs'); + +const packages = fs + .readdirSync(`${__dirname}/packages`, { withFileTypes: true }) + .filter(dirent => dirent.isDirectory()) + .map(dirent => dirent.name); + module.exports = { parser: 'babel-eslint', extends: [ @@ -5,6 +12,7 @@ module.exports = { 'plugin:react/recommended', 'plugin:cypress/recommended', 'prettier', + 'plugin:import/recommended', ], env: { es6: true, @@ -22,6 +30,7 @@ module.exports = { rules: { 'no-console': [0], 'react/prop-types': [0], + 'import/no-named-as-default': 0, 'no-duplicate-imports': 'error', '@emotion/no-vanilla': 'error', '@emotion/import-from-emotion': 'error', @@ -41,6 +50,12 @@ module.exports = { react: { version: 'detect', }, + 'import/resolver': { + node: { + extensions: ['.js', '.jsx', '.ts', '.tsx'], + }, + }, + 'import/core-modules': [...packages, 'netlify-cms-app/dist/esm'], }, overrides: [ { @@ -52,8 +67,7 @@ module.exports = { 'plugin:cypress/recommended', 'plugin:@typescript-eslint/recommended', 'prettier', - 'plugin:import/errors', - 'plugin:import/warnings', + 'plugin:import/recommended', 'plugin:import/typescript', ], parserOptions: { @@ -65,7 +79,7 @@ module.exports = { }, rules: { 'require-atomic-updates': [0], - 'import/no-unresolved': [0], + 'import/no-named-as-default': 0, '@typescript-eslint/no-non-null-assertion': [0], '@typescript-eslint/camelcase': [0], '@typescript-eslint/explicit-function-return-type': [0], @@ -75,5 +89,11 @@ module.exports = { ], }, }, + { + files: ['website/**/*'], + rules: { + 'import/no-unresolved': [0], + }, + }, ], }; diff --git a/babel.config.js b/babel.config.js index b7c1efbf..559439c6 100644 --- a/babel.config.js +++ b/babel.config.js @@ -25,55 +25,6 @@ const defaultPlugins = [ '@babel/plugin-proposal-optional-chaining', '@babel/plugin-syntax-dynamic-import', 'babel-plugin-inline-json-import', - [ - 'module-resolver', - isESM - ? { - root: ['./src'], - alias: { - coreSrc: './src', - Actions: './src/actions', - App: './src/components/App', - Collection: './src/components/Collection', - Constants: './src/constants', - Editor: './src/components/Editor', - EditorWidgets: './src/components/EditorWidgets', - Formats: './src/formats', - Integrations: './src/integrations', - Lib: './src/lib', - MediaLibrary: './src/components/MediaLibrary', - Reducers: './src/reducers', - Selectors: './src/selectors', - ReduxStore: './src/redux', - Routing: './src/routing', - UI: './src/components/UI', - Workflow: './src/components/Workflow', - ValueObjects: './src/valueObjects', - localforage: 'localforage', - redux: 'redux', - }, - extensions: ['.js', '.jsx', '.es', '.es6', '.mjs', '.ts', '.tsx'], - } - : { - root: path.join(__dirname, 'packages/netlify-cms-core/src/components'), - alias: { - coreSrc: path.join(__dirname, 'packages/netlify-cms-core/src'), - Actions: path.join(__dirname, 'packages/netlify-cms-core/src/actions/'), - Constants: path.join(__dirname, 'packages/netlify-cms-core/src/constants/'), - Formats: path.join(__dirname, 'packages/netlify-cms-core/src/formats/'), - Integrations: path.join(__dirname, 'packages/netlify-cms-core/src/integrations/'), - Lib: path.join(__dirname, 'packages/netlify-cms-core/src/lib/'), - Reducers: path.join(__dirname, 'packages/netlify-cms-core/src/reducers/'), - Selectors: path.join(__dirname, 'packages/netlify-cms-core/src/selectors/'), - ReduxStore: path.join(__dirname, 'packages/netlify-cms-core/src/redux/'), - Routing: path.join(__dirname, 'packages/netlify-cms-core/src/routing/'), - ValueObjects: path.join(__dirname, 'packages/netlify-cms-core/src/valueObjects/'), - localforage: 'localforage', - redux: 'redux', - }, - extensions: ['.js', '.jsx', '.es', '.es6', '.mjs', '.ts', '.tsx'], - }, - ], ]; const svgo = { diff --git a/package.json b/package.json index 12619dea..1fd7a0da 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "babel-plugin-inline-json-import": "^0.3.2", "babel-plugin-inline-react-svg": "^2.0.0", "babel-plugin-lodash": "^3.3.4", - "babel-plugin-module-resolver": "^4.0.0", "babel-plugin-transform-builtin-extend": "^1.1.2", "babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-export-extensions": "^6.22.0", diff --git a/packages/netlify-cms-core/src/__tests__/backend.spec.js b/packages/netlify-cms-core/src/__tests__/backend.spec.js index 1ee38341..c0ee704a 100644 --- a/packages/netlify-cms-core/src/__tests__/backend.spec.js +++ b/packages/netlify-cms-core/src/__tests__/backend.spec.js @@ -6,7 +6,7 @@ import { expandSearchEntries, mergeExpandedEntries, } from '../backend'; -import registry from '../lib/registry'; +import { getBackend } from '../lib/registry'; import { FOLDER, FILES } from '../constants/collectionTypes'; jest.mock('../lib/registry'); @@ -18,7 +18,7 @@ describe('Backend', () => { let backend; beforeEach(() => { - registry.getBackend.mockReturnValue({ + getBackend.mockReturnValue({ init: jest.fn(), }); backend = resolveBackend({ diff --git a/packages/netlify-cms-core/src/actions/__tests__/editorialWorkflow.spec.js b/packages/netlify-cms-core/src/actions/__tests__/editorialWorkflow.spec.js index 0ec9460d..0fd6b92d 100644 --- a/packages/netlify-cms-core/src/actions/__tests__/editorialWorkflow.spec.js +++ b/packages/netlify-cms-core/src/actions/__tests__/editorialWorkflow.spec.js @@ -4,7 +4,7 @@ import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { fromJS } from 'immutable'; -jest.mock('coreSrc/backend'); +jest.mock('../../backend'); jest.mock('../../valueObjects/AssetProxy'); jest.mock('netlify-cms-lib-util'); jest.mock('uuid/v4', () => { @@ -33,8 +33,8 @@ describe('editorialWorkflow actions', () => { describe('loadUnpublishedEntry', () => { it('should load unpublished entry', () => { - const { currentBackend } = require('coreSrc/backend'); - const { createAssetProxy } = require('ValueObjects/AssetProxy'); + const { currentBackend } = require('../../backend'); + const { createAssetProxy } = require('../../valueObjects/AssetProxy'); const assetProxy = { name: 'name', path: 'path' }; const entry = { mediaFiles: [{ file: { name: 'name' }, id: '1', draft: true }] }; @@ -91,7 +91,7 @@ describe('editorialWorkflow actions', () => { describe('publishUnpublishedEntry', () => { it('should publish unpublished entry and report success', () => { - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const entry = {}; const backend = { @@ -176,7 +176,7 @@ describe('editorialWorkflow actions', () => { }); it('should publish unpublished entry and report error', () => { - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const error = new Error('failed to publish entry'); const backend = { diff --git a/packages/netlify-cms-core/src/actions/__tests__/entries.spec.js b/packages/netlify-cms-core/src/actions/__tests__/entries.spec.js index 9ba9f8ef..55437e7a 100644 --- a/packages/netlify-cms-core/src/actions/__tests__/entries.spec.js +++ b/packages/netlify-cms-core/src/actions/__tests__/entries.spec.js @@ -11,7 +11,7 @@ import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import AssetProxy from '../../valueObjects/AssetProxy'; -jest.mock('coreSrc/backend'); +jest.mock('../../backend'); jest.mock('netlify-cms-lib-util'); jest.mock('../mediaLibrary'); jest.mock('../../reducers/entries'); @@ -22,7 +22,7 @@ const mockStore = configureMockStore(middlewares); describe('entries', () => { describe('createEmptyDraft', () => { - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const backend = { processEntry: jest.fn((_state, _collection, entry) => Promise.resolve(entry)), }; @@ -319,7 +319,7 @@ describe('entries', () => { }); it('should persist local backup with media files', () => { - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const backend = { persistLocalDraftBackup: jest.fn(() => Promise.resolve()), @@ -351,7 +351,7 @@ describe('entries', () => { }); it('should retrieve media files with local backup', () => { - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const { createAssetProxy } = require('../../valueObjects/AssetProxy'); const backend = { diff --git a/packages/netlify-cms-core/src/actions/__tests__/mediaLibrary.spec.js b/packages/netlify-cms-core/src/actions/__tests__/mediaLibrary.spec.js index 2d6e44e7..fda935aa 100644 --- a/packages/netlify-cms-core/src/actions/__tests__/mediaLibrary.spec.js +++ b/packages/netlify-cms-core/src/actions/__tests__/mediaLibrary.spec.js @@ -59,7 +59,7 @@ describe('mediaLibrary', () => { }); }); - const { currentBackend } = require('coreSrc/backend'); + const { currentBackend } = require('../../backend'); const backend = { persistMedia: jest.fn(() => ({ id: 'id' })), diff --git a/packages/netlify-cms-core/src/actions/collections.ts b/packages/netlify-cms-core/src/actions/collections.ts index 25c51c93..9c87de4d 100644 --- a/packages/netlify-cms-core/src/actions/collections.ts +++ b/packages/netlify-cms-core/src/actions/collections.ts @@ -1,4 +1,4 @@ -import history from '../routing/history'; +import { history } from '../routing/history'; import { getCollectionUrl, getNewEntryUrl } from '../lib/urlHelper'; export function searchCollections(query: string, collection: string) { diff --git a/packages/netlify-cms-core/src/bootstrap.js b/packages/netlify-cms-core/src/bootstrap.js index b8fadf67..a83c7ade 100644 --- a/packages/netlify-cms-core/src/bootstrap.js +++ b/packages/netlify-cms-core/src/bootstrap.js @@ -2,18 +2,18 @@ import React from 'react'; import { render } from 'react-dom'; import { Provider, connect } from 'react-redux'; import { Route, Router } from 'react-router-dom'; -import store from 'ReduxStore'; -import history from 'Routing/history'; -import { loadConfig } from 'Actions/config'; -import { authenticateUser } from 'Actions/auth'; -import { getPhrases } from 'Lib/phrases'; -import { selectLocale } from 'Reducers/config'; -import { I18n } from 'react-polyglot'; import { GlobalStyles } from 'netlify-cms-ui-default'; -import { ErrorBoundary } from 'UI'; -import App from 'App/App'; -import 'EditorWidgets'; -import 'coreSrc/mediaLibrary'; +import { I18n } from 'react-polyglot'; +import { store } from './redux'; +import { history } from './routing/history'; +import { loadConfig } from './actions/config'; +import { authenticateUser } from './actions/auth'; +import { getPhrases } from './lib/phrases'; +import { selectLocale } from './reducers/config'; +import { ErrorBoundary } from './components/UI'; +import App from './components/App/App'; +import './components/EditorWidgets'; +import './mediaLibrary'; import 'what-input'; const ROOT_ID = 'nc-root'; diff --git a/packages/netlify-cms-core/src/components/App/App.js b/packages/netlify-cms-core/src/components/App/App.js index 622b4b5d..23e45950 100644 --- a/packages/netlify-cms-core/src/components/App/App.js +++ b/packages/netlify-cms-core/src/components/App/App.js @@ -8,18 +8,18 @@ import { connect } from 'react-redux'; import { Route, Switch, Redirect } from 'react-router-dom'; import { Notifs } from 'redux-notifications'; import TopBarProgress from 'react-topbar-progress-indicator'; -import { loginUser, logoutUser } from 'Actions/auth'; -import { currentBackend } from 'coreSrc/backend'; -import { createNewEntry } from 'Actions/collections'; -import { openMediaLibrary } from 'Actions/mediaLibrary'; -import MediaLibrary from 'MediaLibrary/MediaLibrary'; -import { Toast } from 'UI'; +import { loginUser, logoutUser } from '../../actions/auth'; +import { currentBackend } from '../../backend'; +import { createNewEntry } from '../../actions/collections'; +import { openMediaLibrary } from '../../actions/mediaLibrary'; +import MediaLibrary from '../MediaLibrary/MediaLibrary'; +import { Toast } from '../UI'; import { Loader, colors } from 'netlify-cms-ui-default'; -import history from 'Routing/history'; -import { SIMPLE, EDITORIAL_WORKFLOW } from 'Constants/publishModes'; -import Collection from 'Collection/Collection'; -import Workflow from 'Workflow/Workflow'; -import Editor from 'Editor/Editor'; +import { history } from '../../routing/history'; +import { SIMPLE, EDITORIAL_WORKFLOW } from '../../constants/publishModes'; +import Collection from '../Collection/Collection'; +import Workflow from '../Workflow/Workflow'; +import Editor from '../Editor/Editor'; import NotFoundPage from './NotFoundPage'; import Header from './Header'; diff --git a/packages/netlify-cms-core/src/components/App/Header.js b/packages/netlify-cms-core/src/components/App/Header.js index 443fb5ab..d210d1a8 100644 --- a/packages/netlify-cms-core/src/components/App/Header.js +++ b/packages/netlify-cms-core/src/components/App/Header.js @@ -16,7 +16,7 @@ import { buttons, zIndex, } from 'netlify-cms-ui-default'; -import SettingsDropdown from 'UI/SettingsDropdown'; +import { SettingsDropdown } from '../UI'; import { connect } from 'react-redux'; import { checkBackendStatus } from '../../actions/status'; diff --git a/packages/netlify-cms-core/src/components/Collection/Collection.js b/packages/netlify-cms-core/src/components/Collection/Collection.js index 75b60222..80958957 100644 --- a/packages/netlify-cms-core/src/components/Collection/Collection.js +++ b/packages/netlify-cms-core/src/components/Collection/Collection.js @@ -5,7 +5,7 @@ import styled from '@emotion/styled'; import { connect } from 'react-redux'; import { translate } from 'react-polyglot'; import { lengths, components } from 'netlify-cms-ui-default'; -import { getNewEntryUrl } from 'Lib/urlHelper'; +import { getNewEntryUrl } from '../../lib/urlHelper'; import Sidebar from './Sidebar'; import CollectionTop from './CollectionTop'; import EntriesCollection from './Entries/EntriesCollection'; diff --git a/packages/netlify-cms-core/src/components/Collection/Entries/EntriesCollection.js b/packages/netlify-cms-core/src/components/Collection/Entries/EntriesCollection.js index 12be141b..f2dc8ddc 100644 --- a/packages/netlify-cms-core/src/components/Collection/Entries/EntriesCollection.js +++ b/packages/netlify-cms-core/src/components/Collection/Entries/EntriesCollection.js @@ -10,14 +10,14 @@ import { colors } from 'netlify-cms-ui-default'; import { loadEntries as actionLoadEntries, traverseCollectionCursor as actionTraverseCollectionCursor, -} from 'Actions/entries'; +} from '../../../actions/entries'; import { selectEntries, selectEntriesLoaded, selectIsFetching, selectGroups, } from '../../../reducers/entries'; -import { selectCollectionEntriesCursor } from 'Reducers/cursors'; +import { selectCollectionEntriesCursor } from '../../../reducers/cursors'; import Entries from './Entries'; const GroupHeading = styled.h2` diff --git a/packages/netlify-cms-core/src/components/Collection/Entries/EntriesSearch.js b/packages/netlify-cms-core/src/components/Collection/Entries/EntriesSearch.js index 57b9488e..ce3b546f 100644 --- a/packages/netlify-cms-core/src/components/Collection/Entries/EntriesSearch.js +++ b/packages/netlify-cms-core/src/components/Collection/Entries/EntriesSearch.js @@ -4,11 +4,11 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { isEqual } from 'lodash'; import { Cursor } from 'netlify-cms-lib-util'; -import { selectSearchedEntries } from 'Reducers'; +import { selectSearchedEntries } from '../../../reducers'; import { searchEntries as actionSearchEntries, clearSearch as actionClearSearch, -} from 'Actions/search'; +} from '../../../actions/search'; import Entries from './Entries'; class EntriesSearch extends React.Component { diff --git a/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js b/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js index f31a9142..973bb92f 100644 --- a/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js +++ b/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; import { connect } from 'react-redux'; -import { boundGetAsset } from 'Actions/media'; +import { boundGetAsset } from '../../../actions/media'; import { Link } from 'react-router-dom'; import { colors, colorsRaw, components, lengths, zIndex } from 'netlify-cms-ui-default'; -import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews'; -import { selectIsLoadingAsset } from 'Reducers/medias'; -import { selectEntryCollectionTitle } from 'Reducers/collections'; +import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from '../../../constants/collectionViews'; +import { selectIsLoadingAsset } from '../../../reducers/medias'; +import { selectEntryCollectionTitle } from '../../../reducers/collections'; const ListCard = styled.li` ${components.card}; diff --git a/packages/netlify-cms-core/src/components/Collection/Entries/EntryListing.js b/packages/netlify-cms-core/src/components/Collection/Entries/EntryListing.js index 3530c410..d22d5d95 100644 --- a/packages/netlify-cms-core/src/components/Collection/Entries/EntryListing.js +++ b/packages/netlify-cms-core/src/components/Collection/Entries/EntryListing.js @@ -4,7 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import styled from '@emotion/styled'; import { Waypoint } from 'react-waypoint'; import { Map } from 'immutable'; -import { selectFields, selectInferedField } from 'Reducers/collections'; +import { selectFields, selectInferedField } from '../../../reducers/collections'; import EntryCard from './EntryCard'; const CardsGrid = styled.ul` diff --git a/packages/netlify-cms-core/src/components/Collection/Sidebar.js b/packages/netlify-cms-core/src/components/Collection/Sidebar.js index 007f9a61..68cd6ba3 100644 --- a/packages/netlify-cms-core/src/components/Collection/Sidebar.js +++ b/packages/netlify-cms-core/src/components/Collection/Sidebar.js @@ -6,7 +6,7 @@ import { css } from '@emotion/core'; import { translate } from 'react-polyglot'; import { NavLink } from 'react-router-dom'; import { Icon, components, colors } from 'netlify-cms-ui-default'; -import { searchCollections } from 'Actions/collections'; +import { searchCollections } from '../../actions/collections'; import CollectionSearch from './CollectionSearch'; import NestedCollection from './NestedCollection'; diff --git a/packages/netlify-cms-core/src/components/Collection/ViewStyleControl.js b/packages/netlify-cms-core/src/components/Collection/ViewStyleControl.js index 444f9f1b..cc618944 100644 --- a/packages/netlify-cms-core/src/components/Collection/ViewStyleControl.js +++ b/packages/netlify-cms-core/src/components/Collection/ViewStyleControl.js @@ -1,7 +1,7 @@ import React from 'react'; import styled from '@emotion/styled'; import { Icon, buttons, colors } from 'netlify-cms-ui-default'; -import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from 'Constants/collectionViews'; +import { VIEW_STYLE_LIST, VIEW_STYLE_GRID } from '../../constants/collectionViews'; const ViewControlsSection = styled.div` display: flex; diff --git a/packages/netlify-cms-core/src/components/Collection/__tests__/Sidebar.spec.js b/packages/netlify-cms-core/src/components/Collection/__tests__/Sidebar.spec.js index 74c2162d..4aa6037e 100644 --- a/packages/netlify-cms-core/src/components/Collection/__tests__/Sidebar.spec.js +++ b/packages/netlify-cms-core/src/components/Collection/__tests__/Sidebar.spec.js @@ -14,7 +14,7 @@ jest.mock('netlify-cms-ui-default', () => { jest.mock('../NestedCollection', () => 'nested-collection'); jest.mock('../CollectionSearch', () => 'collection-search'); -jest.mock('Actions/collections'); +jest.mock('../../../actions/collections'); describe('Sidebar', () => { const props = { diff --git a/packages/netlify-cms-core/src/components/Editor/Editor.js b/packages/netlify-cms-core/src/components/Editor/Editor.js index 3635cb57..706f06a8 100644 --- a/packages/netlify-cms-core/src/components/Editor/Editor.js +++ b/packages/netlify-cms-core/src/components/Editor/Editor.js @@ -5,8 +5,8 @@ import { connect } from 'react-redux'; import { Loader } from 'netlify-cms-ui-default'; import { translate } from 'react-polyglot'; import { debounce } from 'lodash'; -import history from 'Routing/history'; -import { logoutUser } from 'Actions/auth'; +import { history, navigateToCollection, navigateToNewEntry } from '../../routing/history'; +import { logoutUser } from '../../actions/auth'; import { loadEntry, loadEntries, @@ -21,20 +21,19 @@ import { loadLocalBackup, retrieveLocalBackup, deleteLocalBackup, -} from 'Actions/entries'; +} from '../../actions/entries'; import { updateUnpublishedEntryStatus, publishUnpublishedEntry, unpublishPublishedEntry, deleteUnpublishedEntry, -} from 'Actions/editorialWorkflow'; -import { loadDeployPreview } from 'Actions/deploys'; -import { selectEntry, selectUnpublishedEntry, selectDeployPreview } from 'Reducers'; -import { selectFields } from 'Reducers/collections'; -import { status, EDITORIAL_WORKFLOW } from 'Constants/publishModes'; +} from '../../actions/editorialWorkflow'; +import { loadDeployPreview } from '../../actions/deploys'; +import { selectEntry, selectUnpublishedEntry, selectDeployPreview } from '../../reducers'; +import { selectFields } from '../../reducers/collections'; +import { status, EDITORIAL_WORKFLOW } from '../../constants/publishModes'; import EditorInterface from './EditorInterface'; import withWorkflow from './withWorkflow'; -import { navigateToCollection, navigateToNewEntry } from '../../routing/history'; export class Editor extends React.Component { static propTypes = { diff --git a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/EditorControl.js b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/EditorControl.js index 57d2a411..cb745595 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/EditorControl.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/EditorControl.js @@ -8,20 +8,19 @@ import styled from '@emotion/styled'; import { partial, uniqueId } from 'lodash'; import { connect } from 'react-redux'; import { FieldLabel, colors, transitions, lengths, borders } from 'netlify-cms-ui-default'; -import { resolveWidget, getEditorComponents } from 'Lib/registry'; -import { clearFieldErrors, tryLoadEntry } from 'Actions/entries'; -import { addAsset, boundGetAsset } from 'Actions/media'; -import { selectIsLoadingAsset } from 'Reducers/medias'; -import { query, clearSearch } from 'Actions/search'; +import { resolveWidget, getEditorComponents } from '../../../lib/registry'; +import { clearFieldErrors, tryLoadEntry, validateMetaField } from '../../../actions/entries'; +import { addAsset, boundGetAsset } from '../../../actions/media'; +import { selectIsLoadingAsset } from '../../../reducers/medias'; +import { query, clearSearch } from '../../../actions/search'; import { openMediaLibrary, removeInsertedMedia, clearMediaControl, removeMediaControl, persistMedia, -} from 'Actions/mediaLibrary'; +} from '../../../actions/mediaLibrary'; import Widget from './Widget'; -import { validateMetaField } from '../../../actions/entries'; /** * This is a necessary bridge as we are still passing classnames to widgets diff --git a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js index 9430d971..f5c96f70 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorControlPane/Widget.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { Map, List } from 'immutable'; import { oneLine } from 'common-tags'; -import ValidationErrorTypes from 'Constants/validationErrorTypes'; +import ValidationErrorTypes from '../../../constants/validationErrorTypes'; function truthy() { return { error: false }; diff --git a/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js b/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js index 28d945a3..e14dc8b3 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.js @@ -5,13 +5,13 @@ import { List, Map } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Frame, { FrameContextConsumer } from 'react-frame-component'; import { lengths } from 'netlify-cms-ui-default'; -import { resolveWidget, getPreviewTemplate, getPreviewStyles } from 'Lib/registry'; -import { ErrorBoundary } from 'UI'; -import { selectTemplateName, selectInferedField, selectField } from 'Reducers/collections'; +import { resolveWidget, getPreviewTemplate, getPreviewStyles } from '../../../lib/registry'; +import { ErrorBoundary } from '../../UI'; +import { selectTemplateName, selectInferedField, selectField } from '../../../reducers/collections'; import { connect } from 'react-redux'; -import { boundGetAsset } from 'Actions/media'; -import { selectIsLoadingAsset } from 'Reducers/medias'; -import { INFERABLE_FIELDS } from 'Constants/fieldInference'; +import { boundGetAsset } from '../../../actions/media'; +import { selectIsLoadingAsset } from '../../../reducers/medias'; +import { INFERABLE_FIELDS } from '../../../constants/fieldInference'; import EditorPreviewContent from './EditorPreviewContent.js'; import PreviewHOC from './PreviewHOC'; import EditorPreview from './EditorPreview'; diff --git a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js index 231632f5..7bd0fe1b 100644 --- a/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js +++ b/packages/netlify-cms-core/src/components/Editor/EditorToolbar.js @@ -16,8 +16,8 @@ import { buttons, zIndex, } from 'netlify-cms-ui-default'; -import { status } from 'Constants/publishModes'; -import SettingsDropdown from 'UI/SettingsDropdown'; +import { status } from '../../constants/publishModes'; +import { SettingsDropdown } from '../UI'; const styles = { noOverflow: css` diff --git a/packages/netlify-cms-core/src/components/Editor/__tests__/Editor.spec.js b/packages/netlify-cms-core/src/components/Editor/__tests__/Editor.spec.js index deb21700..6b9b81b5 100644 --- a/packages/netlify-cms-core/src/components/Editor/__tests__/Editor.spec.js +++ b/packages/netlify-cms-core/src/components/Editor/__tests__/Editor.spec.js @@ -18,7 +18,7 @@ jest.mock('netlify-cms-ui-default', () => { Loader: props => , }; }); -jest.mock('Routing/history'); +jest.mock('../../../routing/history'); describe('Editor', () => { const props = { diff --git a/packages/netlify-cms-core/src/components/Editor/withWorkflow.js b/packages/netlify-cms-core/src/components/Editor/withWorkflow.js index ecc6ce1f..e78cc3ba 100644 --- a/packages/netlify-cms-core/src/components/Editor/withWorkflow.js +++ b/packages/netlify-cms-core/src/components/Editor/withWorkflow.js @@ -1,9 +1,9 @@ import React from 'react'; import { connect } from 'react-redux'; -import { EDITORIAL_WORKFLOW } from 'Constants/publishModes'; -import { selectUnpublishedEntry } from 'Reducers'; -import { selectAllowDeletion } from 'Reducers/collections'; -import { loadUnpublishedEntry, persistUnpublishedEntry } from 'Actions/editorialWorkflow'; +import { EDITORIAL_WORKFLOW } from '../../constants/publishModes'; +import { selectUnpublishedEntry } from '../../reducers'; +import { selectAllowDeletion } from '../../reducers/collections'; +import { loadUnpublishedEntry, persistUnpublishedEntry } from '../../actions/editorialWorkflow'; function mapStateToProps(state, ownProps) { const { collections } = state; diff --git a/packages/netlify-cms-core/src/components/EditorWidgets/index.js b/packages/netlify-cms-core/src/components/EditorWidgets/index.js index d453e2a3..31207d3a 100644 --- a/packages/netlify-cms-core/src/components/EditorWidgets/index.js +++ b/packages/netlify-cms-core/src/components/EditorWidgets/index.js @@ -1,4 +1,4 @@ -import { registerWidget } from 'Lib/registry'; +import { registerWidget } from '../../lib/registry'; import UnknownControl from './Unknown/UnknownControl'; import UnknownPreview from './Unknown/UnknownPreview'; diff --git a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js index b0eba307..f33f39e8 100644 --- a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js +++ b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js @@ -13,8 +13,8 @@ import { insertMedia as insertMediaAction, loadMediaDisplayURL as loadMediaDisplayURLAction, closeMediaLibrary as closeMediaLibraryAction, -} from 'Actions/mediaLibrary'; -import { selectMediaFiles } from 'Reducers/mediaLibrary'; +} from '../../actions/mediaLibrary'; +import { selectMediaFiles } from '../../reducers/mediaLibrary'; import MediaLibraryModal, { fileShape } from './MediaLibraryModal'; /** diff --git a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryButtons.js b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryButtons.js index 80b4f48e..452f5569 100644 --- a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryButtons.js +++ b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryButtons.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/core'; import styled from '@emotion/styled'; -import { FileUploadButton } from 'UI'; +import { FileUploadButton } from '../UI'; import copyToClipboard from 'copy-text-to-clipboard'; import { isAbsolutePath } from 'netlify-cms-lib-util'; import { buttons, shadows, zIndex } from 'netlify-cms-ui-default'; diff --git a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryModal.js b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryModal.js index ac25b493..6482ac4e 100644 --- a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryModal.js +++ b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibraryModal.js @@ -4,7 +4,7 @@ import styled from '@emotion/styled'; import { Map } from 'immutable'; import { isEmpty } from 'lodash'; import { translate } from 'react-polyglot'; -import { Modal } from 'UI'; +import { Modal } from '../UI'; import MediaLibraryTop from './MediaLibraryTop'; import MediaLibraryCardGrid from './MediaLibraryCardGrid'; import EmptyMessage from './EmptyMessage'; diff --git a/packages/netlify-cms-core/src/components/UI/SettingsDropdown.js b/packages/netlify-cms-core/src/components/UI/SettingsDropdown.js index 31cd830b..d8e50288 100644 --- a/packages/netlify-cms-core/src/components/UI/SettingsDropdown.js +++ b/packages/netlify-cms-core/src/components/UI/SettingsDropdown.js @@ -4,7 +4,7 @@ import { css } from '@emotion/core'; import styled from '@emotion/styled'; import { translate } from 'react-polyglot'; import { Icon, Dropdown, DropdownItem, DropdownButton, colors } from 'netlify-cms-ui-default'; -import { stripProtocol } from 'Lib/urlHelper'; +import { stripProtocol } from '../../lib/urlHelper'; const styles = { avatarImage: css` diff --git a/packages/netlify-cms-core/src/components/UI/index.js b/packages/netlify-cms-core/src/components/UI/index.js index 524995db..5d84fa9a 100644 --- a/packages/netlify-cms-core/src/components/UI/index.js +++ b/packages/netlify-cms-core/src/components/UI/index.js @@ -3,3 +3,4 @@ export { default as ErrorBoundary } from './ErrorBoundary'; export { FileUploadButton } from './FileUploadButton'; export { Modal } from './Modal'; export { default as Toast } from './Toast'; +export { default as SettingsDropdown } from './SettingsDropdown'; diff --git a/packages/netlify-cms-core/src/components/Workflow/Workflow.js b/packages/netlify-cms-core/src/components/Workflow/Workflow.js index 6099bad5..706f9e4d 100644 --- a/packages/netlify-cms-core/src/components/Workflow/Workflow.js +++ b/packages/netlify-cms-core/src/components/Workflow/Workflow.js @@ -14,15 +14,15 @@ import { components, shadows, } from 'netlify-cms-ui-default'; -import { createNewEntry } from 'Actions/collections'; +import { createNewEntry } from '../../actions/collections'; import { loadUnpublishedEntries, updateUnpublishedEntryStatus, publishUnpublishedEntry, deleteUnpublishedEntry, -} from 'Actions/editorialWorkflow'; -import { selectUnpublishedEntriesByStatus } from 'Reducers'; -import { EDITORIAL_WORKFLOW, status } from 'Constants/publishModes'; +} from '../../actions/editorialWorkflow'; +import { selectUnpublishedEntriesByStatus } from '../../reducers'; +import { EDITORIAL_WORKFLOW, status } from '../../constants/publishModes'; import WorkflowList from './WorkflowList'; const WorkflowContainer = styled.div` diff --git a/packages/netlify-cms-core/src/components/Workflow/WorkflowList.js b/packages/netlify-cms-core/src/components/Workflow/WorkflowList.js index 5eb1857f..a1e59703 100644 --- a/packages/netlify-cms-core/src/components/Workflow/WorkflowList.js +++ b/packages/netlify-cms-core/src/components/Workflow/WorkflowList.js @@ -6,10 +6,10 @@ import styled from '@emotion/styled'; import moment from 'moment'; import { translate } from 'react-polyglot'; import { colors, lengths } from 'netlify-cms-ui-default'; -import { status } from 'Constants/publishModes'; -import { DragSource, DropTarget, HTML5DragDrop } from 'UI'; +import { status } from '../../constants/publishModes'; +import { DragSource, DropTarget, HTML5DragDrop } from '../UI'; import WorkflowCard from './WorkflowCard'; -import { selectEntryCollectionTitle } from 'Reducers/collections'; +import { selectEntryCollectionTitle } from '../../reducers/collections'; const WorkflowListContainer = styled.div` min-height: 60%; diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index ae0b7654..8ba157ef 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -6,8 +6,8 @@ import { prohibited, } from 'ajv-keywords/dist/keywords'; import ajvErrors from 'ajv-errors'; -import { formatExtensions, frontmatterFormats, extensionFormatters } from 'Formats/formats'; -import { getWidgets } from 'Lib/registry'; +import { formatExtensions, frontmatterFormats, extensionFormatters } from '../formats/formats'; +import { getWidgets } from '../lib/registry'; import uuid from 'uuid/v4'; import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n'; diff --git a/packages/netlify-cms-core/src/index.js b/packages/netlify-cms-core/src/index.js index a304f070..439218fc 100644 --- a/packages/netlify-cms-core/src/index.js +++ b/packages/netlify-cms-core/src/index.js @@ -1,5 +1,5 @@ import bootstrap from './bootstrap'; -import Registry from 'Lib/registry'; +import Registry from './lib/registry'; export const NetlifyCmsCore = { ...Registry, diff --git a/packages/netlify-cms-core/src/integrations/providers/algolia/implementation.js b/packages/netlify-cms-core/src/integrations/providers/algolia/implementation.js index b617fccb..b006aa6d 100644 --- a/packages/netlify-cms-core/src/integrations/providers/algolia/implementation.js +++ b/packages/netlify-cms-core/src/integrations/providers/algolia/implementation.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -import { createEntry } from 'ValueObjects/Entry'; -import { selectEntrySlug } from 'Reducers/collections'; +import { createEntry } from '../../../valueObjects/Entry'; +import { selectEntrySlug } from '../../../reducers/collections'; import { unsentRequest } from 'netlify-cms-lib-util'; const { fetchWithTimeout: fetch } = unsentRequest; diff --git a/packages/netlify-cms-core/src/integrations/providers/assetStore/implementation.js b/packages/netlify-cms-core/src/integrations/providers/assetStore/implementation.js index 31cc3b8d..9a7e70a0 100644 --- a/packages/netlify-cms-core/src/integrations/providers/assetStore/implementation.js +++ b/packages/netlify-cms-core/src/integrations/providers/assetStore/implementation.js @@ -1,5 +1,5 @@ import { pickBy, trimEnd } from 'lodash'; -import { addParams } from 'Lib/urlHelper'; +import { addParams } from '../../../lib/urlHelper'; import { unsentRequest } from 'netlify-cms-lib-util'; const { fetchWithTimeout: fetch } = unsentRequest; diff --git a/packages/netlify-cms-core/src/lib/registry.js b/packages/netlify-cms-core/src/lib/registry.js index b587ede1..84321f35 100644 --- a/packages/netlify-cms-core/src/lib/registry.js +++ b/packages/netlify-cms-core/src/lib/registry.js @@ -1,7 +1,7 @@ import { Map } from 'immutable'; import produce from 'immer'; import { oneLine } from 'common-tags'; -import EditorComponent from 'ValueObjects/EditorComponent'; +import EditorComponent from '../valueObjects/EditorComponent'; const allowedEvents = [ 'prePublish', diff --git a/packages/netlify-cms-core/src/mediaLibrary.ts b/packages/netlify-cms-core/src/mediaLibrary.ts index 2396892e..23803468 100644 --- a/packages/netlify-cms-core/src/mediaLibrary.ts +++ b/packages/netlify-cms-core/src/mediaLibrary.ts @@ -4,7 +4,7 @@ */ import { once } from 'lodash'; import { getMediaLibrary } from './lib/registry'; -import store from './redux'; +import { store } from './redux'; import { configFailed } from './actions/config'; import { createMediaLibrary, insertMedia } from './actions/mediaLibrary'; import { MediaLibraryInstance } from './types/redux'; diff --git a/packages/netlify-cms-core/src/reducers/__tests__/entryDraft.spec.js b/packages/netlify-cms-core/src/reducers/__tests__/entryDraft.spec.js index 054f07fd..9230eefa 100644 --- a/packages/netlify-cms-core/src/reducers/__tests__/entryDraft.spec.js +++ b/packages/netlify-cms-core/src/reducers/__tests__/entryDraft.spec.js @@ -1,5 +1,5 @@ import { Map, fromJS } from 'immutable'; -import * as actions from 'Actions/entries'; +import * as actions from '../../actions/entries'; import reducer from '../entryDraft'; jest.mock('uuid/v4', () => jest.fn(() => '1')); diff --git a/packages/netlify-cms-core/src/reducers/__tests__/mediaLibrary.spec.js b/packages/netlify-cms-core/src/reducers/__tests__/mediaLibrary.spec.js index fbb2700d..c51398ab 100644 --- a/packages/netlify-cms-core/src/reducers/__tests__/mediaLibrary.spec.js +++ b/packages/netlify-cms-core/src/reducers/__tests__/mediaLibrary.spec.js @@ -1,5 +1,5 @@ import { Map, fromJS } from 'immutable'; -import { mediaDeleted } from 'Actions/mediaLibrary'; +import { mediaDeleted } from '../../actions/mediaLibrary'; import mediaLibrary, { selectMediaFiles, selectMediaFileByPath, @@ -7,8 +7,8 @@ import mediaLibrary, { } from '../mediaLibrary'; jest.mock('uuid/v4'); -jest.mock('Reducers/entries'); -jest.mock('Reducers'); +jest.mock('../entries'); +jest.mock('../'); describe('mediaLibrary', () => { it('should remove media file by key', () => { @@ -44,7 +44,7 @@ describe('mediaLibrary', () => { }); it('should select draft media files from field when editing a draft', () => { - const { selectEditingDraft, selectMediaFolder } = require('Reducers/entries'); + const { selectEditingDraft, selectMediaFolder } = require('../../reducers/entries'); selectEditingDraft.mockReturnValue(true); selectMediaFolder.mockReturnValue('/static/images/posts/logos'); @@ -76,7 +76,7 @@ describe('mediaLibrary', () => { }); it('should select draft media files from collection when editing a draft', () => { - const { selectEditingDraft, selectMediaFolder } = require('Reducers/entries'); + const { selectEditingDraft, selectMediaFolder } = require('../../reducers/entries'); selectEditingDraft.mockReturnValue(true); selectMediaFolder.mockReturnValue('/static/images/posts'); @@ -108,7 +108,7 @@ describe('mediaLibrary', () => { }); it('should select global media files when not editing a draft', () => { - const { selectEditingDraft } = require('Reducers/entries'); + const { selectEditingDraft } = require('../../reducers/entries'); selectEditingDraft.mockReturnValue(false); @@ -120,7 +120,7 @@ describe('mediaLibrary', () => { }); it('should select global media files when not using asset store integration', () => { - const { selectIntegration } = require('Reducers'); + const { selectIntegration } = require('../../reducers'); selectIntegration.mockReturnValue({}); @@ -132,7 +132,7 @@ describe('mediaLibrary', () => { }); it('should return media file by path', () => { - const { selectEditingDraft } = require('Reducers/entries'); + const { selectEditingDraft } = require('../../reducers/entries'); selectEditingDraft.mockReturnValue(false); diff --git a/packages/netlify-cms-core/src/reducers/cursors.js b/packages/netlify-cms-core/src/reducers/cursors.js index 00a492b4..dd857780 100644 --- a/packages/netlify-cms-core/src/reducers/cursors.js +++ b/packages/netlify-cms-core/src/reducers/cursors.js @@ -5,7 +5,7 @@ import { SORT_ENTRIES_SUCCESS, FILTER_ENTRIES_SUCCESS, GROUP_ENTRIES_SUCCESS, -} from 'Actions/entries'; +} from '../actions/entries'; // Since pagination can be used for a variety of views (collections // and searches are the most common examples), we namespace cursors by diff --git a/packages/netlify-cms-core/src/reducers/entryDraft.js b/packages/netlify-cms-core/src/reducers/entryDraft.js index d59322b5..410c16f2 100644 --- a/packages/netlify-cms-core/src/reducers/entryDraft.js +++ b/packages/netlify-cms-core/src/reducers/entryDraft.js @@ -16,12 +16,12 @@ import { ENTRY_DELETE_SUCCESS, ADD_DRAFT_ENTRY_MEDIA_FILE, REMOVE_DRAFT_ENTRY_MEDIA_FILE, -} from 'Actions/entries'; +} from '../actions/entries'; import { UNPUBLISHED_ENTRY_PERSIST_REQUEST, UNPUBLISHED_ENTRY_PERSIST_SUCCESS, UNPUBLISHED_ENTRY_PERSIST_FAILURE, -} from 'Actions/editorialWorkflow'; +} from '../actions/editorialWorkflow'; import { get } from 'lodash'; import { selectFolderEntryExtension, selectHasMetaPath } from './collections'; import { join } from 'path'; diff --git a/packages/netlify-cms-core/src/redux/index.ts b/packages/netlify-cms-core/src/redux/index.ts index b4e0d255..55e1e942 100644 --- a/packages/netlify-cms-core/src/redux/index.ts +++ b/packages/netlify-cms-core/src/redux/index.ts @@ -11,4 +11,4 @@ const store = createStore( composeWithDevTools(applyMiddleware(thunkMiddleware as ThunkMiddleware, waitUntilAction)), ); -export default store; +export { store }; diff --git a/packages/netlify-cms-core/src/routing/history.ts b/packages/netlify-cms-core/src/routing/history.ts index e24c0a80..51562b7d 100644 --- a/packages/netlify-cms-core/src/routing/history.ts +++ b/packages/netlify-cms-core/src/routing/history.ts @@ -14,4 +14,4 @@ export function navigateToEntry(collectionName: string, slug: string) { return history.replace(`/collections/${collectionName}/entries/${slug}`); } -export default history; +export { history }; diff --git a/yarn.lock b/yarn.lock index a755d374..2726d5b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4916,17 +4916,6 @@ babel-plugin-minify-type-constructors@^0.4.3: dependencies: babel-helper-is-void-0 "^0.4.3" -babel-plugin-module-resolver@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-4.1.0.tgz#22a4f32f7441727ec1fbf4967b863e1e3e9f33e2" - integrity sha512-MlX10UDheRr3lb3P0WcaIdtCSRlxdQsB1sBqL7W0raF070bGl1HQQq5K3T2vf2XAYie+ww+5AKC/WrkjRO2knA== - dependencies: - find-babel-config "^1.2.0" - glob "^7.1.6" - pkg-up "^3.1.0" - reselect "^4.0.0" - resolve "^1.13.1" - babel-plugin-named-asset-import@^0.3.1: version "0.3.7" resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.7.tgz#156cd55d3f1228a5765774340937afc8398067dd" @@ -8609,14 +8598,6 @@ finalhandler@~1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-babel-config@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.2.0.tgz#a9b7b317eb5b9860cda9d54740a8c8337a2283a2" - integrity sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA== - dependencies: - json5 "^0.5.1" - path-exists "^3.0.0" - find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" @@ -11487,11 +11468,6 @@ json5@2.x, json5@^2.1.1, json5@^2.1.2: dependencies: minimist "^1.2.5" -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -14080,13 +14056,6 @@ pkg-up@2.0.0, pkg-up@^2.0.0: dependencies: find-up "^2.1.0" -pkg-up@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" - integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA== - dependencies: - find-up "^3.0.0" - platform@1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.3.tgz#646c77011899870b6a0903e75e997e8e51da7461" @@ -15716,11 +15685,6 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= -reselect@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7" - integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA== - resize-observer-polyfill@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"