@vendure/dashboard 3.3.6-master-202507110238 → 3.3.6

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 (68) hide show
  1. package/dist/plugin/types.d.ts +40 -0
  2. package/dist/plugin/utils/ast-utils.d.ts +0 -5
  3. package/dist/plugin/utils/ast-utils.js +0 -67
  4. package/dist/plugin/utils/ast-utils.spec.js +1 -76
  5. package/dist/plugin/utils/compiler.d.ts +22 -0
  6. package/dist/plugin/utils/compiler.js +162 -0
  7. package/dist/plugin/utils/config-loader.d.ts +0 -120
  8. package/dist/plugin/utils/config-loader.js +1 -367
  9. package/dist/plugin/utils/logger.d.ts +3 -0
  10. package/dist/plugin/utils/logger.js +39 -0
  11. package/dist/plugin/utils/plugin-discovery.d.ts +27 -0
  12. package/dist/plugin/utils/plugin-discovery.js +343 -0
  13. package/dist/plugin/utils/tsconfig-utils.d.ts +9 -0
  14. package/dist/plugin/utils/tsconfig-utils.js +50 -0
  15. package/dist/plugin/vite-plugin-config-loader.d.ts +3 -3
  16. package/dist/plugin/vite-plugin-config-loader.js +13 -13
  17. package/dist/plugin/vite-plugin-dashboard-metadata.js +19 -2
  18. package/dist/plugin/vite-plugin-vendure-dashboard.d.ts +7 -7
  19. package/dist/plugin/vite-plugin-vendure-dashboard.js +2 -2
  20. package/package.json +134 -131
  21. package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +0 -1
  22. package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +6 -2
  23. package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +2 -2
  24. package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +0 -1
  25. package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +1 -1
  26. package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +0 -7
  27. package/src/lib/components/layout/content-language-selector.tsx +1 -1
  28. package/src/lib/components/shared/asset/asset-preview.tsx +0 -6
  29. package/src/lib/components/shared/option-value-input.tsx +1 -1
  30. package/src/lib/components/shared/product-variant-selector.tsx +1 -1
  31. package/src/lib/components/ui/calendar.tsx +1 -1
  32. package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +1 -1
  33. package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +0 -2
  34. package/src/lib/hooks/use-extended-list-query.ts +32 -30
  35. package/vite/tests/barrel-exports.spec.ts +13 -4
  36. package/{dist/plugin/tests/barrel-exports/my-plugin/src/my.plugin.js → vite/tests/fixtures-npm-plugin/fake_node_modules/test-plugin/index.js} +6 -6
  37. package/vite/tests/fixtures-npm-plugin/fake_node_modules/test-plugin/package.json +8 -0
  38. package/vite/tests/fixtures-npm-plugin/package.json +6 -0
  39. package/{dist/plugin/tests/barrel-exports/vendure-config.js → vite/tests/fixtures-npm-plugin/vendure-config.ts} +5 -6
  40. package/vite/tests/fixtures-path-alias/aliased-plugin/index.ts +1 -0
  41. package/vite/tests/fixtures-path-alias/aliased-plugin/src/aliased.plugin.ts +8 -0
  42. package/vite/tests/fixtures-path-alias/package.json +6 -0
  43. package/vite/tests/fixtures-path-alias/vendure-config.ts +19 -0
  44. package/vite/tests/npm-plugin.spec.ts +46 -0
  45. package/vite/tests/path-alias.spec.ts +33 -0
  46. package/vite/tests/tsconfig.json +11 -0
  47. package/vite/types.ts +44 -0
  48. package/vite/utils/ast-utils.spec.ts +1 -80
  49. package/vite/utils/ast-utils.ts +0 -86
  50. package/vite/utils/compiler.ts +244 -0
  51. package/vite/utils/config-loader.ts +0 -555
  52. package/vite/utils/logger.ts +43 -0
  53. package/vite/utils/plugin-discovery.ts +442 -0
  54. package/vite/utils/tsconfig-utils.ts +79 -0
  55. package/vite/vite-plugin-config-loader.ts +20 -17
  56. package/vite/vite-plugin-dashboard-metadata.ts +26 -7
  57. package/vite/vite-plugin-tailwind-source.ts +2 -2
  58. package/vite/vite-plugin-vendure-dashboard.ts +9 -9
  59. package/dist/plugin/tests/barrel-exports/my-plugin/index.d.ts +0 -1
  60. package/dist/plugin/tests/barrel-exports/my-plugin/index.js +0 -17
  61. package/dist/plugin/tests/barrel-exports/my-plugin/src/my.plugin.d.ts +0 -2
  62. package/dist/plugin/tests/barrel-exports/vendure-config.d.ts +0 -2
  63. package/dist/plugin/tests/barrel-exports.spec.js +0 -14
  64. /package/dist/plugin/{tests/barrel-exports.spec.d.ts → types.js} +0 -0
  65. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/my-plugin/index.ts +0 -0
  66. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/my-plugin/src/my.plugin.ts +0 -0
  67. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/package.json +0 -0
  68. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/vendure-config.ts +0 -0
