Skip to content

Commit

Permalink
fixup! Fix(variables-scss): Export in JS barrel file #DS-1503
Browse files Browse the repository at this point in the history
  • Loading branch information
curdaj committed Oct 7, 2024
1 parent f186cfd commit 02439da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exporters/variables-scss/generated/exporter.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ${et(p)}
`)}
`,To=a=>`import * as ${C(a)} from './${a}';`,mo=a=>`@use '${N}/${a}';`,fo=a=>i=>a?To(i.name):mo(i.name),go=(a,i)=>a.map(fo(i)).join(`
`),bo=(a,i)=>a.map(p=>i?`${C(p.name)}: {
${x}: ${C(p.name)}.${x}
${x}: ${C(p.name)}.${x},
},`:`${p.name}: (
${x}: ${p.name}.$${x},
),`).join(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ import * as themeLightInverted from './theme-light-inverted';\n
// The first theme is the default theme, as the left column in the Figma table.
export const themes = {
themeLight: {
colors: themeLight.colors
colors: themeLight.colors,
},
themeLightInverted: {
colors: themeLightInverted.colors
colors: themeLightInverted.colors,
},
};
`;
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('fileGenerator', () => {

expect(content).toBe(
// eslint-disable-next-line prettier/prettier, quotes -- special characters in the string
'themeLight: {\ncolors: themeLight.colors\n},\nthemeLightInverted: {\ncolors: themeLightInverted.colors\n},',
'themeLight: {\ncolors: themeLight.colors,\n},\nthemeLightInverted: {\ncolors: themeLightInverted.colors,\n},',
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion exporters/variables-scss/src/generators/fileGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const generateRootThemesFileContent = (themes: TokenTheme[], hasJsOutput:
return themes
.map((theme) => {
return hasJsOutput
? `${toCamelCase(theme.name)}: {\n${COLOR_KEY}: ${toCamelCase(theme.name)}.${COLOR_KEY}\n},`
? `${toCamelCase(theme.name)}: {\n${COLOR_KEY}: ${toCamelCase(theme.name)}.${COLOR_KEY},\n},`
: `${theme.name}: (\n${COLOR_KEY}: ${theme.name}.$${COLOR_KEY},\n),`;
})
.join('\n');
Expand Down

0 comments on commit 02439da

Please sign in to comment.