Skip to content

Commit

Permalink
Configure embroider to be on by default
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed May 25, 2020
1 parent 567c7cb commit 13689d2
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 588 deletions.
2 changes: 1 addition & 1 deletion client/web/emberclear/config/build/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
return {
// was for enabling dynamic import.
babel: {
plugins: [require.resolve('ember-auto-import/babel-plugin')],
// plugins: [require.resolve('ember-auto-import/babel-plugin')],
...(CONCAT_STATS ? { sourceMaps: 'inline' } : {}),
},
};
Expand Down
81 changes: 76 additions & 5 deletions client/web/emberclear/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const { buildWorkerTrees } = require('./config/build/workers');
const crypto = require('crypto');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const { EMBROIDER, CONCAT_STATS } = process.env;
let { EMBROIDER, CONCAT_STATS } = process.env;

if (EMBROIDER !== 'true') {
EMBROIDER = true;
}

module.exports = function (defaults) {
let environment = EmberApp.env();
Expand Down Expand Up @@ -120,15 +124,82 @@ module.exports = function (defaults) {

return compatBuild(app, Webpack, {
extraPublicTrees: additionalTrees,
// staticAddonTestSupportTrees: true,
// staticAddonTrees: true,
// staticHelpers: true,
// staticComponents: true,
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
// splitAtRoutes: true,
// skipBabel: [],
packageRules: [
{
package: 'ember-intl',
semverRange: '^4.3.2',
addonModules: {
'services/intl.js': {
dependsOnModules: ['../adapters/default.js'],
},
},
},
{
package: 'ember-cli-clipboard',
addonModules: {
'components/copy-button.js': {},
},
components: {
'{{copy-button}}': {
layout: {
addonPath: 'templates/components/copy-button.hbs',
},
acceptsComponentArguments: [
'clipboardText',
'clipboardTarget',
'clipboardAction',
'success',
'error',
'buttonType',
],
},
},
},
// {
// package: 'ember-destroyable-polyfill',
// semverRange: '^0.4.0',
// addonModules: {
// '-internal/patch-meta':{
// dependsO
// }
// }
// }
],
compatAdapters: new Map([
['@ember-data/model', EmberDataCompatAdapter],
['@ember-data/model', EmberDataCompatAdapter],
['@ember-data/store', EmberDataCompatAdapter],
['@ember-data/record-data', EmberDataCompatAdapter],
['ember-destroyable-polyfill', EmberDestroyableCompatAdapter],
]),
});
}

// Old-style broccoli-build
return mergeTrees([app.toTree(), ...additionalTrees]);
};

const { V1Addon } = require('@embroider/compat');
const { forceIncludeModule } = require('@embroider/compat/src/compat-utils');

class EmberDataCompatAdapter extends V1Addon {
get packageMeta() {
return forceIncludeModule(super.packageMeta, './-private');
}
}

class EmberDestroyableCompatAdapter extends V1Addon {
get packageMeta() {
let meta = super.packageMeta;
meta = forceIncludeModule(meta, './-internal/patch-core-object');
meta = forceIncludeModule(meta, './-internal/patch-meta');

return meta;
}
}
8 changes: 4 additions & 4 deletions client/web/emberclear/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
"@ember/optional-features": "^1.3.0",
"@ember/render-modifiers": "^1.0.2",
"@ember/test-helpers": "^1.7.1",
"@embroider/compat": "^0.17.0",
"@embroider/core": "^0.17.0",
"@embroider/webpack": "^0.17.0",
"@embroider/compat": "^0.18.0",
"@embroider/core": "^0.18.0",
"@embroider/webpack": "^0.18.0",
"@fortawesome/ember-fontawesome": "^0.2.1",
"@fortawesome/free-brands-svg-icons": "^5.13.0",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
Expand Down Expand Up @@ -142,7 +142,7 @@
"ember-cli": "^3.18.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "7.20.0",
"ember-cli-clipboard": "github:NullVoxPopuli/ember-cli-clipboard#octaneify",
"ember-cli-clipboard": "github:jkusa/ember-cli-clipboard#master",
"ember-cli-code-coverage": "github:kategengler/ember-cli-code-coverage",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-dependency-lint": "^1.1.3",
Expand Down
4 changes: 2 additions & 2 deletions client/web/emberclear/tests/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Application from '../app';
import registerWaiter from 'ember-raf-scheduler/test-support/register-waiter';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import start from 'ember-exam/test-support/start';
// import { start } from 'ember-qunit';
// import start from 'ember-exam/test-support/start';
import { start } from 'ember-qunit';
import QUnit from 'qunit';

// Install Types and assertion extensions
Expand Down
Loading

0 comments on commit 13689d2

Please sign in to comment.