@@ -4,7 +4,8 @@ import react from '@vitejs/plugin-react';
4
4
  import path from 'path';
5
5
  import { PluginOption } from 'vite';
6
6
 
7
- import { PathAdapter } from './utils/config-loader.js';
7
+ import { PathAdapter } from './types.js';
8
+ import { PackageScannerConfig } from './utils/compiler.js';
8
9
  import { adminApiSchemaPlugin } from './vite-plugin-admin-api-schema.js';
9
10
  import { configLoaderPlugin } from './vite-plugin-config-loader.js';
10
11
  import { viteConfigPlugin } from './vite-plugin-config.js';
@@ -67,7 +68,7 @@ export type VitePluginVendureDashboardOptions = {
67
68
  pathAdapter?: PathAdapter;
68
69
  /**
69
70
  * @description
70
- * The name of the exported variable from the Vendure server configuration file.
71
+ * The name of the exported variable from the Vendure server configuration file, e.g. `config`.
71
72
  * This is only required if the plugin is unable to auto-detect the name of the exported variable.
72
73
  */
73
74
  vendureConfigExport?: string;
@@ -80,12 +81,11 @@ export type VitePluginVendureDashboardOptions = {
80
81
  disableTansStackRouterPlugin?: boolean;
81
82
  /**
82
83
  * @description
83
- * If set to `true`, compilation errors during the build process will be reported and
84
- * the build will fail.
85
- *
86
- * @default false
84
+ * Allows you to customize the location of node_modules & glob patterns used to scan for potential
85
+ * Vendure plugins installed as npm packages. If not provided, the compiler will attempt to guess
86
+ * the location based on the location of the `@vendure/core` package.
87
87
  */
88
- reportCompilationErrors?: boolean;
88
+ pluginPackageScanner?: PackageScannerConfig;
89
89
  } & UiConfigPluginOptions &
90
90
  ThemeVariablesPluginOptions;
91
91
 
@@ -126,9 +126,9 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
126
126
  tailwindcss(),
127
127
  configLoaderPlugin({
128
128
  vendureConfigPath: normalizedVendureConfigPath,
129
- tempDir,
130
- reportCompilationErrors: options.reportCompilationErrors,
129
+ outputPath: tempDir,
131
130
  pathAdapter: options.pathAdapter,
131
+ pluginPackageScanner: options.pluginPackageScanner,
132
132
  }),
133
133
  viteConfigPlugin({ packageRoot }),
134
134
  adminApiSchemaPlugin(),
@@ -1 +0,0 @@
1
- export * from './src/my.plugin';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./src/my.plugin"), exports);
@@ -1,2 +0,0 @@
1
- export declare class MyPlugin {
2
- }
@@ -1,2 +0,0 @@
1
- import { VendureConfig } from '@vendure/core';
2
- export declare const config: VendureConfig;
@@ -1,14 +0,0 @@
1
- import { join } from 'node:path';
2
- import { describe, expect, it } from 'vitest';
3
- import { loadVendureConfig } from '../utils/config-loader.js';
4
- describe('detecting plugins in barrel exports', () => {
5
- it('should detect plugins in barrel exports', async () => {
6
- const result = await loadVendureConfig({
7
- tempDir: join(__dirname, './__temp'),
8
- vendureConfigPath: join(__dirname, 'barrel-exports', 'vendure-config.ts'),
9
- });
10
- expect(result.pluginInfo).toHaveLength(1);
11
- expect(result.pluginInfo[0].name).toBe('MyPlugin');
12
- expect(result.pluginInfo[0].dashboardEntryPath).toBe('./dashboard/index.tsx');
13
- }, { timeout: 10000 });
14
- });