kopia lustrzana https://github.com/wagtail/wagtail
Moved wagtailadmin/draftail entrypoints into client folder
rodzic
160d66ca93
commit
27133f9570
|
@ -1,10 +1,11 @@
|
|||
/* eslint-disable */
|
||||
import * as Draftail from 'draftail';
|
||||
import draftail, {
|
||||
Link,
|
||||
Document,
|
||||
ImageBlock,
|
||||
EmbedBlock,
|
||||
} from '../../../../../client/src/components/Draftail/index';
|
||||
} from '../components/Draftail/index';
|
||||
|
||||
/**
|
||||
* Entry point loaded when the Draftail editor is in use.
|
|
@ -1,6 +1,7 @@
|
|||
require('./draftail.entry');
|
||||
/* eslint-disable */
|
||||
require('./draftail');
|
||||
|
||||
describe('draftail.entry', () => {
|
||||
describe('draftail', () => {
|
||||
it('exposes module as global', () => {
|
||||
expect(window.draftail).toBeDefined();
|
||||
});
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import {
|
||||
|
@ -9,7 +10,7 @@ import {
|
|||
initSkipLink,
|
||||
initIE11Warning,
|
||||
initUpgradeNotification,
|
||||
} from '../../../../../client/src/index';
|
||||
} from '..';
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// Run react-axe in development only, so it does not affect performance
|
|
@ -1,12 +1,13 @@
|
|||
jest.mock("../../../../../client/src/index");
|
||||
/* eslint-disable */
|
||||
jest.mock("..");
|
||||
|
||||
const wagtail = require('../../../../../client/src/index');
|
||||
const wagtail = require('..');
|
||||
|
||||
document.addEventListener = jest.fn();
|
||||
|
||||
require('./wagtailadmin.entry');
|
||||
require('./wagtailadmin');
|
||||
|
||||
describe('wagtailadmin.entry', () => {
|
||||
describe('wagtailadmin', () => {
|
||||
const [event, listener] = document.addEventListener.mock.calls[0];
|
||||
|
||||
it('exposes components for reuse', () => {
|
|
@ -1,7 +1,5 @@
|
|||
const path = require('path');
|
||||
|
||||
// Generates a path to an entry file to be compiled by Webpack.
|
||||
const getEntryPath = (app, filename) => path.resolve('wagtail', app, 'static_src', `wagtail${app}`, 'app', filename);
|
||||
// Generates a path to the output bundle to be loaded in the browser.
|
||||
const getOutputPath = (app, filename) => path.join('wagtail', app, 'static', `wagtail${app}`, 'js', filename);
|
||||
|
||||
|
@ -15,17 +13,6 @@ const exposedDependencies = {
|
|||
};
|
||||
|
||||
module.exports = function exports() {
|
||||
const entry = {};
|
||||
|
||||
entry[getOutputPath('admin', 'wagtailadmin')] = [
|
||||
'./client/src/utils/polyfills.js',
|
||||
getEntryPath('admin', 'wagtailadmin.entry.js'),
|
||||
];
|
||||
entry[getOutputPath('admin', 'draftail')] = [
|
||||
'./client/src/utils/polyfills.js',
|
||||
getEntryPath('admin', 'draftail.entry.js'),
|
||||
];
|
||||
|
||||
const entrypoints = [
|
||||
'blocks/list',
|
||||
'blocks/sequence',
|
||||
|
@ -33,6 +20,7 @@ module.exports = function exports() {
|
|||
'blocks/struct',
|
||||
'core',
|
||||
'date-time-chooser',
|
||||
'draftail',
|
||||
'expanding_formset',
|
||||
'filtered-select',
|
||||
'hallo-bootstrap',
|
||||
|
@ -48,10 +36,12 @@ module.exports = function exports() {
|
|||
'task-chooser-modal',
|
||||
'task-chooser',
|
||||
'userbar',
|
||||
'wagtailadmin',
|
||||
'workflow-action',
|
||||
'workflow-status',
|
||||
];
|
||||
|
||||
const entry = {};
|
||||
entrypoints.forEach(moduleName => {
|
||||
entry[getOutputPath('admin', moduleName)] = [
|
||||
'./client/src/utils/polyfills.js',
|
||||
|
|
Ładowanie…
Reference in New Issue