@digdir/designsystemet 1.1.10 → 1.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.
Files changed (33) hide show
  1. package/dist/bin/config.js +12 -12
  2. package/dist/bin/designsystemet.js +55 -57
  3. package/dist/src/config.js +6 -6
  4. package/dist/src/index.js +18 -18
  5. package/dist/src/migrations/beta-to-v1.js +5 -5
  6. package/dist/src/migrations/codemods/css/plugins.js +3 -3
  7. package/dist/src/migrations/codemods/css/run.js +2 -2
  8. package/dist/src/migrations/color-rename-next49.js +5 -5
  9. package/dist/src/migrations/index.js +5 -5
  10. package/dist/src/scripts/createJsonSchema.js +1 -1
  11. package/dist/src/scripts/update-design-tokens.js +2 -2
  12. package/dist/src/scripts/update-preview-tokens.js +22 -22
  13. package/dist/src/scripts/update-template.js +11 -11
  14. package/dist/src/tokens/build.js +29 -29
  15. package/dist/src/tokens/create/generators/$designsystemet.js +5 -5
  16. package/dist/src/tokens/create/write.d.ts.map +1 -1
  17. package/dist/src/tokens/create/write.js +14 -16
  18. package/dist/src/tokens/format.js +18 -18
  19. package/dist/src/tokens/index.js +18 -18
  20. package/dist/src/tokens/process/configs/color.js +2 -2
  21. package/dist/src/tokens/process/configs/semantic.js +2 -2
  22. package/dist/src/tokens/process/configs/typography.js +2 -2
  23. package/dist/src/tokens/process/configs.js +4 -4
  24. package/dist/src/tokens/process/formats/css/color.js +2 -2
  25. package/dist/src/tokens/process/formats/css/semantic.js +2 -2
  26. package/dist/src/tokens/process/formats/css/typography.js +2 -2
  27. package/dist/src/tokens/process/formats/css.js +2 -2
  28. package/dist/src/tokens/process/output/declarations.js +9 -9
  29. package/dist/src/tokens/process/output/theme.js +8 -8
  30. package/dist/src/tokens/process/platform.js +10 -10
  31. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +4 -4
  32. package/dist/src/utils.js +10 -10
  33. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  // src/tokens/process/platform.ts
2
- import chalk2 from "chalk";
2
+ import pc2 from "picocolors";
3
3
  import * as R10 from "ramda";
4
4
  import StyleDictionary2 from "style-dictionary";
5
5
 
@@ -703,8 +703,8 @@ var TypographyValues;
703
703
  })(TypographyValues || (TypographyValues = {}));
704
704
 
705
705
  // src/tokens/process/utils/getMultidimensionalThemes.ts
706
- import chalk from "chalk";
707
706
  import { kebabCase } from "change-case";
707
+ import pc from "picocolors";
708
708
  import * as R8 from "ramda";
