@microsoft/atlas-css 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/class-names.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens.json +1 -1
- package/dist/tokens.ts +2 -0
- package/package.json +9 -5
- package/src/atomics/typography.scss +8 -0
- package/src/components/README.md +0 -10
- package/src/components/code-block.scss +62 -0
- package/src/components/index.scss +1 -0
- package/src/mixins/code-block.scss +30 -13
- package/src/tokens/colors.scss +1 -0
- package/src/tokens/themes.scss +9 -6
- package/tokens/index.js +6 -6
package/tokens/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { readFile, writeFile, mkdir } = require('fs/promises');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const { quicktype, InputData, jsonInputForTargetLanguage } = require('quicktype-core');
|
|
4
4
|
const { exporter } = require('sass-export');
|
|
@@ -24,9 +24,9 @@ async function createTokens() {
|
|
|
24
24
|
const outfileStem = path.join(outfolder, 'tokens');
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
|
-
await
|
|
27
|
+
await mkdir(outfolder, { recursive: true });
|
|
28
28
|
await Promise.all([
|
|
29
|
-
|
|
29
|
+
writeFile(`${outfileStem}.json`, JSON.stringify(collection)),
|
|
30
30
|
quicktypeJSON('AtlasTokens', JSON.stringify(collection), `${outfileStem}.ts`, 'typescript')
|
|
31
31
|
]);
|
|
32
32
|
console.log(`Tokens written to "${path.join(process.cwd(), `/dist/${outfileStem}.json`)}".`);
|
|
@@ -45,7 +45,7 @@ async function getInputFilesFromIndex(filePathStem, indexPath) {
|
|
|
45
45
|
/** @type {string[]} */
|
|
46
46
|
const filePaths = [];
|
|
47
47
|
try {
|
|
48
|
-
const indexFile = (await
|
|
48
|
+
const indexFile = (await readFile(indexPath)).toString();
|
|
49
49
|
const lines = indexFile.split('\n').reduce((arr, line) => {
|
|
50
50
|
if (line.includes('@import')) {
|
|
51
51
|
const filePath = line.replace('@import', '').replaceAll(`'`, '').replace(';', '').trim();
|
|
@@ -66,7 +66,7 @@ async function getInputFilesFromIndex(filePathStem, indexPath) {
|
|
|
66
66
|
function checkFileComments(paths) {
|
|
67
67
|
const promises = paths.map(async path => {
|
|
68
68
|
try {
|
|
69
|
-
const result = await
|
|
69
|
+
const result = await readFile(path, 'utf8');
|
|
70
70
|
if (!result.includes('@sass-export-section')) {
|
|
71
71
|
console.log(`Warning: ${path} is missing @sass-export-section annotations.`);
|
|
72
72
|
}
|
|
@@ -242,5 +242,5 @@ async function quicktypeJSON(typeName, jsonString, outfile, targetLanguage = 'ty
|
|
|
242
242
|
inputData,
|
|
243
243
|
lang: targetLanguage
|
|
244
244
|
});
|
|
245
|
-
return
|
|
245
|
+
return writeFile(outfile, result.lines.join('\n'));
|
|
246
246
|
}
|