-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from noskofficial/fix/build
feat: add devDependencies for js-yaml and node types
- Loading branch information
Showing
7 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
import yaml from "js-yaml"; | ||
|
||
export interface Root { | ||
menu: Menu | ||
} | ||
|
||
export interface Menu { | ||
title: string | ||
main: Main[] | ||
} | ||
|
||
export interface Main { | ||
title: string | ||
link?: string | ||
subMenu?: SubMenu[] | ||
} | ||
|
||
export interface SubMenu { | ||
category: string | ||
inRange?: boolean | ||
rangeStart?: number | ||
rangeEnd?: number | ||
link: string | ||
items?: string[] | ||
} | ||
|
||
|
||
export function loadConfig(): Root { | ||
const filePath = path.resolve("./config.yml"); | ||
const fileContents = fs.readFileSync(filePath, "utf8"); | ||
return yaml.load(fileContents) as Root; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict" | ||
"extends": "astro/tsconfigs/strict", | ||
"include": ["src/**/*.ts", "src/**/*.tsx"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters