Skip to content

Commit

Permalink
feat: export core from bundled integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
oedotme committed Apr 2, 2023
1 parent 94b17a4 commit bb218aa
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/generouted/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"src"
],
"scripts": {
"build": "tsc --emitDeclarationOnly --noEmit false --outDir dist",
"type-check": "tsc --noEmit"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions plugins/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./core": {
"types": "./dist/core.d.ts",
"import": "./dist/core.js"
},
"./lazy": {
"types": "./dist/index-lazy.d.ts",
"import": "./dist/index-lazy.js"
Expand All @@ -54,6 +58,9 @@
"*": [
"./dist/index.d.ts"
],
"core": [
"./dist/core.d.ts"
],
"lazy": [
"./dist/index-lazy.d.ts"
],
Expand Down
1 change: 1 addition & 0 deletions plugins/react-router/src/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'generouted/core'
13 changes: 10 additions & 3 deletions plugins/react-router/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import { defineConfig } from 'tsup'

export default defineConfig([
{
entry: ['src/index*', 'src/client'],
entry: ['src/core.ts', 'src/index*', 'src/client'],
format: ['esm'],
dts: true,
dts: {
entry: {
core: './node_modules/generouted/dist/core.d.ts',
index: './node_modules/generouted/dist/react-router.d.ts',
'index-lazy': './node_modules/generouted/dist/react-router-lazy.d.ts',
'client/index': 'src/client/index.ts',
},
},
external: ['react', 'react-router-dom'],
noExternal: ['generouted'],
inject: ['./src/react.js'],
Expand All @@ -13,6 +20,6 @@ export default defineConfig([
entry: ['src/plugin'],
outDir: 'dist/plugin',
format: ['cjs', 'esm'],
dts: true,
dts: { entry: 'src/plugin/index.ts' },
},
])
7 changes: 7 additions & 0 deletions plugins/solid-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./core": {
"types": "./dist/core.d.ts",
"import": "./dist/core.js"
},
"./lazy": {
"types": "./dist/index-lazy.d.ts",
"import": "./dist/index-lazy.js"
Expand All @@ -54,6 +58,9 @@
"*": [
"./dist/index.d.ts"
],
"core": [
"./dist/core.d.ts"
],
"lazy": [
"./dist/index-lazy.d.ts"
],
Expand Down
1 change: 1 addition & 0 deletions plugins/solid-router/src/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'generouted/core'
13 changes: 10 additions & 3 deletions plugins/solid-router/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ import { solidPlugin as solid } from 'esbuild-plugin-solid'

export default defineConfig([
{
entry: ['src/index*', 'src/client'],
entry: ['src/core.ts', 'src/index*', 'src/client'],
format: ['esm'],
dts: true,
dts: {
entry: {
core: './node_modules/generouted/dist/core.d.ts',
index: './node_modules/generouted/dist/solid-router.d.ts',
'index-lazy': './node_modules/generouted/dist/solid-router-lazy.d.ts',
'client/index': 'src/client/index.ts',
},
},
external: ['solid-js', 'solid-js/web', '@solidjs/router'],
noExternal: ['generouted'],
esbuildPlugins: [solid()],
Expand All @@ -14,6 +21,6 @@ export default defineConfig([
entry: ['src/plugin'],
outDir: 'dist/plugin',
format: ['cjs', 'esm'],
dts: true,
dts: { entry: 'src/plugin/index.ts' },
},
])

0 comments on commit bb218aa

Please sign in to comment.