discourse/bin
David Taylor 16b6e86932 DEV: Introduce feature-flag for Ember 5 upgrade
This commit introduces the scaffolding for us to easily switch between Ember 3.28 and Ember 5 on the `main` branch of Discourse. Unfortunately, there is no built-in system to apply this kind of flagging within yarn / ember-cli. There are projects like `ember-try` which are designed for running against multiple version of a dependency, but they do not allow us to 'lock' dependency/sub-dependency versions, and are therefore unsuitable for our use in production.

Instead, we will be maintaining two root `package.json` files, and two `yarn.lock` files. For ember-3, they remain as-is. For ember5, we use a yarn 'resolution' to override the version for ember-source across the entire yarn workspace.

To allow for easy switching with minimal diff against the repository, `package.json` and `yarn.lock` are symlinks which point to `package-ember3.json` and `yarn-ember3.lock` by default. To switch to Ember 5, we can run `script/switch ember version 5` to update the symlinks to point to `package-ember5.json` and `package-ember3.json` respectively. In production, and when using `bin/ember-cli` for development, the ember version can also be upgraded using the `EMBER_VERSION=5` environment variable.

When making changes to dependencies, these should be made against the default `ember3` versions, and then `script/regen_ember_5_lockfile` should be used to regenerate `yarn-ember5.lock` accordingly. A new 'Ember Version Lockfiles' GitHub workflow will automate this process on Dependabot PRs.

When running a local environment against Ember 5, the two symlink changes will show up as git diffs. To avoid us accidentally committing/pushing that change, another GitHub workflow is introduced which checks the default Ember version and raises an error if it is greater than v3.

Supporting two ember versions simultaneously obviously carries significant overhead, so our aim will be to get themes/plugins updated as quickly as possible, and then drop this flag.
2023-11-27 16:40:22 +00:00
..
docker FIX: Run bundle install before migration in `d/boot_dev` (#24509) 2023-11-22 16:08:28 +08:00
annotate DEV: Allow annotations to work in symlinked plugins, add binstub (#13635) 2021-07-05 15:43:10 +01:00
bundle DEV: Enable `unless` cops 2023-02-21 10:30:48 +01:00
dev DEV: Add basic bin/dev script for launching in development (#23254) 2023-08-25 12:07:16 +08:00
ember-cli DEV: Introduce feature-flag for Ember 5 upgrade 2023-11-27 16:40:22 +00:00
notify_file_change FIX: `notify_file_change` was outputting a command to vim 2020-12-10 10:03:57 -05:00
rails DEV: Compatibility with TruffleRuby (#16641) 2022-05-05 09:50:02 +08:00
rake DEV: Add `rake plugins:turbo_spec` task (#18289) 2022-09-20 15:42:54 +01:00
rspec DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
rubocop DEV: Clean up .gitignore (#12981) 2021-05-10 13:43:13 +02:00
system_rspec DEV: Minimal first pass of rails system test setup (#16311) 2022-09-28 11:48:16 +10:00
turbo_rspec DEV: Allow explicitly enabling/disabling system tests in bin/turbo_rspec (#23515) 2023-09-11 13:11:06 -05:00
unicorn DEV: make `bin/ember-cli -u` terminate unicorn when ember-cli fails (#18172) 2022-09-02 22:51:51 +01:00
yarn-app DEV: Add yarn-app shim to run yarn using the app modules (#20983) 2023-04-05 13:12:58 -05:00