Skip to content

Commit a7bae29

Browse files
committed
refactor(models): import material icons from different package
1 parent 4326943 commit a7bae29

5 files changed

Lines changed: 16 additions & 8 deletions

File tree

package-lock.json

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"multi-progress-bars": "^5.0.3",
5757
"parse-lcov": "^1.0.4",
5858
"simple-git": "^3.20.0",
59+
"vscode-material-icons": "^0.1.0",
5960
"yargs": "^17.7.2",
6061
"zod": "^3.22.4"
6162
},

packages/models/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"license": "MIT",
55
"dependencies": {
66
"zod": "^3.22.1",
7-
"@code-pushup/portal-client": "^0.5.0"
7+
"vscode-material-icons": "^0.1.0"
88
}
99
}

packages/models/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export {
3434
MAX_TITLE_LENGTH,
3535
} from './lib/implementation/limits';
3636
export {
37+
MaterialIcon,
3738
fileNameSchema,
3839
filePathSchema,
3940
materialIconSchema,

packages/models/src/lib/implementation/schemas.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { MATERIAL_ICONS } from 'vscode-material-icons';
12
import { ZodObject, ZodOptional, ZodString, z } from 'zod';
2-
import { MATERIAL_ICONS, MaterialIcon } from '@code-pushup/portal-client';
33
import {
44
MAX_DESCRIPTION_LENGTH,
55
MAX_SLUG_LENGTH,
@@ -207,10 +207,10 @@ export function scorableSchema<T extends ReturnType<typeof weightedRefSchema>>(
207207
);
208208
}
209209

210-
export const materialIconSchema = z.enum(
211-
MATERIAL_ICONS as [MaterialIcon, MaterialIcon, ...MaterialIcon[]],
212-
{ description: 'Icon from VSCode Material Icons extension' },
213-
);
210+
export const materialIconSchema = z.enum(MATERIAL_ICONS, {
211+
description: 'Icon from VSCode Material Icons extension',
212+
});
213+
export type MaterialIcon = z.infer<typeof materialIconSchema>;
214214

215215
type Ref = { weight: number };
216216

0 commit comments

Comments
 (0)