Skip to content

Commit

Permalink
fix pump types
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Dec 16, 2024
1 parent 30686ca commit e718f69
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-eyes-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

types fix
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"great-flies-wonder",
"khaki-ghosts-call",
"lovely-carrots-bathe",
"lucky-eyes-ring",
"mean-panthers-give",
"modern-tools-repeat",
"nasty-bananas-ring",
Expand Down
6 changes: 6 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# basehub

## 8.0.0-canary.27

### Patch Changes

- types fix

## 8.0.0-canary.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/basehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "basehub",
"description": "A very fast Headless CMS.",
"author": "JB <[email protected]>",
"version": "8.0.0-canary.26",
"version": "8.0.0-canary.27",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
9 changes: 6 additions & 3 deletions packages/basehub/src/bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,17 @@ import type { RichTextNode, RichTextTocNode } from './api-transaction';
* DTS stuff.
*/
copyDirSync(
path.join(basehubModulePath, "dts", "react", "pump"),
path.join(basehubModulePath, "dts", "src", "react", "pump"),
reactPumpOutDir
);
copyDirSync(
path.join(basehubModulePath, "dts", "next", "toolbar"),
path.join(basehubModulePath, "dts", "src", "next", "toolbar"),
nextToolbarOutDir
);
copyDirSync(path.join(basehubModulePath, "dts", "events"), analyticsOutDir);
copyDirSync(
path.join(basehubModulePath, "dts", "src", "events"),
analyticsOutDir
);

if (args["--debug"]) {
console.log(`[basehub] copied dts for react pump to: ${reactPumpOutDir}`);
Expand Down
5 changes: 3 additions & 2 deletions packages/basehub/src/react/pump/server-pump.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from "react";
import type { JSX } from "react";
import type { ResponseCache } from "./types";
import {
// @ts-ignore
Expand Down Expand Up @@ -52,7 +53,7 @@ export const Pump = async <Queries extends Array<PumpQuery>>({
children,
queries,
...basehubProps
}: PumpProps<Queries>): Promise<React.JSX.Element> => {
}: PumpProps<Queries>): Promise<JSX.Element> => {
// passed to the client to toast
const errors: Array<ResponseCache["errors"]> = [];
const responseHashes: Array<ResponseCache["responseHash"]> = [];
Expand Down Expand Up @@ -237,7 +238,7 @@ export const createPump = <
return (
props: Omit<PumpProps<Query>, "queries"> &
(Params extends void ? unknown : { params: Params })
) => {
): JSX.Element => {
// Dynamically call query function based on whether query is a function and params are provided
const queryResult =
typeof queries === "function" ? queries((props as any).params) : queries;
Expand Down
7 changes: 7 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 0.0.164-canary.27

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.164-canary.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playground",
"private": true,
"version": "0.0.164-canary.26",
"version": "0.0.164-canary.27",
"scripts": {
"dev": "basehub dev & next dev --port 3003",
"build": "basehub && next build",
Expand Down

0 comments on commit e718f69

Please sign in to comment.