@vendure/dashboard 3.3.6-master-202507120238 → 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 (54) 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/vite/tests/barrel-exports.spec.ts +13 -4
  22. 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
  23. package/vite/tests/fixtures-npm-plugin/fake_node_modules/test-plugin/package.json +8 -0
  24. package/vite/tests/fixtures-npm-plugin/package.json +6 -0
  25. package/{dist/plugin/tests/barrel-exports/vendure-config.js → vite/tests/fixtures-npm-plugin/vendure-config.ts} +5 -6
  26. package/vite/tests/fixtures-path-alias/aliased-plugin/index.ts +1 -0
  27. package/vite/tests/fixtures-path-alias/aliased-plugin/src/aliased.plugin.ts +8 -0
  28. package/vite/tests/fixtures-path-alias/package.json +6 -0
  29. package/vite/tests/fixtures-path-alias/vendure-config.ts +19 -0
  30. package/vite/tests/npm-plugin.spec.ts +46 -0
  31. package/vite/tests/path-alias.spec.ts +33 -0
  32. package/vite/tests/tsconfig.json +11 -0
  33. package/vite/types.ts +44 -0
  34. package/vite/utils/ast-utils.spec.ts +1 -80
  35. package/vite/utils/ast-utils.ts +0 -86
  36. package/vite/utils/compiler.ts +244 -0
  37. package/vite/utils/config-loader.ts +0 -555
  38. package/vite/utils/logger.ts +43 -0
  39. package/vite/utils/plugin-discovery.ts +442 -0
  40. package/vite/utils/tsconfig-utils.ts +79 -0
  41. package/vite/vite-plugin-config-loader.ts +20 -17
  42. package/vite/vite-plugin-dashboard-metadata.ts +26 -7
  43. package/vite/vite-plugin-tailwind-source.ts +2 -2
  44. package/vite/vite-plugin-vendure-dashboard.ts +9 -9
  45. package/dist/plugin/tests/barrel-exports/my-plugin/index.d.ts +0 -1
  46. package/dist/plugin/tests/barrel-exports/my-plugin/index.js +0 -17
  47. package/dist/plugin/tests/barrel-exports/my-plugin/src/my.plugin.d.ts +0 -2
  48. package/dist/plugin/tests/barrel-exports/vendure-config.d.ts +0 -2
  49. package/dist/plugin/tests/barrel-exports.spec.js +0 -14
  50. /package/dist/plugin/{tests/barrel-exports.spec.d.ts → types.js} +0 -0
  51. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/my-plugin/index.ts +0 -0
  52. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/my-plugin/src/my.plugin.ts +0 -0
  53. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/package.json +0 -0
  54. /package/vite/tests/{barrel-exports → fixtures-barrel-exports}/vendure-config.ts +0 -0
