Skip to content

Commit e77feb4

Browse files
authoredFeb 3, 2025··
fix: upgrade dependencies, ditch patches and move tinycolor2 patch (#1442)
1 parent 41bc1b0 commit e77feb4

9 files changed

+5186
-4304
lines changed
 

Diff for: ‎.changeset/itchy-eagles-refuse.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'style-dictionary': patch
3+
---
4+
5+
Move the tinycolor2 patch from a patch file to a 3-liner fix in our source code, so it gets correctly published and usable by consumers.

Diff for: ‎lib/common/formats.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ function stripMetaProps(tokens, options) {
158158
async function formatJS(content, ts = false) {
159159
return prettier.format(content, {
160160
parser: ts ? `typescript` : `babel`,
161-
plugins: [prettierPluginBabel, prettierPluginEstree, prettierPluginTypescript],
161+
plugins: [
162+
prettierPluginBabel,
163+
/** @type {import('prettier').Plugin} */ (prettierPluginEstree),
164+
prettierPluginTypescript,
165+
],
162166
});
163167
}
164168

Diff for: ‎lib/common/transforms.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ const camelOpts = {
4444
* @returns {boolean}
4545
*/
4646
export function isColor(token, options) {
47+
const val = options.usesDtcg ? token.$value : token.value;
48+
const type = options.usesDtcg ? token.$type : token.type;
4749
return (
48-
(options.usesDtcg ? token.$type : token.type) === 'color' &&
49-
Color(options.usesDtcg ? token.$value : token.value).isValid()
50+
type === 'color' &&
51+
Color(val).isValid() &&
52+
// exclude gradients from being color transformed
53+
['linear', 'radial', 'conic']
54+
.map((pre) => `${pre}-gradient`)
55+
.every((pre) => !`${val}`.startsWith(pre) && !`${val}`.startsWith(`repeating-${pre}`))
5056
);
5157
}
5258

Diff for: ‎package-lock.json

+5,154-4,203
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@
130130
},
131131
"devDependencies": {
132132
"@astrojs/check": "^0.9.4",
133-
"@astrojs/starlight": "^0.29.2",
134-
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
133+
"@astrojs/starlight": "^0.31.1",
135134
"@changesets/cli": "^2.27.1",
136135
"@commitlint/cli": "^18.4.3",
137136
"@commitlint/config-conventional": "^18.4.3",
@@ -142,16 +141,16 @@
142141
"@types/chai": "^4.3.9",
143142
"@types/tinycolor2": "^1.4.6",
144143
"@types/uuid": "^9.0.8",
145-
"@typescript-eslint/parser": "^8.16.0",
144+
"@typescript-eslint/parser": "^8.22.0",
146145
"@web/test-runner": "^0.18.2",
147146
"@web/test-runner-commands": "^0.9.0",
148147
"@web/test-runner-playwright": "^0.11.0",
149148
"acorn": "^8.11.3",
150-
"astro": "^4.16.16",
149+
"astro": "^5.2.3",
151150
"chai": "^5.0.0-alpha.2",
152-
"eslint": "^9.14.0",
151+
"eslint": "^9.19.0",
153152
"eslint-plugin-mocha": "^10.5.0",
154-
"eslint-plugin-react": "^7.37.2",
153+
"eslint-plugin-react": "^7.37.4",
155154
"estree-walker": "^3.0.3",
156155
"fs-extra": "^10.0.0",
157156
"hanbi": "^1.0.1",
@@ -169,7 +168,7 @@
169168
"npm-run-all": "^4.1.5",
170169
"sass": "^1.69.5",
171170
"sharp": "^0.32.5",
172-
"starlight-links-validator": "^0.13.3",
171+
"starlight-links-validator": "^0.14.2 ",
173172
"stylus": "^0.56.0",
174173
"typescript": "^5.7.2",
175174
"unist-util-visit": "^5.0.0",
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
11
diff --git a/node_modules/@astrojs/starlight/utils/createTranslationSystem.ts b/node_modules/@astrojs/starlight/utils/createTranslationSystem.ts
2-
index 540b74b..0a06296 100644
2+
index 540b74b..7e8e38f 100644
33
--- a/node_modules/@astrojs/starlight/utils/createTranslationSystem.ts
44
+++ b/node_modules/@astrojs/starlight/utils/createTranslationSystem.ts
55
@@ -125,6 +125,7 @@ function buildResources<T extends Record<string, string | undefined>>(
66
// strings. We let TypeScript merge them into a single union type so that plugins with a TypeScript
77
// configuration preventing `UserI18nKeys` to be properly inferred can still get auto-completion
88
// for built-in UI strings.
9-
+// @ts-expect-error not imported, only in locals.d.ts
9+
+// @ts-expect-error StarlightApp missing
1010
export type I18nKeys = keyof BuiltInStrings | UserI18nKeys | keyof StarlightApp.I18n;
1111

1212
export type I18nT = TFunction<'starlight', undefined> & {
13-
diff --git a/node_modules/@astrojs/starlight/utils/translations-fs.ts b/node_modules/@astrojs/starlight/utils/translations-fs.ts
14-
index 4bcfcda..9b783a9 100644
15-
--- a/node_modules/@astrojs/starlight/utils/translations-fs.ts
16-
+++ b/node_modules/@astrojs/starlight/utils/translations-fs.ts
17-
@@ -1,6 +1,7 @@
18-
import fs from 'node:fs';
19-
import path from 'node:path';
20-
import { fileURLToPath } from 'node:url';
21-
+// @ts-expect-error @types/js-yaml not installed
22-
import yaml from 'js-yaml';
23-
import type { i18nSchemaOutput } from '../schemas/i18n';
24-
import { createTranslationSystem } from './createTranslationSystem';
2513
diff --git a/node_modules/@astrojs/starlight/utils/translations.ts b/node_modules/@astrojs/starlight/utils/translations.ts
26-
index 499ded2..87e0a1a 100644
14+
index 71ce6e7..6707e1e 100644
2715
--- a/node_modules/@astrojs/starlight/utils/translations.ts
2816
+++ b/node_modules/@astrojs/starlight/utils/translations.ts
29-
@@ -1,5 +1,7 @@
17+
@@ -1,6 +1,9 @@
3018
import { getCollection, type CollectionEntry, type DataCollectionKey } from 'astro:content';
31-
+// @ts-expect-error virtual imports not working in context of installed as dependency
19+
+// @ts-expect-error virtual module not found
3220
import config from 'virtual:starlight/user-config';
33-
+// @ts-expect-error virtual imports not working in context of installed as dependency
21+
+// @ts-expect-error virtual module not found
22+
import project from 'virtual:starlight/project-context';
23+
+// @ts-expect-error virtual module not found
3424
import pluginTranslations from 'virtual:starlight/plugin-translations';
3525
import type { i18nSchemaOutput } from '../schemas/i18n';
3626
import { createTranslationSystem } from './createTranslationSystem';

Diff for: ‎patches/globals+11.12.0.patch

-13
This file was deleted.

Diff for: ‎patches/starlight-links-validator+0.13.3.patch

-18
This file was deleted.

Diff for: ‎patches/tinycolor2+1.6.0.patch

-42
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.