Skip to content

Commit 4cf1bb8

Browse files
Disable unused imports (#676)
* rm unused imports * readd scss
1 parent eba4a31 commit 4cf1bb8

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

scripts/buildTokens.ts

+49-49
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import type StyleDictionary from 'style-dictionary'
22
import {PrimerStyleDictionary} from '~/src/PrimerStyleDictionary'
33
import {copyFromDir} from '~/src/utilities'
44
import {
5-
typeDefinitions,
5+
// typeDefinitions,
66
deprecatedJson,
77
css,
88
docJson,
99
scss,
10-
javascript,
11-
typescript,
12-
json,
10+
// javascript,
11+
// typescript,
12+
// json,
1313
fallbacks,
1414
} from '~/src/platforms'
1515
import type {ConfigGeneratorOptions, StyleDictionaryConfigGenerator} from '~/src/types/StyleDictionaryConfigGenerator'
@@ -36,9 +36,9 @@ const getStyleDictionaryConfig: StyleDictionaryConfigGenerator = (
3636
platforms: {
3737
css: css(`css/${filename}.css`, options.prefix, options.buildPath, {themed: options.themed}),
3838
scss: scss(`scss/${filename}.scss`, options.prefix, options.buildPath),
39-
js: javascript(`js/${filename}.js`, options.prefix, options.buildPath),
40-
ts: typescript(`ts/${filename}.ts`, options.prefix, options.buildPath),
41-
json: json(`json/${filename}.json`, options.prefix, options.buildPath),
39+
// js: javascript(`js/${filename}.js`, options.prefix, options.buildPath),
40+
// ts: typescript(`ts/${filename}.ts`, options.prefix, options.buildPath),
41+
// json: json(`json/${filename}.json`, options.prefix, options.buildPath),
4242
docJson: docJson(`docs/${filename}.json`, options.prefix, options.buildPath),
4343
fallbacks: fallbacks(`fallbacks/${filename}.json`, options.prefix, options.buildPath),
4444
...platforms,
@@ -157,49 +157,49 @@ export const buildDesignTokens = (buildOptions: ConfigGeneratorOptions): void =>
157157
/** -----------------------------------
158158
* Type definitions
159159
* ----------------------------------- */
160-
const typeBuilds: TokenBuildInput[] = [
161-
// color, shadow & border
162-
{
163-
filename: 'theme',
164-
source: [
165-
`src/tokens/functional/color/light/*.json5`,
166-
`src/tokens/functional/shadow/light.json5`,
167-
`src/tokens/functional/border/light.json5`,
168-
],
169-
include: [`src/tokens/base/color/light/light.json5`],
170-
},
171-
// typography
172-
{
173-
filename: 'typography',
174-
source: [`src/tokens/functional/typography/*.json`],
175-
include: [`src/tokens/base/typography/*.json`],
176-
},
177-
// size
178-
{
179-
filename: 'size',
180-
source: [`src/tokens/functional/size/*.json`],
181-
include: [`src/tokens/base/size/*.json`],
182-
},
183-
]
184-
//
185-
for (const {filename, source, include} of typeBuilds) {
186-
PrimerStyleDictionary.extend({
187-
source,
188-
include,
189-
platforms: {
190-
types: typeDefinitions(filename, buildOptions.prefix, `${buildOptions.buildPath}ts/types/`),
191-
},
192-
}).buildAllPlatforms()
193-
}
160+
// const typeBuilds: TokenBuildInput[] = [
161+
// // color, shadow & border
162+
// {
163+
// filename: 'theme',
164+
// source: [
165+
// `src/tokens/functional/color/light/*.json5`,
166+
// `src/tokens/functional/shadow/light.json5`,
167+
// `src/tokens/functional/border/light.json5`,
168+
// ],
169+
// include: [`src/tokens/base/color/light/light.json5`],
170+
// },
171+
// // typography
172+
// {
173+
// filename: 'typography',
174+
// source: [`src/tokens/functional/typography/*.json`],
175+
// include: [`src/tokens/base/typography/*.json`],
176+
// },
177+
// // size
178+
// {
179+
// filename: 'size',
180+
// source: [`src/tokens/functional/size/*.json`],
181+
// include: [`src/tokens/base/size/*.json`],
182+
// },
183+
// ]
184+
// //
185+
// for (const {filename, source, include} of typeBuilds) {
186+
// PrimerStyleDictionary.extend({
187+
// source,
188+
// include,
189+
// platforms: {
190+
// types: typeDefinitions(filename, buildOptions.prefix, `${buildOptions.buildPath}ts/types/`),
191+
// },
192+
// }).buildAllPlatforms()
193+
// }
194194

195-
// build types for base scale
196-
PrimerStyleDictionary.extend({
197-
source: [`src/tokens/functional/color/scales.json5`],
198-
include: [`src/tokens/base/color/light/light.json5`],
199-
platforms: {
200-
types: typeDefinitions(`baseColor`, undefined, `${buildOptions.buildPath}ts/types/`),
201-
},
202-
}).buildAllPlatforms()
195+
// // build types for base scale
196+
// PrimerStyleDictionary.extend({
197+
// source: [`src/tokens/functional/color/scales.json5`],
198+
// include: [`src/tokens/base/color/light/light.json5`],
199+
// platforms: {
200+
// types: typeDefinitions(`baseColor`, undefined, `${buildOptions.buildPath}ts/types/`),
201+
// },
202+
// }).buildAllPlatforms()
203203
}
204204

205205
/** -----------------------------------

0 commit comments

Comments
 (0)