Skip to content

Commit

Permalink
refactor: use embroider
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredgalanis committed Jul 8, 2024
1 parent 0964c95 commit aaf9ec7
Show file tree
Hide file tree
Showing 14 changed files with 1,796 additions and 550 deletions.
7 changes: 0 additions & 7 deletions app/models/deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@ export default class DepositModel extends Model {
@belongsTo('submission', { async: false, inverse: null }) submission;
@belongsTo('repository', { async: false, inverse: null }) repository;
}

export const DepositStatus = {
SUBMITTED: 'SUBMITTED',
REJECTED: 'REJECTED',
FAILED: 'FAILED',
ACCEPTED: 'ACCEPTED',
};
9 changes: 0 additions & 9 deletions app/models/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable ember/no-computed-properties-in-native-classes */
import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object';

export default class UserModel extends Model {
/**
Expand All @@ -19,18 +17,11 @@ export default class UserModel extends Model {
/** Possible values: admin, submitter */
@attr('set') roles;

@computed('roles.[]')
get isSubmitter() {
return this.roles ? this.roles.includes('submitter') : false;
}

@computed('roles.[]')
get isAdmin() {
return this.roles ? this.roles.includes('admin') : false;
}
}

export const Role = {
SUBMITTER: 'SUBMITTER',
ADMIN: 'ADMIN',
};
1 change: 0 additions & 1 deletion app/services/metadata-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Service, { inject as service } from '@ember/service';
import ENV from 'pass-ui/config/environment';
import Ajv from 'ajv'; // https://github.com/epoberezkin/ajv
import _ from 'lodash';
import fetch from 'fetch';

/**
* Service to manipulate Alpaca schemas
Expand Down
1 change: 0 additions & 1 deletion app/services/policies.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Service, { inject as service } from '@ember/service';
import ENV from 'pass-ui/config/environment';
import { task, all, hash } from 'ember-concurrency';
import { get } from '@ember/object';
import fetch from 'fetch';
import { run } from '@ember/runloop';

/**
Expand Down
6 changes: 0 additions & 6 deletions babel.config.json

This file was deleted.

28 changes: 25 additions & 3 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function (defaults) {
inlineContent: {
'initial-state': './initial-state.html',
},

'ember-composable-helpers': {
only: ['queue', 'compute', 'invoke', 'includes'],
},
Expand Down Expand Up @@ -41,12 +42,19 @@ module.exports = function (defaults) {
return className;
},
},

fingerprint: {
enabled: false,
},

'ember-test-selectors': {
strip: false,
},

'ember-bootstrap': {
bootstrapVersion: 5,
importBootstrapCSS: true,
},
});

// Use `app.import` to add additional libraries to the generated
Expand All @@ -62,8 +70,22 @@ module.exports = function (defaults) {
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

app.import('node_modules/ember-modal-dialog/app/styles/ember-modal-dialog/ember-modal-structure.css');
app.import('node_modules/ember-modal-dialog/app/styles/ember-modal-dialog/ember-modal-appearance.css');
const { Webpack } = require('@embroider/webpack');

return app.toTree();
return require('@embroider/compat').compatBuild(app, Webpack, {
extraPublicTrees: [],
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
staticHelpers: true,
staticModifiers: true,
staticComponents: true,
staticEmberSource: true,
amdCompatibility: {
es: [],
},
// splitAtRoutes: ['route.name'], // can also be a RegExp
// packagerOptions: {
// webpackConfig: { }
// }
});
};
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,25 @@
"@ember/render-modifiers": "^2.0.5",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.3.0",
"@embroider/compat": "^3.5.6",
"@embroider/core": "^3.4.14",
"@embroider/webpack": "^4.0.4",
"@faker-js/faker": "^8.1.0",
"@fortawesome/ember-fontawesome": "^0.4.3",
"@fortawesome/ember-fontawesome": "^2.0.0",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"ajv": "^6.10.0",
"alpaca": "1.5.27",
"babel-plugin-dynamic-import-node": "^2.3.3",
"bootstrap": "^5.0.0",
"broccoli-asset-rev": "^3.0.0",
"clean-css": ">=4.1.11",
"concurrently": "^8.2.2",
"coveralls": "^3.0.2",
"ember-ajax": "^5.0.0",
"ember-auto-import": "^2.7.2",
"ember-bootstrap": "^6.3.2",
"ember-cli": "~5.8.0",
"ember-cli-app-version": "^6.0.1",
"ember-cli-babel": "^8.2.0",
Expand All @@ -74,11 +78,11 @@
"ember-concurrency-decorators": "^1.0.0",
"ember-css-modules": "^2.0.1",
"ember-data": "~5.3.3",
"ember-fetch": "^8.1.2",
"ember-file-upload": "^7.3.0",
"ember-inflector": "^4.0.2",
"ember-load-initializers": "^2.1.2",
"ember-lodash": "^4.19.4",
"ember-modal-dialog": "^4.1.2",
"ember-modal-dialog": "^4.1.4",
"ember-models-table": "^5.4.1",
"ember-modifier": "^4.1.0",
"ember-page-title": "^8.2.3",
Expand All @@ -92,6 +96,7 @@
"ember-template-lint": "6.0.0",
"ember-template-lint-plugin-prettier": "^5.0.0",
"ember-test-selectors": "^6.0.0",
"ember-tether": "^3.1.0",
"ember-truth-helpers": "^3.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -116,7 +121,7 @@
"stylelint-prettier": "^5.0.0",
"sweetalert2": "^7.29.0",
"tracked-built-ins": "^3.3.0",
"webpack": "^5.91.0"
"webpack": "^5.92.1"
},
"husky": {
"hooks": {
Expand Down
Loading

0 comments on commit aaf9ec7

Please sign in to comment.