Skip to content
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

[Feature Request]: allow filtering variables in DocBlock #142

Open
yarinsa opened this issue Nov 20, 2022 · 12 comments
Open

[Feature Request]: allow filtering variables in DocBlock #142

yarinsa opened this issue Nov 20, 2022 · 12 comments

Comments

@yarinsa
Copy link

yarinsa commented Nov 20, 2022

Want to begin and say I am willing to contribute this feature :).

The motivation:

Our overrides.less file (overrides antd parsed and replaced using less 'modifyVars' ) looks something like this:

:root {
/**
  * @tokens borderRadius
  * @presenter BorderRadius
*/
	--border-radius-base: 6px;
/**
/**
  * @tokens Colors
  * @presenter Color
*/
	--blue-6: #4597ff;
	// More colors....
	--info-color: var(--blue-6);
	// more intent colors...
/**
* @tokens-end
*/
	// Alert component
	--alert-info-bg-color: var(--info-color);
	--alert-border-radius: var(--border-radius-base);

I will wrap the alert variables with @tokens as well and separate it's type. But In the Alert Story I would like to present a table of all the variables containing "--alert-*".

Thought the the most flexible thing will be to add
<DesignTokenDocBlock filter={predicateFn} />;

WDYT? @Sqrrl

@Sqrrl
Copy link
Collaborator

Sqrrl commented Nov 20, 2022

Sounds really useful. Go for it if you like.

@yarinsa
Copy link
Author

yarinsa commented Dec 13, 2022

@Sqrrl I finally got into this contribution.

  1. Cloned the repo
  2. Ran yarn install
  3. Ran start in the addon directory
  4. Ran start in the demo directory

Got:

ERR! Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/yarinsasson/Documents/Work/storybook-design-token/node_modules/postcss-safe-parser/node_modules/postcss/package.json

Here is my offer...

  1. Add contribution.md to a good quick contribution start
  2. Add "workspace" configuration such as "turbo" to ease development , WDYT?

(Also would love to get help to be able to contribute)

@Sqrrl
Copy link
Collaborator

Sqrrl commented Dec 16, 2022

Hm, not sure what causes this. I just tried with a clean clone of the repo, which worked fine.

  1. run yarn install inside root directory
  2. cd addon && yarn start
  3. in another terminal tab: cd demo && yarn start

I'm running yarn v1.22.19 and node v18.7.0.

I will add the contribution.md soon.

@acherkashin
Copy link
Contributor

It would be really helpful to have CONTRIBUTION.md

@yarinsa
Copy link
Author

yarinsa commented Feb 1, 2023

I am sorry for the late response, work is crazy but now I got some free time until March.
I followed your instruction precisely (on 2 machines) and I am getting the exact same error.
Can we get on a call or try it out together?

Hm, not sure what causes this. I just tried with a clean clone of the repo, which worked fine.

  1. run yarn install inside root directory
  2. cd addon && yarn start
  3. in another terminal tab: cd demo && yarn start

I'm running yarn v1.22.19 and node v18.7.0.

I will add the contribution.md soon.

@Sqrrl
Copy link
Collaborator

Sqrrl commented Feb 1, 2023

Was finally able to reproduce the issue on a Windows VM. Seems like a yarn workspace hoisting issue. I'll try to come up with a solution.

In the meantime you could use the webpack5-demo for developing. This runs outside of yarn workspaces.

cd addon && yarn start
cd ../demo-webpack5 && yarn && yarn start

@yarinsa
Copy link
Author

yarinsa commented Feb 3, 2023

Done. I would like to open a PR but I can't push a new branch to this repo. @Sqrrl

Screen Shot 2023-02-03 at 20 05 23

And now iv'e got another feature request :) Can open a separate issue if you find it useful, WDYT about add the table "rawValue" column? Can be useful for designers, that can see their tokens in one place all the way to the value

@yarinsa
Copy link
Author

yarinsa commented Feb 19, 2023

@Sqrrl Your help to push my code would be appreciated

@Sqrrl
Copy link
Collaborator

Sqrrl commented Feb 22, 2023

@yarinsa You can fork the repo and create a PR with your fork. The raw value could be useful, not sure about giving it its own column though. Maybe as a tooltip?

@acherkashin
Copy link
Contributor

@yarinsa Could you create a Pull Request? Ping me if you need any assistance

@yarinsa
Copy link
Author

yarinsa commented Nov 12, 2023

@yarinsa Could you create a Pull Request? Ping me if you need any assistance

Already left that work :( I don't have the source code anymore

@acherkashin
Copy link
Contributor

@yarinsa it is pity. But, I think I will get it done in a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants