Skip to content

Commit 1e1dc0a

Browse files
committed
save
1 parent bbcb643 commit 1e1dc0a

File tree

6 files changed

+329
-0
lines changed

6 files changed

+329
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { compileFixture } from "./src/index.ts";
2+
import { fixtures } from "./fixtures/i18n/i18n-nested.fixture.ts";
3+
4+
const fixture = fixtures.find((f) => f.name === "i18n-same-static-attr-in-conditionals");
5+
if (!fixture) {
6+
console.error("Fixture not found");
7+
process.exit(1);
8+
}
9+
10+
const result = compileFixture(fixture, true);
11+
console.log("===== TypeScript Full =====");
12+
console.log(result.tsOutput.fullCode);
13+
console.log("\n===== OXC Full =====");
14+
console.log(result.oxcOutput.fullCode);

napi/angular-compiler/e2e/compare/fixtures/animations/animation-enter-leave.fixture.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,54 @@ export const fixtures: Fixture[] = [
4040
`,
4141
expectedFeatures: ["ɵɵsyntheticHostProperty", "ɵɵrepeaterCreate"],
4242
},
43+
// Tests for plain animate.enter and animate.leave attributes (without brackets)
44+
// These should emit ɵɵanimateEnter / ɵɵanimateLeave instructions
45+
{
46+
name: "animation-plain-enter-string",
47+
category: "animations",
48+
description: "Plain animate.enter with string value",
49+
className: "AnimationPlainEnterComponent",
50+
template: `<p animate.enter="slide">Sliding Content</p>`,
51+
expectedFeatures: ["ɵɵanimateEnter"],
52+
},
53+
{
54+
name: "animation-plain-leave-string",
55+
category: "animations",
56+
description: "Plain animate.leave with string value",
57+
className: "AnimationPlainLeaveComponent",
58+
template: `<p animate.leave="fade">Fading Content</p>`,
59+
expectedFeatures: ["ɵɵanimateLeave"],
60+
},
61+
{
62+
name: "animation-plain-enter-with-if",
63+
category: "animations",
64+
description: "Plain animate.enter inside @if",
65+
className: "AnimationPlainEnterIfComponent",
66+
template: `
67+
@if (visible) {
68+
<p animate.enter="slide">Conditional sliding content</p>
69+
}
70+
`,
71+
expectedFeatures: ["ɵɵanimateEnter", "ɵɵconditional"],
72+
},
73+
{
74+
name: "animation-plain-leave-with-if",
75+
category: "animations",
76+
description: "Plain animate.leave inside @if",
77+
className: "AnimationPlainLeaveIfComponent",
78+
template: `
79+
@if (visible) {
80+
<p animate.leave="fade">Conditional fading content</p>
81+
}
82+
`,
83+
expectedFeatures: ["ɵɵanimateLeave", "ɵɵconditional"],
84+
},
85+
{
86+
name: "animation-plain-both-enter-leave",
87+
category: "animations",
88+
description: "Both animate.enter and animate.leave on same element",
89+
className: "AnimationPlainBothComponent",
90+
template: `<div animate.enter="slideIn" animate.leave="slideOut">Animated</div>`,
91+
expectedFeatures: ["ɵɵanimateEnter", "ɵɵanimateLeave"],
92+
},
4393
];
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* i18n metadata on property bindings.
3+
*/
4+
import type { Fixture } from "../types.js";
5+
6+
export const fixtures: Fixture[] = [
7+
{
8+
name: "i18n-property-binding-basic",
9+
category: "bindings",
10+
description: "Property binding with i18n metadata",
11+
className: "I18nPropertyBindingBasicComponent",
12+
template: `
13+
<div [cuTooltip]="tooltip.label" i18n-cuTooltip="{{ tooltip.i18n }}"></div>
14+
`,
15+
expectedFeatures: ["ɵɵproperty"],
16+
},
17+
{
18+
name: "i18n-property-binding-multiple",
19+
category: "bindings",
20+
description: "Multiple property bindings with i18n metadata",
21+
className: "I18nPropertyBindingMultipleComponent",
22+
template: `
23+
<div [title]="titleText" i18n-title="@@titleId" [tooltip]="tooltipText" i18n-tooltip="@@tooltipId"></div>
24+
`,
25+
expectedFeatures: ["ɵɵproperty"],
26+
},
27+
{
28+
name: "i18n-bind-prefix",
29+
category: "bindings",
30+
description: "bind- prefix with i18n metadata",
31+
className: "I18nBindPrefixComponent",
32+
template: `
33+
<div bind-tooltip="tooltipText" i18n-tooltip="@@tooltipMsg"></div>
34+
`,
35+
expectedFeatures: ["ɵɵproperty"],
36+
},
37+
];

napi/angular-compiler/e2e/compare/fixtures/i18n/i18n-nested.fixture.ts

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,138 @@ export const fixtures: Fixture[] = [
5858
`,
5959
expectedFeatures: ["ɵɵi18nStart", "ɵɵi18nEnd", "ɵɵconditional"],
6060
},
61+
{
62+
name: "i18n-deeply-nested-control-flow",
63+
category: "i18n",
64+
description: "i18n with deeply nested control flow (nested @if inside @if)",
65+
className: "I18nDeeplyNestedControlFlowComponent",
66+
template: `
67+
<div i18n>
68+
Welcome
69+
@if (outer) {
70+
to the
71+
@if (inner) {
72+
<strong>inner</strong>
73+
} @else {
74+
<em>outer</em>
75+
}
76+
section!
77+
}
78+
</div>
79+
`,
80+
expectedFeatures: ["ɵɵi18nStart", "ɵɵi18nEnd", "ɵɵconditional"],
81+
},
82+
{
83+
name: "i18n-for-loop-nested",
84+
category: "i18n",
85+
description: "i18n with @for loop and nested elements",
86+
className: "I18nForLoopNestedComponent",
87+
template: `
88+
<ul i18n>
89+
Items:
90+
@for (item of items; track item.id) {
91+
<li>{{ item.name }}</li>
92+
} @empty {
93+
<li>No items</li>
94+
}
95+
</ul>
96+
`,
97+
expectedFeatures: ["ɵɵi18nStart", "ɵɵi18nEnd", "ɵɵrepeaterCreate"],
98+
},
99+
{
100+
name: "i18n-static-attr-in-conditional",
101+
category: "i18n",
102+
description: "Static i18n attributes on elements inside @if blocks - tests const deduplication",
103+
className: "I18nStaticAttrInConditionalComponent",
104+
template: `
105+
<div>
106+
@if (conditionA) {
107+
<span
108+
tooltip="First tooltip text"
109+
i18n-tooltip="@@first-tooltip-key"
110+
>First</span>
111+
}
112+
@if (conditionB) {
113+
<span
114+
tooltip="Second tooltip text"
115+
i18n-tooltip="@@second-tooltip-key"
116+
>Second</span>
117+
}
118+
@if (conditionC) {
119+
<span
120+
tooltip="Third tooltip text"
121+
i18n-tooltip="@@third-tooltip-key"
122+
>Third</span>
123+
}
124+
</div>
125+
`,
126+
expectedFeatures: ["ɵɵi18nAttributes"],
127+
},
128+
{
129+
name: "i18n-same-static-attr-in-conditionals",
130+
category: "i18n",
131+
description: "Identical static i18n attributes on elements inside different @if blocks - matches StatusMapRowComponent case",
132+
className: "I18nSameStaticAttrComponent",
133+
template: `
134+
<div>
135+
@if (conditionA) {
136+
<my-icon
137+
class="icon-done"
138+
name="done"
139+
tooltip="Same tooltip text for all"
140+
i18n-tooltip="@@same-key"
141+
></my-icon>
142+
}
143+
@if (conditionB) {
144+
<my-icon
145+
class="icon-done"
146+
name="done"
147+
tooltip="Same tooltip text for all"
148+
i18n-tooltip="@@same-key"
149+
></my-icon>
150+
}
151+
@if (conditionC) {
152+
<my-icon
153+
class="icon-done"
154+
name="done"
155+
tooltip="Same tooltip text for all"
156+
i18n-tooltip="@@same-key"
157+
></my-icon>
158+
}
159+
</div>
160+
`,
161+
expectedFeatures: [],
162+
},
163+
{
164+
name: "no-i18n-same-static-attr-in-conditionals",
165+
category: "i18n",
166+
description: "Identical elements WITHOUT i18n - should deduplicate",
167+
className: "NoI18nSameStaticAttrComponent",
168+
template: `
169+
<div>
170+
@if (conditionA) {
171+
<my-icon
172+
class="icon-done"
173+
name="done"
174+
tooltip="Same tooltip text for all"
175+
></my-icon>
176+
}
177+
@if (conditionB) {
178+
<my-icon
179+
class="icon-done"
180+
name="done"
181+
tooltip="Same tooltip text for all"
182+
></my-icon>
183+
}
184+
@if (conditionC) {
185+
<my-icon
186+
class="icon-done"
187+
name="done"
188+
tooltip="Same tooltip text for all"
189+
></my-icon>
190+
}
191+
</div>
192+
`,
193+
expectedFeatures: [],
194+
},
61195
];
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Structural directives on SVG elements.
3+
* Tests namespace handling for SVG elements with *ngIf, *ngFor, etc.
4+
*/
5+
import type { Fixture } from "../types.js";
6+
7+
export const fixtures: Fixture[] = [
8+
{
9+
name: "svg-structural-if",
10+
category: "templates",
11+
description: "Structural directive (*ngIf) on SVG element",
12+
className: "SvgStructuralIfComponent",
13+
template: `
14+
<svg *ngIf="showSvg" width="100" height="100">
15+
<circle cx="50" cy="50" r="40" fill="red" />
16+
</svg>
17+
`,
18+
expectedFeatures: ["ɵɵtemplate"],
19+
},
20+
{
21+
name: "svg-structural-for",
22+
category: "templates",
23+
description: "Structural directive (*ngFor) on SVG element",
24+
className: "SvgStructuralForComponent",
25+
template: `
26+
<svg *ngFor="let item of items" [attr.width]="item.width">
27+
<rect [attr.height]="item.height" />
28+
</svg>
29+
`,
30+
expectedFeatures: ["ɵɵtemplate"],
31+
},
32+
{
33+
name: "svg-nested-structural",
34+
category: "templates",
35+
description: "Nested SVG with structural directive",
36+
className: "SvgNestedStructuralComponent",
37+
template: `
38+
<div>
39+
<svg *ngIf="visible" viewBox="0 0 100 100">
40+
<g *ngFor="let shape of shapes">
41+
<circle [attr.cx]="shape.x" [attr.cy]="shape.y" [attr.r]="shape.radius" />
42+
</g>
43+
</svg>
44+
</div>
45+
`,
46+
expectedFeatures: ["ɵɵtemplate"],
47+
},
48+
];

