Skip to content

Commit

Permalink
refactor(vike-solid-query): use tsc only for development and build
Browse files Browse the repository at this point in the history
  • Loading branch information
phonzammi committed Sep 23, 2024
1 parent 99bdb86 commit 429fd54
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 84 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
},
"pnpm": {
"overrides": {
"vike-solid": "link:./packages/vike-solid/"
"vike-solid": "link:./packages/vike-solid/",
"vike-solid-query": "link:./packages/vike-solid-query/"
}
},
"devDependencies": {
Expand Down
9 changes: 0 additions & 9 deletions packages/vike-solid-query/integration/+config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Config } from "vike/types";
import type { QueryClientConfig } from "@tanstack/solid-query";
import "vike-solid/config"; // Needed for declaration merging of Config

export default {
Expand All @@ -24,11 +23,3 @@ export default {
},
},
} satisfies Config;

declare global {
namespace Vike {
interface Config {
queryClientConfig?: QueryClientConfig;
}
}
}
14 changes: 14 additions & 0 deletions packages/vike-solid-query/integration/Wrapper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createComponent, type JSX } from "solid-js";
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query";
import { usePageContext } from "vike-solid/usePageContext";

export default function Wrapper(props: { children?: JSX.Element }) {
const pageContext = usePageContext();

return createComponent(QueryClientProvider, {
client: new QueryClient(pageContext.config.queryClientConfig),
get children() {
return props.children;
},
});
}
10 changes: 0 additions & 10 deletions packages/vike-solid-query/integration/Wrapper.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ declare global {
}
}
}

export {};
27 changes: 12 additions & 15 deletions packages/vike-solid-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@
"name": "vike-solid-query",
"version": "0.0.1",
"type": "module",
"main": "dist/src/index.js",
"typings": "dist/src/index.js",
"exports": {
".": "./dist/src/index.js",
"./config": "./dist/integration/+config.js",
"./__internal/integration/Wrapper": "./dist/integration/Wrapper.js"
},
"scripts": {
"dev": "rollup -c rollup.config.js --watch",
"dev": "tsc --watch",
"dev:typecheck": "tsc --noEmit --watch",
"build": "rollup -c rollup.config.js && tsc",
"build": "rimraf dist/ && tsc",
"release": "LANG=en_US release-me patch",
"release:minor": "LANG=en_US release-me minor",
"release:commit": "LANG=en_US release-me commit"
},
"peerDependencies": {
"@tanstack/solid-query": ">=5.0.0",
"solid-js": "^1.8.7",
"vike-solid": "workspace:^"
"vike-solid": ">=0.7.4"
},
"devDependencies": {
"@brillout/release-me": "^0.4.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@tanstack/solid-query": "^5.56.2",
"rimraf": "^6.0.1",
"rollup": "^4.21.3",
"rollup-plugin-dts": "^6.1.1",
"solid-js": "^1.8.22",
"typescript": "^5.6.2",
"vike": "^0.4.195",
"vike-solid": "workspace:*",
"vite": "^5.4.6"
},
"exports": {
".": "./dist/src/index.js",
"./config": "./dist/integration/+config.js",
"./__internal/integration/Wrapper": "./dist/integration/Wrapper.js"
"vike-solid": "^0.7.5"
},
"typesVersions": {
"*": {
Expand All @@ -45,7 +42,7 @@
}
},
"files": [
"dist/"
"dist"
],
"repository": "github:vikejs/vike-solid",
"license": "MIT"
Expand Down
18 changes: 0 additions & 18 deletions packages/vike-solid-query/rollup.config.js

This file was deleted.

26 changes: 11 additions & 15 deletions packages/vike-solid-query/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"noUncheckedIndexedAccess": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"types": ["vite/client"],
"isolatedModules": true,
"outDir": "./dist",
"declaration": true,
"module": "ES2022",
"moduleResolution": "Bundler",
"target": "ES2020",
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"esModuleInterop": true,
"skipLibCheck": true,
"rootDir": "./"
},
"include": ["src/*", "global.d.ts"]
"allowSyntheticDefaultImports": true,
"verbatimModuleSyntax": true,
"strict": true,
"declaration": true,
"outDir": "./dist/"
}
}
18 changes: 2 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 429fd54

Please sign in to comment.