@onexapis/cli 1.1.14 → 1.1.15

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/dist/cli.js CHANGED
@@ -3935,6 +3935,18 @@ function createDevServer(options) {
3935
3935
  serveFile(res, options.previewRuntimePath);
3936
3936
  return;
3937
3937
  }
3938
+ if (pathname.startsWith("/_assets/")) {
3939
+ const parts = pathname.replace(/^\/_assets\//, "").split("/");
3940
+ const assetSubpath = parts.slice(1).join("/");
3941
+ const assetPath = path8__default.default.join(options.themePath, "assets", assetSubpath);
3942
+ if (!assetPath.startsWith(path8__default.default.join(options.themePath, "assets"))) {
3943
+ res.writeHead(403);
3944
+ res.end("Forbidden");
3945
+ return;
3946
+ }
3947
+ serveFile(res, assetPath);
3948
+ return;
3949
+ }
3938
3950
  const filePath = path8__default.default.join(options.distDir, pathname);
3939
3951
  if (!filePath.startsWith(options.distDir)) {
3940
3952
  res.writeHead(403);
@@ -3996,32 +4008,10 @@ function generatePreviewHTML(themeName, port) {
3996
4008
  <!-- Tailwind CSS Play CDN \u2014 JIT compilation in browser for dev preview -->
3997
4009
  <script src="https://cdn.tailwindcss.com"></script>
3998
4010
  <style>
3999
- #onex-dev-toolbar {
4000
- position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
4001
- height: 40px; background: #1a1a2e; color: #e0e0e0;
4002
- display: flex; align-items: center; padding: 0 16px; gap: 16px;
4003
- font-family: system-ui; font-size: 13px;
4004
- border-bottom: 2px solid #16213e;
4005
- }
4006
- #onex-dev-toolbar .status { width: 8px; height: 8px; border-radius: 50%; }
4007
- #onex-dev-toolbar .status.connected { background: #00ff88; }
4008
- #onex-dev-toolbar .status.disconnected { background: #ff4444; }
4009
- #onex-dev-toolbar .status.rebuilding { background: #ffaa00; animation: pulse 0.5s infinite; }
4010
- @keyframes pulse { 50% { opacity: 0.5; } }
4011
- #onex-preview-root { margin-top: 40px; }
4011
+ #onex-preview-root { margin-top: 0; }
4012
4012
  </style>
4013
4013
  </head>
4014
4014
  <body>
4015
- <div id="onex-dev-toolbar">
4016
- <span style="font-weight:600;">OneX Dev</span>
4017
- <span style="color:#888;">|</span>
4018
- <span>${themeName}</span>
4019
- <span style="color:#888;">|</span>
4020
- <span id="page-indicator">Home</span>
4021
- <span style="color:#888;">|</span>
4022
- <span class="status connected" id="ws-status"></span>
4023
- <span id="ws-label">Connected</span>
4024
- </div>
4025
4015
  <div id="onex-preview-root"></div>
4026
4016
  <script type="module" src="/preview-runtime.js"></script>
4027
4017
  </body>
@@ -4079,7 +4069,8 @@ async function devCommand(options) {
4079
4069
  port,
4080
4070
  distDir: outputDir,
4081
4071
  previewRuntimePath,
4082
- themeName
4072
+ themeName,
4073
+ themePath
4083
4074
  });
4084
4075
  const watcher = chokidar__default.default.watch(
4085
4076
  [