-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(tokens): NO-JIRA move themes to tokens package #476
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
import { register, getTransforms, expandTypesMap } from '@tokens-studio/sd-transforms'; | ||
import StyleDictionary from 'style-dictionary'; | ||
import { promises, readFileSync } from 'fs'; | ||
import { kebabCaseToPascalCase } from '../../common/utils.js'; | ||
|
||
import { registerDialtoneTransforms } from './dialtone-transforms.js'; | ||
import { buildDocs } from './build-docs.js'; | ||
|
@@ -16,6 +15,18 @@ register(StyleDictionary); | |
|
||
registerDialtoneTransforms(StyleDictionary); | ||
|
||
/** | ||
* Transform a string from kebab-case to PascalCase | ||
* @param string | ||
* @returns {string} | ||
*/ | ||
function kebabCaseToPascalCase (string) { | ||
return string?.toLowerCase() | ||
.split('-') | ||
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
.join(''); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why moving it to this file? I think that utility it's more general than just for build-sd-transforms, don't you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved back with |
||
StyleDictionary.registerAction({ | ||
name: 'buildDocJson', | ||
do: function (dictionary, config) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"module": "NodeNext", | ||
"target": "es2015", | ||
"allowJs": true, | ||
"sourceMap": true, | ||
"moduleResolution": "node16", | ||
"baseUrl": ".", | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"declarationMap": true, | ||
"strict": true, | ||
"moduleResolution": "NodeNext", | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": true, | ||
"strict": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"noUnusedParameters": true, | ||
"noEmitOnError": true, | ||
"removeComments": true, | ||
"skipLibCheck": true | ||
"skipLibCheck": true, | ||
"paths": { | ||
"@/*": ["./*"] | ||
} | ||
}, | ||
"include": [ | ||
"themes/*.js", | ||
], | ||
"exclude": ["node_modules"] | ||
} |
This file was 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.
I think your linter did this, right? this is being used on icon component IIRC
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 get this...
Do we need to rename this to utils.mjs since package.json is not type: "module" anymore?
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.
Changed this as I mentioned above, seems to have fixed it.