Skip to content

Commit

Permalink
Adjust imports
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed May 27, 2018
1 parent 6c5502a commit a058afe
Show file tree
Hide file tree
Showing 30 changed files with 43 additions and 14 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
]
},
"jest": {
"modulePaths": ["./src"]
"modulePaths": ["./src"],
"moduleNameMapper": {
"^jquery$": "cash-dom"
}
},
"scripts": {
"lint": "eslint src",
Expand Down
2 changes: 2 additions & 0 deletions src/asset_manager/view/FileUploader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import _ from 'underscore';
import Backbone from 'backbone';
import fetch from 'utils/fetch';

module.exports = Backbone.View.extend(
Expand Down
1 change: 1 addition & 0 deletions src/block_manager/view/BlockView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { isObject } from 'underscore';
import { on, off, hasDnd } from 'utils/mixins';

Expand Down
3 changes: 2 additions & 1 deletion src/block_manager/view/CategoryView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var Backbone = require('backbone');
import _ from 'underscore';
import Backbone from 'backbone';

module.exports = Backbone.View.extend({
template: _.template(`
Expand Down
1 change: 1 addition & 0 deletions src/commands/view/CommandAbstract.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const $ = Backbone.$;

module.exports = Backbone.View.extend({
Expand Down
3 changes: 2 additions & 1 deletion src/css_composer/view/CssRulesView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const CssRuleView = require('./CssRuleView');
const CssGroupRuleView = require('./CssGroupRuleView');
const $ = Backbone.$;
Expand All @@ -6,7 +7,7 @@ const $ = Backbone.$;
const getBlockId = (pfx, widthMedia) =>
`${pfx}${widthMedia ? `-${widthMedia.replace('%', 'pc')}` : ''}`;

module.exports = require('backbone').View.extend({
module.exports = Backbone.View.extend({
initialize(o) {
const config = o.config || {};
this.atRules = {};
Expand Down
3 changes: 2 additions & 1 deletion src/device_manager/view/DevicesView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var Backbone = require('backbone');
import _ from 'underscore';
import Backbone from 'backbone';

module.exports = Backbone.View.extend({
template: _.template(`
Expand Down
1 change: 1 addition & 0 deletions src/dom_components/view/ComponentView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { isArray, isEmpty } from 'underscore';

const ComponentsView = require('./ComponentsView');
Expand Down
1 change: 1 addition & 0 deletions src/dom_components/view/ComponentsView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { isUndefined } from 'underscore';

module.exports = Backbone.View.extend({
Expand Down
1 change: 1 addition & 0 deletions src/domain_abstract/ui/Input.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const Backbone = require('backbone');
const $ = Backbone.$;

module.exports = Backbone.View.extend({
Expand Down
4 changes: 3 additions & 1 deletion src/domain_abstract/ui/InputColor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Backbone from 'backbone';
import { isUndefined } from 'underscore';
import ColorPicker from 'utils/ColorPicker';

require('utils/ColorPicker');
const Input = require('./Input');
const $ = Backbone.$;
ColorPicker($);

module.exports = Input.extend({
template() {
Expand Down
1 change: 1 addition & 0 deletions src/panels/view/ButtonView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { isString, isObject, isFunction } from 'underscore';
const $ = Backbone.$;

Expand Down
3 changes: 2 additions & 1 deletion src/selector_manager/view/ClassTagsView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var Backbone = require('backbone');
import _ from 'underscore';
import Backbone from 'backbone';
var ClassTagView = require('./ClassTagView');

module.exports = Backbone.View.extend({
Expand Down
2 changes: 2 additions & 0 deletions src/style_manager/model/Layer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Backbone from 'backbone';

module.exports = Backbone.Model.extend({
defaults: {
index: '',
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/model/Layers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const Layer = require('./Layer');

module.exports = Backbone.Collection.extend({
Expand Down
2 changes: 2 additions & 0 deletions src/style_manager/view/LayerView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Backbone from 'backbone';

module.exports = Backbone.View.extend({
events: {
click: 'active',
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertiesView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const PropertyView = require('./PropertyView');
const PropertyIntegerView = require('./PropertyIntegerView');
const PropertyRadioView = require('./PropertyRadioView');
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertyCompositeView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const PropertyView = require('./PropertyView');
const $ = Backbone.$;

Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertyFileView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const PropertyView = require('./PropertyView');
const $ = Backbone.$;

Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertyIntegerView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const InputNumber = require('domain_abstract/ui/InputNumber');
const PropertyView = require('./PropertyView');
const $ = Backbone.$;
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertySelectView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const $ = Backbone.$;

module.exports = require('./PropertyView').extend({
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/PropertyView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { bindAll, isArray, isUndefined } from 'underscore';
import { camelCase } from 'utils/mixins';

Expand Down
3 changes: 2 additions & 1 deletion src/style_manager/view/SectorView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var Backbone = require('backbone');
import _ from 'underscore';
import Backbone from 'backbone';
var PropertiesView = require('./PropertiesView');

module.exports = Backbone.View.extend({
Expand Down
1 change: 1 addition & 0 deletions src/style_manager/view/SectorsView.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
import { extend } from 'underscore';

const SectorView = require('./SectorView');
Expand Down
2 changes: 1 addition & 1 deletion src/trait_manager/view/TraitSelectView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const TraitView = require('./TraitView');
const $ = Backbone.$;
const $ = require('backbone').$;

module.exports = TraitView.extend({
initialize(o) {
Expand Down
6 changes: 2 additions & 4 deletions src/utils/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
// Author: Brian Grinstead
// License: MIT

(function(factory) {
factory(Backbone.$);
})(function($, undefined) {
export default function($, undefined) {
'use strict';

var defaultOpts = {
Expand Down Expand Up @@ -2531,4 +2529,4 @@
$.fn.spectrum.processNativeColorInputs();
}
});
});
}
1 change: 0 additions & 1 deletion test/helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _ from 'underscore';
import expect from 'expect';
import sinon from 'sinon';
import { JSDOM } from 'jsdom';

Expand Down
2 changes: 1 addition & 1 deletion test/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import grapesjs from './../src';
describe('Main', () => {
describe('Startup', () => {
it('Main object should be loaded', () => {
expect(grapesjs).toExist();
expect(grapesjs).toBeTruthy();
});
});

Expand Down
1 change: 1 addition & 0 deletions test/specs/css_composer/e2e/CssComposer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const $ = Backbone.$;

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions test/specs/dom_components/model/Component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Backbone from 'backbone';
const DomComponents = require('dom_components');
const Component = require('dom_components/model/Component');
const ComponentImage = require('dom_components/model/ComponentImage');
Expand Down

0 comments on commit a058afe

Please sign in to comment.