diff --git a/package.json b/package.json index cb8bef9..1f7fb75 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,24 @@ }, "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/index.cjs" + }, + "./neo4j": { + "types": "./dist/neo4j/index.d.ts", + "import": "./dist/neo4j/index.js", + "require": "./dist/neo4j/index.cjs" + }, + "./next": { + "types": "./dist/next/index.d.ts", + "import": "./dist/next/index.js", + "require": "./dist/next/index.cjs" + }, + "./react": { + "types": "./dist/react/index.d.ts", + "import": "./dist/react/index.js", + "require": "./dist/react/index.cjs" } }, "files": [ @@ -62,4 +78,4 @@ "tsx": "^4.7.2", "typescript": "^5.4.5" } -} +} \ No newline at end of file diff --git a/src/index.neo4j.ts b/src/index.neo4j.ts new file mode 100644 index 0000000..2183d90 --- /dev/null +++ b/src/index.neo4j.ts @@ -0,0 +1,2 @@ +export * from './index' +export * from './layers/Neo4j/defineNeo4jLayer' \ No newline at end of file diff --git a/src/index.nextjs.ts b/src/index.nextjs.ts new file mode 100644 index 0000000..6ee6964 --- /dev/null +++ b/src/index.nextjs.ts @@ -0,0 +1,2 @@ +export * from './index' +export * from './layers/NextjsCache/defineNextjsCacheLayer' \ No newline at end of file diff --git a/src/index.react.ts b/src/index.react.ts new file mode 100644 index 0000000..c5b375f --- /dev/null +++ b/src/index.react.ts @@ -0,0 +1,2 @@ +export * from './index' +export * from './layers/ReactCache/defineReactCacheLayer' \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 98564a9..02a9969 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,10 +2,6 @@ export * from './base/defineBaseGraph' export * from './base/defineNode' -export * from './layers/Neo4j/defineNeo4jLayer' -export * from './layers/NextjsCache/defineNextjsCacheLayer' -export * from './layers/ReactCache/defineReactCacheLayer' - // Types export * from './types/GraphLayer' diff --git a/tsup.config.ts b/tsup.config.ts index f21d7de..ab65b05 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,9 +1,25 @@ import { defineConfig } from "tsup"; -export default defineConfig({ - entry: ["src/index.ts"], + +const baseOptions = { + sourcemap: true, clean: true, shims: true, dts: true, - format: ["esm", 'cjs'], -}); + format: ["cjs", 'esm'], +} as Partial[0]>; + +export default defineConfig([{ + entry: { index: "src/index.ts" }, + ...baseOptions +}, { + entry: { "neo4j/index": "src/index.neo4j.ts" }, + ...baseOptions +}, { + entry: { "nextjs/index": "src/index.nextjs.ts" }, + ...baseOptions, + banner: { js: `'use server'` } +}, { + entry: { "react/index": "src/index.react.ts" }, + ...baseOptions +}]);