@@ -1,367 +1 @@
1
- import fs from 'fs-extra';
2
- import path from 'path';
3
- import tsConfigPaths from 'tsconfig-paths';
4
- import * as ts from 'typescript';
5
- import { pathToFileURL } from 'url';
6
- import { findConfigExport, getPluginInfo } from './ast-utils.js';
7
- const defaultLogger = {
8
- info: (message) => {
9
- /* noop */
10
- },
11
- warn: (message) => {
12
- /* noop */
13
- },
14
- debug: (message) => {
15
- /* noop */
16
- },
17
- };
18
- const defaultPathAdapter = {
19
- getCompiledConfigPath: ({ outputPath, configFileName }) => path.join(outputPath, configFileName),
20
- transformTsConfigPathMappings: ({ patterns }) => patterns,
21
- };
22
- /**
23
- * @description
24
- * This function compiles the given Vendure config file and any imported relative files (i.e.
25
- * project files, not npm packages) into a temporary directory, and returns the compiled config.
26
- *
27
- * The reason we need to do this is that Vendure code makes use of TypeScript experimental decorators
28
- * (e.g. for NestJS decorators and TypeORM column decorators) which are not supported by esbuild.
29
- *
30
- * In Vite, when we load some TypeScript into the top-level Vite config file (in the end-user project), Vite
31
- * internally uses esbuild to temporarily compile that TypeScript code. Unfortunately, esbuild does not support
32
- * these experimental decorators, errors will be thrown as soon as e.g. a TypeORM column decorator is encountered.
33
- *
34
- * To work around this, we compile the Vendure config file and all its imports using the TypeScript compiler,
35
- * which fully supports these experimental decorators. The compiled files are then loaded by Vite, which is able
36
- * to handle the compiled JavaScript output.
37
- */
38
- export async function loadVendureConfig(options) {
39
- var _a, _b;
40
- const { vendureConfigPath, vendureConfigExport, tempDir, pathAdapter } = options;
41
- const getCompiledConfigPath = (_a = pathAdapter === null || pathAdapter === void 0 ? void 0 : pathAdapter.getCompiledConfigPath) !== null && _a !== void 0 ? _a : defaultPathAdapter.getCompiledConfigPath;
42
- const transformTsConfigPathMappings = (_b = pathAdapter === null || pathAdapter === void 0 ? void 0 : pathAdapter.transformTsConfigPathMappings) !== null && _b !== void 0 ? _b : defaultPathAdapter.transformTsConfigPathMappings;
43
- const logger = options.logger || defaultLogger;
44
- const outputPath = tempDir;
45
- const configFileName = path.basename(vendureConfigPath);
46
- const inputRootDir = path.dirname(vendureConfigPath);
47
- await fs.remove(outputPath);
48
- const pluginInfo = await compileFile({
49
- inputRootDir,
50
- inputPath: vendureConfigPath,
51
- outputDir: outputPath,
52
- logger,
53
- transformTsConfigPathMappings,
54
- });
55
- const compiledConfigFilePath = pathToFileURL(getCompiledConfigPath({
56
- inputRootDir,
57
- outputPath,
58
- configFileName,
59
- })).href.replace(/.ts$/, '.js');
60
- // create package.json with type commonjs and save it to the output dir
61
- await fs.writeFile(path.join(outputPath, 'package.json'), JSON.stringify({ type: 'commonjs' }, null, 2));
62
- // We need to figure out the symbol exported by the config file by
63
- // analyzing the AST and finding an export with the type "VendureConfig"
64
- const sourceFile = ts.createSourceFile(vendureConfigPath, await fs.readFile(vendureConfigPath, 'utf-8'), ts.ScriptTarget.Latest, true);
65
- const detectedExportedSymbolName = findConfigExport(sourceFile);
66
- const configExportedSymbolName = detectedExportedSymbolName || vendureConfigExport;
67
- if (!configExportedSymbolName) {
68
- throw new Error(`Could not find a variable exported as VendureConfig. Please specify the name of the exported variable using the "vendureConfigExport" option.`);
69
- }
70
- // Register path aliases from tsconfig before importing
71
- const tsConfigInfo = await findTsConfigPaths(vendureConfigPath, logger, 'loading', transformTsConfigPathMappings);
72
- if (tsConfigInfo) {
73
- tsConfigPaths.register({
74
- baseUrl: outputPath,
75
- paths: tsConfigInfo.paths,
76
- });
77
- }
78
- const config = await import(compiledConfigFilePath).then(m => m[configExportedSymbolName]);
79
- if (!config) {
80
- throw new Error(`Could not find a variable exported as VendureConfig with the name "${configExportedSymbolName}".`);
81
- }
82
- return { vendureConfig: config, exportedSymbolName: configExportedSymbolName, pluginInfo };
83
- }
84
- /**
85
- * Finds and parses tsconfig files in the given directory and its parent directories.
86
- * Returns the paths configuration if found.
87
- */
88
- async function findTsConfigPaths(configPath, logger, phase, transformTsConfigPathMappings) {
89
- const configDir = path.dirname(configPath);
90
- let currentDir = configDir;
91
- while (currentDir !== path.parse(currentDir).root) {
92
- try {
93
- const files = await fs.readdir(currentDir);
94
- const tsConfigFiles = files.filter(file => /^tsconfig(\..*)?\.json$/.test(file));
95
- for (const fileName of tsConfigFiles) {
96
- const tsConfigPath = path.join(currentDir, fileName);
97
- try {
98
- const tsConfigContent = await fs.readFile(tsConfigPath, 'utf-8');
99
- // Use JSON5 or similar parser if comments are expected in tsconfig.json
100
- // For simplicity, assuming standard JSON here. Handle parse errors.
101
- const tsConfig = JSON.parse(tsConfigContent);
102
- const compilerOptions = tsConfig.compilerOptions || {};
103
- if (compilerOptions.paths) {
104
- // Determine the effective baseUrl: explicitly set or the directory of tsconfig.json
105
- const tsConfigBaseUrl = path.resolve(currentDir, compilerOptions.baseUrl || '.');
106
- const paths = {};
107
- for (const [alias, patterns] of Object.entries(compilerOptions.paths)) {
108
- // Store paths as defined in tsconfig, they will be relative to baseUrl
109
- const normalizedPatterns = patterns.map(pattern =>
110
- // Normalize slashes for consistency, keep relative
111
- pattern.replace(/\\/g, '/'));
112
- paths[alias] = transformTsConfigPathMappings({
113
- phase,
114
- alias,
115
- patterns: normalizedPatterns,
116
- });
117
- }
118
- logger.debug(`Found tsconfig paths in ${tsConfigPath}: ${JSON.stringify({
119
- baseUrl: tsConfigBaseUrl,
120
- paths,
121
- }, null, 2)}`);
122
- return { baseUrl: tsConfigBaseUrl, paths };
123
- }
124
- }
125
- catch (e) {
126
- logger.warn(`Could not read or parse tsconfig file ${tsConfigPath}: ${e.message}`);
127
- }
128
- }
129
- }
130
- catch (e) {
131
- // If we can't read the directory, just continue to the parent
132
- logger.warn(`Could not read directory ${currentDir}: ${e.message}`);
133
- }
134
- currentDir = path.dirname(currentDir);
135
- }
136
- logger.debug(`No tsconfig paths found traversing up from ${configDir}`);
137
- return undefined;
138
- }
139
- export async function compileFile({ inputRootDir, inputPath, outputDir, transformTsConfigPathMappings, logger = defaultLogger, compiledFiles = new Set(), isRoot = true, pluginInfo = [], reportCompilationErrors = false, }) {
140
- const absoluteInputPath = path.resolve(inputPath);
141
- if (compiledFiles.has(absoluteInputPath)) {
142
- return pluginInfo;
143
- }
144
- compiledFiles.add(absoluteInputPath);
145
- // Ensure output directory exists
146
- await fs.ensureDir(outputDir);
147
- // Read the source file
148
- const source = await fs.readFile(inputPath, 'utf-8');
149
- // Parse the source to find relative imports
150
- const sourceFile = ts.createSourceFile(absoluteInputPath, source, ts.ScriptTarget.Latest, true);
151
- const importPaths = new Set();
152
- let tsConfigInfo;
153
- if (isRoot) {
154
- tsConfigInfo = await findTsConfigPaths(absoluteInputPath, logger, 'compiling', transformTsConfigPathMappings);
155
- if (tsConfigInfo) {
156
- logger === null || logger === void 0 ? void 0 : logger.debug(`Using TypeScript configuration: ${JSON.stringify(tsConfigInfo, null, 2)}`);
157
- }
158
- }
159
- async function collectImports(node) {
160
- if ((ts.isExportDeclaration(node) || ts.isImportDeclaration(node)) &&
161
- node.moduleSpecifier &&
162
- ts.isStringLiteral(node.moduleSpecifier)) {
163
- const importPath = node.moduleSpecifier.text;
164
- // Handle relative imports
165
- if (importPath.startsWith('.')) {
166
- const resolvedPath = path.resolve(path.dirname(absoluteInputPath), importPath);
167
- // TODO: does this handle index files correctly?
168
- let resolvedTsPath = resolvedPath + '.ts';
169
- // Also check for .tsx if .ts doesn't exist
170
- if (!(await fs.pathExists(resolvedTsPath))) {
171
- const resolvedTsxPath = resolvedPath + '.tsx';
172
- if (await fs.pathExists(resolvedTsxPath)) {
173
- resolvedTsPath = resolvedTsxPath;
174
- }
175
- else {
176
- // If neither exists, maybe it's an index file?
177
- const resolvedIndexPath = path.join(resolvedPath, 'index.ts');
178
- if (await fs.pathExists(resolvedIndexPath)) {
179
- resolvedTsPath = resolvedIndexPath;
180
- }
181
- else {
182
- const resolvedIndexTsxPath = path.join(resolvedPath, 'index.tsx');
183
- if (await fs.pathExists(resolvedIndexTsxPath)) {
184
- resolvedTsPath = resolvedIndexTsxPath;
185
- }
186
- else {
187
- // If still not found, log a warning or let TS handle it later
188
- logger === null || logger === void 0 ? void 0 : logger.warn(`Could not resolve relative import "${importPath}" from "${absoluteInputPath}" to an existing .ts/.tsx file.`);
189
- // Do not add to importPaths if we can't verify existence
190
- return;
191
- }
192
- }
193
- }
194
- }
195
- importPaths.add(resolvedTsPath);
196
- }
197
- // Handle path aliases if tsConfigInfo exists
198
- else if (tsConfigInfo) {
199
- // Attempt to resolve using path aliases
200
- let resolved = false;
201
- for (const [alias, patterns] of Object.entries(tsConfigInfo.paths)) {
202
- const aliasPrefix = alias.replace(/\*/g, '');
203
- const aliasSuffix = alias.endsWith('*') ? '*' : '';
204
- if (importPath.startsWith(aliasPrefix) &&
205
- (aliasSuffix === '*' || importPath === aliasPrefix)) {
206
- const remainingImportPath = importPath.slice(aliasPrefix.length);
207
- for (const pattern of patterns) {
208
- const patternPrefix = pattern.replace(/\*/g, '');
209
- const patternSuffix = pattern.endsWith('*') ? '*' : '';
210
- // Ensure suffix match consistency (* vs exact)
211
- if (aliasSuffix !== patternSuffix)
212
- continue;
213
- const potentialPathBase = path.resolve(tsConfigInfo.baseUrl, patternPrefix);
214
- const resolvedPath = path.join(potentialPathBase, remainingImportPath);
215
- let resolvedTsPath = resolvedPath.endsWith('.ts')
216
- ? resolvedPath
217
- : resolvedPath + '.ts';
218
- // Similar existence checks as relative paths
219
- if (!(await fs.pathExists(resolvedTsPath))) {
220
- const resolvedTsxPath = resolvedPath + '.tsx';
221
- if (await fs.pathExists(resolvedTsxPath)) {
222
- resolvedTsPath = resolvedTsxPath;
223
- }
224
- else {
225
- const resolvedIndexPath = path.join(resolvedPath, 'index.ts');
226
- if (await fs.pathExists(resolvedIndexPath)) {
227
- resolvedTsPath = resolvedIndexPath;
228
- }
229
- else {
230
- const resolvedIndexTsxPath = path.join(resolvedPath, 'index.tsx');
231
- if (await fs.pathExists(resolvedIndexTsxPath)) {
232
- resolvedTsPath = resolvedIndexTsxPath;
233
- }
234
- else {
235
- // Path doesn't resolve to a file for this pattern
236
- continue;
237
- }
238
- }
239
- }
240
- }
241
- // Add the first successful resolution for this alias
242
- importPaths.add(resolvedTsPath);
243
- resolved = true;
244
- break; // Stop checking patterns for this alias
245
- }
246
- }
247
- if (resolved)
248
- break; // Stop checking other aliases if resolved
249
- }
250
- }
251
- // For all other imports (node_modules, etc), we should still add them to be processed
252
- // by the TypeScript compiler, even if we can't resolve them to a file
253
- else {
254
- // Add the import path as is - TypeScript will handle resolution
255
- // importPaths.add(importPath);
256
- }
257
- }
258
- else {
259
- const children = node.getChildren();
260
- for (const child of children) {
261
- // Only process nodes that could contain import statements
262
- if (ts.isSourceFile(child) ||
263
- ts.isModuleBlock(child) ||
264
- ts.isModuleDeclaration(child) ||
265
- ts.isImportDeclaration(child) ||
266
- ts.isExportDeclaration(child) ||
267
- child.kind === ts.SyntaxKind.SyntaxList) {
268
- await collectImports(child);
269
- }
270
- }
271
- }
272
- }
273
- // Start collecting imports from the source file
274
- await collectImports(sourceFile);
275
- const extractedPluginInfo = getPluginInfo(sourceFile);
276
- if (extractedPluginInfo) {
277
- pluginInfo.push(extractedPluginInfo);
278
- }
279
- // Store the tsConfigInfo on the first call if found
280
- const rootTsConfigInfo = isRoot ? tsConfigInfo : undefined;
281
- // Recursively collect all files that need to be compiled
282
- for (const importPath of importPaths) {
283
- // Pass rootTsConfigInfo down, but set isRoot to false
284
- await compileFile({
285
- inputRootDir,
286
- inputPath: importPath,
287
- outputDir,
288
- logger,
289
- transformTsConfigPathMappings,
290
- compiledFiles,
291
- isRoot: false,
292
- pluginInfo,
293
- });
294
- }
295
- // If this is the root file (the one that started the compilation),
296
- // use the TypeScript compiler API to compile all files together
297
- if (isRoot) {
298
- logger.info(`Starting compilation for ${compiledFiles.size} files...`);
299
- const allFiles = Array.from(compiledFiles);
300
- const compilerOptions = {
301
- // Base options
302
- target: ts.ScriptTarget.ES2020,
303
- module: ts.ModuleKind.CommonJS, // Output CommonJS for Node compatibility
304
- experimentalDecorators: true,
305
- emitDecoratorMetadata: true,
306
- esModuleInterop: true,
307
- skipLibCheck: true, // Faster compilation
308
- forceConsistentCasingInFileNames: true,
309
- moduleResolution: ts.ModuleResolutionKind.NodeJs, // Use Node.js module resolution
310
- incremental: false, // No need for incremental compilation
311
- noEmitOnError: false, // Continue emitting even with errors
312
- isolatedModules: true, // Treat files as separate modules
313
- strict: false, // Disable strict type checking for speed
314
- noUnusedLocals: false, // Skip unused locals check
315
- noUnusedParameters: false, // Skip unused parameters check
316
- // Output options
317
- outDir: outputDir, // Output directory for all compiled files
318
- sourceMap: false, // Generate source maps
319
- declaration: false, // Don't generate .d.ts files
320
- // Path resolution options - use info found from tsconfig
321
- baseUrl: rootTsConfigInfo ? rootTsConfigInfo.baseUrl : undefined, // Let TS handle resolution if no baseUrl
322
- paths: rootTsConfigInfo ? rootTsConfigInfo.paths : undefined,
323
- // rootDir: inputRootDir, // Often inferred correctly, can cause issues if set explicitly sometimes
324
- allowJs: true, // Allow JS files if needed, though we primarily collect TS
325
- resolveJsonModule: true, // Allow importing JSON
326
- };
327
- logger.debug(`compilerOptions: ${JSON.stringify(compilerOptions, null, 2)}`);
328
- // Create a Program to represent the compilation context
329
- const program = ts.createProgram(allFiles, compilerOptions);
330
- logger.info(`Emitting compiled files to ${outputDir}`);
331
- const emitResult = program.emit();
332
- if (reportCompilationErrors) {
333
- const hasEmitErrors = reportDiagnostics(program, emitResult, logger);
334
- if (hasEmitErrors) {
335
- throw new Error('TypeScript compilation failed with errors.');
336
- }
337
- }
338
- logger.info(`Successfully compiled ${allFiles.length} files to ${outputDir}`);
339
- }
340
- return pluginInfo;
341
- }
342
- function reportDiagnostics(program, emitResult, logger) {
343
- const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
344
- let hasEmitErrors = emitResult.emitSkipped;
345
- allDiagnostics.forEach(diagnostic => {
346
- if (diagnostic.file && diagnostic.start) {
347
- const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
348
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
349
- const logFn = diagnostic.category === ts.DiagnosticCategory.Error ? logger.warn : logger.info;
350
- // eslint-disable-next-line no-console
351
- console.log(`TS${diagnostic.code} ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
352
- if (diagnostic.category === ts.DiagnosticCategory.Error) {
353
- hasEmitErrors = true;
354
- }
355
- }
356
- else {
357
- const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
358
- const logFn = diagnostic.category === ts.DiagnosticCategory.Error ? logger.warn : logger.info;
359
- // eslint-disable-next-line no-console
360
- console.log(`TS${diagnostic.code}: ${message}`);
361
- if (diagnostic.category === ts.DiagnosticCategory.Error) {
362
- hasEmitErrors = true;
363
- }
364
- }
365
- });
366
- return hasEmitErrors;
367
- }
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Logger } from '../types.js';
2
+ export declare const debugLogger: Logger;
3
+ export declare const noopLogger: Logger;
@@ -0,0 +1,39 @@
1
+ // ANSI color codes
2
+ const colors = {
3
+ grey: '\x1b[90m',
4
+ red: '\x1b[31m',
5
+ yellow: '\x1b[33m',
6
+ reset: '\x1b[0m',
7
+ };
8
+ export const debugLogger = {
9
+ info: (message) => {
10
+ // eslint-disable-next-line no-console
11
+ console.log(`[INFO] ${message}`);
12
+ },
13
+ warn: (message) => {
14
+ // eslint-disable-next-line no-console
15
+ console.warn(`${colors.yellow}[WARN] ${message}${colors.reset}`);
16
+ },
17
+ debug: (message) => {
18
+ // eslint-disable-next-line no-console
19
+ console.debug(`${colors.grey}[DEBUG] ${message}${colors.reset}`);
20
+ },
21
+ error: (message) => {
22
+ // eslint-disable-next-line no-console
23
+ console.error(`${colors.red}[ERROR] ${message}${colors.reset}`);
24
+ },
25
+ };
26
+ export const noopLogger = {
27
+ info: () => {
28
+ /* noop */
29
+ },
30
+ warn: () => {
31
+ /* noop */
32
+ },
33
+ debug: () => {
34
+ /* noop */
35
+ },
36
+ error: () => {
37
+ /* noop */
38
+ },
39
+ };
@@ -0,0 +1,27 @@
1
+ import { Logger, PluginInfo, TransformTsConfigPathMappingsFn } from '../types.js';
2
+ import { PackageScannerConfig } from './compiler.js';
3
+ export declare function discoverPlugins({ vendureConfigPath, transformTsConfigPathMappings, logger, outputPath, pluginPackageScanner, }: {
4
+ vendureConfigPath: string;
5
+ transformTsConfigPathMappings: TransformTsConfigPathMappingsFn;
6
+ logger: Logger;
7
+ outputPath: string;
8
+ pluginPackageScanner?: PackageScannerConfig;
9
+ }): Promise<PluginInfo[]>;
10
+ /**
11
+ * Analyzes TypeScript source files starting from the config file to discover:
12
+ * 1. Local Vendure plugins
13
+ * 2. All non-local package imports that could contain plugins
14
+ */
15
+ export declare function analyzeSourceFiles(vendureConfigPath: string, logger: Logger, transformTsConfigPathMappings: TransformTsConfigPathMappingsFn): Promise<{
16
+ localPluginLocations: Map<string, string>;
17
+ packageImports: string[];
18
+ }>;
19
+ interface FindPluginFilesOptions {
20
+ outputPath: string;
21
+ vendureConfigPath: string;
22
+ logger: Logger;
23
+ packageGlobs: string[];
24
+ nodeModulesRoot?: string;
25
+ }
26
+ export declare function findVendurePluginFiles({ outputPath, vendureConfigPath, logger, nodeModulesRoot: providedNodeModulesRoot, packageGlobs, }: FindPluginFilesOptions): Promise<string[]>;
27
+ export {};