709
709
  var getMultidimensionalThemes = (processed$themes, dimensions) => {
710
710
  const verboseLogging = buildOptions?.verbose;
@@ -714,8 +714,8 @@ var getMultidimensionalThemes = (processed$themes, dimensions) => {
714
714
  const keys2 = R8.keys(grouped$themes);
715
715
  const nonDependentKeys = keys2.filter((x) => ![...ALL_DEPENDENT_ON, ...dimensions].includes(x));
716
716
  if (verboseLogging) {
717
- console.log(chalk.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
718
- console.log(chalk.cyan(` (ignoring permutations for ${nonDependentKeys})`));
717
+ console.log(pc.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
718
+ console.log(pc.cyan(` (ignoring permutations for ${nonDependentKeys})`));
719
719
  }
720
720
  return permutations.filter((val) => {
721
721
  const filters = nonDependentKeys.map((x) => val.permutation[x] === grouped$themes[x][0].name);
@@ -928,18 +928,18 @@ async function processPlatform(options) {
928
928
  const UNSAFE_DEFAULT_COLOR = process.env.UNSAFE_DEFAULT_COLOR ?? "";
929
929
  if (UNSAFE_DEFAULT_COLOR) {
930
930
  console.warn(
931
- chalk2.yellow(
931
+ pc2.yellow(
932
932
  `
933
- \u26A0\uFE0F UNSAFE_DEFAULT_COLOR is set to ${chalk2.blue(UNSAFE_DEFAULT_COLOR)}. This will override the default color.`
933
+ \u26A0\uFE0F UNSAFE_DEFAULT_COLOR is set to ${pc2.blue(UNSAFE_DEFAULT_COLOR)}. This will override the default color.`
934
934
  )
935
935
  );
936
936
  }
937
937
  const UNSAFE_COLOR_GROUPS = Array.from(process.env.UNSAFE_COLOR_GROUPS?.split(",") ?? []);
938
938
  if (UNSAFE_COLOR_GROUPS.length > 0) {
939
939
  console.warn(
940
- chalk2.yellow(
940
+ pc2.yellow(
941
941
  `
942
- \u26A0\uFE0F UNSAFE_COLOR_GROUPS is set to ${chalk2.blue(`[${UNSAFE_COLOR_GROUPS.join(", ")}]`)}. This will override the default color groups.`
942
+ \u26A0\uFE0F UNSAFE_COLOR_GROUPS is set to ${pc2.blue(`[${UNSAFE_COLOR_GROUPS.join(", ")}]`)}. This will override the default color groups.`
943
943
  )
944
944
  );
945
945
  }
@@ -954,7 +954,7 @@ async function processPlatform(options) {
954
954
  }
955
955
  if (buildOptions.defaultColor) {
956
956
  console.log(`
957
- \u{1F3A8} Using ${chalk2.blue(buildOptions.defaultColor)} as default color`);
957
+ \u{1F3A8} Using ${pc2.blue(buildOptions.defaultColor)} as default color`);
958
958
  }
959
959
  const buildAndSdConfigs = R10.map((buildConfig) => {
960
960
  const sdConfigs = getConfigsForThemeDimensions(
@@ -998,7 +998,7 @@ async function processPlatform(options) {
998
998
  }
999
999
  if (sdConfigs.length > 0) {
1000
1000
  console.log(`
1001
- \u{1F371} Building ${chalk2.green(buildConfig.name ?? buildName)}`);
1001
+ \u{1F371} Building ${pc2.green(buildConfig.name ?? buildName)}`);
1002
1002
  const results = await Promise.all(
1003
1003
  sdConfigs.map(async (sdConfig) => {
1004
1004
  const { config, permutation } = sdConfig;
@@ -162,12 +162,12 @@ var TypographyValues;
162
162
  })(TypographyValues || (TypographyValues = {}));
163
163
 
164
164
  // src/tokens/process/utils/getMultidimensionalThemes.ts
165
- import chalk2 from "chalk";
166
165
  import { kebabCase } from "change-case";
166
+ import pc2 from "picocolors";
167
167
  import * as R10 from "ramda";
168
168
 
169
169
  // src/tokens/process/platform.ts
170
- import chalk from "chalk";
170
+ import pc from "picocolors";
171
171
  import * as R9 from "ramda";
172
172
  import StyleDictionary2 from "style-dictionary";
173
173
 
@@ -766,8 +766,8 @@ var getMultidimensionalThemes = (processed$themes, dimensions) => {
766
766
  const keys2 = R10.keys(grouped$themes);
767
767
  const nonDependentKeys = keys2.filter((x) => ![...ALL_DEPENDENT_ON, ...dimensions].includes(x));
768
768
  if (verboseLogging) {
769
- console.log(chalk2.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
770
- console.log(chalk2.cyan(` (ignoring permutations for ${nonDependentKeys})`));
769
+ console.log(pc2.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
770
+ console.log(pc2.cyan(` (ignoring permutations for ${nonDependentKeys})`));
771
771
  }
772
772
  return permutations.filter((val) => {
773
773
  const filters = nonDependentKeys.map((x) => val.permutation[x] === grouped$themes[x][0].name);
package/dist/src/utils.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // src/utils.ts
2
2
  import fs from "fs/promises";
3
- import chalk from "chalk";
3
+ import pc from "picocolors";
4
4
  var mkdir = async (dir, dry) => {
5
5
  if (dry) {
6
- console.log(`${chalk.blue("mkdir")} ${dir}`);
6
+ console.log(`${pc.blue("mkdir")} ${dir}`);
7
7
  return Promise.resolve();
8
8
  }
9
9
  const exists = await fs.access(dir, fs.constants.F_OK).then(() => true).catch(() => false);
@@ -14,41 +14,41 @@ var mkdir = async (dir, dry) => {
14
14
  };
15
15
  var writeFile = async (path, data, dry) => {
16
16
  if (dry) {
17
- console.log(`${chalk.blue("writeFile")} ${path}`);
17
+ console.log(`${pc.blue("writeFile")} ${path}`);
18
18
  return Promise.resolve();
19
19
  }
20
20
  return fs.writeFile(path, data, { encoding: "utf-8" }).catch((error) => {
21
- console.error(chalk.red(`Error writing file: ${path}`));
22
- console.error(chalk.red(error));
21
+ console.error(pc.red(`Error writing file: ${path}`));
22
+ console.error(pc.red(error));
23
23
  throw error;
24
24
  });
25
25
  };
26
26
  var cp = async (src, dest, dry, filter) => {
27
27
  if (dry) {
28
- console.log(`${chalk.blue("cp")} ${src} ${dest}`);
28
+ console.log(`${pc.blue("cp")} ${src} ${dest}`);
29
29
  return Promise.resolve();
30
30
  }
31
31
  return fs.cp(src, dest, { recursive: true, filter });
32
32
  };
33
33
  var copyFile = async (src, dest, dry) => {
34
34
  if (dry) {
35
- console.log(`${chalk.blue("copyFile")} ${src} to ${dest}`);
35
+ console.log(`${pc.blue("copyFile")} ${src} to ${dest}`);
36
36
  return Promise.resolve();
37
37
  }
38
38
  return fs.copyFile(src, dest);
39
39
  };
40
40
  var cleanDir = async (dir, dry) => {
41
41
  if (dry) {
42
- console.log(`${chalk.blue("cleanDir")} ${dir}`);
42
+ console.log(`${pc.blue("cleanDir")} ${dir}`);
43
43
  return Promise.resolve();
44
44
  }
45
45
  console.log(`
46
- \u{1F525} Cleaning dir ${chalk.red(`${dir.trim()}`)} `);
46
+ \u{1F525} Cleaning dir ${pc.red(`${dir.trim()}`)} `);
47
47
  return fs.rm(dir, { recursive: true, force: true });
48
48
  };
49
49
  var readFile = async (path, dry, allowFileNotFound) => {
50
50
  if (dry) {
51
- console.log(`${chalk.blue("readFile")} ${path}`);
51
+ console.log(`${pc.blue("readFile")} ${path}`);
52
52
  return Promise.resolve("");
53
53
  }
54
54
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet",
3
- "version": "1.1.10",
3
+ "version": "1.2.0",
4
4
  "description": "CLI for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "engines": {
@@ -40,7 +40,6 @@
40
40
  "@commander-js/extra-typings": "^14.0.0",
41
41
  "@tokens-studio/sd-transforms": "1.3.0",
42
42
  "apca-w3": "^0.1.9",
43
- "chalk": "^5.4.1",
44
43
  "change-case": "^5.4.4",
45
44
  "chroma-js": "^3.1.2",
46
45
  "colorjs.io": "^0.6.0-alpha.1",
@@ -48,10 +47,11 @@
48
47
  "fast-glob": "^3.3.3",
49
48
  "hsluv": "^1.0.1",
50
49
  "object-hash": "^3.0.0",
50
+ "picocolors": "^1.1.1",
51
51
  "postcss": "^8.5.6",
52
52
  "ramda": "^0.31.3",
53
53
  "style-dictionary": "^5.0.1",
54
- "zod": "^4.0.15",
54
+ "zod": "^4.0.17",
55
55
  "zod-validation-error": "^4.0.1"
56
56
  },
57
57
  "devDependencies": {
@@ -59,10 +59,10 @@
59
59
  "@types/apca-w3": "^0.1.3",
60
60
  "@types/chroma-js": "^3.1.1",
61
61
  "@types/fs-extra": "^11.0.4",
62
- "@types/node": "^22.17.0",
62
+ "@types/node": "^22.17.1",
63
63
  "@types/object-hash": "^3.0.6",
64
64
  "@types/ramda": "^0.31.0",
65
- "fs-extra": "^11.3.0",
65
+ "fs-extra": "^11.3.1",
66
66
  "tslib": "^2.8.1",
67
67
  "tsup": "^8.5.0",
68
68
  "tsx": "^4.20.3",