feat: migrated packages to ts
This commit is contained in:
@@ -49,6 +49,7 @@ app:
|
||||
showcase:
|
||||
public: public
|
||||
assets: assets
|
||||
release: release
|
||||
dir_name:
|
||||
data: data
|
||||
dist: dist
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
import baseConfig from '@aklive2d/eslint-config'
|
||||
import { tsConfig } from '@aklive2d/eslint-config'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import globals from 'globals'
|
||||
|
||||
/** @type {import('eslint').Config} */
|
||||
export default [...baseConfig]
|
||||
export default tseslint.config(
|
||||
...tsConfig,
|
||||
{
|
||||
ignores: ['dist', 'data'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.js', '**/*.ts'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{ argsIgnorePattern: '^_' },
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import path from 'node:path'
|
||||
import { yaml } from '@aklive2d/libs'
|
||||
|
||||
export default yaml.read(path.resolve(import.meta.dirname, 'config.yaml'))
|
||||
9
packages/config/index.ts
Normal file
9
packages/config/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import path from 'node:path'
|
||||
import { yaml } from '@aklive2d/libs'
|
||||
import type { Config } from './types'
|
||||
|
||||
const config: Config = yaml.read(
|
||||
path.resolve(import.meta.dirname, 'config.yaml')
|
||||
)
|
||||
|
||||
export default config
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aklive2d/config",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"main": "index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -9,7 +9,12 @@
|
||||
"@aklive2d/eslint-config": "workspace:*",
|
||||
"@aklive2d/prettier-config": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"globals": ">=16.0.0",
|
||||
"typescript-eslint": ">=8.31.1",
|
||||
"typescript": ">=5.8.2"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint \"*.js\" \"**/*.js\" && prettier --check ."
|
||||
"lint": "eslint && prettier --check ."
|
||||
}
|
||||
}
|
||||
|
||||
25
packages/config/tsconfig.json
Normal file
25
packages/config/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2024",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["**/*"],
|
||||
"exclude": ["dist/**/*", "data/**/*"]
|
||||
}
|
||||
103
packages/config/types.ts
Normal file
103
packages/config/types.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
export type Config = {
|
||||
site_id: string
|
||||
total_size: number
|
||||
akassets: {
|
||||
project_name: string
|
||||
url: string
|
||||
}
|
||||
insight: {
|
||||
id: string
|
||||
url: string
|
||||
}
|
||||
module: {
|
||||
assets: {
|
||||
config_yaml: string
|
||||
background: string
|
||||
music: string
|
||||
charword_table: string
|
||||
project_json: string
|
||||
}
|
||||
background: {
|
||||
operator_bg_png: string
|
||||
}
|
||||
charword_table: {
|
||||
charword_table_json: string
|
||||
}
|
||||
music: {
|
||||
music_table_json: string
|
||||
display_meta_table_json: string
|
||||
audio_data_json: string
|
||||
}
|
||||
official_info: {
|
||||
official_info_json: string
|
||||
}
|
||||
operator: {
|
||||
operator: string
|
||||
config: string
|
||||
template_yaml: string
|
||||
config_yaml: string
|
||||
portraits: string
|
||||
logos_assets: string
|
||||
logos: string
|
||||
directory_assets: string
|
||||
MonoBehaviour: string
|
||||
Texture2D: string
|
||||
title: {
|
||||
'zh-CN': string
|
||||
'en-US': string
|
||||
}
|
||||
}
|
||||
project_json: {
|
||||
project_json: string
|
||||
preview_jpg: string
|
||||
template_yaml: string
|
||||
}
|
||||
wrangler: {
|
||||
index_json: string
|
||||
}
|
||||
vite_helpers: {
|
||||
config_json: string
|
||||
}
|
||||
}
|
||||
app: {
|
||||
showcase: {
|
||||
public: string
|
||||
assets: string
|
||||
release: string
|
||||
}
|
||||
}
|
||||
dir_name: {
|
||||
data: string
|
||||
dist: string
|
||||
extracted: string
|
||||
auto_update: string
|
||||
voice: {
|
||||
main: string
|
||||
sub: {
|
||||
name: string
|
||||
lang: string
|
||||
lookup_region: string
|
||||
}[]
|
||||
}
|
||||
}
|
||||
directory: {
|
||||
assets_dir: string
|
||||
title: string
|
||||
voice: string
|
||||
error: {
|
||||
files: {
|
||||
key: string
|
||||
paddings: {
|
||||
left: string
|
||||
right: string
|
||||
top: string
|
||||
bottom: string
|
||||
}
|
||||
}[]
|
||||
voice: {
|
||||
file: string
|
||||
target: string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user