Skip to content

Commit

Permalink
v
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Dec 13, 2024
1 parent 42ab5ea commit 4271b78
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-lobsters-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

fix
5 changes: 5 additions & 0 deletions .changeset/khaki-ghosts-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

FIX
6 changes: 5 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"clever-ligers-whisper",
"cold-beds-work",
"dirty-falcons-rhyme",
"dirty-lobsters-collect",
"dry-timers-poke",
"eleven-donuts-yell",
"fluffy-sloths-admire",
"good-worms-jam",
"great-flies-wonder",
"khaki-ghosts-call",
"lovely-carrots-bathe",
"mean-panthers-give",
"modern-tools-repeat",
Expand All @@ -28,6 +30,8 @@
"quick-experts-complain",
"short-spiders-taste",
"small-planes-sort",
"stale-seahorses-decide"
"small-walls-act",
"stale-seahorses-decide",
"tame-otters-shake"
]
}
5 changes: 5 additions & 0 deletions .changeset/small-walls-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

fix
5 changes: 5 additions & 0 deletions .changeset/tame-otters-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

fix
24 changes: 24 additions & 0 deletions packages/basehub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# basehub

## 8.0.0-canary.24

### Patch Changes

- FIX

## 8.0.0-canary.23

### Patch Changes

- fix

## 8.0.0-canary.22

### Patch Changes

- fix

## 8.0.0-canary.21

### Patch Changes

- fix

## 8.0.0-canary.20

### 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.20",
"version": "8.0.0-canary.24",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
4 changes: 4 additions & 0 deletions packages/basehub/src/api-transaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Transaction as FullTransaction } from "@basehub/mutation-api-helpers";
export type {
RichTextNode,
RichTextTocNode,
} from "@basehub/mutation-api-helpers";

export type Transaction =
| FullTransaction["operations"]
Expand Down
10 changes: 8 additions & 2 deletions packages/basehub/src/bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export const main = async (
}

const generatedMainExportPath = path.join(basehubOutputPath, "index.ts");
const generatedSchemaPath = path.join(basehubOutputPath, "schema.ts");

// We'll patch some things from the generated code.
let schemaFileContents = fs.readFileSync(generatedMainExportPath, "utf-8");
Expand Down Expand Up @@ -258,10 +259,9 @@ R extends Omit<MutationGenqlSelection, "transaction" | "transactionAwaitable"> &
},
>`
);

// add import for Transaction at the start of the file
schemaFileContents +=
"\nimport type { Transaction, RichTextNode, RichTextTocNode } from './api-transaction';\nimport type { TransactionStatusGenqlSelection } from './schema';\n";
"\nimport type { Transaction } from './api-transaction';\nimport type { TransactionStatusGenqlSelection } from './schema';\n";
}

// 3. append our basehub function to the end of the file.
Expand All @@ -278,6 +278,12 @@ R extends Omit<MutationGenqlSelection, "transaction" | "transactionAwaitable"> &

// 4. write the file back.
fs.writeFileSync(generatedMainExportPath, schemaFileContents);
fs.appendFileSync(
generatedSchemaPath,
`
import type { RichTextNode, RichTextTocNode } from './api-transaction';
`
);

// we'll want to externalize react, react-dom, and "../index" in this case is the generated basehub client.
const peerDependencies = [
Expand Down
8 changes: 7 additions & 1 deletion packages/basehub/src/react/rich-text/primitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,16 +640,22 @@ type TocHandlers = Pick<Handlers, "ol" | "p" | "a">;

export type TocProps = {
content?: RichTextTocNode[];
/**
* @deprecated Use `content` instead.
*/
children?: unknown;
components?: Partial<TocHandlers>;
disableDefaultComponents?: boolean;
};

export const TOC = (props: TocProps): ReactNode => {
const slugger = new GithubSlugger();

const value = (props.content ?? props.children) as RichTextTocNode[];

return (
<>
{props.content?.map((node, index) => {
{value?.map((node, index) => {
return (
<Node
node={node as RichTextNode}
Expand Down
28 changes: 28 additions & 0 deletions playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# playground

## 0.0.164-canary.24

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.164-canary.23

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.164-canary.22

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.164-canary.21

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.164-canary.20

### 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.20",
"version": "0.0.164-canary.24",
"scripts": {
"dev": "basehub dev & next dev --port 3003",
"build": "basehub && next build",
Expand Down

0 comments on commit 4271b78

Please sign in to comment.