-
Notifications
You must be signed in to change notification settings - Fork 1
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(variables-scss): Variables-scss exporter can export new tokens structure #DS-1435 #1592
Conversation
✅ Deploy Preview for spirit-design-system ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for spirit-design-system-storybook canceled.
|
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 holy trinity of the filter
, map
and reduce
is your best friend :-)
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/formatters/cssFormatter.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/fileGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/fileGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/cssGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
I have tried to run this for the first time and it is looking great 👍 But there are two things that need to be fixed:
$container padding:
$border radius:
$spacing systems:
|
You are also using the |
exporters/variables-scss/src/content/generators/fileGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/fileGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/contentGenerator.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/formatters/cssFormatter.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/formatters/__tests__/cssFormatter.test.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/__tests__/exampleTokens.ts
Outdated
Show resolved
Hide resolved
Its probably outdated now |
probably from CR to draft - outdated |
exporters/variables-scss/src/content/formatters/__tests__/cssFormatter.test.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/formatters/cssFormatter.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/generators/__tests__/contentGenerator.test.ts
Outdated
Show resolved
Hide resolved
exporters/variables-scss/src/content/helpers/exceptionHelper.ts
Outdated
Show resolved
Hide resolved
Run yarn format:check
Checking formatting...
[warn] exporters/variables-scss/generated/exporter.cjs
[warn] Code style issues found in the above file. Run Prettier with --write to fix. I think the |
Also, tests are failing with: src/content/formatters/__tests__/cssFormatter.test.ts
● formatCSS › should correctly format CSS string
expect(received).toBe(expected) // Object.is equality
- Expected - 3
+ Received + 3
$my-var: (
- color: #000,
+ color: #000,
- background: #fff,
+ background: #fff,
- border: 1px solid #000,
+ border: 1px solid #000,
) !default;
↵
12 | describe('formatCSS', () => {
13 | it('should correctly format CSS string', () => {
> 14 | expect(formatCSS(mockedUnformattedCSS)).toBe(mockedFormattedCSS);
| ^
15 | });
16 | });
17 |
at Object.<anonymous> (src/content/formatters/__tests__/cssFormatter.test.ts:14: |
I don't understand this. It used to work normally for me and now it doesn't work again. |
It seems to me that something formatted the "unformatted.scss" and that's why it was failing. I'm not sure if prittier won't do something there. |
It started failing since I changed it to cjs according to CR |
86ae506
to
9f0108e
Compare
EDIT: solved. I added this file to prettierignore |
SOLVED - the problem was that prettier always formatted the example scss file before the commit. I added it to the prettierignore |
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 job ❗
d193401
to
f8cc678
Compare
4729a59
to
2274469
Compare
@@ -68,3 +68,9 @@ makefile | |||
|
|||
# GitHub | |||
CODEOWNERS | |||
|
|||
# variable-scss exporter example mock test files | |||
exporters/variables-scss/src/**/*.scss |
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.
Maybe better using __fixtures__
to ignore.
exporters/variables-scss/src/**/*.scss | ||
|
||
# variable-scss exporter generated cjs | ||
exporters/variables-scss/generated/**/*.cjs |
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 you can use just generated
name in general.
JSON.stringify( | ||
tokens.map((token) => ({ | ||
tokenType: token.tokenType, | ||
// @ts-ignore-next-line |
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.
Missing description for this comment why we are ignoring this. And same for the comment few lines lower.
Description
Additional context
Issue reference