From 2d2fb93d881a4cf28d94190b3406e07174226094 Mon Sep 17 00:00:00 2001 From: Isaac Lee <16869656+ijlee2@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:53:34 +0100 Subject: [PATCH] Downstreamed changes from @embroider/addon-blueprint@2.7.0 (#215) * chore: Downstreamed changes from @embroider/addon-blueprint@2.7.0 * chore: Added lockfile * chore: Removed .gitkeep --------- Co-authored-by: ijlee2 --- ember-container-query/babel.config.json | 18 ++++++++-- ember-container-query/package.json | 4 ++- ember-container-query/rollup.config.mjs | 29 ++++++++------- ember-container-query/src/.gitkeep | 0 pnpm-lock.yaml | 48 ++++++++++--------------- 5 files changed, 52 insertions(+), 47 deletions(-) delete mode 100644 ember-container-query/src/.gitkeep diff --git a/ember-container-query/babel.config.json b/ember-container-query/babel.config.json index 6b085bf3..af176e1d 100644 --- a/ember-container-query/babel.config.json +++ b/ember-container-query/babel.config.json @@ -1,8 +1,22 @@ { - "presets": [["@babel/preset-typescript"]], "plugins": [ + [ + "@babel/plugin-transform-typescript", + { + "allExtensions": true, + "allowDeclareFields": true, + "onlyRemoveTypeImports": true + } + ], "@embroider/addon-dev/template-colocation-plugin", - ["@babel/plugin-transform-typescript", { "allowDeclareFields": true }], + "@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" ] diff --git a/ember-container-query/package.json b/ember-container-query/package.json index 7fdfefbb..3e8d6691 100644 --- a/ember-container-query/package.json +++ b/ember-container-query/package.json @@ -74,7 +74,8 @@ "@babel/core": "^7.23.2", "@babel/plugin-proposal-decorators": "^7.23.2", "@babel/plugin-transform-class-properties": "^7.22.5", - "@babel/preset-typescript": "^7.23.2", + "@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", "@gavant/glint-template-types": "^0.3.6", @@ -95,6 +96,7 @@ "@types/ember__owner": "^4.0.8", "@types/ember__runloop": "^4.0.7", "@types/ember__service": "^4.0.6", + "babel-plugin-ember-template-compilation": "^2.2.1", "concurrently": "^8.2.2", "ember-template-lint": "^5.12.0", "eslint": "^8.53.0", diff --git a/ember-container-query/rollup.config.mjs b/ember-container-query/rollup.config.mjs index 7cd9dce8..409916cd 100644 --- a/ember-container-query/rollup.config.mjs +++ b/ember-container-query/rollup.config.mjs @@ -15,25 +15,21 @@ export default { plugins: [ // These are the modules that users should be able to import from your // addon. Anything not listed here may get optimized away. - addon.publicEntrypoints([ - 'components/container-query.js', - 'helpers/aspect-ratio.js', - 'helpers/height.js', - 'helpers/width.js', - 'index.js', - 'modifiers/container-query.js', - 'template-registry.js', - ]), + // By default all your JavaScript modules (**/*.js) will be importable. + // But you are encouraged to tweak this to only cover the modules that make + // up your addon's public API. Also make sure your package.json#exports + // is aligned to the config here. + // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon + addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']), // These are the modules that should get reexported into the traditional // "app" tree. Things in here should also be in publicEntrypoints above, but // not everything in publicEntrypoints necessarily needs to go here. addon.appReexports([ - 'components/container-query.js', - 'helpers/aspect-ratio.js', - 'helpers/height.js', - 'helpers/width.js', - 'modifiers/container-query.js', + 'components/**/*.js', + 'helpers/**/*.js', + 'modifiers/**/*.js', + 'services/**/*.js', ]), // Follow the V2 Addon rules about dependencies. Your code can import from @@ -49,12 +45,15 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', - extensions: ['.js', '.ts'], + extensions: ['.gjs', '.gts', '.js', '.ts'], }), // Ensure that standalone .hbs files are properly integrated as Javascript. addon.hbs(), + // Ensure that .gjs files are properly integrated as Javascript + addon.gjs(), + // 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']), diff --git a/ember-container-query/src/.gitkeep b/ember-container-query/src/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecbf79ff..c53e4bbb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -449,9 +449,12 @@ importers: '@babel/plugin-transform-class-properties': specifier: ^7.22.5 version: 7.22.5(@babel/core@7.23.2) - '@babel/preset-typescript': - specifier: ^7.23.2 - version: 7.23.2(@babel/core@7.23.2) + '@babel/plugin-transform-class-static-block': + specifier: ^7.22.11 + version: 7.22.11(@babel/core@7.23.2) + '@babel/plugin-transform-typescript': + specifier: ^7.22.15 + version: 7.22.15(@babel/core@7.23.2) '@babel/runtime': specifier: ^7.23.2 version: 7.23.2 @@ -512,6 +515,9 @@ importers: '@types/ember__service': specifier: ^4.0.6 version: 4.0.6(@babel/core@7.23.2) + babel-plugin-ember-template-compilation: + specifier: ^2.2.1 + version: 2.2.1 concurrently: specifier: ^8.2.2 version: 8.2.2 @@ -1105,16 +1111,6 @@ packages: '@babel/core': 7.23.2(supports-color@8.1.1) '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2(supports-color@8.1.1) - '@babel/helper-plugin-utils': 7.22.5 - dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.2): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -1839,20 +1835,6 @@ packages: '@babel/types': 7.23.0 esutils: 2.0.3 - /@babel/preset-typescript@7.23.2(@babel/core@7.23.2): - resolution: {integrity: sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2(supports-color@8.1.1) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.22.15 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) - '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) - dev: true - /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} @@ -4698,6 +4680,14 @@ packages: dependencies: '@glimmer/syntax': 0.84.3 babel-import-util: 2.0.1 + dev: true + + /babel-plugin-ember-template-compilation@2.2.1: + resolution: {integrity: sha512-alinprIQcLficqkuIyeKKfD4HQOpMOiHK6pt6Skj/yjoPoQYBuwAJ2BoPAlRe9k/URPeVkpMefbN3m6jEp7RsA==} + engines: {node: '>= 12.*'} + dependencies: + '@glimmer/syntax': 0.84.3 + babel-import-util: 2.0.1 /babel-plugin-filter-imports@4.0.0: resolution: {integrity: sha512-jDLlxI8QnfKd7PtieH6pl4tZJzymzfCDCPGdTq/grgbiYAikwDPp/oL0IlFJn0HQjLpcLkyYhPKkUVneRESw5w==} @@ -7105,7 +7095,7 @@ packages: '@embroider/shared-internals': 2.5.0(supports-color@8.1.1) babel-loader: 8.3.0(@babel/core@7.23.2)(webpack@5.89.0) babel-plugin-ember-modules-api-polyfill: 3.5.0 - babel-plugin-ember-template-compilation: 2.2.0 + babel-plugin-ember-template-compilation: 2.2.1 babel-plugin-htmlbars-inline-precompile: 5.3.1 babel-plugin-syntax-dynamic-import: 6.18.0 broccoli-debug: 0.6.5 @@ -7293,7 +7283,7 @@ packages: engines: {node: 12.* || 14.* || >= 16} dependencies: '@ember/edition-utils': 1.2.0 - babel-plugin-ember-template-compilation: 2.2.0 + babel-plugin-ember-template-compilation: 2.2.1 babel-plugin-htmlbars-inline-precompile: 5.3.1 broccoli-debug: 0.6.5 broccoli-persistent-filter: 3.1.3