feat: add shared infiplot workspace packages

Signed-off-by: baizhi958216 <1475289190@qq.com>
This commit is contained in:
baizhi958216
2026-06-30 00:44:36 +08:00
parent caca4369aa
commit e585bb2eed
17 changed files with 240 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
{
"name": "@infiplot/core",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"scripts": {
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@infiplot/types": "workspace:*"
},
"devDependencies": {
"typescript": "^6.0.3"
}
}
+12
View File
@@ -0,0 +1,12 @@
import type { Locale } from "@infiplot/types";
const DEFAULT_LOCALE: Locale = "zh-CN";
const SUPPORTED_LOCALES = new Set<Locale>(["en", "ja", "zh-CN"]);
export function normalizeLocale(locale: string | undefined): Locale {
if (locale && SUPPORTED_LOCALES.has(locale as Locale)) {
return locale as Locale;
}
return DEFAULT_LOCALE;
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": true
},
"include": ["src/**/*.ts"]
}