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

upgrade test-app with Ember CLI v6.2 blueprints #290

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
templateSingleQuote: false,
overrides: [
{
files: '*.{js,ts,gjs,gts}',
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
options: {
singleQuote: true,
},
Expand Down
1,552 changes: 1,006 additions & 546 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions test-app/.eslintignore

This file was deleted.

55 changes: 0 additions & 55 deletions test-app/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion test-app/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "5.12.0",
"version": "6.2.3",
"blueprints": [
{
"name": "app",
Expand Down
144 changes: 144 additions & 0 deletions test-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/**
* 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 ts from 'typescript-eslint';

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 parserOptions = {
esm: {
js: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
plugins: [
[
'@babel/plugin-proposal-decorators',
{ decoratorsBeforeExport: true },
],
],
},
},
ts: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
};

export default ts.config(
js.configs.recommended,
ember.configs.base,
ember.configs.gjs,
ember.configs.gts,
prettier,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
},
/**
* 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: parserOptions.esm.js,
globals: {
...globals.browser,
},
},
},
{
files: ['**/*.{ts,gts}'],
languageOptions: {
parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
},
{
files: ['tests/**/*-test.{js,gjs,ts,gts}'],
plugins: {
qunit,
},
},
/**
* CJS node files
*/
{
files: [
'**/*.cjs',
'config/**/*.js',
'testem.js',
'testem*.js',
'.prettierrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: parserOptions.esm.js,
globals: {
...globals.node,
},
},
},
);
51 changes: 17 additions & 34 deletions test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,42 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"start": "ember serve",
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"",
"test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\" --prefixColors auto",
"test:ember": "ember test"
},
"devDependencies": {
"@babel/core": "7.26.10",
"@babel/eslint-parser": "^7.26.5",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@ember/optional-features": "2.2.0",
"@ember/string": "4.0.1",
"@ember/test-helpers": "5.1.0",
"@embroider/test-setup": "4.0.0",
"@eslint/js": "^9.19.0",
"@glimmer/component": "2.0.0",
"@glimmer/tracking": "1.1.2",
"@glint/core": "1.5.2",
"@glint/environment-ember-loose": "1.5.2",
"@glint/environment-ember-template-imports": "1.5.2",
"@glint/template": "1.5.2",
"@tsconfig/ember": "3.0.8",
"@types/ember": "4.0.11",
"@types/ember__application": "4.0.11",
"@types/ember__array": "4.0.10",
"@types/ember__component": "4.0.22",
"@types/ember__controller": "4.0.12",
"@types/ember__debug": "4.0.8",
"@types/ember__destroyable": "4.0.5",
"@types/ember__engine": "4.0.11",
"@types/ember__error": "4.0.6",
"@types/ember__helper": "4.0.9",
"@types/ember__modifier": "4.0.9",
"@types/ember__object": "4.0.12",
"@types/ember__owner": "4.0.9",
"@types/ember__polyfills": "4.0.6",
"@types/ember__routing": "4.0.22",
"@types/ember__runloop": "4.0.10",
"@types/ember__service": "4.0.9",
"@types/ember__string": "3.16.3",
"@types/ember__template": "4.0.7",
"@types/ember__test": "4.0.6",
"@types/ember__utils": "4.0.7",
"@types/eslint__js": "^8.42.3",
"@types/qunit": "2.19.12",
"@types/rsvp": "4.0.9",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"broccoli-asset-rev": "3.0.0",
"concurrently": "9.1.2",
"ember-auto-import": "2.10.0",
"ember-cli": "5.12.0",
"ember-cli": "6.2.3",
"ember-cli-app-version": "7.0.0",
"ember-cli-babel": "8.2.0",
"ember-cli-clean-css": "3.0.0",
Expand All @@ -80,31 +61,33 @@
"ember-load-initializers": "3.0.1",
"ember-modifier": "4.2.0",
"ember-page-title": "8.2.4",
"ember-qunit": "8.1.1",
"ember-qunit": "9.0.1",
"ember-resolver": "13.1.0",
"ember-source": "5.12.0",
"ember-source": "6.2.0",
"ember-source-channel-url": "3.0.0",
"ember-style-modifier": "workspace:*",
"ember-template-imports": "4.3.0",
"ember-template-lint": "6.1.0",
"ember-try": "3.0.0",
"eslint": "8.57.1",
"eslint": "9.19.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-ember": "12.5.0",
"eslint-plugin-n": "17.16.2",
"eslint-plugin-prettier": "5.2.3",
"eslint-plugin-qunit": "8.1.2",
"globals": "^15.14.0",
"loader.js": "4.7.0",
"prettier": "3.5.3",
"prettier-plugin-ember-template-tag": "2.0.4",
"qunit": "2.24.1",
"qunit-dom": "3.4.0",
"stylelint": "16.2.1",
"stylelint": "16.14.1",
"stylelint-config-standard": "36.0.1",
"stylelint-prettier": "5.0.3",
"tracked-built-ins": "3.3.0",
"typescript": "5.6.3",
"webpack": "5.95.0"
"tracked-built-ins": "3.4.0",
"typescript": "5.7.3",
"typescript-eslint": "^8.23.0",
"webpack": "5.97.1"
},
"engines": {
"node": ">= 18"
Expand Down
2 changes: 1 addition & 1 deletion test-app/tests/integration/modifiers/style-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module('Integration | Modifiers | style', function (hooks) {

{
interface Context extends TestContext {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
display: String;
}

Expand Down
6 changes: 4 additions & 2 deletions test-app/tests/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import config from 'test-app/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
import { setup } from 'qunit-dom';
import { start } from 'ember-qunit';
import { loadTests } from 'ember-qunit/test-loader';
import { start, setupEmberOnerrorValidation } from 'ember-qunit';

setApplication(Application.create(config.APP));

setup(QUnit.assert);

setupEmberOnerrorValidation();
loadTests();
start();
5 changes: 4 additions & 1 deletion test-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"test-app/tests/*": ["tests/*"],
"test-app/*": ["app/*"],
"*": ["types/*"]
}
},
"types": [
"./node_modules/ember-source/types/stable"
]
}
}
2 changes: 1 addition & 1 deletion test-app/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import '@glint/environment-ember-loose';
import EmberStyleModifierRegistry from 'ember-style-modifier/template-registry';

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry extends EmberStyleModifierRegistry {}
export default EmberStyleModifierRegistry;
}
Loading