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

configure embroider to be on by default #784

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/workflows/web-app-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ jobs:
# name: coverage
# path: client/web/emberclear/coverage/


##############################################################
#

bundle_analysis:
name: Bundle Analysis
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion client/web/addons/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
const PostCSSImport = require('postcss-import');
const PostCSSNext = require('postcss-cssnext');

const nodeModules = path.join(__dirname, '..', '..', '..', 'node_modules');
const nodeModules = path.join(__dirname, '..', '..', 'node_modules');
const addonStyles = path.join(__dirname, 'addon', 'styles');

const importConfig = PostCSSImport({
Expand Down
2 changes: 1 addition & 1 deletion client/web/addons/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ember-cli-babel": "7.21.0",
"ember-cli-htmlbars": "5.1.2",
"ember-cli-postcss": "6.0.1",
"ember-cli-typescript": "3.1.4",
"ember-cli-typescript": "4.0.0-alpha.1",
"ember-focus-trap": "0.4.0",
"ember-keyboard": "6.0.0",
"ember-named-blocks-polyfill": "0.2.1",
Expand Down
2 changes: 0 additions & 2 deletions client/web/emberclear/config/build/babel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module.exports = {
buildBabelConfig({ CONCAT_STATS }) {
return {
// was for enabling dynamic import.
babel: {
plugins: [require.resolve('ember-auto-import/babel-plugin')],
...(CONCAT_STATS ? { sourceMaps: 'inline' } : {}),
},
};
Expand Down
73 changes: 72 additions & 1 deletion client/web/emberclear/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 @@ -119,9 +123,76 @@ module.exports = function (defaults) {
// staticComponents: true,
// splitAtRoutes: true,
// skipBabel: [],
packageRules: [
// {
// package: 'ember-intl',
// semverRange: '^5.2.0',
// 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;
}
}
1 change: 1 addition & 0 deletions client/web/emberclear/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"dependencies": {
"@emberclear/ui": "*",
"blakejs": "1.1.0",
"ember-cli-typescript": "4.0.0-alpha.1",
"emojis": "1.0.10",
"hammerjs": "2.0.8",
"localforage": "1.7.4",
Expand Down
Loading