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

Can I register a new transform using the CLI? #123

Closed
tomger opened this issue Oct 18, 2017 · 3 comments
Closed

Can I register a new transform using the CLI? #123

tomger opened this issue Oct 18, 2017 · 3 comments

Comments

@tomger
Copy link
Contributor

tomger commented Oct 18, 2017

I'd like to append sp/dp to my Android font sizes.

$theo tokens.yml --transform android,myCustomTransform --format android.xml

It looks like I can create JS files with transforms in the "./transforms" folder, but that I can't create new groups like "myCustomTransform" that trigger the valueTransform.

@tomger tomger changed the title Can I register a new transform and using the CLI? Can I register a new transform using the CLI? Oct 18, 2017
@aputinski
Copy link
Contributor

aputinski commented Oct 21, 2017

Currently, you need to use registerValueTransform and registerTransform you need to use the node API

@tomger
Copy link
Contributor Author

tomger commented Oct 22, 2017

Would you accept a PR that would allow the CLI to load custom value transforms from a JS file?

Theo could detect JS files like your Android Unit example in "./transforms" and then then CLI be could called like:

theo tokens.yml --transform android --format android.xml

@aputinski
Copy link
Contributor

aputinski commented Oct 23, 2017

Yeah, I think that's a good idea. Maybe it could look like this:

theo tokens.yml --setup theo.setup.js --transform android --format android.xml

where --setup would be a path to a file that will be required before processing the rest of the flags and allow you to register any additional transforms / formats?

tomger added a commit to tomger/theo that referenced this issue Nov 1, 2017
A setup module has access to Theo before it executes.
Related to salesforce-ux#123
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

2 participants