From 6d5084697b58dcd9a3a21388ff2b683a4d1a115b Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Wed, 17 Mar 2021 10:43:15 -0400 Subject: [PATCH 1/2] Update babel-plugin-htmlbars-inline-precompile to 4.4.6. Fixes an issue when disabling Modules API polyfill option. --- package.json | 2 +- yarn.lock | 413 ++++++--------------------------------------------- 2 files changed, 44 insertions(+), 371 deletions(-) diff --git a/package.json b/package.json index e17103aa..3982d95e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@ember/edition-utils": "^1.2.0", - "babel-plugin-htmlbars-inline-precompile": "^4.4.5", + "babel-plugin-htmlbars-inline-precompile": "^4.4.6", "broccoli-debug": "^0.6.5", "broccoli-persistent-filter": "^3.1.2", "broccoli-plugin": "^4.0.3", diff --git a/yarn.lock b/yarn.lock index 4d399693..8dadca30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,14 +2,14 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11": +"@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.12.13": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== @@ -42,16 +42,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.12.10", "@babel/generator@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" - integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== - dependencies: - "@babel/types" "^7.12.11" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.13.0": +"@babel/generator@^7.12.10", "@babel/generator@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.0.tgz#bd00d4394ca22f220390c56a0b5b85568ec1ec0c" integrity sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw== @@ -67,13 +58,6 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-annotate-as-pure@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz#60bc0bc657f63a0924ff9a4b4a0b24a13cf4deee" - integrity sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw== - dependencies: - "@babel/types" "^7.8.3" - "@babel/helper-builder-binary-assignment-operator-visitor@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz#bb0b75f31bf98cbf9ff143c1ae578b87274ae1a3" @@ -112,15 +96,6 @@ "@babel/helper-regex" "^7.10.4" regexpu-core "^4.7.1" -"@babel/helper-create-regexp-features-plugin@^7.8.3", "@babel/helper-create-regexp-features-plugin@^7.8.8": - version "7.8.8" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz#5d84180b588f560b7864efaeea89243e58312087" - integrity sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/helper-regex" "^7.8.3" - regexpu-core "^4.7.0" - "@babel/helper-define-map@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz#f037ad794264f729eda1889f4ee210b870999092" @@ -138,25 +113,7 @@ "@babel/traverse" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== - dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" - -"@babel/helper-function-name@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz#1fd7738aee5dcf53c3ecff24f1da9c511ec47b42" - integrity sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA== - dependencies: - "@babel/helper-get-function-arity" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/types" "^7.12.11" - -"@babel/helper-function-name@^7.12.13": +"@babel/helper-function-name@^7.10.4", "@babel/helper-function-name@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== @@ -165,20 +122,6 @@ "@babel/template" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-get-function-arity@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-get-function-arity@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz#b158817a3165b5faa2047825dfa61970ddcc16cf" - integrity sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag== - dependencies: - "@babel/types" "^7.12.10" - "@babel/helper-get-function-arity@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" @@ -193,13 +136,6 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-member-expression-to-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz#fba0f2fcff3fba00e6ecb664bb5e6e26e2d6165c" - integrity sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ== - dependencies: - "@babel/types" "^7.12.1" - "@babel/helper-member-expression-to-functions@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz#6aa4bb678e0f8c22f58cdb79451d30494461b091" @@ -207,20 +143,13 @@ dependencies: "@babel/types" "^7.13.0" -"@babel/helper-module-imports@^7.12.1": +"@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.8.3": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz#1644c01591a15a2f084dd6d092d9430eb1d1216c" integrity sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA== dependencies: "@babel/types" "^7.12.1" -"@babel/helper-module-imports@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" - integrity sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== - dependencies: - "@babel/types" "^7.10.4" - "@babel/helper-module-transforms@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" @@ -236,21 +165,14 @@ "@babel/types" "^7.12.1" lodash "^4.17.19" -"@babel/helper-optimise-call-expression@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" - integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-optimise-call-expression@^7.12.13": +"@babel/helper-optimise-call-expression@^7.10.4", "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.1", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== @@ -262,13 +184,6 @@ dependencies: lodash "^4.17.13" -"@babel/helper-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.8.3.tgz#139772607d51b93f23effe72105b319d2a4c6965" - integrity sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ== - dependencies: - lodash "^4.17.13" - "@babel/helper-remap-async-to-generator@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz#8c4dbbf916314f6047dc05e6a2217074238347fd" @@ -278,17 +193,7 @@ "@babel/helper-wrap-function" "^7.10.4" "@babel/types" "^7.12.1" -"@babel/helper-replace-supers@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz#f15c9cc897439281891e11d5ce12562ac0cf3fa9" - integrity sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - -"@babel/helper-replace-supers@^7.13.0": +"@babel/helper-replace-supers@^7.12.1", "@babel/helper-replace-supers@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz#6034b7b51943094cb41627848cb219cb02be1d24" integrity sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw== @@ -312,40 +217,14 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-split-export-declaration@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz#2c70576eaa3b5609b24cb99db2888cc3fc4251d1" - integrity sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-split-export-declaration@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== - dependencies: - "@babel/types" "^7.11.0" - -"@babel/helper-split-export-declaration@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz#1b4cc424458643c47d37022223da33d76ea4603a" - integrity sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g== - dependencies: - "@babel/types" "^7.12.11" - -"@babel/helper-split-export-declaration@^7.12.13": +"@babel/helper-split-export-declaration@^7.10.4", "@babel/helper-split-export-declaration@^7.11.0", "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== - -"@babel/helper-validator-identifier@^7.12.11": +"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== @@ -374,16 +253,7 @@ "@babel/traverse" "^7.12.5" "@babel/types" "^7.12.5" -"@babel/highlight@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" - integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.12.13": +"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": version "7.13.8" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.8.tgz#10b2dac78526424dfc1f47650d0e415dfd9dc481" integrity sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw== @@ -392,12 +262,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.12.10", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.4.5", "@babel/parser@^7.7.0": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" - integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== - -"@babel/parser@^7.12.13", "@babel/parser@^7.13.0": +"@babel/parser@^7.12.10", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.4.5", "@babel/parser@^7.7.0": version "7.13.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.4.tgz#340211b0da94a351a6f10e63671fa727333d13ab" integrity sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA== @@ -510,7 +375,7 @@ "@babel/helper-create-class-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-unicode-property-regex@^7.12.1": +"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz#2a183958d417765b9eae334f47758e5d6a82e072" integrity sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w== @@ -518,14 +383,6 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.8.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz#ee3a95e90cdc04fe8cd92ec3279fa017d68a0d1d" - integrity sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.8" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-async-generators@^7.8.0": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -617,20 +474,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-typescript@^7.12.1": +"@babel/plugin-syntax-typescript@^7.12.1", "@babel/plugin-syntax-typescript@^7.2.0": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz#460ba9d77077653803c3dd2e673f76d66b4029e5" integrity sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-typescript@^7.2.0": - version "7.10.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.1.tgz#5e82bc27bb4202b93b949b029e699db536733810" - integrity sha512-X/d8glkrAtra7CaQGMiGs/OGa6XgUzqPcBXCIGFCpCqnfGlT0Wfbzo/B89xHhnInTaItPK8LALblVXcUOEh95Q== - dependencies: - "@babel/helper-plugin-utils" "^7.10.1" - "@babel/plugin-transform-arrow-functions@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz#8083ffc86ac8e777fbe24b5967c4b2521f3cb2b3" @@ -654,21 +504,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-block-scoping@^7.12.1": +"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.8.3": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.1.tgz#f0ee727874b42a208a48a586b84c3d222c2bbef1" integrity sha512-zJyAC9sZdE60r1nVQHblcfCj29Dh2Y0DOvlMkcqSo0ckqjiCwNiUezUKw+RjOCwGfpLRwnAeQ2XlLpsnGkvv9w== dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-block-scoping@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.4.tgz#a670d1364bb5019a621b9ea2001482876d734787" - integrity sha512-J3b5CluMg3hPUii2onJDRiaVbPtKFPLEaV5dOPY5OeAbDi1iU/UbbFFTgwb7WnanaDy7bjU35kc26W3eM5Qa0A== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - lodash "^4.17.13" - "@babel/plugin-transform-classes@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz#65e650fcaddd3d88ddce67c0f834a3d436a32db6" @@ -697,7 +539,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-dotall-regex@^7.12.1": +"@babel/plugin-transform-dotall-regex@^7.12.1", "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz#a1d16c14862817b6409c0a678d6f9373ca9cd975" integrity sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA== @@ -705,14 +547,6 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz#c3c6ec5ee6125c6993c5cbca20dc8621a9ea7a6e" - integrity sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-transform-duplicate-keys@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz#745661baba295ac06e686822797a69fbaa2ca228" @@ -1029,16 +863,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" - integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" - -"@babel/template@^7.12.13": +"@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.12.7": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== @@ -1047,22 +872,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.0": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.12.tgz#d0cd87892704edd8da002d674bc811ce64743376" - integrity sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w== - dependencies: - "@babel/code-frame" "^7.12.11" - "@babel/generator" "^7.12.11" - "@babel/helper-function-name" "^7.12.11" - "@babel/helper-split-export-declaration" "^7.12.11" - "@babel/parser" "^7.12.11" - "@babel/types" "^7.12.12" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.19" - -"@babel/traverse@^7.13.0": +"@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.13.0", "@babel/traverse@^7.4.5", "@babel/traverse@^7.7.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.0.tgz#6d95752475f86ee7ded06536de309a65fc8966cc" integrity sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== @@ -1077,16 +887,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.12", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.2", "@babel/types@^7.8.3": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" - integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@babel/types@^7.12.13", "@babel/types@^7.13.0": +"@babel/types@^7.10.4", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.13", "@babel/types@^7.12.5", "@babel/types@^7.13.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.2": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== @@ -1236,15 +1037,6 @@ before-after-hook "^2.1.0" universal-user-agent "^5.0.0" -"@octokit/endpoint@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.0.tgz#4c7acd79ab72df78732a7d63b09be53ec5a2230b" - integrity sha512-3nx+MEYoZeD0uJ+7F/gvELLvQJzLXhep2Az0bBSXagbApDvDW0LWwpnAIY/hb0Jwe17A0fJdz0O12dPh05cj7A== - dependencies: - "@octokit/types" "^2.0.0" - is-plain-object "^3.0.0" - universal-user-agent "^5.0.0" - "@octokit/endpoint@^6.0.1": version "6.0.3" resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.3.tgz#dd09b599662d7e1b66374a177ab620d8cdf73487" @@ -1292,21 +1084,7 @@ deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.3.0": - version "5.3.4" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.3.4.tgz#fbc950bf785d59da3b0399fc6d042c8cf52e2905" - integrity sha512-qyj8G8BxQyXjt9Xu6NvfvOr1E0l35lsXtwm3SopsYg/JWXjlsnwqLc8rsD2OLguEL/JjLfBvrXr4az7z8Lch2A== - dependencies: - "@octokit/endpoint" "^6.0.0" - "@octokit/request-error" "^2.0.0" - "@octokit/types" "^2.0.0" - deprecation "^2.0.0" - is-plain-object "^3.0.0" - node-fetch "^2.3.0" - once "^1.4.0" - universal-user-agent "^5.0.0" - -"@octokit/request@^5.4.0": +"@octokit/request@^5.3.0", "@octokit/request@^5.4.0": version "5.4.5" resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.5.tgz#8df65bd812047521f7e9db6ff118c06ba84ac10b" integrity sha512-atAs5GAGbZedvJXXdjtKljin+e2SltEs48B3naJjqWupYl2IUBbB/CJisyjbNHcKpHzb3E+OYEZ46G8eakXgQg== @@ -1337,14 +1115,7 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.0.1.tgz#5459e9a5e9df8565dcc62c17a34491904d71971e" - integrity sha512-GorvORVwp244fGKEt3cgt/P+M0MGy4xEDbckw+K5ojEezxyMDgCaYPKVct+/eWQfZXOT7uq0xRpmrl/+hliabA== - dependencies: - "@types/node" ">= 8" - -"@octokit/types@^5.5.0": +"@octokit/types@^5.0.0", "@octokit/types@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b" integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== @@ -2128,14 +1899,7 @@ babel-plugin-debug-macros@^0.2.0, babel-plugin-debug-macros@^0.2.0-beta.6: dependencies: semver "^5.3.0" -babel-plugin-debug-macros@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-debug-macros/-/babel-plugin-debug-macros-0.3.3.tgz#29c3449d663f61c7385f5b8c72d8015b069a5cb7" - integrity sha512-E+NI8TKpxJDBbVkdWkwHrKgJi696mnRL8XYrOPYw82veNHPDORM9WIQifl6TpIo8PNy2tU2skPqbfkmHXrHKQA== - dependencies: - semver "^5.3.0" - -babel-plugin-debug-macros@^0.3.4: +babel-plugin-debug-macros@^0.3.3, babel-plugin-debug-macros@^0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/babel-plugin-debug-macros/-/babel-plugin-debug-macros-0.3.4.tgz#22961d0cb851a80654cece807a8b4b73d85c6075" integrity sha512-wfel/vb3pXfwIDZUrkoDrn5FHmlWI96PCJ3UCDv2a86poJ3EQrnArNW5KfHSVJ9IOgxHbo748cQt7sDU+0KCEw== @@ -2163,14 +1927,7 @@ babel-plugin-ember-modules-api-polyfill@^2.6.0: dependencies: ember-rfc176-data "^0.3.13" -babel-plugin-ember-modules-api-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-3.2.1.tgz#715252ffde309da36fb32cd6a9bad5c6b61edd33" - integrity sha512-7k4gM0VLAMjoWVxLBDqavH/Dn4mBfzqTuQmtGmZgsdQ4SYVEJ7dewUVeqWBVn5v3QspW4VSoeXh4rHPPlp/rPw== - dependencies: - ember-rfc176-data "^0.3.16" - -babel-plugin-ember-modules-api-polyfill@^3.4.0: +babel-plugin-ember-modules-api-polyfill@^3.2.1, babel-plugin-ember-modules-api-polyfill@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-3.4.0.tgz#3f5e0457e135f8a29b3a8b6910806bb5b524649e" integrity sha512-nVu/LqbZBAup1zLij6xGvQwVLWVk4XYu2fl4vIOUR3S6ukdonMLhKAb0d4QXSzH30Pd7OczVTlPffWbiwahdJw== @@ -2190,10 +1947,10 @@ babel-plugin-htmlbars-inline-precompile@^1.0.0: resolved "https://registry.yarnpkg.com/babel-plugin-htmlbars-inline-precompile/-/babel-plugin-htmlbars-inline-precompile-1.0.0.tgz#a9d2f6eaad8a3f3d361602de593a8cbef8179c22" integrity sha512-4jvKEHR1bAX03hBDZ94IXsYCj3bwk9vYsn6ux6JZNL2U5pvzCWjqyrGahfsGNrhERyxw8IqcirOi9Q6WCo3dkQ== -babel-plugin-htmlbars-inline-precompile@^4.4.5: - version "4.4.5" - resolved "https://registry.yarnpkg.com/babel-plugin-htmlbars-inline-precompile/-/babel-plugin-htmlbars-inline-precompile-4.4.5.tgz#ca0fc6ea49fe13b0a91ff995ee381d33d421a4ef" - integrity sha512-7qnZTDm9uUQppOmEWjAyIPTQ54akEdd9PCIfbTJ8HNgUdekeKC+24uwd+M1ZTjUItby1iLy9maQOK3Wv9RjWJA== +babel-plugin-htmlbars-inline-precompile@^4.4.6: + version "4.4.6" + resolved "https://registry.yarnpkg.com/babel-plugin-htmlbars-inline-precompile/-/babel-plugin-htmlbars-inline-precompile-4.4.6.tgz#9fd632ad2717226b90bde6940b4148b3a323fddb" + integrity sha512-h/HA2T+iKL/AmmOaaH5w107F8G/foMPyapuMWFtwqa+RqHYNiaNg73JCQ13XMa2SJGPYckHE9hKgjV699k1tVA== dependencies: babel-plugin-ember-modules-api-polyfill "^3.4.0" @@ -2626,12 +2383,7 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== -"binaryextensions@1 || 2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.1.2.tgz#c83c3d74233ba7674e4f313cb2a2b70f54e94b7c" - integrity sha512-xVNN69YGDghOqCCtA6FI7avYrr02mTJjOgB0/f1VPD3pJC8QEvjTKWc4epDx8AqxxA75NI0QpVM2gPJXUbE4Tg== - -binaryextensions@^2.1.2: +"binaryextensions@1 || 2", binaryextensions@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.2.0.tgz#e7c6ba82d4f5f5758c26078fe8eea28881233311" integrity sha512-bHhs98rj/7i/RZpCSJ3uk55pLXOItjIrh2sRQZSM6OoktScX+LxJzvlU+FELp9j3TdcddTmmYArLSGptCTwjuw== @@ -3218,7 +2970,7 @@ browserslist@^3.2.6: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" -browserslist@^4.12.0: +browserslist@^4.12.0, browserslist@^4.8.3: version "4.12.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.12.2.tgz#76653d7e4c57caa8a1a28513e2f4e197dc11a711" integrity sha512-MfZaeYqR8StRZdstAK9hCKDd2StvePCYp5rHzQCPicUjfFliDgmuaBNPHYUTpAywBN8+Wc/d7NYVFkO0aqaBUw== @@ -3228,16 +2980,6 @@ browserslist@^4.12.0: escalade "^3.0.1" node-releases "^1.1.58" -browserslist@^4.8.3: - version "4.11.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.11.1.tgz#92f855ee88d6e050e7e7311d987992014f1a1f1b" - integrity sha512-DCTr3kDrKEYNw6Jb9HFxVLQNaue8z+0ZfRBRjmCunKDEXEBajKDj2Y+Uelg+Pi29OnvaSGwjOsnRyNEkXzHg5g== - dependencies: - caniuse-lite "^1.0.30001038" - electron-to-chromium "^1.3.390" - node-releases "^1.1.53" - pkg-up "^2.0.0" - bser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" @@ -3378,12 +3120,7 @@ can-symlink@^1.0.0: dependencies: tmp "0.0.28" -caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30001038: - version "1.0.30001040" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001040.tgz#103fc8e6eb1d7397e95134cd0e996743353d58ea" - integrity sha512-Ep0tEPeI5wCvmJNrXjE3etgfI+lkl1fTDU6Y3ZH1mhrjkPlVI9W4pcKbMo+BQLpEWKVYYp2EmYaRsqpPC3k7lQ== - -caniuse-lite@^1.0.30001088: +caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30001088: version "1.0.30001091" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001091.tgz#84908c67b98e02c2a56d4afa51e6458b53fb5321" integrity sha512-ECd8gfBBpv0GKsEYY5052+8PBjExiugDoi3dfkJcxujh2mf7kiuDvb1o27GXlOOGopKiIPYEX8XDPYj7eo3E9w== @@ -3586,12 +3323,7 @@ cli-highlight@^2.1.4: parse5-htmlparser2-tree-adapter "^5.1.1" yargs "^15.0.0" -cli-spinners@^2.0.0, cli-spinners@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.2.0.tgz#e8b988d9206c692302d8ee834e7a85c0144d8f77" - integrity sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ== - -cli-spinners@^2.4.0: +cli-spinners@^2.0.0, cli-spinners@^2.2.0, cli-spinners@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f" integrity sha512-sJAofoarcm76ZGpuooaO0eDy8saEy+YoZBLjC4h8srt4jeBnkYeOgqxgsJQTpyt2LjI5PTfLJHSL+41Yu4fEJA== @@ -3714,12 +3446,7 @@ colors@1.0.3: resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= -colors@^1.1.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" - integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== - -colors@^1.4.0: +colors@^1.1.2, colors@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== @@ -4243,12 +3970,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.390, electron-to-chromium@^1.3.47: - version "1.3.402" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.402.tgz#9ad93c0c8ea2e571431739e0d76bd6bc9788a846" - integrity sha512-gaCDfX7IUH0s3JmBiHCDPrvVcdnTTP1r4WLJc2dHkYYbLmXZ2XHiJCcGQ9Balf91aKTvuCKCyu2JjJYRykoI1w== - -electron-to-chromium@^1.3.483: +electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.483: version "1.3.483" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.483.tgz#9269e7cfc1c8e72709824da171cbe47ca5e3ca9e" integrity sha512-+05RF8S9rk8S0G8eBCqBRBaRq7+UN3lDs2DAvnG8SBSgQO3hjy0+qt4CmRk5eiuGbTcaicgXfPmBi31a+BD3lg== @@ -4610,12 +4332,7 @@ ember-resolver@^8.0.0: ember-cli-version-checker "^5.0.2" resolve "^1.15.1" -ember-rfc176-data@^0.3.13, ember-rfc176-data@^0.3.15: - version "0.3.15" - resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.15.tgz#af3f1da5a0339b6feda380edc2f7190e0f416c2d" - integrity sha512-GPKa7zRDBblRy0orxTXt5yrpp/Pf5CkuRFSIR8qMFDww0CqCKjCRwdZnWYzCM4kAEfZnXRIDDefe1tBaFw7v7w== - -ember-rfc176-data@^0.3.16: +ember-rfc176-data@^0.3.13, ember-rfc176-data@^0.3.15, ember-rfc176-data@^0.3.16: version "0.3.16" resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.16.tgz#2ace0ac9cf9016d493a74a1d931643a308679803" integrity sha512-IYAzffS90r2ybAcx8c2qprYfkxa70G+/UPkxMN1hw55DU5S2aLOX6v3umKDZItoRhrvZMCnzwsdfKSrKdC9Wbg== @@ -4916,12 +4633,7 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -escalade@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.0.1.tgz#52568a77443f6927cd0ab9c73129137533c965ed" - integrity sha512-DR6NO3h9niOT+MZs7bjxlj2a1k+POu5RN8CLTPX2+i78bRi9eLe7+0zXgUHMnGXWybYcL61E9hGhPKqedy8tQA== - -escalade@^3.1.1: +escalade@^3.0.1, escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== @@ -5107,12 +4819,7 @@ estraverse@^4.1.1: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" - integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== - -estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== @@ -7679,24 +7386,24 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" -mime-db@1.44.0, "mime-db@>= 1.40.0 < 2": +mime-db@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== -mime-db@1.45.0: +mime-db@1.45.0, "mime-db@>= 1.40.0 < 2": version "1.45.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== -mime-types@2.1.27, mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.19, mime-types@^2.1.26: +mime-types@2.1.27: version "2.1.27" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== dependencies: mime-db "1.44.0" -mime-types@~2.1.24: +mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.19, mime-types@^2.1.26, mime-types@~2.1.24: version "2.1.28" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== @@ -8016,11 +7723,6 @@ node-notifier@^5.0.1: shellwords "^0.1.1" which "^1.3.0" -node-releases@^1.1.53: - version "1.1.53" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" - integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== - node-releases@^1.1.58: version "1.1.58" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.58.tgz#8ee20eef30fa60e52755fcc0942def5a734fe935" @@ -8970,18 +8672,6 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -regexpu-core@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938" - integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ== - dependencies: - regenerate "^1.4.0" - regenerate-unicode-properties "^8.2.0" - regjsgen "^0.5.1" - regjsparser "^0.6.4" - unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.2.0" - regexpu-core@^4.7.1: version "4.7.1" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6" @@ -9334,14 +9024,7 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.4.0: - version "6.5.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" - integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== - dependencies: - tslib "^1.9.0" - -rxjs@^6.6.0: +rxjs@^6.4.0, rxjs@^6.6.0: version "6.6.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.2.tgz#8096a7ac03f2cc4fe5860ef6e572810d9e01c0d2" integrity sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg== @@ -9353,12 +9036,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - -safe-buffer@^5.1.0: +safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -10093,12 +9771,7 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -"textextensions@1 || 2": - version "2.5.0" - resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.5.0.tgz#e21d3831dafa37513dd80666dff541414e314293" - integrity sha512-1IkVr355eHcomgK7fgj1Xsokturx6L5S2JRT5WcRdA6v5shk9sxWuO/w/VbpQexwkXJMQIa/j1dBi3oo7+HhcA== - -textextensions@^2.5.0: +"textextensions@1 || 2", textextensions@^2.5.0: version "2.6.0" resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.6.0.tgz#d7e4ab13fe54e32e08873be40d51b74229b00fc4" integrity sha512-49WtAWS+tcsy93dRt6P0P3AMD2m5PvXRhuEA0kaXos5ZLlujtYmpmFsB+QvWUSxE1ZsstmYXfQ7L40+EcQgpAQ== From 26d9fdc14275ccfbb2b7394c493c06645e3dbf30 Mon Sep 17 00:00:00 2001 From: Chris Garrett Date: Tue, 16 Mar 2021 15:29:54 -0700 Subject: [PATCH 2/2] Disable the modules API polyfill on latest Ember Disables the modules API polyfill on the latest versions of Ember. --- lib/colocated-babel-plugin.js | 57 ++- lib/ember-addon-main.js | 15 +- lib/template-compiler-plugin.js | 49 ++- lib/utils.js | 21 +- node-tests/addon-test.js | 1 + node-tests/colocated-babel-plugin-test.js | 489 +++++++++++++++------- node-tests/colocated-test.js | 394 ++++++++++++++++- node-tests/template_compiler_test.js | 362 +++++++++++----- package.json | 2 +- yarn.lock | 9 + 10 files changed, 1109 insertions(+), 290 deletions(-) diff --git a/lib/colocated-babel-plugin.js b/lib/colocated-babel-plugin.js index 544c2cb0..51de9c1a 100644 --- a/lib/colocated-babel-plugin.js +++ b/lib/colocated-babel-plugin.js @@ -3,7 +3,11 @@ module.exports = function (babel) { let t = babel.types; - function makeSetComponentTemplateMemberExpression() { + function makeSetComponentTemplateExpression(state) { + if (!state.opts.requiresModuleApiPolyfill) { + return state._colocationEnsureImport('setComponentTemplate', '@ember/component'); + } + return t.memberExpression(t.identifier('Ember'), t.identifier('_setComponentTemplate')); } @@ -15,6 +19,53 @@ module.exports = function (babel) { name: 'ember-cli-htmlbars-colocation-template', visitor: { + Program(path, state) { + let allAddedImports = {}; + + state._colocationEnsureImport = (exportName, moduleName) => { + let addedImports = (allAddedImports[moduleName] = allAddedImports[moduleName] || {}); + + if (addedImports[exportName]) return addedImports[exportName]; + + let importDeclarations = path.get('body').filter((n) => n.type === 'ImportDeclaration'); + + let preexistingImportDeclaration = importDeclarations.find( + (n) => n.get('source').get('value').node === moduleName + ); + + if (preexistingImportDeclaration) { + let importSpecifier = preexistingImportDeclaration + .get('specifiers') + .find(({ node }) => { + return exportName === 'default' + ? t.isImportDefaultSpecifier(node) + : node.imported.name === exportName; + }); + + if (importSpecifier) { + addedImports[exportName] = importSpecifier.node.local; + } + } + + if (!addedImports[exportName]) { + let uid = path.scope.generateUidIdentifier( + exportName === 'default' ? moduleName : exportName + ); + addedImports[exportName] = uid; + + let newImportSpecifier = + exportName === 'default' + ? t.importDefaultSpecifier(uid) + : t.importSpecifier(uid, t.identifier(exportName)); + + let newImport = t.importDeclaration([newImportSpecifier], t.stringLiteral(moduleName)); + path.unshiftContainer('body', newImport); + } + + return addedImports[exportName]; + }; + }, + VariableDeclarator(path, state) { if (path.node.id.name === '__COLOCATED_TEMPLATE__') { state.colocatedTemplateFound = true; @@ -38,7 +89,7 @@ module.exports = function (babel) { state.setComponentTemplateInjected = true; let defaultExportDeclaration = path.node.declaration; - let setComponentTemplateMemberExpression = makeSetComponentTemplateMemberExpression(); + let setComponentTemplateMemberExpression = makeSetComponentTemplateExpression(state); let colocatedTemplateIdentifier = makeColocatedTemplateIdentifier(); if (defaultExportDeclaration.type === 'ClassDeclaration') { @@ -85,7 +136,7 @@ module.exports = function (babel) { state.setComponentTemplateInjected = true; path.parent.body.push( t.expressionStatement( - t.callExpression(makeSetComponentTemplateMemberExpression(), [ + t.callExpression(makeSetComponentTemplateExpression(state), [ makeColocatedTemplateIdentifier(), defaultSpecifier.local, ]) diff --git a/lib/ember-addon-main.js b/lib/ember-addon-main.js index 13bad063..ca7ca7ea 100644 --- a/lib/ember-addon-main.js +++ b/lib/ember-addon-main.js @@ -3,6 +3,7 @@ const path = require('path'); const SilentError = require('silent-error'); const utils = require('./utils'); +const VersionChecker = require('ember-cli-version-checker'); let registryInvocationCounter = 0; @@ -62,7 +63,7 @@ module.exports = { transpileTree(inputTree, htmlbarsOptions) { const TemplateCompiler = require('./template-compiler-plugin'); - return new TemplateCompiler(inputTree, htmlbarsOptions); + return new TemplateCompiler(inputTree, htmlbarsOptions, this._requiresModuleApiPolyfill); }, setupPreprocessorRegistry(type, registry) { @@ -169,6 +170,9 @@ module.exports = { let isProduction = process.env.EMBER_ENV === 'production'; + let checker = new VersionChecker(this.parent).for('ember-source', 'npm'); + this._requiresModuleApiPolyfill = checker.exists() && checker.lt('3.27.0-alpha.1'); + // This is an option intended to be used only be `ember-template-imports`. // DO NOT USE THIS let customModules = @@ -190,7 +194,8 @@ module.exports = { this.projectConfig(), templateCompilerPath, isProduction, - customModules + customModules, + this._requiresModuleApiPolyfill ); babelPlugins.push(htmlbarsInlinePrecompilePlugin); @@ -205,6 +210,7 @@ module.exports = { projectConfig: this.projectConfig(), templateCompilerPath, modules: customModules, + requiresModuleApiPolyfill: this._requiresModuleApiPolyfill, }); babelPlugins.push(htmlBarsPlugin); @@ -212,7 +218,10 @@ module.exports = { } if (this._shouldColocateTemplates() && !utils.isColocatedBabelPluginRegistered(babelPlugins)) { - babelPlugins.push(require.resolve('./colocated-babel-plugin')); + babelPlugins.push([ + require.resolve('./colocated-babel-plugin'), + { requiresModuleApiPolyfill: this._requiresModuleApiPolyfill }, + ]); } }, diff --git a/lib/template-compiler-plugin.js b/lib/template-compiler-plugin.js index 2847706d..74bf8578 100644 --- a/lib/template-compiler-plugin.js +++ b/lib/template-compiler-plugin.js @@ -24,7 +24,7 @@ function rethrowBuildError(error) { } class TemplateCompiler extends Filter { - constructor(inputTree, _options) { + constructor(inputTree, _options, requiresModuleApiPolyfill) { let options = _options || {}; if (!('persist' in options)) { @@ -35,6 +35,7 @@ class TemplateCompiler extends Filter { this.options = options; this.inputTree = inputTree; + this.requiresModuleApiPolyfill = requiresModuleApiPolyfill; // TODO: do we need this? this.precompile = this.options.templateCompiler.precompile; @@ -51,6 +52,7 @@ class TemplateCompiler extends Filter { processString(string, relativePath) { let srcDir = this.inputPaths[0]; let srcName = path.join(srcDir, relativePath); + try { // we have to reverse these for reasons that are a bit bonkers. the initial // version of this system used `registeredPlugin` from @@ -63,25 +65,23 @@ class TemplateCompiler extends Filter { // sooooooo...... we are forced to maintain that **absolutely bonkers** ordering let astPlugins = this.options.plugins ? [...this.options.plugins.ast].reverse() : []; - let result = - 'export default ' + - utils.template(this.options.templateCompiler, stripBom(string), { - contents: string, - isProduction: this.options.isProduction, - moduleName: relativePath, - parseOptions: { - srcName: srcName, - }, - - // intentionally not using `plugins: this.options.plugins` here - // because if we do, Ember will mutate the shared plugins object (adding - // all of the built in AST transforms into plugins.ast, which breaks - // persistent caching) - plugins: { - ast: astPlugins, - }, - }) + - ';'; + let precompiled = this.options.templateCompiler.precompile(stripBom(string), { + contents: string, + isProduction: this.options.isProduction, + moduleName: relativePath, + parseOptions: { + srcName: srcName, + }, + + // intentionally not using `plugins: this.options.plugins` here + // because if we do, Ember will mutate the shared plugins object (adding + // all of the built in AST transforms into plugins.ast, which breaks + // persistent caching) + plugins: { + ast: astPlugins, + }, + }); + if (this.options.dependencyInvalidation) { let plugins = pluginsWithDependencies(this.options.plugins.ast); let dependencies = []; @@ -91,7 +91,12 @@ class TemplateCompiler extends Filter { } this.dependencies.setDependencies(relativePath, dependencies); } - return result; + + if (this.requiresModuleApiPolyfill) { + return `export default Ember.HTMLBars.template(${precompiled});`; + } else { + return `import { createTemplateFactory } from '@ember/template-factory';\n\nexport default createTemplateFactory(${precompiled});`; + } } catch (error) { rethrowBuildError(error); } @@ -106,6 +111,8 @@ class TemplateCompiler extends Filter { } } + strippedOptions._requiresModuleApiPolyfill = this.requiresModuleApiPolyfill; + return strippedOptions; } diff --git a/lib/utils.js b/lib/utils.js index dc1bcf73..7fd0e01a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -50,9 +50,11 @@ function isInlinePrecompileBabelPluginRegistered(plugins) { } function isColocatedBabelPluginRegistered(plugins) { - return plugins.some( - (plugin) => typeof plugin === 'string' && plugin === require.resolve('./colocated-babel-plugin') - ); + return plugins.some((plugin) => { + let path = Array.isArray(plugin) ? plugin[0] : plugin; + + return typeof path === 'string' && path === require.resolve('./colocated-babel-plugin'); + }); } function buildParalleizedBabelPlugin( @@ -60,7 +62,8 @@ function buildParalleizedBabelPlugin( projectConfig, templateCompilerPath, isProduction, - customModules + customModules, + requiresModuleApiPolyfill ) { let parallelBabelInfo = { requireFile: require.resolve('./require-from-worker'), @@ -71,6 +74,7 @@ function buildParalleizedBabelPlugin( projectConfig, parallelConfigs: pluginInfo.parallelConfigs, modules: Object.assign({}, customModules, INLINE_PRECOMPILE_MODULES), + requiresModuleApiPolyfill, }, }; @@ -199,12 +203,6 @@ function initializeEmberENV(templateCompiler, EmberENV) { } } -function template(templateCompiler, string, options) { - let precompiled = templateCompiler.precompile(string, options); - - return 'Ember.HTMLBars.template(' + precompiled + ')'; -} - function setup(pluginInfo, options) { let projectConfig = options.projectConfig || {}; let templateCompilerPath = options.templateCompilerPath; @@ -261,7 +259,7 @@ function setup(pluginInfo, options) { { precompile, isProduction: options.isProduction, - ensureModuleApiPolyfill: true, + ensureModuleApiPolyfill: options.requiresModuleApiPolyfill, modules: Object.assign({}, options.modules, INLINE_PRECOMPILE_MODULES), }, 'ember-cli-htmlbars:inline-precompile', @@ -355,7 +353,6 @@ function setupPlugins(wrappers) { module.exports = { buildOptions, initializeEmberENV, - template, setup, makeCacheKey, setupPlugins, diff --git a/node-tests/addon-test.js b/node-tests/addon-test.js index 3b81566a..de4b9a4e 100644 --- a/node-tests/addon-test.js +++ b/node-tests/addon-test.js @@ -34,6 +34,7 @@ describe('ember-cli-htmlbars addon', function () { project, parent: project, ui: this.ui, + _requiresModuleApiPolyfill: true, }); project.addons.push(this.addon); diff --git a/node-tests/colocated-babel-plugin-test.js b/node-tests/colocated-babel-plugin-test.js index 01b8ce78..764cf846 100644 --- a/node-tests/colocated-babel-plugin-test.js +++ b/node-tests/colocated-babel-plugin-test.js @@ -22,161 +22,350 @@ const RuntimePlugin = [ describe('ColocatedBabelPlugin', function () { this.slow(500); - it('can be used with decorators', function () { - let { code } = babel.transformSync( - stripIndent` - import Component from '@glimmer/component'; - const __COLOCATED_TEMPLATE__ = 'ok'; - - export default class MyComponent extends Component { - @tracked data = null; - }; - `, - { plugins: [RuntimePlugin, ColocatedBabelPlugin, DecoratorsPlugin, ClassPropertiesPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; - import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; - import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; - - var _class, _descriptor, _temp; - - import Component from '@glimmer/component'; - const __COLOCATED_TEMPLATE__ = 'ok'; - let MyComponent = (_class = (_temp = class MyComponent extends Component { - constructor(...args) { - super(...args); - - _initializerDefineProperty(this, "data", _descriptor, this); - } - - }, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "data", [tracked], { - configurable: true, - enumerable: true, - writable: true, - initializer: function () { - return null; - } - })), _class); - export { MyComponent as default }; - ; - - Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); - ` - ); - }); + describe('requiresModuleApiPolyfill: true', function () { + const ColocatedBabelPluginOptions = [ColocatedBabelPlugin, { requiresModuleApiPolyfill: true }]; - it('can be used with TypeScript merged declarations', function () { - let { code } = babel.transformSync( - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - type MyArgs = { required: string; optional?: number }; - - export default interface MyComponent extends MyArgs {} - export default class MyComponent extends Component {} - `, - { plugins: [ColocatedBabelPlugin, TypeScriptPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default class MyComponent extends Component {} - - Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); - ` - ); - }); + it('can be used with decorators', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from '@glimmer/component'; + const __COLOCATED_TEMPLATE__ = 'ok'; - it('sets the template for non-class default exports', function () { - let { code } = babel.transformSync( - stripIndent` - import MyComponent from 'other-module'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default MyComponent; - `, - { plugins: [ColocatedBabelPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import MyComponent from 'other-module'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); - ` - ); - }); + export default class MyComponent extends Component { + @tracked data = null; + }; + `, + { + plugins: [ + RuntimePlugin, + ColocatedBabelPluginOptions, + DecoratorsPlugin, + ClassPropertiesPlugin, + ], + } + ); - it('sets the template for named class default exports', function () { - let { code } = babel.transformSync( - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default class MyComponent extends Component {} - `, - { plugins: [ColocatedBabelPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default class MyComponent extends Component {} - - Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); - ` - ); - }); + assert.strictEqual( + code, + stripIndent` + import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; + import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; + import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; + + var _class, _descriptor, _temp; + + import Component from '@glimmer/component'; + const __COLOCATED_TEMPLATE__ = 'ok'; + let MyComponent = (_class = (_temp = class MyComponent extends Component { + constructor(...args) { + super(...args); + + _initializerDefineProperty(this, "data", _descriptor, this); + } + + }, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "data", [tracked], { + configurable: true, + enumerable: true, + writable: true, + initializer: function () { + return null; + } + })), _class); + export { MyComponent as default }; + ; + + Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('can be used with TypeScript merged declarations', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + type MyArgs = { required: string; optional?: number }; + + export default interface MyComponent extends MyArgs {} + export default class MyComponent extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions, TypeScriptPlugin] } + ); + + assert.strictEqual( + code, + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + + Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for non-class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import MyComponent from 'other-module'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default MyComponent; + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import MyComponent from 'other-module'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for named class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + + Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for anonymous class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, class extends Component {}); + ` + ); + }); + + it('sets the template for identifier `as default` exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + const MyComponent = class extends Component {}; + export { MyComponent as default }; + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + const MyComponent = class extends Component {}; + export { MyComponent as default }; - it('sets the template for anonymous class default exports', function () { - let { code } = babel.transformSync( - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default class extends Component {} - `, - { plugins: [ColocatedBabelPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - export default Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, class extends Component {}); - ` - ); + Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); }); - it('sets the template for identifier `as default` exports', function () { - let { code } = babel.transformSync( - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - const MyComponent = class extends Component {}; - export { MyComponent as default }; - `, - { plugins: [ColocatedBabelPlugin] } - ); - - assert.strictEqual( - code, - stripIndent` - import Component from 'somewhere'; - const __COLOCATED_TEMPLATE__ = 'ok'; - const MyComponent = class extends Component {}; - export { MyComponent as default }; - - Ember._setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); - ` - ); + describe('requiresModuleApiPolyfill: false', function () { + const ColocatedBabelPluginOptions = [ + ColocatedBabelPlugin, + { requiresModuleApiPolyfill: false }, + ]; + + it('can be used with decorators', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from '@glimmer/component'; + const __COLOCATED_TEMPLATE__ = 'ok'; + + export default class MyComponent extends Component { + @tracked data = null; + }; + `, + { + plugins: [ + RuntimePlugin, + ColocatedBabelPluginOptions, + DecoratorsPlugin, + ClassPropertiesPlugin, + ], + } + ); + + assert.strictEqual( + code, + stripIndent` + import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; + import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; + import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; + + var _class, _descriptor, _temp; + + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import Component from '@glimmer/component'; + const __COLOCATED_TEMPLATE__ = 'ok'; + let MyComponent = (_class = (_temp = class MyComponent extends Component { + constructor(...args) { + super(...args); + + _initializerDefineProperty(this, "data", _descriptor, this); + } + + }, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "data", [tracked], { + configurable: true, + enumerable: true, + writable: true, + initializer: function () { + return null; + } + })), _class); + export { MyComponent as default }; + ; + + _setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('can be used with TypeScript merged declarations', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + type MyArgs = { required: string; optional?: number }; + + export default interface MyComponent extends MyArgs {} + export default class MyComponent extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions, TypeScriptPlugin] } + ); + + assert.strictEqual( + code, + stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + + _setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for non-class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import MyComponent from 'other-module'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default MyComponent; + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import MyComponent from 'other-module'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default _setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for named class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class MyComponent extends Component {} + + _setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); + + it('sets the template for anonymous class default exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default class extends Component {} + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + export default _setComponentTemplate(__COLOCATED_TEMPLATE__, class extends Component {}); + ` + ); + }); + + it('sets the template for identifier `as default` exports', function () { + let { code } = babel.transformSync( + stripIndent` + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + const MyComponent = class extends Component {}; + export { MyComponent as default }; + `, + { plugins: [ColocatedBabelPluginOptions] } + ); + + assert.strictEqual( + code, + stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import Component from 'somewhere'; + const __COLOCATED_TEMPLATE__ = 'ok'; + const MyComponent = class extends Component {}; + export { MyComponent as default }; + + _setComponentTemplate(__COLOCATED_TEMPLATE__, MyComponent); + ` + ); + }); }); }); diff --git a/node-tests/colocated-test.js b/node-tests/colocated-test.js index 18949b3b..bdc4b4e8 100644 --- a/node-tests/colocated-test.js +++ b/node-tests/colocated-test.js @@ -32,7 +32,7 @@ class BabelTranspiler extends BroccoliPersistentFilter { } } -describe('Colocation - Broccoli + Babel Integration', function () { +describe('Colocation - Broccoli + Babel Integration (modules API: true)', function () { this.timeout(10000); let input, output; @@ -57,7 +57,7 @@ describe('Colocation - Broccoli + Babel Integration', function () { }); let babelTree = new BabelTranspiler(colocatedTree, { - plugins: [...plugins, ColocatedBabelPlugin], + plugins: [...plugins, [ColocatedBabelPlugin, { requiresModuleApiPolyfill: true }]], }); output = _createBuilder(babelTree); @@ -416,3 +416,393 @@ describe('Colocation - Broccoli + Babel Integration', function () { it('does not break class decorator usage'); }); + +describe('Colocation - Broccoli + Babel Integration (modules API: false)', function () { + this.timeout(10000); + + let input, output; + + beforeEach(async function () { + input = await createTempDir(); + }); + + afterEach(async function () { + await input.dispose(); + + if (output) { + await output.dispose(); + } + }); + + function createBuilder(plugins = []) { + let colocatedTree = new ColocatedTemplateCompiler(input.path(), { + precompile(template) { + return JSON.stringify({ template }); + }, + }); + + let babelTree = new BabelTranspiler(colocatedTree, { + plugins: [...plugins, [ColocatedBabelPlugin, { requiresModuleApiPolyfill: false }]], + }); + + output = _createBuilder(babelTree); + + return output; + } + + it('works for template only component', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }); + + createBuilder(); + + await output.build(); + + assert.deepStrictEqual(output.read(), { + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import { hbs } from 'ember-cli-htmlbars'; + + const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", { + "contents": "{{yield}}", + "moduleName": "app-name-here/components/foo.hbs", + "parseOptions": { + "srcName": "app-name-here/components/foo.hbs" + } + }); + + import templateOnly from '@ember/component/template-only'; + export default _setComponentTemplate(__COLOCATED_TEMPLATE__, templateOnly()); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }); + }); + + it('works for component with template and class', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + 'foo.js': stripIndent` + import Component from '@glimmer/component'; + + export default class FooComponent extends Component {} + `, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }); + + createBuilder(); + + await output.build(); + + assert.deepStrictEqual(output.read(), { + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import { hbs } from 'ember-cli-htmlbars'; + + const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", { + "contents": "{{yield}}", + "moduleName": "app-name-here/components/foo.hbs", + "parseOptions": { + "srcName": "app-name-here/components/foo.hbs" + } + }); + + import Component from '@glimmer/component'; + export default class FooComponent extends Component {} + + _setComponentTemplate(__COLOCATED_TEMPLATE__, FooComponent); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }); + }); + + it('works for typescript component class with template', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + 'foo.ts': stripIndent` + import Component from '@glimmer/component'; + + export default class FooComponent extends Component {} + `, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }); + + createBuilder([TypescriptTransform]); + + await output.build(); + + assert.deepStrictEqual(output.read(), { + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import { hbs } from 'ember-cli-htmlbars'; + + const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", { + "contents": "{{yield}}", + "moduleName": "app-name-here/components/foo.hbs", + "parseOptions": { + "srcName": "app-name-here/components/foo.hbs" + } + }); + + import Component from '@glimmer/component'; + export default class FooComponent extends Component {} + + _setComponentTemplate(__COLOCATED_TEMPLATE__, FooComponent); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }); + }); + + it('works for scoped addon using template only component', async function () { + input.write({ + '@scope-name': { + 'addon-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }, + }); + + createBuilder(); + + await output.build(); + + assert.deepStrictEqual(output.read(), { + '@scope-name': { + 'addon-name-here': { + components: { + 'foo.js': stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import { hbs } from 'ember-cli-htmlbars'; + + const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", { + "contents": "{{yield}}", + "moduleName": "@scope-name/addon-name-here/components/foo.hbs", + "parseOptions": { + "srcName": "@scope-name/addon-name-here/components/foo.hbs" + } + }); + + import templateOnly from '@ember/component/template-only'; + export default _setComponentTemplate(__COLOCATED_TEMPLATE__, templateOnly()); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }, + }); + }); + + it('works for scoped addon using component with template and class', async function () { + input.write({ + '@scope-name': { + 'addon-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + 'foo.js': stripIndent` + import Component from '@glimmer/component'; + export default class FooComponent extends Component {} + `, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }, + }); + + createBuilder(); + + await output.build(); + + assert.deepStrictEqual(output.read(), { + '@scope-name': { + 'addon-name-here': { + components: { + 'foo.js': stripIndent` + import { setComponentTemplate as _setComponentTemplate } from "@ember/component"; + import { hbs } from 'ember-cli-htmlbars'; + + const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", { + "contents": "{{yield}}", + "moduleName": "@scope-name/addon-name-here/components/foo.hbs", + "parseOptions": { + "srcName": "@scope-name/addon-name-here/components/foo.hbs" + } + }); + + import Component from '@glimmer/component'; + export default class FooComponent extends Component {} + + _setComponentTemplate(__COLOCATED_TEMPLATE__, FooComponent); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }, + }); + }); + + it('does nothing for "classic" location components', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import Component from '@glimmer/component'; + export default class FooComponent extends Component {} + `, + }, + templates: { + 'application.hbs': `{{outlet}}`, + components: { + 'foo.hbs': `{{yield}}`, + }, + }, + }, + }); + + createBuilder(); + + await output.build(); + + assert.deepStrictEqual(output.read(), input.read()); + }); + + it('does nothing for "pod" location templates', async function () { + input.write({ + 'addon-name-here': { + components: { + foo: { + 'template.hbs': `{{yield}}`, + }, + }, + }, + }); + + createBuilder(); + await output.build(); + + assert.deepStrictEqual(output.read(), input.read()); + }); + + it('it works if there are no input files', async function () { + input.write({}); + + createBuilder(); + await output.build(); + + assert.deepStrictEqual(output.read(), {}); + }); + + it('it works if input is manually using setComponentTemplate - no colocated template exists', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import Component from '@glimmer/component'; + import { setComponentTemplate } from '@ember/component'; + import hbs from 'ember-cli-htmlbars-inline-precompile'; + export default class FooComponent extends Component {} + setComponentTemplate(FooComponent, hbs\`sometemplate\`); + `, + }, + templates: { + 'application.hbs': `{{outlet}}`, + }, + }, + }); + + createBuilder(); + await output.build(); + + assert.deepStrictEqual(output.read(), { + 'app-name-here': { + components: { + 'foo.js': stripIndent` + import Component from '@glimmer/component'; + import { setComponentTemplate } from '@ember/component'; + import hbs from 'ember-cli-htmlbars-inline-precompile'; + export default class FooComponent extends Component {} + setComponentTemplate(FooComponent, hbs\`sometemplate\`); + `, + }, + templates: { + 'application.hbs': '{{outlet}}', + }, + }, + }); + }); + + it('emits an error when a default export is not present in a component JS file', async function () { + input.write({ + 'app-name-here': { + components: { + 'foo.hbs': `{{yield}}`, + 'foo.js': stripIndent` + export function whatever() {} + `, + }, + }, + }); + + createBuilder(); + await output.build(); + + assert.deepStrictEqual(output.read(), { + 'app-name-here': { + components: { + 'foo.js': stripIndent` + export function whatever() {}\nthrow new Error("\`app-name-here/components/foo.hbs\` does not contain a \`default export\`. Did you forget to export the component class?"); + `, + }, + }, + }); + }); + + it('does not break class decorator usage'); +}); diff --git a/node-tests/template_compiler_test.js b/node-tests/template_compiler_test.js index b41741fa..76bd4601 100644 --- a/node-tests/template_compiler_test.js +++ b/node-tests/template_compiler_test.js @@ -5,6 +5,7 @@ const TemplateCompiler = require('../lib/template-compiler-plugin'); const co = require('co'); const { createTempDir, createBuilder } = require('broccoli-test-helper'); const fixturify = require('fixturify'); +const { stripIndent } = require('common-tags'); describe('TemplateCompiler', function () { this.timeout(10000); @@ -47,144 +48,309 @@ describe('TemplateCompiler', function () { htmlbarsPrecompile = htmlbarsOptions.templateCompiler.precompile; }); - it( - 'precompiles templates into htmlbars', - co.wrap(function* () { - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + describe('requiresModuleApiPolyfill: true', function () { + it( + 'precompiles templates into htmlbars', + co.wrap(function* () { + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); + + output = createBuilder(tree); + yield output.build(); + + let source = input.readText('template.hbs'); + let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { + moduleName: 'template.hbs', + })});`; + assert.strictEqual(output.readText('template.js'), expected); + }) + ); + + it('invokes AST plugins', async function () { + let source = '{{foo-bar}}'; + input.write({ + 'template.hbs': source, + }); + let plugin = (env) => { + return { + name: 'fake-ast-plugin', + + visitor: { + MustacheStatement() { + return env.syntax.builders.text('Huzzah!'); + }, + }, + }; + }; + + htmlbarsOptions.plugins.ast.push(plugin); + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); output = createBuilder(tree); - yield output.build(); + await output.build(); - let source = input.readText('template.hbs'); let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { moduleName: 'template.hbs', + plugins: { + ast: [plugin], + }, })});`; - assert.strictEqual(output.readText('template.js'), expected); - }) - ); - it('invokes AST plugins', async function () { - let source = '{{foo-bar}}'; - input.write({ - 'template.hbs': source, + let outputString = output.readText('template.js'); + assert.strictEqual(outputString, expected); + assert.ok(outputString.includes('Huzzah!')); }); - let plugin = (env) => { - return { - name: 'fake-ast-plugin', - visitor: { - MustacheStatement() { - return env.syntax.builders.text('Huzzah!'); - }, - }, - }; - }; + it('AST Plugins have access to `isProduction` status', async function () { + let source = '{{foo-bar}}'; + input.write({ + 'template.hbs': source, + }); - htmlbarsOptions.plugins.ast.push(plugin); + let wasProduction = false; + let plugin = (env) => { + wasProduction = env.isProduction; - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + return { + name: 'fake-ast-plugin', - output = createBuilder(tree); - await output.build(); + visitor: {}, + }; + }; - let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { - moduleName: 'template.hbs', - plugins: { - ast: [plugin], - }, - })});`; + htmlbarsOptions.isProduction = true; + htmlbarsOptions.plugins.ast.push(plugin); - let outputString = output.readText('template.js'); - assert.strictEqual(outputString, expected); - assert.ok(outputString.includes('Huzzah!')); - }); + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); + + output = createBuilder(tree); + await output.build(); - it('AST Plugins have access to `isProduction` status', async function () { - let source = '{{foo-bar}}'; - input.write({ - 'template.hbs': source, + assert.ok(wasProduction); }); - let wasProduction = false; - let plugin = (env) => { - wasProduction = env.isProduction; + it( + 'ignores utf-8 byte order marks', + co.wrap(function* () { + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); - return { - name: 'fake-ast-plugin', + output = createBuilder(tree); + yield output.build(); - visitor: {}, - }; - }; + let source = input.readText('template.hbs'); + let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { + moduleName: 'template-with-bom.hbs', + })});`; + + assert.strictEqual(output.readText('template-with-bom.js'), expected); + }) + ); + + it( + 'passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', + co.wrap(function* () { + htmlbarsOptions.FEATURES = { + 'ember-htmlbars-component-generation': true, + }; + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); + + output = createBuilder(tree); + yield output.build(); + + let source = input.readText('web-component-template.hbs'); + let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { + moduleName: 'web-component-template.hbs', + })});`; + + assert.strictEqual(output.readText('web-component-template.js'), expected); + }) + ); - htmlbarsOptions.isProduction = true; - htmlbarsOptions.plugins.ast.push(plugin); + it( + 'passes FEATURES to compiler when provided as `EmberENV.FEATURES`', + co.wrap(function* () { + htmlbarsOptions.EmberENV = { + FEATURES: { + 'ember-htmlbars-component-generation': true, + }, + }; + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + output = createBuilder(tree); + yield output.build(); - output = createBuilder(tree); - await output.build(); + let source = input.readText('web-component-template.hbs'); + let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { + moduleName: 'web-component-template.hbs', + })});`; - assert.ok(wasProduction); + assert.strictEqual(output.readText('web-component-template.js'), expected); + }) + ); }); - it( - 'ignores utf-8 byte order marks', - co.wrap(function* () { - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + describe('requiresModuleApiPolyfill: false', function () { + it( + 'precompiles templates into htmlbars', + co.wrap(function* () { + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); + + output = createBuilder(tree); + yield output.build(); + + let source = input.readText('template.hbs'); + let expected = stripIndent` + import { createTemplateFactory } from '@ember/template-factory'; + + export default createTemplateFactory(${htmlbarsPrecompile(source, { + moduleName: 'template.hbs', + })}); + `; + assert.strictEqual(output.readText('template.js'), expected); + }) + ); + + it('invokes AST plugins', async function () { + let source = '{{foo-bar}}'; + input.write({ + 'template.hbs': source, + }); + let plugin = (env) => { + return { + name: 'fake-ast-plugin', + + visitor: { + MustacheStatement() { + return env.syntax.builders.text('Huzzah!'); + }, + }, + }; + }; + + htmlbarsOptions.plugins.ast.push(plugin); + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); output = createBuilder(tree); - yield output.build(); + await output.build(); - let source = input.readText('template.hbs'); - let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { - moduleName: 'template-with-bom.hbs', - })});`; + let expected = stripIndent` + import { createTemplateFactory } from '@ember/template-factory'; - assert.strictEqual(output.readText('template-with-bom.js'), expected); - }) - ); + export default createTemplateFactory(${htmlbarsPrecompile(source, { + moduleName: 'template.hbs', + plugins: { + ast: [plugin], + }, + })}); + `; - it( - 'passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', - co.wrap(function* () { - htmlbarsOptions.FEATURES = { - 'ember-htmlbars-component-generation': true, + let outputString = output.readText('template.js'); + assert.strictEqual(outputString, expected); + assert.ok(outputString.includes('Huzzah!')); + }); + + it('AST Plugins have access to `isProduction` status', async function () { + let source = '{{foo-bar}}'; + input.write({ + 'template.hbs': source, + }); + + let wasProduction = false; + let plugin = (env) => { + wasProduction = env.isProduction; + + return { + name: 'fake-ast-plugin', + + visitor: {}, + }; }; - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + htmlbarsOptions.isProduction = true; + htmlbarsOptions.plugins.ast.push(plugin); + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); output = createBuilder(tree); - yield output.build(); + await output.build(); - let source = input.readText('web-component-template.hbs'); - let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { - moduleName: 'web-component-template.hbs', - })});`; + assert.ok(wasProduction); + }); - assert.strictEqual(output.readText('web-component-template.js'), expected); - }) - ); + it( + 'ignores utf-8 byte order marks', + co.wrap(function* () { + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); - it( - 'passes FEATURES to compiler when provided as `EmberENV.FEATURES`', - co.wrap(function* () { - htmlbarsOptions.EmberENV = { - FEATURES: { + output = createBuilder(tree); + yield output.build(); + + let source = input.readText('template.hbs'); + let expected = stripIndent` + import { createTemplateFactory } from '@ember/template-factory'; + + export default createTemplateFactory(${htmlbarsPrecompile(source, { + moduleName: 'template-with-bom.hbs', + })}); + `; + + assert.strictEqual(output.readText('template-with-bom.js'), expected); + }) + ); + + it( + 'passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', + co.wrap(function* () { + htmlbarsOptions.FEATURES = { 'ember-htmlbars-component-generation': true, - }, - }; + }; - let tree = new TemplateCompiler(input.path(), htmlbarsOptions); + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); - output = createBuilder(tree); - yield output.build(); + output = createBuilder(tree); + yield output.build(); - let source = input.readText('web-component-template.hbs'); - let expected = `export default Ember.HTMLBars.template(${htmlbarsPrecompile(source, { - moduleName: 'web-component-template.hbs', - })});`; + let source = input.readText('web-component-template.hbs'); + let expected = stripIndent` + import { createTemplateFactory } from '@ember/template-factory'; - assert.strictEqual(output.readText('web-component-template.js'), expected); - }) - ); + export default createTemplateFactory(${htmlbarsPrecompile(source, { + moduleName: 'web-component-template.hbs', + })}); + `; + + assert.strictEqual(output.readText('web-component-template.js'), expected); + }) + ); + + it( + 'passes FEATURES to compiler when provided as `EmberENV.FEATURES`', + co.wrap(function* () { + htmlbarsOptions.EmberENV = { + FEATURES: { + 'ember-htmlbars-component-generation': true, + }, + }; + + let tree = new TemplateCompiler(input.path(), htmlbarsOptions, false); + + output = createBuilder(tree); + yield output.build(); + + let source = input.readText('web-component-template.hbs'); + let expected = stripIndent` + import { createTemplateFactory } from '@ember/template-factory'; + + export default createTemplateFactory(${htmlbarsPrecompile(source, { + moduleName: 'web-component-template.hbs', + })}); + `; + + assert.strictEqual(output.readText('web-component-template.js'), expected); + }) + ); + }); }); diff --git a/package.json b/package.json index 3982d95e..94eddf0b 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "broccoli-plugin": "^4.0.3", "common-tags": "^1.8.0", "ember-cli-babel-plugin-helpers": "^1.1.1", + "ember-cli-version-checker": "^5.1.2", "fs-tree-diff": "^2.0.1", "hash-for-dep": "^1.5.1", "heimdalljs-logger": "^0.1.10", @@ -69,7 +70,6 @@ "ember-cli-babel": "^7.23.1", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-inject-live-reload": "^2.0.2", - "ember-cli-version-checker": "^5.1.1", "ember-compatibility-helpers": "^1.2.2", "ember-export-application-global": "^2.0.1", "ember-load-initializers": "^2.1.1", diff --git a/yarn.lock b/yarn.lock index 8dadca30..8370fa0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4178,6 +4178,15 @@ ember-cli-version-checker@^5.0.2, ember-cli-version-checker@^5.1.1: semver "^7.3.2" silent-error "^1.1.1" +ember-cli-version-checker@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/ember-cli-version-checker/-/ember-cli-version-checker-5.1.2.tgz#649c7b6404902e3b3d69c396e054cea964911ab0" + integrity sha512-rk7GY+FmLn/2e22HsZs0Ycrz8HQ1W3Fv+2TFOuEFW9optnDXDgkntPBIl6gact/LHsfBM5RKbM3dHsIIeLgl0Q== + dependencies: + resolve-package-path "^3.1.0" + semver "^7.3.4" + silent-error "^1.1.1" + ember-cli@~3.25.2: version "3.25.2" resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.25.2.tgz#e48203adfb2e6ff8f93d88b602f2c7c3b1633be2"