Skip to content

Commit

Permalink
Switch from embor-browserify to ember-auto-import
Browse files Browse the repository at this point in the history
no issue
- minor reduction in build size. Before/after:
  - `vendor.min.js 3.32 MB (710.66 KB gzipped)`
  - `vendor.min.js 3.29 MB (706 KB gzipped)`
  • Loading branch information
kevinansfield committed Jan 22, 2019
1 parent c3e41fe commit 37a2312
Show file tree
Hide file tree
Showing 30 changed files with 73 additions and 605 deletions.
2 changes: 1 addition & 1 deletion app/components/gh-navitem-url-input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TextField from '@ember/component/text-field';
import validator from 'npm:validator';
import validator from 'validator';
import {computed} from '@ember/object';
import {run} from '@ember/runloop';

Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-profile-image.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import $ from 'jquery';
import Component from '@ember/component';
import md5 from 'npm:blueimp-md5';
import md5 from 'blueimp-md5';
import request from 'ember-ajax/request';
import validator from 'npm:validator';
import validator from 'validator';
import {htmlSafe} from '@ember/string';
import {inject as service} from '@ember/service';
import {task, timeout} from 'ember-concurrency';
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/settings/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import $ from 'jquery';
import Controller from '@ember/controller';
import randomPassword from 'ghost-admin/utils/random-password';
import validator from 'npm:validator';
import validator from 'validator';
import {
IMAGE_EXTENSIONS,
IMAGE_MIME_TYPES
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/setup/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Controller, {inject as controller} from '@ember/controller';
import DS from 'ember-data';
import Ember from 'ember';
import RSVP from 'rsvp';
import validator from 'npm:validator';
import validator from 'validator';
import {alias} from '@ember/object/computed';
import {computed} from '@ember/object';
import {A as emberA} from '@ember/array';
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/team/user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import boundOneWay from 'ghost-admin/utils/bound-one-way';
import isNumber from 'ghost-admin/utils/isNumber';
import validator from 'npm:validator';
import validator from 'validator';
import windowProxy from 'ghost-admin/utils/window-proxy';
import {alias, and, not, or, readOnly} from '@ember/object/computed';
import {computed} from '@ember/object';
Expand Down
2 changes: 1 addition & 1 deletion app/mixins/text-input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Mixin from '@ember/object/mixin';
import device from 'npm:current-device';
import device from 'current-device';
import {computed} from '@ember/object';

const keyCodes = {
Expand Down
2 changes: 1 addition & 1 deletion app/services/resize-detector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Service from '@ember/service';
import erd from 'npm:element-resize-detector';
import erd from 'element-resize-detector';

export default Service.extend({
init() {
Expand Down
8 changes: 4 additions & 4 deletions app/utils/format-markdown.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import markdownit from 'npm:markdown-it';
import markdownitFootnote from 'npm:markdown-it-footnote';
import markdownitLazyHeaders from 'npm:markdown-it-lazy-headers';
import markdownitMark from 'npm:markdown-it-mark';
import markdownit from 'markdown-it';
import markdownitFootnote from 'markdown-it-footnote';
import markdownitLazyHeaders from 'markdown-it-lazy-headers';
import markdownitMark from 'markdown-it-mark';
import {sanitizeHtml} from 'koenig-editor/helpers/sanitize-html';

let slugify = function slugify(inputString, usedHeaders) {
Expand Down
2 changes: 1 addition & 1 deletion app/utils/random-password.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import generatePassword from 'npm:password-generator';
import generatePassword from 'password-generator';

export default function () {
let word = generatePassword(6);
Expand Down
2 changes: 1 addition & 1 deletion app/validators/integration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/invite-user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/mixins/password.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Mixin from '@ember/object/mixin';
import validator from 'npm:validator';
import validator from 'validator';

const BAD_PASSWORDS = [
'1234567890',
Expand Down
2 changes: 1 addition & 1 deletion app/validators/nav-item.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/new-user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseValidator from './base';
import PasswordValidatorMixin from './mixins/password';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.extend(PasswordValidatorMixin, {
Expand Down
2 changes: 1 addition & 1 deletion app/validators/post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseValidator from './base';
import moment from 'moment';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank, isEmpty, isPresent} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/reset.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseValidator from './base';
import PasswordValidatorMixin from './mixins/password';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

const resetValidator = BaseValidator.extend(PasswordValidatorMixin, {
Expand Down
2 changes: 1 addition & 1 deletion app/validators/setting.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';

export default BaseValidator.create({
properties: ['title', 'description', 'password'],
Expand Down
2 changes: 1 addition & 1 deletion app/validators/setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NewUserValidator from 'ghost-admin/validators/new-user';
import validator from 'npm:validator';
import validator from 'validator';

export default NewUserValidator.create({
properties: ['name', 'email', 'password', 'blogTitle'],
Expand Down
2 changes: 1 addition & 1 deletion app/validators/signin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/slack-integration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/subscriber.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/tag-settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
2 changes: 1 addition & 1 deletion app/validators/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseValidator from './base';
import PasswordValidatorMixin from './mixins/password';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

const userValidator = BaseValidator.extend(PasswordValidatorMixin, {
Expand Down
2 changes: 1 addition & 1 deletion app/validators/webhook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseValidator from './base';
import validator from 'npm:validator';
import validator from 'validator';
import {isBlank} from '@ember/utils';

export default BaseValidator.create({
Expand Down
12 changes: 0 additions & 12 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ module.exports = function (environment) {
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
ENV.APP.LOG_VIEW_LOOKUPS = true;

// This is needed so that browserify dependencies in tests work correctly
// See https://github.com/ef4/ember-browserify/issues/14
ENV.browserify = {
tests: true
};

// Enable mirage here in order to mock API endpoints during development
ENV['ember-cli-mirage'] = {
enabled: false
Expand All @@ -68,12 +62,6 @@ module.exports = function (environment) {
ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;

// This is needed so that browserify dependencies in tests work correctly
// See https://github.com/ef4/ember-browserify/issues/14
ENV.browserify = {
tests: true
};

// Withuot manually setting this, pretender won't track requests
ENV['ember-cli-mirage'] = {
trackRequests: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Editor from 'mobiledoc-kit/editor/editor';
import layout from '../templates/components/koenig-basic-html-input';
import parserPlugins from '../options/basic-html-parser-plugins';
import registerKeyCommands, {BASIC_KEY_COMMANDS} from '../options/key-commands';
import validator from 'npm:validator';
import validator from 'validator';
import {MOBILEDOC_VERSION} from 'mobiledoc-kit/renderers/mobiledoc';
import {arrayToMap, toggleSpecialFormatEditState} from './koenig-editor';
import {assign} from '@ember/polyfills';
Expand Down
2 changes: 1 addition & 1 deletion lib/koenig-editor/addon/components/koenig-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import layout from '../templates/components/koenig-editor';
import parserPlugins from '../options/parser-plugins';
import registerKeyCommands from '../options/key-commands';
import registerTextExpansions from '../options/text-expansions';
import validator from 'npm:validator';
import validator from 'validator';
import {A} from '@ember/array';
import {MOBILEDOC_VERSION} from 'mobiledoc-kit/renderers/mobiledoc';
import {assign} from '@ember/polyfills';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"element-resize-detector": "^1.1.14",
"ember-ajax": "4.0.2",
"ember-assign-helper": "0.2.0",
"ember-browserify": "1.2.2",
"ember-auto-import": "1.2.19",
"ember-cli": "3.4.1",
"ember-cli-app-version": "3.2.0",
"ember-cli-babel": "6.18.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/gh-profile-image-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Pretender from 'pretender';
import Service from '@ember/service';
import hbs from 'htmlbars-inline-precompile';
import md5 from 'npm:blueimp-md5';
import md5 from 'blueimp-md5';
import {describe, it} from 'mocha';
import {expect} from 'chai';
import {find, render} from '@ember/test-helpers';
Expand Down
Loading

0 comments on commit 37a2312

Please sign in to comment.