Skip to content

Commit

Permalink
fix(devtools): Update ESM export extension (#5364)
Browse files Browse the repository at this point in the history
* fix(devtools): Update ESM export extension

* Update Svelte devtools types error

* Fix svelte-query-devtools types error
  • Loading branch information
ardeora authored May 4, 2023
1 parent 45a810c commit a58b18b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
"types": "build/types/index.d.ts",
"main": "build/umd/index.js",
"module": "build/esm/index.js",
"module": "build/esm/index.mjs",
"exports": {
".": {
"types": "./build/types/index.d.ts",
"import": "./build/esm/index.js",
"import": "./build/esm/index.mjs",
"require": "./build/umd/index.js",
"default": "./build/umd/index.js"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-query-devtools/src/Devtools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let errorTypes: DevToolsErrorType[] = []
let ref: HTMLDivElement
let devtools: TanstackQueryDevtools
let devtools: TanstackQueryDevtools | undefined
if (DEV && BROWSER) {
onMount(async () => {
Expand All @@ -37,7 +37,7 @@
devtools.mount(ref)
return () => {
devtools.unmount()
devtools?.unmount()
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query-devtools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"paths": {
"@tanstack/query-core": ["../query-core/src"],
"@tanstack/query-devtools": ["../query-devtools/src"],
"@tanstack/svelte-query": ["../svelte-query/src"],
"@tanstack/svelte-query": ["../svelte-query/src"]
},
"references": [
{ "path": "../query-core" },
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"scripts": {
"clean": "rimraf ./build",
"test:types": "svelte-check --tsconfig ./tsconfig.json",
"test:types": "svelte-check --tsconfig ./tsconfig.json && tsc --emitDeclarationOnly --declaration --outDir build/lib",
"test:eslint": "eslint --ext .svelte,.ts ./src",
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
Expand Down
1 change: 0 additions & 1 deletion packages/svelte-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"lib": ["esnext", "DOM", "DOM.Iterable"],
"moduleResolution": "node",
"module": "esnext",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ function createTanstackQueryDevtoolsConfig() {
outputs.forEach((output) => {
const format = output.format
output.dir = `${packageDir}/build/${format}`
if (output.format === 'esm') {
output.dir = undefined
output.file = `${packageDir}/build/${format}/index.mjs`
}
})

solidRollupOptions.external = []
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ "path": "packages/react-query" },
{ "path": "packages/react-query-devtools" },
{ "path": "packages/react-query-persist-client" },
{ "path": "packages/svelte-query" },
{ "path": "packages/solid-query" },
{ "path": "packages/vue-query" },
{ "path": "packages/query-devtools" }
Expand Down

0 comments on commit a58b18b

Please sign in to comment.