Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as-clean-up-deps #1827

Merged
merged 8 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions app/models/build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { all } from 'rsvp';

import { isEmpty } from '@ember/utils';
import safelistedConfigKeys from 'travis/utils/safelisted-config-keys';
import pickBy from 'lodash.pickby';
import { isEmpty, isPresent } from '@ember/utils';
import configKeysMap from 'travis/utils/keys-map';
import Model from 'ember-data/model';
import DurationCalculations from 'travis/mixins/duration-calculations';
Expand Down Expand Up @@ -49,7 +47,11 @@ export default Model.extend(DurationCalculations, {
@computed('_config', 'currentState.stateName')
config(config, stateName) {
if (config) {
return pickBy(config);
return Object.keys(config).reduce((compact, key) => {
const value = config[key];
if (isPresent(value)) compact[key] = value;
return compact;
});
} else if (stateName !== 'root.loading') {
if (this.get('isFetchingConfig')) {
return;
Expand Down Expand Up @@ -98,11 +100,11 @@ export default Model.extend(DurationCalculations, {

@computed('jobs.@each.config')
rawConfigKeys(jobs) {
let keys = [];
jobs.forEach((job) => {
const configKeys = safelistedConfigKeys(job.get('config'));
return configKeys.forEach((key) => {
if (!keys.includes(key)) {
const keys = [];
jobs.forEach(job => {
const configKeys = job.config || [];
return configKeys.forEach(key => {
if (!keys.includes(key) && configKeysMap.hasOwnProperty(key)) {
return keys.pushObject(key);
}
});
Expand Down
9 changes: 0 additions & 9 deletions app/utils/safelisted-config-keys.js

This file was deleted.

24 changes: 13 additions & 11 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ module.exports = function () {
'ember-cli-babel': {
includePolyfill: true,
},
autoImport: {
webpack: {
// workaround for https://github.com/jeremyfa/yaml.js/issues/102
node: {
fs: 'empty'
},
module: {
noParse: /pusher/
}
}
},
babel: {
blacklist: ['regenerator'],
plugins: [
Expand Down Expand Up @@ -95,5 +84,18 @@ module.exports = function () {
destDir: '/images/emoji'
});

importNpmDependency(app, 'node_modules/fuzzysort/fuzzysort.js');
importNpmDependency(app, 'node_modules/pusher-js/dist/web/pusher.js');
importNpmDependency(app, 'node_modules/raven-js/dist/raven.js');
importNpmDependency(app, 'node_modules/emoji-js/lib/emoji.js');
importNpmDependency(app, 'node_modules/visibilityjs/index.js');
importNpmDependency(app, 'node_modules/ansiparse/lib/ansiparse.js', 'amd');
importNpmDependency(app, 'node_modules/yamljs/index.js');

return app.toTree(emojiAssets);
};

function importNpmDependency(app, path, transformation = 'cjs', alias) {
const as = alias || path.split('/')[1];
app.import(path, { using: [{ transformation, as }] });
}
Loading