diff --git a/.changeset/social-baths-serve.md b/.changeset/social-baths-serve.md
new file mode 100644
index 00000000..41ae037e
--- /dev/null
+++ b/.changeset/social-baths-serve.md
@@ -0,0 +1,5 @@
+---
+"@codemod-utils/ast-template-tag": minor
+---
+
+Updated content-tag to 4.1.0 (soft-breaking)
diff --git a/packages/ast/template-tag/package.json b/packages/ast/template-tag/package.json
index 0eeffdb6..472ec482 100644
--- a/packages/ast/template-tag/package.json
+++ b/packages/ast/template-tag/package.json
@@ -49,7 +49,7 @@
},
"dependencies": {
"@codemod-utils/ast-javascript": "workspace:^",
- "content-tag": "^4.0.0"
+ "content-tag": "^4.1.0"
},
"devDependencies": {
"@codemod-utils/ast-template": "workspace:*",
diff --git a/packages/ast/template-tag/tests/find-template-tags/class-2.test.ts b/packages/ast/template-tag/tests/find-template-tags/class-2.test.ts
index c5fa9a18..93b78037 100644
--- a/packages/ast/template-tag/tests/find-template-tags/class-2.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/class-2.test.ts
@@ -26,8 +26,10 @@ testOnPosix('find-template-tags > class (2)', function () {
contentRange: {
endByte: 222,
endChar: 222,
+ endUtf16Codepoint: 222,
startByte: 152,
startChar: 152,
+ startUtf16Codepoint: 152,
},
contents: normalizeFile([
``,
@@ -39,20 +41,26 @@ testOnPosix('find-template-tags > class (2)', function () {
endRange: {
endByte: 233,
endChar: 233,
+ endUtf16Codepoint: 233,
startByte: 222,
startChar: 222,
+ startUtf16Codepoint: 222,
},
range: {
endByte: 233,
endChar: 233,
+ endUtf16Codepoint: 233,
startByte: 142,
startChar: 142,
+ startUtf16Codepoint: 142,
},
startRange: {
endByte: 152,
endChar: 152,
+ endUtf16Codepoint: 152,
startByte: 142,
startChar: 142,
+ startUtf16Codepoint: 142,
},
tagName: 'template',
type: 'class-member',
diff --git a/packages/ast/template-tag/tests/find-template-tags/class-3.test.ts b/packages/ast/template-tag/tests/find-template-tags/class-3.test.ts
index 9ff5f6fb..10b90c7b 100644
--- a/packages/ast/template-tag/tests/find-template-tags/class-3.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/class-3.test.ts
@@ -44,8 +44,10 @@ testOnPosix('find-template-tags > class (3)', function () {
contentRange: {
endByte: 287,
endChar: 275,
+ endUtf16Codepoint: 279,
startByte: 156,
startChar: 156,
+ startUtf16Codepoint: 156,
},
contents: normalizeFile([
``,
@@ -60,20 +62,26 @@ testOnPosix('find-template-tags > class (3)', function () {
endRange: {
endByte: 298,
endChar: 286,
+ endUtf16Codepoint: 290,
startByte: 287,
startChar: 275,
+ startUtf16Codepoint: 279,
},
range: {
endByte: 298,
endChar: 286,
+ endUtf16Codepoint: 290,
startByte: 146,
startChar: 146,
+ startUtf16Codepoint: 146,
},
startRange: {
endByte: 156,
endChar: 156,
+ endUtf16Codepoint: 156,
startByte: 146,
startChar: 146,
+ startUtf16Codepoint: 146,
},
tagName: 'template',
type: 'expression',
@@ -82,8 +90,10 @@ testOnPosix('find-template-tags > class (3)', function () {
contentRange: {
endByte: 608,
endChar: 578,
+ endUtf16Codepoint: 588,
startByte: 423,
startChar: 411,
+ startUtf16Codepoint: 415,
},
contents: normalizeFile([
``,
@@ -100,20 +110,26 @@ testOnPosix('find-template-tags > class (3)', function () {
endRange: {
endByte: 619,
endChar: 589,
+ endUtf16Codepoint: 599,
startByte: 608,
startChar: 578,
+ startUtf16Codepoint: 588,
},
range: {
endByte: 619,
endChar: 589,
+ endUtf16Codepoint: 599,
startByte: 413,
startChar: 401,
+ startUtf16Codepoint: 405,
},
startRange: {
endByte: 423,
endChar: 411,
+ endUtf16Codepoint: 415,
startByte: 413,
startChar: 401,
+ startUtf16Codepoint: 405,
},
tagName: 'template',
type: 'class-member',
diff --git a/packages/ast/template-tag/tests/find-template-tags/class-4.test.ts b/packages/ast/template-tag/tests/find-template-tags/class-4.test.ts
index 79d3e729..21d3179e 100644
--- a/packages/ast/template-tag/tests/find-template-tags/class-4.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/class-4.test.ts
@@ -108,8 +108,14 @@ testOnPosix('find-template-tags > class (4)', function () {
assert.deepStrictEqual(templateTags, [
{
- type: 'class-member',
- tagName: 'template',
+ contentRange: {
+ endByte: 2407,
+ endChar: 2407,
+ endUtf16Codepoint: 2407,
+ startByte: 1551,
+ startChar: 1551,
+ startUtf16Codepoint: 1551,
+ },
contents: normalizeFile([
``,
` `,
@@ -146,30 +152,32 @@ testOnPosix('find-template-tags > class (4)', function () {
` `,
` `,
]),
+ endRange: {
+ endByte: 2418,
+ endChar: 2418,
+ endUtf16Codepoint: 2418,
+ startByte: 2407,
+ startChar: 2407,
+ startUtf16Codepoint: 2407,
+ },
range: {
- startByte: 1541,
endByte: 2418,
- startChar: 1541,
endChar: 2418,
+ endUtf16Codepoint: 2418,
+ startByte: 1541,
+ startChar: 1541,
+ startUtf16Codepoint: 1541,
},
startRange: {
- startByte: 1541,
endByte: 1551,
- startChar: 1541,
endChar: 1551,
+ endUtf16Codepoint: 1551,
+ startByte: 1541,
+ startChar: 1541,
+ startUtf16Codepoint: 1541,
},
- contentRange: {
- startByte: 1551,
- endByte: 2407,
- startChar: 1551,
- endChar: 2407,
- },
- endRange: {
- startByte: 2407,
- endByte: 2418,
- startChar: 2407,
- endChar: 2418,
- },
+ tagName: 'template',
+ type: 'class-member',
},
]);
});
diff --git a/packages/ast/template-tag/tests/find-template-tags/rendering-test-2.test.ts b/packages/ast/template-tag/tests/find-template-tags/rendering-test-2.test.ts
index c77d229f..a4a5d374 100644
--- a/packages/ast/template-tag/tests/find-template-tags/rendering-test-2.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/rendering-test-2.test.ts
@@ -54,27 +54,35 @@ testOnPosix('find-template-tags > rendering test (2)', function () {
contentRange: {
endByte: 799,
endChar: 799,
+ endUtf16Codepoint: 799,
startByte: 787,
startChar: 787,
+ startUtf16Codepoint: 787,
},
contents: '',
endRange: {
endByte: 810,
endChar: 810,
+ endUtf16Codepoint: 810,
startByte: 799,
startChar: 799,
+ startUtf16Codepoint: 799,
},
range: {
endByte: 810,
endChar: 810,
+ endUtf16Codepoint: 810,
startByte: 777,
startChar: 777,
+ startUtf16Codepoint: 777,
},
startRange: {
endByte: 787,
endChar: 787,
+ endUtf16Codepoint: 787,
startByte: 777,
startChar: 777,
+ startUtf16Codepoint: 777,
},
tagName: 'template',
type: 'expression',
@@ -83,8 +91,10 @@ testOnPosix('find-template-tags > rendering test (2)', function () {
contentRange: {
endByte: 995,
endChar: 995,
+ endUtf16Codepoint: 995,
startByte: 950,
startChar: 950,
+ startUtf16Codepoint: 950,
},
contents: normalizeFile([
``,
@@ -94,20 +104,26 @@ testOnPosix('find-template-tags > rendering test (2)', function () {
endRange: {
endByte: 1006,
endChar: 1006,
+ endUtf16Codepoint: 1006,
startByte: 995,
startChar: 995,
+ startUtf16Codepoint: 995,
},
range: {
endByte: 1006,
endChar: 1006,
+ endUtf16Codepoint: 1006,
startByte: 940,
startChar: 940,
+ startUtf16Codepoint: 940,
},
startRange: {
endByte: 950,
endChar: 950,
+ endUtf16Codepoint: 950,
startByte: 940,
startChar: 940,
+ startUtf16Codepoint: 940,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/find-template-tags/rendering-test-3.test.ts b/packages/ast/template-tag/tests/find-template-tags/rendering-test-3.test.ts
index 02504d42..10eb5e2c 100644
--- a/packages/ast/template-tag/tests/find-template-tags/rendering-test-3.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/rendering-test-3.test.ts
@@ -64,27 +64,35 @@ testOnPosix('find-template-tags > rendering test (3)', function () {
contentRange: {
endByte: 806,
endChar: 806,
+ endUtf16Codepoint: 806,
startByte: 794,
startChar: 794,
+ startUtf16Codepoint: 794,
},
contents: '',
endRange: {
endByte: 817,
endChar: 817,
+ endUtf16Codepoint: 817,
startByte: 806,
startChar: 806,
+ startUtf16Codepoint: 806,
},
range: {
endByte: 817,
endChar: 817,
+ endUtf16Codepoint: 817,
startByte: 784,
startChar: 784,
+ startUtf16Codepoint: 784,
},
startRange: {
endByte: 794,
endChar: 794,
+ endUtf16Codepoint: 794,
startByte: 784,
startChar: 784,
+ startUtf16Codepoint: 784,
},
tagName: 'template',
type: 'expression',
@@ -93,8 +101,10 @@ testOnPosix('find-template-tags > rendering test (3)', function () {
contentRange: {
endByte: 1040,
endChar: 1040,
+ endUtf16Codepoint: 1040,
startByte: 991,
startChar: 991,
+ startUtf16Codepoint: 991,
},
contents: normalizeFile([
``,
@@ -104,20 +114,26 @@ testOnPosix('find-template-tags > rendering test (3)', function () {
endRange: {
endByte: 1051,
endChar: 1051,
+ endUtf16Codepoint: 1051,
startByte: 1040,
startChar: 1040,
+ startUtf16Codepoint: 1040,
},
range: {
endByte: 1051,
endChar: 1051,
+ endUtf16Codepoint: 1051,
startByte: 981,
startChar: 981,
+ startUtf16Codepoint: 981,
},
startRange: {
endByte: 991,
endChar: 991,
+ endUtf16Codepoint: 991,
startByte: 981,
startChar: 981,
+ startUtf16Codepoint: 981,
},
tagName: 'template',
type: 'expression',
@@ -126,27 +142,35 @@ testOnPosix('find-template-tags > rendering test (3)', function () {
contentRange: {
endByte: 1220,
endChar: 1220,
+ endUtf16Codepoint: 1220,
startByte: 1191,
startChar: 1191,
+ startUtf16Codepoint: 1191,
},
contents: '',
endRange: {
endByte: 1231,
endChar: 1231,
+ endUtf16Codepoint: 1231,
startByte: 1220,
startChar: 1220,
+ startUtf16Codepoint: 1220,
},
range: {
endByte: 1231,
endChar: 1231,
+ endUtf16Codepoint: 1231,
startByte: 1181,
startChar: 1181,
+ startUtf16Codepoint: 1181,
},
startRange: {
endByte: 1191,
endChar: 1191,
+ endUtf16Codepoint: 1191,
startByte: 1181,
startChar: 1181,
+ startUtf16Codepoint: 1181,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/find-template-tags/template-only-1.test.ts b/packages/ast/template-tag/tests/find-template-tags/template-only-1.test.ts
index 3f85d070..f65e6a82 100644
--- a/packages/ast/template-tag/tests/find-template-tags/template-only-1.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/template-only-1.test.ts
@@ -13,27 +13,35 @@ testOnPosix('find-template-tags > template-only (1)', function () {
contentRange: {
endByte: 10,
endChar: 10,
+ endUtf16Codepoint: 10,
startByte: 10,
startChar: 10,
+ startUtf16Codepoint: 10,
},
contents: '',
endRange: {
endByte: 21,
endChar: 21,
+ endUtf16Codepoint: 21,
startByte: 10,
startChar: 10,
+ startUtf16Codepoint: 10,
},
range: {
endByte: 21,
endChar: 21,
+ endUtf16Codepoint: 21,
startByte: 0,
startChar: 0,
+ startUtf16Codepoint: 0,
},
startRange: {
endByte: 10,
endChar: 10,
+ endUtf16Codepoint: 10,
startByte: 0,
startChar: 0,
+ startUtf16Codepoint: 0,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/find-template-tags/template-only-2.test.ts b/packages/ast/template-tag/tests/find-template-tags/template-only-2.test.ts
index 7ed33cd7..a3a199a8 100644
--- a/packages/ast/template-tag/tests/find-template-tags/template-only-2.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/template-only-2.test.ts
@@ -22,8 +22,10 @@ testOnPosix('find-template-tags > template-only (2)', function () {
contentRange: {
endByte: 108,
endChar: 108,
+ endUtf16Codepoint: 108,
startByte: 46,
startChar: 46,
+ startUtf16Codepoint: 46,
},
contents: normalizeFile([
``,
@@ -35,20 +37,26 @@ testOnPosix('find-template-tags > template-only (2)', function () {
endRange: {
endByte: 119,
endChar: 119,
+ endUtf16Codepoint: 119,
startByte: 108,
startChar: 108,
+ startUtf16Codepoint: 108,
},
range: {
endByte: 119,
endChar: 119,
+ endUtf16Codepoint: 119,
startByte: 36,
startChar: 36,
+ startUtf16Codepoint: 36,
},
startRange: {
endByte: 46,
endChar: 46,
+ endUtf16Codepoint: 46,
startByte: 36,
startChar: 36,
+ startUtf16Codepoint: 36,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/find-template-tags/template-only-3.test.ts b/packages/ast/template-tag/tests/find-template-tags/template-only-3.test.ts
index 092df5b9..e778aab5 100644
--- a/packages/ast/template-tag/tests/find-template-tags/template-only-3.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/template-only-3.test.ts
@@ -22,8 +22,10 @@ testOnPosix('find-template-tags > template-only (3)', function () {
contentRange: {
endByte: 123,
endChar: 123,
+ endUtf16Codepoint: 123,
startByte: 61,
startChar: 61,
+ startUtf16Codepoint: 61,
},
contents: normalizeFile([
``,
@@ -35,20 +37,26 @@ testOnPosix('find-template-tags > template-only (3)', function () {
endRange: {
endByte: 134,
endChar: 134,
+ endUtf16Codepoint: 134,
startByte: 123,
startChar: 123,
+ startUtf16Codepoint: 123,
},
range: {
endByte: 134,
endChar: 134,
+ endUtf16Codepoint: 134,
startByte: 51,
startChar: 51,
+ startUtf16Codepoint: 51,
},
startRange: {
endByte: 61,
endChar: 61,
+ endUtf16Codepoint: 61,
startByte: 51,
startChar: 51,
+ startUtf16Codepoint: 51,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/find-template-tags/template-only-4.test.ts b/packages/ast/template-tag/tests/find-template-tags/template-only-4.test.ts
index 7549e241..68a5ed3c 100644
--- a/packages/ast/template-tag/tests/find-template-tags/template-only-4.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/template-only-4.test.ts
@@ -86,8 +86,14 @@ testOnPosix('find-template-tags > template-only (4)', function () {
assert.deepStrictEqual(templateTags, [
{
- type: 'expression',
- tagName: 'template',
+ contentRange: {
+ endByte: 1837,
+ endChar: 1837,
+ endUtf16Codepoint: 1837,
+ startByte: 643,
+ startChar: 643,
+ startUtf16Codepoint: 643,
+ },
contents: normalizeFile([
``,
` template-only (4)', function () {
` `,
` `,
]),
+ endRange: {
+ endByte: 1848,
+ endChar: 1848,
+ endUtf16Codepoint: 1848,
+ startByte: 1837,
+ startChar: 1837,
+ startUtf16Codepoint: 1837,
+ },
range: {
- startByte: 633,
endByte: 1848,
- startChar: 633,
endChar: 1848,
+ endUtf16Codepoint: 1848,
+ startByte: 633,
+ startChar: 633,
+ startUtf16Codepoint: 633,
},
startRange: {
- startByte: 633,
endByte: 643,
- startChar: 633,
endChar: 643,
+ endUtf16Codepoint: 643,
+ startByte: 633,
+ startChar: 633,
+ startUtf16Codepoint: 633,
},
- contentRange: {
- startByte: 643,
- endByte: 1837,
- startChar: 643,
- endChar: 1837,
- },
- endRange: {
- startByte: 1837,
- endByte: 1848,
- startChar: 1837,
- endChar: 1848,
- },
+ tagName: 'template',
+ type: 'expression',
},
]);
});
diff --git a/packages/ast/template-tag/tests/find-template-tags/template-only-5.test.ts b/packages/ast/template-tag/tests/find-template-tags/template-only-5.test.ts
index 90a8d6ee..de12235f 100644
--- a/packages/ast/template-tag/tests/find-template-tags/template-only-5.test.ts
+++ b/packages/ast/template-tag/tests/find-template-tags/template-only-5.test.ts
@@ -41,8 +41,10 @@ testOnPosix('find-template-tags > template-only (5)', function () {
contentRange: {
endByte: 417,
endChar: 417,
+ endUtf16Codepoint: 417,
startByte: 355,
startChar: 355,
+ startUtf16Codepoint: 355,
},
contents: normalizeFile([
``,
@@ -52,20 +54,26 @@ testOnPosix('find-template-tags > template-only (5)', function () {
endRange: {
endByte: 428,
endChar: 428,
+ endUtf16Codepoint: 428,
startByte: 417,
startChar: 417,
+ startUtf16Codepoint: 417,
},
range: {
endByte: 428,
endChar: 428,
+ endUtf16Codepoint: 428,
startByte: 345,
startChar: 345,
+ startUtf16Codepoint: 345,
},
startRange: {
endByte: 355,
endChar: 355,
+ endUtf16Codepoint: 355,
startByte: 345,
startChar: 345,
+ startUtf16Codepoint: 345,
},
tagName: 'template',
type: 'expression',
@@ -74,27 +82,35 @@ testOnPosix('find-template-tags > template-only (5)', function () {
contentRange: {
endByte: 495,
endChar: 495,
+ endUtf16Codepoint: 495,
startByte: 445,
startChar: 445,
+ startUtf16Codepoint: 445,
},
contents: '
',
endRange: {
endByte: 506,
endChar: 506,
+ endUtf16Codepoint: 506,
startByte: 495,
startChar: 495,
+ startUtf16Codepoint: 495,
},
range: {
endByte: 506,
endChar: 506,
+ endUtf16Codepoint: 506,
startByte: 435,
startChar: 435,
+ startUtf16Codepoint: 435,
},
startRange: {
endByte: 445,
endChar: 445,
+ endUtf16Codepoint: 445,
startByte: 435,
startChar: 435,
+ startUtf16Codepoint: 435,
},
tagName: 'template',
type: 'expression',
diff --git a/packages/ast/template-tag/tests/to-ecma/class-2.test.ts b/packages/ast/template-tag/tests/to-ecma/class-2.test.ts
index f8fe5f4e..c5bbe168 100644
--- a/packages/ast/template-tag/tests/to-ecma/class-2.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/class-2.test.ts
@@ -30,11 +30,9 @@ test('to-ecma > class (2)', function () {
``,
`export default class MyComponent extends Component {`,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- `
`,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ `Hello world!`,
+ `
\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
diff --git a/packages/ast/template-tag/tests/to-ecma/class-3.test.ts b/packages/ast/template-tag/tests/to-ecma/class-3.test.ts
index a5fabfcf..0125a615 100644
--- a/packages/ast/template-tag/tests/to-ecma/class-3.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/class-3.test.ts
@@ -47,14 +47,12 @@ test('to-ecma > class (3)', function () {
``,
`import styles from './example.css';`,
``,
- `const UserName = template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` {{@user.name}}`,
- `
`,
- `\`, {`,
+ `const UserName = template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` {{@user.name}}`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -66,16 +64,14 @@ test('to-ecma > class (3)', function () {
` }`,
``,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\` `,
``,
``,
- ` {{this.timestamp}}`,
+ `{{this.timestamp}}`,
``,
`
😀😀😀 Hello! 🎉🎉🎉`,
`
`,
- `
`,
- `\`, {`,
+ `\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
diff --git a/packages/ast/template-tag/tests/to-ecma/class-4.test.ts b/packages/ast/template-tag/tests/to-ecma/class-4.test.ts
index c862e369..2ccfc681 100644
--- a/packages/ast/template-tag/tests/to-ecma/class-4.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/class-4.test.ts
@@ -171,40 +171,38 @@ test('to-ecma > class (4)', function () {
` }`,
``,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- ` <:label as |l|>`,
- ` `,
+ ``,
``,
- ` <:field as |f|>`,
- ` `,
- ` `,
- ``,
- `\`, {`,
+ `<:field as |f|>`,
+ ``,
+ ``,
+ `\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
diff --git a/packages/ast/template-tag/tests/to-ecma/rendering-test-2.test.ts b/packages/ast/template-tag/tests/to-ecma/rendering-test-2.test.ts
index 81a8e7b5..c4e78c3b 100644
--- a/packages/ast/template-tag/tests/to-ecma/rendering-test-2.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/rendering-test-2.test.ts
@@ -87,9 +87,7 @@ test('to-ecma > rendering test (2)', function () {
``,
` test('We can pass styles', async function (this: TestContext, assert) {`,
` await render(`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-ecma/rendering-test-3.test.ts b/packages/ast/template-tag/tests/to-ecma/rendering-test-3.test.ts
index 7978a003..afc54359 100644
--- a/packages/ast/template-tag/tests/to-ecma/rendering-test-3.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/rendering-test-3.test.ts
@@ -98,9 +98,7 @@ test('to-ecma > rendering test (3)', function () {
` module('Styles', function () {`,
` test('Splattributes', async function (this: TestContext, assert) {`,
` await render(`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-ecma/template-only-2.test.ts b/packages/ast/template-tag/tests/to-ecma/template-only-2.test.ts
index 1e307fb1..3e27fa90 100644
--- a/packages/ast/template-tag/tests/to-ecma/template-only-2.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/template-only-2.test.ts
@@ -22,11 +22,9 @@ test('to-ecma > template-only (2)', function () {
`import { template as template_fd9b2463e5f141cfb5666b64daa1f11a } from "@ember/template-compiler";`,
`import styles from './styles.css';`,
``,
- `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` Hello world!`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-ecma/template-only-3.test.ts b/packages/ast/template-tag/tests/to-ecma/template-only-3.test.ts
index 59808845..3546b78b 100644
--- a/packages/ast/template-tag/tests/to-ecma/template-only-3.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/template-only-3.test.ts
@@ -22,11 +22,9 @@ test('to-ecma > template-only (3)', function () {
`import { template as template_fd9b2463e5f141cfb5666b64daa1f11a } from "@ember/template-compiler";`,
`import styles from './styles.css';`,
``,
- `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` Hello world!`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-ecma/template-only-4.test.ts b/packages/ast/template-tag/tests/to-ecma/template-only-4.test.ts
index a9cb6a4d..7fe0f97e 100644
--- a/packages/ast/template-tag/tests/to-ecma/template-only-4.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/template-only-4.test.ts
@@ -109,49 +109,47 @@ test('to-ecma > template-only (4)', function () {
`}`,
``,
`const ProductsProductCardComponent: TOC =`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` `,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` `,
``,
- ` `,
+ ` `,
``,
- ` `,
- `
`,
- ` {{@product.shortDescription}}`,
- `
`,
+ `
`,
+ `
`,
+ ` {{@product.shortDescription}}`,
+ `
`,
``,
- `
`,
- ` {{formatPrice @product.price}}`,
- `
`,
- `
`,
+ `
`,
+ ` {{formatPrice @product.price}}`,
+ `
`,
+ `
`,
``,
- ` `,
- ` `,
- ` {{t "components.products.product.card.learn-more.label"}}`,
- ` `,
- `
`,
- ` `,
- ` \`, {`,
+ ` `,
+ ` `,
+ ` {{t "components.products.product.card.learn-more.label"}}`,
+ ` `,
+ `
`,
+ `\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-ecma/template-only-5.test.ts b/packages/ast/template-tag/tests/to-ecma/template-only-5.test.ts
index ffff4c28..4b01d621 100644
--- a/packages/ast/template-tag/tests/to-ecma/template-only-5.test.ts
+++ b/packages/ast/template-tag/tests/to-ecma/template-only-5.test.ts
@@ -52,9 +52,7 @@ test('to-ecma > template-only (5)', function () {
``,
`const ProductsProductImageComponent: TOC =`,
` macroCondition(isTesting())`,
- ` ? template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` \`, {`,
+ ` ? template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
diff --git a/packages/ast/template-tag/tests/to-template-tag/class-2.test.ts b/packages/ast/template-tag/tests/to-template-tag/class-2.test.ts
index dd18ff2b..40e4764d 100644
--- a/packages/ast/template-tag/tests/to-template-tag/class-2.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/class-2.test.ts
@@ -11,11 +11,9 @@ test('to-template-tag > class (2)', function () {
``,
`export default class MyComponent extends Component {`,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ `Hello world!`,
+ `
\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
@@ -36,11 +34,9 @@ test('to-template-tag > class (2)', function () {
`import styles from './my-component.css';`,
``,
`export default class MyComponent extends Component {`,
- ` `,
- ` `,
- ` Hello world!`,
- `
`,
- ` `,
+ ` `,
+ ` Hello world!`,
+ `
`,
`}`,
``,
]),
diff --git a/packages/ast/template-tag/tests/to-template-tag/class-3.test.ts b/packages/ast/template-tag/tests/to-template-tag/class-3.test.ts
index 4e50267f..50ee696c 100644
--- a/packages/ast/template-tag/tests/to-template-tag/class-3.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/class-3.test.ts
@@ -10,14 +10,12 @@ test('to-template-tag > class (3)', function () {
``,
`import styles from './example.css';`,
``,
- `const UserName = template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` {{@user.name}}`,
- `
`,
- `\`, {`,
+ `const UserName = template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` {{@user.name}}`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -29,16 +27,14 @@ test('to-template-tag > class (3)', function () {
` }`,
``,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\` `,
``,
``,
- ` {{this.timestamp}}`,
+ `{{this.timestamp}}`,
``,
`
😀😀😀 Hello! 🎉🎉🎉`,
`
`,
- `
`,
- `\`, {`,
+ `\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
@@ -58,30 +54,26 @@ test('to-template-tag > class (3)', function () {
``,
`import styles from './example.css';`,
``,
- `const UserName = `,
- ` `,
- ` {{@user.name}}`,
- `
`,
- `;`,
+ `const UserName = `,
+ ` {{@user.name}}`,
+ `
;`,
``,
`export default class MyComponent extends Component {`,
- ` get timestamp(): string {`,
- ` return 'yesterday';`,
- ` }`,
+ ` get timestamp(): string {`,
+ ` return 'yesterday';`,
+ ` }`,
``,
- ` `,
- ` `,
+ ` `,
``,
- ` `,
+ `
`,
` {{this.timestamp}}`,
``,
- `
😀😀😀 Hello! 🎉🎉🎉`,
- `
`,
- `
`,
- ` `,
+ `
😀😀😀 Hello! 🎉🎉🎉`,
+ `
`,
+ `
`,
`}`,
]),
);
diff --git a/packages/ast/template-tag/tests/to-template-tag/class-4.test.ts b/packages/ast/template-tag/tests/to-template-tag/class-4.test.ts
index 3e63c95d..4ce9b093 100644
--- a/packages/ast/template-tag/tests/to-template-tag/class-4.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/class-4.test.ts
@@ -67,40 +67,38 @@ test('to-template-tag > class (4)', function () {
` }`,
``,
` static{`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- ` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ `<:label as |l|>`,
+ ``,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ``,
+ ``,
``,
- ` <:field as |f|>`,
- ` `,
- ` `,
- ``,
- `\`, {`,
+ `<:field as |f|>`,
+ ``,
+ ``,
+ `\`, {`,
` component: this,`,
` eval () {`,
` return eval(arguments[0]);`,
@@ -177,40 +175,38 @@ test('to-template-tag > class (4)', function () {
` onUpdate({ key, value });`,
` }`,
``,
- ` `,
- ` `,
- ` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` `,
+ ` <:label as |l|>`,
+ ` `,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ` `,
+ ` `,
``,
- ` <:field as |f|>`,
- ` `,
- ` `,
- ` `,
- ` `,
+ ` <:field as |f|>`,
+ ` `,
+ ` `,
+ ` `,
`}`,
``,
]),
diff --git a/packages/ast/template-tag/tests/to-template-tag/rendering-test-2.test.ts b/packages/ast/template-tag/tests/to-template-tag/rendering-test-2.test.ts
index 3977939b..fe533041 100644
--- a/packages/ast/template-tag/tests/to-template-tag/rendering-test-2.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/rendering-test-2.test.ts
@@ -40,9 +40,7 @@ test('to-template-tag > rendering test (2)', function () {
``,
` test('We can pass styles', async function (this: TestContext, assert) {`,
` await render(`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -90,9 +88,7 @@ test('to-template-tag > rendering test (2)', function () {
` });`,
``,
` test('We can pass styles', async function (this: TestContext, assert) {`,
- ` await render(`,
- ` `,
- ` );`,
+ ` await render();`,
``,
` assert.ok(true);`,
` });`,
diff --git a/packages/ast/template-tag/tests/to-template-tag/rendering-test-3.test.ts b/packages/ast/template-tag/tests/to-template-tag/rendering-test-3.test.ts
index 393e1dc4..3a2c2ae6 100644
--- a/packages/ast/template-tag/tests/to-template-tag/rendering-test-3.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/rendering-test-3.test.ts
@@ -41,9 +41,7 @@ test('to-template-tag > rendering test (3)', function () {
` module('Styles', function () {`,
` test('Splattributes', async function (this: TestContext, assert) {`,
` await render(`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ``,
- `\`, {`,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -105,9 +103,7 @@ test('to-template-tag > rendering test (3)', function () {
``,
` module('Styles', function () {`,
` test('Splattributes', async function (this: TestContext, assert) {`,
- ` await render(`,
- ` `,
- ` );`,
+ ` await render();`,
``,
` assert.ok(true);`,
` });`,
diff --git a/packages/ast/template-tag/tests/to-template-tag/template-only-2.test.ts b/packages/ast/template-tag/tests/to-template-tag/template-only-2.test.ts
index 0d93e458..9b4281fb 100644
--- a/packages/ast/template-tag/tests/to-template-tag/template-only-2.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/template-only-2.test.ts
@@ -7,11 +7,9 @@ test('to-template-tag > template-only (2)', function () {
`import { template as template_fd9b2463e5f141cfb5666b64daa1f11a } from "@ember/template-compiler";`,
`import styles from './styles.css';`,
``,
- `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` Hello world!`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -26,11 +24,9 @@ test('to-template-tag > template-only (2)', function () {
normalizeFile([
`import styles from './styles.css';`,
``,
- ``,
- ` `,
- ` Hello world!`,
- `
`,
- ``,
+ ``,
+ ` Hello world!`,
+ `
`,
``,
]),
);
diff --git a/packages/ast/template-tag/tests/to-template-tag/template-only-3.test.ts b/packages/ast/template-tag/tests/to-template-tag/template-only-3.test.ts
index f0d1616e..9ef507f1 100644
--- a/packages/ast/template-tag/tests/to-template-tag/template-only-3.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/template-only-3.test.ts
@@ -7,11 +7,9 @@ test('to-template-tag > template-only (3)', function () {
`import { template as template_fd9b2463e5f141cfb5666b64daa1f11a } from "@ember/template-compiler";`,
`import styles from './styles.css';`,
``,
- `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` Hello world!`,
- `
`,
- `\`, {`,
+ `export default template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` Hello world!`,
+ `
\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -26,11 +24,9 @@ test('to-template-tag > template-only (3)', function () {
normalizeFile([
`import styles from './styles.css';`,
``,
- ``,
- ` `,
- ` Hello world!`,
- `
`,
- ``,
+ ``,
+ ` Hello world!`,
+ `
`,
``,
]),
);
diff --git a/packages/ast/template-tag/tests/to-template-tag/template-only-4.test.ts b/packages/ast/template-tag/tests/to-template-tag/template-only-4.test.ts
index d33258a8..4417bdbf 100644
--- a/packages/ast/template-tag/tests/to-template-tag/template-only-4.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/template-only-4.test.ts
@@ -27,49 +27,47 @@ test('to-template-tag > template-only (4)', function () {
`}`,
``,
`const ProductsProductCardComponent: TOC =`,
- ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` `,
+ ` template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
+ ` `,
``,
- ` `,
+ ` `,
``,
- ` `,
- `
`,
- ` {{@product.shortDescription}}`,
- `
`,
+ `
`,
+ `
`,
+ ` {{@product.shortDescription}}`,
+ `
`,
``,
- `
`,
- ` {{formatPrice @product.price}}`,
- `
`,
- `
`,
+ `
`,
+ ` {{formatPrice @product.price}}`,
+ `
`,
+ `
`,
``,
- ` `,
- ` `,
- ` {{t "components.products.product.card.learn-more.label"}}`,
- ` `,
- `
`,
- ` `,
- ` \`, {`,
+ ` `,
+ ` `,
+ ` {{t "components.products.product.card.learn-more.label"}}`,
+ ` `,
+ `
`,
+ `\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -112,49 +110,47 @@ test('to-template-tag > template-only (4)', function () {
` };`,
`}`,
``,
- `const ProductsProductCardComponent: TOC = `,
- ` `,
- ` `,
+ `const ProductsProductCardComponent: TOC = `,
+ ` `,
``,
- ` `,
+ ` `,
``,
- ` `,
- `
`,
- ` {{@product.shortDescription}}`,
- `
`,
+ `
`,
+ `
`,
+ ` {{@product.shortDescription}}`,
+ `
`,
``,
- `
`,
- ` {{formatPrice @product.price}}`,
- `
`,
- `
`,
+ `
`,
+ ` {{formatPrice @product.price}}`,
+ `
`,
+ `
`,
``,
- ` `,
- ` `,
- ` {{t "components.products.product.card.learn-more.label"}}`,
- ` `,
- `
`,
- ` `,
- ` ;`,
+ ` `,
+ ` `,
+ ` {{t "components.products.product.card.learn-more.label"}}`,
+ ` `,
+ `
`,
+ `;`,
``,
`export default ProductsProductCardComponent;`,
``,
diff --git a/packages/ast/template-tag/tests/to-template-tag/template-only-5.test.ts b/packages/ast/template-tag/tests/to-template-tag/template-only-5.test.ts
index 13c520d3..7ed24820 100644
--- a/packages/ast/template-tag/tests/to-template-tag/template-only-5.test.ts
+++ b/packages/ast/template-tag/tests/to-template-tag/template-only-5.test.ts
@@ -18,9 +18,7 @@ test('to-template-tag > template-only (5)', function () {
``,
`const ProductsProductImageComponent: TOC =`,
` macroCondition(isTesting())`,
- ` ? template_fd9b2463e5f141cfb5666b64daa1f11a(\``,
- ` `,
- ` \`, {`,
+ ` ? template_fd9b2463e5f141cfb5666b64daa1f11a(\`\`, {`,
` eval () {`,
` return eval(arguments[0]);`,
` }`,
@@ -59,9 +57,7 @@ test('to-template-tag > template-only (5)', function () {
`}`,
``,
`const ProductsProductImageComponent: TOC =`,
- ` macroCondition(isTesting()) ? `,
- ` `,
- ` :
;`,
+ ` macroCondition(isTesting()) ? :
;`,
``,
`export default ProductsProductImageComponent;`,
``,
diff --git a/packages/ast/template-tag/tests/update-javascript/class-2.test.ts b/packages/ast/template-tag/tests/update-javascript/class-2.test.ts
index 58d77bfa..5584f9ae 100644
--- a/packages/ast/template-tag/tests/update-javascript/class-2.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/class-2.test.ts
@@ -31,11 +31,9 @@ test('update-javascript > class (2)', function () {
`import styles from './my-component.css';`,
``,
`export default class MyComponent extends Component {`,
- ` `,
- ` `,
- ` Hello world!`,
- `
`,
- ` `,
+ ` `,
+ ` Hello world!`,
+ `
`,
`}`,
``,
]),
diff --git a/packages/ast/template-tag/tests/update-javascript/class-3.test.ts b/packages/ast/template-tag/tests/update-javascript/class-3.test.ts
index e08c365a..4846f494 100644
--- a/packages/ast/template-tag/tests/update-javascript/class-3.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/class-3.test.ts
@@ -49,31 +49,27 @@ test('update-javascript > class (3)', function () {
``,
`import styles from './example.css';`,
``,
- `const UserName = `,
- ` `,
- ` {{@user.name}}`,
- `
`,
- `;`,
+ `const UserName = `,
+ ` {{@user.name}}`,
+ `
;`,
``,
`export default class MyComponent extends Component {`,
- ` // Assigned new name`,
- ` get __timestamp(): string {`,
- ` return 'yesterday';`,
- ` }`,
+ ` // Assigned new name`,
+ ` get __timestamp(): string {`,
+ ` return 'yesterday';`,
+ ` }`,
``,
- ` `,
- ` `,
+ ` `,
``,
- ` `,
+ `
`,
` {{this.timestamp}}`,
``,
- `
😀😀😀 Hello! 🎉🎉🎉`,
- `
`,
- `
`,
- ` `,
+ `
😀😀😀 Hello! 🎉🎉🎉`,
+ `
`,
+ `
`,
`}`,
]),
);
@@ -93,31 +89,27 @@ test('update-javascript > class (3)', function () {
``,
`import styles from './example.css';`,
``,
- `const UserName = `,
- ` `,
- ` {{@user.name}}`,
- `
`,
- `;`,
+ `const UserName = `,
+ ` {{@user.name}}`,
+ `
;`,
``,
`export default class MyComponent extends Component {`,
- ` // Assigned new name`,
- ` get __timestamp(): string {`,
- ` return 'yesterday';`,
- ` }`,
+ ` // Assigned new name`,
+ ` get __timestamp(): string {`,
+ ` return 'yesterday';`,
+ ` }`,
``,
- ` `,
- ` `,
+ ` `,
``,
- ` `,
- ` {{this.timestamp}}`,
+ `
`,
+ ` {{this.timestamp}}`,
``,
- `
😀😀😀 Hello! 🎉🎉🎉`,
- `
`,
- `
`,
- ` `,
+ `
😀😀😀 Hello! 🎉🎉🎉`,
+ `
`,
+ `
`,
`}`,
]),
);
diff --git a/packages/ast/template-tag/tests/update-javascript/class-4.test.ts b/packages/ast/template-tag/tests/update-javascript/class-4.test.ts
index 6624a606..759934b7 100644
--- a/packages/ast/template-tag/tests/update-javascript/class-4.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/class-4.test.ts
@@ -174,40 +174,38 @@ test('update-javascript > class (4)', function () {
` onUpdate({ key, value });`,
` }`,
``,
- ` `,
- ` `,
- ` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` `,
+ ` <:label as |l|>`,
+ ` `,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ` `,
+ ` `,
``,
- ` <:field as |f|>`,
- ` `,
- ` `,
- ` `,
- ` `,
+ ` <:field as |f|>`,
+ ` `,
+ ` `,
+ ` `,
`}`,
``,
]),
@@ -286,40 +284,38 @@ test('update-javascript > class (4)', function () {
` onUpdate({ key, value });`,
` }`,
``,
- ` `,
- ` `,
+ ` `,
` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` `,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ` `,
` `,
``,
` <:field as |f|>`,
- ` `,
+ ` `,
` `,
- ` `,
- ` `,
+ ` `,
`}`,
``,
]),
diff --git a/packages/ast/template-tag/tests/update-javascript/rendering-test-2.test.ts b/packages/ast/template-tag/tests/update-javascript/rendering-test-2.test.ts
index d638923a..3ee49630 100644
--- a/packages/ast/template-tag/tests/update-javascript/rendering-test-2.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/rendering-test-2.test.ts
@@ -85,9 +85,7 @@ test('update-javascript > rendering test (2)', function () {
` });`,
``,
` test('We can pass styles', async function (this: TestContext, assert) {`,
- ` await render(`,
- ` `,
- ` );`,
+ ` await render();`,
``,
` assert.ok(true);`,
` });`,
diff --git a/packages/ast/template-tag/tests/update-javascript/rendering-test-3.test.ts b/packages/ast/template-tag/tests/update-javascript/rendering-test-3.test.ts
index a23a4bd3..58ff0582 100644
--- a/packages/ast/template-tag/tests/update-javascript/rendering-test-3.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/rendering-test-3.test.ts
@@ -96,9 +96,7 @@ test('update-javascript > rendering test (3)', function () {
``,
` module('Styles', function () {`,
` test('Splattributes', async function (this: TestContext, assert) {`,
- ` await render(`,
- ` `,
- ` );`,
+ ` await render();`,
``,
` assert.ok(true);`,
` });`,
diff --git a/packages/ast/template-tag/tests/update-javascript/template-only-2.test.ts b/packages/ast/template-tag/tests/update-javascript/template-only-2.test.ts
index c362348d..2e8896f7 100644
--- a/packages/ast/template-tag/tests/update-javascript/template-only-2.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/template-only-2.test.ts
@@ -24,11 +24,9 @@ test('update-javascript > template-only (2)', function () {
normalizeFile([
`import styles from './styles.css';`,
``,
- ``,
- ` `,
- ` Hello world!`,
- `
`,
- ``,
+ ``,
+ ` Hello world!`,
+ `
`,
``,
]),
);
diff --git a/packages/ast/template-tag/tests/update-javascript/template-only-3.test.ts b/packages/ast/template-tag/tests/update-javascript/template-only-3.test.ts
index d84fef0c..ccf97afd 100644
--- a/packages/ast/template-tag/tests/update-javascript/template-only-3.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/template-only-3.test.ts
@@ -24,11 +24,9 @@ test('update-javascript > template-only (3)', function () {
normalizeFile([
`import styles from './styles.css';`,
``,
- ``,
- ` `,
- ` Hello world!`,
- `
`,
- ``,
+ ``,
+ ` Hello world!`,
+ `
`,
``,
]),
);
diff --git a/packages/ast/template-tag/tests/update-javascript/template-only-4.test.ts b/packages/ast/template-tag/tests/update-javascript/template-only-4.test.ts
index 8e2bca33..395003a8 100644
--- a/packages/ast/template-tag/tests/update-javascript/template-only-4.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/template-only-4.test.ts
@@ -110,49 +110,47 @@ test('update-javascript > template-only (4)', function () {
` };`,
`}`,
``,
- `const ProductsProductCardComponent: TOC = `,
- ` `,
- ` `,
+ `const ProductsProductCardComponent: TOC = `,
+ ` `,
``,
- ` `,
+ ` `,
``,
- ` `,
- `
`,
- ` {{@product.shortDescription}}`,
- `
`,
+ `
`,
+ `
`,
+ ` {{@product.shortDescription}}`,
+ `
`,
``,
- `
`,
- ` {{formatPrice @product.price}}`,
- `
`,
- `
`,
+ `
`,
+ ` {{formatPrice @product.price}}`,
+ `
`,
+ `
`,
``,
- ` `,
- ` `,
- ` {{t "components.products.product.card.learn-more.label"}}`,
- ` `,
- `
`,
- ` `,
- ` ;`,
+ ` `,
+ ` `,
+ ` {{t "components.products.product.card.learn-more.label"}}`,
+ ` `,
+ `
`,
+ `;`,
``,
`export default ProductsProductCardComponent;`,
``,
diff --git a/packages/ast/template-tag/tests/update-javascript/template-only-5.test.ts b/packages/ast/template-tag/tests/update-javascript/template-only-5.test.ts
index 277fe40e..a98019b0 100644
--- a/packages/ast/template-tag/tests/update-javascript/template-only-5.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/template-only-5.test.ts
@@ -53,9 +53,7 @@ test('update-javascript > template-only (5)', function () {
`}`,
``,
`const ProductsProductImageComponent: TOC =`,
- ` macroCondition(isTesting()) ? `,
- ` `,
- ` :
;`,
+ ` macroCondition(isTesting()) ? :
;`,
``,
`export default ProductsProductImageComponent;`,
``,
@@ -73,37 +71,5 @@ test('update-javascript > template-only (5)', function () {
return renameGetters(code, data);
});
- // TODO: Guarantee idempotence
- assert.notStrictEqual(newFile2, newFile);
-
- assert.strictEqual(
- newFile2,
- normalizeFile([
- `import type { TOC } from '@ember/component/template-only';`,
- `import { isTesting, macroCondition } from '@embroider/macros';`,
- ``,
- `import styles from './image.css';`,
- ``,
- `interface ProductsProductImageSignature {`,
- ` Args: {`,
- ` src: string;`,
- ` };`,
- `}`,
- ``,
- `const ProductsProductImageComponent: TOC =`,
- ` macroCondition(isTesting()) ? `,
- ` `,
- ` :
;`,
- ``,
- `export default ProductsProductImageComponent;`,
- ``,
- `declare module '@glint/environment-ember-loose/registry' {`,
- ` export default interface Registry {`,
- ` 'Products::Product::Image': typeof ProductsProductImageComponent;`,
- ` 'products/product/image': typeof ProductsProductImageComponent;`,
- ` }`,
- `}`,
- ``,
- ]),
- );
+ assert.strictEqual(newFile2, newFile);
});
diff --git a/packages/ast/template-tag/tests/update-javascript/update-is-identity-2.test.ts b/packages/ast/template-tag/tests/update-javascript/update-is-identity-2.test.ts
index bd7887e4..76e77f00 100644
--- a/packages/ast/template-tag/tests/update-javascript/update-is-identity-2.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/update-is-identity-2.test.ts
@@ -173,40 +173,38 @@ test('update-javascript > update is identity (2)', function () {
` onUpdate({ key, value });`,
` }`,
``,
- ` `,
- ` `,
- ` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` `,
+ ` <:label as |l|>`,
+ ` `,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ` `,
+ ` `,
``,
- ` <:field as |f|>`,
- ` `,
- ` `,
- ` `,
- ` `,
+ ` <:field as |f|>`,
+ ` `,
+ ` `,
+ ` `,
`}`,
``,
]),
@@ -281,40 +279,38 @@ test('update-javascript > update is identity (2)', function () {
` onUpdate({ key, value });`,
` }`,
``,
- ` `,
- ` `,
+ ` `,
` <:label as |l|>`,
- ` `,
- ` {{@label}}`,
+ ` `,
+ ` {{@label}}`,
``,
- ` {{#if @isRequired}}`,
- ` `,
- ` *`,
- ` `,
- ` {{/if}}`,
- ` `,
+ ` {{#if @isRequired}}`,
+ ` `,
+ ` *`,
+ ` `,
+ ` {{/if}}`,
+ ` `,
` `,
``,
` <:field as |f|>`,
- ` `,
+ ` `,
` `,
- ` `,
- ` `,
+ ` `,
`}`,
``,
]),
diff --git a/packages/ast/template-tag/tests/update-javascript/update-is-identity-3.test.ts b/packages/ast/template-tag/tests/update-javascript/update-is-identity-3.test.ts
index e1a0dd36..57b2ef82 100644
--- a/packages/ast/template-tag/tests/update-javascript/update-is-identity-3.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/update-is-identity-3.test.ts
@@ -96,9 +96,7 @@ test('update-javascript > update is identity (3)', function () {
``,
` module('Styles', function () {`,
` test('Splattributes', async function (this: TestContext, assert) {`,
- ` await render(`,
- ` `,
- ` );`,
+ ` await render();`,
``,
` assert.ok(true);`,
` });`,
diff --git a/packages/ast/template-tag/tests/update-javascript/update-is-identity-4.test.ts b/packages/ast/template-tag/tests/update-javascript/update-is-identity-4.test.ts
index a36817d9..fb3872ac 100644
--- a/packages/ast/template-tag/tests/update-javascript/update-is-identity-4.test.ts
+++ b/packages/ast/template-tag/tests/update-javascript/update-is-identity-4.test.ts
@@ -54,9 +54,7 @@ test('update-javascript > update is identity (4)', function () {
`}`,
``,
`const ProductsProductImageComponent: TOC =`,
- ` macroCondition(isTesting()) ? `,
- ` `,
- ` :
;`,
+ ` macroCondition(isTesting()) ? :
;`,
``,
`export default ProductsProductImageComponent;`,
``,
@@ -72,37 +70,5 @@ test('update-javascript > update is identity (4)', function () {
const newFile2 = updateJavaScript(newFile, identity);
- // TODO: Guarantee idempotence
- assert.notStrictEqual(newFile2, newFile);
-
- assert.strictEqual(
- newFile2,
- normalizeFile([
- `import type { TOC } from '@ember/component/template-only';`,
- `import { isTesting, macroCondition } from '@embroider/macros';`,
- ``,
- `import styles from './image.css';`,
- ``,
- `interface ProductsProductImageSignature {`,
- ` Args: {`,
- ` src: string;`,
- ` };`,
- `}`,
- ``,
- `const ProductsProductImageComponent: TOC =`,
- ` macroCondition(isTesting()) ? `,
- ` `,
- ` :
;`,
- ``,
- `export default ProductsProductImageComponent;`,
- ``,
- `declare module '@glint/environment-ember-loose/registry' {`,
- ` export default interface Registry {`,
- ` 'Products::Product::Image': typeof ProductsProductImageComponent;`,
- ` 'products/product/image': typeof ProductsProductImageComponent;`,
- ` }`,
- `}`,
- ``,
- ]),
- );
+ assert.strictEqual(newFile2, newFile);
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 82940102..10c8ad0f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -149,8 +149,8 @@ importers:
specifier: workspace:^
version: link:../javascript
content-tag:
- specifier: ^4.0.0
- version: 4.0.0
+ specifier: ^4.1.0
+ version: 4.1.0
devDependencies:
'@codemod-utils/ast-template':
specifier: workspace:*
@@ -1131,8 +1131,8 @@ packages:
engines: {node: '>=18'}
hasBin: true
- content-tag@4.0.0:
- resolution: {integrity: sha512-qqJiY9nueYAI396MOmfOk+w/0KL6ERKxANQcSKcR0CrNTc38yT//b73l+WHr9brZx57bFHNaW7a/6Yll0bn95w==}
+ content-tag@4.1.0:
+ resolution: {integrity: sha512-On6gUuvI1l5MScHO+Xbwjeq1Pk9H6HOipDWkzqGGUGmKpq6K5TRmQuCl1LGSHbdIo2l+lSsgLKrLgCl5kKYA+A==}
convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
@@ -2999,7 +2999,7 @@ snapshots:
tree-kill: 1.2.2
yargs: 17.7.2
- content-tag@4.0.0: {}
+ content-tag@4.1.0: {}
convert-source-map@2.0.0: {}
@@ -3611,7 +3611,7 @@ snapshots:
prettier-plugin-ember-template-tag@2.1.2(prettier@3.7.4):
dependencies:
'@babel/core': 7.28.5
- content-tag: 4.0.0
+ content-tag: 4.1.0
prettier: 3.7.4
transitivePeerDependencies:
- supports-color