forked from tedconf/ember-cli-deploy-front-end-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
[DEV] Upgrade to Ember 6.1 #29
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
Open
timjcook
wants to merge
6
commits into
master
Choose a base branch
from
upgrade/ember-6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5ef2c7c
Upgrade to Ember 6.0
timjcook 6e48ae4
Update node version to 18.20.4
timjcook 0097bf7
v6.0.1...v6.1.0
timjcook d1b0726
Handle eslint no-redeclare issues
timjcook f5194e0
Update lockfile
timjcook 9db2ccb
Upgrade to node 20
timjcook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,5 @@ | |
|
|
||
| # ember-try | ||
| /.node_modules.ember-try/ | ||
|
|
||
| eslint.config.mjs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,20 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| plugins: ['prettier-plugin-ember-template-tag'], | ||
| overrides: [ | ||
| { | ||
| files: '*.{js,ts}', | ||
| files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}', | ||
| options: { | ||
| singleQuote: true, | ||
| }, | ||
| }, | ||
| { | ||
| files: '*.{gjs,gts}', | ||
| options: { | ||
| singleQuote: true, | ||
| templateSingleQuote: false, | ||
| }, | ||
| }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| nodejs 18.12.0 | ||
| nodejs 20.19.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| /** | ||
| * Debugging: | ||
| * https://eslint.org/docs/latest/use/configure/debug | ||
| * ---------------------------------------------------- | ||
| * | ||
| * Print a file's calculated configuration | ||
| * | ||
| * npx eslint --print-config path/to/file.js | ||
| * | ||
| * Inspecting the config | ||
| * | ||
| * npx eslint --inspect-config | ||
| * | ||
| */ | ||
| import globals from 'globals'; | ||
| import js from '@eslint/js'; | ||
|
|
||
| import ember from 'eslint-plugin-ember/recommended'; | ||
| import prettier from 'eslint-plugin-prettier/recommended'; | ||
| import qunit from 'eslint-plugin-qunit'; | ||
| import n from 'eslint-plugin-n'; | ||
|
|
||
| import babelParser from '@babel/eslint-parser'; | ||
|
|
||
| const esmParserOptions = { | ||
| ecmaFeatures: { modules: true }, | ||
| ecmaVersion: 'latest', | ||
| requireConfigFile: false, | ||
| babelOptions: { | ||
| plugins: [ | ||
| ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], | ||
| ], | ||
| }, | ||
| }; | ||
|
|
||
| export default [ | ||
| js.configs.recommended, | ||
| prettier, | ||
| ember.configs.base, | ||
| ember.configs.gjs, | ||
| /** | ||
| * Ignores must be in their own object | ||
| * https://eslint.org/docs/latest/use/configure/ignore | ||
| */ | ||
| { | ||
| ignores: [ | ||
| 'dist/', | ||
| 'node_modules/', | ||
| 'coverage/', | ||
| '! **/.*', | ||
| 'eslint.config.mjs', | ||
| '.node_modules.ember-try/' | ||
| ], | ||
| }, | ||
| /** | ||
| * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options | ||
| */ | ||
| { | ||
| linterOptions: { | ||
| reportUnusedDisableDirectives: 'error', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.js'], | ||
| languageOptions: { | ||
| parser: babelParser, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.{js,gjs}'], | ||
| languageOptions: { | ||
| parserOptions: esmParserOptions, | ||
| globals: { | ||
| ...globals.browser, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| files: ['tests/**/*-test.{js,gjs}'], | ||
| plugins: { | ||
| qunit, | ||
| }, | ||
| }, | ||
| /** | ||
| * CJS node files | ||
| */ | ||
| { | ||
| files: [ | ||
| '**/*.cjs', | ||
| 'config/**/*.js', | ||
| 'tests/dummy/config/**/*.js', | ||
| 'testem.js', | ||
| 'testem*.js', | ||
| 'index.js', | ||
| '.prettierrc.js', | ||
| '.stylelintrc.js', | ||
| '.template-lintrc.js', | ||
| 'ember-cli-build.js', | ||
| './lib/**/*.js', | ||
| ], | ||
| plugins: { | ||
| n, | ||
| }, | ||
|
|
||
| languageOptions: { | ||
| sourceType: 'script', | ||
| ecmaVersion: 'latest', | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| }, | ||
| /** | ||
| * ESM node files | ||
| */ | ||
| { | ||
| files: ['**/*.mjs'], | ||
| plugins: { | ||
| n, | ||
| }, | ||
|
|
||
| languageOptions: { | ||
| sourceType: 'module', | ||
| ecmaVersion: 'latest', | ||
| parserOptions: esmParserOptions, | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antonivanopoulos @andybluntish I'm a little stuck on making a decision on these two imports. They are slightly different in nature.
For
crypto, I believe what eslint is trying to tell me is that I can just callcryptowithout importing it on the version of node that I'm on, however I can't find supporting docs for that, most examples online continue to import like this.For
fetch, I believe eslint is aware that node ships with a fetch module, however this is using the installednode-fetchpackage, hence the namespace clash.The thing that is really stopping me from making decisions is that there is no way to test this out, apart from pointing one of our apps at it and seeing if it works. While that would be effective, I kinda want to be more certain, especially as we are using private keys to sign things.
I'd like to write some tests but exporting a file from the lib dir into a test for an addon isn't straightforward. (lol at the supporting documentation for testing addons https://cli.emberjs.com/release/writing-addons/intro-tutorial/#testinganaddon).
Any thoughts would be valued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is going to be the eslint setup. We're setting up the
globalsconfig to includeglobals.browserin all js files (**/*.{js,gjs}).Later on we're including
lib/**/*.jsin the "node files" config, which adds the node globals, but this isn't overriding the previous config—is additive.So eslint thinks that this file has access to both the browser and nodejs globals, and in this case is complaining that we're importing
cryptobecause that exists inglobals.browser.For this plugin, we can probably just remove all the browser-specific eslint config, since there isn't any code that will run there.