From 584abef68cae3acc4eea37fdc67d41dd23e3ad5d Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 21 Dec 2024 17:10:40 +0100 Subject: [PATCH 1/5] Update addon-dev --- packages/ember/package.json | 2 +- pnpm-lock.yaml | 147 ++++++++++-------------------------- 2 files changed, 41 insertions(+), 108 deletions(-) diff --git a/packages/ember/package.json b/packages/ember/package.json index 4b33f491b..a23e40291 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -48,7 +48,7 @@ "@babel/core": "7.25.9", "@babel/plugin-transform-typescript": "7.25.9", "@babel/runtime": "7.25.9", - "@embroider/addon-dev": "7.0.0", + "@embroider/addon-dev": "7.1.1", "@glimmer/component": "2.0.0", "@glimmer/tracking": "1.1.2", "@glint/core": "1.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e37502447..8b259965f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -907,8 +907,8 @@ importers: specifier: 7.25.9 version: 7.25.9 '@embroider/addon-dev': - specifier: 7.0.0 - version: 7.0.0(@glint/template@1.5.0)(rollup@4.29.1) + specifier: 7.1.1 + version: 7.1.1(@glint/template@1.5.0)(rollup@4.29.1) '@glimmer/component': specifier: 2.0.0 version: 2.0.0 @@ -2092,8 +2092,8 @@ packages: resolution: {integrity: sha512-bb9h95ktG2wKY9+ja1sdsFBdOms2lB19VWs8wmNpzgHv1NCetonBoV5jHBV4DHt0uS1tg9z66cZqhUVlYs96KQ==} engines: {node: 10.* || 12.* || >= 14.*} - '@embroider/addon-dev@7.0.0': - resolution: {integrity: sha512-jxRh++d2YXnEAjPxvjHGsTqx/Gd9U3LDeuLYBhLW6wzXakCyvU3K6V7jbYfx5fAxbdGkr2jFIp2gmGEsai2fpQ==} + '@embroider/addon-dev@7.1.1': + resolution: {integrity: sha512-81xGvfvIULEvZTZIswdF4X2Ag7dRKfiUfIQsQ9s11ScozexVj7gyBsMZ4iIwpPmv9iz7WZdBu+ptyJjOdx+HgA==} engines: {node: 12.* || 14.* || >= 16} hasBin: true peerDependencies: @@ -2138,8 +2138,8 @@ packages: resolution: {integrity: sha512-fD1r3v8cyXlAygbRWyQO6dOE2stapW3GQT5B5jt39WJc/eQz2GdNJTwgUeWFD6Peh05O+QCpNNddixwLTPjpng==} engines: {node: 12.* || 14.* || >= 16} - '@embroider/core@3.4.19': - resolution: {integrity: sha512-nnjQzXa+LkbqcSl7+a5sX6UKzeyHaiKrYCi/Wg5EG5OzyukiFmX2ZNI44fJ/U69htIphCZXAvLsMsEsUPm94ZA==} + '@embroider/core@3.4.20': + resolution: {integrity: sha512-bKy/uIrcoUyJXcBud2d8E7J8R8NRMz0T3xaKbEUx4nxc4/BbBsU+y7wSyzzfggykyJTK/95PwNIxls8gqnyYYA==} engines: {node: 12.* || 14.* || >= 16} '@embroider/hbs-loader@3.0.3': @@ -2149,8 +2149,8 @@ packages: '@embroider/core': ^3.4.0 webpack: ^5 - '@embroider/macros@1.16.5': - resolution: {integrity: sha512-Oz8bUZvZzOV1Gk3qSgIzZJJzs6acclSTcEFyB+KdKbKqjTC3uebn53aU2gAlLU7/YdTRZrg2gNbQuwAp+tGkGg==} + '@embroider/macros@1.16.10': + resolution: {integrity: sha512-G0vCsKgNCX0PMmuVNsTLG7IYXz8VkekQMK4Kcllzqpwb7ivFRDwVx2bD4QSvZ9LCTd4eWQ654RsCqVbW5aviww==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: '@glint/template': ^1.0.0 @@ -2158,8 +2158,8 @@ packages: '@glint/template': optional: true - '@embroider/macros@1.16.6': - resolution: {integrity: sha512-aSdRetg0vY3c70G/3K85fOSlGtDzSV4ozwF9qD8ToQB+4RLZusxwItnctWEa+MKkhAYB6rbFiQ+bhFwEnaEazg==} + '@embroider/macros@1.16.5': + resolution: {integrity: sha512-Oz8bUZvZzOV1Gk3qSgIzZJJzs6acclSTcEFyB+KdKbKqjTC3uebn53aU2gAlLU7/YdTRZrg2gNbQuwAp+tGkGg==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: '@glint/template': ^1.0.0 @@ -2167,8 +2167,8 @@ packages: '@glint/template': optional: true - '@embroider/macros@1.16.7-unstable.f33728f': - resolution: {integrity: sha512-qLgrRNlOgHFvRBShAQ1FKV3LYTt+mL8+sgU2BdMrRlwgag9RW3Fty8+8QIAp25lyOJxJxvB9/SgP/IBkT+hDpw==} + '@embroider/macros@1.16.6': + resolution: {integrity: sha512-aSdRetg0vY3c70G/3K85fOSlGtDzSV4ozwF9qD8ToQB+4RLZusxwItnctWEa+MKkhAYB6rbFiQ+bhFwEnaEazg==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: '@glint/template': ^1.0.0 @@ -2176,8 +2176,8 @@ packages: '@glint/template': optional: true - '@embroider/macros@1.16.9': - resolution: {integrity: sha512-AUrmHQdixczIU3ouv/+HzWxwYVsw/NwssZxAQnXfBDJ3d3/CRtAvGRu3JhY6OT3AAPFwfa2WT66tB5jeAa7r5g==} + '@embroider/macros@1.16.7-unstable.f33728f': + resolution: {integrity: sha512-qLgrRNlOgHFvRBShAQ1FKV3LYTt+mL8+sgU2BdMrRlwgag9RW3Fty8+8QIAp25lyOJxJxvB9/SgP/IBkT+hDpw==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: '@glint/template': ^1.0.0 @@ -13296,11 +13296,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@embroider/addon-dev@7.0.0(@glint/template@1.5.0)(rollup@4.29.1)': + '@embroider/addon-dev@7.1.1(@glint/template@1.5.0)(rollup@4.29.1)': dependencies: - '@embroider/core': 3.4.19(@glint/template@1.5.0) + '@embroider/core': 3.4.20(@glint/template@1.5.0) '@rollup/pluginutils': 4.2.1 content-tag: 3.0.0 + execa: 5.1.1 fs-extra: 10.1.0 minimatch: 3.1.2 rollup-plugin-copy-assets: 2.0.3(rollup@4.29.1) @@ -13518,12 +13519,12 @@ snapshots: - supports-color - utf-8-validate - '@embroider/core@3.4.19(@glint/template@1.5.0)': + '@embroider/core@3.4.20(@glint/template@1.5.0)': dependencies: '@babel/core': 7.25.9 '@babel/parser': 7.26.3 '@babel/traverse': 7.26.4 - '@embroider/macros': 1.16.9(@glint/template@1.5.0) + '@embroider/macros': 1.16.10(@glint/template@1.5.0) '@embroider/shared-internals': 2.8.1 assert-never: 1.3.0 babel-plugin-ember-template-compilation: 2.3.0 @@ -13563,9 +13564,9 @@ snapshots: webpack: 5.97.1 optional: true - '@embroider/macros@1.16.5(@glint/template@1.5.0)': + '@embroider/macros@1.16.10(@glint/template@1.5.0)': dependencies: - '@embroider/shared-internals': 2.6.2 + '@embroider/shared-internals': 2.8.1 assert-never: 1.3.0 babel-import-util: 2.1.1 ember-cli-babel: 7.26.11 @@ -13578,9 +13579,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@embroider/macros@1.16.6(@glint/template@1.5.0)': + '@embroider/macros@1.16.5(@glint/template@1.5.0)': dependencies: - '@embroider/shared-internals': 2.6.3 + '@embroider/shared-internals': 2.6.2 assert-never: 1.3.0 babel-import-util: 2.1.1 ember-cli-babel: 7.26.11 @@ -13593,9 +13594,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@embroider/macros@1.16.7-unstable.f33728f(@glint/template@1.5.0)': + '@embroider/macros@1.16.6(@glint/template@1.5.0)': dependencies: - '@embroider/shared-internals': 2.6.4-unstable.f33728f + '@embroider/shared-internals': 2.6.3 assert-never: 1.3.0 babel-import-util: 2.1.1 ember-cli-babel: 7.26.11 @@ -13608,9 +13609,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@embroider/macros@1.16.9(@glint/template@1.5.0)': + '@embroider/macros@1.16.7-unstable.f33728f(@glint/template@1.5.0)': dependencies: - '@embroider/shared-internals': 2.8.1 + '@embroider/shared-internals': 2.6.4-unstable.f33728f assert-never: 1.3.0 babel-import-util: 2.1.1 ember-cli-babel: 7.26.11 @@ -15316,40 +15317,20 @@ snapshots: dependencies: '@types/node': 22.10.2 - '@types/ember@4.0.11': - dependencies: - '@types/ember__application': 4.0.11(@babel/core@7.25.9) - '@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__engine': 4.0.11 - '@types/ember__error': 4.0.6 - '@types/ember__object': 4.0.12 - '@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(@babel/core@7.25.9) - '@types/ember__utils': 4.0.7 - '@types/rsvp': 4.0.9 - '@types/ember@4.0.11(@babel/core@7.25.9)': dependencies: '@types/ember__application': 4.0.11(@babel/core@7.25.9) '@types/ember__array': 4.0.10(@babel/core@7.25.9) '@types/ember__component': 4.0.22(@babel/core@7.25.9) - '@types/ember__controller': 4.0.12 - '@types/ember__debug': 4.0.8 - '@types/ember__engine': 4.0.11 + '@types/ember__controller': 4.0.12(@babel/core@7.25.9) + '@types/ember__debug': 4.0.8(@babel/core@7.25.9) + '@types/ember__engine': 4.0.11(@babel/core@7.25.9) '@types/ember__error': 4.0.6 '@types/ember__object': 4.0.12(@babel/core@7.25.9) '@types/ember__polyfills': 4.0.6 '@types/ember__routing': 4.0.22(@babel/core@7.25.9) '@types/ember__runloop': 4.0.10(@babel/core@7.25.9) - '@types/ember__service': 4.0.9 + '@types/ember__service': 4.0.9(@babel/core@7.25.9) '@types/ember__string': 3.16.3 '@types/ember__template': 4.0.7 '@types/ember__test': 4.0.6(@babel/core@7.25.9) @@ -15362,45 +15343,31 @@ snapshots: '@types/ember__application@4.0.11(@babel/core@7.25.9)': dependencies: '@glimmer/component': 1.1.2(@babel/core@7.25.9) - '@types/ember': 4.0.11 - '@types/ember__engine': 4.0.11 - '@types/ember__object': 4.0.12 + '@types/ember': 4.0.11(@babel/core@7.25.9) + '@types/ember__engine': 4.0.11(@babel/core@7.25.9) + '@types/ember__object': 4.0.12(@babel/core@7.25.9) '@types/ember__owner': 4.0.9 - '@types/ember__routing': 4.0.22 + '@types/ember__routing': 4.0.22(@babel/core@7.25.9) transitivePeerDependencies: - '@babel/core' - supports-color - '@types/ember__array@4.0.10': - dependencies: - '@types/ember': 4.0.11 - '@types/ember__object': 4.0.12 - '@types/ember__array@4.0.10(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) - '@types/ember__object': 4.0.12 + '@types/ember__object': 4.0.12(@babel/core@7.25.9) transitivePeerDependencies: - '@babel/core' - supports-color - '@types/ember__component@4.0.22': - dependencies: - '@types/ember': 4.0.11 - '@types/ember__object': 4.0.12 - '@types/ember__component@4.0.22(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) - '@types/ember__object': 4.0.12 + '@types/ember__object': 4.0.12(@babel/core@7.25.9) transitivePeerDependencies: - '@babel/core' - supports-color - '@types/ember__controller@4.0.12': - dependencies: - '@types/ember__object': 4.0.12 - '@types/ember__controller@4.0.12(@babel/core@7.25.9)': dependencies: '@types/ember__object': 4.0.12(@babel/core@7.25.9) @@ -15408,11 +15375,6 @@ snapshots: - '@babel/core' - supports-color - '@types/ember__debug@4.0.8': - dependencies: - '@types/ember__object': 4.0.12 - '@types/ember__owner': 4.0.9 - '@types/ember__debug@4.0.8(@babel/core@7.25.9)': dependencies: '@types/ember__object': 4.0.12(@babel/core@7.25.9) @@ -15423,11 +15385,6 @@ snapshots: '@types/ember__destroyable@4.0.5': {} - '@types/ember__engine@4.0.11': - dependencies: - '@types/ember__object': 4.0.12 - '@types/ember__owner': 4.0.9 - '@types/ember__engine@4.0.11(@babel/core@7.25.9)': dependencies: '@types/ember__object': 4.0.12(@babel/core@7.25.9) @@ -15455,11 +15412,6 @@ snapshots: - '@babel/core' - supports-color - '@types/ember__object@4.0.12': - dependencies: - '@types/ember': 4.0.11 - '@types/rsvp': 4.0.9 - '@types/ember__object@4.0.12(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) @@ -15472,27 +15424,16 @@ snapshots: '@types/ember__polyfills@4.0.6': {} - '@types/ember__routing@4.0.22': - dependencies: - '@types/ember': 4.0.11 - '@types/ember__controller': 4.0.12 - '@types/ember__object': 4.0.12 - '@types/ember__service': 4.0.9 - '@types/ember__routing@4.0.22(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) - '@types/ember__controller': 4.0.12 - '@types/ember__object': 4.0.12 - '@types/ember__service': 4.0.9 + '@types/ember__controller': 4.0.12(@babel/core@7.25.9) + '@types/ember__object': 4.0.12(@babel/core@7.25.9) + '@types/ember__service': 4.0.9(@babel/core@7.25.9) transitivePeerDependencies: - '@babel/core' - supports-color - '@types/ember__runloop@4.0.10': - dependencies: - '@types/ember': 4.0.11 - '@types/ember__runloop@4.0.10(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) @@ -15500,10 +15441,6 @@ snapshots: - '@babel/core' - supports-color - '@types/ember__service@4.0.9': - dependencies: - '@types/ember__object': 4.0.12 - '@types/ember__service@4.0.9(@babel/core@7.25.9)': dependencies: '@types/ember__object': 4.0.12(@babel/core@7.25.9) @@ -15524,10 +15461,6 @@ snapshots: - '@babel/core' - supports-color - '@types/ember__utils@4.0.7': - dependencies: - '@types/ember': 4.0.11 - '@types/ember__utils@4.0.7(@babel/core@7.25.9)': dependencies: '@types/ember': 4.0.11(@babel/core@7.25.9) From 5c67a68fd36db21d9c5900135c24a430d037e366 Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 21 Dec 2024 17:12:17 +0100 Subject: [PATCH 2/5] Use declarations plugin --- packages/ember/package.json | 8 ++------ packages/ember/rollup.config.mjs | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/ember/package.json b/packages/ember/package.json index a23e40291..f1fb8872d 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -14,9 +14,7 @@ "dist" ], "scripts": { - "build": "concurrently 'npm:build:*'", - "build:js": "rollup --config", - "build:types": "glint --declaration", + "build": "rollup --config", "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'", "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'", "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern", @@ -24,9 +22,7 @@ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern", "lint:js:fix": "eslint . --fix", "lint:types": "glint", - "start": "concurrently 'npm:start:*'", - "start:js": "rollup --config --watch --no-watch.clearScreen", - "start:types": "glint --declaration --watch", + "start": "rollup --config --watch --no-watch.clearScreen", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "prepack": "pnpm turbo build" }, diff --git a/packages/ember/rollup.config.mjs b/packages/ember/rollup.config.mjs index f4ad5f7ff..d4e08b1a3 100644 --- a/packages/ember/rollup.config.mjs +++ b/packages/ember/rollup.config.mjs @@ -62,6 +62,9 @@ export default [ // Ensure that .gjs files are properly integrated as Javascript addon.gjs(), + // Emit .d.ts declaration files + addon.declarations('declarations'), + // addons are allowed to contain imports of .css files, which we want rollup // to leave alone and keep in the published output. addon.keepAssets(['**/*.css']), From 460930ff658726db6c490e2a79a5ba0cc4645d99 Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 21 Dec 2024 17:32:58 +0100 Subject: [PATCH 3/5] Update config for gts --- packages/ember/.eslintrc.cjs | 104 ++++++++++++++++++ packages/ember/.eslintrc.js | 54 --------- packages/ember/.prettierrc.cjs | 7 ++ ...emplate-lintrc.js => .template-lintrc.cjs} | 0 .../ember/{addon-main.js => addon-main.cjs} | 0 packages/ember/package.json | 6 +- packages/ember/tsconfig.json | 2 +- .../unpublished-development-types/glint.d.ts | 2 +- pnpm-lock.yaml | 12 +- 9 files changed, 126 insertions(+), 61 deletions(-) create mode 100644 packages/ember/.eslintrc.cjs delete mode 100644 packages/ember/.eslintrc.js create mode 100644 packages/ember/.prettierrc.cjs rename packages/ember/{.template-lintrc.js => .template-lintrc.cjs} (100%) rename packages/ember/{addon-main.js => addon-main.cjs} (100%) diff --git a/packages/ember/.eslintrc.cjs b/packages/ember/.eslintrc.cjs new file mode 100644 index 000000000..34d62d92f --- /dev/null +++ b/packages/ember/.eslintrc.cjs @@ -0,0 +1,104 @@ +'use strict'; + +module.exports = { + root: true, + // 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', + 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 + }, + }, + // ts files + { + 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 + }, + }, + { + 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 + { + files: [ + './.eslintrc.cjs', + './.prettierrc.cjs', + './.template-lintrc.cjs', + './addon-main.cjs', + ], + parserOptions: { + sourceType: 'script', + }, + env: { + browser: false, + node: true, + }, + plugins: ['n'], + extends: [ + 'eslint:recommended', + 'plugin:n/recommended', + 'plugin:prettier/recommended', + ], + }, + ], +}; diff --git a/packages/ember/.eslintrc.js b/packages/ember/.eslintrc.js deleted file mode 100644 index 632b5074a..000000000 --- a/packages/ember/.eslintrc.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - babelOptions: { - root: __dirname, - }, - }, - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:prettier/recommended', - ], - env: { - browser: true, - }, - rules: {}, - overrides: [ - // ts files - { - files: ['**/*.ts'], - extends: [ - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - ], - rules: { - // Add any custom rules here - }, - }, - // node files - { - files: [ - './.eslintrc.js', - './.prettierrc.js', - './.template-lintrc.js', - './addon-main.js', - ], - parserOptions: { - sourceType: 'script', - }, - env: { - browser: false, - node: true, - }, - plugins: ['n'], - extends: ['plugin:n/recommended'], - }, - ], -}; diff --git a/packages/ember/.prettierrc.cjs b/packages/ember/.prettierrc.cjs new file mode 100644 index 000000000..f9f8cd217 --- /dev/null +++ b/packages/ember/.prettierrc.cjs @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = { + plugins: ['prettier-plugin-ember-template-tag'], + singleQuote: true, + templateSingleQuote: false, +}; diff --git a/packages/ember/.template-lintrc.js b/packages/ember/.template-lintrc.cjs similarity index 100% rename from packages/ember/.template-lintrc.js rename to packages/ember/.template-lintrc.cjs diff --git a/packages/ember/addon-main.js b/packages/ember/addon-main.cjs similarity index 100% rename from packages/ember/addon-main.js rename to packages/ember/addon-main.cjs diff --git a/packages/ember/package.json b/packages/ember/package.json index f1fb8872d..b770ac101 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -49,6 +49,7 @@ "@glimmer/tracking": "1.1.2", "@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", "@rollup/plugin-node-resolve": "16.0.0", @@ -88,6 +89,7 @@ "eslint-plugin-n": "17.15.1", "eslint-plugin-prettier": "5.2.1", "prettier": "3.4.2", + "prettier-plugin-ember-template-tag": "2.0.4", "rollup": "4.29.1", "rollup-plugin-copy": "3.5.0", "rollup-plugin-node-externals": "8.0.0", @@ -102,7 +104,7 @@ "ember-addon": { "version": 2, "type": "addon", - "main": "addon-main.js", + "main": "addon-main.cjs", "app-js": { "./components/responsive-image.js": "./dist/_app_/components/responsive-image.js", "./helpers/responsive-image-cloudinary.js": "./dist/_app_/helpers/responsive-image-cloudinary.js", @@ -123,7 +125,7 @@ "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, - "./addon-main.js": "./addon-main.js" + "./addon-main.js": "./addon-main.cjs" }, "typesVersions": { "*": { diff --git a/packages/ember/tsconfig.json b/packages/ember/tsconfig.json index 6de81a038..4aac426b3 100644 --- a/packages/ember/tsconfig.json +++ b/packages/ember/tsconfig.json @@ -2,7 +2,7 @@ "extends": "@tsconfig/ember/tsconfig.json", "include": ["src/**/*", "unpublished-development-types/**/*"], "glint": { - "environment": ["ember-loose"] + "environment": ["ember-loose", "ember-template-imports"] }, "compilerOptions": { "allowJs": true, diff --git a/packages/ember/unpublished-development-types/glint.d.ts b/packages/ember/unpublished-development-types/glint.d.ts index 3d32ad322..d86aedef7 100644 --- a/packages/ember/unpublished-development-types/glint.d.ts +++ b/packages/ember/unpublished-development-types/glint.d.ts @@ -2,7 +2,7 @@ import Helper from '@ember/component/helper'; import '@glint/environment-ember-loose'; import 'ember-cached-decorator-polyfill'; import Modifier from 'ember-modifier'; -import AddonRegistry from '../src/template-registry'; +import AddonRegistry from '../src/template-registry.ts'; declare class RenderModifier extends Modifier<{ Element: HTMLElement; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b259965f..c1bfddd75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,7 +70,7 @@ importers: version: 1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))) '@glint/environment-ember-template-imports': specifier: 1.5.0 - version: 1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5)(webpack@5.97.1))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9)) + version: 1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9)) '@glint/template': specifier: 1.5.0 version: 1.5.0 @@ -469,7 +469,7 @@ importers: version: 1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))) '@glint/environment-ember-template-imports': specifier: 1.5.0 - version: 1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5)(webpack@5.97.1))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9)) + version: 1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9)) '@glint/template': specifier: 1.5.0 version: 1.5.0 @@ -921,6 +921,9 @@ importers: '@glint/environment-ember-loose': specifier: 1.5.0 version: 1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))) + '@glint/environment-ember-template-imports': + specifier: 1.5.0 + version: 1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9)) '@glint/template': specifier: 1.5.0 version: 1.5.0 @@ -1038,6 +1041,9 @@ importers: prettier: specifier: 3.4.2 version: 3.4.2 + prettier-plugin-ember-template-tag: + specifier: 2.0.4 + version: 2.0.4(prettier@3.4.2) rollup: specifier: 4.29.1 version: 4.29.1 @@ -14473,7 +14479,7 @@ snapshots: ember-cli-htmlbars: 6.3.0 ember-modifier: 4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5)) - '@glint/environment-ember-template-imports@1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5)(webpack@5.97.1))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))': + '@glint/environment-ember-template-imports@1.5.0(@glint/environment-ember-loose@1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))))(@glint/template@1.5.0)(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__helper@4.0.9(@babel/core@7.25.9))(@types/ember__modifier@4.0.9(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))': dependencies: '@glint/environment-ember-loose': 1.5.0(@glimmer/component@2.0.0)(@glint/template@1.5.0)(@types/ember__array@4.0.10(@babel/core@7.25.9))(@types/ember__component@4.0.22(@babel/core@7.25.9))(@types/ember__controller@4.0.12(@babel/core@7.25.9))(@types/ember__object@4.0.12(@babel/core@7.25.9))(@types/ember__routing@4.0.22(@babel/core@7.25.9))(ember-cli-htmlbars@6.3.0)(ember-modifier@4.2.0(@babel/core@7.25.9)(ember-source@6.0.1(@glimmer/component@2.0.0)(@glint/template@1.5.0)(rsvp@4.8.5))) '@glint/template': 1.5.0 From b1b0060ad37c785c92bc2f2f0cdf3d6414ac40b0 Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 21 Dec 2024 17:33:08 +0100 Subject: [PATCH 4/5] Migrate component to gts --- ...sponsive-image.ts => responsive-image.gts} | 32 +++++++++++++++++++ .../ember/src/components/responsive-image.hbs | 26 --------------- packages/ember/src/index.ts | 2 +- packages/ember/src/template-registry.ts | 2 +- 4 files changed, 34 insertions(+), 28 deletions(-) rename packages/ember/src/components/{responsive-image.ts => responsive-image.gts} (86%) delete mode 100644 packages/ember/src/components/responsive-image.hbs diff --git a/packages/ember/src/components/responsive-image.ts b/packages/ember/src/components/responsive-image.gts similarity index 86% rename from packages/ember/src/components/responsive-image.ts rename to packages/ember/src/components/responsive-image.gts index 647244976..0e03fe331 100644 --- a/packages/ember/src/components/responsive-image.ts +++ b/packages/ember/src/components/responsive-image.gts @@ -16,6 +16,9 @@ import type { import type Owner from '@ember/owner'; import './responsive-image.css'; +import { on } from '@ember/modifier'; +import style from 'ember-style-modifier'; +import { hash } from '@ember/helper'; declare global { const __eri_blurhash: { @@ -230,4 +233,33 @@ export default class ResponsiveImageComponent extends Component + + {{#each this.sourcesSorted as |s|}} + + {{/each}} + + + } diff --git a/packages/ember/src/components/responsive-image.hbs b/packages/ember/src/components/responsive-image.hbs deleted file mode 100644 index 46464e69b..000000000 --- a/packages/ember/src/components/responsive-image.hbs +++ /dev/null @@ -1,26 +0,0 @@ - - {{#each this.sourcesSorted as |s|}} - - {{/each}} - - \ No newline at end of file diff --git a/packages/ember/src/index.ts b/packages/ember/src/index.ts index 322acc9e5..a9379ca35 100644 --- a/packages/ember/src/index.ts +++ b/packages/ember/src/index.ts @@ -1,3 +1,3 @@ -export { default as ResponsiveImage } from './components/responsive-image.ts'; +export { default as ResponsiveImage } from './components/responsive-image.gts'; export { default as resolve } from './helpers/responsive-image-resolve.ts'; export type { ImageData } from '@responsive-image/core'; diff --git a/packages/ember/src/template-registry.ts b/packages/ember/src/template-registry.ts index 0a1bd08a1..809ca8ec9 100644 --- a/packages/ember/src/template-registry.ts +++ b/packages/ember/src/template-registry.ts @@ -1,4 +1,4 @@ -import type ResponsiveImageComponent from './components/responsive-image.ts'; +import type ResponsiveImageComponent from './components/responsive-image.gts'; import type ResponsiveImageResolve from './helpers/responsive-image-resolve.ts'; import type CloudinaryProvider from './helpers/responsive-image-cloudinary'; import type NetlifyProvider from './helpers/responsive-image-netlify'; From 220396501332b4235e665072f4d23b4a2102628e Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 21 Dec 2024 17:35:18 +0100 Subject: [PATCH 5/5] Add changeset --- .changeset/tender-mayflies-love.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tender-mayflies-love.md diff --git a/.changeset/tender-mayflies-love.md b/.changeset/tender-mayflies-love.md new file mode 100644 index 000000000..7a715abb9 --- /dev/null +++ b/.changeset/tender-mayflies-love.md @@ -0,0 +1,5 @@ +--- +'@responsive-image/ember': patch +--- + +Migrate component to gts format