Skip to content

Commit

Permalink
remove redundant config
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Viteri committed Sep 6, 2024
1 parent ab809a0 commit 39a3a0a
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 71 deletions.
1 change: 1 addition & 0 deletions style-dictionary/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async function buildAllThemesAndPlatforms () {
await sd.buildAllPlatforms()
} catch (error) {
console.error(error)
throw new Error(`Error building platform: ${platform}`)
}

console.log(`\nEnd processing [${platform}] [${theme}]`)
Expand Down
9 changes: 0 additions & 9 deletions style-dictionary/configs/android.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,20 @@ export const android = (theme) => ({
filter: {
$type: 'color'
},
options: {
showFileHeader: false
},
format: 'android/resources'
},
{
destination: 'font_dimens.xml',
filter: {
$type: 'fontSize'
},
options: {
showFileHeader: false
},
format: 'android/fontDimens'
},
{
destination: 'dimens.xml',
filter: {
$type: 'dimension'
},
options: {
showFileHeader: false
},
format: 'android/dimens'
}
]
Expand Down
5 changes: 1 addition & 4 deletions style-dictionary/configs/css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export const css = (theme) => ({
files: [
{
destination: 'cdr-tokens.css',
format: 'css/variables',
options: {
showFileHeader: false
}
format: 'css/variables'
}
]
}
Expand Down
3 changes: 0 additions & 3 deletions style-dictionary/configs/figma.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export const figma = (theme) => ({
{
destination: 'figma.json',
format: 'figma',
options: {
showFileHeader: false
},
filter: 'remove-source-tokens'
}
]
Expand Down
14 changes: 4 additions & 10 deletions style-dictionary/configs/ios.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export const ios = (theme) => ({
filter: 'ios-size',
options: {
type: 'float',
className: 'CdrSize',
showFileHeader: false
className: 'CdrSize'
}
},
{
Expand All @@ -29,8 +28,7 @@ export const ios = (theme) => ({
filter: 'ios-size',
options: {
type: 'float',
className: 'CdrSize',
showFileHeader: false
className: 'CdrSize'
}
},
{
Expand All @@ -40,10 +38,7 @@ export const ios = (theme) => ({
$type: 'color'
},
type: 'CdrColorName',
className: 'CdrColor',
options: {
showFileHeader: false
}
className: 'CdrColor'
},
{
destination: 'CdrColor.m',
Expand All @@ -53,8 +48,7 @@ export const ios = (theme) => ({
},
options: {
type: 'CdrColorName',
className: 'CdrColor',
showFileHeader: false
className: 'CdrColor'
}
}
]
Expand Down
10 changes: 2 additions & 8 deletions style-dictionary/configs/js.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ export const js = (theme) => ({
files: [
{
destination: 'cdr-tokens.cjs',
format: 'javascript/module-flat',
options: {
showFileHeader: false
}
format: 'javascript/module-flat'
},
{
destination: 'cdr-tokens.mjs',
format: 'javascript/es6',
filter: 'remove-source-tokens',
options: {
showFileHeader: false
}
filter: 'remove-source-tokens'
},
{
format: 'typescript/es6-declarations',
Expand Down
10 changes: 2 additions & 8 deletions style-dictionary/configs/less.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ export const less = (theme) => ({
files: [
{
destination: 'cdr-variable.less',
format: 'less/variables',
options: {
showFileHeader: false
}
format: 'less/variables'
},
{
destination: 'cdr-mixins.less',
format: 'less/mixin',
options: {
showFileHeader: false
}
format: 'less/mixin'
}
],
actions: ['include-media-queries-less', 'include-display-less', 'concat-files']
Expand Down
15 changes: 3 additions & 12 deletions style-dictionary/configs/scss.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,15 @@ export const scss = (theme) => ({
files: [
{
destination: 'cdr-variable.scss',
format: 'scss/variables',
options: {
showFileHeader: false
}
format: 'scss/variables'
},
{
destination: 'cdr-mixins.scss',
format: 'scss/mixin',
options: {
showFileHeader: false
}
format: 'scss/mixin'
},
{
destination: 'utility-map.no_concat.scss',
format: 'scss/map',
options: {
showFileHeader: false
}
format: 'scss/map'
}
],
actions: ['include-media-queries-scss', 'include-display-scss', 'concat-files', 'include-deprecate-scss']
Expand Down
3 changes: 0 additions & 3 deletions style-dictionary/configs/site.android.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export const siteAndroid = (theme) => ({
{
destination: 'android.json',
format: 'site',
options: {
showFileHeader: false
},
filter: 'remove-source-tokens'
}
]
Expand Down
3 changes: 0 additions & 3 deletions style-dictionary/configs/site.global.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export const siteGlobal = (theme) => ({
{
destination: 'global.json',
format: 'site',
options: {
showFileHeader: false
},
filter: 'remove-source-tokens'
}
]
Expand Down
5 changes: 1 addition & 4 deletions style-dictionary/configs/site.ios.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ export const siteIos = (theme) => ({
{
destination: 'ios.json',
format: 'site',
filter: 'remove-source-tokens',
options: {
showFileHeader: false
}
filter: 'remove-source-tokens'
}
]
}
Expand Down
3 changes: 0 additions & 3 deletions style-dictionary/configs/site.web.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export const siteWeb = (theme) => ({
{
destination: 'web.json',
format: 'site',
options: {
showFileHeader: false
},
filter: 'remove-source-tokens'
}
]
Expand Down
5 changes: 4 additions & 1 deletion style-dictionary/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ export const BASE_FONT_SIZE = 10

export const commonConfig = (theme, platform) => ({
prefix: 'cdr',
buildPath: `dist/${theme}/${platform}/`
buildPath: `dist/${theme}/${platform}/`,
options: {
showFileHeader: false
}
})
5 changes: 2 additions & 3 deletions validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ const validateStructure = async () => {
}

if (!_.isEqual(existingData, newData)) {
console.log('Dist data structure has changed');
// Print out the difference for easier debugging
console.log('Existing data:');
console.log(JSON.stringify(existingData, null, 2));
console.log('---');
console.log('New data:');
console.log(JSON.stringify(newData, null, 2));
throw new Error('Structure in dist folder has changed!');
}
Expand Down

0 comments on commit 39a3a0a

Please sign in to comment.