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

Fix compatibility with ember-cli 5.4+ #223

Merged
merged 11 commits into from
Nov 22, 2023
Merged

Fix compatibility with ember-cli 5.4+ #223

merged 11 commits into from
Nov 22, 2023

Conversation

NullVoxPopuli
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli commented Oct 31, 2023

Disruption caused by: ember-cli/ember-cli#10368
We'll need to test with ember-cli 5.3 and 5.4

Fixes:

  • --pnpm, --npm, --yarn flags not propagating correctly
    • X=true is no longer allowed in ember-cli
    • using packageManager === X to detect which package manager is in use
      • helpers extracted to support pre ember-cli 5.4
  • ember-cli 5.4.1 fixes the typescript tests, so CI now specifically calls that out

CI has been updated to test against 5.3 and 5.4.1

  • ci now also only tests TS against 5.4.1
  • ember-cli 5.3 TS is broken, so we won't test that

Of note,

  • it looks like CI isn't enforcing our lint/formatting rules. This isn't good because editors typically do enforce these.

Clearer matrix name
Updates

test
@NullVoxPopuli NullVoxPopuli added internal bug Something isn't working and removed internal labels Nov 21, 2023
@NullVoxPopuli NullVoxPopuli changed the title Let's see what's wrong with CI / ember-cli 5.4 Fix compatibility with ember-cli 5.4+ Nov 21, 2023
@@ -44,19 +44,12 @@ jobs:
# waiting on a an api from vitest for querying
# the list of tests ahead of time before running them.
#
# https://github.com/vitest-dev/vitest/issues/2901
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

relevant background info for the surrounding pre-existing comment

@@ -75,3 +68,49 @@ jobs:
- run: pnpm add --global ember-cli yarn
- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
working-directory: tests


defaults_tests:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these tests are probably the most important to have anything "matrixy" -- no frills, just defaults

- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
working-directory: tests

typescript_tests:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typescript tests get a separate matrix, due to reasons
(accidental non-breaking release of @tsconfig/ember in this case)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(this is only needed because our tests ensure that lint passes across both workspaces)
(( but we don't actually have any control over the test app ))

((( which should be fine under normal circumstances )))

@@ -39,7 +39,7 @@ module.exports = {
if (!options.addonOnly) {
if (fs.existsSync(path.join('..', 'package.json'))) {
options.ui.writeInfoLine(
"Existing monorepo detected! The blueprint will only create the addon and test-app folders, and omit any other files in the repo's root folder."
"Existing monorepo detected! The blueprint will only create the addon and test-app folders, and omit any other files in the repo's root folder.",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

my editor added these commas -- I think this repo's prettier config is probably not being checked in ci or something. didn't look too deeply in to it.

pnpm: options.pnpm,
npm: options.npm,
packageManager: options.packageManager,
yarn: isYarn(options),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because we now have to check for X as well as packageManager === X, these are now extracted utils at the bottom of the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

For my understanding: this change in ember-cli is only not a breaking change for users, because things like --pnpm are still supported as an alias, but it is a breaking change for us, because --pnpm is not exposed to us as options.pnpm anymore but as options.packageManager (as of 5.4). Is that correct?

@@ -77,33 +77,13 @@ export async function install({
if (packageManager === 'yarn') {
await execa('yarn', ['install', '--non-interactive'], { cwd });
} else {
try {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cleanup tangent.

@@ -20,7 +20,7 @@ describe('--addon-location', () => {
tmpDir = await createTmp();

let { name } = await createAddon({
args: [`--addon-location=${addonLocation}`, '--pnpm=true'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ember-cli 5.4 doesn't support X=true, and it turns out it wasn't needed, even for 5.3

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review November 21, 2023 18:19
Copy link
Contributor

@lolmaus lolmaus left a comment

Choose a reason for hiding this comment

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

Thanks!! 🙀

pnpm: options.pnpm,
npm: options.npm,
packageManager: options.packageManager,
yarn: isYarn(options),
Copy link
Collaborator

Choose a reason for hiding this comment

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

For my understanding: this change in ember-cli is only not a breaking change for users, because things like --pnpm are still supported as an alias, but it is a breaking change for us, because --pnpm is not exposed to us as options.pnpm anymore but as options.packageManager (as of 5.4). Is that correct?

@NullVoxPopuli
Copy link
Collaborator Author

Is that correct?

yup!

@NullVoxPopuli NullVoxPopuli merged commit cfcf7cc into main Nov 22, 2023
18 checks passed
@NullVoxPopuli NullVoxPopuli deleted the update-ci branch November 22, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants