Skip to content

Commit

Permalink
v
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbenegas committed Oct 19, 2024
1 parent 1e78e1a commit 48b3a65
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 26 deletions.
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

## 7.5.13

### Patch Changes

- fix windows powershell generating backslashes instead of forward slashes

## 7.5.12

### 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": "7.5.12",
"version": "7.5.13",
"license": "MIT",
"repository": "basehub-ai/basehub",
"bugs": "https://github.com/basehub-ai/basehub/issues",
Expand Down
61 changes: 37 additions & 24 deletions packages/basehub/src/bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { copyDirSync } from "./util/cp";
import { z } from "zod";
import { createHash } from "crypto";
import { ResolvedRef } from "../common-types";
import { ensureCrossPlatformTsImport } from "./util/cross-platform-ts-imports";

const buildManifestSchema = z.object({
generatedAt: z.string(),
Expand Down Expand Up @@ -449,45 +450,57 @@ R extends Omit<MutationGenqlSelection, "transaction" | "transactionAwaitable"> &
);
fs.writeFileSync(
indexJsPath,
`export * from "${path.relative(
basehubModulePath,
path.join(basehubOutputPath, "index.js")
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
path.join(basehubOutputPath, "index.js")
)}";`
)
);
fs.writeFileSync(
indexDtsPath,
`export * from "${path.relative(
basehubModulePath,
generatedMainExportPath
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
generatedMainExportPath
)}";`
)
);
fs.writeFileSync(
reactPumpIndexJsPath,
`export * from "${path.relative(
basehubModulePath,
path.join(reactPumpOutDir, "index.js")
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
path.join(reactPumpOutDir, "index.js")
)}";`
)
);
fs.writeFileSync(
reactPumpIndexDtsPath,
`export * from "${path.relative(
basehubModulePath,
path.join(reactPumpOutDir, "index.d.ts")
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
path.join(reactPumpOutDir, "index.d.ts")
)}";`
)
);
fs.writeFileSync(
nextToolbarIndexJsPath,
`export * from "${path.relative(
basehubModulePath,
path.join(nextToolbarOutDir, "index.js")
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
path.join(nextToolbarOutDir, "index.js")
)}";`
)
);
fs.writeFileSync(
nextToolbarIndexDtsPath,
`export * from "${path.relative(
basehubModulePath,
path.join(nextToolbarOutDir, "index.d.ts")
)}";`
ensureCrossPlatformTsImport(
`export * from "${path.relative(
basehubModulePath,
path.join(nextToolbarOutDir, "index.d.ts")
)}";`
)
);

if (args["--debug"]) {
Expand Down
4 changes: 4 additions & 0 deletions packages/basehub/src/bin/util/cross-platform-ts-imports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const ensureCrossPlatformTsImport = (statement: string) => {
// make sure paths created by powershell, with backslashes, are converted to forward slashes
return statement.replace(/\\/g, "/");
};
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.155

### Patch Changes

- Updated dependencies
- [email protected]

## 0.0.154

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

0 comments on commit 48b3a65

Please sign in to comment.