-
Notifications
You must be signed in to change notification settings - Fork 78
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
chore: merge cds-core tools to clr-angular (WIP) #1515
base: main
Are you sure you want to change the base?
Conversation
👋 @Jinnie,
Thank you, 🤖 Clarity Release Bot |
|
||
## Quick Start Install | ||
|
||
1. First, install the Clarity Core package from npm. |
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.
The info in this file is irrelevant now. It should either be updated, or the file deleted.
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.
The content of /projects/core/build should be reviewed. Some storybook and website related tools exist, that are not relevant to the new location.
✅ Deploy Preview for clarity-date-range ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
package.json
Outdated
@@ -66,21 +70,32 @@ | |||
"@angular/platform-browser": "15.2.2", | |||
"@angular/platform-browser-dynamic": "15.2.2", | |||
"@angular/router": "15.2.2", | |||
"@cds/core": "6.9.2", | |||
"@cds/core": "file:dist/@cds/core", |
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 don't think this should be in package.json
. I think it would be better to use path aliases in tsconfig.json
so that you don't have to have core built before staring ng-clarity.
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.
Another problem with this is that the cds-icon
imports work in this project, but the icon component is not included in a published package. I think this needs to be restructured so that there is not a ./dist/@cds/core
folder. It's not actually a dist folder anyway because it is not published. Instead, I think the styles/tokens should be in @clr/ui
and the icon component should be in @clr/angular
. Otherwise, there is no way for consumers of the published packages to use the things that used to be in @cds/core
.
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.
It's still one of the WIP parts. And your feedback is very valuable.
The idea is to either have a separate package (but not named @cds/core
, maybe @clr/core
or something else), or, as you say, move tokens to @clr/ui
and the rest to @clr/angular
(or a smaller core package).
The problem with moving them to the existing packages is that many of the consumable artefacts should still be built before we're able to import and use them.
As a next step we can explore the merging option, and if unsuccessful, fall back to a @clr/core
or similar package.
cdsCloseButton.setAttribute('aria-label', ariaLabel); | ||
cdsCloseButton.setAttribute('aria-hidden', 'true'); | ||
cdsCloseButton.setAttribute('type', 'button'); | ||
const createCloseButton = (document: Document, ariaLabel: string) => { |
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 think this change should be extracted to a separate PR that just removes dependency on cds-internal-close-button
.
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.
Yes, we can do it before the rest of this PR lands.
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.
Done, with PR #1539
& { | ||
@if (map.has-key($map, $key)) { |
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.
Why is this change needed?
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.
At some point I was using a newer SASS version and it started reporting issues with the order of mixins vs declarations.
But once we need to do this, we'd better do it separately from this PR and when the change is needed.
I'll revert this.
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.
Done. Also remove the same change from _buttons...
projects/core/build/build.tokens.ts
Outdated
buildAndroidXMLTokens('./dist/@cds/core/tokens/tokens.android.xml'); | ||
buildIOSSwiftTokens('./dist/@cds/core/tokens/tokens.ios.swift'); |
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 think these should be removed. The ./dist/@cds/core
folder is not published as a package, so this is dead code.
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.
Good catch, I removed some, but these I've missed.
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.
Done
package.json
Outdated
@@ -66,21 +70,32 @@ | |||
"@angular/platform-browser": "15.2.2", | |||
"@angular/platform-browser-dynamic": "15.2.2", | |||
"@angular/router": "15.2.2", | |||
"@cds/core": "6.9.2", | |||
"@cds/core": "file:dist/@cds/core", | |||
"@commitlint/cz-commitlint": "16.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.
This should be removed.
package.json
Outdated
@@ -103,15 +118,28 @@ | |||
"karma-mocha-reporter": "2.2.5", | |||
"karma-parallel": "0.3.1", | |||
"lint-staged": "12.3.7", | |||
"lit": "^2.1.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.
This should be an exact version.
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.
Done
package.json
Outdated
"ng-packagr": "15.0.1", | ||
"node-static": "0.7.11", | ||
"npm-run-all": "4.1.5", | ||
"patch-package": "6.4.7", | ||
"playwright": "1.43.0", | ||
"postcss-cli": "8.3.1", | ||
"prettier": "2.6.2", | ||
"purgecss": "^4.1.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.
This should be an exact version.
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.
Done
projects/demo/src/styles.scss
Outdated
@import '../../../dist/@cds/core/styles/module.reset.min.css'; | ||
@import '../../../dist/@cds/core/styles/module.tokens.min.css'; | ||
@import '../../../dist/@cds/core/styles/module.layout.min.css'; | ||
@import '../../../dist/@cds/core/styles/module.typography.min.css'; | ||
@import '../../../dist/@cds/core/styles/theme.dark.min.css'; |
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.
How are consumer supposed to import these files? I think we need to build these files into the @clr/ui
directory so that they are included in a published package.
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.
This will be handled once we make a choice and provide solution, as discussed in my reply to your first comment above.
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.
For now, changing the import to be through @cds/core/styles/.....
, so we don't rely on direct relative paths and dist
.
415ea42
to
45b8ce1
Compare
d6c05d5
to
bc46b1c
Compare
This PR introduces visual changes: 57a4d47
|
b34b4aa
to
4b800dd
Compare
This PR introduces visual changes: 8cb1534
|
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information