Michael Bromley b3d8ad0ece chore: Publish v3.5.3 3 dní pred
..
.storybook 3af21d5486 chore: Update github org name in links 3 týždňov pred
plugin 0eaf1e7390 feat(docs): Migrate documentation to @vendure/docs package (#4124) 5 dní pred
public f24f14e7aa feat(dashboard): Set up login/authenticated routes 11 mesiacov pred
scripts f07fee7d29 fix(dashboard): Fix usePaginatedList context duplication in extensions (#4164) 6 dní pred
src 58a7e4df90 fix(dashboard): Boolean fields in DetailPage now show correct value (#4186) 3 dní pred
vite 0934924aab fix(dashboard): Support Bun package manager in plugin discovery (#4183) 4 dní pred
.gitignore b336df418c chore(dashboard): Fix typescript compiler errors (#3996) 1 mesiac pred
.npmignore aded6e4c52 chore(dashboard): Do not package stories 3 mesiacov pred
CLAUDE.md f07fee7d29 fix(dashboard): Fix usePaginatedList context duplication in extensions (#4164) 6 dní pred
README.md 6c85b28e92 feat(dashboard): Full localization for 25 languages (#3847) 4 mesiacov pred
components.json 28b3405837 chore(dashboard): Add missing shadcn components (#3685) 6 mesiacov pred
eslint.config.js dcf8516f69 feat(dashboard): Add storybook app for dashboard components (#3879) 3 mesiacov pred
index.html cb0463d60b feat(dashboard): Implement meta title based on breadcrumb (#3834) 4 mesiacov pred
lingui.config.js 090db23464 feat(dashboard): Add Bulgarian (bg) translation for the Dashboard (#4001) 1 mesiac pred
missing-translations.txt e72f822af8 fix(dashboard): Clarify draft order completion UX (#4163) 4 dní pred
package.json b3d8ad0ece chore: Publish v3.5.3 3 dní pred
sample-vendure-config.ts 134fa381a0 fix(dashboard): Fix various build issues 10 mesiacov pred
tsconfig.check.json b336df418c chore(dashboard): Fix typescript compiler errors (#3996) 1 mesiac pred
tsconfig.json a3d7f05ba8 fix(dashboard): Use dedicated @/vdb alias for imports (#3631) 7 mesiacov pred
tsconfig.lib.json 7cc6ff2dd9 fix(dashboard): Fix TS errors and packaging issues 10 mesiacov pred
tsconfig.plugin.json 49d449f18a feat(dashboard): Add DashboardPlugin as part of dashboard package (#3711) 6 mesiacov pred
tsconfig.storybook.json dcf8516f69 feat(dashboard): Add storybook app for dashboard components (#3879) 3 mesiacov pred
tsconfig.vite.json 49d449f18a feat(dashboard): Add DashboardPlugin as part of dashboard package (#3711) 6 mesiacov pred
vercel.json 6b21954dd1 chore(dashboard): Fix storybook deploy config (#3880) 3 mesiacov pred
vite.config.mts 12ef58a5e7 chore(dashboard): Fix storybook deployment 3 mesiacov pred
vitest.shims.d.ts dcf8516f69 feat(dashboard): Add storybook app for dashboard components (#3879) 3 mesiacov pred

README.md

Vendure Dashboard

This is a React-based admin dashboard for Vendure. It is a standalone application that can be extended to suit the needs of any Vendure project.

The package consists of three main components:

  • @vendure/dashboard: Dashboard source code
  • @vendure/dashboard/vite: A Vite plugin that is used to compile the dashboard in your project
  • @vendure/dashboard/plugin: A Vendure plugin that provides backend functionality used by the dashboard app.

DashboardPlugin

Basic usage - serving the Dashboard UI

import { DashboardPlugin } from '@vendure/dashboard-plugin';

const config: VendureConfig = {
  // Add an instance of the plugin to the plugins array
  plugins: [
    DashboardPlugin.init({ route: 'dashboard' }),
  ],
};

The Dashboard UI will be served at the /dashboard/ path.

Using only the metrics API

If you are building a stand-alone version of the Dashboard UI app and don't need this plugin to serve the Dashboard UI, you can still use the metricSummary query by adding the DashboardPlugin to the plugins array without calling the init() method:

import { DashboardPlugin } from '@vendure/dashboard-plugin';

const config: VendureConfig = {
  plugins: [
    DashboardPlugin, // <-- no call to .init()
  ],
  // ...
};

Custom Dashboard UI build

You can also provide a custom build of the Dashboard UI:

import { DashboardPlugin } from '@vendure/dashboard-plugin';

const config: VendureConfig = {
  plugins: [
    DashboardPlugin.init({ 
      route: 'dashboard',
      app: path.join(__dirname, 'custom-dashboard-build'),
    }),
  ],
};

API

DashboardPluginOptions

  • route: string - The route at which the Dashboard UI will be served (default: 'dashboard')
  • app?: string - Optional path to a custom build of the Dashboard UI

Development

Run npx vite to start Vite in dev mode.

Note on internal @/vdb imports

You will notice that the dashboard uses internal Vendure Dashboard imports prefixed with @/vdb. This is adapted from the convention of Shadcn which uses a @/* path alias for internal imports.

Why not just use relative imports?

The problem with using relative imports is that they are handled differently by Vite when compiling the dashboard. This manifests as things like React Context not working correctly. The underlying reason is that Vite will selectively pre-compile source code and mixing the imports between alias and relative can result in 2 "versions" of the same code being loaded, which causes issues with React Context and other things that rely on a single instance of a module.

For this reason, try to use the @/vdb alias for all internal Vendure Dashboard imports to the "src/lib" directory.

This is especially import for hooks (since many of them use React Context) and there is even a pre-commit hook that will run a script to ensure that you are not using relative imports for internal Vendure Dashboard code.

Type Safety for Consumers

Because we ship source code in the npm package, consumers need to tell TypeScript how to resolve these internal imports by adding the path alias to their tsconfig.json file.

{
    "compilerOptions": {
        "paths": {
            "@/vdb/*": [
                "./node_modules/@vendure/dashboard/src/lib/*"
            ]
        }
    }
}

Note: even without that path alias, the vite compilation will still work, but TypeScript types will not resolve correctly when developing dashboard extensions.

Testing

Run npm run test to run tests once, or npx vitest to run tests in watch mode

Translations

See ./scripts/translate/README.md