Skip to content

Commit

Permalink
Merge pull request #164 from josemarluedke/feat/embroider-take-2
Browse files Browse the repository at this point in the history
Setup Embroider for testing in CI
  • Loading branch information
josemarluedke committed Jul 23, 2021
2 parents f9b950c + 61df554 commit acd91bf
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 68 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
ember-try-scenario:
- ember-release
- ember-beta
# - embroider-safe
# - embroider-optimized
# - ember-canary https://github.com/jeffjewiss/ember-cli-postcss/issues/745

steps:
Expand Down
79 changes: 29 additions & 50 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = function () {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
useYarn: true,
scenarios: [
{
name: 'ember-3.16',
npm: {
devDependencies: {
'ember-source': '~3.16.0'
}
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release')
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta')
}
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
]
};
});
},
embroiderSafe(),
embroiderOptimized()
]
};
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"eslint": "^7.31.0",
"lerna": "^4.0.0",
"typescript": "^4.3.5"
},
"dependencies": {
"@embroider/test-setup": "^0.43.0"
}
}
3 changes: 2 additions & 1 deletion packages/buttons/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/buttons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"postpack": "ember ts:clean"
},
"dependencies": {
"@embroider/test-setup": "^0.43.0",
"@frontile/tailwindcss-plugin-helpers": "^0.12.0",
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^5.7.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/changeset-form/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/changeset-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"postpack": "ember ts:clean"
},
"dependencies": {
"@embroider/test-setup": "^0.43.0",
"@frontile/forms": "^0.12.0",
"ember-changeset": "^3.14.1",
"ember-changeset-validations": "^3.15.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@ember/render-modifiers": "^1.0.2",
"@ember/test-waiters": "^2.4.5",
"@embroider/test-setup": "^0.43.0",
"@frontile/tailwindcss-plugin-helpers": "^0.12.0",
"ember-cli-babel": "^7.26.6",
"ember-cli-htmlbars": "^5.7.1",
Expand Down
30 changes: 18 additions & 12 deletions packages/forms/addon/components/form-select.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<FormField
@size={{@size}}
class={{use-frontile-class "form-select" @size class=@containerClass}}
as |f|
class={{use-frontile-class "form-select" @size class=@containerClass}} as |f|
>
{{#if @label}}
<f.Label
Expand All @@ -14,25 +13,33 @@
{{/if}}

{{#if @hint}}
<f.Hint
class={{use-frontile-class "form-select" @size part="hint"}}
>
<f.Hint class={{use-frontile-class "form-select" @size part="hint"}}>
{{@hint}}
</f.Hint>
{{/if}}

{{#let (component (if @isMultiple "power-select-multiple" "power-select")) as |Component|}}
{{#let
(if
@isMultiple (component "power-select-multiple") (component "power-select")
) as |Component|
}}
<Component
...attributes
@onChange={{this.handleChange}}
@onFocus={{this.handleFocusIn}}
@onBlur={{this.handleFocusOut}}
@onOpen={{this.handleOpen}}
@onClose={{this.handleClose}}
@ariaDescribedBy="{{if @hint f.hintId}}{{if this.showErrorFeedback (concat " " f.feedbackId)}}{{if @ariaDescribedBy (concat " " @ariaDescribedBy)}}"
@ariaLabelledBy="{{if @label f.id}}{{if @ariaLabelledBy (concat " "@ariaLabelledBy)}}"
@ariaDescribedBy="{{if @hint f.hintId}}{{
if this.showErrorFeedback (concat " " f.feedbackId)
}}{{if @ariaDescribedBy (concat " " @ariaDescribedBy)}}"
@ariaLabelledBy="{{if @label f.id}}{{
if @ariaLabelledBy (concat " " @ariaLabelledBy)
}}"
@ariaInvalid={{if this.showErrorFeedback "true"}}
@triggerClass="{{@triggerClass}} {{if @size (concat "ember-power-select-trigger-" @size)}} {{use-frontile-class "form-select" @size part="select"}}"
@triggerClass="{{@triggerClass}} {{
if @size (concat "ember-power-select-trigger-" @size)
}} {{use-frontile-class "form-select" @size part="select"}}"
@highlightOnHover={{@highlightOnHover}}
@placeholderComponent={{@placeholderComponent}}
@searchMessage={{@searchMessage}}
Expand Down Expand Up @@ -79,8 +86,7 @@
@optionsComponent={{@optionsComponent}}
@extra={{@extra}}
@groupComponent={{@groupComponent}}
@afterOptionsComponent={{@afterOptionsComponent}}
as |option term|
@afterOptionsComponent={{@afterOptionsComponent}} as |option term|
>
{{yield option term}}
</Component>
Expand All @@ -92,4 +98,4 @@
@errors={{@errors}}
/>
{{/if}}
</FormField>
</FormField>
3 changes: 2 additions & 1 deletion packages/forms/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"postpack": "ember ts:clean"
},
"dependencies": {
"@embroider/test-setup": "^0.43.0",
"@frontile/core": "^0.12.0",
"@frontile/tailwindcss-plugin-helpers": "^0.12.0",
"ember-cli-babel": "^7.26.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/notifications/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"@ember/render-modifiers": "^1.0.2",
"@embroider/test-setup": "^0.43.0",
"@frontile/core": "^0.12.0",
"@frontile/tailwindcss-plugin-helpers": "^0.12.0",
"ember-cli-babel": "^7.26.6",
Expand Down
3 changes: 2 additions & 1 deletion packages/overlays/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
1 change: 1 addition & 0 deletions packages/overlays/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"@ember/render-modifiers": "^1.0.2",
"@embroider/test-setup": "^0.43.0",
"@frontile/core": "^0.12.0",
"@frontile/forms": "^0.12.0",
"@frontile/tailwindcss-plugin-helpers": "^0.12.0",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,14 @@
semver "^7.3.2"
typescript-memoize "^1.0.0-alpha.3"

"@embroider/test-setup@^0.43.0":
version "0.43.0"
resolved "https://registry.yarnpkg.com/@embroider/test-setup/-/test-setup-0.43.0.tgz#c549bec9b3597ad30793ba008fcc9f6eafbfa03e"
integrity sha512-8LWpqqdPw283yb0LWxbXwf75LTbnpka6kCnTYcFh8MIRR6yraEXNu2BL6xezI5PCbYqc+fhNQGA8gUHbxAOfYw==
dependencies:
lodash "^4.17.21"
resolve "^1.20.0"

"@embroider/util@^0.39.0 || ^0.40.0 || ^0.41.0", "@embroider/util@^0.39.1 || ^0.40.0 || ^0.41.0":
version "0.41.0"
resolved "https://registry.yarnpkg.com/@embroider/util/-/util-0.41.0.tgz#5324cb4742aa4ed8d613c4f88a466f73e4e6acc1"
Expand Down

0 comments on commit acd91bf

Please sign in to comment.