refactor: improve content json importing

This commit is contained in:
Kim, Jimin 2023-08-08 12:39:46 +09:00
parent a3c0990804
commit 36b1ecd8ec
Signed by: pomp
GPG key ID: CE1DDB8A4A765403
10 changed files with 43 additions and 28 deletions

View 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
}
}