okno 1.0.0-beta.19 → 1.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1018,10 +1018,17 @@ let W9 = class extends St {
1018
1018
  const t = this.currentRepo;
1019
1019
  return t ? `${t.owner}/${t.repo}@${t.branch}` : null;
1020
1020
  }
1021
- /** X-Okno-Path header — the monorepo subdir. Null (header omitted) at the
1022
- * repo root so single-project repos send exactly what they did before. */
1021
+ /** X-Okno-Path header — the monorepo subdir. The baked path describes the
1022
+ * build's OWN project (bakedRepo), so it's only valid while the editor targets
1023
+ * that repo. If the user switched to (or the editor auto-picked) a DIFFERENT
1024
+ * repo, the baked path is meaningless there — send nothing (repo root), or a
1025
+ * request would read/scaffold `<baked-subdir>/okno` inside the wrong repo (the
1026
+ * bug that scaffolded a stray root `okno/` into okno-test). Null → header
1027
+ * omitted → backend treats it as the repo root. */
1023
1028
  get rootHeader() {
1024
- return this.bakedRoot || null;
1029
+ if (!this.bakedRoot) return null;
1030
+ const t = this.bakedRepo, r = this.currentRepo;
1031
+ return !t || !r ? null : t.owner === r.owner && t.repo === r.repo ? this.bakedRoot : null;
1025
1032
  }
1026
1033
  /** Base URL for CONTENT-engine calls (content/schema/files/publish). In dev
1027
1034
  * these hit the Vite plugin's local engine (disk + git, no backend); in
@@ -41528,8 +41535,11 @@ class LT {
41528
41535
  try {
41529
41536
  if (this.project.isDev && await this.deriveDevRepo())
41530
41537
  return await this.refresh(), await this.dispatchAfterStatus();
41531
- if (this.project.currentRepo)
41532
- return await this.refresh(), await this.dispatchAfterStatus();
41538
+ if (this.project.currentRepo) {
41539
+ await this.refresh();
41540
+ const n = this.project.bakedRepo, i = this.project.currentRepo;
41541
+ return !this.setup.hasInstallation && n && !(n.owner === i.owner && n.repo === i.repo) && (this.project.setCurrentRepo(n), await this.refresh()), await this.dispatchAfterStatus();
41542
+ }
41533
41543
  if (this.project.bakedRepo)
41534
41544
  return this.project.setCurrentRepo(this.project.bakedRepo), await this.refresh(), await this.dispatchAfterStatus();
41535
41545
  await this.fetchInstallations();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "okno",
3
3
  "description": "Git-backed CMS with live editing for any Vite framework",
4
4
  "author": "Gabriel Uhlíř",
5
- "version": "1.0.0-beta.19",
5
+ "version": "1.0.0-beta.20",
6
6
  "homepage": "https://okno.build",
7
7
  "type": "module",
8
8
  "types": "./dist/index.d.ts",