@panomc/theme-core 1.0.0-dev.47 → 1.0.0-dev.48

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.
Files changed (2) hide show
  1. package/bin/theme-core.js +11 -1
  2. package/package.json +6 -1
package/bin/theme-core.js CHANGED
@@ -18,9 +18,19 @@ import { join, dirname } from "node:path";
18
18
  import { fileURLToPath } from "node:url";
19
19
  import { pc, version, DOCS_URL, brandIntro, outro, note } from "./ui.js";
20
20
 
21
- const binDir = dirname(fileURLToPath(import.meta.url));
21
+ let binDir = dirname(fileURLToPath(import.meta.url));
22
22
  const [cmd, ...args] = process.argv.slice(2);
23
23
 
24
+ // Inside a theme, always drive the THEME's own installed engine, not whatever
25
+ // version bunx happened to fetch (a stale `latest` here would desync the CLI
26
+ // from the code the theme actually runs). `new` is exempt — it creates themes.
27
+ {
28
+ const localBin = join(process.cwd(), "node_modules", "@panomc", "theme-core", "bin");
29
+ if (cmd !== "new" && existsSync(join(localBin, "theme-core.js")) && localBin !== binDir) {
30
+ binDir = localBin;
31
+ }
32
+ }
33
+
24
34
  function run(script, extra = []) {
25
35
  const r = spawnSync("bun", [join(binDir, script), ...extra], {
26
36
  stdio: "inherit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panomc/theme-core",
3
- "version": "1.0.0-dev.47",
3
+ "version": "1.0.0-dev.48",
4
4
  "description": "The Pano theme engine: hooks factories, plugin engine, headless page controllers, default views and the theme CLI. Themes depend on this package instead of forking vanilla-theme.",
5
5
  "author": "PanoMC",
6
6
  "license": "MIT",
@@ -78,5 +78,10 @@
78
78
  },
79
79
  "bin": {
80
80
  "theme-core": "./bin/theme-core.js"
81
+ },
82
+ "peerDependenciesMeta": {
83
+ "@panomc/sdk": {
84
+ "optional": true
85
+ }
81
86
  }
82
87
  }