Skip to content

Commit

Permalink
Fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
cf committed Oct 14, 2023
1 parent b054c70 commit d4393cb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
"module": "./dist/poseidon2.mjs",
"exports": {
"./goldilocks-12": {
"types": "./dist/goldilocks-12.d.ts",
"require": "./dist/goldilocks-12.cjs",
"import": "./dist/goldilocks-12.mjs"
},
".": {
"types": "./dist/poseidon2.d.ts",
"require": "./dist/poseidon2.cjs",
"import": "./dist/poseidon2.mjs"
}
},
"scripts": {
"dev": "vite --host",
"build": "rimraf ./dist && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
"build": "rimraf ./dist && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts && tsc -p ./tsconfig.types.json",
"test": "vitest",
"test:coverage": "vitest --coverage",
"lint:scripts": "eslint . --ext .ts",
Expand Down
36 changes: 36 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"compilerOptions": {
"rootDir": "./src",
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"types": ["vite/client", "node"],
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
"allowJs": true,
// Generate d.ts files
"declaration": true,
// This compiler run should
// only output d.ts files
"emitDeclarationOnly": true,
// Types should go into this directory.
// Removing this would place the .d.ts files
// next to the .js files
"outDir": "dist",
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
},
"include": ["src"],
"exclude": ["**/*.test.ts", "node_modules", "test/**", ".history/**"]
}

0 comments on commit d4393cb

Please sign in to comment.