Skip to content

Commit

Permalink
Convert to using exports in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 6, 2025
1 parent f0a42cb commit 7f69bfe
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 254 deletions.
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
"name": "@gmod/vcf",
"version": "6.0.1",
"description": "High performance streaming Variant Call Format (VCF) parser in pure JavaScript",
"main": "dist/index.js",
"module": "esm/index.js",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./esm/index.d.ts",
"import": "./esm/index.js"
},
"require": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js"
}
},
"repository": "github:GMOD/vcf-js",
"author": {
"name": "Garrett Stevens",
Expand Down Expand Up @@ -33,6 +44,7 @@
"build:es5": "tsc --target es2015 --module commonjs --outDir dist",
"build": "yarn build:esm && yarn build:es5",
"prebuild": "yarn clean && yarn lint",
"postbuild:es5": "echo '{\"type\": \"commonjs\"}' > dist/package.json",
"preversion": "yarn lint && yarn test --run && yarn build",
"version": "standard-changelog && git add CHANGELOG.md",
"postversion": "git push --follow-tags"
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ export function parseBreakend(breakendString: string): Breakend | undefined {
return undefined
}

export type { Variant } from './parse'
export type { Variant } from './parse.ts'

export { default } from './parse'
export { default } from './parse.ts'
4 changes: 2 additions & 2 deletions src/parse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseMetaString } from './parseMetaString'
import vcfReserved from './vcfReserved'
import { parseMetaString } from './parseMetaString.ts'
import vcfReserved from './vcfReserved.ts'

function decodeURIComponentNoThrow(uri: string) {
try {
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"esModuleInterop": true
}
}
Loading

0 comments on commit 7f69bfe

Please sign in to comment.