Skip to content

Commit fd8c7a9

Browse files
committed
chore: update dependencies
1 parent 6f44f5f commit fd8c7a9

File tree

11 files changed

+1227
-2514
lines changed

11 files changed

+1227
-2514
lines changed

jest.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

package.json

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"clean": "del-cli ./lib",
1818
"prepare": "yarn run build",
19-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
19+
"test": "vitest",
2020
"lint": "run-p \"lint:*\"",
2121
"lint:eslint": "eslint",
2222
"lint:prettier": "prettier --check .",
@@ -27,28 +27,26 @@
2727
"release": "yarn build && standard-version"
2828
},
2929
"devDependencies": {
30-
"@angular/compiler": "19.0.0",
30+
"@angular/compiler": "19.2.1",
3131
"@babel/code-frame": "7.26.2",
32-
"@babel/parser": "7.26.2",
33-
"@babel/types": "7.26.0",
32+
"@babel/parser": "7.26.9",
33+
"@babel/types": "7.26.9",
3434
"@types/babel__code-frame": "7.0.6",
35-
"@types/jest": "29.5.14",
3635
"del-cli": "6.0.0",
37-
"eslint": "9.15.0",
38-
"eslint-config-prettier": "9.1.0",
36+
"eslint": "9.22.0",
37+
"eslint-config-prettier": "10.1.1",
3938
"eslint-plugin-import": "2.31.0",
4039
"eslint-plugin-simple-import-sort": "12.1.1",
41-
"eslint-plugin-unicorn": "56.0.1",
42-
"globals": "15.12.0",
43-
"jest": "29.7.0",
44-
"jest-snapshot-serializer-raw": "1.2.0",
40+
"eslint-plugin-unicorn": "57.0.0",
41+
"globals": "16.0.0",
42+
"jest-snapshot-serializer-raw": "2.0.0",
4543
"lines-and-columns": "2.0.4",
4644
"npm-run-all": "4.1.5",
47-
"prettier": "3.3.3",
45+
"prettier": "3.5.3",
4846
"standard-version": "9.5.0",
49-
"ts-jest": "29.2.5",
50-
"typescript": "5.7.2",
51-
"typescript-eslint": "8.15.0"
47+
"typescript": "5.8.2",
48+
"typescript-eslint": "8.26.1",
49+
"vitest": "3.0.8"
5250
},
5351
"peerDependencies": {
5452
"@angular/compiler": "^17.3.9 || ^18.0.0 || ^19.0.0"

src/__snapshots__/utils.test.ts.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`fitSpans start: 0, end: 15 1`] = `
3+
exports[`fitSpans > start: 0, end: 15 1`] = `
44
origin
55
> 1 | ( ( ( 1 ) ) )
66
| ^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ outer hasParens=false
1212
| ^^^^^^^^^^^^^
1313
`;
1414

15-
exports[`fitSpans start: 1, end: 14 1`] = `
15+
exports[`fitSpans > start: 1, end: 14 1`] = `
1616
origin
1717
> 1 | ( ( ( 1 ) ) )
1818
| ^^^^^^^^^^^^^
@@ -24,7 +24,7 @@ outer hasParens=false
2424
| ^^^^^^^^^^^^^
2525
`;
2626

27-
exports[`fitSpans start: 2, end: 13 1`] = `
27+
exports[`fitSpans > start: 2, end: 13 1`] = `
2828
origin
2929
> 1 | ( ( ( 1 ) ) )
3030
| ^^^^^^^^^^^
@@ -36,7 +36,7 @@ outer hasParens=true
3636
| ^^^^^^^^^^^^^
3737
`;
3838

39-
exports[`fitSpans start: 3, end: 12 1`] = `
39+
exports[`fitSpans > start: 3, end: 12 1`] = `
4040
origin
4141
> 1 | ( ( ( 1 ) ) )
4242
| ^^^^^^^^^
@@ -48,7 +48,7 @@ outer hasParens=true
4848
| ^^^^^^^^^^^^^
4949
`;
5050

