From 0ffec09109c8618fcc0f8058a56b5a3f061aac0f Mon Sep 17 00:00:00 2001 From: sehilyi Date: Thu, 23 Nov 2023 11:04:30 -0500 Subject: [PATCH 1/3] feat: export several util functions --- src/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/index.ts b/src/index.ts index 920cac94..3aaab07d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,3 +13,21 @@ 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 }; From ace15e412944244b91e521539398c4c6b170facf Mon Sep 17 00:00:00 2001 From: sehilyi Date: Thu, 23 Nov 2023 11:05:31 -0500 Subject: [PATCH 2/3] chore: format --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3aaab07d..87fe7228 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,12 +14,12 @@ export { GoslingComponent } from './core/gosling-component'; export type { GoslingRef } from './core/gosling-component'; export { embed } from './core/gosling-embed'; -import { +import { getRelativeGenomicPosition, computeChromSizes, getChromInterval, getChromTotalSize, - parseGenomicPosition, + parseGenomicPosition } from './core/utils/assembly'; import { sanitizeChrName } from './data-fetchers/utils'; const utils = { From 46d0229743147413225979dbf93dde85bba08c4d Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Thu, 30 Nov 2023 11:47:08 -0500 Subject: [PATCH 3/3] feat(core): Create `gosling.js/utils` entrypoint for exporting utility funcs (#1001) feat: Create separate entrypoint for gosling.js/utils --- package.json | 4 ++++ src/exported-utils.ts | 8 ++++++++ src/index.ts | 18 ------------------ vite.config.js | 6 ++++-- 4 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 src/exported-utils.ts diff --git a/package.json b/package.json index 81cfce36..826731cd 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/exported-utils.ts b/src/exported-utils.ts new file mode 100644 index 00000000..996af136 --- /dev/null +++ b/src/exported-utils.ts @@ -0,0 +1,8 @@ +export { + getRelativeGenomicPosition, + computeChromSizes, + getChromInterval, + getChromTotalSize, + parseGenomicPosition +} from './core/utils/assembly'; +export { sanitizeChrName } from './data-fetchers/utils'; diff --git a/src/index.ts b/src/index.ts index 87fe7228..920cac94 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 }; diff --git a/vite.config.js b/vite.config.js index 9c2c07ed..1db30eda 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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 } },