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

Expand try-matrix to expected current support (keeping 3.16+) #509

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
97 changes: 19 additions & 78 deletions test-apps/base-tests/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,36 @@

const getChannelURL = require('ember-source-channel-url');

function embroider(label, deps) {
return [
{
name: `${label}-embroider-safe`,
npm: {
devDependencies: {
...deps,
},
},
env: {
EMBROIDER_TEST_SETUP_OPTIONS: 'safe',
},
},
{
name: `${label}-embroider-optimized`,
npm: {
devDependencies: {
...deps,
},
},
env: {
EMBROIDER_TEST_SETUP_OPTIONS: 'optimized',
},
},
];
}

const v3Embroider = embroider('3.x', {
'@embroider/core': `^3.4.2`,
'@embroider/webpack': `^3.2.1`,
'@embroider/compat': `^3.4.0`,
'@embroider/test-setup': `^3.0.3`,
});

module.exports = async function () {
module.exports = async function() {
return {
usePnpm: true,
scenarios: [
{
name: 'ember-lts-3.16',
npm: {
devDependencies: {
'@ember/test-helpers': '^2.0.0',
'ember-source': '~3.16.0',
'ember-cli': '^4.10.0',
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'@ember/test-helpers': '^2.0.0',
'ember-source': '~3.20.0',
'ember-cli': '^4.10.0',
},
},
},
{
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'@ember/test-helpers': '^2.0.0',
'ember-source': '~3.24.0',
'ember-cli': '^4.10.0',
'@ember/string': '^3.0.0',
'@ember/test-helpers': '^2.9.3',
'@glimmer/component': '^1.0.0',
'ember-cli': '~3.28.0',
'ember-cli-app-version': '^5.0.0',
'ember-qunit': '^5.0.0',
'ember-resolver': '~8.0.0',
},
},
},
{
name: 'ember-lts-3.28',
npm: {
devDependencies: {
'@ember/test-helpers': '^2.0.0',
'ember-source': '~3.28.0',
'ember-cli': '^4.10.0',
'ember-source': '~3.28.11',
'@ember/string': '^3.0.0',
'@ember/test-helpers': '^2.9.3',
'@glimmer/component': '^1.0.0',
'ember-cli': '~3.28.0',
'ember-qunit': '^6.0.0',
'ember-resolver': '~8.0.0',
},
},
},
Expand All @@ -85,25 +40,23 @@ module.exports = async function () {
npm: {
devDependencies: {
'ember-source': '~4.12.0',
'@glimmer/component': '^1.0.0',
},
},
},
{
name: 'ember-lts-5.4',
name: 'ember-lts-5.12',
npm: {
devDependencies: {
'ember-source': '~5.4.0',
'ember-source': '~5.12.0',
'@glimmer/component': '^1.0.0',
},
},
},

{
name: 'ember-release',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'ember-source': await getChannelURL('release'),
},
Expand All @@ -112,31 +65,19 @@ module.exports = async function () {
{
name: 'ember-beta',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'ember-resolver': '^10.0.0',
'ember-source': await getChannelURL('beta'),
},
},
},
{
name: 'ember-canary',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'@types/ember__owner': '^4.0.3',
'ember-resolver': '^10.0.0',
'ember-source': await getChannelURL('canary'),
},
},
},
...v3Embroider,
],
};
};
56 changes: 35 additions & 21 deletions test-apps/base-tests/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const CLASSIC_ONLY = new Set([
'ember-lts-3.16',
'ember-lts-3.28',
'ember-lts-3.20',
'ember-lts-3.24',
]);

module.exports = function (defaults) {
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
'ember-cli-babel': { enableTypeScriptTransform: true },

autoImport: {
forbidEval: true,
// for classic mode
watchDependencies: ['@ember/test-waiters'],
},
// Add options here
});

if (process.env.EMBROIDER) {
const { Webpack } = require('@embroider/webpack');

return require('@embroider/compat').compatBuild(app, Webpack, {
extraPublicTrees: [],
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
staticHelpers: true,
staticModifiers: true,
staticComponents: true,
staticEmberSource: true,
packagerOptions: {
webpackConfig: {
// Highest fidelity source map (at the cost of build speed)
devtool: 'source-map',
},
},
});
if (
CLASSIC_ONLY.has(process.env.EMBER_TRY_CURRENT_SCENARIO) ||
process.env.FORCE_CLASSIC
) {
// Embroider does not support < 3.28
return app.toTree();
}

return app.toTree();
const { Webpack } = require('@embroider/webpack');

return require('@embroider/compat').compatBuild(app, Webpack, {
extraPublicTrees: [],
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
staticHelpers: true,
staticModifiers: true,
staticComponents: true,
staticEmberSource: true,
packagerOptions: {
webpackConfig: {
// Highest fidelity source map (at the cost of build speed)
devtool: 'source-map',
},
},
});
};
Loading