Skip to content

Commit c94d9b2

Browse files
committedDec 8, 2020
Fix regression in non-embroider apps, fix broken tests.
1 parent 3e35f08 commit c94d9b2

File tree

7 files changed

+1601
-93
lines changed

7 files changed

+1601
-93
lines changed
 

‎eyeglass.code-workspace

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
},
1818
{
1919
"path": "private-packages/lazy-test-addon"
20+
},
21+
{
22+
"path": "private-packages/eyeglass-embroider-app"
2023
}
2124
],
2225
"settings": {

‎packages/ember-cli-eyeglass/src/index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ function getDefaultAssetHttpPrefix(parent: any): string {
9292
if (isLazyEngine(current)) {
9393
// only lazy engines will inline their assets in the engines-dist folder
9494
return `engines-dist/${current.name}/assets`;
95+
} else if (isEngine(current)) {
96+
return `${current.name}/assets`;
9597
}
9698
current = current.parent;
9799
}
@@ -173,6 +175,7 @@ const EMBER_CLI_EYEGLASS = {
173175
name,
174176
parentPath,
175177
app,
178+
isEngine: isEngine(this.parent),
176179
assets: new BroccoliSymbolicLinker({}, {
177180
annotation: `Eyeglass Assets for ${app.name}/${name}`,
178181
persistentOutput: true,
@@ -229,7 +232,7 @@ const EMBER_CLI_EYEGLASS = {
229232
addonInfo.assets.reset();
230233
});
231234
let withoutSassFiles = funnel(tree, {
232-
srcDir: isApp ? 'app/styles' : undefined,
235+
srcDir: (isApp && !embroiderEnabled()) ? 'app/styles' : undefined,
233236
destDir: isApp ? 'assets' : undefined,
234237
exclude: ['**/*.s{a,c}ss'],
235238
allowEmpty: true,
@@ -346,6 +349,11 @@ const EMBER_CLI_EYEGLASS = {
346349
}
347350
};
348351

352+
function isEngine(appOrAddon: any): boolean {
353+
let keywords: Array<string> = appOrAddon._packageInfo.pkg.keywords || new Array<string>();
354+
return keywords.includes("ember-engine");
355+
}
356+
349357
function convertURLToPath(fragment: string): string {
350358
return (new URL(`file://${fragment}`)).pathname;
351359
}

‎private-packages/eager-test-addon/addon/styles/addon.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33
.eager-addon {
44
color: blue;
5-
background-image: asset-url('img/test.jpg')
5+
height: 200px;
6+
background-image: asset-url('img/test.jpg');
7+
background-size: contain;
8+
background-position-y: 10px;
9+
background-repeat: no-repeat;
610
}

‎private-packages/eyeglass-test-app/tests/acceptance/eyeglass-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module('Acceptance | eyeglass', function(hooks) {
7777

7878
const lazyStyle = self.getComputedStyle(document.querySelector('.lazy'));
7979

80-
assert.contains('/engines-dist/lazy-test-addon/assets/img/test.svg', lazyStyle.borderImage);
80+
assert.contains('/engines-dist/lazy-test-addon/assets/img/test.svg', lazyStyle.backgroundImage);
8181
});
8282

8383
test('/assets/eyeglass-test-app.css', async function(assert) {

‎private-packages/lazy-test-addon/addon/styles/addon.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
.lazy {
44
background: blue;
5-
border-image: asset-url('img/test.svg');
5+
height: 200px;
6+
background-image: asset-url('img/test.svg');
7+
background-size: contain;
68
}

‎private-packages/lazy-test-addon/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"ember-engine"
88
],
99
"dependencies": {
10-
"ember-cli-babel": "^7.13.0",
10+
"ember-cli-babel": "^7.20.5",
1111
"ember-cli-eyeglass": "^7.0.2",
12-
"ember-cli-htmlbars": "^4.2.2"
12+
"ember-cli-htmlbars": "^4.3.1"
1313
},
1414
"ember-addon": {
1515
"engineConfigPath": "config",

‎yarn.lock

+1,578-87
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.