Skip to content

Commit

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

* chore: Updated test fixtures

* feature: Improved Glint support

* chore: Updated test fixtures

---------

Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Dec 27, 2024
1 parent 3b097d1 commit 00dd24b
Show file tree
Hide file tree
Showing 35 changed files with 433 additions and 441 deletions.
3 changes: 2 additions & 1 deletion src/blueprints/ember-addon/__addonLocation__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
]<% if (options.packages.addon.hasGlint) { %>,
"glint": {
"environment": [
"ember-loose"
"ember-loose",
"ember-template-imports"
]
}<% } %>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!
<% if (options.packages.addon.hasGlint) { %>
import '@glint/environment-ember-loose';
import '@glint/environment-ember-template-imports';
import 'ember-source/types';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export default interface Registry {
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
}
}
// Uncomment if you need to support consuming projects in loose mode
//
// declare module '@glint/environment-ember-loose/registry' {
// export default interface Registry {
// // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
// }
// }
<% } %>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ export function updateDevDependencies(
packagesToInstall.delete('@babel/eslint-parser');
packagesToInstall.add('@babel/plugin-transform-typescript');
packagesToInstall.add('@tsconfig/ember');
packagesToInstall.add('@types/ember__component');
packagesToInstall.add('@types/ember__object');
packagesToInstall.add('@types/ember__service');
packagesToInstall.add('@typescript-eslint/eslint-plugin');
packagesToInstall.add('@typescript-eslint/parser');
packagesToInstall.add('typescript');
Expand All @@ -52,7 +49,9 @@ export function updateDevDependencies(
if (packages.addon.hasGlint) {
packagesToInstall.add('@glint/core');
packagesToInstall.add('@glint/environment-ember-loose');
packagesToInstall.add('@glint/environment-ember-template-imports');
packagesToInstall.add('@glint/template');
packagesToInstall.add('ember-source');
}

Array.from(packagesToInstall).forEach((packageName) => {
Expand Down
51 changes: 25 additions & 26 deletions src/utils/blueprints/get-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,39 @@ import { decideVersion } from '@codemod-utils/blueprints';
import type { Options } from '../../types/index.js';

const latestVersions = new Map([
['@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'],
['@babel/core', '7.26.0'],
['@babel/eslint-parser', '7.25.9'],
['@babel/plugin-transform-typescript', '7.26.3'],
['@babel/runtime', '7.26.0'],
['@embroider/addon-dev', '7.1.1'],
['@embroider/addon-shim', '1.9.0'],
['@embroider/test-setup', '4.0.0'],
['@glint/core', '1.4.0'],
['@glint/environment-ember-loose', '1.4.0'],
['@glint/template', '1.4.0'],
['@glint/core', '1.5.0'],
['@glint/environment-ember-loose', '1.5.0'],
['@glint/environment-ember-template-imports', '1.5.0'],
['@glint/template', '1.5.0'],
['@rollup/plugin-babel', '6.0.4'],
['@tsconfig/ember', '3.0.8'],
['@types/ember__component', '4.0.22'],
['@types/ember__object', '4.0.12'],
['@types/ember__service', '4.0.9'],
['@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.4'],
['ember-cli-babel', '8.1.0'],
['@typescript-eslint/eslint-plugin', '8.18.2'],
['@typescript-eslint/parser', '8.18.2'],
['babel-plugin-ember-template-compilation', '2.3.0'],
['concurrently', '9.1.0'],
['decorator-transforms', '2.3.0'],
['ember-auto-import', '2.10.0'],
['ember-cli-babel', '8.2.0'],
['ember-cli-htmlbars', '6.3.0'],
['ember-source', '6.1.0'],
['ember-template-lint', '6.0.0'],
['eslint', '8.57.0'],
['eslint', '8.57.1'],
['eslint-config-prettier', '9.1.0'],
['eslint-plugin-ember', '12.1.1'],
['eslint-plugin-import', '2.29.1'],
['eslint-plugin-n', '17.10.2'],
['eslint-plugin-ember', '12.3.3'],
['eslint-plugin-import', '2.31.0'],
['eslint-plugin-n', '17.15.1'],
['eslint-plugin-prettier', '5.2.1'],
['prettier', '3.3.3'],
['rollup', '4.20.0'],
['prettier', '3.4.2'],
['rollup', '4.29.1'],
['rollup-plugin-copy', '3.5.0'],
['typescript', '5.5.4'],
['typescript', '5.7.2'],
]);

export function getLatestVersion(packageName: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,41 +51,40 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.9",
"decorator-transforms": "^2.0.0",
"@embroider/addon-shim": "^1.9.0",
"decorator-transforms": "^2.3.0",
"ember-element-helper": "^0.6.1",
"ember-modifier": "^3.2.7",
"ember-resize-observer-service": "^1.1.0",
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@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",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-typescript": "^7.26.3",
"@babel/runtime": "^7.26.0",
"@embroider/addon-dev": "^7.1.1",
"@glint/core": "^1.5.0",
"@glint/environment-ember-loose": "^1.5.0",
"@glint/environment-ember-template-imports": "^1.5.0",
"@glint/template": "^1.5.0",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^3.0.8",
"@types/ember__component": "^4.0.22",
"@types/ember__object": "^4.0.12",
"@types/ember__service": "^4.0.9",
"@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",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^9.1.0",
"ember-source": "^6.1.0",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-ember": "^12.3.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"rollup": "^4.20.0",
"prettier": "^3.4.2",
"rollup": "^4.29.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^5.5.4"
"typescript": "^5.7.2"
},
"engines": {
"node": "14.* || 16.* || >= 18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
],
"glint": {
"environment": [
"ember-loose"
"ember-loose",
"ember-template-imports"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!

import '@glint/environment-ember-loose';
import '@glint/environment-ember-template-imports';
import 'ember-source/types';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export default interface Registry {
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
}
}
// Uncomment if you need to support consuming projects in loose mode
//
// declare module '@glint/environment-ember-loose/registry' {
// export default interface Registry {
// // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -51,41 +51,40 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.9",
"decorator-transforms": "^2.0.0",
"@embroider/addon-shim": "^1.9.0",
"decorator-transforms": "^2.3.0",
"ember-element-helper": "^0.6.1",
"ember-modifier": "^3.2.7",
"ember-resize-observer-service": "^1.1.0",
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@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",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-typescript": "^7.26.3",
"@babel/runtime": "^7.26.0",
"@embroider/addon-dev": "^7.1.1",
"@glint/core": "^1.5.0",
"@glint/environment-ember-loose": "^1.5.0",
"@glint/environment-ember-template-imports": "^1.5.0",
"@glint/template": "^1.5.0",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^3.0.8",
"@types/ember__component": "^4.0.22",
"@types/ember__object": "^4.0.12",
"@types/ember__service": "^4.0.9",
"@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",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^9.1.0",
"ember-source": "^6.1.0",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-ember": "^12.3.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"rollup": "^4.20.0",
"prettier": "^3.4.2",
"rollup": "^4.29.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^5.5.4"
"typescript": "^5.7.2"
},
"engines": {
"node": "14.* || 16.* || >= 18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
],
"glint": {
"environment": [
"ember-loose"
"ember-loose",
"ember-template-imports"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!

import '@glint/environment-ember-loose';
import '@glint/environment-ember-template-imports';
import 'ember-source/types';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export default interface Registry {
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
}
}
// Uncomment if you need to support consuming projects in loose mode
//
// declare module '@glint/environment-ember-loose/registry' {
// export default interface Registry {
// // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,30 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.9",
"decorator-transforms": "^2.0.0",
"@embroider/addon-shim": "^1.9.0",
"decorator-transforms": "^2.3.0",
"ember-element-helper": "^0.6.1",
"ember-modifier": "^3.2.7",
"ember-resize-observer-service": "^1.1.0",
"ember-test-selectors": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/runtime": "^7.25.0",
"@embroider/addon-dev": "^5.0.0",
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/runtime": "^7.26.0",
"@embroider/addon-dev": "^7.1.1",
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.2.5",
"concurrently": "^8.2.2",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^9.1.0",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-ember": "^12.3.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"rollup": "^4.20.0",
"prettier": "^3.4.2",
"rollup": "^4.29.1",
"rollup-plugin-copy": "^3.5.0"
},
"engines": {
Expand Down
Loading

0 comments on commit 00dd24b

Please sign in to comment.