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

Test ember-fetch against an embroider build #554

Open
wants to merge 4 commits into
base: main
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=embroider-tests

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
Expand Down
10 changes: 10 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ module.exports = async function() {
'@ember/jquery': '^0.5.1'
}
}
},
{
name: 'embroider-tests',
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
},
},
}
]
};
Expand Down
10 changes: 10 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ module.exports = function(defaults) {
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
if ('@embroider/webpack' in app.dependencies()) {
const { Webpack } = require('@embroider/webpack'); // eslint-disable-line
return require('@embroider/compat') // eslint-disable-line
.compatBuild(app, Webpack, {
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: true,
staticComponents: true,
});
}

return app.toTree();
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"calculate-cache-key-for-tree": "^2.0.0",
"caniuse-api": "^3.0.0",
"ember-cli-babel": "^7.19.0",
"ember-cli-typescript": "^3.1.3",
"ember-cli-typescript": "^4.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be split out, I think. It seems unrelated to the overall goal of testing Embroider.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But updating the dependency addressed an issue where Babel detected duplicate plugins.

"node-fetch": "^2.6.0",
"whatwg-fetch": "^3.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion test/fastboot-build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('it builds with ember-cli-fastboot', function() {
app = new AddonTestApp();

return app
.create('dummy', { skipNpm: true })
.create('dummy', { skipNpm: true, emberVersion: 'latest' })
.then(app =>
app.editPackageJSON(pkg => {
pkg.devDependencies['ember-cli-fastboot'] = '*';
Expand Down
2 changes: 1 addition & 1 deletion test/fastboot-fetch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('renders in fastboot build', function() {
app = new AddonTestApp();

return app
.create('dummy', { skipNpm: true })
.create('dummy', { skipNpm: true, emberVersion: 'latest' })
.then(app =>
app.editPackageJSON(pkg => {
pkg.devDependencies['ember-cli-fastboot'] = '*';
Expand Down
2 changes: 1 addition & 1 deletion test/fastboot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('renders in fastboot build without calling fetch', function() {
app = new AddonTestApp();

return app
.create('fresh', { skipNpm: true, noFixtures: true })
.create('fresh', { skipNpm: true, noFixtures: true, emberVersion: 'latest' })
.then(app =>
app.editPackageJSON(pkg => {
pkg.devDependencies['ember-cli-fastboot'] = '*';
Expand Down
2 changes: 1 addition & 1 deletion test/without-fastboot-build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('it builds without ember-cli-fastboot', function() {

it('builds no exist dist/ember-fetch/fetch-fastboot.js', function() {
return app
.create('dummy', { skipNpm: true })
.create('dummy', { skipNpm: true, emberVersion: 'latest' })
.then((app) =>
app.editPackageJSON((pkg) => {
delete pkg.devDependencies['ember-cli-fastboot'];
Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4844,6 +4844,22 @@ ember-cli-typescript@^3.1.3:
stagehand "^1.0.0"
walk-sync "^2.0.0"

ember-cli-typescript@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-4.0.0.tgz#690f0cd3d15f4a69ae6d89f25b70b5997ae59161"
integrity sha512-ZwnBbBJ0yAIKq4FVgNFkxfMwqJhw6PyT45Enp2RvWIgzgaYCId8brrSgg3tvVWWjA7N5hiT4Ilyz5jrQwrnU1Q==
dependencies:
ansi-to-html "^0.6.6"
broccoli-stew "^3.0.0"
debug "^4.0.0"
execa "^4.0.0"
fs-extra "^9.0.1"
resolve "^1.5.0"
rsvp "^4.8.1"
semver "^7.3.2"
stagehand "^1.0.0"
walk-sync "^2.2.0"

ember-cli-uglify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-uglify/-/ember-cli-uglify-3.0.0.tgz#8819665b2cc5fe70e3ba9fe7a94645209bc42fd6"
Expand Down Expand Up @@ -11152,7 +11168,7 @@ walk-sync@^1.0.0, walk-sync@^1.1.3:
ensure-posix-path "^1.1.0"
matcher-collection "^1.1.1"

walk-sync@^2.0.0, walk-sync@^2.0.2, walk-sync@^2.1.0:
walk-sync@^2.0.0, walk-sync@^2.0.2, walk-sync@^2.1.0, walk-sync@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/walk-sync/-/walk-sync-2.2.0.tgz#80786b0657fcc8c0e1c0b1a042a09eae2966387a"
integrity sha512-IC8sL7aB4/ZgFcGI2T1LczZeFWZ06b3zoHH7jBPyHxOtIIz1jppWHjjEXkOFvFojBVAK9pV7g47xOZ4LW3QLfg==
Expand Down