Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/beige-moons-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

.
5 changes: 5 additions & 0 deletions .changeset/bright-clouds-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

asdf
5 changes: 5 additions & 0 deletions .changeset/bright-needles-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

pack next
5 changes: 5 additions & 0 deletions .changeset/curly-dragons-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

asdf
5 changes: 5 additions & 0 deletions .changeset/dull-pans-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

internalize some deps
5 changes: 5 additions & 0 deletions .changeset/happy-wombats-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

fitz
5 changes: 5 additions & 0 deletions .changeset/honest-terms-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

dsf
5 changes: 5 additions & 0 deletions .changeset/kind-ways-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

asd
5 changes: 5 additions & 0 deletions .changeset/lemon-pumpkins-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

pack v0.00001
5 changes: 5 additions & 0 deletions .changeset/mighty-gifts-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

.
5 changes: 5 additions & 0 deletions .changeset/odd-spoons-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

next
5 changes: 5 additions & 0 deletions .changeset/orange-taxis-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": minor
---

expose basehub/cli
30 changes: 30 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"mode": "pre",
"tag": "canary",
"initialVersions": {
"eslint-config-custom": "1.0.0",
"tsconfig": "1.0.0",
"basehub": "8.2.11",
"playground": "0.0.215"
},
"changesets": [
"beige-moons-tap",
"bright-clouds-mix",
"bright-needles-beg",
"curly-dragons-dress",
"dull-pans-argue",
"happy-wombats-sparkle",
"honest-terms-nail",
"kind-ways-destroy",
"lemon-pumpkins-report",
"mighty-gifts-cross",
"odd-spoons-joke",
"orange-taxis-rule",
"proud-brooms-accept",
"rich-ravens-doubt",
"smart-garlics-walk",
"tasty-onions-play",
"violet-geckos-punch",
"wise-dancers-warn"
]
}
5 changes: 5 additions & 0 deletions .changeset/proud-brooms-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

asdf
5 changes: 5 additions & 0 deletions .changeset/rich-ravens-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

.
5 changes: 5 additions & 0 deletions .changeset/smart-garlics-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

sd:
5 changes: 5 additions & 0 deletions .changeset/tasty-onions-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

.
5 changes: 5 additions & 0 deletions .changeset/violet-geckos-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

.
5 changes: 5 additions & 0 deletions .changeset/wise-dancers-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"basehub": patch
---

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

## 8.3.0-canary.17

### Patch Changes

- asd

## 8.3.0-canary.16

### Patch Changes

- sd:

## 8.3.0-canary.15

### Patch Changes

- .

## 8.3.0-canary.14

### Patch Changes

- dsf

## 8.3.0-canary.13

### Patch Changes

- .

## 8.3.0-canary.12

### Patch Changes

- asdf

## 8.3.0-canary.11

### Patch Changes

- .

## 8.3.0-canary.10

### Patch Changes

- asdf

## 8.3.0-canary.9

### Patch Changes

- .

## 8.3.0-canary.8

### Patch Changes

- asdf

## 8.3.0-canary.7

### Patch Changes

- .

## 8.3.0-canary.6

### Patch Changes

- .

## 8.3.0-canary.5

### Patch Changes

- fitz

## 8.3.0-canary.4

### Patch Changes

- next

## 8.3.0-canary.3

### Patch Changes

- pack next

## 8.3.0-canary.2

### Patch Changes

- pack v0.00001

## 8.3.0-canary.1

### Patch Changes

- internalize some deps

## 8.3.0-canary.0

### Minor Changes

- expose basehub/cli

