Skip to content

Commit

Permalink
feat: Create separate entrypoint for gosling.js/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Nov 29, 2023
1 parent ace15e4 commit 0cb7de4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 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';
18 changes: 0 additions & 18 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,3 @@ export { validateGoslingSpec } from '@gosling-lang/gosling-schema';
export { GoslingComponent } from './core/gosling-component';
export type { GoslingRef } from './core/gosling-component';
export { embed } from './core/gosling-embed';

import {
getRelativeGenomicPosition,
computeChromSizes,
getChromInterval,
getChromTotalSize,
parseGenomicPosition
} from './core/utils/assembly';
import { sanitizeChrName } from './data-fetchers/utils';
const utils = {
getRelativeGenomicPosition,
computeChromSizes,
getChromInterval,
getChromTotalSize,
parseGenomicPosition,
sanitizeChrName
};
export { utils };
6 changes: 4 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,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 0cb7de4

Please sign in to comment.