Ingo Schommer 2016-03-26 18:41:24 +13:00
parent c70590e50c
commit 47dd7b48af
21 changed files with 58 additions and 57 deletions

View File

@ -4,12 +4,12 @@ import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import reducerRegister from 'reducer-register';
import * as configActions from '../state/config/actions';
import ConfigReducer from '../state/config/reducer';
import SchemaReducer from '../state/schema/reducer';
import * as configActions from 'state/config/actions';
import ConfigReducer from 'state/config/reducer';
import SchemaReducer from 'state/schema/reducer';
// Sections
import CampaignAdmin from '../sections/campaign-admin';
import CampaignAdmin from 'sections/campaign-admin';
function appBoot() {
reducerRegister.add('config', ConfigReducer);

View File

@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class ActionComponent extends SilverStripeComponent {
constructor(props) {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class FormActionComponent extends SilverStripeComponent {

View File

@ -2,12 +2,12 @@ import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import $ from 'jQuery';
import * as schemaActions from '../../state/schema/actions';
import SilverStripeComponent from '../../SilverStripeComponent';
import FormComponent from '../form';
import TextField from '../text-field';
import HiddenField from '../hidden-field';
import GridField from '../../components/grid-field';
import * as schemaActions from 'state/schema/actions';
import SilverStripeComponent from 'silverstripe-component.js';
import FormComponent from 'components/form';
import TextField from 'components/text-field';
import HiddenField from 'components/hidden-field';
import GridField from 'components/grid-field';
// Using this to map field types to components until we implement dependency injection.
var fakeInjector = {

View File

@ -1,4 +1,4 @@
jest.unmock('../../../SilverStripeComponent');
jest.unmock('silverstripe-component.js');
jest.unmock('../');
import { FormBuilderComponent } from '../';

View File

@ -1,6 +1,6 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import FormActionComponent from '../form-action';
import SilverStripeComponent from 'silverstripe-component.js';
import FormActionComponent from 'components/form-action';
class FormComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class GridFieldCellComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class GridFieldHeaderCellComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
import GridFieldRowComponent from './row';
class GridFieldHeaderComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
import GridFieldTable from './table';
import GridFieldHeader from './header';
import GridFieldHeaderCell from './header-cell';

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class GridFieldRowComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class GridFieldTableComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class HiddenFieldComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class NorthHeaderBreadcrumbsComponent extends SilverStripeComponent {

View File

@ -1,6 +1,6 @@
import React from 'react';
import NorthHeaderBreadcrumbsComponent from '../north-header-breadcrumbs';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class NorthHeaderComponent extends SilverStripeComponent {

View File

@ -1,5 +1,5 @@
import React from 'react';
import SilverStripeComponent from '../../SilverStripeComponent';
import SilverStripeComponent from 'silverstripe-component.js';
class TextFieldComponent extends SilverStripeComponent {

View File

@ -1,11 +1,10 @@
import React from 'react';
import { connect } from 'react-redux';
import SilverStripeComponent from 'silverstripe-component';
import ActionButton from 'action-button';
import ActionButton from 'components/action-button';
import i18n from 'i18n';
import NorthHeader from 'north-header';
import GridField from 'grid-field';
import FormBuilder from '../../components/form-builder';
import NorthHeader from 'components/north-header';
import FormBuilder from 'components/form-builder';
class CampaignAdminContainer extends SilverStripeComponent {

View File

@ -4,7 +4,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import CampaignAdmin from './controller';
import campaignsReducer from '../../state/campaigns/reducer';
import campaignsReducer from 'state/campaigns/reducer';
// TODO: Move this to the controller.
reducerRegister.add('campaigns', campaignsReducer);

View File

@ -41,7 +41,10 @@ var PATHS = {
// Folders which contain both scss and css folders to be compiled
var rootCompileFolders = [PATHS.FRAMEWORK, PATHS.ADMIN, PATHS.FRAMEWORK_DEV_INSTALL]
var browserifyOptions = { debug: true };
var browserifyOptions = {
debug: true,
paths: [PATHS.ADMIN_JAVASCRIPT_SRC, PATHS.FRAMEWORK_JAVASCRIPT_SRC]
};
var babelifyOptions = {
presets: ['es2015', 'react'],
@ -189,22 +192,23 @@ gulp.task('bundle-lib', function bundleLib() {
.on('update', bundleLib)
.on('log', function (msg) { gulpUtil.log('Finished', 'bundled ' + bundleFileName + ' ' + msg) })
.transform('babelify', babelifyOptions)
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/action', { expose: 'action-button' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/action', { expose: 'components/action-button' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form', { expose: 'components/form' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form-action', { expose: 'components/form-action' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form-builder', { expose: 'components/form-builder' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field', { expose: 'components/grid-field' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/cell', { expose: 'components/grid-field/cell' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/header', { expose: 'components/grid-field/header' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/header-cell', { expose: 'components/grid-field/header-cell' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/row', { expose: 'components/grid-field/row' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/table', { expose: 'components/grid-field/table' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/hidden-field', { expose: 'components/hidden-field' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/text-field', { expose: 'components/text-field' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/north-header', { expose: 'components/north-header' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/north-header-breadcrumbs', { expose: 'components/north-header-breadcrumbs' })
.require('deep-freeze', { expose: 'deep-freeze' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form', { expose: 'form' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form-action', { expose: 'form-action' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/form-builder', { expose: 'form-builder' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field', { expose: 'grid-field' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/cell', { expose: 'grid-field-cell' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/header', { expose: 'grid-field-header' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/header-cell', { expose: 'grid-field-header-cell' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/row', { expose: 'grid-field-row' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/grid-field/table', { expose: 'grid-field-table' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/hidden-field', { expose: 'hidden-field' })
.require(PATHS.FRAMEWORK_JAVASCRIPT_SRC + '/i18n.js', { expose: 'i18n' })
.require(PATHS.FRAMEWORK_JAVASCRIPT_SRC + '/jQuery.js', { expose: 'jQuery' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/north-header', { expose: 'north-header' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/north-header-breadcrumbs', { expose: 'north-header-breadcrumbs' })
.require('react', { expose: 'react' })
.require('react-addons-css-transition-group', { expose: 'react-addons-css-transition-group' })
.require('react-addons-test-utils', { expose: 'react-addons-test-utils' })
@ -214,8 +218,7 @@ gulp.task('bundle-lib', function bundleLib() {
.require('redux', { expose: 'redux' })
.require('redux-thunk', { expose: 'redux-thunk' })
.require(PATHS.FRAMEWORK_JAVASCRIPT_SRC + '/router.js', { expose: 'router' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/SilverStripeComponent', { expose: 'silverstripe-component' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/components/text-field', { expose: 'text-field' })
.require(PATHS.ADMIN_JAVASCRIPT_SRC + '/silverstripe-component.js', { expose: 'silverstripe-component' })
.bundle()
.on('update', bundleLib)
.on('error', notify.onError({ message: bundleFileName + ': <%= error.message %>' }))
@ -256,13 +259,13 @@ gulp.task('bundle-framework', function bundleBoot() {
.on('update', bundleBoot)
.on('log', function (msg) { gulpUtil.log('Finished', 'bundled ' + bundleFileName + ' ' + msg) })
.transform('babelify', babelifyOptions)
.external('action-button')
.external('components/action-button')
.external('components/north-header')
.external('components/form-builder')
.external('deep-freeze')
.external('grid-field')
.external('components/grid-field')
.external('i18n')
.external('jQuery')
.external('jQuery')
.external('north-header')
.external('page.js')
.external('react-addons-test-utils')
.external('react-dom')

View File

@ -11,13 +11,12 @@
},
"scripts": {
"build": "gulp build",
"bundle": "gulp bundle",
"coverage": "jest --coverage",
"css": "gulp css",
"lock": "npm-shrinkwrap --dev",
"sanity": "gulp sanity",
"sprites": "gulp sprites",
"test": "jest",
"test": "NODE_PATH=\"./javascript/src:./admin/javascript/src\" jest",
"coverage": "NODE_PATH=\"./javascript/src:./admin/javascript/src\" jest --coverage",
"thirdparty": "gulp thirdparty"
},
"repository": {