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

Downstreamed changes from @embroider/[email protected] #71

Merged
merged 6 commits into from
Dec 20, 2023
Merged
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
11 changes: 8 additions & 3 deletions src/blueprints/ember-addon/__addonLocation__/babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
}
],
<% } %> "@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
Comment on lines +19 to +26
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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';
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

embroider-build/addon-blueprint#218

At the moment, the codemod doesn't check if @glint/environment-ember-template-imports (optional) is installed. Rather than omitting the line, I opted to comment the line.


declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
Expand Down
2 changes: 1 addition & 1 deletion src/steps/update-addon-package-json/update-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function updateDependencies(
dependencies.delete(packageName);
});

const packagesToInstall = ['@embroider/addon-shim'];
const packagesToInstall = ['@embroider/addon-shim', 'decorator-transforms'];

packagesToInstall.forEach((packageName) => {
const version = getVersion(packageName, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export function updateDevDependencies(

const packagesToInstall = new Set([
'@babel/core',
'@babel/plugin-proposal-decorators',
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-class-static-block',
'@babel/runtime',
'@embroider/addon-dev',
'@rollup/plugin-babel',
Expand Down
1 change: 1 addition & 0 deletions src/steps/update-addon-tsconfig-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function setCompilerOptions(
compilerOptions.set('allowImportingTsExtensions', true);
compilerOptions.set('allowJs', true);
compilerOptions.set('declarationDir', 'declarations');
compilerOptions.set('rootDir', './src');
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (!packages.addon.hasGlint) {
compilerOptions.set('declaration', true);
Expand Down
24 changes: 11 additions & 13 deletions src/utils/blueprints/get-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ import { decideVersion } from '@codemod-utils/blueprints';
import type { Options } from '../../types/index.js';

const latestVersions = new Map([
['@babel/core', '7.23.2'],
['@babel/plugin-proposal-decorators', '7.22.15'],
['@babel/plugin-transform-class-properties', '7.22.5'],
['@babel/plugin-transform-class-static-block', '7.22.11'],
['@babel/plugin-transform-typescript', '7.22.15'],
['@babel/runtime', '7.23.2'],
['@embroider/addon-dev', '4.1.1'],
['@embroider/addon-shim', '1.8.6'],
['@embroider/test-setup', '3.0.2'],
['@babel/core', '7.23.6'],
['@babel/plugin-transform-typescript', '7.23.6'],
['@babel/runtime', '7.23.6'],
['@embroider/addon-dev', '4.1.3'],
['@embroider/addon-shim', '1.8.7'],
['@embroider/test-setup', '3.0.3'],
['@rollup/plugin-babel', '6.0.4'],
['@tsconfig/ember', '3.0.2'],
['@tsconfig/ember', '3.0.3'],
['babel-plugin-ember-template-compilation', '2.2.1'],
['concurrently', '8.2.2'],
['ember-auto-import', '2.6.3'],
['decorator-transforms', '1.0.1'],
['ember-auto-import', '2.7.1'],
['ember-cli-babel', '8.1.0'],
['ember-cli-htmlbars', '6.3.0'],
['rollup', '4.3.0'],
['rollup', '4.9.1'],
['rollup-plugin-copy', '3.5.0'],
['typescript', '5.2.2'],
['typescript', '5.3.3'],
]);

export function getVersion(packageName: string, options: Options): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
}
],
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,23 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.6",
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^1.0.1",
"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.23.2",
"@babel/plugin-proposal-decorators": "^7.22.15",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-class-static-block": "^7.22.11",
"@babel/plugin-transform-typescript": "^7.22.15",
"@babel/runtime": "^7.23.2",
"@embroider/addon-dev": "^4.1.1",
"@babel/core": "^7.23.6",
"@babel/plugin-transform-typescript": "^7.23.6",
"@babel/runtime": "^7.23.6",
"@embroider/addon-dev": "^4.1.3",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^2.0.0",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^7.6.0",
"rollup": "^4.3.0",
"rollup": "^4.9.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^4.9.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"allowJs": true,
"declarationDir": "declarations"
"declarationDir": "declarations",
"rootDir": "./src"
},
"include": [
"src/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
}
],
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,23 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.6",
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^1.0.1",
"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.23.2",
"@babel/plugin-proposal-decorators": "^7.22.15",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-class-static-block": "^7.22.11",
"@babel/plugin-transform-typescript": "^7.22.15",
"@babel/runtime": "^7.23.2",
"@embroider/addon-dev": "^4.1.1",
"@babel/core": "^7.23.6",
"@babel/plugin-transform-typescript": "^7.23.6",
"@babel/runtime": "^7.23.6",
"@embroider/addon-dev": "^4.1.3",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^2.0.0",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^7.6.0",
"rollup": "^4.3.0",
"rollup": "^4.9.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^4.9.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"allowJs": true,
"declarationDir": "declarations"
"declarationDir": "declarations",
"rootDir": "./src"
},
"include": [
"src/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,21 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.6",
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^1.0.1",
"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.23.2",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-class-static-block": "^7.22.11",
"@babel/runtime": "^7.23.2",
"@embroider/addon-dev": "^4.1.1",
"@babel/core": "^7.23.6",
"@babel/runtime": "^7.23.6",
"@embroider/addon-dev": "^4.1.3",
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^7.6.0",
"rollup": "^4.3.0",
"rollup": "^4.9.1",
"rollup-plugin-copy": "^3.5.0"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
}
],
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,23 @@
}
},
"dependencies": {
"@embroider/addon-shim": "^1.8.6",
"@embroider/addon-shim": "^1.8.7",
"decorator-transforms": "^1.0.1",
"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.23.2",
"@babel/plugin-proposal-decorators": "^7.22.15",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/plugin-transform-class-static-block": "^7.22.11",
"@babel/plugin-transform-typescript": "^7.22.15",
"@babel/runtime": "^7.23.2",
"@embroider/addon-dev": "^4.1.1",
"@babel/core": "^7.23.6",
"@babel/plugin-transform-typescript": "^7.23.6",
"@babel/runtime": "^7.23.6",
"@embroider/addon-dev": "^4.1.3",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^2.0.0",
"babel-plugin-ember-template-compilation": "^2.2.1",
"concurrently": "^7.6.0",
"rollup": "^4.3.0",
"rollup": "^4.9.1",
"rollup-plugin-copy": "^3.5.0",
"typescript": "^4.9.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"allowImportingTsExtensions": true,
"allowJs": true,
"declarationDir": "declarations"
"declarationDir": "declarations",
"rootDir": "./src"
},
"include": [
"src/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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';

declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
}
],
"@embroider/addon-dev/template-colocation-plugin",
"@babel/plugin-transform-class-static-block",
[
"babel-plugin-ember-template-compilation",
{
"targetFormat": "hbs",
"transforms": []
}
],
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
"@babel/plugin-transform-class-properties"
[
"module:decorator-transforms",
{
"runtime": {
"import": "decorator-transforms/runtime"
}
}
]
]
}
Loading