51-
exports[`fitSpans start: 4, end: 11 1`] = `
51+
exports[`fitSpans > start: 4, end: 11 1`] = `
5252
origin
5353
> 1 | ( ( ( 1 ) ) )
5454
| ^^^^^^^
@@ -60,7 +60,7 @@ outer hasParens=true
6060
| ^^^^^^^^^^^^^
6161
`;
6262

63-
exports[`fitSpans start: 5, end: 10 1`] = `
63+
exports[`fitSpans > start: 5, end: 10 1`] = `
6464
origin
6565
> 1 | ( ( ( 1 ) ) )
6666
| ^^^^^
@@ -72,7 +72,7 @@ outer hasParens=true
7272
| ^^^^^^^^^^^^^
7373
`;
7474

75-
exports[`fitSpans start: 6, end: 9 1`] = `
75+
exports[`fitSpans > start: 6, end: 9 1`] = `
7676
origin
7777
> 1 | ( ( ( 1 ) ) )
7878
| ^^^

src/transform-node.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function isParenthesized(node: NGNode) {
1515
return Boolean(node.extra?.parenthesized);
1616
}
1717
function getOuterStart(node: NGNode): number {
18-
return isParenthesized(node) ? node.extra.parenStart : node.start;
18+
return isParenthesized(node) ? node.extra.parenStart : node.start!;
1919
}
2020
function getOuterEnd(node: NGNode): number {
21-
return isParenthesized(node) ? node.extra.parenEnd : node.end;
21+
return isParenthesized(node) ? node.extra.parenEnd : node.end!;
2222
}
2323

