feat: initialize TypeScript configuration and Vitest setup

- Add pnpm workspace configuration to specify built dependencies.
- Create tsconfig.json for TypeScript compiler options and module resolution.
- Add tsconfig.build.json for build-specific TypeScript settings.
- Set up Vitest configuration with path aliasing for testing.
This commit is contained in:
2026-02-19 23:24:52 -05:00
parent 19276dff4d
commit 19ef9042ce
9 changed files with 1541 additions and 3 deletions

5
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"recommendations": [
"biomejs.biome",
]
}

12
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"editor.formatOnSave": true,
"search.exclude": {
"**/.git/": true,
"**/node_modules/": true,
"**/dist/": true
}
}

55
biome.json Normal file
View File

@@ -0,0 +1,55 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.3/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"bracketSameLine": false,
"bracketSpacing": true,
"expand": "auto",
"useEditorconfig": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
},
"style": {
"noNonNullAssertion": "off"
}
}
},
"javascript": {
"formatter": {
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"bracketSpacing": true
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

View File

@@ -4,10 +4,19 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "build": "rimraf ./dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"prepare": "pnpm build"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "MIT",
"packageManager": "pnpm@10.30.1" "packageManager": "pnpm@10.30.1",
"devDependencies": {
"@biomejs/biome": "2.4.3",
"@types/node": "25.3.0",
"rimraf": "6.1.3",
"tsc-alias": "1.8.16",
"tsx": "4.21.0",
"vitest": "4.0.18"
}
} }

1391
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

3
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,3 @@
onlyBuiltDependencies:
- core-js
- esbuild

10
tsconfig.build.json Normal file
View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
},
"exclude": [
"tests/**/*",
"vitest.config.ts",
]
}

40
tsconfig.json Normal file
View File

@@ -0,0 +1,40 @@
{
"compilerOptions": {
"target": "es2020",
"module": "nodenext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"rootDir": "./",
"outDir": "./dist",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noUnusedLocals": true,
"noFallthroughCasesInSwitch": true,
"moduleDetection": "force",
"isolatedModules": true,
"removeComments": true,
"skipLibCheck": true,
"baseUrl": "./",
"paths": {
"@/*": [
"./src/*"
]
},
"plugins": [
{
"transform": "typescript-transform-paths"
},
{
"transform": "typescript-transform-paths",
"afterDeclarations": true
}
]
},
"include": [
"src/**/*",
"tests/**/*",
],
}

13
vitest.config.ts Normal file
View File

@@ -0,0 +1,13 @@
import path from 'node:path'
import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
test: {
environment: 'node',
},
})