@kitledger/admin 0.0.1 → 0.0.2

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.
@@ -4,7 +4,7 @@ import { StaticUIConfig } from '@kitledger/core/ui';
4
4
  */
5
5
  export interface AdminUIOptions {
6
6
  serverPath: string;
7
- basePath?: string;
7
+ basePath: string;
8
8
  title?: string;
9
9
  }
10
10
  export declare function defineAdminUI(options: AdminUIOptions): StaticUIConfig;
@@ -14,8 +14,9 @@ const DIST_PATH = path.resolve(__dirname, '../dist');
14
14
  const assetsPath = relative(process.cwd(), DIST_PATH);
15
15
  export function defineAdminUI(options) {
16
16
  return {
17
- path: options.basePath || '/admin',
17
+ serverPath: options.serverPath,
18
18
  htmlContent: getAdminHtmlContent(options),
19
+ basePath: options.basePath || '/admin',
19
20
  assetsPath: assetsPath
20
21
  };
21
22
  }
@@ -29,9 +30,9 @@ function getAdminHtmlContent(config) {
29
30
  throw new Error(`Kitledger UI not found at ${htmlPath}.`);
30
31
  }
31
32
  let html = fs.readFileSync(htmlPath, 'utf-8');
32
- const safeBase = config.basePath?.endsWith('/')
33
+ const safeBase = config.basePath.endsWith('/')
33
34
  ? config.basePath
34
- : `${config.basePath || ''}/`;
35
+ : `${config.basePath}/`;
35
36
  const injection = `
36
37
  <base href="${safeBase}" />
37
38
  <script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kitledger/admin",
3
3
  "license": "Apache-2.0",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./dist-package/admin.js",
@@ -30,7 +30,7 @@
30
30
  "globals": "^16.5.0",
31
31
  "typescript": "~5.9.3",
32
32
  "vite": "npm:rolldown-vite@7.2.5",
33
- "@kitledger/core": "0.0.1"
33
+ "@kitledger/core": "0.0.2"
34
34
  },
35
35
  "scripts": {
36
36
  "dev": "vite",