2424
function isOptionalObjectOrCallee(node: NGNode): boolean {
@@ -145,12 +145,7 @@ class Transformer extends Source {
145145
const right = this.#transform<babel.Expression>(originalRight);
146146
const start = getOuterStart(left);
147147
const end = getOuterEnd(right);
148-
const properties = {
149-
left,
150-
right,
151-
start,
152-
end,
153-
};
148+
const properties = { left, right, start, end };
154149

155150
if (operator === '&&' || operator === '||' || operator === '??') {
156151
return this.#create<babel.LogicalExpression>(

src/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ describe('fitSpans', () => {
3535
}
3636
});
3737

38-
describe('getCharacterIndex', () => {
38+
test('getCharacterIndex', () => {
3939
expect(getCharacterIndex('foobar', /o/, 0)).toBe(1);
4040
expect(getCharacterIndex('foobar', /o/, 1)).toBe(1);
4141
expect(getCharacterIndex('foobar', 'o', 0)).toBe(1);
4242
expect(() => getCharacterIndex('foobar', '_', 0)).toThrow();
4343
});
4444

45-
describe('getCharacterLastIndex', () => {
45+
test('getCharacterLastIndex', () => {
4646
expect(getCharacterLastIndex('foobar', /o/, 6)).toBe(2);
4747
expect(getCharacterLastIndex('foobar', /o/, 2)).toBe(2);
4848
expect(getCharacterLastIndex('foobar', 'o', 6)).toBe(2);

tests/__snapshots__/transform-microsyntax.test.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[` 1`] = `
4-
NGMicrosyntax {
5-
"body": []
6-
}
7-
> 1 |
8-
| ^
9-
`;
10-
11-
exports[` a 1`] = `
3+
exports[`' a ' 1`] = `
124
NGMicrosyntax {
135
"body": [
146
"NGMicrosyntaxExpression"
@@ -31,7 +23,7 @@ Identifier {
3123
| ^
3224
`;
3325

34-
exports[` a , b 1`] = `
26+
exports[`' a , b ' 1`] = `
3527
NGMicrosyntax {
3628
"body": [
3729
"NGMicrosyntaxExpression",
@@ -61,7 +53,7 @@ NGMicrosyntaxKey {
6153
| ^
6254
`;
6355

64-
exports[` a ; b 1`] = `
56+
exports[`' a ; b ' 1`] = `
6557
NGMicrosyntax {
6658
"body": [
6759
"NGMicrosyntaxExpression",
@@ -91,7 +83,7 @@ NGMicrosyntaxKey {
9183
| ^
9284
`;
9385

94-
exports[` a ; b : c 1`] = `
86+
exports[`' a ; b : c ' 1`] = `
9587
NGMicrosyntax {
9688
"body": [
9789
"NGMicrosyntaxExpression",
@@ -141,7 +133,7 @@ Identifier {
141133
| ^
142134
`;
143135

144-
exports[` a ; b : c as d 1`] = `
136+
exports[`' a ; b : c as d ' 1`] = `
145137
NGMicrosyntax {
146138
"body": [
147139
"NGMicrosyntaxExpression",
@@ -197,7 +189,7 @@ NGMicrosyntaxKey {
197189
| ^
198190
`;
199191

200-
exports[` a ; b as c 1`] = `
192+
exports[`' a ; b as c ' 1`] = `
201193
NGMicrosyntax {
202194
"body": [
203195
"NGMicrosyntaxExpression",
@@ -240,7 +232,7 @@ NGMicrosyntaxKey {
240232
| ^
241233
`;
242234

243-
exports[` a ; b c 1`] = `
235+
exports[`' a ; b c ' 1`] = `
244236
NGMicrosyntax {
245237
"body": [
246238
"NGMicrosyntaxExpression",
@@ -290,7 +282,7 @@ Identifier {
290282
| ^
291283
`;
292284

293-
exports[` a as b 1`] = `
285+
exports[`' a as b ' 1`] = `
294286
NGMicrosyntax {
295287
"body": [
296288
"NGMicrosyntaxExpression"
@@ -319,7 +311,7 @@ NGMicrosyntaxKey {
319311
| ^
320312
`;
321313

322-
exports[` as b 1`] = `
314+
exports[`' as b ' 1`] = `
323315
NGMicrosyntax {
324316
"body": [
325317
"NGMicrosyntaxAs"
@@ -348,7 +340,7 @@ NGMicrosyntaxKey {
348340
| ^
349341
`;
350342

351-
exports[` let "\\"" 1`] = `
343+
exports[`' let "\\"" ' 1`] = `
352344
NGMicrosyntax {
353345
"body": [
354346
"NGMicrosyntaxLet"
@@ -371,7 +363,7 @@ NGMicrosyntaxKey {
371363
| ^^^^
372364
`;
373365
374-
exports[` let "a" = "b" ; "c" as "d" 1`] = `
366+
exports[`' let "a" = "b" ; "c" as "d" ' 1`] = `
375367
NGMicrosyntax {
376368
"body": [
377369
"NGMicrosyntaxLet",
@@ -420,7 +412,7 @@ NGMicrosyntaxKey {
420412
| ^^^
421413
`;
422414
423-
exports[` let hero 1`] = `
415+
exports[`' let hero ' 1`] = `
424416
NGMicrosyntax {
425417
"body": [
426418
"NGMicrosyntaxLet"
@@ -443,7 +435,7 @@ NGMicrosyntaxKey {
443435
| ^^^^
444436
`;
445437
446-
exports[` let hero ; of : heroes 1`] = `
438+
exports[`' let hero ; of : heroes ' 1`] = `
447439
NGMicrosyntax {
448440
"body": [
449441
"NGMicrosyntaxLet",
@@ -493,7 +485,7 @@ Identifier {
493485
| ^^^^^^
494486
`;
495487
496-
exports[` let hero = hello 1`] = `
488+
exports[`' let hero = hello ' 1`] = `
497489
NGMicrosyntax {
498490
"body": [
499491
"NGMicrosyntaxLet"
@@ -522,7 +514,7 @@ NGMicrosyntaxKey {
522514
| ^^^^^
523515
`;
524516
525-
exports[` let hero of heroes 1`] = `
517+
exports[`' let hero of heroes ' 1`] = `
526518
NGMicrosyntax {
527519
"body": [
528520
"NGMicrosyntaxLet",
@@ -571,3 +563,11 @@ Identifier {
571563
> 1 | let hero of heroes
572564
| ^^^^^^
573565
`;
566+
567+
exports[`'' 1`] = `
568+
NGMicrosyntax {
569+
"body": []
570+
}
571+
> 1 |
572+
| ^
573+
`;

0 commit comments

Comments
 (0)