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

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.
package/bin/new.js CHANGED
@@ -206,9 +206,9 @@ export default {
206
206
  dev: "vite dev --host=0.0.0.0 --port 3000",
207
207
  "dev:ui": 'concurrently "bun run watch:ui" "bun run dev"',
208
208
  "watch:ui":
209
- "sass src/styles/style.scss static/style.css --watch --load-path=. --load-path=node_modules --quiet-deps --no-source-map",
209
+ "sass src/styles/style.scss static/style.css --watch --load-path=. --load-path=node_modules --quiet-deps --silence-deprecation=import --no-source-map",
210
210
  "build:ui":
211
- "sass src/styles/style.scss static/style.css --load-path=. --load-path=node_modules --quiet-deps --no-source-map",
211
+ "sass src/styles/style.scss static/style.css --load-path=. --load-path=node_modules --quiet-deps --silence-deprecation=import --no-source-map",
212
212
  sync: "bun node_modules/@panomc/theme-core/bin/sync.js",
213
213
  check: "bun node_modules/@panomc/theme-core/bin/check.js",
214
214
  prebuild:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panomc/theme-core",
3
- "version": "1.0.0-dev.48",
3
+ "version": "1.0.0-dev.49",
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",
@@ -181,19 +181,6 @@ export function createViteConfig(opts = {}) {
181
181
  "svelte",
182
182
  ...(opts.extraOptimizeExclude ?? []),
183
183
  ],
184
- // When the engine is a real node_modules install (registry, not a
185
- // file:/workspace link), vite's dependency scanner cannot resolve the
186
- // engine's .svelte glob imports and aborts with a scary "Failed to run
187
- // dependency scan" wall of errors. The scan is only a warm-up — skip
188
- // it there; the `include` list above is still pre-bundled.
189
- ...(function () {
190
- try {
191
- const p = path.join(process.cwd(), "node_modules", "@panomc", "theme-core");
192
- return fs.existsSync(p) && !fs.lstatSync(p).isSymbolicLink() ? { entries: [] } : {};
193
- } catch {
194
- return {};
195
- }
196
- })(),
197
184
  },
198
185
  server: {
199
186
  proxy: {
@@ -47,13 +47,26 @@
47
47
  import { hasPermission } from "$pano/lib/auth.util.js";
48
48
 
49
49
 
50
- const layouts = import.meta.glob('$pano/lib/layouts/*.svelte', { eager: true });
51
-
52
- const layoutMap = Object.keys(layouts).reduce((acc, path) => {
53
- const name = path.split('/').pop().replace('.svelte', '');
54
- acc[name] = layouts[path];
55
- return acc;
56
- }, {});
50
+ // Static imports instead of import.meta.glob: the glob's transform emits
51
+ // relative specifiers that vite's dependency scanner cannot resolve when the
52
+ // engine is a registry install, killing pre-bundling with a wall of
53
+ // UNRESOLVED_IMPORT errors on every fresh theme. The layout set is part of
54
+ // the theme contract, so enumerating it is safe.
55
+ import * as AppLayout from "$pano/lib/layouts/AppLayout.svelte";
56
+ import * as AuthLayout from "$pano/lib/layouts/AuthLayout.svelte";
57
+ import * as MainLayout from "$pano/lib/layouts/MainLayout.svelte";
58
+ import * as ProfileLayout from "$pano/lib/layouts/ProfileLayout.svelte";
59
+ import * as ThemeSettingsLayout from "$pano/lib/layouts/ThemeSettingsLayout.svelte";
60
+ import * as TicketsLayout from "$pano/lib/layouts/TicketsLayout.svelte";
61
+
62
+ const layoutMap = {
63
+ AppLayout,
64
+ AuthLayout,
65
+ MainLayout,
66
+ ProfileLayout,
67
+ ThemeSettingsLayout,
68
+ TicketsLayout,
69
+ };
57
70
 
58
71
  function removePrefix(str, prefix) {
59
72
  return str.startsWith(prefix) ? str.slice(prefix.length) : str;