Skip to content

Commit

Permalink
Updated blueprints (#88)
Browse files Browse the repository at this point in the history
* chore: Updated latestVersions

* chore: Updated fixtures

* feature: Downstreamed changes from @embroider/[email protected]

* chore: Updated fixtures

---------

Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Aug 14, 2024
1 parent 023ff36 commit 4045241
Show file tree
Hide file tree
Showing 37 changed files with 1,185 additions and 533 deletions.
88 changes: 62 additions & 26 deletions src/blueprints/ember-addon/__addonLocation__/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,83 @@

module.exports = {
root: true,
parser: '<%= options.packages.addon.hasTypeScript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>',
parserOptions: {
ecmaVersion: 'latest',<% if (!options.packages.addon.hasTypeScript) { %>
sourceType: 'module',
babelOptions: {
root: __dirname,
},<% } %>
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
// Only use overrides
// https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs
overrides: [
{
files: ['**/*.js'<%= options.packages.addon.hasTypeScript ? ", '**/*.ts'" : '' %>],
env: { browser: true },
parser: '<%= options.packages.addon.hasTypeScript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>',
parserOptions: {
ecmaVersion: 'latest',<% if (!options.packages.addon.hasTypeScript) { %>
sourceType: 'module',
babelOptions: {
root: __dirname,
},<% } %>
},
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
<% if (options.packages.addon.hasTypeScript) { %> // ts files
{
files: ['**/*.ts', '**/*.gts'],
files: ['**/*.ts'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// require relative imports use full extensions
{
files: ['src/**/*.{js,ts,gjs,gts}'],
files: ['**/*.gts'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gts',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
<% } else { %> // require relative imports use full extensions
{
files: ['src/**/*.{js,gjs}'],
<% } %> {
files: ['**/*.gjs'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gjs',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
<% } %> // node files
// node files
{
files: [
'./.eslintrc.cjs',
Expand All @@ -62,7 +94,11 @@ module.exports = {
node: true,
},
plugins: ['n'],
extends: ['plugin:n/recommended'],
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:prettier/recommended',
],
},
],
};
26 changes: 13 additions & 13 deletions src/utils/blueprints/get-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { decideVersion } from '@codemod-utils/blueprints';
import type { Options } from '../../types/index.js';

const latestVersions = new Map([
['@babel/core', '7.24.7'],
['@babel/eslint-parser', '7.24.7'],
['@babel/plugin-transform-typescript', '7.24.7'],
['@babel/runtime', '7.24.7'],
['@embroider/addon-dev', '4.3.1'],
['@babel/core', '7.25.2'],
['@babel/eslint-parser', '7.25.1'],
['@babel/plugin-transform-typescript', '7.25.2'],
['@babel/runtime', '7.25.0'],
['@embroider/addon-dev', '5.0.0'],
['@embroider/addon-shim', '1.8.9'],
['@embroider/test-setup', '4.0.0'],
['@glint/core', '1.4.0'],
Expand All @@ -18,25 +18,25 @@ const latestVersions = new Map([
['@types/ember__component', '4.0.22'],
['@types/ember__object', '4.0.12'],
['@types/ember__service', '4.0.9'],
['@typescript-eslint/eslint-plugin', '7.12.0'],
['@typescript-eslint/parser', '7.12.0'],
['@typescript-eslint/eslint-plugin', '8.1.0'],
['@typescript-eslint/parser', '8.1.0'],
['babel-plugin-ember-template-compilation', '2.2.5'],
['concurrently', '8.2.2'],
['decorator-transforms', '2.0.0'],
['ember-auto-import', '2.7.3'],
['ember-auto-import', '2.7.4'],
['ember-cli-babel', '8.1.0'],
['ember-cli-htmlbars', '6.3.0'],
['ember-template-lint', '6.0.0'],
['eslint', '8.57.0'],
['eslint-config-prettier', '9.1.0'],
['eslint-plugin-ember', '12.1.1'],
['eslint-plugin-import', '2.29.1'],
['eslint-plugin-n', '17.8.1'],
['eslint-plugin-prettier', '5.1.3'],
['prettier', '3.3.1'],
['rollup', '4.18.0'],
['eslint-plugin-n', '17.10.2'],
['eslint-plugin-prettier', '5.2.1'],
['prettier', '3.3.3'],
['rollup', '4.20.0'],
['rollup-plugin-copy', '3.5.0'],
['typescript', '5.4.5'],
['typescript', '5.5.4'],
]);

export function getLatestVersion(packageName: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,76 @@

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
// Only use overrides
// https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs
overrides: [
{
files: ['**/*.js', '**/*.ts'],
env: { browser: true },
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// ts files
{
files: ['**/*.ts', '**/*.gts'],
files: ['**/*.ts'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// require relative imports use full extensions
{
files: ['src/**/*.{js,ts,gjs,gts}'],
files: ['**/*.gts'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gts',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
{
files: ['**/*.gjs'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gjs',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// node files
Expand All @@ -51,7 +90,11 @@ module.exports = {
node: true,
},
plugins: ['n'],
extends: ['plugin:n/recommended'],
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:prettier/recommended',
],
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/plugin-transform-typescript": "^7.24.7",
"@babel/runtime": "^7.24.7",
"@embroider/addon-dev": "^4.3.1",
"@babel/core": "^7.25.2",
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/runtime": "^7.25.0",
"@embroider/addon-dev": "^5.0.0",
"@glint/core": "^1.4.0",
"@glint/environment-ember-loose": "^1.4.0",
"@glint/template": "^1.4.0",
Expand All @@ -71,21 +71,21 @@
"@types/ember__component": "^4.0.22",
"@types/ember__object": "^4.0.12",
"@types/ember__service": "^4.0.9",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"babel-plugin-ember-template-compilation": "^2.2.5",
"concurrently": "^8.2.2",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.8.1",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.1",
"rollup": "^4.18.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"rollup": "^4.20.0",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
},
"engines": {
"node": "14.* || 16.* || >= 18"
Expand Down
Loading

0 comments on commit 4045241

Please sign in to comment.