## 8.2.11

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions packages/basehub/cli.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./dist/cli.d.ts";
1 change: 1 addition & 0 deletions packages/basehub/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./dist/cli.js";
15 changes: 11 additions & 4 deletions 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.2.11",
"version": "8.3.0-canary.17",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down Expand Up @@ -46,15 +46,19 @@
"search.js",
"search.d.ts",
"next-image.js",
"next-image.d.ts"
"next-image.d.ts",
"cli.js",
"cli.d.ts"
],
"sideEffects": false,
"scripts": {
"emit-dts": "dts-bundle-generator --inline-declare-externals --external-inlines @basehub/mutation-api-helpers --no-check -o dts/src/api-transaction.d.ts src/api-transaction.ts && node scripts/fix-api-transaction-types.mjs && tsc --project tsconfig.dts-only.json",
"dev": "pnpm emit-dts && pnpm build --watch",
"build": "pnpm build:bin && pnpm build:client",
"build:bin": "pnpm emit-dts && tsup --config tsup-bin.config.ts",
"build:client": "tsup --config tsup-client.config.ts"
"build:client": "tsup --config tsup-client.config.ts",
"test": "vitest",
"test:run": "vitest run"
},
"dependencies": {
"@basehub/genql": "9.0.0-canary.13",
Expand Down Expand Up @@ -83,14 +87,17 @@
"@types/node": "18.13.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"@types/tar": "^6.1.5",
"dts-bundle-generator": "^9.5.1",
"esbuild-scss-modules-plugin": "^1.1.1",
"next": "^13.5.3",
"pkg-pr-new": "^0.0.30",
"react": "18.2.0",
"react-dom": "18.2.0",
"tar": "^6.2.0",
"tsconfig": "workspace:*",
"tsup": "8.0.2",
"type-fest": "3.0.0"
"type-fest": "3.0.0",
"vitest": "^0.32.3"
}
}
12 changes: 12 additions & 0 deletions packages/basehub/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import arg from "arg";
import { main } from "./main";
import { pack } from "./pack";
import { formatError } from "./util/format-error";
import fs from "fs";
import resolvePkg from "resolve-pkg";
Expand All @@ -25,6 +26,7 @@ async function help(code: number) {
Usage
$ basehub
$ basehub dev # turns on draft and watch mode automatically.
$ basehub pack # creates a standalone tarball of the generated client.

Options
--output, -o Output directory, if you don't want the default behavior.
Expand All @@ -33,6 +35,8 @@ async function help(code: number) {
--watch, -w Watch for changes and regenerate.
--draft, -d Generate with draft mode enabled.
--api-version, -av The version of the API to use.
--pack-dest, -pd Directory to place the tarball (pack command only).
--keep-generated, -kg Keep the generated client directory after packing.
--version, -v Version number.
--help, -h Display this message.`);
process.exit(code);
Expand Down Expand Up @@ -61,6 +65,8 @@ const args = arg(
"--watch": Boolean,
"--api-version": String,
"--debug": Boolean,
"--pack-dest": String,
"--keep-generated": Boolean,
// aliases
"-o": "--output",
"-t": "--token",
Expand All @@ -72,6 +78,8 @@ const args = arg(
"-h": "--help",
"-w": "--watch",
"-av": "--api-version",
"-pd": "--pack-dest",
"-kg": "--keep-generated",
},
{ permissive: true }
);
Expand All @@ -88,6 +96,10 @@ const cmds: { [key: string]: (args: Args) => Promise<void> } = {
generate: () => main(args, { version }),
build: () => main(args, { version }), // same as "generate"
dev: () => main({ ...args, "--watch": true }, { forceDraft: true, version }),
pack: async () => {
const _tarballPath = await pack(args, { version });
// Don't print the path again as it's already logged in the pack function
},
help: () => help(0),
};

Expand Down
13 changes: 2 additions & 11 deletions packages/basehub/src/bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { createHash } from "crypto";
import { ResolvedRef } from "../common-types";
import { ensureCrossPlatformTsImport } from "./util/cross-platform-ts-imports";
import { ensureSingleInstance } from "./util/ensure-single-instance";
import { BASEHUB_MODULES } from "./shared-modules";

const buildManifestSchema = z.object({
generatedAt: z.string(),
Expand Down Expand Up @@ -465,17 +466,7 @@ import type { Language as B_Language } from './react-code-block';

if (output !== "node_modules") {
// alias react-rich-text and other packages to the generated client for better import experience
[
"react-svg",
"react-rich-text",
"react-form",
"react-code-block/index",
"react-code-block/client",
"api-transaction",
"react-search",
"search",
"next-image",
].map((pathsToAlias) => {
BASEHUB_MODULES.map((pathsToAlias) => {
// ensure the directory exists
fs.mkdirSync(
path.join(basehubOutputPath, ...pathsToAlias.split("/").slice(0, -1)),
Expand Down
Loading