refactor: improve content json importing
This commit is contained in:
parent
a3c0990804
commit
36b1ecd8ec
10 changed files with 43 additions and 28 deletions
14
packages/content/exports/portfolio.ts
Normal file
14
packages/content/exports/portfolio.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import portfolio from "../dist/portfolio.json" assert { type: "json" }
|
||||
import type { PortfolioProject } from "../src/types/types"
|
||||
|
||||
export type ProjectKey = keyof typeof portfolio.projects
|
||||
|
||||
// sort of like src/types/types.ts > PortfolioData but exported
|
||||
export default portfolio as {
|
||||
// waiting for https://github.com/microsoft/TypeScript/issues/32063
|
||||
skills: string[]
|
||||
|
||||
projects: {
|
||||
[key in ProjectKey]: PortfolioProject
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue