@vendure/dashboard 3.3.7-master-202507150240 → 3.3.7

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.
@@ -164,7 +164,11 @@ export async function analyzeSourceFiles(vendureConfigPath, logger, transformTsC
164
164
  importPath + '.js',
165
165
  path.join(importPath, 'index.ts'),
166
166
  path.join(importPath, 'index.js'),
167
+ importPath,
167
168
  ];
169
+ if (importPath.endsWith('.js')) {
170
+ possiblePaths.push(importPath.replace(/.js$/, '.ts'));
171
+ }
168
172
  // Try each possible path
169
173
  let found = false;
170
174
  for (const possiblePath of possiblePaths) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.3.7-master-202507150240",
4
+ "version": "3.3.7",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -86,8 +86,8 @@
86
86
  "@types/react-dom": "^19.0.4",
87
87
  "@types/react-grid-layout": "^1.3.5",
88
88
  "@uidotdev/usehooks": "^2.4.1",
89
- "@vendure/common": "^3.3.7-master-202507150240",
90
- "@vendure/core": "^3.3.7-master-202507150240",
89
+ "@vendure/common": "3.3.7",
90
+ "@vendure/core": "3.3.7",
91
91
  "@vitejs/plugin-react": "^4.3.4",
92
92
  "acorn": "^8.11.3",
93
93
  "acorn-walk": "^8.3.2",
@@ -133,5 +133,5 @@
133
133
  "lightningcss-linux-arm64-musl": "^1.29.3",
134
134
  "lightningcss-linux-x64-musl": "^1.29.1"
135
135
  },
136
- "gitHead": "19432a9b2417187f80bd226d31f933ec4c0a7703"
136
+ "gitHead": "475eb918c9fc95de41e26f91f8eec39cfeeb6dd7"
137
137
  }
@@ -0,0 +1 @@
1
+ export * from './src/js-aliased.plugin';
@@ -5,4 +5,4 @@ import { PluginCommonModule, VendurePlugin } from '@vendure/core';
5
5
  providers: [],
6
6
  dashboard: './dashboard/index.tsx',
7
7
  })
8
- export class AliasedPlugin {}
8
+ export class JsAliasedPlugin {}
@@ -0,0 +1 @@
1
+ export * from './src/star-aliased.plugin';
@@ -0,0 +1,8 @@
1
+ import { PluginCommonModule, VendurePlugin } from '@vendure/core';
2
+
3
+ @VendurePlugin({
4
+ imports: [PluginCommonModule],
5
+ providers: [],
6
+ dashboard: './dashboard/index.tsx',
7
+ })
8
+ export class StarAliasedPlugin {}
@@ -0,0 +1 @@
1
+ export * from './src/ts-aliased.plugin';
@@ -0,0 +1,8 @@
1
+ import { PluginCommonModule, VendurePlugin } from '@vendure/core';
2
+
3
+ @VendurePlugin({
4
+ imports: [PluginCommonModule],
5
+ providers: [],
6
+ dashboard: './dashboard/index.tsx',
7
+ })
8
+ export class TsAliasedPlugin {}
@@ -1,7 +1,8 @@
1
+ import { JsAliasedPlugin } from '@other/js-aliased';
2
+ import { TsAliasedPlugin } from '@other/ts-aliased';
3
+ import { StarAliasedPlugin } from '@plugins/star-aliased';
1
4
  import { VendureConfig } from '@vendure/core';
2
5
 
