Skip to content

Commit

Permalink
feat(core): export several util functions (#997)
Browse files Browse the repository at this point in the history
* feat: export several util functions

* chore: format

* feat(core): Create `gosling.js/utils` entrypoint for exporting utility funcs (#1001)

feat: Create separate entrypoint for gosling.js/utils

---------

Co-authored-by: Trevor Manz <[email protected]>
  • Loading branch information
sehilyi and manzt authored Dec 4, 2023
1 parent 09c0179 commit 7e9a834
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/gosling.js"
},
"./utils": {
"types": "./dist/src/exported-utils.d.ts",
"import": "./dist/utils.js"
}
},
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/exported-utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export {
getRelativeGenomicPosition,
computeChromSizes,
getChromInterval,
getChromTotalSize,
parseGenomicPosition
} from './core/utils/assembly';
export { sanitizeChrName } from './data-fetchers/utils';
6 changes: 4 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ const esm = defineConfig({
target: 'es2018',
sourcemap: true,
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
entry: {
gosling: path.resolve(__dirname, 'src/index.ts'),
utils: path.resolve(__dirname, 'src/exported-utils.ts'),
},
formats: ['es'],
fileName: 'gosling'
},
rollupOptions: { external }
},
Expand Down

0 comments on commit 7e9a834

Please sign in to comment.