Skip to content

Commit 8234010

Browse files
chore: re-add custom file header to include tokens docs
1 parent ec15f2a commit 8234010

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

lib/build-tokens.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ async function buildTokensCommand(commandArgs) {
6161
prefix: 'pgn',
6262
// NOTE: buildPath must end with a slash
6363
buildPath: buildDir.slice(-1) === '/' ? buildDir : `${buildDir}/`,
64+
options: {
65+
fileHeader: 'customFileHeader',
66+
},
6467
files: [
6568
{
6669
format: 'css/custom-variables',
6770
destination: 'core/variables.css',
6871
filter: hasSourceTokensOnly ? 'isSource' : undefined,
6972
options: {
7073
outputReferences,
71-
formatting: {
72-
fileHeaderTimestamp: true,
73-
},
7474
},
7575
},
7676
{
@@ -79,9 +79,6 @@ async function buildTokensCommand(commandArgs) {
7979
filter: hasSourceTokensOnly ? 'isSource' : undefined,
8080
options: {
8181
outputReferences,
82-
formatting: {
83-
fileHeaderTimestamp: true,
84-
},
8582
},
8683
},
8784
],
@@ -124,9 +121,6 @@ async function buildTokensCommand(commandArgs) {
124121
: `isThemeVariant.${themeVariant}`,
125122
options: {
126123
outputReferences,
127-
formatting: {
128-
fileHeaderTimestamp: true,
129-
},
130124
},
131125
},
132126
{
@@ -135,9 +129,6 @@ async function buildTokensCommand(commandArgs) {
135129
filter: hasSourceTokensOnly ? 'isSource' : undefined,
136130
options: {
137131
outputReferences,
138-
formatting: {
139-
fileHeaderTimestamp: true,
140-
},
141132
},
142133
},
143134
],

styles/css/core/custom-media-breakpoints.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Do not edit directly, this file was auto-generated.
3-
* Generated on Tue, 03 Sep 2024 13:46:25 GMT
2+
* Do not edit directly, this file was auto-generated. while transforming design tokens.
3+
* See <root>/tokens/README.md for more details.
44
*/
55

66
@custom-media --pgn-size-breakpoint-min-width-xs (min-width: 0);

styles/css/core/variables.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Do not edit directly, this file was auto-generated.
3-
* Generated on Tue, 03 Sep 2024 13:46:25 GMT
2+
* Do not edit directly, this file was auto-generated. while transforming design tokens.
3+
* See <root>/tokens/README.md for more details.
44
*/
55

66
:root {

styles/css/themes/light/utility-classes.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Do not edit directly, this file was auto-generated.
3-
* Generated on Tue, 03 Sep 2024 13:46:26 GMT
2+
* Do not edit directly, this file was auto-generated. while transforming design tokens.
3+
* See <root>/tokens/README.md for more details.
44
*/
55

66
.bg-accent-a {

styles/css/themes/light/variables.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Do not edit directly, this file was auto-generated.
3-
* Generated on Tue, 03 Sep 2024 13:46:26 GMT
2+
* Do not edit directly, this file was auto-generated. while transforming design tokens.
3+
* See <root>/tokens/README.md for more details.
44
*/
55

66
:root {

tokens/style-dictionary.js

+11
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ const initializeStyleDictionary = async ({ themes }) => {
346346
parser: ({ contents }) => toml.load(contents),
347347
});
348348

349+
/**
350+
* Registers a custom fileHeader.
351+
*/
352+
StyleDictionary.registerFileHeader({
353+
name: 'customFileHeader',
354+
fileHeader: (defaultMessage) => [
355+
`${defaultMessage} while transforming design tokens.`,
356+
'See <root>/tokens/README.md for more details.',
357+
],
358+
});
359+
349360
return StyleDictionary;
350361
};
351362

0 commit comments

Comments
 (0)