-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Angular wrapper #3267
Conversation
# Conflicts: # package.json # yarn.lock
This reverts commit e91d964.
# Conflicts: # package.json # src/elements/file-selector/file-selector.ts # src/elements/radio-button/radio-button-group/radio-button-group.ts # yarn.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stunning work. Only very partial review
package.json
Outdated
@@ -71,12 +74,23 @@ | |||
"lit": "3.2.1" | |||
}, | |||
"devDependencies": { | |||
"@angular-devkit/build-angular": "^18.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to go to Angular 19 for all angular deps
"@angular-devkit/build-angular": "^18.2.3", | |
"@angular-devkit/build-angular": "18.2.3", |
package.json
Outdated
"@commitlint/cli": "19.6.0", | ||
"@commitlint/config-conventional": "19.6.0", | ||
"@custom-elements-manifest/analyzer": "0.10.3", | ||
"@custom-elements-manifest/to-markdown": "0.1.0", | ||
"@eslint/eslintrc": "3.2.0", | ||
"@eslint/eslintrc": "3.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downgrade needed?
package.json
Outdated
@@ -125,13 +139,15 @@ | |||
"lint-staged": "15.2.10", | |||
"lit-analyzer": "2.0.3", | |||
"madge": "8.0.0", | |||
"npm-run-all2": "7.0.1", | |||
"ng-packagr": "18.2.1", | |||
"npm-run-all2": "7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downgrade needed?
package.json
Outdated
@@ -145,7 +161,8 @@ | |||
"typescript-eslint": "8.16.0", | |||
"urlpattern-polyfill": "10.0.0", | |||
"vite": "5.4.11", | |||
"vite-plugin-dts": "4.3.0" | |||
"vite-plugin-dts": "4.3.0", | |||
"zone.js": "~0.14.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we try to avoid zone.js at all?
@@ -20,6 +20,8 @@ | |||
"@sbb-esta/lyne-elements/*": ["src/elements/*"], | |||
"@sbb-esta/lyne-elements-experimental": ["src/elements-experimental"], | |||
"@sbb-esta/lyne-elements-experimental/*": ["src/elements-experimental/*"], | |||
"@sbb-esta/lyne-angular": ["src/angular"], | |||
"@sbb-esta/lyne-angular/*": ["src/angular/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
angular experimental entries needed?
@@ -0,0 +1,10 @@ | |||
// TODO check if makes sense or they are just duplicated and possibily remove. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to standardize todo / fixmes like TODO:
// TODO check if makes sense or they are just duplicated and possibily remove. | |
// TODO: check if makes sense or they are just duplicated and can possibily be removed. |
# Conflicts: # package.json # yarn.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial impression is positive. Amazing work! 😃
I guess to test it, we need to generate the code.
I started yesterday, found some little detail to fix; i'll hope to finish it tomorrow |
# Conflicts: # package.json # yarn.lock
// FIXME add import from esta core/attribute-transform | ||
if (member.type.getText() === 'boolean') { | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that all occurrences of the substring }
are replaced, not just the first one. This can be achieved by using a regular expression with the global flag (g
). This change will ensure that the replacement is applied to all instances of the substring within the string.
Specifically, we will modify the input.replace
call on line 391 to use a regular expression with the global flag. This change will be made in the file tools/eslint/angular-generator-rule.ts
.
-
Copy modified line R391
@@ -390,3 +390,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); | ||
input = input.replace(/}/g, `, transform: booleanAttribute }`); | ||
} else { |
} | ||
} else if (member.type.getText() === 'number') { | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: numberAttribute }`); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that all occurrences of the string to be replaced are handled. This can be achieved by using a regular expression with the global flag (g
). Specifically, we will replace the input.replace
call with a regular expression to ensure that all instances of the matched string are replaced.
-
Copy modified line R391 -
Copy modified line R397
@@ -390,3 +390,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); | ||
input = input.replace(/}/g, `, transform: booleanAttribute }`); | ||
} else { | ||
@@ -396,3 +396,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: numberAttribute }`); | ||
input = input.replace(/}/g, `, transform: numberAttribute }`); | ||
} else { |
if (paramType) { | ||
if (paramType.getText() === 'boolean') { | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that all occurrences of the string to be replaced are handled. This can be achieved by using a regular expression with the global flag. Specifically, we will replace the input.replace
call with a version that uses a regular expression to replace all occurrences of the string.
-
Copy modified line R456 -
Copy modified line R462
@@ -455,3 +455,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); | ||
input = input.replace(/}/g, `, transform: booleanAttribute }`); | ||
} else { | ||
@@ -461,3 +461,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: numberAttribute }`); | ||
input = input.replace(/}/g, `, transform: numberAttribute }`); | ||
} else { |
} | ||
} else if (paramType.getText() === 'number') { | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: numberAttribute }`); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that all occurrences of the string to be replaced are handled. This can be achieved by using a regular expression with the global flag. Specifically, we will replace the input.replace
call with a version that uses a regular expression to match all occurrences of the closing curly brace }
.
-
Copy modified line R456 -
Copy modified line R462
@@ -455,3 +455,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: booleanAttribute }`); | ||
input = input.replace(/}/g, `, transform: booleanAttribute }`); | ||
} else { | ||
@@ -461,3 +461,3 @@ | ||
if (input.includes('alias')) { | ||
input = input.replace(`}`, `, transform: numberAttribute }`); | ||
input = input.replace(/}/g, `, transform: numberAttribute }`); | ||
} else { |
@DavideMininni-Fincons Could this PR be closed? |
PR closed: this feature will be implemented in sbb-design-systems/lyne-angular#1 |
No description provided.