3
- import { AliasedPlugin } from './aliased-plugin';
4
-
5
6
  export const config: VendureConfig = {
6
7
  apiOptions: {
7
8
  port: 3000,
@@ -15,5 +16,5 @@ export const config: VendureConfig = {
15
16
  paymentOptions: {
16
17
  paymentMethodHandlers: [],
17
18
  },
18
- plugins: [AliasedPlugin],
19
+ plugins: [StarAliasedPlugin, TsAliasedPlugin, JsAliasedPlugin],
19
20
  };
@@ -16,17 +16,45 @@ describe('detecting plugins using tsconfig path aliases', () => {
16
16
  outputPath: tempDir,
17
17
  vendureConfigPath: join(__dirname, 'fixtures-path-alias', 'vendure-config.ts'),
18
18
  logger: process.env.LOG ? debugLogger : noopLogger,
19
+ pathAdapter: {
20
+ transformTsConfigPathMappings: ({ phase, patterns }) => {
21
+ if (phase === 'loading') {
22
+ return patterns.map(pattern => {
23
+ return pattern.replace(/\/fixtures-path-alias/, '').replace(/.ts$/, '.js');
24
+ });
25
+ } else {
26
+ return patterns;
27
+ }
28
+ },
29
+ },
19
30
  });
20
31
 
21
- expect(result.pluginInfo).toHaveLength(1);
22
- expect(result.pluginInfo[0].name).toBe('AliasedPlugin');
23
- expect(result.pluginInfo[0].dashboardEntryPath).toBe('./dashboard/index.tsx');
24
- expect(result.pluginInfo[0].sourcePluginPath).toBe(
25
- join(__dirname, 'fixtures-path-alias', 'aliased-plugin', 'src', 'aliased.plugin.ts'),
32
+ const plugins = result.pluginInfo.sort((a, b) => a.name.localeCompare(b.name));
33
+
34
+ expect(plugins).toHaveLength(3);
35
+
36
+ expect(plugins[0].name).toBe('JsAliasedPlugin');
37
+ expect(plugins[0].dashboardEntryPath).toBe('./dashboard/index.tsx');
38
+ expect(plugins[0].sourcePluginPath).toBe(
39
+ join(__dirname, 'fixtures-path-alias', 'js-aliased', 'src', 'js-aliased.plugin.ts'),
40
+ );
41
+ expect(plugins[0].pluginPath).toBe(join(tempDir, 'js-aliased', 'src', 'js-aliased.plugin.js'));
42
+
43
+ expect(plugins[1].name).toBe('StarAliasedPlugin');
44
+ expect(plugins[1].dashboardEntryPath).toBe('./dashboard/index.tsx');
45
+ expect(plugins[1].sourcePluginPath).toBe(
46
+ join(__dirname, 'fixtures-path-alias', 'star-aliased', 'src', 'star-aliased.plugin.ts'),
47
+ );
48
+ expect(plugins[1].pluginPath).toBe(
49
+ join(tempDir, 'star-aliased', 'src', 'star-aliased.plugin.js'),
26
50
  );
27
- expect(result.pluginInfo[0].pluginPath).toBe(
28
- join(tempDir, 'aliased-plugin', 'src', 'aliased.plugin.js'),
51
+
52
+ expect(plugins[2].name).toBe('TsAliasedPlugin');
53
+ expect(plugins[2].dashboardEntryPath).toBe('./dashboard/index.tsx');
54
+ expect(plugins[2].sourcePluginPath).toBe(
55
+ join(__dirname, 'fixtures-path-alias', 'ts-aliased', 'src', 'ts-aliased.plugin.ts'),
29
56
  );
57
+ expect(plugins[2].pluginPath).toBe(join(tempDir, 'ts-aliased', 'src', 'ts-aliased.plugin.js'));
30
58
  },
31
59
  { timeout: 10_000 },
32
60
  );
@@ -1,11 +1,21 @@
1
1
  {
2
- "compilerOptions": {
3
- "module": "NodeNext",
4
- "sourceMap": true,
5
- "jsx": "react-jsx",
6
- "paths": {
7
- "@plugins/*": ["./fixtures-path-alias/*"]
8
- }
9
- },
10
- "exclude": ["node_modules"]
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "sourceMap": true,
5
+ "jsx": "react-jsx",
6
+ "paths": {
7
+ "@plugins/*": [
8
+ "./fixtures-path-alias/*"
9
+ ],
10
+ "@other/ts-aliased": [
11
+ "./fixtures-path-alias/ts-aliased/index.ts"
12
+ ],
13
+ "@other/js-aliased": [
14
+ "./fixtures-path-alias/js-aliased/index.js"
15
+ ]
16
+ }
17
+ },
18
+ "exclude": [
19
+ "node_modules"
20
+ ]
11
21
  }
@@ -232,8 +232,11 @@ export async function analyzeSourceFiles(
232
232
  importPath + '.js',
233
233
  path.join(importPath, 'index.ts'),
234
234
  path.join(importPath, 'index.js'),
235
+ importPath,
235
236
  ];
236
-
237
+ if (importPath.endsWith('.js')) {
238
+ possiblePaths.push(importPath.replace(/.js$/, '.ts'));
239
+ }
237
240
  // Try each possible path
238
241
  let found = false;
239
242
  for (const possiblePath of possiblePaths) {
@@ -1 +0,0 @@
1
- export * from './src/aliased.plugin';