napi/angular-compiler/e2e/compare/src/presets.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface Preset {
2323
// Need 6 levels up: src -> compare -> e2e -> angular-compiler -> napi -> oxc -> github
2424
const BITWARDEN_PROJECT_ROOT = resolve(__dirname, "../../../../../../bitwarden-clients");
2525
const MATERIAL_ANGULAR_PROJECT_ROOT = resolve(__dirname, "../../../../../../material-angular");
26+
const CLICKUP_FRONTEND_PROJECT_ROOT = resolve(__dirname, "../../../../../../clickup_frontend");
2627

2728
export const PRESETS: Record<string, Preset> = {
2829
bitwarden: {
@@ -60,6 +61,51 @@ export const PRESETS: Record<string, Preset> = {
6061
projectRoot: MATERIAL_ANGULAR_PROJECT_ROOT,
6162
tsconfigPath: resolve(MATERIAL_ANGULAR_PROJECT_ROOT, "tsconfig.json"),
6263
},
64+
// ClickUp Frontend - Full project (5,600+ components)
65+
clickup: {
66+
name: "clickup",
67+
description: "ClickUp Frontend - full project (5,600+ components)",
68+
include: ["**/*.component.ts"],
69+
exclude: [
70+
"**/node_modules/**",
71+
"**/*.spec.ts",
72+
"**/*.test.ts",
73+
"**/*.mock.ts",
74+
"**/*.fixture.ts",
75+
"**/*.stories.ts",
76+
"**/*.po.ts",
77+
"**/*stub*.ts",
78+
"**/testing/**",
79+
"**/client-e2e/**",
80+
],
81+
projectRoot: CLICKUP_FRONTEND_PROJECT_ROOT,
82+
tsconfigPath: resolve(CLICKUP_FRONTEND_PROJECT_ROOT, "tsconfig.base.json"),
83+
},
84+
// ClickUp - Core libs only (~350 components, faster iteration)
85+
"clickup-core": {
86+
name: "clickup-core",
87+
description: "ClickUp Frontend - core library (~350 components)",
88+
include: ["libs/core/**/*.component.ts"],
89+
exclude: [
90+
"**/node_modules/**",
91+
"**/*.spec.ts",
92+
"**/*.test.ts",
93+
"**/*.mock.ts",
94+
"**/*.fixture.ts",
95+
"**/*.stories.ts",
96+
],
97+
projectRoot: CLICKUP_FRONTEND_PROJECT_ROOT,
98+
tsconfigPath: resolve(CLICKUP_FRONTEND_PROJECT_ROOT, "tsconfig.base.json"),
99+
},
100+
// ClickUp - Client app only (~7 components, quickest)
101+
"clickup-client": {
102+
name: "clickup-client",
103+
description: "ClickUp Frontend - client app only (~7 components)",
104+
include: ["apps/client/**/*.component.ts"],
105+
exclude: ["**/node_modules/**", "**/*.spec.ts", "**/*.test.ts", "**/*.mock.ts"],
106+
projectRoot: CLICKUP_FRONTEND_PROJECT_ROOT,
107+
tsconfigPath: resolve(CLICKUP_FRONTEND_PROJECT_ROOT, "apps/client/tsconfig.app.json"),
108+
},
63109
};
64110

65111
export function getPreset(name: string): Preset | undefined {

0 commit comments

Comments
 (0)